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 | 630df7d | 2017-09-03 22:29:45 +0200 | [diff] [blame] | 2 | AC_INIT([osmo-bsc], |
Harald Welte | 5a29c7f | 2010-03-23 00:09:32 +0800 | [diff] [blame] | 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 | |
Neels Hofmeyr | b810312 | 2016-10-01 00:34:31 +0200 | [diff] [blame] | 6 | dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ |
| 7 | AC_CONFIG_AUX_DIR([.]) |
| 8 | |
Harald Welte | 5a29c7f | 2010-03-23 00:09:32 +0800 | [diff] [blame] | 9 | AM_INIT_AUTOMAKE([dist-bzip2]) |
Holger Hans Peter Freyther | 6c88217 | 2012-01-06 15:16:12 +0100 | [diff] [blame] | 10 | AC_CONFIG_TESTDIR(tests) |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 11 | |
Holger Hans Peter Freyther | 1f59ac4 | 2009-10-27 03:34:49 +0100 | [diff] [blame] | 12 | dnl kernel style compile messages |
| 13 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 14 | |
Max | 88d8bcb | 2017-08-28 12:04:18 +0200 | [diff] [blame] | 15 | dnl include release helper |
| 16 | RELMAKE='-include osmo-release.mk' |
| 17 | AC_SUBST([RELMAKE]) |
| 18 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 19 | dnl checks for programs |
| 20 | AC_PROG_MAKE_SET |
| 21 | AC_PROG_CC |
| 22 | AC_PROG_INSTALL |
Max | eab5f59 | 2017-05-26 12:31:00 +0200 | [diff] [blame] | 23 | LT_INIT |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 24 | |
Neels Hofmeyr | a8f91df | 2016-10-01 00:50:25 +0200 | [diff] [blame] | 25 | dnl check for pkg-config (explained in detail in libosmocore/configure.ac) |
| 26 | AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) |
| 27 | if test "x$PKG_CONFIG_INSTALLED" = "xno"; then |
| 28 | AC_MSG_WARN([You need to install pkg-config]) |
| 29 | fi |
| 30 | PKG_PROG_PKG_CONFIG([0.20]) |
| 31 | |
Max | 34f0126 | 2017-01-20 13:03:03 +0100 | [diff] [blame] | 32 | dnl check for AX_CHECK_COMPILE_FLAG |
| 33 | m4_ifdef([AX_CHECK_COMPILE_FLAG], [], [ |
| 34 | AC_MSG_ERROR([Please install autoconf-archive; re-run 'autoreconf -fi' for it to take effect.]) |
| 35 | ]) |
| 36 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 37 | dnl checks for libraries |
Jacob Erlbeck | 51a869c | 2013-10-15 12:00:26 +0200 | [diff] [blame] | 38 | AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""]) |
| 39 | AC_SUBST(LIBRARY_DL) |
| 40 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 41 | |
Harald Welte | b069f65 | 2017-10-28 12:59:20 +0200 | [diff] [blame^] | 42 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0) |
| 43 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0) |
| 44 | PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0) |
| 45 | PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0) |
| 46 | PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.3.2) |
| 47 | PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0) |
| 48 | PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0) |
Daniel Willmann | cdeb815 | 2015-10-08 16:10:23 +0200 | [diff] [blame] | 49 | PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5) |
Neels Hofmeyr | becfc4c | 2017-07-19 16:48:42 +0200 | [diff] [blame] | 50 | PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1) |
Harald Welte | 1861b55 | 2017-09-03 20:13:28 +0200 | [diff] [blame] | 51 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) |
Holger Hans Peter Freyther | 25b70ce | 2012-12-20 23:49:24 +0100 | [diff] [blame] | 52 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 53 | dnl checks for header files |
| 54 | AC_HEADER_STDC |
Max | 7bb383a | 2017-05-02 12:59:15 +0200 | [diff] [blame] | 55 | |
| 56 | found_pcap=yes |
| 57 | AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no) |
| 58 | AM_CONDITIONAL(HAVE_PCAP, test "$found_pcap" = yes) |
Harald Welte | ca17ef8 | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 59 | |
Harald Welte | 7465e4c | 2012-11-13 07:06:54 +0100 | [diff] [blame] | 60 | found_cdk=yes |
| 61 | AC_CHECK_HEADERS(cdk/cdk.h,,found_cdk=no) |
| 62 | AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes) |
| 63 | |
Holger Hans Peter Freyther | bb06eb9 | 2015-01-10 09:51:31 +0100 | [diff] [blame] | 64 | found_sqlite3=yes |
| 65 | PKG_CHECK_MODULES(SQLITE3, sqlite3, ,found_sqlite3=no) |
| 66 | AM_CONDITIONAL(HAVE_SQLITE3, test "$found_sqlite3" = yes) |
| 67 | AC_SUBST(found_sqlite3) |
| 68 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 69 | |
| 70 | dnl Checks for typedefs, structures and compiler characteristics |
| 71 | |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 72 | # The following test is taken from WebKit's webkit.m4 |
| 73 | saved_CFLAGS="$CFLAGS" |
| 74 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 75 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
Alexander Huemer | db1bd69 | 2011-05-24 15:16:54 +0200 | [diff] [blame] | 76 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 77 | [ AC_MSG_RESULT([yes]) |
| 78 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 79 | AC_MSG_RESULT([no])) |
| 80 | CFLAGS="$saved_CFLAGS" |
| 81 | AC_SUBST(SYMBOL_VISIBILITY) |
| 82 | |
Max | 34f0126 | 2017-01-20 13:03:03 +0100 | [diff] [blame] | 83 | AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"]) |
| 84 | AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"]) |
| 85 | AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"]) |
| 86 | AX_CHECK_COMPILE_FLAG([-Werror=null-dereference], [CFLAGS="$CFLAGS -Werror=null-dereference"]) |
| 87 | AX_CHECK_COMPILE_FLAG([-Werror=sizeof-array-argument], [CFLAGS="$CFLAGS -Werror=sizeof-array-argument"]) |
| 88 | AX_CHECK_COMPILE_FLAG([-Werror=sizeof-pointer-memaccess], [CFLAGS="$CFLAGS -Werror=sizeof-pointer-memaccess"]) |
| 89 | |
Holger Hans Peter Freyther | ecd94a4 | 2010-11-15 18:37:57 +0100 | [diff] [blame] | 90 | # Coverage build taken from WebKit's configure.in |
| 91 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 92 | AC_ARG_ENABLE(coverage, |
| 93 | AC_HELP_STRING([--enable-coverage], |
| 94 | [enable code coverage support [default=no]]), |
| 95 | [],[enable_coverage="no"]) |
| 96 | AC_MSG_RESULT([$enable_coverage]) |
| 97 | if test "$enable_coverage" = "yes"; then |
| 98 | COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs" |
| 99 | COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" |
| 100 | AC_SUBST([COVERAGE_CFLAGS]) |
| 101 | AC_SUBST([COVERAGE_LDFLAGS]) |
| 102 | fi |
| 103 | |
Katerina Barone-Adesi | e0aee7a | 2013-04-05 17:36:09 +0200 | [diff] [blame] | 104 | AC_ARG_ENABLE([vty_tests], |
| 105 | AC_HELP_STRING([--enable-vty-tests], |
Holger Hans Peter Freyther | dd588ae | 2014-08-22 00:29:04 +0200 | [diff] [blame] | 106 | [Include the VTY/CTRL tests in make check (deprecated) |
| 107 | [default=no]]), |
| 108 | [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) |
Pablo Neira Ayuso | 9224010 | 2014-09-01 09:34:07 +0200 | [diff] [blame] | 109 | AC_ARG_ENABLE([external_tests], |
Holger Hans Peter Freyther | dd588ae | 2014-08-22 00:29:04 +0200 | [diff] [blame] | 110 | AC_HELP_STRING([--enable-external-tests], |
| 111 | [Include the VTY/CTRL tests in make check [default=no]]), |
| 112 | [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) |
| 113 | if test "x$enable_ext_tests" = "xyes" ; then |
Neels Hofmeyr | 7b65688 | 2017-07-09 22:09:18 +0200 | [diff] [blame] | 114 | AM_PATH_PYTHON |
Holger Hans Peter Freyther | dd588ae | 2014-08-22 00:29:04 +0200 | [diff] [blame] | 115 | AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) |
| 116 | if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then |
Neels Hofmeyr | 178d137 | 2017-07-20 23:01:45 +0200 | [diff] [blame] | 117 | AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) |
Katerina Barone-Adesi | e0aee7a | 2013-04-05 17:36:09 +0200 | [diff] [blame] | 118 | fi |
| 119 | fi |
Holger Hans Peter Freyther | dd588ae | 2014-08-22 00:29:04 +0200 | [diff] [blame] | 120 | AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) |
| 121 | AC_MSG_RESULT([$enable_ext_tests]) |
| 122 | AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes") |
Katerina Barone-Adesi | e0aee7a | 2013-04-05 17:36:09 +0200 | [diff] [blame] | 123 | |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 124 | dnl Generate the output |
| 125 | AM_CONFIG_HEADER(bscconfig.h) |
| 126 | |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 127 | AC_OUTPUT( |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 128 | include/Makefile |
Neels Hofmeyr | c016479 | 2017-09-04 15:15:32 +0200 | [diff] [blame] | 129 | include/osmocom/Makefile |
| 130 | include/osmocom/bsc/Makefile |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 131 | src/Makefile |
Harald Welte | 89579b4 | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 132 | src/libtrau/Makefile |
Harald Welte | 89579b4 | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 133 | src/libbsc/Makefile |
Harald Welte | 89579b4 | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 134 | src/libcommon/Makefile |
Holger Hans Peter Freyther | 4247cea | 2015-04-04 18:42:46 +0200 | [diff] [blame] | 135 | src/libfilter/Makefile |
Neels Hofmeyr | c69ee85 | 2016-05-10 12:50:31 +0200 | [diff] [blame] | 136 | src/libcommon-cs/Makefile |
Harald Welte | 31c00f7 | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 137 | src/osmo-bsc/Makefile |
Harald Welte | a17faf8 | 2011-03-03 23:36:48 +0100 | [diff] [blame] | 138 | src/osmo-bsc_nat/Makefile |
Harald Welte | 31c00f7 | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 139 | src/ipaccess/Makefile |
| 140 | src/utils/Makefile |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 141 | tests/Makefile |
Holger Hans Peter Freyther | 93ef33e | 2012-01-09 22:53:04 +0100 | [diff] [blame] | 142 | tests/atlocal |
Holger Freyther | aa0fb36 | 2008-12-28 21:55:40 +0000 | [diff] [blame] | 143 | tests/gsm0408/Makefile |
Holger Hans Peter Freyther | 800d29d | 2009-06-10 12:36:38 +0200 | [diff] [blame] | 144 | tests/channel/Makefile |
Jacob Erlbeck | 946d141 | 2013-09-17 13:59:29 +0200 | [diff] [blame] | 145 | tests/bsc/Makefile |
Holger Hans Peter Freyther | 28e2988 | 2010-06-15 20:21:44 +0800 | [diff] [blame] | 146 | tests/bsc-nat/Makefile |
Holger Hans Peter Freyther | 85d3b34 | 2013-06-14 19:10:28 +0200 | [diff] [blame] | 147 | tests/bsc-nat-trie/Makefile |
Holger Hans Peter Freyther | bce5675 | 2012-11-22 14:59:46 +0100 | [diff] [blame] | 148 | tests/abis/Makefile |
Andreas Eversberg | d074f8f | 2013-12-06 16:59:10 +0100 | [diff] [blame] | 149 | tests/trau/Makefile |
Jacob Erlbeck | 0acc001 | 2014-12-03 13:05:16 +0100 | [diff] [blame] | 150 | tests/subscr/Makefile |
Philipp | b4cb838 | 2016-09-29 17:01:57 +0200 | [diff] [blame] | 151 | tests/nanobts_omlattr/Makefile |
Harald Welte | eb11313 | 2011-05-11 22:11:28 +0200 | [diff] [blame] | 152 | doc/Makefile |
| 153 | doc/examples/Makefile |
Neels Hofmeyr | 5809e1e | 2017-07-20 17:57:37 +0200 | [diff] [blame] | 154 | contrib/Makefile |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 155 | Makefile) |