"Fossies" - the Fresh Open Source Software Archive

Member "jansson-2.14/configure.ac" (9 Sep 2021, 5831 Bytes) of package /linux/www/jansson-2.14.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "configure.ac": 2.13.1_vs_2.14.

    1 AC_PREREQ([2.60])
    2 AC_INIT([jansson], [2.14], [https://github.com/akheron/jansson/issues])
    3 
    4 AC_CONFIG_AUX_DIR([.])
    5 AM_INIT_AUTOMAKE([1.10 foreign])
    6 
    7 AC_CONFIG_SRCDIR([src/value.c])
    8 AC_CONFIG_HEADERS([jansson_private_config.h])
    9 
   10 # Checks for programs.
   11 AC_PROG_CC
   12 AC_PROG_CXX
   13 AC_PROG_LIBTOOL
   14 AM_CONDITIONAL([GCC], [test x$GCC = xyes])
   15 
   16 # Checks for libraries.
   17 
   18 # Checks for header files.
   19 AC_CHECK_HEADERS([endian.h fcntl.h locale.h sched.h unistd.h sys/param.h sys/stat.h sys/time.h sys/types.h])
   20 
   21 # Checks for typedefs, structures, and compiler characteristics.
   22 AC_TYPE_INT32_T
   23 AC_TYPE_UINT32_T
   24 AC_TYPE_UINT16_T
   25 AC_TYPE_UINT8_T
   26 AC_TYPE_LONG_LONG_INT
   27 
   28 AC_C_INLINE
   29 case $ac_cv_c_inline in
   30     yes) json_inline=inline;;
   31     no) json_inline=;;
   32     *) json_inline=$ac_cv_c_inline;;
   33 esac
   34 AC_SUBST([json_inline])
   35 
   36 # Checks for library functions.
   37 AC_CHECK_FUNCS([close getpid gettimeofday localeconv open read sched_yield strtoll])
   38 
   39 AC_MSG_CHECKING([for gcc __sync builtins])
   40 have_sync_builtins=no
   41 AC_TRY_LINK(
   42   [], [unsigned long val; __sync_bool_compare_and_swap(&val, 0, 1); __sync_add_and_fetch(&val, 1); __sync_sub_and_fetch(&val, 1);],
   43   [have_sync_builtins=yes],
   44 )
   45 if test "x$have_sync_builtins" = "xyes"; then
   46   AC_DEFINE([HAVE_SYNC_BUILTINS], [1],
   47     [Define to 1 if gcc's __sync builtins are available])
   48   json_have_sync_builtins=1
   49 else
   50   json_have_sync_builtins=0
   51 fi
   52 AC_SUBST([json_have_sync_builtins])
   53 AC_MSG_RESULT([$have_sync_builtins])
   54 
   55 AC_MSG_CHECKING([for gcc __atomic builtins])
   56 have_atomic_builtins=no
   57 AC_TRY_LINK(
   58   [], [char l; unsigned long v; __atomic_test_and_set(&l, __ATOMIC_RELAXED); __atomic_store_n(&v, 1, __ATOMIC_RELEASE); __atomic_load_n(&v, __ATOMIC_ACQUIRE); __atomic_add_fetch(&v, 1, __ATOMIC_ACQUIRE); __atomic_sub_fetch(&v, 1, __ATOMIC_RELEASE);],
   59   [have_atomic_builtins=yes],
   60 )
   61 if test "x$have_atomic_builtins" = "xyes"; then
   62   AC_DEFINE([HAVE_ATOMIC_BUILTINS], [1],
   63     [Define to 1 if gcc's __atomic builtins are available])
   64   json_have_atomic_builtins=1
   65 else
   66   json_have_atomic_builtins=0
   67 fi
   68 AC_SUBST([json_have_atomic_builtins])
   69 AC_MSG_RESULT([$have_atomic_builtins])
   70 
   71 case "$ac_cv_type_long_long_int$ac_cv_func_strtoll" in
   72      yesyes) json_have_long_long=1;;
   73      *) json_have_long_long=0;;
   74 esac
   75 AC_SUBST([json_have_long_long])
   76 
   77 case "$ac_cv_header_locale_h$ac_cv_func_localeconv" in
   78      yesyes) json_have_localeconv=1;;
   79      *) json_have_localeconv=0;;
   80 esac
   81 AC_SUBST([json_have_localeconv])
   82 
   83 # Features
   84 AC_ARG_ENABLE([urandom],
   85   [AS_HELP_STRING([--disable-urandom],
   86     [Don't use /dev/urandom to seed the hash function])],
   87   [use_urandom=$enableval], [use_urandom=yes])
   88 
   89 if test "x$use_urandom" = xyes; then
   90 AC_DEFINE([USE_URANDOM], [1],
   91   [Define to 1 if /dev/urandom should be used for seeding the hash function])
   92 fi
   93 
   94 AC_ARG_ENABLE([windows-cryptoapi],
   95   [AS_HELP_STRING([--disable-windows-cryptoapi],
   96     [Don't use CryptGenRandom to seed the hash function])],
   97   [use_windows_cryptoapi=$enableval], [use_windows_cryptoapi=yes])
   98 
   99 if test "x$use_windows_cryptoapi" = xyes; then
  100 AC_DEFINE([USE_WINDOWS_CRYPTOAPI], [1],
  101   [Define to 1 if CryptGenRandom should be used for seeding the hash function])
  102 fi
  103 
  104 AC_ARG_ENABLE([initial-hashtable-order],
  105   [AS_HELP_STRING([--enable-initial-hashtable-order=VAL],
  106     [Number of buckets new object hashtables contain is 2 raised to this power. The default is 3, so empty hashtables contain 2^3 = 8 buckets.])],
  107   [initial_hashtable_order=$enableval], [initial_hashtable_order=3])
  108 AC_DEFINE_UNQUOTED([INITIAL_HASHTABLE_ORDER], [$initial_hashtable_order],
  109   [Number of buckets new object hashtables contain is 2 raised to this power. E.g. 3 -> 2^3 = 8.])
  110 
  111 AC_ARG_ENABLE([Bsymbolic],
  112   [AS_HELP_STRING([--disable-Bsymbolic],
  113     [Avoid linking with -Bsymbolic-function])],
  114   [], [with_Bsymbolic=check])
  115 
  116 if test "x$with_Bsymbolic" != "xno" ; then
  117     AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
  118     saved_LDFLAGS="${LDFLAGS}"
  119     LDFLAGS=-Wl,-Bsymbolic-functions
  120     AC_TRY_LINK(
  121       [], [int main (void) { return 0; }],
  122       [AC_MSG_RESULT([yes])
  123        have_Bsymbolic=yes],
  124       [AC_MSG_RESULT([no])
  125        have_Bsymbolic=no]
  126     )
  127     LDFLAGS="${saved_LDFLAGS}"
  128 
  129     if test "x$with_Bsymbolic" = "xcheck" ; then
  130         with_Bsymbolic=$have_Bsymbolic;
  131     fi
  132     if test "x$with_Bsymbolic:x$have_Bsymbolic" = "xyes:xno" ; then
  133         AC_MSG_ERROR([linker support is required for -Bsymbolic])
  134     fi
  135 fi
  136 
  137 AS_IF([test "x$with_Bsymbolic" = "xyes"], [JSON_BSYMBOLIC_LDFLAGS=-Wl[,]-Bsymbolic-functions])
  138 AC_SUBST(JSON_BSYMBOLIC_LDFLAGS)
  139 
  140 # Enable symbol versioning on GNU libc
  141 JSON_SYMVER_LDFLAGS=
  142 AC_CHECK_DECL([__GLIBC__], [JSON_SYMVER_LDFLAGS=-Wl,--default-symver])
  143 AC_SUBST([JSON_SYMVER_LDFLAGS])
  144 
  145 AC_ARG_ENABLE([ossfuzzers],
  146   [AS_HELP_STRING([--enable-ossfuzzers],
  147     [Whether to generate the fuzzers for OSS-Fuzz])],
  148   [have_ossfuzzers=yes], [have_ossfuzzers=no])
  149 AM_CONDITIONAL([USE_OSSFUZZERS], [test "x$have_ossfuzzers" = "xyes"])
  150 
  151 
  152 AC_SUBST([LIB_FUZZING_ENGINE])
  153 AM_CONDITIONAL([USE_OSSFUZZ_FLAG], [test "x$LIB_FUZZING_ENGINE" = "x-fsanitize=fuzzer"])
  154 AM_CONDITIONAL([USE_OSSFUZZ_STATIC], [test -f "$LIB_FUZZING_ENGINE"])
  155 
  156 
  157 if test x$GCC = xyes; then
  158     AC_MSG_CHECKING(for -Wno-format-truncation)
  159     wnoformat_truncation="-Wno-format-truncation"
  160     AS_IF([${CC} -Wno-format-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1],
  161       [AC_MSG_RESULT(yes)],
  162       [AC_MSG_RESULT(no)
  163       wnoformat_truncation=""])
  164 
  165     AM_CFLAGS="-Wall -Wextra -Wdeclaration-after-statement -Wshadow ${wnoformat_truncation}"
  166 fi
  167 AC_SUBST([AM_CFLAGS])
  168 
  169 AC_CONFIG_FILES([
  170         jansson.pc
  171         Makefile
  172         doc/Makefile
  173         src/Makefile
  174         src/jansson_config.h
  175         test/Makefile
  176         test/bin/Makefile
  177         test/ossfuzz/Makefile
  178         test/suites/Makefile
  179         test/suites/api/Makefile
  180 ])
  181 AC_OUTPUT