Harald Welte | 681f119 | 2020-04-20 12:00:33 +0200 | [diff] [blame] | 1 | # Process this file with autoconf to produce a configure script. |
| 2 | AC_INIT([osmo-uecups],[m4_esyscmd(./git-version-gen .tarball-version)],[osmocom-net-gprs@lists.osmocom.org]) |
| 3 | |
| 4 | dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ |
| 5 | AC_CONFIG_AUX_DIR([.]) |
| 6 | |
| 7 | AM_INIT_AUTOMAKE([dist-bzip2]) |
| 8 | |
| 9 | dnl kernel style compile messages |
| 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 11 | |
| 12 | dnl include release helper |
| 13 | RELMAKE='-include osmo-release.mk' |
| 14 | AC_SUBST([RELMAKE]) |
| 15 | |
| 16 | # Checks for programs. |
| 17 | AC_PROG_MAKE_SET |
| 18 | AC_PROG_CC |
| 19 | AC_PROG_INSTALL |
| 20 | LT_INIT |
| 21 | |
| 22 | dnl check for pkg-config (explained in detail in libosmocore/configure.ac) |
| 23 | AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no) |
| 24 | if test "x$PKG_CONFIG_INSTALLED" = "xno"; then |
| 25 | AC_MSG_WARN([You need to install pkg-config]) |
| 26 | fi |
| 27 | PKG_PROG_PKG_CONFIG([0.20]) |
| 28 | |
Pau Espin Pedrol | 6fca3d1 | 2023-02-07 17:45:20 +0100 | [diff] [blame] | 29 | PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.8.0) |
| 30 | PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.8.0) |
| 31 | PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.3.0) |
Harald Welte | 681f119 | 2020-04-20 12:00:33 +0200 | [diff] [blame] | 32 | PKG_CHECK_MODULES(LIBJANSSON, jansson) |
| 33 | PKG_CHECK_MODULES(LIBNLROUTE3, libnl-route-3.0) |
| 34 | |
| 35 | AC_HEADER_STDC |
| 36 | |
| 37 | AC_ARG_ENABLE(sanitize, |
| 38 | [AS_HELP_STRING( |
| 39 | [--enable-sanitize], |
| 40 | [Compile with address sanitizer enabled], |
| 41 | )], |
| 42 | [sanitize=$enableval], [sanitize="no"]) |
| 43 | if test x"$sanitize" = x"yes" |
| 44 | then |
| 45 | CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" |
| 46 | CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" |
| 47 | fi |
| 48 | |
| 49 | AC_ARG_ENABLE(werror, |
| 50 | [AS_HELP_STRING( |
| 51 | [--enable-werror], |
| 52 | [Turn all compiler warnings into errors, with exceptions: |
| 53 | a) deprecation (allow upstream to mark deprecation without breaking builds); |
| 54 | b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) |
| 55 | ] |
| 56 | )], |
| 57 | [werror=$enableval], [werror="no"]) |
| 58 | if test x"$werror" = x"yes" |
| 59 | then |
| 60 | WERROR_FLAGS="-Werror" |
| 61 | WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" |
| 62 | WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" |
| 63 | CFLAGS="$CFLAGS $WERROR_FLAGS" |
| 64 | CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" |
| 65 | fi |
| 66 | |
| 67 | # The following test is taken from WebKit's webkit.m4 |
| 68 | saved_CFLAGS="$CFLAGS" |
| 69 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 70 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
| 71 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], |
| 72 | [ AC_MSG_RESULT([yes]) |
| 73 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 74 | AC_MSG_RESULT([no])) |
| 75 | CFLAGS="$saved_CFLAGS" |
| 76 | AC_SUBST(SYMBOL_VISIBILITY) |
| 77 | |
Harald Welte | 681f119 | 2020-04-20 12:00:33 +0200 | [diff] [blame] | 78 | # Coverage build taken from WebKit's configure.in |
| 79 | AC_MSG_CHECKING([whether to enable code coverage support]) |
| 80 | AC_ARG_ENABLE(coverage, |
| 81 | AC_HELP_STRING([--enable-coverage], |
| 82 | [enable code coverage support [default=no]]), |
| 83 | [],[enable_coverage="no"]) |
| 84 | AC_MSG_RESULT([$enable_coverage]) |
| 85 | if test "$enable_coverage" = "yes"; then |
| 86 | COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs" |
| 87 | COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs" |
| 88 | AC_SUBST([COVERAGE_CFLAGS]) |
| 89 | AC_SUBST([COVERAGE_LDFLAGS]) |
| 90 | fi |
| 91 | |
| 92 | AC_ARG_ENABLE(profile, |
| 93 | [AS_HELP_STRING([--enable-profile], [Compile with profiling support enabled], )], |
| 94 | [profile=$enableval], [profile="no"]) |
| 95 | if test x"$profile" = x"yes" |
| 96 | then |
| 97 | CFLAGS="$CFLAGS -pg" |
| 98 | CPPFLAGS="$CPPFLAGS -pg" |
| 99 | fi |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | AC_MSG_RESULT([CFLAGS="$CFLAGS"]) |
| 105 | AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) |
| 106 | |
| 107 | AC_OUTPUT( |
| 108 | Makefile |
| 109 | daemon/Makefile |
| 110 | doc/Makefile |
| 111 | doc/examples/Makefile |
Harald Welte | e051427 | 2022-11-06 12:26:45 +0100 | [diff] [blame] | 112 | contrib/osmo-uecups.spec |
Harald Welte | 681f119 | 2020-04-20 12:00:33 +0200 | [diff] [blame] | 113 | ) |