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