blob: e0ee4b94f531882e84f9491deb48dd7755109305 [file] [log] [blame]
Harald Welte3aa901d2018-08-13 18:32:36 +02001AC_INIT([osmo-remsim],
2 m4_esyscmd([./git-version-gen .tarball-version]),
3 [simtrace@lists.osmocom.org])
4
5dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
6AC_CONFIG_AUX_DIR([.])
7
8LT_INIT
9
10AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.9 tar-ustar])
11dnl tar-ustar: some asn1 filenames surpass the 99 char limit of tar, so we need
12dnl to make tar allow longer filenames.
13
14
15dnl kernel style compile messages
16m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
17
18dnl include release helper
19RELMAKE='-include osmo-release.mk'
20AC_SUBST([RELMAKE])
21
22dnl checks for programs
23AC_PROG_MAKE_SET
24AC_PROG_MKDIR_P
25AC_PROG_CC
26AC_PROG_INSTALL
27
28dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
29AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
30if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
31 AC_MSG_WARN([You need to install pkg-config])
32fi
33PKG_PROG_PKG_CONFIG([0.20])
34
35PKG_CHECK_MODULES(OSMOCORE, libosmocore >= 0.11.0)
Harald Welte77911b02018-08-14 23:47:30 +020036PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.11.0)
37PKG_CHECK_MODULES(OSMOABIS, libosmoabis)
Harald Welte77911b02018-08-14 23:47:30 +020038PKG_CHECK_MODULES(PCSC, libpcsclite)
Harald Welte3aa901d2018-08-13 18:32:36 +020039
40AC_CONFIG_MACRO_DIR([m4])
41
42dnl checks for header files
43AC_HEADER_STDC
44
45AC_ARG_ENABLE(sanitize,
46 [AS_HELP_STRING(
47 [--enable-sanitize],
48 [Compile with address sanitizer enabled],
49 )],
50 [sanitize=$enableval], [sanitize="no"])
51if test x"$sanitize" = x"yes"
52then
53 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
54 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
55fi
56
57AC_ARG_ENABLE(werror,
58 AS_HELP_STRING(
59 [--enable-werror],
60 [Turn all compiler warnings into errors, with exceptions:
61 a) deprecation (allow upstream to mark deprecation without breaking builds);
62 b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
63 ]
64 )],
65 [werror=$enableval], [werror="no"])
66if test x"$werror" = x"yes"
67then
68 WERROR_FLAGS="-Werror"
69 WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
70 WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
71 CFLAGS="$CFLAGS $WERROR_FLAGS"
72 CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
73fi
74
75CFLAGS="$CFLAGS -Wall"
76CPPFLAGS="$CPPFLAGS -Wall"
77
78AC_MSG_RESULT([CFLAGS="$CFLAGS"])
79AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
80
81AC_OUTPUT(
82 Makefile
83 src/Makefile
84 src/rspro/Makefile
85 include/Makefile
86 include/osmocom/Makefile
87 include/osmocom/rspro/Makefile
88 )