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 | |
Oliver Smith | f08da24 | 2018-11-14 10:47:01 +0100 | [diff] [blame] | 95 | # Generate manuals |
| 96 | AC_ARG_ENABLE(manuals, |
| 97 | [AS_HELP_STRING( |
| 98 | [--enable-manuals], |
| 99 | [Generate manual PDFs [default=no]], |
| 100 | )], |
| 101 | [osmo_ac_build_manuals=$enableval], [osmo_ac_build_manuals="no"]) |
| 102 | AM_CONDITIONAL([BUILD_MANUALS], [test x"$osmo_ac_build_manuals" = x"yes"]) |
| 103 | AC_ARG_VAR(OSMO_GSM_MANUALS_DIR, [path to common osmo-gsm-manuals files, overriding pkg-config and "../osmo-gsm-manuals" |
| 104 | fallback]) |
| 105 | if test x"$osmo_ac_build_manuals" = x"yes" |
| 106 | then |
| 107 | # Find OSMO_GSM_MANUALS_DIR (env, pkg-conf, fallback) |
| 108 | if test -n "$OSMO_GSM_MANUALS_DIR"; then |
| 109 | echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from env)" |
| 110 | else |
| 111 | OSMO_GSM_MANUALS_DIR="$($PKG_CONFIG osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null)" |
| 112 | if test -n "$OSMO_GSM_MANUALS_DIR"; then |
| 113 | echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from pkg-conf)" |
| 114 | else |
| 115 | OSMO_GSM_MANUALS_DIR="../osmo-gsm-manuals" |
| 116 | echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (fallback)" |
| 117 | fi |
| 118 | fi |
| 119 | if ! test -d "$OSMO_GSM_MANUALS_DIR"; then |
| 120 | AC_MSG_ERROR("OSMO_GSM_MANUALS_DIR does not exist! Install osmo-gsm-manuals or set OSMO_GSM_MANUALS_DIR.") |
| 121 | fi |
| 122 | |
| 123 | # Find and run check-depends |
| 124 | CHECK_DEPENDS="$OSMO_GSM_MANUALS_DIR/check-depends.sh" |
| 125 | if ! test -x "$CHECK_DEPENDS"; then |
| 126 | CHECK_DEPENDS="osmo-gsm-manuals-check-depends" |
| 127 | fi |
| 128 | if ! $CHECK_DEPENDS; then |
| 129 | AC_MSG_ERROR("missing dependencies for --enable-manuals") |
| 130 | fi |
| 131 | |
| 132 | # Put in Makefile with absolute path |
| 133 | OSMO_GSM_MANUALS_DIR="$(realpath "$OSMO_GSM_MANUALS_DIR")" |
| 134 | AC_SUBST([OSMO_GSM_MANUALS_DIR]) |
| 135 | fi |
| 136 | |
Pau Espin Pedrol | 6fe1c22 | 2018-09-10 12:27:21 +0200 | [diff] [blame] | 137 | # https://www.freedesktop.org/software/systemd/man/daemon.html |
| 138 | AC_ARG_WITH([systemdsystemunitdir], |
| 139 | [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, |
| 140 | [with_systemdsystemunitdir=auto]) |
| 141 | AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ |
| 142 | def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd) |
| 143 | |
| 144 | AS_IF([test "x$def_systemdsystemunitdir" = "x"], |
| 145 | [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], |
| 146 | [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) |
| 147 | with_systemdsystemunitdir=no], |
| 148 | [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) |
| 149 | AS_IF([test "x$with_systemdsystemunitdir" != "xno"], |
| 150 | [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) |
| 151 | AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) |
| 152 | |
Neels Hofmeyr | 2e78858 | 2018-03-05 20:42:57 +0100 | [diff] [blame] | 153 | AC_MSG_RESULT([CFLAGS="$CFLAGS"]) |
| 154 | AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) |
| 155 | |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 156 | AC_OUTPUT( |
| 157 | Makefile |
Alexander Couzens | 38f0877 | 2017-11-16 01:01:09 +0100 | [diff] [blame] | 158 | doc/Makefile |
Pau Espin Pedrol | 966fcb2 | 2018-09-12 18:15:03 +0200 | [diff] [blame] | 159 | doc/examples/Makefile |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 160 | src/Makefile |
Harald Welte | ec6915a | 2018-07-23 14:25:33 +0200 | [diff] [blame] | 161 | src/gsupclient/Makefile |
| 162 | include/Makefile |
| 163 | libosmo-gsup-client.pc |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 164 | sql/Makefile |
Oliver Smith | f08da24 | 2018-11-14 10:47:01 +0100 | [diff] [blame] | 165 | doc/manuals/Makefile |
Pau Espin Pedrol | 6fe1c22 | 2018-09-10 12:27:21 +0200 | [diff] [blame] | 166 | contrib/Makefile |
| 167 | contrib/systemd/Makefile |
Neels Hofmeyr | 00c0697 | 2017-01-31 01:19:27 +0100 | [diff] [blame] | 168 | tests/Makefile |
| 169 | tests/auc/Makefile |
Neels Hofmeyr | 6b883f7 | 2017-01-31 16:40:28 +0100 | [diff] [blame] | 170 | tests/auc/gen_ts_55_205_test_sets/Makefile |
Neels Hofmeyr | cab2fcd | 2017-03-15 00:07:43 +0100 | [diff] [blame] | 171 | tests/gsup_server/Makefile |
Neels Hofmeyr | 9d307ec | 2018-05-04 16:06:32 +0200 | [diff] [blame] | 172 | tests/gsup/Makefile |
Neels Hofmeyr | 9850946 | 2017-10-09 17:28:53 +0200 | [diff] [blame] | 173 | tests/db/Makefile |
Neels Hofmeyr | 40d8b01 | 2016-12-11 00:27:48 +0100 | [diff] [blame] | 174 | ) |