blob: f741441537db7ea023386acf8d7c6fdc0860c1cf [file] [log] [blame]
Harald Weltede729a12008-12-23 21:01:25 +00001dnl Process this file with autoconf to produce a configure script
Harald Welte630df7d2017-09-03 22:29:45 +02002AC_INIT([osmo-bsc],
Harald Welte5a29c7f2010-03-23 00:09:32 +08003 m4_esyscmd([./git-version-gen .tarball-version]),
Holger Hans Peter Freyther47d8f022014-05-15 12:26:16 +02004 [openbsc@lists.osmocom.org])
Harald Weltede729a12008-12-23 21:01:25 +00005
Neels Hofmeyrb8103122016-10-01 00:34:31 +02006dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
7AC_CONFIG_AUX_DIR([.])
8
Harald Welte5a29c7f2010-03-23 00:09:32 +08009AM_INIT_AUTOMAKE([dist-bzip2])
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +010010AC_CONFIG_TESTDIR(tests)
Harald Weltede729a12008-12-23 21:01:25 +000011
Holger Hans Peter Freyther1f59ac42009-10-27 03:34:49 +010012dnl kernel style compile messages
13m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
14
Max88d8bcb2017-08-28 12:04:18 +020015dnl include release helper
16RELMAKE='-include osmo-release.mk'
17AC_SUBST([RELMAKE])
18
Harald Weltede729a12008-12-23 21:01:25 +000019dnl checks for programs
20AC_PROG_MAKE_SET
21AC_PROG_CC
22AC_PROG_INSTALL
Maxeab5f592017-05-26 12:31:00 +020023LT_INIT
Harald Weltede729a12008-12-23 21:01:25 +000024
Neels Hofmeyra8f91df2016-10-01 00:50:25 +020025dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
26AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
27if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
28 AC_MSG_WARN([You need to install pkg-config])
29fi
30PKG_PROG_PKG_CONFIG([0.20])
31
Max34f01262017-01-20 13:03:03 +010032dnl check for AX_CHECK_COMPILE_FLAG
33m4_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 Weltede729a12008-12-23 21:01:25 +000037dnl checks for libraries
Jacob Erlbeck51a869c2013-10-15 12:00:26 +020038AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
39AC_SUBST(LIBRARY_DL)
40
Harald Weltede729a12008-12-23 21:01:25 +000041
Harald Welteb069f652017-10-28 12:59:20 +020042PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.10.0)
43PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0)
44PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0)
45PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0)
46PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.3.2)
47PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 0.1.0)
48PKG_CHECK_MODULES(LIBOSMOSIGTRAN, libosmo-sigtran >= 0.8.0)
Daniel Willmanncdeb8152015-10-08 16:10:23 +020049PKG_CHECK_MODULES(LIBCRYPTO, libcrypto >= 0.9.5)
Harald Welte1861b552017-09-03 20:13:28 +020050PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
Harald Weltef04e9c22017-11-10 11:39:16 +090051PKG_CHECK_MODULES(LIBOSMOMGCPCLIENT, libosmo-mgcp-client >= 1.2.0)
Philipp Maier39c609b2017-09-27 15:51:34 +020052PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 1.0.0)
Holger Hans Peter Freyther25b70ce2012-12-20 23:49:24 +010053
Harald Weltede729a12008-12-23 21:01:25 +000054dnl checks for header files
55AC_HEADER_STDC
Max7bb383a2017-05-02 12:59:15 +020056
57found_pcap=yes
58AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no)
59AM_CONDITIONAL(HAVE_PCAP, test "$found_pcap" = yes)
Harald Welteca17ef82011-02-05 15:13:27 +010060
Harald Welte7465e4c2012-11-13 07:06:54 +010061found_cdk=yes
62AC_CHECK_HEADERS(cdk/cdk.h,,found_cdk=no)
63AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes)
64
Holger Hans Peter Freytherbb06eb92015-01-10 09:51:31 +010065found_sqlite3=yes
66PKG_CHECK_MODULES(SQLITE3, sqlite3, ,found_sqlite3=no)
67AM_CONDITIONAL(HAVE_SQLITE3, test "$found_sqlite3" = yes)
68AC_SUBST(found_sqlite3)
69
Harald Weltede729a12008-12-23 21:01:25 +000070
71dnl Checks for typedefs, structures and compiler characteristics
72
Holger Freyther6d9f77a2009-06-08 10:32:54 +000073# The following test is taken from WebKit's webkit.m4
74saved_CFLAGS="$CFLAGS"
75CFLAGS="$CFLAGS -fvisibility=hidden "
76AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemerdb1bd692011-05-24 15:16:54 +020077AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Holger Freyther6d9f77a2009-06-08 10:32:54 +000078 [ AC_MSG_RESULT([yes])
79 SYMBOL_VISIBILITY="-fvisibility=hidden"],
80 AC_MSG_RESULT([no]))
81CFLAGS="$saved_CFLAGS"
82AC_SUBST(SYMBOL_VISIBILITY)
83
Max34f01262017-01-20 13:03:03 +010084AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"])
85AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"])
86AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"])
87AX_CHECK_COMPILE_FLAG([-Werror=null-dereference], [CFLAGS="$CFLAGS -Werror=null-dereference"])
88AX_CHECK_COMPILE_FLAG([-Werror=sizeof-array-argument], [CFLAGS="$CFLAGS -Werror=sizeof-array-argument"])
89AX_CHECK_COMPILE_FLAG([-Werror=sizeof-pointer-memaccess], [CFLAGS="$CFLAGS -Werror=sizeof-pointer-memaccess"])
90
Holger Hans Peter Freytherecd94a42010-11-15 18:37:57 +010091# Coverage build taken from WebKit's configure.in
92AC_MSG_CHECKING([whether to enable code coverage support])
93AC_ARG_ENABLE(coverage,
94 AC_HELP_STRING([--enable-coverage],
95 [enable code coverage support [default=no]]),
96 [],[enable_coverage="no"])
97AC_MSG_RESULT([$enable_coverage])
98if test "$enable_coverage" = "yes"; then
99 COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
100 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
101 AC_SUBST([COVERAGE_CFLAGS])
102 AC_SUBST([COVERAGE_LDFLAGS])
103fi
104
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +0200105AC_ARG_ENABLE([vty_tests],
106 AC_HELP_STRING([--enable-vty-tests],
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +0200107 [Include the VTY/CTRL tests in make check (deprecated)
108 [default=no]]),
109 [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
Pablo Neira Ayuso92240102014-09-01 09:34:07 +0200110AC_ARG_ENABLE([external_tests],
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +0200111 AC_HELP_STRING([--enable-external-tests],
112 [Include the VTY/CTRL tests in make check [default=no]]),
113 [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
114if test "x$enable_ext_tests" = "xyes" ; then
Neels Hofmeyr7b656882017-07-09 22:09:18 +0200115AM_PATH_PYTHON
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +0200116 AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
117 if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
Neels Hofmeyr178d1372017-07-20 23:01:45 +0200118 AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +0200119 fi
120fi
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +0200121AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
122AC_MSG_RESULT([$enable_ext_tests])
123AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +0200124
Holger Freyther6d9f77a2009-06-08 10:32:54 +0000125dnl Generate the output
126AM_CONFIG_HEADER(bscconfig.h)
127
Holger Freyther5f755982008-12-27 09:42:59 +0000128AC_OUTPUT(
Holger Freyther5f755982008-12-27 09:42:59 +0000129 include/Makefile
Neels Hofmeyrc0164792017-09-04 15:15:32 +0200130 include/osmocom/Makefile
131 include/osmocom/bsc/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000132 src/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100133 src/libtrau/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100134 src/libbsc/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100135 src/libcommon/Makefile
Holger Hans Peter Freyther4247cea2015-04-04 18:42:46 +0200136 src/libfilter/Makefile
Neels Hofmeyrc69ee852016-05-10 12:50:31 +0200137 src/libcommon-cs/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +0100138 src/osmo-bsc/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +0100139 src/ipaccess/Makefile
140 src/utils/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000141 tests/Makefile
Holger Hans Peter Freyther93ef33e2012-01-09 22:53:04 +0100142 tests/atlocal
Holger Freytheraa0fb362008-12-28 21:55:40 +0000143 tests/gsm0408/Makefile
Holger Hans Peter Freyther800d29d2009-06-10 12:36:38 +0200144 tests/channel/Makefile
Jacob Erlbeck946d1412013-09-17 13:59:29 +0200145 tests/bsc/Makefile
Holger Hans Peter Freyther28e29882010-06-15 20:21:44 +0800146 tests/bsc-nat/Makefile
Holger Hans Peter Freyther85d3b342013-06-14 19:10:28 +0200147 tests/bsc-nat-trie/Makefile
Holger Hans Peter Freytherbce56752012-11-22 14:59:46 +0100148 tests/abis/Makefile
Andreas Eversbergd074f8f2013-12-06 16:59:10 +0100149 tests/trau/Makefile
Jacob Erlbeck0acc0012014-12-03 13:05:16 +0100150 tests/subscr/Makefile
Philippb4cb8382016-09-29 17:01:57 +0200151 tests/nanobts_omlattr/Makefile
Neels Hofmeyr9eb208f2017-11-07 03:38:28 +0100152 tests/bssap/Makefile
Harald Welteeb113132011-05-11 22:11:28 +0200153 doc/Makefile
154 doc/examples/Makefile
Neels Hofmeyr5809e1e2017-07-20 17:57:37 +0200155 contrib/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000156 Makefile)