blob: 74b30448cfb0f0c820ac7c186c36fa0e7e93f978 [file] [log] [blame]
Harald Welte2b944cf2008-12-23 21:01:25 +00001dnl Process this file with autoconf to produce a configure script
Harald Weltefa13cad2010-03-23 00:09:32 +08002AC_INIT([openbsc],
3 m4_esyscmd([./git-version-gen .tarball-version]),
4 [openbsc-devel@lists.openbsc.org])
Harald Welte2b944cf2008-12-23 21:01:25 +00005
Harald Weltefa13cad2010-03-23 00:09:32 +08006AM_INIT_AUTOMAKE([dist-bzip2])
Harald Welte2b944cf2008-12-23 21:01:25 +00007
Holger Hans Peter Freytherc746e682009-10-27 03:34:49 +01008dnl kernel style compile messages
9m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
Harald Welte2b944cf2008-12-23 21:01:25 +000011dnl checks for programs
12AC_PROG_MAKE_SET
13AC_PROG_CC
14AC_PROG_INSTALL
Holger Freyther91f49f62009-02-20 18:33:00 +000015AC_PROG_RANLIB
Harald Welte2b944cf2008-12-23 21:01:25 +000016
17dnl checks for libraries
Holger Freyther559bb712009-06-08 10:32:28 +000018AC_SEARCH_LIBS(crypt, crypt,
19 [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])])
Harald Welteeaf33032010-05-18 00:20:21 +020020AC_SEARCH_LIBS(gtp_new, gtp,
21 [LIBCRYPT="-lgtp"; AC_SUBST([GPRS_LIBGTP], [1])])
22
23AM_CONDITIONAL(HAVE_LIBGTP, test "x$GPRS_LIBGTP" != "x")
Harald Welte2b944cf2008-12-23 21:01:25 +000024
Holger Hans Peter Freythera8dffc12010-07-30 02:53:14 +080025
26AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
27 [
Harald Welte90e5eae2010-08-03 15:11:51 +020028 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
Holger Hans Peter Freythera8dffc12010-07-30 02:53:14 +080029 osmo_ac_build_nat="yes"
30 ],
31 [
32 osmo_ac_build_nat="no"
33 ])
34AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes")
35
Harald Welte90e5eae2010-08-03 15:11:51 +020036AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])],
Holger Hans Peter Freythera8dffc12010-07-30 02:53:14 +080037 [
Harald Welte90e5eae2010-08-03 15:11:51 +020038 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
Holger Hans Peter Freythera8dffc12010-07-30 02:53:14 +080039 osmo_ac_build_bsc="yes"
40 ],
41 [
42 osmo_ac_build_bsc="no"
43 ])
44AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes")
45
Harald Welte4d109ff2011-05-08 09:41:45 +020046PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.0)
47PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
48PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0)
Harald Welte9c38ed62010-02-20 17:29:27 +010049
Harald Welte2b944cf2008-12-23 21:01:25 +000050dnl checks for header files
51AC_HEADER_STDC
Harald Weltec7841cc2011-02-05 15:13:27 +010052AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))
Pablo Neira Ayusof58692f2011-03-08 13:38:49 +010053AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed))
Harald Weltec7841cc2011-02-05 15:13:27 +010054
Harald Welte2b944cf2008-12-23 21:01:25 +000055
56dnl Checks for typedefs, structures and compiler characteristics
57
Holger Freyther64026e92009-06-08 10:32:54 +000058# The following test is taken from WebKit's webkit.m4
59saved_CFLAGS="$CFLAGS"
60CFLAGS="$CFLAGS -fvisibility=hidden "
61AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemer93ae2d62011-05-24 15:16:54 +020062AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Holger Freyther64026e92009-06-08 10:32:54 +000063 [ AC_MSG_RESULT([yes])
64 SYMBOL_VISIBILITY="-fvisibility=hidden"],
65 AC_MSG_RESULT([no]))
66CFLAGS="$saved_CFLAGS"
67AC_SUBST(SYMBOL_VISIBILITY)
68
Holger Hans Peter Freyther16bdb142010-11-15 18:37:57 +010069# Coverage build taken from WebKit's configure.in
70AC_MSG_CHECKING([whether to enable code coverage support])
71AC_ARG_ENABLE(coverage,
72 AC_HELP_STRING([--enable-coverage],
73 [enable code coverage support [default=no]]),
74 [],[enable_coverage="no"])
75AC_MSG_RESULT([$enable_coverage])
76if test "$enable_coverage" = "yes"; then
77 COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
78 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
79 AC_SUBST([COVERAGE_CFLAGS])
80 AC_SUBST([COVERAGE_LDFLAGS])
81fi
82
Holger Freyther64026e92009-06-08 10:32:54 +000083
84dnl Generate the output
85AM_CONFIG_HEADER(bscconfig.h)
86
Holger Freyther1bad6012008-12-27 09:42:59 +000087AC_OUTPUT(
Holger Freytherb27d8452009-06-08 10:32:39 +000088 openbsc.pc
Holger Freyther1bad6012008-12-27 09:42:59 +000089 include/openbsc/Makefile
90 include/Makefile
91 src/Makefile
Harald Welte3d1aaac2011-03-04 13:18:30 +010092 src/libtrau/Makefile
93 src/libabis/Makefile
94 src/libbsc/Makefile
95 src/libmsc/Makefile
96 src/libmgcp/Makefile
97 src/libcommon/Makefile
Harald Welte4f272cc2011-03-03 23:29:05 +010098 src/osmo-nitb/Makefile
99 src/osmo-bsc/Makefile
Harald Welteacdcfea2011-03-03 23:36:48 +0100100 src/osmo-bsc_nat/Makefile
101 src/osmo-bsc_mgcp/Makefile
Harald Welte4f272cc2011-03-03 23:29:05 +0100102 src/ipaccess/Makefile
103 src/utils/Makefile
Harald Welte3d1aaac2011-03-04 13:18:30 +0100104 src/libgb/Makefile
Harald Welte4f272cc2011-03-03 23:29:05 +0100105 src/gprs/Makefile
Holger Freyther1bad6012008-12-27 09:42:59 +0000106 tests/Makefile
Holger Freytherc95546b2008-12-27 12:03:07 +0000107 tests/debug/Makefile
Holger Freytherec5b1d82008-12-28 21:55:40 +0000108 tests/gsm0408/Makefile
Holger Freytherc1e11922008-12-31 23:25:05 +0000109 tests/db/Makefile
Holger Hans Peter Freytherf8584a12009-06-10 12:36:38 +0200110 tests/channel/Makefile
Holger Hans Peter Freyther4dfa08d2010-06-15 20:21:44 +0800111 tests/bsc-nat/Makefile
Holger Hans Peter Freytherf0bc0752011-01-06 19:32:52 +0100112 tests/mgcp/Makefile
Harald Welte2d6f49d2011-05-11 22:11:28 +0200113 doc/Makefile
114 doc/examples/Makefile
Holger Freyther1bad6012008-12-27 09:42:59 +0000115 Makefile)