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