Lev Walkin | fa9bb6d | 2017-03-26 03:48:43 -0700 | [diff] [blame] | 1 | AC_INIT([asn1c],[0.9.29],[vlm@lionet.info]) |
Lev Walkin | 1b03c79 | 2014-10-12 17:31:26 -0700 | [diff] [blame] | 2 | |
| 3 | AC_CONFIG_AUX_DIR(config) |
Lev Walkin | e7c4b96 | 2010-11-09 03:10:36 -0800 | [diff] [blame] | 4 | AC_CONFIG_HEADER([config.h]) |
Lev Walkin | f761320 | 2016-01-10 13:27:18 -0800 | [diff] [blame] | 5 | AM_INIT_AUTOMAKE([foreign]) |
Lev Walkin | e7c4b96 | 2010-11-09 03:10:36 -0800 | [diff] [blame] | 6 | AC_CONFIG_MACRO_DIR([m4]) |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 7 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 8 | dnl Checks for programs. |
| 9 | AC_PROG_CC |
| 10 | AC_PROG_CPP |
| 11 | AC_PROG_INSTALL |
| 12 | AC_PROG_LN_S |
| 13 | AC_PROG_MAKE_SET |
| 14 | AC_PROG_YACC |
| 15 | AM_PROG_LEX |
theirix | b577d4d | 2016-07-30 17:14:59 +0300 | [diff] [blame] | 16 | dnl locate ar using standard macro (old automake 1.11 does not know about AM_PROG_AR) |
| 17 | m4_ifdef([AM_PROG_AR], |
| 18 | [AM_PROG_AR], |
| 19 | [AC_PATH_PROG(AR, ar, ar, $PATH:/usr/ucb:/usr/ccs/bin)]) |
| 20 | |
Lev Walkin | 5c600f4 | 2017-09-15 21:57:29 -0700 | [diff] [blame] | 21 | AC_PROG_CXX |
| 22 | CXXFLAGS="-std=c++11" |
| 23 | |
theirix | b577d4d | 2016-07-30 17:14:59 +0300 | [diff] [blame] | 24 | LT_INIT |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 25 | |
Lev Walkin | 3278995 | 2014-10-12 18:51:52 -0700 | [diff] [blame] | 26 | dnl If you need to see the details, just run make V=1. |
| 27 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
Frank Morgner | fb63c01 | 2013-05-21 09:56:38 +0200 | [diff] [blame] | 28 | |
Lev Walkin | bec70d8 | 2004-08-23 10:40:21 +0000 | [diff] [blame] | 29 | case "$host_os" in |
Lev Walkin | 19abe22 | 2006-03-18 06:39:12 +0000 | [diff] [blame] | 30 | cygwin) |
Lev Walkin | bec70d8 | 2004-08-23 10:40:21 +0000 | [diff] [blame] | 31 | case "$target" in |
| 32 | *mingw*) |
| 33 | CC="$CC -mno-cygwin" |
| 34 | esac |
| 35 | ;; |
Lev Walkin | 615a7fa | 2006-03-18 06:24:33 +0000 | [diff] [blame] | 36 | esac |
| 37 | |
Lev Walkin | 58ecc7b | 2014-09-17 00:32:03 -0700 | [diff] [blame] | 38 | AC_ARG_ENABLE([ASN_DEBUG], |
Lev Walkin | 271131c | 2015-04-10 00:09:57 -0700 | [diff] [blame] | 39 | [AS_HELP_STRING([--enable-ASN_DEBUG], |
| 40 | [produce debug log during `make check` testing])], |
| 41 | [enable_asn_debug=$enableval], [enable_asn_debug=no]) |
| 42 | AS_IF([test x$enable_asn_debug != xno], [ |
| 43 | TESTSUITE_CFLAGS="-DEMIT_ASN_DEBUG" |
Lev Walkin | 64dd70c | 2016-03-14 05:14:07 -0700 | [diff] [blame] | 44 | SKELETONS_CFLAGS="-DEMIT_ASN_DEBUG" |
Lev Walkin | 271131c | 2015-04-10 00:09:57 -0700 | [diff] [blame] | 45 | ]) |
Lev Walkin | 58ecc7b | 2014-09-17 00:32:03 -0700 | [diff] [blame] | 46 | |
Lev Walkin | f84cc01 | 2014-01-14 02:12:24 -0800 | [diff] [blame] | 47 | AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"]) |
| 48 | AX_CHECK_COMPILE_FLAG([-Wcast-qual], [CFLAGS="$CFLAGS -Wcast-qual"]) |
| 49 | AX_CHECK_COMPILE_FLAG([-Wchar-subscripts], |
Lev Walkin | 65907f0 | 2014-09-14 17:19:21 -0700 | [diff] [blame] | 50 | [CFLAGS="$CFLAGS -Wchar-subscripts"]) |
Lev Walkin | f84cc01 | 2014-01-14 02:12:24 -0800 | [diff] [blame] | 51 | AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes], |
Lev Walkin | 65907f0 | 2014-09-14 17:19:21 -0700 | [diff] [blame] | 52 | [CFLAGS="$CFLAGS -Wmissing-prototypes"]) |
Lev Walkin | f84cc01 | 2014-01-14 02:12:24 -0800 | [diff] [blame] | 53 | AX_CHECK_COMPILE_FLAG([-Wmissing-declarations], |
Lev Walkin | 65907f0 | 2014-09-14 17:19:21 -0700 | [diff] [blame] | 54 | [CFLAGS="$CFLAGS -Wmissing-declarations"]) |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 55 | |
Lev Walkin | f84cc01 | 2014-01-14 02:12:24 -0800 | [diff] [blame] | 56 | dnl There are legitimate uses for these features, disable warnings/errors. |
Lev Walkin | 84556d5 | 2017-09-26 23:13:10 -0700 | [diff] [blame] | 57 | AX_CHECK_COMPILE_FLAG([-Wno-error=attributes], |
| 58 | [CFLAGS="$CFLAGS -Wno-error=attributes"]) |
Lev Walkin | f84cc01 | 2014-01-14 02:12:24 -0800 | [diff] [blame] | 59 | AX_CHECK_COMPILE_FLAG([-Wno-error=cast-align], |
Lev Walkin | 65907f0 | 2014-09-14 17:19:21 -0700 | [diff] [blame] | 60 | [CFLAGS="$CFLAGS -Wno-error=cast-align"]) |
Lev Walkin | f84cc01 | 2014-01-14 02:12:24 -0800 | [diff] [blame] | 61 | AX_CHECK_COMPILE_FLAG([-Wno-error=visibility], |
Lev Walkin | 65907f0 | 2014-09-14 17:19:21 -0700 | [diff] [blame] | 62 | [CFLAGS="$CFLAGS -Wno-error=visibility"]) |
Lev Walkin | f84cc01 | 2014-01-14 02:12:24 -0800 | [diff] [blame] | 63 | AX_CHECK_COMPILE_FLAG([-Wno-error=parentheses-equality], |
Lev Walkin | 65907f0 | 2014-09-14 17:19:21 -0700 | [diff] [blame] | 64 | [CFLAGS="$CFLAGS -Wno-error=parentheses-equality"]) |
Lev Walkin | 3798f34 | 2016-03-14 04:07:45 -0700 | [diff] [blame] | 65 | AX_CHECK_COMPILE_FLAG([-std=gnu99], |
Lev Walkin | 62d95d2 | 2017-08-06 23:41:11 -0700 | [diff] [blame] | 66 | [CFLAGS="$CFLAGS -std=gnu99" |
Lev Walkin | e0236da | 2017-09-17 22:03:57 -0700 | [diff] [blame] | 67 | TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -std=gnu99"]) |
Lev Walkin | 65907f0 | 2014-09-14 17:19:21 -0700 | [diff] [blame] | 68 | AX_CHECK_COMPILE_FLAG([-Wno-error=unused-variable], |
Lev Walkin | e0236da | 2017-09-17 22:03:57 -0700 | [diff] [blame] | 69 | [TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -Wno-error=unused-variable"]) |
| 70 | |
| 71 | dnl Lower the optimization level in tests to aid debugging. |
| 72 | dnl AX_CHECK_COMPILE_FLAG([-O1], |
| 73 | dnl [TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -O1"]) |
| 74 | dnl AX_CHECK_COMPILE_FLAG([-fno-inline], |
| 75 | dnl [TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -fno-inline"]) |
Lev Walkin | 65907f0 | 2014-09-14 17:19:21 -0700 | [diff] [blame] | 76 | |
Vasil Velichkov | e318759 | 2016-07-18 22:46:36 +0300 | [diff] [blame] | 77 | AX_CODE_COVERAGE |
| 78 | AS_IF([test x$enable_code_coverage != xno], [ |
| 79 | CFLAGS="$CFLAGS $CODE_COVERAGE_CFLAGS" |
| 80 | # The CODE_COVERAGE_CPPFLAGS contains -DNDEBUG flag |
| 81 | # which removes assert(...) macros from code coverage and improves the |
| 82 | # branches score. But when it is defined it results in few |
| 83 | # unsed-but-set-variable warnings that are treated as errors in the travis-ci |
| 84 | # build because these variables are only used inside assert macros. |
| 85 | # error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable] |
| 86 | #CPPFLAGS="$CPPFLAGS $CODE_COVERAGE_CPPFLAGS" |
| 87 | CXXFLAGS="$CXXFLAGS $CODE_COVERAGE_CXXFLAGS" |
Lev Walkin | efded51 | 2017-03-26 16:12:11 -0700 | [diff] [blame] | 88 | AC_SEARCH_LIBS(gcov_open, gcov, [LDFLAGS="$LDFLAGS $CODE_COVERAGE_LDFLAGS"]) |
Vasil Velichkov | e318759 | 2016-07-18 22:46:36 +0300 | [diff] [blame] | 89 | ]) |
| 90 | |
Lev Walkin | 9736348 | 2016-01-24 19:23:02 -0800 | [diff] [blame] | 91 | dnl Skeletons should be very compatible with most of the compilers, hence |
| 92 | dnl very strict backward compatibility flags. |
Lev Walkin | 64dd70c | 2016-03-14 05:14:07 -0700 | [diff] [blame] | 93 | SKELETONS_CFLAGS="${ADD_CFLAGS} ${SKELETONS_CFLAGS}" |
Lev Walkin | 9736348 | 2016-01-24 19:23:02 -0800 | [diff] [blame] | 94 | AX_CHECK_COMPILE_FLAG([-std=c89], |
Lev Walkin | 104af19 | 2016-01-24 22:13:27 -0800 | [diff] [blame] | 95 | [SKELETONS_CFLAGS="$SKELETONS_CFLAGS -std=c89"]) |
Lev Walkin | 9736348 | 2016-01-24 19:23:02 -0800 | [diff] [blame] | 96 | AX_CHECK_COMPILE_FLAG([-Wpedantic], |
Vasil Velichkov | 1144b35 | 2016-07-19 19:09:33 +0300 | [diff] [blame] | 97 | [SKELETONS_CFLAGS="$SKELETONS_CFLAGS -Wpedantic"], |
| 98 | [ |
| 99 | dnl When -Wpedantic is not supported try the -pedantic instead. (gcc-4.7) |
| 100 | dnl See https://gcc.gnu.org/gcc-4.8/changes.html |
| 101 | AX_CHECK_COMPILE_FLAG([-pedantic], |
| 102 | [SKELETONS_CFLAGS="$SKELETONS_CFLAGS -pedantic"], [], [-Werror]) |
| 103 | ], |
| 104 | [-Werror]) #clang 3.0 prints warning when the flag is not supported |
Lev Walkin | 0f5dd34 | 2017-09-13 22:52:39 +0000 | [diff] [blame] | 105 | |
| 106 | AC_ARG_ENABLE(Werror, |
| 107 | [AS_HELP_STRING([--enable-Werror], |
| 108 | [abort compilation after any C compiler warning])], |
| 109 | [enable_werror=$enableval], [enable_werror=no]) |
| 110 | AS_IF([test x$enable_werror != xno], [ |
| 111 | ADD_CFLAGS="${ADD_CFLAGS} -Werror -W -Wall -Wpointer-arith" |
| 112 | SKELETONS_CFLAGS="${SKELETONS_CFLAGS} -Werror -W -Wall -Wpointer-arith" |
| 113 | AX_CHECK_COMPILE_FLAG([-Wgnu], |
| 114 | [SKELETONS_CFLAGS="${SKELETONS_CFLAGS} -Wgnu"]) |
| 115 | ]) |
| 116 | |
| 117 | AC_ARG_ENABLE(test-Werror, |
| 118 | [AS_HELP_STRING([--enable-test-Werror], |
| 119 | [abort compiling tests after any C compiler warning])], |
| 120 | [enable_test_werror=$enableval], [enable_test_werror=no]) |
| 121 | AS_IF([test x$enable_test_werror != xno], [ |
| 122 | TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -Werror -W -Wpointer-arith" |
| 123 | ]) |
Vasil Velichkov | 12e91c9 | 2017-10-18 18:57:47 +0300 | [diff] [blame^] | 124 | AX_CHECK_COMPILE_FLAG([-Wno-format], |
| 125 | [SKELETONS_CFLAGS="$SKELETONS_CFLAGS -Wno-format"]) |
Lev Walkin | 0f5dd34 | 2017-09-13 22:52:39 +0000 | [diff] [blame] | 126 | |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 127 | |
Lev Walkin | 249fd26 | 2017-10-18 10:05:26 -0700 | [diff] [blame] | 128 | dnl If -m32 is available to create 32-bit code, |
| 129 | dnl treat it like a special case to be checked. |
| 130 | AC_ARG_ENABLE([test-32bit], |
| 131 | [AS_HELP_STRING([--disable-test-32bit], |
| 132 | [Disable tests for 32-bit compatibility])], |
| 133 | [disable_test_32bit=$enableval], [disable_test_32bit=maybe]) |
| 134 | AS_IF([test "x$disable_test_32bit" != xno], [ |
| 135 | AX_CHECK_COMPILE_FLAG([-m32], [CFLAGS_M32=-m32], |
| 136 | [ |
| 137 | CFLAGS_M32="" |
| 138 | AS_IF([test "x$disable_test_32bit" != xmaybe], [ |
| 139 | AC_MSG_FAILURE([--disable-test-32bit=$disable_test_32bit is not supported on a target system.]) |
| 140 | ]) |
| 141 | ]) |
| 142 | ]) |
| 143 | AC_SUBST(CFLAGS_M32) |
| 144 | AM_CONDITIONAL([EXPLICIT_M32], [test "x${CFLAGS_M32}" != "x"]) |
| 145 | |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 146 | SANITIZER_CFLAGS="" |
| 147 | |
| 148 | dnl Enable Undefined Behavior Sanitizer, if supported. |
| 149 | AC_ARG_ENABLE([test-ubsan], |
| 150 | [AS_HELP_STRING([--disable-test-ubsan], |
| 151 | [Disable Undefined Behavior Sanitizer for tests])], |
| 152 | [disable_test_ubsan=$enableval], [disable_test_ubsan=maybe]) |
| 153 | AS_IF([test "x$disable_test_ubsan" != xno], [ |
| 154 | AX_CHECK_COMPILE_FLAG([-fsanitize=undefined], |
| 155 | [SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fsanitize=undefined"], |
| 156 | [ |
| 157 | AS_IF([test "x$disable_test_ubsan" != xmaybe], [ |
| 158 | AC_MSG_FAILURE( |
Lev Walkin | 5c600f4 | 2017-09-15 21:57:29 -0700 | [diff] [blame] | 159 | [--disable-test-ubsan=$disable_test_ubsan is not supported on a target system. |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 160 | https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#how-to-build])]) |
| 161 | ]) |
Lev Walkin | e0236da | 2017-09-17 22:03:57 -0700 | [diff] [blame] | 162 | AX_CHECK_COMPILE_FLAG([-fno-sanitize-recover=undefined], |
| 163 | [SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-sanitize-recover=undefined"]) |
| 164 | |
| 165 | dnl Unsigned integer overflow is enabled separately. |
| 166 | AX_CHECK_COMPILE_FLAG([-fsanitize=unsigned-integer-overflow], |
| 167 | [SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fsanitize=unsigned-integer-overflow"]) |
| 168 | AX_CHECK_COMPILE_FLAG([-fno-sanitize-recover=unsigned-integer-overflow], |
| 169 | [SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-sanitize-recover=unsigned-integer-overflow"]) |
| 170 | |
| 171 | dnl Nullability is enabled separately. |
| 172 | AX_CHECK_COMPILE_FLAG([-fsanitize=nullability], |
| 173 | [SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fsanitize=nullability"]) |
| 174 | AX_CHECK_COMPILE_FLAG([-fno-sanitize-recover=nullability], |
| 175 | [SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-sanitize-recover=nullability"]) |
| 176 | |
| 177 | dnl Keep error messages nice. Also consider: |
| 178 | dnl export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer |
| 179 | dnl export UBSAN_OPTIONS=print_stacktrace=1 |
| 180 | AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer], |
| 181 | [SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-omit-frame-pointer"]) |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 182 | ]) |
| 183 | |
Lev Walkin | a7d6400 | 2017-08-23 22:34:29 -0700 | [diff] [blame] | 184 | dnl Enable Address Sanitizer, if supported by gcc (4.8+) or clang. |
| 185 | dnl http://clang.llvm.org/docs/AddressSanitizer.html |
Lev Walkin | 33897e2 | 2017-09-26 21:17:39 -0700 | [diff] [blame] | 186 | ASAN_ENV_FLAGS="" |
Lev Walkin | a7d6400 | 2017-08-23 22:34:29 -0700 | [diff] [blame] | 187 | AC_ARG_ENABLE([test-asan], |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 188 | [AS_HELP_STRING([--disable-test-asan], |
| 189 | [Disable Address Sanitizer for tests])], |
| 190 | [disable_test_asan=$enableval], [disable_test_asan=maybe]) |
| 191 | AS_IF([test "x$disable_test_asan" != xno], [ |
Lev Walkin | a7d6400 | 2017-08-23 22:34:29 -0700 | [diff] [blame] | 192 | AX_CHECK_COMPILE_FLAG([-fsanitize=address], |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 193 | [SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fsanitize=address"], |
| 194 | [ |
| 195 | AS_IF([test "x$disable_test_asan" != xmaybe], [ |
| 196 | AC_MSG_FAILURE( |
Lev Walkin | 5c600f4 | 2017-09-15 21:57:29 -0700 | [diff] [blame] | 197 | [--disable-test-asan=$disable_test_asan is not supported on a target system. |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 198 | Check out https://clang.llvm.org/docs/AddressSanitizer.html#how-to-build])]) |
| 199 | ]) |
Lev Walkin | 33897e2 | 2017-09-26 21:17:39 -0700 | [diff] [blame] | 200 | dnl Address sanitizer sometimes is equipped with the leak sanitizer, |
| 201 | dnl so we use -fsanitize=leak to permit ASAN_OPTIONS environment. |
| 202 | dnl If address sanitizer is not equipped with a leak sanitizer, |
| 203 | dnl invoking programs with ASAN_OPTIONS=detect_leaks=1 will break them. |
| 204 | AX_CHECK_COMPILE_FLAG([-fsanitize=leak], [ |
| 205 | ASAN_ENV_FLAGS="${ASAN_ENV_FLAGS} ASAN_OPTIONS=detect_leaks=1" |
| 206 | ]) |
Lev Walkin | a7d6400 | 2017-08-23 22:34:29 -0700 | [diff] [blame] | 207 | dnl Keep error messages nice. Also consider: |
| 208 | dnl export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer |
| 209 | dnl export ASAN_OPTIONS=symbolize=1 |
| 210 | AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer], |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 211 | [SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-omit-frame-pointer"]) |
| 212 | ]) |
| 213 | |
| 214 | |
Lev Walkin | 5c600f4 | 2017-09-15 21:57:29 -0700 | [diff] [blame] | 215 | dnl Enable LibFuzzer, if supported. |
| 216 | LIBFUZZER_CFLAGS="" |
| 217 | AC_ARG_ENABLE([test-fuzzer], |
| 218 | [AS_HELP_STRING([--enable-test-fuzzer], |
| 219 | [Enable LLVM LibFuzzer for randomized testing])], |
| 220 | [enable_test_fuzzer=$enableval], [enable_test_fuzzer=no]) |
| 221 | AS_IF([test "x$enable_test_fuzzer" != xno], [ |
| 222 | AX_CHECK_COMPILE_FLAG([-fsanitize=fuzzer], |
Lev Walkin | 387a8f0 | 2017-09-15 23:24:00 -0700 | [diff] [blame] | 223 | [LIBFUZZER_CFLAGS="${FUZZER_CFLAGS} -fsanitize=fuzzer -DENABLE_LIBFUZZER"], |
Lev Walkin | 5c600f4 | 2017-09-15 21:57:29 -0700 | [diff] [blame] | 224 | [ |
| 225 | AC_MSG_FAILURE( |
| 226 | [--enable-test-fuzzer=$enable_test_fuzzer is not supported on a target system. |
| 227 | Check out http://llvm.org/docs/LibFuzzer.html]) |
| 228 | ]) |
| 229 | ]) |
| 230 | |
Lev Walkin | 85d7a1b | 2017-10-06 16:35:21 -0700 | [diff] [blame] | 231 | TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} ${SANITIZER_CFLAGS}" |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 232 | SKELETONS_CFLAGS="${SKELETONS_CFLAGS} ${SANITIZER_CFLAGS}" |
Lev Walkin | a7d6400 | 2017-08-23 22:34:29 -0700 | [diff] [blame] | 233 | |
| 234 | AC_SUBST(ADD_CFLAGS) |
Lev Walkin | 5c600f4 | 2017-09-15 21:57:29 -0700 | [diff] [blame] | 235 | AC_SUBST(LIBFUZZER_CFLAGS) |
Lev Walkin | cb4eddb | 2017-09-15 19:12:24 -0700 | [diff] [blame] | 236 | AC_SUBST(SANITIZER_CFLAGS) |
Lev Walkin | a7d6400 | 2017-08-23 22:34:29 -0700 | [diff] [blame] | 237 | AC_SUBST(TESTSUITE_CFLAGS) |
Lev Walkin | 9736348 | 2016-01-24 19:23:02 -0800 | [diff] [blame] | 238 | AC_SUBST(SKELETONS_CFLAGS) |
Lev Walkin | 33897e2 | 2017-09-26 21:17:39 -0700 | [diff] [blame] | 239 | AC_SUBST(ASAN_ENV_FLAGS) |
Lev Walkin | 9736348 | 2016-01-24 19:23:02 -0800 | [diff] [blame] | 240 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 241 | dnl Checks for header files. |
| 242 | AC_HEADER_STDC |
Lev Walkin | 79f5495 | 2004-08-13 16:58:19 +0000 | [diff] [blame] | 243 | AC_CHECK_HEADERS(sys/param.h) |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 244 | |
| 245 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 246 | AC_C_BIGENDIAN |
| 247 | AC_TYPE_OFF_T |
| 248 | AC_TYPE_SIZE_T |
| 249 | AC_STRUCT_TM |
Lev Walkin | da997b1 | 2017-08-04 01:38:41 -0700 | [diff] [blame] | 250 | AC_CHECK_TYPE([__int128], |
| 251 | [AC_DEFINE(HAVE_128_BIT_INT, 1, [Have 128-bit integer])]) |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 252 | AC_CHECK_TYPE(intmax_t, int64_t) |
| 253 | |
Lev Walkin | 1d84ea9 | 2017-08-02 12:40:13 -0700 | [diff] [blame] | 254 | dnl Test if we should test features that depend on 64-bitness. |
| 255 | AC_CHECK_SIZEOF([void *]) |
| 256 | AM_CONDITIONAL([TEST_64BIT], [test "$ac_cv_sizeof_void_p" -eq 8]) |
Lev Walkin | b40ec41 | 2014-02-24 00:57:18 -0800 | [diff] [blame] | 257 | |
Lev Walkin | 058e222 | 2007-12-04 00:27:38 +0000 | [diff] [blame] | 258 | dnl For mingw |
| 259 | AC_SEARCH_LIBS(getopt, iberty) |
| 260 | |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 261 | AC_CHECK_FUNCS(strtoimax strtoll) |
Lev Walkin | 49b0a3e | 2004-06-28 21:22:35 +0000 | [diff] [blame] | 262 | AC_CHECK_FUNCS(mergesort) |
Lev Walkin | 27fd0b6 | 2007-08-27 23:57:45 +0000 | [diff] [blame] | 263 | AC_CHECK_FUNCS(mkstemps) |
Lev Walkin | 04fbe62 | 2014-09-17 02:27:01 -0700 | [diff] [blame] | 264 | AC_CHECK_FUNCS(timegm) |
Lev Walkin | a4f8e94 | 2017-10-08 19:28:20 -0700 | [diff] [blame] | 265 | AC_CHECK_DECLS(strcasecmp) |
Lev Walkin | a06b1b4 | 2017-10-05 23:07:22 -0700 | [diff] [blame] | 266 | AC_CHECK_DECLS(vasprintf) |
Frank Morgner | 8a759ad | 2013-05-16 13:32:49 +0200 | [diff] [blame] | 267 | AC_TRY_LINK_FUNC([symlink],[AC_DEFINE([HAVE_SYMLINK], 1, [Define to 1 if you have the symlink function.])]) |
Lev Walkin | 27fd0b6 | 2007-08-27 23:57:45 +0000 | [diff] [blame] | 268 | |
Lev Walkin | c6080fd | 2016-01-23 06:35:34 -0800 | [diff] [blame] | 269 | dnl Use pandoc to generate manual pages. |
| 270 | AC_PATH_PROG([PANDOC], pandoc) |
| 271 | AM_CONDITIONAL([HAVE_PANDOC], [test -n "$PANDOC"]) |
| 272 | |
Lev Walkin | 327bab2 | 2016-03-14 02:36:27 -0700 | [diff] [blame] | 273 | AC_CONFIG_FILES([\ |
Lev Walkin | 700df49 | 2017-08-10 14:59:15 -0700 | [diff] [blame] | 274 | tests/tests-c-compiler/check-src/Makefile \ |
| 275 | tests/tests-asn1c-compiler/Makefile \ |
Lev Walkin | cb52391 | 2017-09-30 19:33:23 -0700 | [diff] [blame] | 276 | tests/tests-randomized/Makefile \ |
Lev Walkin | 700df49 | 2017-08-10 14:59:15 -0700 | [diff] [blame] | 277 | tests/tests-c-compiler/Makefile \ |
Lev Walkin | 56d59b4 | 2017-08-24 13:54:58 -0700 | [diff] [blame] | 278 | tests/tests-skeletons/Makefile \ |
Lev Walkin | 700df49 | 2017-08-10 14:59:15 -0700 | [diff] [blame] | 279 | libasn1compiler/Makefile \ |
Lev Walkin | d922184 | 2017-08-22 01:44:56 -0700 | [diff] [blame] | 280 | libasn1common/Makefile \ |
Lev Walkin | 700df49 | 2017-08-10 14:59:15 -0700 | [diff] [blame] | 281 | libasn1parser/Makefile \ |
| 282 | libasn1print/Makefile \ |
| 283 | libasn1fix/Makefile \ |
| 284 | doc/docsrc/Makefile \ |
| 285 | skeletons/Makefile \ |
| 286 | examples/Makefile \ |
| 287 | doc/man/Makefile \ |
| 288 | tests/Makefile \ |
| 289 | asn1c/Makefile \ |
| 290 | doc/Makefile \ |
| 291 | Makefile \ |
Lev Walkin | 327bab2 | 2016-03-14 02:36:27 -0700 | [diff] [blame] | 292 | ]) |
| 293 | AC_OUTPUT |
Lev Walkin | f15320b | 2004-06-03 03:38:44 +0000 | [diff] [blame] | 294 | |