blob: ab630459d1937f5af1900a42f08f9a249bff6244 [file] [log] [blame]
Harald Welte41b85d52015-08-31 08:56:53 +02001AC_INIT([libasn1c], [0.9.28],
Harald Weltebdff5e62010-06-12 19:05:23 +02002 [openbsc-devel@lists.openbsc.org])
3
4AM_INIT_AUTOMAKE([dist-bzip2])
5
6dnl kernel style compile messages
7m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
Pau Espin Pedrol96ef99e2018-05-03 17:15:26 +02009dnl include release helper
10RELMAKE='-include osmo-release.mk'
11AC_SUBST([RELMAKE])
12
Harald Weltebdff5e62010-06-12 19:05:23 +020013dnl checks for programs
14AC_PROG_MAKE_SET
15AC_PROG_CC
16AC_PROG_INSTALL
17LT_INIT
18AC_PROG_LIBTOOL
19
20AC_CONFIG_MACRO_DIR([m4])
21
Holger Hans Peter Freytherf3c30492016-04-05 16:25:43 +020022PKG_CHECK_MODULES(LIBTALLOC, talloc)
Harald Weltefa034002010-07-18 23:15:24 +020023
Neels Hofmeyrbd217372017-11-17 01:43:36 +010024AC_ARG_ENABLE(sanitize,
25 [AS_HELP_STRING(
26 [--enable-sanitize],
27 [Compile with address sanitizer enabled],
28 )],
29 [sanitize=$enableval], [sanitize="no"])
30if test x"$sanitize" = x"yes"
31then
32 CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
33 CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
34fi
35
Neels Hofmeyr6e152f22018-03-05 19:46:44 +010036AC_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"])
45if test x"$werror" = x"yes"
46then
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"
52fi
53
Harald Weltebdff5e62010-06-12 19:05:23 +020054# The following test is taken from WebKit's webkit.m4
55saved_CFLAGS="$CFLAGS"
56CFLAGS="$CFLAGS -fvisibility=hidden "
57AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Harald Weltef6b91732015-08-31 09:06:57 +020058AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Harald Weltebdff5e62010-06-12 19:05:23 +020059 [ AC_MSG_RESULT([yes])
60 SYMBOL_VISIBILITY="-fvisibility=hidden"],
61 AC_MSG_RESULT([no]))
62CFLAGS="$saved_CFLAGS"
63AC_SUBST(SYMBOL_VISIBILITY)
64
Harald Weltea37b06d2015-12-18 15:37:17 +010065AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Buld the library with EMIT_ASN_DEBUG enabled])],
66 [build_debug="$enableval"], [build_debug="no"])
67AM_CONDITIONAL(BUILD_DEBUG, test "x$build_debug" = "xyes")
68
Neels Hofmeyr6e152f22018-03-05 19:46:44 +010069AC_MSG_RESULT([CFLAGS="$CFLAGS"])
70AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
71
Harald Weltebdff5e62010-06-12 19:05:23 +020072AC_OUTPUT(
73 libasn1c.pc
74 src/Makefile
Harald Welte98cb8362010-06-12 19:15:51 +020075 include/Makefile
76 include/asn1c/Makefile
Harald Weltebdff5e62010-06-12 19:05:23 +020077 Makefile)
78