Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 1 | dnl Process this file with autoconf to produce a configure script |
Harald Welte | 5a29c7f | 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 | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 5 | |
Harald Welte | 5a29c7f | 2010-03-23 00:09:32 +0800 | [diff] [blame] | 6 | AM_INIT_AUTOMAKE([dist-bzip2]) |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 7 | |
Holger Hans Peter Freyther | 1f59ac4 | 2009-10-27 03:34:49 +0100 | [diff] [blame] | 8 | dnl kernel style compile messages |
| 9 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 10 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 11 | dnl checks for programs |
| 12 | AC_PROG_MAKE_SET |
| 13 | AC_PROG_CC |
| 14 | AC_PROG_INSTALL |
Holger Freyther | 3281f6e | 2009-02-20 18:33:00 +0000 | [diff] [blame] | 15 | AC_PROG_RANLIB |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 16 | |
| 17 | dnl checks for libraries |
Holger Freyther | b424ecb | 2009-06-08 10:32:28 +0000 | [diff] [blame] | 18 | AC_SEARCH_LIBS(crypt, crypt, |
| 19 | [LIBCRYPT="-lcrypt"; AC_DEFINE([VTY_CRYPT_PW], [], [Use crypt functionality of vty.])]) |
Harald Welte | 03800ba | 2010-05-18 00:20:21 +0200 | [diff] [blame] | 20 | AC_SEARCH_LIBS(gtp_new, gtp, |
| 21 | [LIBCRYPT="-lgtp"; AC_SUBST([GPRS_LIBGTP], [1])]) |
| 22 | |
| 23 | AM_CONDITIONAL(HAVE_LIBGTP, test "x$GPRS_LIBGTP" != "x") |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 24 | |
Holger Hans Peter Freyther | 30e1ae9 | 2010-07-30 02:53:14 +0800 | [diff] [blame] | 25 | |
| 26 | AC_ARG_ENABLE([nat], [AS_HELP_STRING([--enable-nat], [Build the BSC NAT. Requires SCCP])], |
| 27 | [ |
Harald Welte | d5db12c | 2010-08-03 15:11:51 +0200 | [diff] [blame] | 28 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.2) |
Holger Hans Peter Freyther | 30e1ae9 | 2010-07-30 02:53:14 +0800 | [diff] [blame] | 29 | osmo_ac_build_nat="yes" |
| 30 | ], |
| 31 | [ |
| 32 | osmo_ac_build_nat="no" |
| 33 | ]) |
| 34 | AM_CONDITIONAL(BUILD_NAT, test "x$osmo_ac_build_nat" = "xyes") |
| 35 | |
Harald Welte | d5db12c | 2010-08-03 15:11:51 +0200 | [diff] [blame] | 36 | AC_ARG_ENABLE([osmo-bsc], [AS_HELP_STRING([--enable-osmo-bsc], [Build the Osmo BSC])], |
Holger Hans Peter Freyther | 30e1ae9 | 2010-07-30 02:53:14 +0800 | [diff] [blame] | 37 | [ |
Holger Hans Peter Freyther | 784ca9c | 2011-06-04 16:59:37 +0200 | [diff] [blame] | 38 | PKG_CHECK_MODULES(LIBOSMOSCCP, libosmo-sccp >= 0.0.6) |
Holger Hans Peter Freyther | 30e1ae9 | 2010-07-30 02:53:14 +0800 | [diff] [blame] | 39 | osmo_ac_build_bsc="yes" |
| 40 | ], |
| 41 | [ |
| 42 | osmo_ac_build_bsc="no" |
| 43 | ]) |
| 44 | AM_CONDITIONAL(BUILD_BSC, test "x$osmo_ac_build_bsc" = "xyes") |
| 45 | |
Harald Welte | c90499b | 2011-06-26 14:48:11 +0200 | [diff] [blame] | 46 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.2) |
Harald Welte | ef466d4 | 2011-05-08 09:41:45 +0200 | [diff] [blame] | 47 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0) |
| 48 | PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.0) |
Harald Welte | f98a497 | 2010-02-20 17:29:27 +0100 | [diff] [blame] | 49 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 50 | dnl checks for header files |
| 51 | AC_HEADER_STDC |
Harald Welte | ca17ef8 | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 52 | AC_CHECK_HEADERS(dahdi/user.h,,AC_MSG_WARN(DAHDI input driver will not be built)) |
Pablo Neira Ayuso | 5d7ad47 | 2011-03-08 13:38:49 +0100 | [diff] [blame] | 53 | AC_CHECK_HEADERS(dbi/dbd.h,,AC_MSG_ERROR(DBI library is not installed)) |
Harald Welte | ca17ef8 | 2011-02-05 15:13:27 +0100 | [diff] [blame] | 54 | |
Harald Welte | de729a1 | 2008-12-23 21:01:25 +0000 | [diff] [blame] | 55 | |
| 56 | dnl Checks for typedefs, structures and compiler characteristics |
| 57 | |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 58 | # The following test is taken from WebKit's webkit.m4 |
| 59 | saved_CFLAGS="$CFLAGS" |
| 60 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 61 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
Alexander Huemer | db1bd69 | 2011-05-24 15:16:54 +0200 | [diff] [blame] | 62 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 63 | [ AC_MSG_RESULT([yes]) |
| 64 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 65 | AC_MSG_RESULT([no])) |
| 66 | CFLAGS="$saved_CFLAGS" |
| 67 | AC_SUBST(SYMBOL_VISIBILITY) |
| 68 | |
Holger Hans Peter Freyther | ecd94a4 | 2010-11-15 18:37:57 +0100 | [diff] [blame] | 69 | # Coverage build taken from WebKit's configure.in |
| 70 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 71 | AC_ARG_ENABLE(coverage, |
| 72 | AC_HELP_STRING([--enable-coverage], |
| 73 | [enable code coverage support [default=no]]), |
| 74 | [],[enable_coverage="no"]) |
| 75 | AC_MSG_RESULT([$enable_coverage]) |
| 76 | if 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]) |
| 81 | fi |
| 82 | |
Holger Freyther | 6d9f77a | 2009-06-08 10:32:54 +0000 | [diff] [blame] | 83 | |
| 84 | dnl Generate the output |
| 85 | AM_CONFIG_HEADER(bscconfig.h) |
| 86 | |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 87 | AC_OUTPUT( |
Holger Freyther | c7aa3c4 | 2009-06-08 10:32:39 +0000 | [diff] [blame] | 88 | openbsc.pc |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 89 | include/openbsc/Makefile |
| 90 | include/Makefile |
| 91 | src/Makefile |
Harald Welte | 89579b4 | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 92 | src/libtrau/Makefile |
| 93 | src/libabis/Makefile |
| 94 | src/libbsc/Makefile |
| 95 | src/libmsc/Makefile |
| 96 | src/libmgcp/Makefile |
| 97 | src/libcommon/Makefile |
Harald Welte | 31c00f7 | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 98 | src/osmo-nitb/Makefile |
| 99 | src/osmo-bsc/Makefile |
Harald Welte | a17faf8 | 2011-03-03 23:36:48 +0100 | [diff] [blame] | 100 | src/osmo-bsc_nat/Makefile |
| 101 | src/osmo-bsc_mgcp/Makefile |
Harald Welte | 31c00f7 | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 102 | src/ipaccess/Makefile |
| 103 | src/utils/Makefile |
Harald Welte | 89579b4 | 2011-03-04 13:18:30 +0100 | [diff] [blame] | 104 | src/libgb/Makefile |
Harald Welte | 31c00f7 | 2011-03-03 23:29:05 +0100 | [diff] [blame] | 105 | src/gprs/Makefile |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 106 | tests/Makefile |
Holger Freyther | d546e31 | 2008-12-27 12:03:07 +0000 | [diff] [blame] | 107 | tests/debug/Makefile |
Holger Freyther | aa0fb36 | 2008-12-28 21:55:40 +0000 | [diff] [blame] | 108 | tests/gsm0408/Makefile |
Holger Freyther | dbede4e | 2008-12-31 23:25:05 +0000 | [diff] [blame] | 109 | tests/db/Makefile |
Holger Hans Peter Freyther | 800d29d | 2009-06-10 12:36:38 +0200 | [diff] [blame] | 110 | tests/channel/Makefile |
Holger Hans Peter Freyther | 28e2988 | 2010-06-15 20:21:44 +0800 | [diff] [blame] | 111 | tests/bsc-nat/Makefile |
Holger Hans Peter Freyther | 9f239a2 | 2011-01-06 19:32:52 +0100 | [diff] [blame] | 112 | tests/mgcp/Makefile |
Harald Welte | eb11313 | 2011-05-11 22:11:28 +0200 | [diff] [blame] | 113 | doc/Makefile |
| 114 | doc/examples/Makefile |
Holger Freyther | 5f75598 | 2008-12-27 09:42:59 +0000 | [diff] [blame] | 115 | Makefile) |