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