blob: 79523d1410d54be8604f3217cf3f83cae0c33c88 [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)
Neels Hofmeyrbecfc4c2017-07-19 16:48:42 +020050PKG_CHECK_MODULES(LIBOSMOLEGACYMGCP, libosmo-legacy-mgcp >= 0.0.1)
Harald Welte1861b552017-09-03 20:13:28 +020051PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
Holger Hans Peter Freyther25b70ce2012-12-20 23:49:24 +010052
Harald Weltede729a12008-12-23 21:01:25 +000053dnl checks for header files
54AC_HEADER_STDC
Max7bb383a2017-05-02 12:59:15 +020055
56found_pcap=yes
57AC_CHECK_HEADERS(pcap/pcap.h,,found_pcap=no)
58AM_CONDITIONAL(HAVE_PCAP, test "$found_pcap" = yes)
Harald Welteca17ef82011-02-05 15:13:27 +010059
Harald Welte7465e4c2012-11-13 07:06:54 +010060found_cdk=yes
61AC_CHECK_HEADERS(cdk/cdk.h,,found_cdk=no)
62AM_CONDITIONAL(HAVE_LIBCDK, test "$found_cdk" = yes)
63
Holger Hans Peter Freytherbb06eb92015-01-10 09:51:31 +010064found_sqlite3=yes
65PKG_CHECK_MODULES(SQLITE3, sqlite3, ,found_sqlite3=no)
66AM_CONDITIONAL(HAVE_SQLITE3, test "$found_sqlite3" = yes)
67AC_SUBST(found_sqlite3)
68
Harald Weltede729a12008-12-23 21:01:25 +000069
70dnl Checks for typedefs, structures and compiler characteristics
71
Holger Freyther6d9f77a2009-06-08 10:32:54 +000072# The following test is taken from WebKit's webkit.m4
73saved_CFLAGS="$CFLAGS"
74CFLAGS="$CFLAGS -fvisibility=hidden "
75AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemerdb1bd692011-05-24 15:16:54 +020076AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Holger Freyther6d9f77a2009-06-08 10:32:54 +000077 [ AC_MSG_RESULT([yes])
78 SYMBOL_VISIBILITY="-fvisibility=hidden"],
79 AC_MSG_RESULT([no]))
80CFLAGS="$saved_CFLAGS"
81AC_SUBST(SYMBOL_VISIBILITY)
82
Max34f01262017-01-20 13:03:03 +010083AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"])
84AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"])
85AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"])
86AX_CHECK_COMPILE_FLAG([-Werror=null-dereference], [CFLAGS="$CFLAGS -Werror=null-dereference"])
87AX_CHECK_COMPILE_FLAG([-Werror=sizeof-array-argument], [CFLAGS="$CFLAGS -Werror=sizeof-array-argument"])
88AX_CHECK_COMPILE_FLAG([-Werror=sizeof-pointer-memaccess], [CFLAGS="$CFLAGS -Werror=sizeof-pointer-memaccess"])
89
Holger Hans Peter Freytherecd94a42010-11-15 18:37:57 +010090# Coverage build taken from WebKit's configure.in
91AC_MSG_CHECKING([whether to enable code coverage support])
92AC_ARG_ENABLE(coverage,
93 AC_HELP_STRING([--enable-coverage],
94 [enable code coverage support [default=no]]),
95 [],[enable_coverage="no"])
96AC_MSG_RESULT([$enable_coverage])
97if 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])
102fi
103
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +0200104AC_ARG_ENABLE([vty_tests],
105 AC_HELP_STRING([--enable-vty-tests],
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +0200106 [Include the VTY/CTRL tests in make check (deprecated)
107 [default=no]]),
108 [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
Pablo Neira Ayuso92240102014-09-01 09:34:07 +0200109AC_ARG_ENABLE([external_tests],
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +0200110 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"])
113if test "x$enable_ext_tests" = "xyes" ; then
Neels Hofmeyr7b656882017-07-09 22:09:18 +0200114AM_PATH_PYTHON
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +0200115 AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
116 if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
Neels Hofmeyr178d1372017-07-20 23:01:45 +0200117 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 +0200118 fi
119fi
Holger Hans Peter Freytherdd588ae2014-08-22 00:29:04 +0200120AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
121AC_MSG_RESULT([$enable_ext_tests])
122AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +0200123
Holger Freyther6d9f77a2009-06-08 10:32:54 +0000124dnl Generate the output
125AM_CONFIG_HEADER(bscconfig.h)
126
Holger Freyther5f755982008-12-27 09:42:59 +0000127AC_OUTPUT(
Holger Freyther5f755982008-12-27 09:42:59 +0000128 include/Makefile
Neels Hofmeyrc0164792017-09-04 15:15:32 +0200129 include/osmocom/Makefile
130 include/osmocom/bsc/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000131 src/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100132 src/libtrau/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100133 src/libbsc/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100134 src/libcommon/Makefile
Holger Hans Peter Freyther4247cea2015-04-04 18:42:46 +0200135 src/libfilter/Makefile
Neels Hofmeyrc69ee852016-05-10 12:50:31 +0200136 src/libcommon-cs/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +0100137 src/osmo-bsc/Makefile
Harald Weltea17faf82011-03-03 23:36:48 +0100138 src/osmo-bsc_nat/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
Harald Welteeb113132011-05-11 22:11:28 +0200152 doc/Makefile
153 doc/examples/Makefile
Neels Hofmeyr5809e1e2017-07-20 17:57:37 +0200154 contrib/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000155 Makefile)