2012-03-14 22:54:31 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_INIT(dna.c)
|
|
|
|
|
2012-04-23 05:58:00 +00:00
|
|
|
dnl Set $host_os, which is needed by javac detection.
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
|
2012-04-23 02:35:00 +00:00
|
|
|
dnl Check for programs.
|
2012-03-14 22:54:31 +00:00
|
|
|
AC_PROG_CC
|
2012-04-23 02:35:00 +00:00
|
|
|
|
|
|
|
dnl Check for a working Java compiler, keep going if unsuccessful.
|
|
|
|
pushdef([AC_MSG_ERROR], defn([AC_MSG_WARN]))
|
2012-04-20 07:27:36 +00:00
|
|
|
AC_PROG_JAVAC
|
2012-04-23 02:35:00 +00:00
|
|
|
popdef([AC_MSG_ERROR])
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-04-23 02:35:00 +00:00
|
|
|
dnl Check for JNI includes, keep going if not present.
|
|
|
|
pushdef([AC_MSG_ERROR], defn([AC_MSG_WARN]))
|
|
|
|
AC_JNI_INCLUDE_DIR
|
|
|
|
for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS; do
|
2012-04-23 05:58:00 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
|
2012-04-23 02:35:00 +00:00
|
|
|
done
|
|
|
|
popdef([AC_MSG_ERROR])
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-04-23 02:35:00 +00:00
|
|
|
AC_CHECK_LIB(c,srandomdev)
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-04-23 02:35:00 +00:00
|
|
|
AC_CHECK_HEADERS(stdio.h errno.h stdlib.h strings.h unistd.h string.h arpa/inet.h sys/socket.h sys/mman.h sys/time.h poll.h netdb.h linux/if.h linux/netlink.h linux/rtnetlink.h net/if.h netinet/in.h ifaddrs.h net/route.h signal.h jni.h)
|
2012-04-20 07:27:36 +00:00
|
|
|
|
2012-03-14 22:54:31 +00:00
|
|
|
echo "Fetching and building NaCl if required."
|
|
|
|
echo "(this can take HOURS to build depending on your architecture,"
|
|
|
|
echo " but fortunately it only needs to happen once.)"
|
2012-03-16 23:07:00 +00:00
|
|
|
cd nacl
|
2012-03-14 22:54:31 +00:00
|
|
|
./nacl-gcc-prep
|
2012-03-16 23:07:00 +00:00
|
|
|
cd ..
|
2012-04-03 01:03:21 +00:00
|
|
|
CFLAGS="$CFLAGS -Inacl/"`cat nacl/naclinc.txt`
|
|
|
|
LDFLAGS="$LDFLAGS nacl/"`cat nacl/nacllib.txt`
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-04-03 01:03:21 +00:00
|
|
|
AC_CHECK_LIB(m,sqrtf,[LDFLAGS="$LDFLAGS -lm"])
|
2012-03-14 22:54:31 +00:00
|
|
|
AC_CHECK_LIB(nsl,callrpc,[LDFLAGS="$LDFLAGS -lnsl"])
|
|
|
|
AC_CHECK_LIB(socket,socket,[LDFLAGS="$LDFLAGS -lsocket"])
|
2012-04-03 01:03:21 +00:00
|
|
|
AC_CHECK_LIB(dl,dlopen,[LDFLAGS="$LDFLAGS -ldl"])
|
|
|
|
AC_CHECK_LIB(pthread,pthread_create,[LDFLAGS="$LDFLAGS -lpthread"])
|
2012-04-22 22:07:25 +00:00
|
|
|
AC_CHECK_LIB(portaudio,Pa_Terminate,[LDFLAGS="$LDFLAGS -lportaudio"; CFLAGS="$CFLAGS -DWITH_PORTAUDIO"])
|
2012-03-14 22:54:31 +00:00
|
|
|
|
|
|
|
AC_OUTPUT(Makefile)
|