blob: 0227d2698daaaef3e8e45b30197aac4f0e3b6bac [file] [log] [blame]
Harald Weltede729a12008-12-23 21:01:25 +00001dnl Process this file with autoconf to produce a configure script
Harald Welte5a29c7f2010-03-23 00:09:32 +08002AC_INIT([openbsc],
3 m4_esyscmd([./git-version-gen .tarball-version]),
4 [openbsc-devel@lists.openbsc.org])
Harald Weltede729a12008-12-23 21:01:25 +00005
Harald Welte5a29c7f2010-03-23 00:09:32 +08006AM_INIT_AUTOMAKE([dist-bzip2])
Holger Hans Peter Freyther6c882172012-01-06 15:16:12 +01007AC_CONFIG_TESTDIR(tests)
Harald Weltede729a12008-12-23 21:01:25 +00008
Holger Hans Peter Freyther1f59ac42009-10-27 03:34:49 +01009dnl kernel style compile messages
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11
Harald Weltede729a12008-12-23 21:01:25 +000012dnl checks for programs
13AC_PROG_MAKE_SET
14AC_PROG_CC
15AC_PROG_INSTALL
Holger Freyther3281f6e2009-02-20 18:33:00 +000016AC_PROG_RANLIB
Harald Weltede729a12008-12-23 21:01:25 +000017
18dnl checks for libraries
Holger Freytherb424ecb2009-06-08 10:32:28 +000019AC_SEARCH_LIBS(crypt, crypt,
20 [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])])
Harald Weltede729a12008-12-23 21:01:25 +000021
Holger Hans Peter Freytherc751cf92012-12-19 16:18:44 +010022PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.5.3.60)
Harald Welteef466d42011-05-08 09:41:45 +020023PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
Harald Welte3f786002013-03-13 15:29:27 +010024PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.6.0)
Harald Weltea3199072011-10-10 09:11:29 +020025PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.1.0)
Holger Hans Peter Freyther9b5db282012-08-03 10:01:57 +020026PKG_CHECK_MODULES(LIBOSMOGB, libosmogb >= 0.5.2)
Harald Weltef98a4972010-02-20 17:29:27 +010027
Holger Hans Peter Freyther25b70ce2012-12-20 23:49:24 +010028# Enabke/disable the NAT?
29AC_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"])
31if test "$osmo_ac_build_nat" = "yes" ; then
32 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
33fi
34AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes")
35AC_SUBST(osmo_ac_build_nat)
36
37# Enable/disable the BSC?
38AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])],
39 [osmo_ac_build_bsc="$enableval"])
40if test "$osmo_ac_build_bsc" = "yes" ; then
41 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6)
42fi
43AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes")
44
45# Enable/disable smpp support in the nitb?
46AC_ARG_ENABLE([smpp], [AS_HELP_STRING([--enable-smpp], [Build the SMPP interface])],
Holger Hans Peter Freythera7328a52013-07-13 17:09:56 +020047 [osmo_ac_build_smpp="$enableval"],[osmo_ac_build_smpp="no"])
Holger Hans Peter Freyther25b70ce2012-12-20 23:49:24 +010048if test "$osmo_ac_build_smpp" = "yes" ; then
49 PKG_CHECK_MODULES(LIBSMPP34, libsmpp34 >= 1.10)
50 AC_DEFINE(BUILD_SMPP, 1, [Define if we want to build SMPP])
51fi
52AM_CONDITIONAL(BUILD_SMPP, test "x$osmo_ac_build_smpp" = "xyes")
Holger Hans Peter Freythera7328a52013-07-13 17:09:56 +020053AC_SUBST(osmo_ac_build_smpp)
Holger Hans Peter Freyther25b70ce2012-12-20 23:49:24 +010054
55
Sylvain Munaut86aaefe2011-10-18 13:27:00 +020056found_libgtp=yes
57PKG_CHECK_MODULES(LIBGTP, libgtp, , found_libgtp=no)
58AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes)
59
Harald Weltede729a12008-12-23 21:01:25 +000060dnl checks for header files
61AC_HEADER_STDC
Harald Welteca17ef82011-02-05 15:13:27 +010062AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))
Pablo Neira Ayuso5d7ad472011-03-08 13:38:49 +010063AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed))
Harald Welteca17ef82011-02-05 15:13:27 +010064
Harald Weltede729a12008-12-23 21:01:25 +000065
66dnl Checks for typedefs, structures and compiler characteristics
67
Holger Freyther6d9f77a2009-06-08 10:32:54 +000068# The following test is taken from WebKit's webkit.m4
69saved_CFLAGS="$CFLAGS"
70CFLAGS="$CFLAGS -fvisibility=hidden "
71AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemerdb1bd692011-05-24 15:16:54 +020072AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Holger Freyther6d9f77a2009-06-08 10:32:54 +000073 [ AC_MSG_RESULT([yes])
74 SYMBOL_VISIBILITY="-fvisibility=hidden"],
75 AC_MSG_RESULT([no]))
76CFLAGS="$saved_CFLAGS"
77AC_SUBST(SYMBOL_VISIBILITY)
78
Holger Hans Peter Freytherecd94a42010-11-15 18:37:57 +010079# Coverage build taken from WebKit's configure.in
80AC_MSG_CHECKING([whether to enable code coverage support])
81AC_ARG_ENABLE(coverage,
82 AC_HELP_STRING([--enable-coverage],
83 [enable code coverage support [default=no]]),
84 [],[enable_coverage="no"])
85AC_MSG_RESULT([$enable_coverage])
86if test "$enable_coverage" = "yes"; then
87 COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
88 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
89 AC_SUBST([COVERAGE_CFLAGS])
90 AC_SUBST([COVERAGE_LDFLAGS])
91fi
92
Harald Welte9c3dc902012-04-08 16:59:24 +020093AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
94 AC_CACHE_CHECK(
95 [whether struct tm has tm_gmtoff member],
96 osmo_cv_tm_includes_tm_gmtoff,
97 [AC_LINK_IFELSE([
98 AC_LANG_PROGRAM([
99 #include <time.h>
100 ], [
101 time_t t = time(NULL);
102 struct tm* lt = localtime(&t);
103 int off = lt->tm_gmtoff;
104 ])
105 ],
106 osmo_cv_tm_includes_tm_gmtoff=yes,
107 osmo_cv_tm_includes_tm_gmtoff=no
108 )]
109 )
110 if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then
111 AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1,
112 [Define if struct tm has tm_gmtoff member.])
113 fi
114])
115
116CHECK_TM_INCLUDES_TM_GMTOFF
Holger Freyther6d9f77a2009-06-08 10:32:54 +0000117
Katerina Barone-Adesie0aee7a2013-04-05 17:36:09 +0200118AC_ARG_ENABLE([vty_tests],
119 AC_HELP_STRING([--enable-vty-tests],
120 [Include the VTY tests in make check [default=no]]),
121 [enable_vty_tests="$enableval"],[enable_vty_tests="no"])
122if test "x$enable_vty_tests" = "xyes" ; then
123 AM_PATH_PYTHON
124 AC_CHECK_PROG(OSMOTESTVTY_CHECK,osmotestvty.py,yes)
125 if test "x$OSMOTESTVTY_CHECK" != "xyes" ; then
126 AC_MSG_ERROR([Please install osmocom-python to run the vty tests.])
127 fi
128fi
129AC_MSG_CHECKING([whether to enable VTY tests])
130AC_MSG_RESULT([$enable_vty_tests])
131AM_CONDITIONAL(ENABLE_VTY_TESTS, test "x$enable_vty_tests" = "xyes")
132
Holger Freyther6d9f77a2009-06-08 10:32:54 +0000133dnl Generate the output
134AM_CONFIG_HEADER(bscconfig.h)
135
Holger Freyther5f755982008-12-27 09:42:59 +0000136AC_OUTPUT(
Holger Freytherc7aa3c42009-06-08 10:32:39 +0000137 openbsc.pc
Holger Freyther5f755982008-12-27 09:42:59 +0000138 include/openbsc/Makefile
139 include/Makefile
140 src/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100141 src/libtrau/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100142 src/libbsc/Makefile
Daniel Willmann4462f8c2010-10-21 15:00:36 +0200143 src/libctrl/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100144 src/libmsc/Makefile
145 src/libmgcp/Makefile
146 src/libcommon/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +0100147 src/osmo-nitb/Makefile
148 src/osmo-bsc/Makefile
Harald Weltea17faf82011-03-03 23:36:48 +0100149 src/osmo-bsc_nat/Makefile
150 src/osmo-bsc_mgcp/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +0100151 src/ipaccess/Makefile
152 src/utils/Makefile
153 src/gprs/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000154 tests/Makefile
Holger Hans Peter Freyther93ef33e2012-01-09 22:53:04 +0100155 tests/atlocal
Holger Freytheraa0fb362008-12-28 21:55:40 +0000156 tests/gsm0408/Makefile
Holger Freytherdbede4e2008-12-31 23:25:05 +0000157 tests/db/Makefile
Holger Hans Peter Freyther800d29d2009-06-10 12:36:38 +0200158 tests/channel/Makefile
Holger Hans Peter Freyther28e29882010-06-15 20:21:44 +0800159 tests/bsc-nat/Makefile
Holger Hans Peter Freyther9f239a22011-01-06 19:32:52 +0100160 tests/mgcp/Makefile
Holger Hans Peter Freytherfaf1f642011-06-23 17:53:27 -0400161 tests/gprs/Makefile
Holger Hans Peter Freyther511f9c32012-10-13 12:38:54 +0200162 tests/si/Makefile
Holger Hans Peter Freytherbce56752012-11-22 14:59:46 +0100163 tests/abis/Makefile
Holger Hans Peter Freythera7328a52013-07-13 17:09:56 +0200164 tests/smpp/Makefile
Harald Welteeb113132011-05-11 22:11:28 +0200165 doc/Makefile
166 doc/examples/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000167 Makefile)