blob: 459fab183b3e52c679aedaf131ee2195987e0e17 [file] [log] [blame]
Pablo Neira Ayuso14506662014-02-20 18:43:15 +01001dnl Process this file with autoconf to create configure.
2
Harald Welte853753e2016-07-28 20:40:17 +02003AC_INIT([libgtpnl], [1.0.1])
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
10dnl kernel style compile messages
11m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
12
13dnl Dependencies
14PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.0])
15
16AC_PROG_CC
17AM_PROG_CC_C_O
18AC_EXEEXT
19AC_DISABLE_STATIC
20LT_INIT
21CHECK_GCC_FVISIBILITY
22case "$host" in
23*-*-linux* | *-*-uclinux*) ;;
24*) AC_MSG_ERROR([Linux only, dude!]);;
25esac
26
Harald Welte134d0a32017-11-12 22:41:54 +090027AC_ARG_ENABLE(sanitize,
28 [AS_HELP_STRING(
29 [--enable-sanitize],
30 [Compile with address sanitizer enabled],
31 )],
32 [sanitize=$enableval], [sanitize="no"])
33if test x"$sanitize" = x"yes"
34then
35 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
36 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
37fi
38
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010039regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
40regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
41 -Wmissing-prototypes -Wshadow -Wstrict-prototypes \
42 -Wformat=2 -pipe"
43AC_SUBST([regular_CPPFLAGS])
44AC_SUBST([regular_CFLAGS])
45AC_CONFIG_FILES([Makefile src/Makefile include/Makefile include/libgtpnl/Makefile include/linux/Makefile tools/Makefile libgtpnl.pc])
46AC_OUTPUT