blob: 90e3654e2f63de5df754f321c09f331cf9d7e75e [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 Freyther30e1ae92010-07-30 02:53:14 +080022
23AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
24 [
Harald Welted5db12c2010-08-03 15:11:51 +020025 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
Holger Hans Peter Freyther30e1ae92010-07-30 02:53:14 +080026 osmo_ac_build_nat="yes"
27 ],
28 [
29 osmo_ac_build_nat="no"
30 ])
31AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes")
32
Harald Welted5db12c2010-08-03 15:11:51 +020033AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])],
Holger Hans Peter Freyther30e1ae92010-07-30 02:53:14 +080034 [
Holger Hans Peter Freyther784ca9c2011-06-04 16:59:37 +020035 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6)
Holger Hans Peter Freyther30e1ae92010-07-30 02:53:14 +080036 osmo_ac_build_bsc="yes"
37 ],
38 [
39 osmo_ac_build_bsc="no"
40 ])
41AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes")
42
Harald Weltec90499b2011-06-26 14:48:11 +020043PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)
Harald Welteef466d42011-05-08 09:41:45 +020044PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
45PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0)
Harald Weltea3199072011-10-10 09:11:29 +020046PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.1.0)
Harald Weltef98a4972010-02-20 17:29:27 +010047
Sylvain Munaut86aaefe2011-10-18 13:27:00 +020048found_libgtp=yes
49PKG_CHECK_MODULES(LIBGTP, libgtp, , found_libgtp=no)
50AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes)
51
Harald Weltede729a12008-12-23 21:01:25 +000052dnl checks for header files
53AC_HEADER_STDC
Harald Welteca17ef82011-02-05 15:13:27 +010054AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))
Pablo Neira Ayuso5d7ad472011-03-08 13:38:49 +010055AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed))
Harald Welteca17ef82011-02-05 15:13:27 +010056
Harald Weltede729a12008-12-23 21:01:25 +000057
58dnl Checks for typedefs, structures and compiler characteristics
59
Holger Freyther6d9f77a2009-06-08 10:32:54 +000060# The following test is taken from WebKit's webkit.m4
61saved_CFLAGS="$CFLAGS"
62CFLAGS="$CFLAGS -fvisibility=hidden "
63AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemerdb1bd692011-05-24 15:16:54 +020064AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Holger Freyther6d9f77a2009-06-08 10:32:54 +000065 [ AC_MSG_RESULT([yes])
66 SYMBOL_VISIBILITY="-fvisibility=hidden"],
67 AC_MSG_RESULT([no]))
68CFLAGS="$saved_CFLAGS"
69AC_SUBST(SYMBOL_VISIBILITY)
70
Holger Hans Peter Freytherecd94a42010-11-15 18:37:57 +010071# Coverage build taken from WebKit's configure.in
72AC_MSG_CHECKING([whether to enable code coverage support])
73AC_ARG_ENABLE(coverage,
74 AC_HELP_STRING([--enable-coverage],
75 [enable code coverage support [default=no]]),
76 [],[enable_coverage="no"])
77AC_MSG_RESULT([$enable_coverage])
78if test "$enable_coverage" = "yes"; then
79 COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
80 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
81 AC_SUBST([COVERAGE_CFLAGS])
82 AC_SUBST([COVERAGE_LDFLAGS])
83fi
84
Holger Freyther6d9f77a2009-06-08 10:32:54 +000085
86dnl Generate the output
87AM_CONFIG_HEADER(bscconfig.h)
88
Holger Freyther5f755982008-12-27 09:42:59 +000089AC_OUTPUT(
Holger Freytherc7aa3c42009-06-08 10:32:39 +000090 openbsc.pc
Holger Freyther5f755982008-12-27 09:42:59 +000091 include/openbsc/Makefile
92 include/Makefile
93 src/Makefile
Harald Welte89579b42011-03-04 13:18:30 +010094 src/libtrau/Makefile
Harald Welte89579b42011-03-04 13:18:30 +010095 src/libbsc/Makefile
Daniel Willmann4462f8c2010-10-21 15:00:36 +020096 src/libctrl/Makefile
Harald Welte89579b42011-03-04 13:18:30 +010097 src/libmsc/Makefile
98 src/libmgcp/Makefile
99 src/libcommon/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +0100100 src/osmo-nitb/Makefile
101 src/osmo-bsc/Makefile
Harald Weltea17faf82011-03-03 23:36:48 +0100102 src/osmo-bsc_nat/Makefile
103 src/osmo-bsc_mgcp/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +0100104 src/ipaccess/Makefile
105 src/utils/Makefile
Harald Welte89579b42011-03-04 13:18:30 +0100106 src/libgb/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +0100107 src/gprs/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000108 tests/Makefile
Holger Freytherd546e312008-12-27 12:03:07 +0000109 tests/debug/Makefile
Holger Freytheraa0fb362008-12-28 21:55:40 +0000110 tests/gsm0408/Makefile
Holger Freytherdbede4e2008-12-31 23:25:05 +0000111 tests/db/Makefile
Holger Hans Peter Freyther800d29d2009-06-10 12:36:38 +0200112 tests/channel/Makefile
Holger Hans Peter Freyther28e29882010-06-15 20:21:44 +0800113 tests/bsc-nat/Makefile
Holger Hans Peter Freyther9f239a22011-01-06 19:32:52 +0100114 tests/mgcp/Makefile
Harald Welteeb113132011-05-11 22:11:28 +0200115 doc/Makefile
116 doc/examples/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000117 Makefile)