Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script |
Harald Welte | fa13cad | 2010-03-23 00:09:32 +0800 | [diff] [blame] | 2 | AC_INIT([openbsc], |
| 3 | m4_esyscmd([./git-version-gen .tarball-version]), |
| 4 | [openbsc-devel@lists.openbsc.org]) |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 5 | |
Harald Welte | fa13cad | 2010-03-23 00:09:32 +0800 | [diff] [blame] | 6 | AM_INIT_AUTOMAKE([dist-bzip2]) |
Holger Hans Peter Freyther | fee826b | 2012-01-06 15:16:12 +0100 | [diff] [blame] | 7 | AC_CONFIG_TESTDIR(tests) |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 8 | |
Holger Hans Peter Freyther | c746e68 | 2009-10-27 03:34:49 +0100 | [diff] [blame] | 9 | dnl kernel style compile messages |
| 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 11 | |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 12 | dnl checks for programs |
| 13 | AC_PROG_MAKE_SET |
| 14 | AC_PROG_CC |
| 15 | AC_PROG_INSTALL |
Holger Freyther | 91f49f6 | 2009-02-20 18:33:00 +0000 | [diff] [blame] | 16 | AC_PROG_RANLIB |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 17 | |
| 18 | dnl checks for libraries |
Holger Freyther | 559bb71 | 2009-06-08 10:32:28 +0000 | [diff] [blame] | 19 | AC_SEARCH_LIBS(crypt, crypt, |
| 20 | [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])]) |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 21 | |
Holger Hans Peter Freyther | a8dffc1 | 2010-07-30 02:53:14 +0800 | [diff] [blame] | 22 | |
| 23 | AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], |
| 24 | [ |
Harald Welte | 90e5eae | 2010-08-03 15:11:51 +0200 | [diff] [blame] | 25 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) |
Holger Hans Peter Freyther | a8dffc1 | 2010-07-30 02:53:14 +0800 | [diff] [blame] | 26 | osmo_ac_build_nat="yes" |
| 27 | ], |
| 28 | [ |
| 29 | osmo_ac_build_nat="no" |
| 30 | ]) |
| 31 | AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") |
Holger Hans Peter Freyther | 34abf21 | 2012-01-09 22:53:04 +0100 | [diff] [blame] | 32 | AC_SUBST(osmo_ac_build_nat) |
Holger Hans Peter Freyther | a8dffc1 | 2010-07-30 02:53:14 +0800 | [diff] [blame] | 33 | |
Harald Welte | 90e5eae | 2010-08-03 15:11:51 +0200 | [diff] [blame] | 34 | AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], |
Holger Hans Peter Freyther | a8dffc1 | 2010-07-30 02:53:14 +0800 | [diff] [blame] | 35 | [ |
Holger Hans Peter Freyther | 80381e8 | 2011-06-04 16:59:37 +0200 | [diff] [blame] | 36 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) |
Holger Hans Peter Freyther | a8dffc1 | 2010-07-30 02:53:14 +0800 | [diff] [blame] | 37 | osmo_ac_build_bsc="yes" |
| 38 | ], |
| 39 | [ |
| 40 | osmo_ac_build_bsc="no" |
| 41 | ]) |
| 42 | AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") |
| 43 | |
Harald Welte | 3d8a8fd | 2011-06-26 14:48:11 +0200 | [diff] [blame] | 44 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2) |
Harald Welte | 4d109ff | 2011-05-08 09:41:45 +0200 | [diff] [blame] | 45 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) |
| 46 | PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0) |
Harald Welte | 3386bdc | 2011-10-10 09:11:29 +0200 | [diff] [blame] | 47 | PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.1.0) |
Harald Welte | 9c38ed6 | 2010-02-20 17:29:27 +0100 | [diff] [blame] | 48 | |
Sylvain Munaut | f4b4e8f | 2011-10-18 13:27:00 +0200 | [diff] [blame] | 49 | found_libgtp=yes |
| 50 | PKG_CHECK_MODULES(LIBGTP, libgtp, , found_libgtp=no) |
| 51 | AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) |
| 52 | |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 53 | dnl checks for header files |
| 54 | AC_HEADER_STDC |
Harald Welte | c7841cc | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 55 | AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) |
Pablo Neira Ayuso | f58692f | 2011-03-08 13:38:49 +0100 | [diff] [blame] | 56 | AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) |
Harald Welte | c7841cc | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 57 | |
Harald Welte | 2b944cf | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 58 | |
| 59 | dnl Checks for typedefs, structures and compiler characteristics |
| 60 | |
Holger Freyther | 64026e9 | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 61 | # The following test is taken from WebKit's webkit.m4 |
| 62 | saved_CFLAGS="$CFLAGS" |
| 63 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 64 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
Alexander Huemer | 93ae2d6 | 2011-05-24 15:16:54 +0200 | [diff] [blame] | 65 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], |
Holger Freyther | 64026e9 | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 66 | [ AC_MSG_RESULT([yes]) |
| 67 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 68 | AC_MSG_RESULT([no])) |
| 69 | CFLAGS="$saved_CFLAGS" |
| 70 | AC_SUBST(SYMBOL_VISIBILITY) |
| 71 | |
Holger Hans Peter Freyther | 16bdb14 | 2010-11-15 18:37:57 +0100 | [diff] [blame] | 72 | # Coverage build taken from WebKit's configure.in |
| 73 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 74 | AC_ARG_ENABLE(coverage, |
| 75 | AC_HELP_STRING([--enable-coverage], |
| 76 | [enable code coverage support [default=no]]), |
| 77 | [],[enable_coverage="no"]) |
| 78 | AC_MSG_RESULT([$enable_coverage]) |
| 79 | if test "$enable_coverage" = "yes"; then |
| 80 | COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs" |
| 81 | COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" |
| 82 | AC_SUBST([COVERAGE_CFLAGS]) |
| 83 | AC_SUBST([COVERAGE_LDFLAGS]) |
| 84 | fi |
| 85 | |
Holger Freyther | 64026e9 | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 86 | |
| 87 | dnl Generate the output |
| 88 | AM_CONFIG_HEADER(bscconfig.h) |
| 89 | |
Holger Freyther | 1bad601 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 90 | AC_OUTPUT( |
Holger Freyther | b27d845 | 2009-06-08 10:32:39 +0000 | [diff] [blame] | 91 | openbsc.pc |
Holger Freyther | 1bad601 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 92 | include/openbsc/Makefile |
| 93 | include/Makefile |
| 94 | src/Makefile |
Harald Welte | 3d1aaac | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 95 | src/libtrau/Makefile |
Harald Welte | 3d1aaac | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 96 | src/libbsc/Makefile |
Daniel Willmann | 27da244 | 2010-10-21 15:00:36 +0200 | [diff] [blame] | 97 | src/libctrl/Makefile |
Harald Welte | 3d1aaac | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 98 | src/libmsc/Makefile |
| 99 | src/libmgcp/Makefile |
| 100 | src/libcommon/Makefile |
Harald Welte | 4f272cc | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 101 | src/osmo-nitb/Makefile |
| 102 | src/osmo-bsc/Makefile |
Harald Welte | acdcfea | 2011-03-03 23:36:48 +0100 | [diff] [blame] | 103 | src/osmo-bsc_nat/Makefile |
| 104 | src/osmo-bsc_mgcp/Makefile |
Harald Welte | 4f272cc | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 105 | src/ipaccess/Makefile |
| 106 | src/utils/Makefile |
Harald Welte | 3d1aaac | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 107 | src/libgb/Makefile |
Harald Welte | 4f272cc | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 108 | src/gprs/Makefile |
Holger Freyther | 1bad601 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 109 | tests/Makefile |
Holger Hans Peter Freyther | 34abf21 | 2012-01-09 22:53:04 +0100 | [diff] [blame] | 110 | tests/atlocal |
Holger Freyther | c95546b | 2008-12-27 12:03:07 +0000 | [diff] [blame] | 111 | tests/debug/Makefile |
Holger Freyther | ec5b1d8 | 2008-12-28 21:55:40 +0000 | [diff] [blame] | 112 | tests/gsm0408/Makefile |
Holger Freyther | c1e1192 | 2008-12-31 23:25:05 +0000 | [diff] [blame] | 113 | tests/db/Makefile |
Holger Hans Peter Freyther | f8584a1 | 2009-06-10 12:36:38 +0200 | [diff] [blame] | 114 | tests/channel/Makefile |
Holger Hans Peter Freyther | 4dfa08d | 2010-06-15 20:21:44 +0800 | [diff] [blame] | 115 | tests/bsc-nat/Makefile |
Holger Hans Peter Freyther | f0bc075 | 2011-01-06 19:32:52 +0100 | [diff] [blame] | 116 | tests/mgcp/Makefile |
Holger Hans Peter Freyther | 6721a08 | 2011-06-23 17:53:27 -0400 | [diff] [blame] | 117 | tests/gprs/Makefile |
Harald Welte | 2d6f49d | 2011-05-11 22:11:28 +0200 | [diff] [blame] | 118 | doc/Makefile |
| 119 | doc/examples/Makefile |
Holger Freyther | 1bad601 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 120 | Makefile) |