Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script |
Harald Welte | 5a29c7f | 2010-03-23 00:09:32 +0800 | [diff] [blame] | 2 | AC_INIT([openbsc], |
| 3 | m4_esyscmd([./git-version-gen .tarball-version]), |
Holger Hans Peter Freyther | 47d8f02 | 2014-05-15 12:26:16 +0200 | [diff] [blame] | 4 | [openbsc@lists.osmocom.org]) |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 5 | |
Harald Welte | 5a29c7f | 2010-03-23 00:09:32 +0800 | [diff] [blame] | 6 | AM_INIT_AUTOMAKE([dist-bzip2]) |
Holger Hans Peter Freyther | 6c88217 | 2012-01-06 15:16:12 +0100 | [diff] [blame] | 7 | AC_CONFIG_TESTDIR(tests) |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 8 | |
Holger Hans Peter Freyther | 1f59ac4 | 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 | de729a1 | 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 | 3281f6e | 2009-02-20 18:33:00 +0000 | [diff] [blame] | 16 | AC_PROG_RANLIB |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 17 | |
| 18 | dnl checks for libraries |
Holger Freyther | b424ecb | 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.])]) |
Jacob Erlbeck | 51a869c | 2013-10-15 12:00:26 +0200 | [diff] [blame] | 21 | AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""]) |
| 22 | AC_SUBST(LIBRARY_DL) |
| 23 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 24 | |
Holger Hans Peter Freyther | 8c90f47 | 2013-10-15 13:29:06 +0200 | [diff] [blame] | 25 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.6.4) |
Harald Welte | ef466d4 | 2011-05-08 09:41:45 +0200 | [diff] [blame] | 26 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) |
Harald Welte | 0ad2382 | 2014-08-21 15:56:00 +0200 | [diff] [blame] | 27 | PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl) |
| 28 | PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.7.0) |
Jacob Erlbeck | e827812 | 2014-03-31 13:42:11 +0200 | [diff] [blame] | 29 | PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.2.0) |
Holger Hans Peter Freyther | 8c90f47 | 2013-10-15 13:29:06 +0200 | [diff] [blame] | 30 | PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.6.4) |
Pablo Neira Ayuso | cab6e75 | 2014-02-05 18:56:17 +0100 | [diff] [blame] | 31 | PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.0.1) |
Harald Welte | f98a497 | 2010-02-20 17:29:27 +0100 | [diff] [blame] | 32 | |
Holger Hans Peter Freyther | 25b70ce | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 33 | # Enabke/disable the NAT? |
| 34 | AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], |
| 35 | [osmo_ac_build_nat="$enableval"],[osmo_ac_build_nat="no"]) |
| 36 | if test "$osmo_ac_build_nat" = "yes" ; then |
| 37 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) |
| 38 | fi |
| 39 | AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") |
| 40 | AC_SUBST(osmo_ac_build_nat) |
| 41 | |
| 42 | # Enable/disable the BSC? |
| 43 | AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], |
Jacob Erlbeck | 946d141 | 2013-09-17 13:59:29 +0200 | [diff] [blame] | 44 | [osmo_ac_build_bsc="$enableval"],[osmo_ac_build_bsc="no"]) |
Holger Hans Peter Freyther | 25b70ce | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 45 | if test "$osmo_ac_build_bsc" = "yes" ; then |
| 46 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) |
| 47 | fi |
| 48 | AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") |
Jacob Erlbeck | 946d141 | 2013-09-17 13:59:29 +0200 | [diff] [blame] | 49 | AC_SUBST(osmo_ac_build_bsc) |
Holger Hans Peter Freyther | 25b70ce | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 50 | |
| 51 | # Enable/disable smpp support in the nitb? |
| 52 | AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])], |
Holger Hans Peter Freyther | a7328a5 | 2013-07-13 17:09:56 +0200 | [diff] [blame] | 53 | [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"]) |
Holger Hans Peter Freyther | 25b70ce | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 54 | if test "$osmo_ac_build_smpp" = "yes" ; then |
| 55 | PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10) |
| 56 | AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP]) |
| 57 | fi |
| 58 | AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes") |
Holger Hans Peter Freyther | a7328a5 | 2013-07-13 17:09:56 +0200 | [diff] [blame] | 59 | AC_SUBST(osmo_ac_build_smpp) |
Holger Hans Peter Freyther | 25b70ce | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 60 | |
Jacob Erlbeck | 239a853 | 2014-03-13 14:25:51 +0100 | [diff] [blame] | 61 | # Enable/disable transcoding within osmo-bsc_mgcp? |
| 62 | AC_ARG_ENABLE([mgcp-transcoding], [AS_HELP_STRING([--enable-mgcp-transcoding], [Build the MGCP gateway with internal transcoding enabled.])], |
| 63 | [osmo_ac_mgcp_transcoding="$enableval"],[osmo_ac_mgcp_transcoding="no"]) |
| 64 | AC_ARG_WITH([g729], [AS_HELP_STRING([--with-g729], [Enable G.729 encoding/decoding.])], [osmo_ac_with_g729="$withval"],[osmo_ac_with_g729="no"]) |
| 65 | |
| 66 | if test "$osmo_ac_mgcp_transcoding" = "yes" ; then |
| 67 | AC_SEARCH_LIBS(gsm_create, gsm) |
| 68 | if test "$osmo_ac_with_g729" = "yes" ; then |
| 69 | PKG_CHECK_MODULES(LIBBCG729, libbcg729 >= 0.1, [AC_DEFINE([HAVE_BCG729], [1], [Use bgc729 decoder/encoder])]) |
| 70 | fi |
| 71 | AC_DEFINE(BUILD_MGCP_TRANSCODING, 1, [Define if we want to build the MGCP gateway with transcoding support]) |
| 72 | fi |
| 73 | AM_CONDITIONAL(BUILD_MGCP_TRANSCODING, test "x$osmo_ac_mgcp_transcoding" = "xyes") |
| 74 | AC_SUBST(osmo_ac_mgcp_transcoding) |
| 75 | |
Holger Hans Peter Freyther | 25b70ce | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 76 | |
Sylvain Munaut | 86aaefe | 2011-10-18 13:27:00 +0200 | [diff] [blame] | 77 | found_libgtp=yes |
| 78 | PKG_CHECK_MODULES(LIBGTP, libgtp, , found_libgtp=no) |
| 79 | AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) |
Holger Hans Peter Freyther | 68c6f88 | 2014-09-30 09:10:25 +0200 | [diff] [blame] | 80 | AC_SUBST(found_libgtp) |
Sylvain Munaut | 86aaefe | 2011-10-18 13:27:00 +0200 | [diff] [blame] | 81 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 82 | dnl checks for header files |
| 83 | AC_HEADER_STDC |
Harald Welte | ca17ef8 | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 84 | AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) |
Pablo Neira Ayuso | 5d7ad47 | 2011-03-08 13:38:49 +0100 | [diff] [blame] | 85 | AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) |
Harald Welte | ca17ef8 | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 86 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 87 | |
| 88 | dnl Checks for typedefs, structures and compiler characteristics |
| 89 | |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 90 | # The following test is taken from WebKit's webkit.m4 |
| 91 | saved_CFLAGS="$CFLAGS" |
| 92 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 93 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
Alexander Huemer | db1bd69 | 2011-05-24 15:16:54 +0200 | [diff] [blame] | 94 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 95 | [ AC_MSG_RESULT([yes]) |
| 96 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 97 | AC_MSG_RESULT([no])) |
| 98 | CFLAGS="$saved_CFLAGS" |
| 99 | AC_SUBST(SYMBOL_VISIBILITY) |
| 100 | |
Holger Hans Peter Freyther | ecd94a4 | 2010-11-15 18:37:57 +0100 | [diff] [blame] | 101 | # Coverage build taken from WebKit's configure.in |
| 102 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 103 | AC_ARG_ENABLE(coverage, |
| 104 | AC_HELP_STRING([--enable-coverage], |
| 105 | [enable code coverage support [default=no]]), |
| 106 | [],[enable_coverage="no"]) |
| 107 | AC_MSG_RESULT([$enable_coverage]) |
| 108 | if test "$enable_coverage" = "yes"; then |
| 109 | COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs" |
| 110 | COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" |
| 111 | AC_SUBST([COVERAGE_CFLAGS]) |
| 112 | AC_SUBST([COVERAGE_LDFLAGS]) |
| 113 | fi |
| 114 | |
Harald Welte | 9c3dc90 | 2012-04-08 16:59:24 +0200 | [diff] [blame] | 115 | AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ |
| 116 | AC_CACHE_CHECK( |
| 117 | [whether struct tm has tm_gmtoff member], |
| 118 | osmo_cv_tm_includes_tm_gmtoff, |
| 119 | [AC_LINK_IFELSE([ |
| 120 | AC_LANG_PROGRAM([ |
| 121 | #include <time.h> |
| 122 | ], [ |
| 123 | time_t t = time(NULL); |
| 124 | struct tm* lt = localtime(&t); |
| 125 | int off = lt->tm_gmtoff; |
| 126 | ]) |
| 127 | ], |
| 128 | osmo_cv_tm_includes_tm_gmtoff=yes, |
| 129 | osmo_cv_tm_includes_tm_gmtoff=no |
| 130 | )] |
| 131 | ) |
| 132 | if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then |
| 133 | AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1, |
| 134 | [Define if struct tm has tm_gmtoff member.]) |
| 135 | fi |
| 136 | ]) |
| 137 | |
| 138 | CHECK_TM_INCLUDES_TM_GMTOFF |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 139 | |
Katerina Barone-Adesi | e0aee7a | 2013-04-05 17:36:09 +0200 | [diff] [blame] | 140 | AC_ARG_ENABLE([vty_tests], |
| 141 | AC_HELP_STRING([--enable-vty-tests], |
Holger Hans Peter Freyther | dd588ae | 2014-08-22 00:29:04 +0200 | [diff] [blame] | 142 | [Include the VTY/CTRL tests in make check (deprecated) |
| 143 | [default=no]]), |
| 144 | [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) |
Pablo Neira Ayuso | 9224010 | 2014-09-01 09:34:07 +0200 | [diff] [blame] | 145 | AC_ARG_ENABLE([external_tests], |
Holger Hans Peter Freyther | dd588ae | 2014-08-22 00:29:04 +0200 | [diff] [blame] | 146 | AC_HELP_STRING([--enable-external-tests], |
| 147 | [Include the VTY/CTRL tests in make check [default=no]]), |
| 148 | [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) |
| 149 | if test "x$enable_ext_tests" = "xyes" ; then |
Katerina Barone-Adesi | e0aee7a | 2013-04-05 17:36:09 +0200 | [diff] [blame] | 150 | AM_PATH_PYTHON |
Holger Hans Peter Freyther | dd588ae | 2014-08-22 00:29:04 +0200 | [diff] [blame] | 151 | AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) |
| 152 | if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then |
| 153 | AC_MSG_ERROR([Please install osmocom-python to run the VTY/CTRL tests.]) |
Katerina Barone-Adesi | e0aee7a | 2013-04-05 17:36:09 +0200 | [diff] [blame] | 154 | fi |
| 155 | fi |
Holger Hans Peter Freyther | dd588ae | 2014-08-22 00:29:04 +0200 | [diff] [blame] | 156 | AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) |
| 157 | AC_MSG_RESULT([$enable_ext_tests]) |
| 158 | AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes") |
Katerina Barone-Adesi | e0aee7a | 2013-04-05 17:36:09 +0200 | [diff] [blame] | 159 | |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 160 | dnl Generate the output |
| 161 | AM_CONFIG_HEADER(bscconfig.h) |
| 162 | |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 163 | AC_OUTPUT( |
Holger Freyther | c7aa3c4 | 2009-06-08 10:32:39 +0000 | [diff] [blame] | 164 | openbsc.pc |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 165 | include/openbsc/Makefile |
| 166 | include/Makefile |
| 167 | src/Makefile |
Harald Welte | 89579b4 | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 168 | src/libtrau/Makefile |
Harald Welte | 89579b4 | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 169 | src/libbsc/Makefile |
| 170 | src/libmsc/Makefile |
| 171 | src/libmgcp/Makefile |
| 172 | src/libcommon/Makefile |
Harald Welte | 31c00f7 | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 173 | src/osmo-nitb/Makefile |
| 174 | src/osmo-bsc/Makefile |
Harald Welte | a17faf8 | 2011-03-03 23:36:48 +0100 | [diff] [blame] | 175 | src/osmo-bsc_nat/Makefile |
| 176 | src/osmo-bsc_mgcp/Makefile |
Harald Welte | 31c00f7 | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 177 | src/ipaccess/Makefile |
| 178 | src/utils/Makefile |
| 179 | src/gprs/Makefile |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 180 | tests/Makefile |
Holger Hans Peter Freyther | 93ef33e | 2012-01-09 22:53:04 +0100 | [diff] [blame] | 181 | tests/atlocal |
Holger Freyther | aa0fb36 | 2008-12-28 21:55:40 +0000 | [diff] [blame] | 182 | tests/gsm0408/Makefile |
Holger Freyther | dbede4e | 2008-12-31 23:25:05 +0000 | [diff] [blame] | 183 | tests/db/Makefile |
Holger Hans Peter Freyther | 800d29d | 2009-06-10 12:36:38 +0200 | [diff] [blame] | 184 | tests/channel/Makefile |
Jacob Erlbeck | 946d141 | 2013-09-17 13:59:29 +0200 | [diff] [blame] | 185 | tests/bsc/Makefile |
Holger Hans Peter Freyther | 28e2988 | 2010-06-15 20:21:44 +0800 | [diff] [blame] | 186 | tests/bsc-nat/Makefile |
Holger Hans Peter Freyther | 85d3b34 | 2013-06-14 19:10:28 +0200 | [diff] [blame] | 187 | tests/bsc-nat-trie/Makefile |
Holger Hans Peter Freyther | 9f239a2 | 2011-01-06 19:32:52 +0100 | [diff] [blame] | 188 | tests/mgcp/Makefile |
Holger Hans Peter Freyther | faf1f64 | 2011-06-23 17:53:27 -0400 | [diff] [blame] | 189 | tests/gprs/Makefile |
Jacob Erlbeck | 51a869c | 2013-10-15 12:00:26 +0200 | [diff] [blame] | 190 | tests/gbproxy/Makefile |
Holger Hans Peter Freyther | bce5675 | 2012-11-22 14:59:46 +0100 | [diff] [blame] | 191 | tests/abis/Makefile |
Holger Hans Peter Freyther | a7328a5 | 2013-07-13 17:09:56 +0200 | [diff] [blame] | 192 | tests/smpp/Makefile |
Andreas Eversberg | d074f8f | 2013-12-06 16:59:10 +0100 | [diff] [blame] | 193 | tests/trau/Makefile |
Holger Hans Peter Freyther | 68c6f88 | 2014-09-30 09:10:25 +0200 | [diff] [blame] | 194 | tests/sgsn/Makefile |
Harald Welte | eb11313 | 2011-05-11 22:11:28 +0200 | [diff] [blame] | 195 | doc/Makefile |
| 196 | doc/examples/Makefile |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 197 | Makefile) |