From 4e9b35160ec6a37a49f98de39881b46d38e5897e Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Tue, 24 Apr 2012 13:56:11 +0930 Subject: [PATCH] Improve configure.in VoIP options: - if --disable-voiptest is given, does not test for VoIP headers and libraries, and sets HAVE_VOIPTEST=0 (as before) - if --enable-voiptest is given, tests for VoIP headers and libraries, and fails with an error if any are missing - if neither option is given, behaviour is opportunistic: tests for VoIP headers and libraries and sets HAVE_VOIPTEST accordingly --- configure.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 1bf78fc6..463fa299 100644 --- a/configure.in +++ b/configure.in @@ -8,7 +8,10 @@ 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([--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' +) have_voip=0 AS_IF([test "x$enable_voiptest" != "xno"], [ @@ -19,6 +22,9 @@ AS_IF([test "x$enable_voiptest" != "xno"], [ AC_CHECK_HEADER([codec2.h],, [have_voip=0]) AC_CHECK_LIB([codec2], [codec2_create], [AC_SUBST(CODEC2_LIBS, -lcodec2)], [have_voip=0]) ]) +AS_IF([test "x$enable_voiptest" = "xyes" -a "x$have_voip" != "x1" ], [ + AC_MSG_ERROR([Missing VoIP dependencies]) +]) AC_SUBST([HAVE_VOIPTEST], $have_voip) dnl Check for programs.