blob: a632a1dfbde2fd5945c29ffd090804a95b8ce594 [file] [log] [blame]
Neels Hofmeyr40d8b012016-12-11 00:27:48 +01001AC_INIT([osmo-hlr],
2 m4_esyscmd([./git-version-gen .tarball-version]),
3 [openbsc@lists.osmocom.org])
4
5dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
6AC_CONFIG_AUX_DIR([.])
7
8dnl libtool init
9LT_INIT
10
11AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.9])
12
Neels Hofmeyr00c06972017-01-31 01:19:27 +010013AC_CONFIG_TESTDIR(tests)
14
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010015dnl kernel style compile messages
16m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
17
Max43bf7bc2017-08-25 18:27:28 +020018dnl include release helper
19RELMAKE='-include osmo-release.mk'
20AC_SUBST([RELMAKE])
21
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010022dnl 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(TALLOC, [talloc >= 2.0.1])
36
Pau Espin Pedrolcb360f02018-05-03 16:27:14 +020037PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.11.0)
38PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.11.0)
39PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.11.0)
40PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.11.0)
41PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.5.0)
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010042
Neels Hofmeyrc317cc22016-12-13 14:33:26 +010043PKG_CHECK_MODULES(SQLITE3, sqlite3)
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010044
45AC_CONFIG_MACRO_DIR([m4])
46
47dnl checks for header files
48AC_HEADER_STDC
49
Neels Hofmeyr6f3e8d62017-11-17 01:43:36 +010050AC_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
Neels Hofmeyr2e788582018-03-05 20:42:57 +010062AC_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
Neels Hofmeyrf95ce042017-09-25 23:22:02 +020080AC_ARG_ENABLE([external_tests],
81 AC_HELP_STRING([--enable-external-tests],
82 [Include the VTY/CTRL tests in make check [default=no]]),
83 [enable_ext_tests="$enableval"],[enable_ext_tests="no"])
84if test "x$enable_ext_tests" = "xyes" ; then
85 AM_PATH_PYTHON
86 AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes)
87 if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
88 AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
89 fi
90fi
91AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
92AC_MSG_RESULT([$enable_ext_tests])
93AM_CONDITIONAL(ENABLE_EXT_TESTS, test "x$enable_ext_tests" = "xyes")
94
Neels Hofmeyr2e788582018-03-05 20:42:57 +010095AC_MSG_RESULT([CFLAGS="$CFLAGS"])
96AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
97
Neels Hofmeyr40d8b012016-12-11 00:27:48 +010098AC_OUTPUT(
99 Makefile
Alexander Couzens38f08772017-11-16 01:01:09 +0100100 doc/Makefile
Neels Hofmeyr40d8b012016-12-11 00:27:48 +0100101 src/Makefile
102 sql/Makefile
Neels Hofmeyr00c06972017-01-31 01:19:27 +0100103 tests/Makefile
104 tests/auc/Makefile
Neels Hofmeyr6b883f72017-01-31 16:40:28 +0100105 tests/auc/gen_ts_55_205_test_sets/Makefile
Neels Hofmeyrcab2fcd2017-03-15 00:07:43 +0100106 tests/gsup_server/Makefile
Neels Hofmeyr98509462017-10-09 17:28:53 +0200107 tests/db/Makefile
Neels Hofmeyr40d8b012016-12-11 00:27:48 +0100108 )