Harald Welte | 3aa901d | 2018-08-13 18:32:36 +0200 | [diff] [blame] | 1 | AC_INIT([osmo-remsim], |
| 2 | m4_esyscmd([./git-version-gen .tarball-version]), |
| 3 | [simtrace@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 | LT_INIT |
| 9 | |
| 10 | AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.9 tar-ustar]) |
| 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 | |
| 14 | |
| 15 | dnl kernel style compile messages |
| 16 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 17 | |
| 18 | dnl include release helper |
| 19 | RELMAKE='-include osmo-release.mk' |
| 20 | AC_SUBST([RELMAKE]) |
| 21 | |
| 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 | |
Harald Welte | b0cef1d | 2018-10-15 02:03:10 +0200 | [diff] [blame] | 35 | AC_CHECK_LIB(csv, csv_init, LIBS="$LIBS -lcsv", [AC_MSG_ERROR([*** libcsv library not found!])]) |
| 36 | AC_CHECK_HEADERS([csv.h]) |
| 37 | |
Harald Welte | 3aa901d | 2018-08-13 18:32:36 +0200 | [diff] [blame] | 38 | PKG_CHECK_MODULES(OSMOCORE, libosmocore >= 0.11.0) |
Harald Welte | 77911b0 | 2018-08-14 23:47:30 +0200 | [diff] [blame] | 39 | PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.11.0) |
| 40 | PKG_CHECK_MODULES(OSMOABIS, libosmoabis) |
Kévin Redon | e0b837c | 2018-10-10 00:39:25 +0200 | [diff] [blame] | 41 | PKG_CHECK_MODULES(OSMOSIM, libosmosim) |
Harald Welte | 77911b0 | 2018-08-14 23:47:30 +0200 | [diff] [blame] | 42 | PKG_CHECK_MODULES(PCSC, libpcsclite) |
Kévin Redon | e0b837c | 2018-10-10 00:39:25 +0200 | [diff] [blame] | 43 | PKG_CHECK_MODULES(USB, libusb-1.0) |
Harald Welte | f5a0fa3 | 2019-03-03 15:44:18 +0100 | [diff] [blame] | 44 | PKG_CHECK_MODULES(ULFIUS, libulfius) |
| 45 | PKG_CHECK_MODULES(JANSSON, jansson) |
Harald Welte | 3aa901d | 2018-08-13 18:32:36 +0200 | [diff] [blame] | 46 | |
| 47 | AC_CONFIG_MACRO_DIR([m4]) |
| 48 | |
| 49 | dnl checks for header files |
| 50 | AC_HEADER_STDC |
| 51 | |
| 52 | AC_ARG_ENABLE(sanitize, |
| 53 | [AS_HELP_STRING( |
| 54 | [--enable-sanitize], |
| 55 | [Compile with address sanitizer enabled], |
| 56 | )], |
| 57 | [sanitize=$enableval], [sanitize="no"]) |
| 58 | if test x"$sanitize" = x"yes" |
| 59 | then |
| 60 | CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" |
| 61 | CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" |
| 62 | fi |
| 63 | |
| 64 | AC_ARG_ENABLE(werror, |
| 65 | AS_HELP_STRING( |
| 66 | [--enable-werror], |
| 67 | [Turn all compiler warnings into errors, with exceptions: |
| 68 | a) deprecation (allow upstream to mark deprecation without breaking builds); |
| 69 | b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) |
| 70 | ] |
| 71 | )], |
| 72 | [werror=$enableval], [werror="no"]) |
| 73 | if test x"$werror" = x"yes" |
| 74 | then |
| 75 | WERROR_FLAGS="-Werror" |
| 76 | WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" |
| 77 | WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" |
| 78 | CFLAGS="$CFLAGS $WERROR_FLAGS" |
| 79 | CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" |
| 80 | fi |
| 81 | |
| 82 | CFLAGS="$CFLAGS -Wall" |
| 83 | CPPFLAGS="$CPPFLAGS -Wall" |
| 84 | |
| 85 | AC_MSG_RESULT([CFLAGS="$CFLAGS"]) |
| 86 | AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) |
| 87 | |
| 88 | AC_OUTPUT( |
| 89 | Makefile |
| 90 | src/Makefile |
| 91 | src/rspro/Makefile |
Harald Welte | f5a0fa3 | 2019-03-03 15:44:18 +0100 | [diff] [blame] | 92 | src/server/Makefile |
Harald Welte | 3aa901d | 2018-08-13 18:32:36 +0200 | [diff] [blame] | 93 | include/Makefile |
| 94 | include/osmocom/Makefile |
| 95 | include/osmocom/rspro/Makefile |
| 96 | ) |