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