blob: 59516187dd3d30570da796fc0b8b75980bbcff1b [file] [log] [blame]
Jonathan Santos5a45b152011-08-17 15:33:57 -04001dnl Process this file with autoconf to produce a configure script
2AC_INIT([openbsc],
3 m4_esyscmd([./git-version-gen .tarball-version]),
4 [openbsc-devel@lists.openbsc.org])
5
6AM_INIT_AUTOMAKE([dist-bzip2])
7
8dnl kernel style compile messages
9m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
11dnl checks for programs
12AC_PROG_MAKE_SET
13AC_PROG_CC
14AC_PROG_INSTALL
15AC_PROG_RANLIB
16
17dnl checks for libraries
18AC_SEARCH_LIBS(crypt, crypt,
19 [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])])
20AC_SEARCH_LIBS(gtp_new, gtp,
21 [LIBCRYPT="-lgtp"; AC_SUBST([GPRS_LIBGTP], [1])])
22
23AM_CONDITIONAL(HAVE_LIBGTP, test "x$GPRS_LIBGTP" != "x")
24
25
26AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])],
27 [
28 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
29 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
36AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])],
37 [
38 PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2)
39 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
46PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2)
47PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
48PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0)
49
50dnl checks for header files
51AC_HEADER_STDC
52AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built))
53AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed))
54
55
56dnl Checks for typedefs, structures and compiler characteristics
57
58# 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])
62AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
63 [ AC_MSG_RESULT([yes])
64 SYMBOL_VISIBILITY="-fvisibility=hidden"],
65 AC_MSG_RESULT([no]))
66CFLAGS="$saved_CFLAGS"
67AC_SUBST(SYMBOL_VISIBILITY)
68
69# 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
83
84dnl Generate the output
85AM_CONFIG_HEADER(bscconfig.h)
86
87AC_OUTPUT(
88 openbsc.pc
89 include/openbsc/Makefile
90 include/Makefile
91 src/Makefile
92 src/libtrau/Makefile
93 src/libabis/Makefile
94 src/libbsc/Makefile
95 src/libmsc/Makefile
96 src/libmgcp/Makefile
97 src/libcommon/Makefile
98 src/osmo-nitb/Makefile
99 src/osmo-bsc/Makefile
100 src/osmo-bsc_nat/Makefile
101 src/osmo-bsc_mgcp/Makefile
102 src/ipaccess/Makefile
103 src/utils/Makefile
104 src/libgb/Makefile
105 src/gprs/Makefile
106 tests/Makefile
107 tests/debug/Makefile
108 tests/gsm0408/Makefile
109 tests/db/Makefile
110 tests/channel/Makefile
111 tests/bsc-nat/Makefile
112 tests/mgcp/Makefile
113 doc/Makefile
114 doc/examples/Makefile
115 Makefile)