blob: c3ec5ad194861691e23b4be67271857d57e94eef [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)
36PKG_CHECK_MODULES(ASN1C, libasn1c >= 0.9.30)
37
38AC_CONFIG_MACRO_DIR([m4])
39
40dnl checks for header files
41AC_HEADER_STDC
42
43AC_ARG_ENABLE(sanitize,
44 [AS_HELP_STRING(
45 [--enable-sanitize],
46 [Compile with address sanitizer enabled],
47 )],
48 [sanitize=$enableval], [sanitize="no"])
49if test x"$sanitize" = x"yes"
50then
51 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
52 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
53fi
54
55AC_ARG_ENABLE(werror,
56 AS_HELP_STRING(
57 [--enable-werror],
58 [Turn all compiler warnings into errors, with exceptions:
59 a) deprecation (allow upstream to mark deprecation without breaking builds);
60 b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
61 ]
62 )],
63 [werror=$enableval], [werror="no"])
64if test x"$werror" = x"yes"
65then
66 WERROR_FLAGS="-Werror"
67 WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
68 WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
69 CFLAGS="$CFLAGS $WERROR_FLAGS"
70 CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
71fi
72
73CFLAGS="$CFLAGS -Wall"
74CPPFLAGS="$CPPFLAGS -Wall"
75
76AC_MSG_RESULT([CFLAGS="$CFLAGS"])
77AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
78
79AC_OUTPUT(
80 Makefile
81 src/Makefile
82 src/rspro/Makefile
83 include/Makefile
84 include/osmocom/Makefile
85 include/osmocom/rspro/Makefile
86 )