Jonathan Santos | 03fd8d0 | 2011-05-25 13:54:02 -0400 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script |
| 2 | AC_INIT([openbsc], |
| 3 | m4_esyscmd([./git-version-gen .tarball-version]), |
| 4 | [openbsc-devel@lists.openbsc.org]) |
| 5 | |
| 6 | AM_INIT_AUTOMAKE([dist-bzip2]) |
| 7 | |
| 8 | dnl kernel style compile messages |
| 9 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 10 | |
| 11 | dnl checks for programs |
| 12 | AC_PROG_MAKE_SET |
| 13 | AC_PROG_CC |
| 14 | AC_PROG_INSTALL |
| 15 | AC_PROG_RANLIB |
| 16 | |
| 17 | dnl checks for libraries |
| 18 | AC_SEARCH_LIBS(crypt, crypt, |
| 19 | [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])]) |
| 20 | AC_SEARCH_LIBS(gtp_new, gtp, |
| 21 | [LIBCRYPT="-lgtp"; AC_SUBST([GPRS_LIBGTP], [1])]) |
| 22 | |
| 23 | AM_CONDITIONAL(HAVE_LIBGTP, test "x$GPRS_LIBGTP" != "x") |
| 24 | |
| 25 | |
| 26 | AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], |
| 27 | [ |
| 28 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) |
| 29 | osmo_ac_build_nat="yes" |
| 30 | ], |
| 31 | [ |
| 32 | osmo_ac_build_nat="no" |
| 33 | ]) |
| 34 | AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") |
| 35 | |
| 36 | AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], |
| 37 | [ |
| 38 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) |
| 39 | osmo_ac_build_bsc="yes" |
| 40 | ], |
| 41 | [ |
| 42 | osmo_ac_build_bsc="no" |
| 43 | ]) |
| 44 | AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") |
| 45 | |
| 46 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.1.30) |
| 47 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.1.28) |
| 48 | |
| 49 | dnl checks for header files |
| 50 | AC_HEADER_STDC |
| 51 | AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) |
| 52 | |
| 53 | |
| 54 | dnl Checks for typedefs, structures and compiler characteristics |
| 55 | |
| 56 | # The following test is taken from WebKit's webkit.m4 |
| 57 | saved_CFLAGS="$CFLAGS" |
| 58 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 59 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
| 60 | AC_COMPILE_IFELSE([char foo;], |
| 61 | [ AC_MSG_RESULT([yes]) |
| 62 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 63 | AC_MSG_RESULT([no])) |
| 64 | CFLAGS="$saved_CFLAGS" |
| 65 | AC_SUBST(SYMBOL_VISIBILITY) |
| 66 | |
| 67 | # Coverage build taken from WebKit's configure.in |
| 68 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 69 | AC_ARG_ENABLE(coverage, |
| 70 | AC_HELP_STRING([--enable-coverage], |
| 71 | [enable code coverage support [default=no]]), |
| 72 | [],[enable_coverage="no"]) |
| 73 | AC_MSG_RESULT([$enable_coverage]) |
| 74 | if test "$enable_coverage" = "yes"; then |
| 75 | COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs" |
| 76 | COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" |
| 77 | AC_SUBST([COVERAGE_CFLAGS]) |
| 78 | AC_SUBST([COVERAGE_LDFLAGS]) |
| 79 | fi |
| 80 | |
| 81 | |
| 82 | dnl Generate the output |
| 83 | AM_CONFIG_HEADER(bscconfig.h) |
| 84 | |
| 85 | AC_OUTPUT( |
| 86 | openbsc.pc |
| 87 | include/openbsc/Makefile |
| 88 | include/Makefile |
| 89 | src/Makefile |
| 90 | src/libtrau/Makefile |
| 91 | src/libabis/Makefile |
| 92 | src/libbsc/Makefile |
| 93 | src/libmsc/Makefile |
| 94 | src/libmgcp/Makefile |
| 95 | src/libcommon/Makefile |
| 96 | src/osmo-nitb/Makefile |
| 97 | src/osmo-bsc/Makefile |
| 98 | src/osmo-bsc_nat/Makefile |
| 99 | src/osmo-bsc_mgcp/Makefile |
| 100 | src/ipaccess/Makefile |
| 101 | src/utils/Makefile |
| 102 | src/libgb/Makefile |
| 103 | src/gprs/Makefile |
| 104 | tests/Makefile |
| 105 | tests/debug/Makefile |
| 106 | tests/gsm0408/Makefile |
| 107 | tests/db/Makefile |
| 108 | tests/channel/Makefile |
| 109 | tests/bsc-nat/Makefile |
| 110 | tests/mgcp/Makefile |
| 111 | Makefile) |