blob: bf3530f42c0b1a899c501324ebcdf27ab2d178f1 [file] [log] [blame]
Harald Welte681f1192020-04-20 12:00:33 +02001# Process this file with autoconf to produce a configure script.
2AC_INIT([osmo-uecups],[m4_esyscmd(./git-version-gen .tarball-version)],[osmocom-net-gprs@lists.osmocom.org])
3
4dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
5AC_CONFIG_AUX_DIR([.])
6
7AM_INIT_AUTOMAKE([dist-bzip2])
8
9dnl kernel style compile messages
10m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11
12dnl include release helper
13RELMAKE='-include osmo-release.mk'
14AC_SUBST([RELMAKE])
15
16# Checks for programs.
17AC_PROG_MAKE_SET
18AC_PROG_CC
19AC_PROG_INSTALL
20LT_INIT
21
22dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
23AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
24if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
25 AC_MSG_WARN([You need to install pkg-config])
26fi
27PKG_PROG_PKG_CONFIG([0.20])
28
Pau Espin Pedrol3ea62fc2023-09-12 17:27:39 +020029PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.9.0)
30PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.9.0)
31PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.4.0)
Harald Welte681f1192020-04-20 12:00:33 +020032PKG_CHECK_MODULES(LIBJANSSON, jansson)
33PKG_CHECK_MODULES(LIBNLROUTE3, libnl-route-3.0)
34
35AC_HEADER_STDC
36
37AC_ARG_ENABLE(sanitize,
38 [AS_HELP_STRING(
39 [--enable-sanitize],
40 [Compile with address sanitizer enabled],
41 )],
42 [sanitize=$enableval], [sanitize="no"])
43if test x"$sanitize" = x"yes"
44then
45 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
46 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
47fi
48
49AC_ARG_ENABLE(werror,
50 [AS_HELP_STRING(
51 [--enable-werror],
52 [Turn all compiler warnings into errors, with exceptions:
53 a) deprecation (allow upstream to mark deprecation without breaking builds);
54 b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
55 ]
56 )],
57 [werror=$enableval], [werror="no"])
58if test x"$werror" = x"yes"
59then
60 WERROR_FLAGS="-Werror"
61 WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
62 WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
63 CFLAGS="$CFLAGS $WERROR_FLAGS"
64 CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
65fi
66
67# The following test is taken from WebKit's webkit.m4
68saved_CFLAGS="$CFLAGS"
69CFLAGS="$CFLAGS -fvisibility=hidden "
70AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
71AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
72 [ AC_MSG_RESULT([yes])
73 SYMBOL_VISIBILITY="-fvisibility=hidden"],
74 AC_MSG_RESULT([no]))
75CFLAGS="$saved_CFLAGS"
76AC_SUBST(SYMBOL_VISIBILITY)
77
Harald Welte681f1192020-04-20 12:00:33 +020078# Coverage build taken from WebKit's configure.in
79AC_MSG_CHECKING([whether to enable code coverage support])
80AC_ARG_ENABLE(coverage,
81 AC_HELP_STRING([--enable-coverage],
82 [enable code coverage support [default=no]]),
83 [],[enable_coverage="no"])
84AC_MSG_RESULT([$enable_coverage])
85if test "$enable_coverage" = "yes"; then
86 COVERAGE_CFLAGS="-ftest-coverage -fprofile-arcs"
87 COVERAGE_LDFLAGS="-ftest-coverage -fprofile-arcs"
88 AC_SUBST([COVERAGE_CFLAGS])
89 AC_SUBST([COVERAGE_LDFLAGS])
90fi
91
92AC_ARG_ENABLE(profile,
93 [AS_HELP_STRING([--enable-profile], [Compile with profiling support enabled], )],
94 [profile=$enableval], [profile="no"])
95if test x"$profile" = x"yes"
96then
97 CFLAGS="$CFLAGS -pg"
98 CPPFLAGS="$CPPFLAGS -pg"
99fi
100
101
102
103
104AC_MSG_RESULT([CFLAGS="$CFLAGS"])
105AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
106
107AC_OUTPUT(
108 Makefile
109 daemon/Makefile
110 doc/Makefile
111 doc/examples/Makefile
Harald Weltee0514272022-11-06 12:26:45 +0100112 contrib/osmo-uecups.spec
Harald Welte681f1192020-04-20 12:00:33 +0200113 )