Harald Welte | 3761ef4 | 2016-01-03 18:07:32 +0100 | [diff] [blame] | 1 | AC_INIT([osmo-iuh], |
| 2 | m4_esyscmd([./git-version-gen .tarball-version]), |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 3 | [openbsc@lists.osmocom.org]) |
| 4 | |
Neels Hofmeyr | 08d5c8c | 2016-10-01 00:34:48 +0200 | [diff] [blame] | 5 | dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ |
| 6 | AC_CONFIG_AUX_DIR([.]) |
| 7 | |
Harald Welte | 0322feb | 2016-01-03 15:39:11 +0100 | [diff] [blame] | 8 | LT_INIT |
| 9 | |
Neels Hofmeyr | c636cab | 2016-08-26 23:41:46 +0200 | [diff] [blame] | 10 | AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.9 tar-ustar]) |
Neels Hofmeyr | e7d6476 | 2016-08-18 15:57:04 +0200 | [diff] [blame] | 11 | dnl tar-ustar: some asn1 filenames surpass the 99 char limit of tar, so we need |
| 12 | dnl to make tar allow longer filenames. |
| 13 | |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 14 | AC_CONFIG_TESTDIR(src/tests) |
| 15 | |
| 16 | dnl kernel style compile messages |
| 17 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 18 | |
Max | 5a3df8f | 2017-08-28 12:00:58 +0200 | [diff] [blame] | 19 | dnl include release helper |
| 20 | RELMAKE='-include osmo-release.mk' |
| 21 | AC_SUBST([RELMAKE]) |
| 22 | |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 23 | dnl checks for programs |
| 24 | AC_PROG_MAKE_SET |
| 25 | AC_PROG_MKDIR_P |
| 26 | AC_PROG_CC |
| 27 | AC_PROG_INSTALL |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 28 | |
Neels Hofmeyr | a44cb48 | 2016-10-01 00:52:01 +0200 | [diff] [blame] | 29 | dnl check for pkg-config (explained in detail in libosmocore/configure.ac) |
| 30 | AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) |
| 31 | if test "x$PKG_CONFIG_INSTALLED" = "xno"; then |
| 32 | AC_MSG_WARN([You need to install pkg-config]) |
| 33 | fi |
| 34 | PKG_PROG_PKG_CONFIG([0.20]) |
| 35 | |
Harald Welte | 961674a | 2017-10-27 22:01:29 +0200 | [diff] [blame] | 36 | PKG_CHECK_MODULES(OSMOCORE, libosmocore >= 0.10.0) |
| 37 | PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.10.0) |
| 38 | PKG_CHECK_MODULES(OSMOVTY, libosmovty >= 0.10.0) |
Max | ef72741 | 2017-12-26 19:27:43 +0100 | [diff] [blame] | 39 | PKG_CHECK_MODULES(OSMOCTRL, libosmoctrl) |
Harald Welte | 961674a | 2017-10-27 22:01:29 +0200 | [diff] [blame] | 40 | PKG_CHECK_MODULES(OSMONETIF, libosmo-netif >= 0.1.0) |
| 41 | PKG_CHECK_MODULES(OSMOSIGTRAN, libosmo-sigtran >= 0.8.0) |
| 42 | PKG_CHECK_MODULES(ASN1C, libasn1c >= 0.9.28) |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 43 | |
| 44 | AC_CONFIG_MACRO_DIR([m4]) |
| 45 | |
| 46 | dnl checks for header files |
| 47 | AC_HEADER_STDC |
| 48 | |
Neels Hofmeyr | 4325a2a | 2017-11-16 11:02:48 +0100 | [diff] [blame] | 49 | AC_ARG_ENABLE(sanitize, |
| 50 | [AS_HELP_STRING( |
| 51 | [--enable-sanitize], |
| 52 | [Compile with address sanitizer enabled], |
| 53 | )], |
| 54 | [sanitize=$enableval], [sanitize="no"]) |
| 55 | if test x"$sanitize" = x"yes" |
| 56 | then |
| 57 | CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" |
| 58 | CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" |
| 59 | fi |
| 60 | |
Neels Hofmeyr | 666121a | 2018-03-05 20:43:10 +0100 | [diff] [blame] | 61 | AC_ARG_ENABLE(werror, |
| 62 | [AS_HELP_STRING( |
| 63 | [--enable-werror], |
| 64 | [Turn all compiler warnings into errors, with exceptions: |
| 65 | a) deprecation (allow upstream to mark deprecation without breaking builds); |
| 66 | b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) |
| 67 | ] |
| 68 | )], |
| 69 | [werror=$enableval], [werror="no"]) |
| 70 | if test x"$werror" = x"yes" |
| 71 | then |
| 72 | WERROR_FLAGS="-Werror" |
| 73 | WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" |
| 74 | WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" |
| 75 | CFLAGS="$CFLAGS $WERROR_FLAGS" |
| 76 | CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" |
| 77 | fi |
| 78 | |
Pau Espin Pedrol | aec91ab | 2018-01-22 19:03:37 +0100 | [diff] [blame] | 79 | CFLAGS="$CFLAGS -Wall" |
| 80 | CPPFLAGS="$CPPFLAGS -Wall" |
| 81 | |
Neels Hofmeyr | 666121a | 2018-03-05 20:43:10 +0100 | [diff] [blame] | 82 | AC_MSG_RESULT([CFLAGS="$CFLAGS"]) |
| 83 | AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) |
| 84 | |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 85 | AC_OUTPUT( |
Harald Welte | 216ac21 | 2016-01-03 18:12:22 +0100 | [diff] [blame] | 86 | libosmo-ranap.pc |
Daniel Willmann | 29b9e00 | 2015-12-15 15:10:31 +0100 | [diff] [blame] | 87 | src/Makefile |
| 88 | src/hnbap/Makefile |
| 89 | src/ranap/Makefile |
| 90 | src/rua/Makefile |
| 91 | src/tests/Makefile |
Neels Hofmeyr | c04a96c | 2016-01-04 18:03:31 +0100 | [diff] [blame] | 92 | Makefile |
| 93 | include/Makefile |
| 94 | include/osmocom/Makefile |
Neels Hofmeyr | f1f2d7c | 2016-01-05 12:00:06 +0100 | [diff] [blame] | 95 | include/osmocom/hnbap/Makefile |
| 96 | include/osmocom/ranap/Makefile |
| 97 | include/osmocom/rua/Makefile |
Neels Hofmeyr | 926153b | 2016-08-18 02:15:56 +0200 | [diff] [blame] | 98 | include/osmocom/iuh/Makefile |
Neels Hofmeyr | 4d91ab2 | 2016-08-18 16:10:52 +0200 | [diff] [blame] | 99 | doc/Makefile |
Neels Hofmeyr | 01c71fc | 2016-08-18 16:11:37 +0200 | [diff] [blame] | 100 | doc/examples/Makefile |
Neels Hofmeyr | c04a96c | 2016-01-04 18:03:31 +0100 | [diff] [blame] | 101 | ) |