blob: 2c30dfbc1fcc5ec0da84b2ebb888d48f12a613a3 [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
Harald Welteb0cef1d2018-10-15 02:03:10 +020035AC_CHECK_LIB(csv, csv_init, LIBS="$LIBS -lcsv", [AC_MSG_ERROR([*** libcsv library not found!])])
36AC_CHECK_HEADERS([csv.h])
37
Harald Welte3aa901d2018-08-13 18:32:36 +020038PKG_CHECK_MODULES(OSMOCORE, libosmocore >= 0.11.0)
Harald Welte77911b02018-08-14 23:47:30 +020039PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.11.0)
40PKG_CHECK_MODULES(OSMOABIS, libosmoabis)
Kévin Redone0b837c2018-10-10 00:39:25 +020041PKG_CHECK_MODULES(OSMOSIM, libosmosim)
Harald Welte77911b02018-08-14 23:47:30 +020042PKG_CHECK_MODULES(PCSC, libpcsclite)
Kévin Redone0b837c2018-10-10 00:39:25 +020043PKG_CHECK_MODULES(USB, libusb-1.0)
Harald Welte3aa901d2018-08-13 18:32:36 +020044
45AC_CONFIG_MACRO_DIR([m4])
46
47dnl checks for header files
48AC_HEADER_STDC
49
50AC_ARG_ENABLE(sanitize,
51 [AS_HELP_STRING(
52 [--enable-sanitize],
53 [Compile with address sanitizer enabled],
54 )],
55 [sanitize=$enableval], [sanitize="no"])
56if test x"$sanitize" = x"yes"
57then
58 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
59 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
60fi
61
62AC_ARG_ENABLE(werror,
63 AS_HELP_STRING(
64 [--enable-werror],
65 [Turn all compiler warnings into errors, with exceptions:
66 a) deprecation (allow upstream to mark deprecation without breaking builds);
67 b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
68 ]
69 )],
70 [werror=$enableval], [werror="no"])
71if test x"$werror" = x"yes"
72then
73 WERROR_FLAGS="-Werror"
74 WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
75 WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
76 CFLAGS="$CFLAGS $WERROR_FLAGS"
77 CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
78fi
79
80CFLAGS="$CFLAGS -Wall"
81CPPFLAGS="$CPPFLAGS -Wall"
82
83AC_MSG_RESULT([CFLAGS="$CFLAGS"])
84AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
85
86AC_OUTPUT(
87 Makefile
88 src/Makefile
89 src/rspro/Makefile
90 include/Makefile
91 include/osmocom/Makefile
92 include/osmocom/rspro/Makefile
93 )