Harald Welte | 41b85d5 | 2015-08-31 08:56:53 +0200 | [diff] [blame] | 1 | AC_INIT([libasn1c], [0.9.28], |
Harald Welte | bdff5e6 | 2010-06-12 19:05:23 +0200 | [diff] [blame] | 2 | [openbsc-devel@lists.openbsc.org]) |
| 3 | |
| 4 | AM_INIT_AUTOMAKE([dist-bzip2]) |
| 5 | |
| 6 | dnl kernel style compile messages |
| 7 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 8 | |
Pau Espin Pedrol | 96ef99e | 2018-05-03 17:15:26 +0200 | [diff] [blame] | 9 | dnl include release helper |
| 10 | RELMAKE='-include osmo-release.mk' |
| 11 | AC_SUBST([RELMAKE]) |
| 12 | |
Harald Welte | bdff5e6 | 2010-06-12 19:05:23 +0200 | [diff] [blame] | 13 | dnl checks for programs |
| 14 | AC_PROG_MAKE_SET |
| 15 | AC_PROG_CC |
| 16 | AC_PROG_INSTALL |
| 17 | LT_INIT |
| 18 | AC_PROG_LIBTOOL |
| 19 | |
| 20 | AC_CONFIG_MACRO_DIR([m4]) |
| 21 | |
Holger Hans Peter Freyther | f3c3049 | 2016-04-05 16:25:43 +0200 | [diff] [blame] | 22 | PKG_CHECK_MODULES(LIBTALLOC, talloc) |
Harald Welte | fa03400 | 2010-07-18 23:15:24 +0200 | [diff] [blame] | 23 | |
Neels Hofmeyr | bd21737 | 2017-11-17 01:43:36 +0100 | [diff] [blame] | 24 | AC_ARG_ENABLE(sanitize, |
| 25 | [AS_HELP_STRING( |
| 26 | [--enable-sanitize], |
| 27 | [Compile with address sanitizer enabled], |
| 28 | )], |
| 29 | [sanitize=$enableval], [sanitize="no"]) |
| 30 | if test x"$sanitize" = x"yes" |
| 31 | then |
| 32 | CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" |
| 33 | CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" |
| 34 | fi |
| 35 | |
Neels Hofmeyr | 6e152f2 | 2018-03-05 19:46:44 +0100 | [diff] [blame] | 36 | AC_ARG_ENABLE(werror, |
| 37 | [AS_HELP_STRING( |
| 38 | [--enable-werror], |
| 39 | [Turn all compiler warnings into errors, with exceptions: |
| 40 | a) deprecation (allow upstream to mark deprecation without breaking builds); |
| 41 | b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds) |
| 42 | ] |
| 43 | )], |
| 44 | [werror=$enableval], [werror="no"]) |
| 45 | if test x"$werror" = x"yes" |
| 46 | then |
| 47 | WERROR_FLAGS="-Werror" |
| 48 | WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations" |
| 49 | WERROR_FLAGS+=" -Wno-error=cpp" # "#warning" |
| 50 | CFLAGS="$CFLAGS $WERROR_FLAGS" |
| 51 | CPPFLAGS="$CPPFLAGS $WERROR_FLAGS" |
| 52 | fi |
| 53 | |
Harald Welte | bdff5e6 | 2010-06-12 19:05:23 +0200 | [diff] [blame] | 54 | # The following test is taken from WebKit's webkit.m4 |
| 55 | saved_CFLAGS="$CFLAGS" |
| 56 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 57 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
Harald Welte | f6b9173 | 2015-08-31 09:06:57 +0200 | [diff] [blame] | 58 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], |
Harald Welte | bdff5e6 | 2010-06-12 19:05:23 +0200 | [diff] [blame] | 59 | [ AC_MSG_RESULT([yes]) |
| 60 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 61 | AC_MSG_RESULT([no])) |
| 62 | CFLAGS="$saved_CFLAGS" |
| 63 | AC_SUBST(SYMBOL_VISIBILITY) |
| 64 | |
Harald Welte | a37b06d | 2015-12-18 15:37:17 +0100 | [diff] [blame] | 65 | AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Buld the library with EMIT_ASN_DEBUG enabled])], |
| 66 | [build_debug="$enableval"], [build_debug="no"]) |
| 67 | AM_CONDITIONAL(BUILD_DEBUG, test "x$build_debug" = "xyes") |
| 68 | |
Neels Hofmeyr | 6e152f2 | 2018-03-05 19:46:44 +0100 | [diff] [blame] | 69 | AC_MSG_RESULT([CFLAGS="$CFLAGS"]) |
| 70 | AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"]) |
| 71 | |
Harald Welte | bdff5e6 | 2010-06-12 19:05:23 +0200 | [diff] [blame] | 72 | AC_OUTPUT( |
| 73 | libasn1c.pc |
| 74 | src/Makefile |
Harald Welte | 98cb836 | 2010-06-12 19:15:51 +0200 | [diff] [blame] | 75 | include/Makefile |
| 76 | include/asn1c/Makefile |
Harald Welte | bdff5e6 | 2010-06-12 19:05:23 +0200 | [diff] [blame] | 77 | Makefile) |
| 78 | |