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 | 853753e | 2016-07-28 20:40:17 +0200 | [diff] [blame] | 3 | AC_INIT([libgtpnl], [1.0.1]) |
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 | |
| 16 | AC_PROG_CC |
| 17 | AM_PROG_CC_C_O |
| 18 | AC_EXEEXT |
| 19 | AC_DISABLE_STATIC |
| 20 | LT_INIT |
| 21 | CHECK_GCC_FVISIBILITY |
| 22 | case "$host" in |
| 23 | *-*-linux* | *-*-uclinux*) ;; |
| 24 | *) AC_MSG_ERROR([Linux only, dude!]);; |
| 25 | esac |
| 26 | |
Harald Welte | 134d0a3 | 2017-11-12 22:41:54 +0900 | [diff] [blame^] | 27 | AC_ARG_ENABLE(sanitize, |
| 28 | [AS_HELP_STRING( |
| 29 | [--enable-sanitize], |
| 30 | [Compile with address sanitizer enabled], |
| 31 | )], |
| 32 | [sanitize=$enableval], [sanitize="no"]) |
| 33 | if test x"$sanitize" = x"yes" |
| 34 | then |
| 35 | CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" |
| 36 | CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" |
| 37 | fi |
| 38 | |
Pablo Neira Ayuso | 1450666 | 2014-02-20 18:43:15 +0100 | [diff] [blame] | 39 | regular_CPPFLAGS="-D_FILE_OFFSET_BITS=64 -D_REENTRANT" |
| 40 | regular_CFLAGS="-Wall -Waggregate-return -Wmissing-declarations \ |
| 41 | -Wmissing-prototypes -Wshadow -Wstrict-prototypes \ |
| 42 | -Wformat=2 -pipe" |
| 43 | AC_SUBST([regular_CPPFLAGS]) |
| 44 | AC_SUBST([regular_CFLAGS]) |
| 45 | AC_CONFIG_FILES([Makefile src/Makefile include/Makefile include/libgtpnl/Makefile include/linux/Makefile tools/Makefile libgtpnl.pc]) |
| 46 | AC_OUTPUT |