2012-03-14 22:54:31 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
2012-07-27 02:14:20 +00:00
|
|
|
AC_INIT(servald, 0.9)
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-05-21 02:52:50 +00:00
|
|
|
CPPFLAGS=-D_GNU_SOURCE
|
|
|
|
|
2012-04-23 05:58:00 +00:00
|
|
|
dnl Set $host_os, which is needed by javac detection.
|
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
|
2012-04-24 03:48:00 +00:00
|
|
|
dnl Init pkg-config
|
2012-04-23 10:47:11 +00:00
|
|
|
PKG_PROG_PKG_CONFIG()
|
|
|
|
|
|
|
|
dnl VoIP test app
|
2012-04-24 04:26:11 +00:00
|
|
|
AC_ARG_ENABLE(voiptest,
|
|
|
|
AS_HELP_STRING([--enable-voiptest], [Require VoIP test program (default: only build if dependencies are present)])
|
|
|
|
AS_HELP_STRING([--disable-voiptest], [Disable VoIP test program (don't test for dependencies)])dnl'
|
|
|
|
)
|
2012-04-23 10:47:11 +00:00
|
|
|
|
2012-04-24 03:48:00 +00:00
|
|
|
have_voip=0
|
2012-04-23 10:47:11 +00:00
|
|
|
AS_IF([test "x$enable_voiptest" != "xno"], [
|
2012-04-24 03:48:00 +00:00
|
|
|
have_voip=1
|
|
|
|
PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0],,[have_voip=0])
|
|
|
|
PKG_CHECK_MODULES([SRC], [samplerate],,[have_voip=0])
|
|
|
|
PKG_CHECK_MODULES([SPANDSP], [spandsp],,[have_voip=0])
|
|
|
|
AC_CHECK_HEADER([codec2.h],, [have_voip=0])
|
|
|
|
AC_CHECK_LIB([codec2], [codec2_create], [AC_SUBST(CODEC2_LIBS, -lcodec2)], [have_voip=0])
|
|
|
|
])
|
2012-04-24 04:26:11 +00:00
|
|
|
AS_IF([test "x$enable_voiptest" = "xyes" -a "x$have_voip" != "x1" ], [
|
|
|
|
AC_MSG_ERROR([Missing VoIP dependencies])
|
|
|
|
])
|
2012-04-24 03:48:00 +00:00
|
|
|
AC_SUBST([HAVE_VOIPTEST], $have_voip)
|
2012-04-23 10:47:11 +00:00
|
|
|
|
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
|
|
|
|
2012-04-23 10:47:11 +00:00
|
|
|
dnl Threading
|
|
|
|
ACX_PTHREAD()
|
|
|
|
|
|
|
|
dnl Math library functions for spandsp
|
|
|
|
AC_CHECK_HEADERS([math.h], [INSERT_MATH_HEADER="#include <math.h>"])
|
|
|
|
AC_CHECK_HEADERS([float.h])
|
|
|
|
|
2012-04-23 02:35:00 +00:00
|
|
|
dnl Check for a working Java compiler, keep going if unsuccessful.
|
2012-04-24 03:48:00 +00:00
|
|
|
dnl *** Kludge: override AC_MSG_ERROR because AC_PROG_JAVAC does not have
|
|
|
|
dnl *** [if-found] and [if-not-found] action parameters.
|
2012-04-23 02:35:00 +00:00
|
|
|
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-04-23 08:55:26 +00:00
|
|
|
AC_SUBST([JAVAC])
|
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.
|
2012-04-23 08:55:26 +00:00
|
|
|
if test -n "$JAVAC"; then
|
2012-04-24 03:48:00 +00:00
|
|
|
dnl *** Kludge: override AC_MSG_ERROR because AC_JNI_INCLUDE_DIR does not have
|
|
|
|
dnl *** [if-found] and [if-not-found] action parameters.
|
2012-04-23 08:55:26 +00:00
|
|
|
pushdef([AC_MSG_ERROR], defn([AC_MSG_WARN]))
|
|
|
|
AC_JNI_INCLUDE_DIR
|
|
|
|
for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS; do
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$JNI_INCLUDE_DIR"
|
|
|
|
done
|
|
|
|
popdef([AC_MSG_ERROR])
|
|
|
|
fi
|
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-05-10 08:59:27 +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 \
|
2012-05-21 02:52:50 +00:00
|
|
|
sys/ucred.h \
|
2012-05-10 08:59:27 +00:00
|
|
|
poll.h \
|
|
|
|
netdb.h \
|
|
|
|
linux/if.h \
|
2012-05-21 02:52:50 +00:00
|
|
|
linux/ioctl.h \
|
2012-05-10 08:59:27 +00:00
|
|
|
linux/netlink.h \
|
|
|
|
linux/rtnetlink.h \
|
|
|
|
net/if.h \
|
|
|
|
netinet/in.h \
|
|
|
|
ifaddrs.h \
|
|
|
|
net/route.h \
|
|
|
|
signal.h \
|
|
|
|
jni.h \
|
|
|
|
alsa/asoundlib.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-05-16 01:52:10 +00:00
|
|
|
NACL_INC=`cat nacl/naclinc.txt`
|
|
|
|
NACL_LIB=`cat nacl/nacllib.txt`
|
|
|
|
CPPFLAGS="$CPPFLAGS -Inacl/$NACL_INC"
|
|
|
|
LDFLAGS="$LDFLAGS nacl/$NACL_LIB"
|
|
|
|
AC_CHECK_HEADER(crypto_sign_edwards25519sha512batch_ref/ge25519.h,
|
|
|
|
AC_DEFINE([HAVE_CRYPTO_SIGN_NACL_GE25519_H]),
|
|
|
|
[
|
|
|
|
dnl A kludge to get to the NaCl ge25519 functions, which are not included in the public API
|
|
|
|
dnl in a native build (but are available in the Android build).
|
|
|
|
oCPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS -Inacl/$NACL_INC -Inacl/${NACL_INC%%/*}/crypto_sign"
|
|
|
|
AC_CHECK_HEADER([edwards25519sha512batch/ref/ge25519.h],
|
|
|
|
AC_DEFINE([HAVE_KLUDGE_NACL_GE25519_H]),
|
|
|
|
CPPFLAGS="$oCPPFLAGS"
|
|
|
|
)
|
|
|
|
]
|
|
|
|
)
|
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"])
|
2012-04-23 10:47:11 +00:00
|
|
|
|
|
|
|
dnl Some platforms still seem to lack the basic single precision trig and power related function.
|
|
|
|
AC_SEARCH_LIBS([sinf], [m], AC_DEFINE([HAVE_SINF], [1], [Define to 1 if you have the sinf() function.]))
|
|
|
|
AC_SEARCH_LIBS([cosf], [m], AC_DEFINE([HAVE_COSF], [1], [Define to 1 if you have the cosf() function.]))
|
|
|
|
AC_SEARCH_LIBS([tanf], [m], AC_DEFINE([HAVE_TANF], [1], [Define to 1 if you have the tanf() function.]))
|
|
|
|
AC_SEARCH_LIBS([asinf], [m], AC_DEFINE([HAVE_ASINF], [1], [Define to 1 if you have the asinf() function.]))
|
|
|
|
AC_SEARCH_LIBS([acosf], [m], AC_DEFINE([HAVE_ACOSF], [1], [Define to 1 if you have the acosf() function.]))
|
|
|
|
AC_SEARCH_LIBS([atanf], [m], AC_DEFINE([HAVE_ATANF], [1], [Define to 1 if you have the atanf() function.]))
|
|
|
|
AC_SEARCH_LIBS([atan2f], [m], AC_DEFINE([HAVE_ATAN2F], [1], [Define to 1 if you have the atan2f() function.]))
|
|
|
|
AC_SEARCH_LIBS([ceilf], [m], AC_DEFINE([HAVE_CEILF], [1], [Define to 1 if you have the ceilf() function.]))
|
|
|
|
AC_SEARCH_LIBS([floorf], [m], AC_DEFINE([HAVE_FLOORF], [1], [Define to 1 if you have the floorf() function.]))
|
|
|
|
AC_SEARCH_LIBS([powf], [m], AC_DEFINE([HAVE_POWF], [1], [Define to 1 if you have the powf() function.]))
|
|
|
|
AC_SEARCH_LIBS([expf], [m], AC_DEFINE([HAVE_EXPF], [1], [Define to 1 if you have the expf() function.]))
|
|
|
|
AC_SEARCH_LIBS([logf], [m], AC_DEFINE([HAVE_LOGF], [1], [Define to 1 if you have the logf() function.]))
|
|
|
|
AC_SEARCH_LIBS([log10f], [m], AC_DEFINE([HAVE_LOG10F], [1], [Define to 1 if you have the log10f() function.]))
|
2012-03-14 22:54:31 +00:00
|
|
|
|
2012-08-13 08:52:17 +00:00
|
|
|
dnl Check for strlcpy (eg Ubuntu)
|
|
|
|
AC_SEARCH_LIBS([strlcpy], [], AC_DEFINE([HAVE_STRLCPY], [1], [Define to 1 if you have the strlcpy() function.]))
|
|
|
|
|
2012-04-23 08:55:26 +00:00
|
|
|
AC_OUTPUT([
|
|
|
|
Makefile
|
|
|
|
testconfig.sh
|
|
|
|
])
|