Fix configure.in to adapt to missing VoIP dependencies

- if any dependency is missing, defines HAVE_VOIPTEST=0
This commit is contained in:
Andrew Bettison 2012-04-24 13:18:00 +09:30
parent 70eb0a8cc4
commit 9bd0a15ea9

View File

@ -4,23 +4,22 @@ AC_INIT(dna.c)
dnl Set $host_os, which is needed by javac detection.
AC_CANONICAL_SYSTEM
dnl Init pkg-config
dnl Init pkg-config
PKG_PROG_PKG_CONFIG()
dnl VoIP test app
AC_ARG_ENABLE(voiptest,
AS_HELP_STRING([--disable-voiptest], [Disable VoIP test program]))
AC_ARG_ENABLE(voiptest, AS_HELP_STRING([--disable-voiptest], [Disable VoIP test program]))
pushdef([AC_MSG_ERROR], defn([AC_MSG_WARN]))
have_voip=0
AS_IF([test "x$enable_voiptest" != "xno"], [
PKG_CHECK_MODULES([PORTAUDIO], [portaudio-2.0])
PKG_CHECK_MODULES([SRC], [samplerate])
PKG_CHECK_MODULES([SPANDSP], [spandsp])
AC_CHECK_HEADERS([codec2.h])
AC_CHECK_LIB([codec2], [codec2_create], [AC_SUBST(CODEC2_LIBS, -lcodec2)])
AC_SUBST(HAVE_VOIPTEST, 1)
], [AC_SUBST(HAVE_VOIPTEST, 0)])
popdef([AC_MSG_ERROR])
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])
])
AC_SUBST([HAVE_VOIPTEST], $have_voip)
dnl Check for programs.
AC_PROG_CC
@ -33,6 +32,8 @@ AC_CHECK_HEADERS([math.h], [INSERT_MATH_HEADER="#include <math.h>"])
AC_CHECK_HEADERS([float.h])
dnl Check for a working Java compiler, keep going if unsuccessful.
dnl *** Kludge: override AC_MSG_ERROR because AC_PROG_JAVAC does not have
dnl *** [if-found] and [if-not-found] action parameters.
pushdef([AC_MSG_ERROR], defn([AC_MSG_WARN]))
AC_PROG_JAVAC
popdef([AC_MSG_ERROR])
@ -40,6 +41,8 @@ AC_SUBST([JAVAC])
dnl Check for JNI includes, keep going if not present.
if test -n "$JAVAC"; then
dnl *** Kludge: override AC_MSG_ERROR because AC_JNI_INCLUDE_DIR does not have
dnl *** [if-found] and [if-not-found] action parameters.
pushdef([AC_MSG_ERROR], defn([AC_MSG_WARN]))
AC_JNI_INCLUDE_DIR
for JNI_INCLUDE_DIR in $JNI_INCLUDE_DIRS; do