blob: eb35f571cf5a9acf9f251799006b47facb26fe83 [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
Oliver Smith5314ea42021-01-27 17:31:54 +010016CFLAGS="$CFLAGS -std=gnu11"
17
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010018dnl kernel style compile messages
19m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
20
21dnl Dependencies
22PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.0])
23
Harald Welte51c10b72017-11-12 23:25:00 +090024dnl include release helper
25RELMAKE='-include osmo-release.mk'
26AC_SUBST([RELMAKE])
27
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010028AC_PROG_CC
29AM_PROG_CC_C_O
30AC_EXEEXT
31AC_DISABLE_STATIC
32LT_INIT
33CHECK_GCC_FVISIBILITY
34case "$host" in
35*-*-linux* | *-*-uclinux*) ;;
36*) AC_MSG_ERROR([Linux only, dude!]);;
37esac
38
Harald Welte134d0a32017-11-12 22:41:54 +090039AC_ARG_ENABLE(sanitize,
40 [AS_HELP_STRING(
41 [--enable-sanitize],
42 [Compile with address sanitizer enabled],
43 )],
44 [sanitize=$enableval], [sanitize="no"])
45if test x"$sanitize" = x"yes"
46then
47 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
48 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
49fi
50
Pablo Neira Ayuso14506662014-02-20 18:43:15 +010051regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT"
52regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \
53 -Wmissing-prototypes -Wshadow -Wstrict-prototypes \
54 -Wformat=2 -pipe"
55AC_SUBST([regular_CPPFLAGS])
56AC_SUBST([regular_CFLAGS])
57AC_CONFIG_FILES([Makefile src/Makefile include/Makefile include/libgtpnl/Makefile include/linux/Makefile tools/Makefile libgtpnl.pc])
Oliver Smith01b2d942020-05-14 11:21:59 +020058AC_OUTPUT(
59 contrib/libgtpnl.spec)