blob: f7580e62612e8066ce04007155565280cb87c63f [file] [log] [blame]
Pablo Neira Ayuso14506662014-02-20 18:43:15 +01001dnl Process this file with autoconf to create configure.
2
Pau Espin Pedrolb1adcf72018-05-02 16:15:26 +02003AC_INIT([libgtpnl],
4 m4_esyscmd([./git-version-gen .tarball-version]),
5 [osmocom-net-gprs@lists.osmocom.org])
Pablo Neira Ayuso14506662014-02-20 18:43:15 +01006AC_CONFIG_AUX_DIR([build-aux])
7AC_CANONICAL_HOST
8AC_CONFIG_MACRO_DIR([m4])
9AC_CONFIG_HEADERS([config.h])
10AM_INIT_AUTOMAKE([foreign tar-pax no-dist-gzip dist-bzip2 1.6 subdir-objects])
11
Pau Espin Pedrol16fa45f2018-05-02 13:55:46 +020012dnl include release helper
13RELMAKE='-include osmo-release.mk'
14AC_SUBST([RELMAKE])
15
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010016dnl kernel style compile messages
17m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
18
19dnl Dependencies
20PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.0])
21
Harald Welte51c10b72017-11-12 23:25:00 +090022dnl include release helper
23RELMAKE='-include osmo-release.mk'
24AC_SUBST([RELMAKE])
25
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010026AC_PROG_CC
27AM_PROG_CC_C_O
28AC_EXEEXT
29AC_DISABLE_STATIC
30LT_INIT
31CHECK_GCC_FVISIBILITY
32case "$host" in
33*-*-linux* | *-*-uclinux*) ;;
34*) AC_MSG_ERROR([Linux only, dude!]);;
35esac
36
Harald Welte134d0a32017-11-12 22:41:54 +090037AC_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
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010049regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
50regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
51 -Wmissing-prototypes -Wshadow -Wstrict-prototypes \
52 -Wformat=2 -pipe"
53AC_SUBST([regular_CPPFLAGS])
54AC_SUBST([regular_CFLAGS])
55AC_CONFIG_FILES([Makefile src/Makefile include/Makefile include/libgtpnl/Makefile include/linux/Makefile tools/Makefile libgtpnl.pc])
56AC_OUTPUT