From 25b70cea9d9521b081ea0cc524f5d157a1b89baf Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 20 Dec 2012 23:49:24 +0100 Subject: autoconf: Fix the --disable-* case for the AC_ARG_ENABLE macros --disable-smpp would actually not disable SMPP but enable it. Correct it for all usages of AC_ARG_ENABLE. Move the unconditional invocation of PKG_CHECK_MODULES before the conditional one to make it work as the pkg-config m4 macro appears to expand the first usage differently and searches for the pkg-config exuable. Use "$enableval" to see if the feature should be enabled or disabled and then search for the module afterwards. --- openbsc/configure.ac | 47 ++++++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) (limited to 'openbsc/configure.ac') diff --git a/openbsc/configure.ac b/openbsc/configure.ac index 91ae08aeb..7004f96bd 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -19,46 +19,39 @@ dnl checks for libraries AC_SEARCH_LIBS(crypt, crypt, [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])]) +PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.5.3.60) +PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) +PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0) +PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.1.0) +PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.2) +# Enabke/disable the NAT? AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], - [ + [osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"]) +if test "$osmo_ac_build_nat" = "yes" ; then PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) - osmo_ac_build_nat="yes" - ], - [ - osmo_ac_build_nat="no" - ]) +fi AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") AC_SUBST(osmo_ac_build_nat) +# Enable/disable the BSC? AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], - [ - PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) - osmo_ac_build_bsc="yes" - ], - [ - osmo_ac_build_bsc="no" - ]) + [osmo_ac_build_bsc="$enableval"]) +if test "$osmo_ac_build_bsc" = "yes" ; then + PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) +fi AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") +# Enable/disable smpp support in the nitb? AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], - [ - PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10) - osmo_ac_build_smpp="yes" - AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) - ], - [ - osmo_ac_build_smpp="no" - ]) + [osmo_ac_build_smpp="$enableval"]) +if test "$osmo_ac_build_smpp" = "yes" ; then + PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10) + AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) +fi AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") -PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.5.3.60) -PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0) -PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.1.0) -PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.2) - found_libgtp=yes PKG_CHECK_MODULES(LIBGTP, libgtp, , found_libgtp=no) AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) -- cgit v1.2.3