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 | |
| 10 | dnl kernel style compile messages |
| 11 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 12 | |
| 13 | dnl Dependencies |
| 14 | PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.0]) |
| 15 | |
Harald Welte | 51c10b7 | 2017-11-12 23:25:00 +0900 | [diff] [blame] | 16 | dnl include release helper |
| 17 | RELMAKE='-include osmo-release.mk' |
| 18 | AC_SUBST([RELMAKE]) |
| 19 | |
Pablo Neira Ayuso | 1450666 | 2014-02-20 18:43:15 +0100 | [diff] [blame] | 20 | AC_PROG_CC |
| 21 | AM_PROG_CC_C_O |
| 22 | AC_EXEEXT |
| 23 | AC_DISABLE_STATIC |
| 24 | LT_INIT |
| 25 | CHECK_GCC_FVISIBILITY |
| 26 | case "$host" in |
| 27 | *-*-linux* | *-*-uclinux*) ;; |
| 28 | *) AC_MSG_ERROR([Linux only, dude!]);; |
| 29 | esac |
| 30 | |
Harald Welte | 134d0a3 | 2017-11-12 22:41:54 +0900 | [diff] [blame] | 31 | AC_ARG_ENABLE(sanitize, |
| 32 | [AS_HELP_STRING( |
| 33 | [--enable-sanitize], |
| 34 | [Compile with address sanitizer enabled], |
| 35 | )], |
| 36 | [sanitize=$enableval], [sanitize="no"]) |
| 37 | if test x"$sanitize" = x"yes" |
| 38 | then |
| 39 | CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" |
| 40 | CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" |
| 41 | fi |
| 42 | |
Pablo Neira Ayuso | 1450666 | 2014-02-20 18:43:15 +0100 | [diff] [blame] | 43 | regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT" |
| 44 | regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ |
| 45 | -Wmissing-prototypes -Wshadow -Wstrict-prototypes \ |
| 46 | -Wformat=2 -pipe" |
| 47 | AC_SUBST([regular_CPPFLAGS]) |
| 48 | AC_SUBST([regular_CFLAGS]) |
| 49 | AC_CONFIG_FILES([Makefile src/Makefile include/Makefile include/libgtpnl/Makefile include/linux/Makefile tools/Makefile libgtpnl.pc]) |
| 50 | AC_OUTPUT |