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
This commit is contained in:
Andrew Bettison 2012-04-24 13:56:11 +09:30
parent 9bd0a15ea9
commit 4e9b35160e

View File

@ -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.