2017-03-26 10:48:43 +00:00
|
|
|
|
AC_INIT([asn1c],[0.9.29],[vlm@lionet.info])
|
2014-10-13 00:31:26 +00:00
|
|
|
|
|
|
|
|
|
AC_CONFIG_AUX_DIR(config)
|
2010-11-09 11:10:36 +00:00
|
|
|
|
AC_CONFIG_HEADER([config.h])
|
2016-01-10 21:27:18 +00:00
|
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
2010-11-09 11:10:36 +00:00
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2004-06-03 03:38:44 +00:00
|
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
|
AC_PROG_CC
|
|
|
|
|
AC_PROG_CPP
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
AC_PROG_LN_S
|
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
AC_PROG_YACC
|
|
|
|
|
AM_PROG_LEX
|
2016-07-30 14:14:59 +00:00
|
|
|
|
dnl locate ar using standard macro (old automake 1.11 does not know about AM_PROG_AR)
|
|
|
|
|
m4_ifdef([AM_PROG_AR],
|
|
|
|
|
[AM_PROG_AR],
|
|
|
|
|
[AC_PATH_PROG(AR, ar, ar, $PATH:/usr/ucb:/usr/ccs/bin)])
|
|
|
|
|
|
|
|
|
|
LT_INIT
|
2004-06-03 03:38:44 +00:00
|
|
|
|
|
2014-10-13 01:51:52 +00:00
|
|
|
|
dnl If you need to see the details, just run make V=1.
|
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
2013-05-21 07:56:38 +00:00
|
|
|
|
|
2004-08-23 10:40:21 +00:00
|
|
|
|
case "$host_os" in
|
2006-03-18 06:39:12 +00:00
|
|
|
|
cygwin)
|
2004-08-23 10:40:21 +00:00
|
|
|
|
case "$target" in
|
|
|
|
|
*mingw*)
|
|
|
|
|
CC="$CC -mno-cygwin"
|
|
|
|
|
esac
|
|
|
|
|
;;
|
2006-03-18 06:24:33 +00:00
|
|
|
|
esac
|
|
|
|
|
|
2014-09-17 07:32:03 +00:00
|
|
|
|
AC_ARG_ENABLE([ASN_DEBUG],
|
2015-04-10 07:09:57 +00:00
|
|
|
|
[AS_HELP_STRING([--enable-ASN_DEBUG],
|
|
|
|
|
[produce debug log during `make check` testing])],
|
|
|
|
|
[enable_asn_debug=$enableval], [enable_asn_debug=no])
|
|
|
|
|
AS_IF([test x$enable_asn_debug != xno], [
|
|
|
|
|
TESTSUITE_CFLAGS="-DEMIT_ASN_DEBUG"
|
2016-03-14 12:14:07 +00:00
|
|
|
|
SKELETONS_CFLAGS="-DEMIT_ASN_DEBUG"
|
2015-04-10 07:09:57 +00:00
|
|
|
|
])
|
2014-09-17 07:32:03 +00:00
|
|
|
|
|
2014-01-14 10:12:24 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wall], [CFLAGS="$CFLAGS -Wall"])
|
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wcast-qual], [CFLAGS="$CFLAGS -Wcast-qual"])
|
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wchar-subscripts],
|
2014-09-15 00:19:21 +00:00
|
|
|
|
[CFLAGS="$CFLAGS -Wchar-subscripts"])
|
2014-01-14 10:12:24 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes],
|
2014-09-15 00:19:21 +00:00
|
|
|
|
[CFLAGS="$CFLAGS -Wmissing-prototypes"])
|
2014-01-14 10:12:24 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wmissing-declarations],
|
2014-09-15 00:19:21 +00:00
|
|
|
|
[CFLAGS="$CFLAGS -Wmissing-declarations"])
|
2004-06-03 03:38:44 +00:00
|
|
|
|
|
2014-01-14 10:12:24 +00:00
|
|
|
|
dnl There are legitimate uses for these features, disable warnings/errors.
|
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wno-error=cast-align],
|
2014-09-15 00:19:21 +00:00
|
|
|
|
[CFLAGS="$CFLAGS -Wno-error=cast-align"])
|
2014-01-14 10:12:24 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wno-error=visibility],
|
2014-09-15 00:19:21 +00:00
|
|
|
|
[CFLAGS="$CFLAGS -Wno-error=visibility"])
|
2014-01-14 10:12:24 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wno-error=parentheses-equality],
|
2014-09-15 00:19:21 +00:00
|
|
|
|
[CFLAGS="$CFLAGS -Wno-error=parentheses-equality"])
|
2016-03-14 11:07:45 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-std=gnu99],
|
|
|
|
|
[TESTSUITE_CFLAGS="$TESTSUITE_CFLAGS -std=gnu99"])
|
2014-09-15 00:19:21 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wno-error=unused-variable],
|
|
|
|
|
[TESTSUITE_CFLAGS="$TESTSUITE_CFLAGS -Wno-error=unused-variable"])
|
|
|
|
|
|
2016-01-10 21:27:18 +00:00
|
|
|
|
AC_ARG_ENABLE(Werror,
|
|
|
|
|
[AS_HELP_STRING([--enable-Werror],
|
|
|
|
|
[abort compilation after any C compiler warning])],
|
|
|
|
|
[enable_werror=$enableval], [enable_werror=no])
|
|
|
|
|
AS_IF([test x$enable_werror != xno], [
|
|
|
|
|
ADD_CFLAGS="-Werror -W -Wpointer-arith"
|
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(test-Werror,
|
|
|
|
|
[AS_HELP_STRING([--enable-test-Werror],
|
|
|
|
|
[abort compiling tests after any C compiler warning])],
|
|
|
|
|
[enable_test_werror=$enableval], [enable_test_werror=no])
|
|
|
|
|
AS_IF([test x$enable_test_werror != xno], [
|
|
|
|
|
TESTSUITE_CFLAGS="-Werror -W -Wpointer-arith"
|
|
|
|
|
])
|
|
|
|
|
|
2016-07-18 19:46:36 +00:00
|
|
|
|
AX_CODE_COVERAGE
|
|
|
|
|
AS_IF([test x$enable_code_coverage != xno], [
|
|
|
|
|
CFLAGS="$CFLAGS $CODE_COVERAGE_CFLAGS"
|
|
|
|
|
# The CODE_COVERAGE_CPPFLAGS contains -DNDEBUG flag
|
|
|
|
|
# which removes assert(...) macros from code coverage and improves the
|
|
|
|
|
# branches score. But when it is defined it results in few
|
|
|
|
|
# unsed-but-set-variable warnings that are treated as errors in the travis-ci
|
|
|
|
|
# build because these variables are only used inside assert macros.
|
|
|
|
|
# error: variable ‘ret’ set but not used [-Werror=unused-but-set-variable]
|
|
|
|
|
#CPPFLAGS="$CPPFLAGS $CODE_COVERAGE_CPPFLAGS"
|
|
|
|
|
CXXFLAGS="$CXXFLAGS $CODE_COVERAGE_CXXFLAGS"
|
2017-03-26 23:12:11 +00:00
|
|
|
|
AC_SEARCH_LIBS(gcov_open, gcov, [LDFLAGS="$LDFLAGS $CODE_COVERAGE_LDFLAGS"])
|
2016-07-18 19:46:36 +00:00
|
|
|
|
])
|
|
|
|
|
|
2014-09-15 00:19:21 +00:00
|
|
|
|
AC_SUBST(ADD_CFLAGS)
|
|
|
|
|
AC_SUBST(TESTSUITE_CFLAGS)
|
2004-06-03 03:38:44 +00:00
|
|
|
|
|
2016-01-25 03:23:02 +00:00
|
|
|
|
dnl Skeletons should be very compatible with most of the compilers, hence
|
|
|
|
|
dnl very strict backward compatibility flags.
|
2016-03-14 12:14:07 +00:00
|
|
|
|
SKELETONS_CFLAGS="${ADD_CFLAGS} ${SKELETONS_CFLAGS}"
|
2016-01-25 03:23:02 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-std=c89],
|
2016-01-25 06:13:27 +00:00
|
|
|
|
[SKELETONS_CFLAGS="$SKELETONS_CFLAGS -std=c89"])
|
2016-01-25 03:23:02 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wpedantic],
|
2016-07-19 16:09:33 +00:00
|
|
|
|
[SKELETONS_CFLAGS="$SKELETONS_CFLAGS -Wpedantic"],
|
|
|
|
|
[
|
|
|
|
|
dnl When -Wpedantic is not supported try the -pedantic instead. (gcc-4.7)
|
|
|
|
|
dnl See https://gcc.gnu.org/gcc-4.8/changes.html
|
|
|
|
|
AX_CHECK_COMPILE_FLAG([-pedantic],
|
|
|
|
|
[SKELETONS_CFLAGS="$SKELETONS_CFLAGS -pedantic"], [], [-Werror])
|
|
|
|
|
],
|
|
|
|
|
[-Werror]) #clang 3.0 prints warning when the flag is not supported
|
2016-01-25 06:13:27 +00:00
|
|
|
|
AX_CHECK_COMPILE_FLAG([-Wno-duplicate-decl-specifier],
|
|
|
|
|
[SKELETONS_CFLAGS="$SKELETONS_CFLAGS -Wno-duplicate-decl-specifier"])
|
2016-01-25 03:23:02 +00:00
|
|
|
|
AC_SUBST(SKELETONS_CFLAGS)
|
|
|
|
|
|
2004-06-03 03:38:44 +00:00
|
|
|
|
dnl Checks for header files.
|
|
|
|
|
AC_HEADER_STDC
|
2004-08-13 16:58:19 +00:00
|
|
|
|
AC_CHECK_HEADERS(sys/param.h)
|
2016-07-02 19:55:23 +00:00
|
|
|
|
AC_CHECK_HEADERS(alloca.h)
|
2004-06-03 03:38:44 +00:00
|
|
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
AC_STRUCT_TM
|
|
|
|
|
AC_CHECK_TYPE(intmax_t, int64_t)
|
|
|
|
|
|
2017-08-02 19:40:13 +00:00
|
|
|
|
dnl Test if we should test features that depend on 64-bitness.
|
|
|
|
|
AC_CHECK_SIZEOF([void *])
|
|
|
|
|
AM_CONDITIONAL([TEST_64BIT], [test "$ac_cv_sizeof_void_p" -eq 8])
|
2014-02-24 08:57:18 +00:00
|
|
|
|
|
2007-12-04 00:27:38 +00:00
|
|
|
|
dnl For mingw
|
|
|
|
|
AC_SEARCH_LIBS(getopt, iberty)
|
|
|
|
|
|
2004-06-03 03:38:44 +00:00
|
|
|
|
AC_CHECK_FUNCS(strtoimax strtoll)
|
2004-06-28 21:22:35 +00:00
|
|
|
|
AC_CHECK_FUNCS(mergesort)
|
2007-08-27 23:57:45 +00:00
|
|
|
|
AC_CHECK_FUNCS(mkstemps)
|
2014-09-17 09:27:01 +00:00
|
|
|
|
AC_CHECK_FUNCS(timegm)
|
2013-05-21 12:28:35 +00:00
|
|
|
|
AC_CHECK_DECLS(alloca strcasecmp)
|
2013-05-16 11:32:49 +00:00
|
|
|
|
AC_TRY_LINK_FUNC([symlink],[AC_DEFINE([HAVE_SYMLINK], 1, [Define to 1 if you have the symlink function.])])
|
2007-08-27 23:57:45 +00:00
|
|
|
|
|
2016-01-23 14:35:34 +00:00
|
|
|
|
dnl Use pandoc to generate manual pages.
|
|
|
|
|
AC_PATH_PROG([PANDOC], pandoc)
|
|
|
|
|
AM_CONDITIONAL([HAVE_PANDOC], [test -n "$PANDOC"])
|
|
|
|
|
|
2016-03-14 09:36:27 +00:00
|
|
|
|
AC_CONFIG_FILES([\
|
2016-03-14 11:30:27 +00:00
|
|
|
|
asn1c/tests/check-src/Makefile \
|
2006-03-06 11:33:39 +00:00
|
|
|
|
skeletons/tests/Makefile \
|
|
|
|
|
libasn1compiler/Makefile \
|
|
|
|
|
libasn1parser/Makefile \
|
|
|
|
|
libasn1print/Makefile \
|
|
|
|
|
asn1c/tests/Makefile \
|
|
|
|
|
libasn1fix/Makefile \
|
2010-11-09 11:10:36 +00:00
|
|
|
|
doc/docsrc/Makefile \
|
2006-03-06 11:33:39 +00:00
|
|
|
|
skeletons/Makefile \
|
|
|
|
|
examples/Makefile \
|
2016-01-23 14:35:34 +00:00
|
|
|
|
doc/man/Makefile \
|
2016-03-14 10:46:16 +00:00
|
|
|
|
tests/Makefile \
|
2006-03-06 11:33:39 +00:00
|
|
|
|
asn1c/Makefile \
|
|
|
|
|
doc/Makefile \
|
|
|
|
|
Makefile \
|
2016-03-14 09:36:27 +00:00
|
|
|
|
])
|
|
|
|
|
AC_OUTPUT
|
2004-06-03 03:38:44 +00:00
|
|
|
|
|