blob: 525bad82ca5f74e2b8051b213b6e2598686d92b3 [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])
Harald Weltede729a12008-12-23 21:01:25 +00007
Holger Hans Peter Freyther1f59ac42009-10-27 03:34:49 +01008dnl kernel style compile messages
9m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
Harald Weltede729a12008-12-23 21:01:25 +000011dnl checks for programs
12AC_PROG_MAKE_SET
13AC_PROG_CC
14AC_PROG_INSTALL
Holger Freyther3281f6e2009-02-20 18:33:00 +000015AC_PROG_RANLIB
Harald Weltede729a12008-12-23 21:01:25 +000016
17dnl checks for libraries
Holger Freytherb424ecb2009-06-08 10:32:28 +000018AC_SEARCH_LIBS(crypt, crypt,
19 [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])])
Harald Welte03800ba2010-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 Weltede729a12008-12-23 21:01:25 +000024
Holger Hans Peter Freyther30e1ae92010-07-30 02:53:14 +080025
26AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
27 [
Harald Welted5db12c2010-08-03 15:11:51 +020028 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
Holger Hans Peter Freyther30e1ae92010-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 Welted5db12c2010-08-03 15:11:51 +020036AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])],
Holger Hans Peter Freyther30e1ae92010-07-30 02:53:14 +080037 [
Harald Welted5db12c2010-08-03 15:11:51 +020038 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
Holger Hans Peter Freyther30e1ae92010-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
Holger Hans Peter Freytherafa5a392010-10-27 12:37:13 +020046PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.1.27)
Holger Hans Peter Freyther867d69b2011-02-25 11:54:31 +010047PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.1.28)
Harald Weltef98a4972010-02-20 17:29:27 +010048
Harald Weltede729a12008-12-23 21:01:25 +000049dnl checks for header files
50AC_HEADER_STDC
Harald Welteca17ef82011-02-05 15:13:27 +010051AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))
52
Harald Weltede729a12008-12-23 21:01:25 +000053
54dnl Checks for typedefs, structures and compiler characteristics
55
Holger Freyther6d9f77a2009-06-08 10:32:54 +000056# The following test is taken from WebKit's webkit.m4
57saved_CFLAGS="$CFLAGS"
58CFLAGS="$CFLAGS -fvisibility=hidden "
59AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
60AC_COMPILE_IFELSE([char foo;],
61 [ AC_MSG_RESULT([yes])
62 SYMBOL_VISIBILITY="-fvisibility=hidden"],
63 AC_MSG_RESULT([no]))
64CFLAGS="$saved_CFLAGS"
65AC_SUBST(SYMBOL_VISIBILITY)
66
Holger Hans Peter Freytherecd94a42010-11-15 18:37:57 +010067# Coverage build taken from WebKit's configure.in
68AC_MSG_CHECKING([whether to enable code coverage support])
69AC_ARG_ENABLE(coverage,
70 AC_HELP_STRING([--enable-coverage],
71 [enable code coverage support [default=no]]),
72 [],[enable_coverage="no"])
73AC_MSG_RESULT([$enable_coverage])
74if test "$enable_coverage" = "yes"; then
75 COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
76 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
77 AC_SUBST([COVERAGE_CFLAGS])
78 AC_SUBST([COVERAGE_LDFLAGS])
79fi
80
Holger Freyther6d9f77a2009-06-08 10:32:54 +000081
82dnl Generate the output
83AM_CONFIG_HEADER(bscconfig.h)
84
Holger Freyther5f755982008-12-27 09:42:59 +000085AC_OUTPUT(
Holger Freytherc7aa3c42009-06-08 10:32:39 +000086 openbsc.pc
Holger Freyther5f755982008-12-27 09:42:59 +000087 include/openbsc/Makefile
88 include/Makefile
89 src/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +010090 src/trau/Makefile
91 src/abis/Makefile
Holger Hans Peter Freyther5ccab102010-06-30 14:33:01 +080092 src/bsc/Makefile
Harald Welte31c00f72011-03-03 23:29:05 +010093 src/msc/Makefile
94 src/mgcp/Makefile
95 src/common/Makefile
96 src/osmo-nitb/Makefile
97 src/osmo-bsc/Makefile
98 src/nat/Makefile
99 src/ipaccess/Makefile
100 src/utils/Makefile
101 src/gprs/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000102 tests/Makefile
Holger Freytherd546e312008-12-27 12:03:07 +0000103 tests/debug/Makefile
Holger Freytheraa0fb362008-12-28 21:55:40 +0000104 tests/gsm0408/Makefile
Holger Freytherdbede4e2008-12-31 23:25:05 +0000105 tests/db/Makefile
Holger Hans Peter Freyther800d29d2009-06-10 12:36:38 +0200106 tests/channel/Makefile
Holger Hans Peter Freyther28e29882010-06-15 20:21:44 +0800107 tests/bsc-nat/Makefile
Holger Hans Peter Freyther9f239a22011-01-06 19:32:52 +0100108 tests/mgcp/Makefile
Holger Freyther5f755982008-12-27 09:42:59 +0000109 Makefile)