blob: 19e07b206c58bf02f4f4fd8bcece5f99c261bcdb [file] [log] [blame]
Pablo Neira Ayuso14506662014-02-20 18:43:15 +01001dnl Process this file with autoconf to create configure.
2
Harald Weltedd1e2f22017-11-12 23:27:30 +09003AC_INIT([libgtpnl], [1.1.0])
Pablo Neira Ayuso14506662014-02-20 18:43:15 +01004AC_CONFIG_AUX_DIR([build-aux])
5AC_CANONICAL_HOST
6AC_CONFIG_MACRO_DIR([m4])
7AC_CONFIG_HEADERS([config.h])
8AM_INIT_AUTOMAKE([foreign tar-pax no-dist-gzip dist-bzip2 1.6 subdir-objects])
9
Pau Espin Pedrol16fa45f2018-05-02 13:55:46 +020010dnl include release helper
11RELMAKE='-include osmo-release.mk'
12AC_SUBST([RELMAKE])
13
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010014dnl kernel style compile messages
15m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
16
17dnl Dependencies
18PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.0])
19
Harald Welte51c10b72017-11-12 23:25:00 +090020dnl include release helper
21RELMAKE='-include osmo-release.mk'
22AC_SUBST([RELMAKE])
23
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010024AC_PROG_CC
25AM_PROG_CC_C_O
26AC_EXEEXT
27AC_DISABLE_STATIC
28LT_INIT
29CHECK_GCC_FVISIBILITY
30case "$host" in
31*-*-linux* | *-*-uclinux*) ;;
32*) AC_MSG_ERROR([Linux only, dude!]);;
33esac
34
Harald Welte134d0a32017-11-12 22:41:54 +090035AC_ARG_ENABLE(sanitize,
36 [AS_HELP_STRING(
37 [--enable-sanitize],
38 [Compile with address sanitizer enabled],
39 )],
40 [sanitize=$enableval], [sanitize="no"])
41if test x"$sanitize" = x"yes"
42then
43 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
44 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
45fi
46
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010047regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
48regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
49 -Wmissing-prototypes -Wshadow -Wstrict-prototypes \
50 -Wformat=2 -pipe"
51AC_SUBST([regular_CPPFLAGS])
52AC_SUBST([regular_CFLAGS])
53AC_CONFIG_FILES([Makefile src/Makefile include/Makefile include/libgtpnl/Makefile include/linux/Makefile tools/Makefile libgtpnl.pc])
54AC_OUTPUT