Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script |
Harald Welte | fa13cad | 2010-03-23 00:09:32 +0800 | [diff] [blame] | 2 | AC_INIT([openbsc], |
| 3 | m4_esyscmd([./git-version-gen .tarball-version]), |
| 4 | [openbsc-devel@lists.openbsc.org]) |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 5 | |
Harald Welte | fa13cad | 2010-03-23 00:09:32 +0800 | [diff] [blame] | 6 | AM_INIT_AUTOMAKE([dist-bzip2]) |
Holger Hans Peter Freyther | fee826b | 2012-01-06 15:16:12 +0100 | [diff] [blame] | 7 | AC_CONFIG_TESTDIR(tests) |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 8 | |
Holger Hans Peter Freyther | c746e68 | 2009-10-27 03:34:49 +0100 | [diff] [blame] | 9 | dnl kernel style compile messages |
| 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 11 | |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 12 | dnl checks for programs |
| 13 | AC_PROG_MAKE_SET |
| 14 | AC_PROG_CC |
| 15 | AC_PROG_INSTALL |
Holger Freyther | 91f49f6 | 2009-02-20 18:33:00 +0000 | [diff] [blame] | 16 | AC_PROG_RANLIB |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 17 | |
| 18 | dnl checks for libraries |
Holger Freyther | 559bb71 | 2009-06-08 10:32:28 +0000 | [diff] [blame] | 19 | AC_SEARCH_LIBS(crypt, crypt, |
| 20 | [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])]) |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 21 | |
Holger Hans Peter Freyther | d728eb0 | 2012-12-19 16:18:44 +0100 | [diff] [blame] | 22 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.5.3.60) |
Harald Welte | 4d109ff | 2011-05-08 09:41:45 +0200 | [diff] [blame] | 23 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) |
Harald Welte | f243cb9 | 2013-03-13 15:29:27 +0100 | [diff] [blame] | 24 | PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.6.0) |
Harald Welte | 3386bdc | 2011-10-10 09:11:29 +0200 | [diff] [blame] | 25 | PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.1.0) |
Holger Hans Peter Freyther | b6f053c | 2012-08-03 10:01:57 +0200 | [diff] [blame] | 26 | PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.2) |
Harald Welte | 9c38ed6 | 2010-02-20 17:29:27 +0100 | [diff] [blame] | 27 | |
Holger Hans Peter Freyther | 61c586c | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 28 | # Enabke/disable the NAT? |
| 29 | AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], |
| 30 | [osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"]) |
| 31 | if test "$osmo_ac_build_nat" = "yes" ; then |
| 32 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) |
| 33 | fi |
| 34 | AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") |
| 35 | AC_SUBST(osmo_ac_build_nat) |
| 36 | |
| 37 | # Enable/disable the BSC? |
| 38 | AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], |
Jacob Erlbeck | cc0d884 | 2013-09-17 13:59:29 +0200 | [diff] [blame] | 39 | [osmo_ac_build_bsc="$enableval"],[osmo_ac_build_bsc="no"]) |
Holger Hans Peter Freyther | 61c586c | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 40 | if test "$osmo_ac_build_bsc" = "yes" ; then |
| 41 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) |
| 42 | fi |
| 43 | AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") |
Jacob Erlbeck | cc0d884 | 2013-09-17 13:59:29 +0200 | [diff] [blame] | 44 | AC_SUBST(osmo_ac_build_bsc) |
Holger Hans Peter Freyther | 61c586c | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 45 | |
| 46 | # Enable/disable smpp support in the nitb? |
| 47 | AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], |
Holger Hans Peter Freyther | 5292edc | 2013-07-13 17:09:56 +0200 | [diff] [blame] | 48 | [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) |
Holger Hans Peter Freyther | 61c586c | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 49 | if test "$osmo_ac_build_smpp" = "yes" ; then |
| 50 | PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10) |
| 51 | AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) |
| 52 | fi |
| 53 | AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") |
Holger Hans Peter Freyther | 5292edc | 2013-07-13 17:09:56 +0200 | [diff] [blame] | 54 | AC_SUBST(osmo_ac_build_smpp) |
Holger Hans Peter Freyther | 61c586c | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 55 | |
| 56 | |
Sylvain Munaut | f4b4e8f | 2011-10-18 13:27:00 +0200 | [diff] [blame] | 57 | found_libgtp=yes |
| 58 | PKG_CHECK_MODULES(LIBGTP, libgtp, , found_libgtp=no) |
| 59 | AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) |
| 60 | |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 61 | dnl checks for header files |
| 62 | AC_HEADER_STDC |
Harald Welte | c7841cc | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 63 | AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) |
Pablo Neira Ayuso | f58692f | 2011-03-08 13:38:49 +0100 | [diff] [blame] | 64 | AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) |
Harald Welte | c7841cc | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 65 | |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 66 | |
| 67 | dnl Checks for typedefs, structures and compiler characteristics |
| 68 | |
Holger Freyther | 64026e9 | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 69 | # The following test is taken from WebKit's webkit.m4 |
| 70 | saved_CFLAGS="$CFLAGS" |
| 71 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 72 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
Alexander Huemer | 93ae2d6 | 2011-05-24 15:16:54 +0200 | [diff] [blame] | 73 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], |
Holger Freyther | 64026e9 | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 74 | [ AC_MSG_RESULT([yes]) |
| 75 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 76 | AC_MSG_RESULT([no])) |
| 77 | CFLAGS="$saved_CFLAGS" |
| 78 | AC_SUBST(SYMBOL_VISIBILITY) |
| 79 | |
Holger Hans Peter Freyther | 16bdb14 | 2010-11-15 18:37:57 +0100 | [diff] [blame] | 80 | # Coverage build taken from WebKit's configure.in |
| 81 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 82 | AC_ARG_ENABLE(coverage, |
| 83 | AC_HELP_STRING([--enable-coverage], |
| 84 | [enable code coverage support [default=no]]), |
| 85 | [],[enable_coverage="no"]) |
| 86 | AC_MSG_RESULT([$enable_coverage]) |
| 87 | if test "$enable_coverage" = "yes"; then |
| 88 | COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs" |
| 89 | COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" |
| 90 | AC_SUBST([COVERAGE_CFLAGS]) |
| 91 | AC_SUBST([COVERAGE_LDFLAGS]) |
| 92 | fi |
| 93 | |
Harald Welte | eaf4a52 | 2012-04-08 16:59:24 +0200 | [diff] [blame] | 94 | AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ |
| 95 | AC_CACHE_CHECK( |
| 96 | [whether struct tm has tm_gmtoff member], |
| 97 | osmo_cv_tm_includes_tm_gmtoff, |
| 98 | [AC_LINK_IFELSE([ |
| 99 | AC_LANG_PROGRAM([ |
| 100 | #include <time.h> |
| 101 | ], [ |
| 102 | time_t t = time(NULL); |
| 103 | struct tm* lt = localtime(&t); |
| 104 | int off = lt->tm_gmtoff; |
| 105 | ]) |
| 106 | ], |
| 107 | osmo_cv_tm_includes_tm_gmtoff=yes, |
| 108 | osmo_cv_tm_includes_tm_gmtoff=no |
| 109 | )] |
| 110 | ) |
| 111 | if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then |
| 112 | AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1, |
| 113 | [Define if struct tm has tm_gmtoff member.]) |
| 114 | fi |
| 115 | ]) |
| 116 | |
| 117 | CHECK_TM_INCLUDES_TM_GMTOFF |
Holger Freyther | 64026e9 | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 118 | |
Katerina Barone-Adesi | ad5fb00 | 2013-04-05 17:36:09 +0200 | [diff] [blame] | 119 | AC_ARG_ENABLE([vty_tests], |
| 120 | AC_HELP_STRING([--enable-vty-tests], |
| 121 | [Include the VTY tests in make check [default=no]]), |
| 122 | [enable_vty_tests="$enableval"],[enable_vty_tests="no"]) |
| 123 | if test "x$enable_vty_tests" = "xyes" ; then |
| 124 | AM_PATH_PYTHON |
| 125 | AC_CHECK_PROG(OSMOTESTVTY_CHECK,osmotestvty.py,yes) |
| 126 | if test "x$OSMOTESTVTY_CHECK" != "xyes" ; then |
| 127 | AC_MSG_ERROR([Please install osmocom-python to run the vty tests.]) |
| 128 | fi |
| 129 | fi |
| 130 | AC_MSG_CHECKING([whether to enable VTY tests]) |
| 131 | AC_MSG_RESULT([$enable_vty_tests]) |
| 132 | AM_CONDITIONAL(ENABLE_VTY_TESTS, test "x$enable_vty_tests" = "xyes") |
| 133 | |
Holger Freyther | 64026e9 | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 134 | dnl Generate the output |
| 135 | AM_CONFIG_HEADER(bscconfig.h) |
| 136 | |
Holger Freyther | 1bad601 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 137 | AC_OUTPUT( |
Holger Freyther | b27d845 | 2009-06-08 10:32:39 +0000 | [diff] [blame] | 138 | openbsc.pc |
Holger Freyther | 1bad601 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 139 | include/openbsc/Makefile |
| 140 | include/Makefile |
| 141 | src/Makefile |
Harald Welte | 3d1aaac | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 142 | src/libtrau/Makefile |
Harald Welte | 3d1aaac | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 143 | src/libbsc/Makefile |
Daniel Willmann | 27da244 | 2010-10-21 15:00:36 +0200 | [diff] [blame] | 144 | src/libctrl/Makefile |
Harald Welte | 3d1aaac | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 145 | src/libmsc/Makefile |
| 146 | src/libmgcp/Makefile |
| 147 | src/libcommon/Makefile |
Harald Welte | 4f272cc | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 148 | src/osmo-nitb/Makefile |
| 149 | src/osmo-bsc/Makefile |
Harald Welte | acdcfea | 2011-03-03 23:36:48 +0100 | [diff] [blame] | 150 | src/osmo-bsc_nat/Makefile |
| 151 | src/osmo-bsc_mgcp/Makefile |
Harald Welte | 4f272cc | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 152 | src/ipaccess/Makefile |
| 153 | src/utils/Makefile |
| 154 | src/gprs/Makefile |
Holger Freyther | 1bad601 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 155 | tests/Makefile |
Holger Hans Peter Freyther | 34abf21 | 2012-01-09 22:53:04 +0100 | [diff] [blame] | 156 | tests/atlocal |
Holger Freyther | ec5b1d8 | 2008-12-28 21:55:40 +0000 | [diff] [blame] | 157 | tests/gsm0408/Makefile |
Holger Freyther | c1e1192 | 2008-12-31 23:25:05 +0000 | [diff] [blame] | 158 | tests/db/Makefile |
Holger Hans Peter Freyther | f8584a1 | 2009-06-10 12:36:38 +0200 | [diff] [blame] | 159 | tests/channel/Makefile |
Jacob Erlbeck | cc0d884 | 2013-09-17 13:59:29 +0200 | [diff] [blame] | 160 | tests/bsc/Makefile |
Holger Hans Peter Freyther | 4dfa08d | 2010-06-15 20:21:44 +0800 | [diff] [blame] | 161 | tests/bsc-nat/Makefile |
Holger Hans Peter Freyther | aaa3d08 | 2013-06-14 19:10:28 +0200 | [diff] [blame] | 162 | tests/bsc-nat-trie/Makefile |
Holger Hans Peter Freyther | f0bc075 | 2011-01-06 19:32:52 +0100 | [diff] [blame] | 163 | tests/mgcp/Makefile |
Holger Hans Peter Freyther | 6721a08 | 2011-06-23 17:53:27 -0400 | [diff] [blame] | 164 | tests/gprs/Makefile |
Holger Hans Peter Freyther | a9e7de6 | 2012-10-13 12:38:54 +0200 | [diff] [blame] | 165 | tests/si/Makefile |
Holger Hans Peter Freyther | 23e8000 | 2012-11-22 14:59:46 +0100 | [diff] [blame] | 166 | tests/abis/Makefile |
Holger Hans Peter Freyther | 5292edc | 2013-07-13 17:09:56 +0200 | [diff] [blame] | 167 | tests/smpp/Makefile |
Harald Welte | 2d6f49d | 2011-05-11 22:11:28 +0200 | [diff] [blame] | 168 | doc/Makefile |
| 169 | doc/examples/Makefile |
Holger Freyther | 1bad601 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 170 | Makefile) |