Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 1 | AC_INIT([osmo-hlr], |
| 2 | m4_esyscmd([./git-version-gen .tarball-version]), |
| 3 | [openbsc@lists.osmocom.org]) |
| 4 | |
| 5 | dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ |
| 6 | AC_CONFIG_AUX_DIR([.]) |
| 7 | |
| 8 | dnl libtool init |
| 9 | LT_INIT |
| 10 | |
| 11 | AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.9]) |
| 12 | |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 13 | AC_CONFIG_TESTDIR(tests) |
| 14 | |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 15 | dnl kernel style compile messages |
| 16 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 17 | |
Max | 43bf7bc | 2017-08-25 18:27:28 +0200 | [diff] [blame] | 18 | dnl include release helper |
| 19 | RELMAKE='-include osmo-release.mk' |
| 20 | AC_SUBST([RELMAKE]) |
| 21 | |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 22 | dnl checks for programs |
| 23 | AC_PROG_MAKE_SET |
| 24 | AC_PROG_MKDIR_P |
| 25 | AC_PROG_CC |
| 26 | AC_PROG_INSTALL |
| 27 | |
| 28 | dnl check for pkg-config (explained in detail in libosmocore/configure.ac) |
| 29 | AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) |
| 30 | if test "x$PKG_CONFIG_INSTALLED" = "xno"; then |
| 31 | AC_MSG_WARN([You need to install pkg-config]) |
| 32 | fi |
| 33 | PKG_PROG_PKG_CONFIG([0.20]) |
| 34 | |
| 35 | PKG_CHECK_MODULES(TALLOC, [talloc >= 2.0.1]) |
| 36 | |
Pau Espin Pedrol | cb360f0 | 2018-05-03 16:27:14 +0200 | [diff] [blame] | 37 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0) |
| 38 | PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0) |
| 39 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0) |
| 40 | PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.11.0) |
| 41 | PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0) |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 42 | |
Neels Hofmeyr | c317cc2 | 2016-12-13 14:33:26 +0100 | [diff] [blame] | 43 | PKG_CHECK_MODULES(SQLITE3, sqlite3) |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 44 | |
| 45 | AC_CONFIG_MACRO_DIR([m4]) |
| 46 | |
| 47 | dnl checks for header files |
| 48 | AC_HEADER_STDC |
| 49 | |
Neels Hofmeyr | 6f3e8d6 | 2017-11-17 01:43:36 +0100 | [diff] [blame] | 50 | AC_ARG_ENABLE(sanitize, |
| 51 | [AS_HELP_STRING( |
| 52 | [--enable-sanitize], |
| 53 | [Compile with address sanitizer enabled], |
| 54 | )], |
| 55 | [sanitize=$enableval], [sanitize="no"]) |
| 56 | if test x"$sanitize" = x"yes" |
| 57 | then |
| 58 | CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" |
| 59 | CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" |
| 60 | fi |
| 61 | |
Neels Hofmeyr | 2e78858 | 2018-03-05 20:42:57 +0100 | [diff] [blame] | 62 | AC_ARG_ENABLE(werror, |
| 63 | [AS_HELP_STRING( |
| 64 | [--enable-werror], |
| 65 | [Turn all compiler warnings into errors, with exceptions: |
| 66 | a) deprecation (allow upstream to mark deprecation without breaking builds); |
| 67 | b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) |
| 68 | ] |
| 69 | )], |
| 70 | [werror=$enableval], [werror="no"]) |
| 71 | if test x"$werror" = x"yes" |
| 72 | then |
| 73 | WERROR_FLAGS="-Werror" |
| 74 | WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" |
| 75 | WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" |
| 76 | CFLAGS="$CFLAGS $WERROR_FLAGS" |
| 77 | CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" |
| 78 | fi |
| 79 | |
Neels Hofmeyr | f95ce04 | 2017-09-25 23:22:02 +0200 | [diff] [blame] | 80 | AC_ARG_ENABLE([external_tests], |
| 81 | AC_HELP_STRING([--enable-external-tests], |
| 82 | [Include the VTY/CTRL tests in make check [default=no]]), |
| 83 | [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) |
| 84 | if test "x$enable_ext_tests" = "xyes" ; then |
| 85 | AM_PATH_PYTHON |
| 86 | AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) |
| 87 | if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then |
| 88 | AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) |
| 89 | fi |
| 90 | fi |
| 91 | AC_MSG_CHECKING([whether to enable VTY/CTRL tests]) |
| 92 | AC_MSG_RESULT([$enable_ext_tests]) |
| 93 | AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes") |
| 94 | |
Neels Hofmeyr | 2e78858 | 2018-03-05 20:42:57 +0100 | [diff] [blame] | 95 | AC_MSG_RESULT([CFLAGS="$CFLAGS"]) |
| 96 | AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) |
| 97 | |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 98 | AC_OUTPUT( |
| 99 | Makefile |
Alexander Couzens | 38f0877 | 2017-11-16 01:01:09 +0100 | [diff] [blame] | 100 | doc/Makefile |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 101 | src/Makefile |
Harald Welte | ec6915a | 2018-07-23 14:25:33 +0200 | [diff] [blame] | 102 | src/gsupclient/Makefile |
| 103 | include/Makefile |
| 104 | libosmo-gsup-client.pc |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 105 | sql/Makefile |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 106 | tests/Makefile |
| 107 | tests/auc/Makefile |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 108 | tests/auc/gen_ts_55_205_test_sets/Makefile |
Neels Hofmeyr | cab2fcd | 2017-03-15 00:07:43 +0100 | [diff] [blame] | 109 | tests/gsup_server/Makefile |
Neels Hofmeyr | 9d307ec | 2018-05-04 16:06:32 +0200 | [diff] [blame] | 110 | tests/gsup/Makefile |
Neels Hofmeyr | 9850946 | 2017-10-09 17:28:53 +0200 | [diff] [blame] | 111 | tests/db/Makefile |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 112 | ) |