"Fossies" - the Fresh Open Source Software Archive

Member "nettle-3.7.3/configure.ac" (6 Jun 2021, 31663 Bytes) of package /linux/privat/nettle-3.7.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. 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": 3.7.2_vs_3.7.3.

    1 dnl -*- mode: shell-script; sh-indentation: 2; -*-
    2 
    3 dnl Process this file with autoconf to produce a configure script.
    4 
    5 AC_INIT([nettle], [3.7.3], [nettle-bugs@lists.lysator.liu.se])
    6 AC_PREREQ(2.61)
    7 AC_CONFIG_SRCDIR([arcfour.c])
    8 # Needed to stop autoconf from looking for files in parent directories.
    9 AC_CONFIG_AUX_DIR([.])
   10 
   11 AC_CONFIG_HEADER([config.h])
   12 
   13 LIBNETTLE_MAJOR=8
   14 LIBNETTLE_MINOR=4
   15 
   16 LIBHOGWEED_MAJOR=6
   17 LIBHOGWEED_MINOR=4
   18 
   19 dnl Note double square brackets, for extra m4 quoting.
   20 MAJOR_VERSION=`echo $PACKAGE_VERSION | sed 's/^\([[^.]]*\)\..*/\1/'`
   21 MINOR_VERSION=`echo $PACKAGE_VERSION | sed 's/^[[^.]]*\.\([[0-9]]*\).*/\1/'`
   22 AC_SUBST([MAJOR_VERSION])
   23 AC_SUBST([MINOR_VERSION])
   24 
   25 AC_CANONICAL_HOST
   26 
   27 # Command line options
   28 AC_ARG_WITH(include-path,
   29   AC_HELP_STRING([--with-include-path], [A colon-separated list of directories to search for include files]),,
   30   [with_include_path=''])
   31 
   32 if test x$with_include_path != x ; then
   33   CPPFLAGS="$CPPFLAGS -I`echo $with_include_path | sed 's/:/ -I/g'`"
   34 fi
   35 
   36 AC_ARG_WITH(lib-path,
   37   AC_HELP_STRING([--with-lib-path], [A colon-separated list of directories to search for libraries]),,
   38   [with_lib_path=''])
   39 
   40 if test x$with_lib_path != x ; then
   41   LDFLAGS="$LDFLAGS -L`echo $with_lib_path | sed 's/:/ -L/g'`"
   42 fi
   43 
   44 AC_ARG_ENABLE(public-key,
   45   AC_HELP_STRING([--disable-public-key], [Disable public key algorithms]),,
   46   [enable_public_key=yes])
   47 
   48 AC_ARG_ENABLE(assembler,
   49   AC_HELP_STRING([--disable-assembler],[Disable assembler code]),,
   50   [enable_assembler=yes])
   51 
   52 AC_ARG_ENABLE(static,
   53   AC_HELP_STRING([--disable-static], [Do not build any static library]),,
   54   [enable_static=yes])
   55 
   56 AC_ARG_ENABLE(shared,
   57   AC_HELP_STRING([--disable-shared], [Do not build any shared library]),,
   58   [enable_shared=yes])
   59 
   60 AC_ARG_ENABLE(pic,
   61   AC_HELP_STRING([--disable-pic],
   62   [Do not try to compile library files as position independent code]),,
   63   [enable_pic=yes])
   64 
   65 AC_ARG_ENABLE(openssl,
   66   AC_HELP_STRING([--disable-openssl], [Do not include openssl glue in the benchmark program]),,
   67   [enable_openssl=yes])
   68 
   69 AC_ARG_ENABLE(gcov,
   70   AC_HELP_STRING([--enable-gcov], [Instrument for gcov (requires a modern gcc)]),,
   71   [enable_gcov=no])
   72 
   73 AC_ARG_ENABLE(documentation,
   74   AC_HELP_STRING([--disable-documentation], [Omit building and installing the documentation. (default=auto)]),,
   75   [enable_documentation=auto])
   76 
   77 AC_ARG_ENABLE(fat, AC_HELP_STRING([--disable-fat], [Disable fat library build]),,
   78   [enable_fat=yes])
   79 
   80 AC_ARG_ENABLE(arm-neon,
   81   AC_HELP_STRING([--enable-arm-neon], [Enable ARM Neon assembly. (default=auto)]),,
   82   [enable_arm_neon=auto])
   83 
   84 AC_ARG_ENABLE(x86-aesni,
   85   AC_HELP_STRING([--enable-x86-aesni], [Enable x86_64 aes instructions. (default=no)]),,
   86   [enable_x86_aesni=no])
   87 
   88 AC_ARG_ENABLE(x86-sha-ni,
   89   AC_HELP_STRING([--enable-x86-sha-ni], [Enable x86_64 sha_ni instructions. (default=no)]),,
   90   [enable_x86_sha_ni=no])
   91 
   92 AC_ARG_ENABLE(power-crypto-ext,
   93   AC_HELP_STRING([--enable-power-crypto-ext], [Enable POWER crypto extensions. (default=no)]),,
   94   [enable_power_crypto_ext=no])
   95 
   96 AC_ARG_ENABLE(power-altivec,
   97   AC_HELP_STRING([--enable-power-altivec], [Enable POWER altivec and vsx extensions. (default=no)]),,
   98   [enable_altivec=no])
   99 
  100 AC_ARG_ENABLE(mini-gmp,
  101   AC_HELP_STRING([--enable-mini-gmp], [Enable mini-gmp, used instead of libgmp.]),,
  102   [enable_mini_gmp=no])
  103 
  104 if test "x$enable_mini_gmp" = xyes ; then
  105   NETTLE_USE_MINI_GMP=1
  106   HOGWEED_EXTRA_SYMBOLS="mpz_*;gmp_*;mpn_*;mp_*;"
  107 else
  108   NETTLE_USE_MINI_GMP=0
  109   HOGWEED_EXTRA_SYMBOLS=""
  110 fi
  111 AC_SUBST([NETTLE_USE_MINI_GMP])
  112 AC_SUBST([HOGWEED_EXTRA_SYMBOLS])
  113 
  114 LSH_RPATH_INIT([`echo $with_lib_path | sed 's/:/ /g'` \
  115     `echo $exec_prefix | sed "s@^NONE@$prefix/lib@g" | sed "s@^NONE@$ac_default_prefix/lib@g"` \
  116     /usr/local/lib /sw/local/lib /sw/lib \
  117     /usr/gnu/lib /opt/gnu/lib /sw/gnu/lib /usr/freeware/lib /usr/pkg/lib])
  118 
  119 # Checks for programs.
  120 AC_PROG_CC
  121 
  122 NETTLE_CHECK_IFUNC
  123 
  124 # When $CC foo.c -o foo creates both foo and foo.exe, autoconf picks
  125 # up the foo.exe and sets exeext to .exe. That is correct for cygwin,
  126 # which has some kind of magic link from foo to foo.exe, but not for
  127 # rntcl. A better check for the cygwin case would check if the
  128 # contents of foo and foo.exe are equal; in the rntcl case, foo is a
  129 # sh script, and foo.exe is a windows executable.
  130 
  131 if test "x$CC" = xrntcl ; then
  132     AC_MSG_NOTICE([Compiling with rntcl; clearing EXEEXT and disabling assembler])
  133     ac_exeext=''
  134     ac_cv_exeext=''
  135     EXEEXT=''
  136     enable_assembler=no
  137 fi
  138 
  139 # Used by the testsuite only
  140 AC_PROG_CXX
  141 
  142 AC_LANG_PUSH(C++)
  143 AC_TRY_COMPILE([],[return 0;],[IF_CXX=''], [IF_CXX='#'])
  144 AC_SUBST([IF_CXX])
  145 AC_LANG_POP
  146 
  147 LD_VERSION_SCRIPT
  148 
  149 AC_PROG_MAKE_SET
  150 AC_PROG_RANLIB
  151 AC_CHECK_TOOL(NM, nm, strings)
  152 # Used only for the GNU-stack configure test.
  153 AC_CHECK_TOOL(OBJDUMP, objdump, false)
  154 AC_CHECK_TOOL(AR, ar, false)
  155 
  156 if test "x$ac_cv_prog_cc_stdc" = xno ; then
  157   AC_ERROR([the C compiler doesn't handle ANSI-C]) #'
  158 fi
  159 
  160 AC_PROG_INSTALL
  161 
  162 # According to the autoconf manual, needs install-sh from
  163 # autoconf-2.60 or automake-1.10 to avoid races.
  164 AC_PROG_MKDIR_P
  165 
  166 AC_PROG_LN_S
  167 
  168 # Compiler tests for the build system
  169 GMP_PROG_CC_FOR_BUILD
  170 GMP_PROG_EXEEXT_FOR_BUILD
  171 
  172 LSH_DEPENDENCY_TRACKING
  173 
  174 if test "x$enable_gcov" = "xyes"; then
  175   CFLAGS="$CFLAGS -ftest-coverage -fprofile-arcs"
  176 fi
  177 
  178 # Checks for typedefs, structures, and compiler characteristics.
  179 AC_C_CONST
  180 AC_C_INLINE
  181 AC_TYPE_UID_T
  182 AC_TYPE_SIZE_T
  183 AC_HEADER_TIME
  184 AC_CHECK_SIZEOF(long)
  185 AC_CHECK_SIZEOF(size_t)
  186 
  187 AC_CHECK_HEADERS([openssl/evp.h openssl/ecdsa.h],,
  188 [enable_openssl=no
  189  break])
  190 
  191 # For use by the testsuite
  192 AC_CHECK_HEADERS([valgrind/memcheck.h])
  193 AC_CHECK_HEADERS([dlfcn.h])
  194 AC_CHECK_LIB([dl], [dlopen],
  195          [AC_DEFINE([HAVE_LIBDL], 1,
  196             [Define to 1 if you have dlopen (with -ldl).])])
  197 
  198 LSH_FUNC_ALLOCA
  199 LSH_FUNC_STRERROR
  200 # getenv_secure is used for fat overrides,
  201 # getline is used in the testsuite
  202 AC_CHECK_FUNCS(secure_getenv getline)
  203 
  204 ASM_WORDS_BIGENDIAN=unknown
  205 AC_C_BIGENDIAN([AC_DEFINE([WORDS_BIGENDIAN], 1)
  206         ASM_WORDS_BIGENDIAN=yes],
  207     [ASM_WORDS_BIGENDIAN=no])
  208 
  209 AC_CACHE_CHECK([for __builtin_bswap64],
  210         nettle_cv_c_builtin_bswap64,
  211 [AC_TRY_LINK([
  212 #include <stdint.h>
  213 ],[
  214 uint64_t x = 17;
  215 uint64_t y = __builtin_bswap64(x);
  216 ],
  217 nettle_cv_c_builtin_bswap64=yes,
  218 nettle_cv_c_builtin_bswap64=no)])
  219 
  220 AH_TEMPLATE([HAVE_BUILTIN_BSWAP64], [Define if __builtin_bswap64 is available])
  221 if test "x$nettle_cv_c_builtin_bswap64" = "xyes" ; then
  222   AC_DEFINE(HAVE_BUILTIN_BSWAP64)
  223 fi
  224 
  225 LSH_GCC_ATTRIBUTES
  226 
  227 # Check for file locking. We (AC_PROG_CC?) have already checked for
  228 # sys/types.h and unistd.h.
  229 AC_CACHE_CHECK([for fcntl file locking],
  230         nettle_cv_fcntl_locking,
  231 [AC_TRY_COMPILE([
  232 #if HAVE_SYS_TYPES_H
  233 # include <sys/types.h>
  234 #endif
  235 #if HAVE_UNISTD_H
  236 # include <unistd.h>
  237 #endif
  238 #include <fcntl.h>
  239 ],[
  240 int op = F_SETLKW;
  241 struct flock fl;
  242 ],
  243 nettle_cv_fcntl_locking=yes,
  244 nettle_cv_fcntl_locking=no)])
  245 
  246 AH_TEMPLATE([HAVE_FCNTL_LOCKING], [Define if fcntl file locking is available])
  247 if test "x$nettle_cv_fcntl_locking" = "xyes" ; then
  248   AC_DEFINE(HAVE_FCNTL_LOCKING)
  249 fi
  250 
  251 # Checks for libraries
  252 if test "x$enable_public_key" = "xyes" ; then
  253   if test "x$enable_mini_gmp" = "xno" ; then
  254     # mpn_zero_p was added in GMP-6.1.0
  255     AC_CHECK_LIB(gmp, __gmpn_zero_p,,
  256         [AC_MSG_WARN(
  257     [GNU MP not found, or too old. GMP-6.1.0 or later is needed, see https://gmplib.org/.
  258     Support for public key algorithms will be unavailable.])]
  259         enable_public_key=no)
  260 
  261     # Add -R flags needed to run programs linked with gmp
  262     LSH_RPATH_FIX
  263   fi
  264 fi
  265 
  266 nettle_cv_gmp_numb_bits=0
  267 if test "x$enable_public_key" = "xyes" ; then
  268   # Check for gmp limb size
  269   if test "x$enable_mini_gmp" = "xyes" ; then
  270     AC_MSG_CHECKING([for mini-gmp limb size])
  271     # With mini-gmp, mp_limb_t is always unsigned long.
  272     AC_COMPUTE_INT(nettle_cv_gmp_numb_bits, [(sizeof(unsigned long) * CHAR_BIT)],
  273         [#include <limits.h>],
  274         [AC_MSG_FAILURE([cannot find value of GMP_NUMB_BITS])])
  275 
  276     AC_MSG_RESULT([$nettle_cv_gmp_numb_bits bits])
  277   else
  278     AC_MSG_CHECKING([for GMP limb size])
  279     AC_COMPUTE_INT(nettle_cv_gmp_numb_bits, [GMP_NUMB_BITS],
  280         [#include <gmp.h>],
  281         [AC_MSG_FAILURE([cannot find value of GMP_NUMB_BITS])])
  282 
  283     AC_MSG_RESULT([$nettle_cv_gmp_numb_bits bits])
  284   fi
  285 fi
  286 
  287 # Substituted in Makefile, passed on to the eccdata command.
  288 NUMB_BITS="$nettle_cv_gmp_numb_bits"
  289 AC_SUBST([NUMB_BITS])
  290 
  291 # Substituted in version.h, used only with mini-gmp.
  292 if test "x$enable_mini_gmp" = "xyes" ; then
  293   GMP_NUMB_BITS="$NUMB_BITS"
  294 else
  295   GMP_NUMB_BITS="n/a"
  296 fi
  297 AC_SUBST([GMP_NUMB_BITS])
  298 
  299 # Figure out ABI. Currently, configurable only by setting CFLAGS.
  300 ABI=standard
  301 
  302 case "$host_cpu" in
  303   [x86_64 | amd64])
  304     AC_TRY_COMPILE([
  305 #if defined(__x86_64__) || defined(__arch64__)
  306 #error 64-bit x86
  307 #endif
  308     ], [], [
  309       ABI=32
  310     ], [
  311       ABI=64
  312     ])
  313     ;;
  314   *sparc*)
  315     AC_TRY_COMPILE([
  316 #if defined(__sparcv9) || defined(__arch64__)
  317 #error 64-bit sparc
  318 #endif
  319     ], [], [
  320       ABI=32
  321     ], [
  322       ABI=64
  323     ])
  324     ;;
  325   *mips*)
  326     AC_TRY_COMPILE([
  327 #if defined(__sgi) && defined(__LP64__)
  328 #error 64-bit mips
  329 #endif
  330     ], [], [
  331       ABI=32
  332     ], [
  333       ABI=64
  334     ])
  335     ;;
  336   *powerpc64*)
  337     AC_TRY_COMPILE([
  338 #if defined(__PPC64__)
  339 #error 64-bit powerpc
  340 #endif
  341     ], [], [
  342       ABI=32
  343     ], [
  344       ABI=64
  345     ])
  346     ;;
  347 esac
  348 
  349 if test "x$ABI" != xstandard ; then
  350   AC_MSG_NOTICE([Compiler uses $ABI-bit ABI. To change, set CC.])
  351   if test "$libdir" = '${exec_prefix}/lib' ; then
  352     # Try setting a better default
  353     case "$host_cpu:$host_os:$ABI" in
  354       *:solaris*:32|*:sunos*:32)
  355     libdir='${exec_prefix}/lib'
  356     ;;
  357       *:solaris*:64|*:sunos*:64)
  358     libdir='${exec_prefix}/lib/64'
  359     ;;
  360       # Linux conventions are a mess... According to the Linux File
  361       # Hierarchy Standard, all architectures except IA64 puts 32-bit
  362       # libraries in lib, and 64-bit in lib64. Some distributions,
  363       # e.g., Fedora and Gentoo, adhere to this standard, while at
  364       # least Debian has decided to put 64-bit libraries in lib and
  365       # 32-bit libraries in lib32.
  366       
  367       # We try to figure out the convention, except if we're cross
  368       # compiling. We use lib${ABI} if /usr/lib${ABI} exists and
  369       # appears to not be a symlink to a different name.
  370       *:linux*:32|*:linux*:64)
  371     if test "$cross_compiling" = yes ; then
  372           AC_MSG_WARN([Cross compiling for linux. Can't guess if libraries go in lib${ABI} or lib.]); dnl '
  373     else
  374       # The dash builtin pwd tries to be "helpful" and remember
  375       # symlink names. Use -P option, and hope it's portable enough.
  376       test -d /usr/lib${ABI} \
  377         && (cd /usr/lib${ABI} && pwd -P | grep >/dev/null "/lib${ABI}"'$') \
  378         && libdir='${exec_prefix}/'"lib${ABI}"
  379     fi
  380     ;;
  381       # On freebsd, it seems 32-bit libraries are in lib32,
  382       # and 64-bit in lib. Don't know about "kfreebsd", does
  383       # it follow the Linux fhs conventions?
  384       *:freebsd*:32)
  385     libdir='${exec_prefix}/lib32'
  386     ;;
  387       *:freebsd*:64)
  388     libdir='${exec_prefix}/lib'
  389     ;;
  390       *:irix*:32)
  391     libdir='${exec_prefix}/lib32'
  392     ;;
  393       *:irix*:64)
  394     libdir='${exec_prefix}/lib64'
  395     ;;
  396       *)
  397         AC_MSG_WARN([Don't know where to install $ABI-bit libraries on this system.]); dnl '
  398 
  399     esac
  400     AC_MSG_NOTICE([Libraries to be installed in $libdir.])
  401   fi
  402 fi
  403 
  404 OPT_NETTLE_SOURCES=""
  405 FAT_TEST_LIST=""
  406 ASM_PPC_WANT_R_REGISTERS="n/a"
  407 
  408 # Select assembler code
  409 asm_path=
  410 if test "x$enable_assembler" = xyes ; then
  411   case "$host_cpu" in
  412     [x86 | i?86* | k[5-8]* | pentium* | athlon])
  413       asm_path=x86
  414       ;;
  415     [x86_64 | amd64])
  416       if test "$ABI" = 64 ; then
  417     asm_path=x86_64
  418     if test "x$enable_fat" = xyes ; then
  419       asm_path="x86_64/fat $asm_path"
  420       OPT_NETTLE_SOURCES="fat-x86_64.c $OPT_NETTLE_SOURCES"
  421       # For now, not enabling aesni or sha_ni, since at least 
  422       # the latter appears unavailable on te gitlab test machines.
  423       FAT_TEST_LIST="vendor:intel vendor:amd"
  424     else
  425       if test "x$enable_x86_aesni" = xyes ; then
  426         asm_path="x86_64/aesni $asm_path"
  427       fi
  428       if test "x$enable_x86_sha_ni" = xyes ; then
  429         asm_path="x86_64/sha_ni $asm_path"
  430       fi
  431     fi
  432       else
  433     asm_path=x86
  434       fi
  435       ;;
  436     *sparc*)
  437       if test "$ABI" = 64 ; then
  438     asm_path=sparc64
  439       else
  440     asm_path=sparc32
  441       fi
  442       ;;
  443     arm*)
  444       asm_path=arm
  445       if test "x$enable_fat" = xyes ; then
  446     asm_path="arm/fat $asm_path"
  447     OPT_NETTLE_SOURCES="fat-arm.c $OPT_NETTLE_SOURCES"
  448     FAT_TEST_LIST="arch:5 arch:6,neon"
  449       else
  450     case "$host_cpu" in
  451       armv6* | armv7*)
  452         NETTLE_CHECK_ARM_NEON
  453 
  454         asm_path="arm/v6 arm"
  455         ;;
  456     esac
  457     if test "x$enable_arm_neon" = xyes ; then
  458       asm_path="arm/neon $asm_path"
  459     fi
  460       fi
  461       ;;
  462     *powerpc64*)
  463       if test "$ABI" = 64 ; then
  464     GMP_ASM_POWERPC_R_REGISTERS
  465     asm_path="powerpc64"
  466     if test "x$enable_fat" = xyes ; then
  467       asm_path="powerpc64/fat $asm_path"
  468       OPT_NETTLE_SOURCES="fat-ppc.c $OPT_NETTLE_SOURCES"
  469       FAT_TEST_LIST="none crypto_ext altivec"
  470     else
  471       if test "$enable_power_crypto_ext" = yes ; then
  472             asm_path="powerpc64/p8 $asm_path"
  473       fi
  474       if test "$enable_power_altivec" = yes ; then
  475         asm_path="powerpc64/p7 $asm_path"
  476       fi
  477     fi
  478       fi
  479       ;;
  480 
  481     *)
  482       enable_assembler=no
  483       ;;
  484   esac
  485 fi
  486 
  487 # Files which replace a C source file (or otherwise don't correspond
  488 # to a new object file).
  489 asm_replace_list="aes-encrypt-internal.asm aes-decrypt-internal.asm \
  490         arcfour-crypt.asm camellia-crypt-internal.asm \
  491         md5-compress.asm memxor.asm memxor3.asm \
  492         poly1305-internal.asm \
  493         chacha-core-internal.asm \
  494         salsa20-crypt.asm salsa20-core-internal.asm \
  495         serpent-encrypt.asm serpent-decrypt.asm \
  496         sha1-compress.asm sha256-compress.asm sha512-compress.asm \
  497         sha3-permute.asm umac-nh.asm umac-nh-n.asm machine.m4"
  498 
  499 # Assembler files which generate additional object files if they are used.
  500 asm_nettle_optional_list="gcm-hash.asm gcm-hash8.asm cpuid.asm \
  501   aes-encrypt-internal-2.asm aes-decrypt-internal-2.asm memxor-2.asm \
  502   chacha-2core.asm chacha-3core.asm chacha-4core.asm chacha-core-internal-2.asm \
  503   salsa20-2core.asm salsa20-core-internal-2.asm \
  504   sha1-compress-2.asm sha256-compress-2.asm \
  505   sha3-permute-2.asm sha512-compress-2.asm \
  506   umac-nh-n-2.asm umac-nh-2.asm"
  507 
  508 asm_hogweed_optional_list=""
  509 if test "x$enable_public_key" = "xyes" ; then
  510   asm_hogweed_optional_list="ecc-secp192r1-modp.asm ecc-secp224r1-modp.asm \
  511     ecc-secp256r1-redc.asm ecc-secp384r1-modp.asm ecc-secp521r1-modp.asm \
  512     ecc-curve25519-modp.asm ecc-curve448-modp.asm"
  513 fi
  514 
  515 OPT_NETTLE_OBJS=""
  516 OPT_HOGWEED_OBJS=""
  517 
  518 asm_file_list=""
  519 
  520 if test "x$enable_assembler" = xyes ; then
  521   if test -n "$asm_path"; then
  522     AC_MSG_NOTICE([Looking for assembler files in $asm_path.])
  523     for tmp_f in $asm_replace_list ; do
  524       for asm_dir in $asm_path ; do
  525         if test -f "$srcdir/$asm_dir/$tmp_f"; then
  526       asm_file_list="$asm_file_list $tmp_f"
  527           AC_CONFIG_LINKS($tmp_f:$asm_dir/$tmp_f)
  528       break
  529         fi
  530       done
  531     done
  532     dnl Workaround for AC_CONFIG_LINKS, which complains if we use the
  533     dnl same destination argument $tmp_f multiple times.
  534     for tmp_n in $asm_nettle_optional_list ; do
  535       dnl Note extra pair of [] in sed expression
  536       tmp_b=`echo "$tmp_n" | sed 's/\.[[^.]]*$//'`
  537       for asm_dir in $asm_path ; do
  538     if test -f "$srcdir/$asm_dir/$tmp_n"; then
  539       asm_file_list="$asm_file_list $tmp_n"
  540       AC_CONFIG_LINKS($tmp_n:$asm_dir/$tmp_n)
  541       while read tmp_func ; do
  542         AC_DEFINE_UNQUOTED(HAVE_NATIVE_$tmp_func)
  543         eval HAVE_NATIVE_$tmp_func=yes
  544       done <<EOF
  545 [`sed -n 's/^.*[^   ]*PROLOGUE(_*\(nettle_\)*\([^)]*\)).*$/\2/p' < "$srcdir/$asm_dir/$tmp_n"`]
  546 EOF
  547       OPT_NETTLE_OBJS="$OPT_NETTLE_OBJS $tmp_b"'.$(OBJEXT)'
  548       break
  549     fi
  550       done
  551     done    
  552     for tmp_h in $asm_hogweed_optional_list ; do
  553       dnl Note extra pair of [] in sed expression
  554       tmp_b=`echo "$tmp_h" | sed 's/\.[[^.]]*$//'`
  555       for asm_dir in $asm_path ; do
  556     if test -f "$srcdir/$asm_dir/$tmp_h"; then
  557       dnl Note double square brackets, for extra m4 quoting.
  558       tmp_bits=`grep GMP_NUMB_BITS "$srcdir/$asm_dir/$tmp_h" \
  559             | sed 's/^.*GMP_NUMB_BITS(\([[0-9]]*\)).*$/\1/'`
  560       if test "$tmp_bits" && test "$tmp_bits" != "${NUMB_BITS}" ; then
  561          AC_MSG_WARN([skipping $tmp_h, because GMP_NUMB_BITS != $tmp_bits])
  562          continue
  563       fi
  564       asm_file_list="$asm_file_list $tmp_h"
  565       AC_CONFIG_LINKS($tmp_h:$asm_dir/$tmp_h)
  566       while read tmp_func ; do
  567         AC_DEFINE_UNQUOTED(HAVE_NATIVE_$tmp_func)
  568         eval HAVE_NATIVE_$tmp_func=yes
  569       done <<EOF
  570 [`sed -n 's/[^  ]*PROLOGUE(_*\(nettle_\)*\([^)]*\)).*$/\2/p' < "$srcdir/$asm_dir/$tmp_h"`]
  571 EOF
  572       OPT_HOGWEED_OBJS="$OPT_HOGWEED_OBJS $tmp_b"'.$(OBJEXT)'
  573       break
  574     fi
  575       done
  576     done    
  577     if test -z "$asm_file_list"; then
  578       enable_assembler=no
  579       AC_MSG_WARN([No assembler files found.])
  580     fi
  581   fi
  582   case "$host_os" in
  583     darwin*)
  584       ASM_RODATA='.section __TEXT,__const'
  585       ;;
  586     *)
  587       ASM_RODATA='.section .rodata'
  588       ;;
  589   esac
  590 fi
  591 
  592 AC_SUBST([OPT_NETTLE_OBJS])
  593 AC_SUBST([OPT_HOGWEED_OBJS])
  594 AC_SUBST([OPT_NETTLE_SOURCES])
  595 AC_SUBST([FAT_TEST_LIST])
  596 AC_SUBST([ASM_RODATA])
  597 if test "x$enable_assembler" = xyes ; then
  598   IF_ASM=''
  599 else
  600   IF_ASM='#'
  601 fi
  602 AC_SUBST([IF_ASM])
  603 AC_SUBST([ASM_PPC_WANT_R_REGISTERS])
  604 
  605 AH_VERBATIM([HAVE_NATIVE],
  606 [/* Define to 1 each of the following for which a native (ie. CPU specific)
  607     implementation of the corresponding routine exists.  */
  608 #undef HAVE_NATIVE_aes_decrypt
  609 #undef HAVE_NATIVE_aes_encrypt
  610 #undef HAVE_NATIVE_chacha_core
  611 #undef HAVE_NATIVE_chacha_2core
  612 #undef HAVE_NATIVE_chacha_3core
  613 #undef HAVE_NATIVE_chacha_4core
  614 #undef HAVE_NATIVE_fat_chacha_2core
  615 #undef HAVE_NATIVE_fat_chacha_3core
  616 #undef HAVE_NATIVE_fat_chacha_4core
  617 #undef HAVE_NATIVE_ecc_curve25519_modp
  618 #undef HAVE_NATIVE_ecc_curve448_modp
  619 #undef HAVE_NATIVE_ecc_secp192r1_modp
  620 #undef HAVE_NATIVE_ecc_secp192r1_redc
  621 #undef HAVE_NATIVE_ecc_secp224r1_modp
  622 #undef HAVE_NATIVE_ecc_secp224r1_redc
  623 #undef HAVE_NATIVE_ecc_secp256r1_modp
  624 #undef HAVE_NATIVE_ecc_secp256r1_redc
  625 #undef HAVE_NATIVE_ecc_secp384r1_modp
  626 #undef HAVE_NATIVE_ecc_secp384r1_redc
  627 #undef HAVE_NATIVE_ecc_secp521r1_modp
  628 #undef HAVE_NATIVE_ecc_secp521r1_redc
  629 #undef HAVE_NATIVE_gcm_init_key
  630 #undef HAVE_NATIVE_fat_gcm_init_key
  631 #undef HAVE_NATIVE_gcm_hash
  632 #undef HAVE_NATIVE_fat_gcm_hash
  633 #undef HAVE_NATIVE_gcm_hash8
  634 #undef HAVE_NATIVE_salsa20_core
  635 #undef HAVE_NATIVE_salsa20_2core
  636 #undef HAVE_NATIVE_fat_salsa20_2core
  637 #undef HAVE_NATIVE_sha1_compress
  638 #undef HAVE_NATIVE_sha256_compress
  639 #undef HAVE_NATIVE_sha512_compress
  640 #undef HAVE_NATIVE_sha3_permute
  641 #undef HAVE_NATIVE_umac_nh
  642 #undef HAVE_NATIVE_umac_nh_n])
  643 
  644 if test "x$enable_pic" = xyes; then
  645     LSH_CCPIC
  646 else
  647     CCPIC=''
  648 fi
  649 AC_SUBST(CCPIC)
  650 
  651 IF_DLL='#'
  652 LIBNETTLE_FILE_SRC='$(LIBNETTLE_FORLINK)'
  653 LIBHOGWEED_FILE_SRC='$(LIBHOGWEED_FORLINK)'
  654 EMULATOR=''
  655 W64_ABI=no
  656 
  657 case "$host_os" in
  658   mingw32*|cygwin*)
  659     # The actual DLLs, e.g. libnettle-$major-$minor.dll, are normally
  660     # installed into the bin dir (or more exactly $libdir/../bin, for
  661     # automake), while libnettle.dll.a, which is a stub file for
  662     # linking to the DLL, is installed into the lib dir.
  663     case "$host_os" in
  664       mingw32*)
  665         LIBNETTLE_FORLINK='libnettle-$(LIBNETTLE_MAJOR).dll'
  666         LIBHOGWEED_FORLINK='libhogweed-$(LIBHOGWEED_MAJOR).dll'
  667         ;;
  668       cygwin*)
  669         LIBNETTLE_FORLINK='cygnettle-$(LIBNETTLE_MAJOR).dll'
  670         LIBHOGWEED_FORLINK='cyghogweed-$(LIBHOGWEED_MAJOR).dll'
  671         ;;
  672     esac
  673     if test "x$cross_compiling" = xyes ; then
  674     case "$ABI" in
  675         64)
  676         EMULATOR=wine64
  677         ;;
  678         *)
  679         EMULATOR=wine
  680         ;;
  681     esac
  682     fi
  683     if test "x$ABI" = x64 ; then
  684         W64_ABI=yes
  685     fi
  686     LIBNETTLE_SONAME=''
  687     LIBNETTLE_FILE='libnettle.dll.a'
  688     LIBNETTLE_FILE_SRC='$(LIBNETTLE_FILE)'
  689     LIBNETTLE_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBNETTLE_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
  690     LIBNETTLE_LIBS='-Wl,--no-whole-archive $(LIBS)'
  691 
  692     LIBHOGWEED_SONAME=''
  693     LIBHOGWEED_FILE='libhogweed.dll.a'
  694     LIBHOGWEED_FILE_SRC='$(LIBHOGWEED_FILE)'
  695     LIBHOGWEED_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBHOGWEED_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
  696     LIBHOGWEED_LIBS='-Wl,--no-whole-archive $(LIBS) libnettle.dll.a'
  697     IF_DLL=''
  698     ;;
  699   darwin*)
  700     LIBNETTLE_FORLINK=libnettle.dylib
  701     LIBNETTLE_SONAME='libnettle.$(LIBNETTLE_MAJOR).dylib'
  702     LIBNETTLE_FILE='libnettle.$(LIBNETTLE_MAJOR).$(LIBNETTLE_MINOR).dylib'
  703     LIBNETTLE_LINK='$(CC) $(CFLAGS) -dynamiclib $(LDFLAGS) -install_name ${libdir}/$(LIBNETTLE_SONAME) -compatibility_version $(LIBNETTLE_MAJOR) -current_version $(LIBNETTLE_MAJOR).$(LIBNETTLE_MINOR)'
  704     LIBNETTLE_LIBS=''
  705 
  706     LIBHOGWEED_FORLINK=libhogweed.dylib
  707     LIBHOGWEED_SONAME='libhogweed.$(LIBHOGWEED_MAJOR).dylib'
  708     LIBHOGWEED_FILE='libhogweed.$(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR).dylib'
  709     LIBHOGWEED_LINK='$(CC) $(CFLAGS) -dynamiclib -L. $(LDFLAGS) -install_name ${libdir}/$(LIBHOGWEED_SONAME) -compatibility_version $(LIBHOGWEED_MAJOR) -current_version $(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR)'
  710     LIBHOGWEED_LIBS='-lnettle $(LIBS)'
  711     ;;
  712   solaris*)
  713     # Sun's ld uses -h to set the soname, and this option is passed
  714     # through by both Sun's compiler and gcc. Might not work with GNU
  715     # ld, but it's unusual to use GNU ld on Solaris.
  716     LIBNETTLE_FORLINK=libnettle.so
  717     LIBNETTLE_SONAME='$(LIBNETTLE_FORLINK).$(LIBNETTLE_MAJOR)'
  718     LIBNETTLE_FILE='$(LIBNETTLE_SONAME).$(LIBNETTLE_MINOR)'
  719     LIBNETTLE_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -h $(LIBNETTLE_SONAME)'
  720     LIBNETTLE_LIBS=''
  721 
  722     LIBHOGWEED_FORLINK=libhogweed.so
  723     LIBHOGWEED_SONAME='$(LIBHOGWEED_FORLINK).$(LIBHOGWEED_MAJOR)'
  724     LIBHOGWEED_FILE='$(LIBHOGWEED_SONAME).$(LIBHOGWEED_MINOR)'
  725     LIBHOGWEED_LINK='$(CC) $(CFLAGS) $(LDFLAGS) --shared -h $(LIBHOGWEED_SONAME)'
  726     LIBHOGWEED_LIBS='libnettle.so $(LIBS)'
  727     ;;
  728   *)
  729     LIBNETTLE_FORLINK=libnettle.so
  730     LIBNETTLE_SONAME='$(LIBNETTLE_FORLINK).$(LIBNETTLE_MAJOR)'
  731     LIBNETTLE_FILE='$(LIBNETTLE_SONAME).$(LIBNETTLE_MINOR)'
  732     LIBNETTLE_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$(LIBNETTLE_SONAME)'
  733     LIBNETTLE_LIBS=''
  734 
  735     LIBHOGWEED_FORLINK=libhogweed.so
  736     LIBHOGWEED_SONAME='$(LIBHOGWEED_FORLINK).$(LIBHOGWEED_MAJOR)'
  737     LIBHOGWEED_FILE='$(LIBHOGWEED_SONAME).$(LIBHOGWEED_MINOR)'
  738     LIBHOGWEED_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$(LIBHOGWEED_SONAME)'
  739     # Requested by debian, to make linking with only -lhogweed work
  740     # (does not work in general, e.g., with static linking all of
  741     # -lhogweed -lgmp -lnettle are still required). Also makes dlopen
  742     # of libhogweed.so work, without having to use RTLD_GLOBAL.
  743     LIBHOGWEED_LIBS='libnettle.so $(LIBS)'
  744     ;;
  745 esac
  746 
  747 ASM_SYMBOL_PREFIX=''
  748 ASM_ELF_STYLE='no'
  749 ASM_COFF_STYLE='no'
  750 # GNU as default is to use @
  751 ASM_TYPE_FUNCTION='@function'
  752 ASM_TYPE_PROGBITS='@progbits'
  753 ASM_MARK_NOEXEC_STACK=''
  754 ASM_ALIGN_LOG=''
  755 
  756 if test x$enable_assembler = xyes ; then
  757   AC_CACHE_CHECK([if globals are prefixed by underscore],
  758   nettle_cv_asm_underscore,
  759   [ # Default is no underscore
  760     nettle_cv_asm_underscore=no
  761     AC_COMPILE_IFELSE(
  762       [AC_LANG_SOURCE([int a_global_symbol;])],
  763       [ $NM conftest.$OBJEXT >conftest.out
  764         if grep _a_global_symbol conftest.out >/dev/null ; then
  765           nettle_cv_asm_underscore=yes
  766         elif grep a_global_symbol conftest.out >/dev/null ; then
  767           nettle_cv_asm_underscore=no
  768         else
  769           AC_MSG_WARN([nm does not list a_global_symbol at all])
  770     fi],
  771       [AC_MSG_WARN([test program with a single global could not be compiled!?])])])
  772   if test x$nettle_cv_asm_underscore = xyes ; then
  773     ASM_SYMBOL_PREFIX='_'
  774   fi
  775 
  776   AC_CACHE_CHECK([for ELF-style .type,%function pseudo-ops],
  777     [nettle_cv_asm_type_percent_function],
  778     [GMP_TRY_ASSEMBLE([
  779 .text
  780 .globl foo
  781 .type foo,%function
  782 foo:
  783 .Lend:
  784 
  785 .size foo, .Lend - foo
  786 ],
  787        [nettle_cv_asm_type_percent_function=yes],
  788        [nettle_cv_asm_type_percent_function=no])])
  789 
  790 dnl Needs double quote for the # character
  791   AC_CACHE_CHECK([[for ELF-style .type,#function pseudo-ops]],
  792     [nettle_cv_asm_type_hash_function],
  793     [GMP_TRY_ASSEMBLE([
  794 .text
  795 .globl foo
  796 .type foo,#function
  797 foo:
  798 .Lend:
  799 
  800 .size foo, .Lend - foo
  801 ],
  802        [nettle_cv_asm_type_hash_function=yes],
  803        [nettle_cv_asm_type_hash_function=no])])
  804 
  805   if test x$nettle_cv_asm_type_percent_function = xyes ; then
  806     ASM_ELF_STYLE='yes'
  807     ASM_TYPE_FUNCTION='%function'
  808     ASM_TYPE_PROGBITS='%progbits'
  809   else
  810     if test x$nettle_cv_asm_type_hash_function = xyes ; then
  811       ASM_ELF_STYLE='yes'
  812       ASM_TYPE_FUNCTION='#function'
  813       ASM_TYPE_PROGBITS='#progbits'
  814     fi
  815   fi
  816 
  817   AC_CACHE_CHECK([for COFF-style .type directive],
  818     [nettle_cv_asm_coff_type],
  819       [GMP_TRY_ASSEMBLE([
  820 .text
  821 .globl _foo
  822 .def _foo
  823 .scl 2
  824 .type 32
  825 .endef
  826 _foo:
  827 ],
  828         [nettle_cv_asm_coff_type=yes],
  829         [nettle_cv_asm_coff_type=no])])
  830   if test "x$nettle_cv_asm_coff_type" = "xyes" ; then
  831     ASM_COFF_STYLE=yes
  832   fi
  833 
  834   AC_CACHE_CHECK([if we should use a .note.GNU-stack section],
  835   nettle_cv_asm_gnu_stack,
  836   [ # Default
  837     nettle_cv_asm_gnu_stack=no
  838 
  839     cat >conftest.c <<EOF
  840 int foo() { return 0; }
  841 EOF
  842     nettle_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >conftest.out 2>&1"
  843     if AC_TRY_EVAL(nettle_compile); then
  844       cat conftest.out >&AC_FD_CC
  845       $OBJDUMP -x conftest.o | grep '\.note\.GNU-stack' > /dev/null \
  846       && nettle_cv_asm_gnu_stack=yes
  847     else
  848       cat conftest.out >&AC_FD_CC
  849       echo "configure: failed program was:" >&AC_FD_CC
  850       cat conftest.s >&AC_FD_CC
  851     fi
  852     rm -f conftest.*])
  853   if test x$nettle_cv_asm_gnu_stack = xyes ; then
  854     ASM_MARK_NOEXEC_STACK='.section .note.GNU-stack,"",TYPE_PROGBITS'
  855   fi
  856 
  857   AC_CACHE_CHECK([if .align assembly directive is logarithmic],
  858     [nettle_cv_asm_align_log],
  859     [GMP_TRY_ASSEMBLE([
  860 .align 3
  861 ],
  862        [nettle_cv_asm_align_log=yes],
  863        [nettle_cv_asm_align_log=no])])
  864   ASM_ALIGN_LOG="$nettle_cv_asm_align_log"
  865 fi
  866 
  867 dnl  Define
  868 dnl  1. ASM_X86_ENDBR for endbr32/endbr64.
  869 dnl  2. ASM_X86_MARK_CET to add a .note.gnu.property section to mark
  870 dnl  Intel CET support if needed.
  871 dnl  3. ASM_X86_MARK_CET_ALIGN to align ASM_X86_MARK_CET.
  872 AC_CACHE_CHECK([if Intel CET is enabled],
  873   [nettle_cv_asm_x86_intel_cet],
  874   [AC_TRY_COMPILE([
  875 #ifndef __CET__
  876 #error Intel CET is not enabled
  877 #endif
  878   ], [],
  879   [nettle_cv_asm_x86_intel_cet=yes],
  880   [nettle_cv_asm_x86_intel_cet=no])])
  881 if test "$nettle_cv_asm_x86_intel_cet" = yes; then
  882   case $ABI in
  883   32|standard)
  884     ASM_X86_ENDBR=endbr32
  885     ASM_X86_MARK_CET_ALIGN=2
  886     ;;
  887   64)
  888     ASM_X86_ENDBR=endbr64
  889     ASM_X86_MARK_CET_ALIGN=3
  890     ;;
  891   x32)
  892     ASM_X86_ENDBR=endbr64
  893     ASM_X86_MARK_CET_ALIGN=2
  894     ;;
  895   esac
  896   AC_CACHE_CHECK([if .note.gnu.property section is needed],
  897     [nettle_cv_asm_x86_gnu_property],
  898     [AC_TRY_COMPILE([
  899 #if !defined __ELF__ || !defined __CET__
  900 #error GNU property is not needed
  901 #endif
  902     ], [],
  903     [nettle_cv_asm_x86_gnu_property=yes],
  904     [nettle_cv_asm_x86_gnu_property=no])])
  905 else
  906   nettle_cv_asm_x86_gnu_property=no
  907 fi
  908 if test "$nettle_cv_asm_x86_gnu_property" = yes; then
  909   ASM_X86_MARK_CET='
  910     .pushsection ".note.gnu.property", "a"
  911     .p2align ASM_X86_MARK_CET_ALIGN
  912     .long 1f - 0f
  913     .long 4f - 1f
  914     .long 5
  915 0:
  916     .asciz "GNU"
  917 1:
  918     .p2align ASM_X86_MARK_CET_ALIGN
  919     .long 0xc0000002
  920     .long 3f - 2f
  921 2:
  922     .long 3
  923 3:
  924     .p2align ASM_X86_MARK_CET_ALIGN
  925 4:
  926     .popsection'
  927 fi
  928 
  929 AC_SUBST(ASM_SYMBOL_PREFIX)
  930 AC_SUBST(ASM_ELF_STYLE)
  931 AC_SUBST(ASM_COFF_STYLE)
  932 AC_SUBST(ASM_TYPE_FUNCTION)
  933 AC_SUBST(ASM_TYPE_PROGBITS)
  934 AC_SUBST(ASM_MARK_NOEXEC_STACK)
  935 AC_SUBST(ASM_ALIGN_LOG)
  936 AC_SUBST(W64_ABI)
  937 AC_SUBST(ASM_WORDS_BIGENDIAN)
  938 AC_SUBST(EMULATOR)
  939 AC_SUBST(ASM_X86_ENDBR)
  940 AC_SUBST(ASM_X86_MARK_CET)
  941 AC_SUBST(ASM_X86_MARK_CET_ALIGN)
  942 
  943 AC_SUBST(LIBNETTLE_MAJOR)
  944 AC_SUBST(LIBNETTLE_MINOR)
  945 AC_SUBST(LIBNETTLE_FORLINK)
  946 AC_SUBST(LIBNETTLE_SONAME)
  947 AC_SUBST(LIBNETTLE_FILE)
  948 AC_SUBST(LIBNETTLE_FILE_SRC)
  949 AC_SUBST(LIBNETTLE_LINK)
  950 AC_SUBST(LIBNETTLE_LIBS)
  951 
  952 AC_SUBST(LIBHOGWEED_MAJOR)
  953 AC_SUBST(LIBHOGWEED_MINOR)
  954 AC_SUBST(LIBHOGWEED_FORLINK)
  955 AC_SUBST(LIBHOGWEED_SONAME)
  956 AC_SUBST(LIBHOGWEED_FILE)
  957 AC_SUBST(LIBHOGWEED_FILE_SRC)
  958 AC_SUBST(LIBHOGWEED_LINK)
  959 AC_SUBST(LIBHOGWEED_LIBS)
  960 
  961 AC_PATH_PROG(M4, m4, m4)
  962 
  963 AH_TEMPLATE([WITH_HOGWEED], [Defined if public key features are enabled])
  964 
  965 if test "x$enable_public_key" = xyes ; then
  966   AC_DEFINE(WITH_HOGWEED)
  967   IF_HOGWEED=''
  968 else
  969   IF_HOGWEED='#'
  970 fi
  971 
  972 if test "x$enable_static" = xyes ; then
  973   IF_STATIC=''
  974 else
  975   IF_STATIC='#'
  976 fi
  977 
  978 IF_DLOPEN_TEST='#'
  979 if test "x$enable_shared" = xyes ; then
  980   IF_SHARED=''
  981   IF_NOT_SHARED='#'
  982   if test "x$ac_cv_lib_dl_dlopen" = xyes ; then
  983     IF_DLOPEN_TEST=''
  984   fi
  985 else
  986   IF_SHARED='#'
  987   IF_NOT_SHARED=''
  988 fi
  989 
  990 # Documentation tools
  991 if test "x$enable_documentation" != "xno"; then
  992   AC_PATH_PROG(MAKEINFO, makeinfo, not-found)
  993 
  994   if test "x$MAKEINFO" != "xnot-found"; then
  995     enable_documentation=yes
  996     AC_SUBST(MAKEINFO)
  997   else
  998     if test "x$enable_documentation" == "xauto" ; then
  999       enable_documentation=no
 1000     else
 1001       AC_MSG_ERROR([Cannot find 'makeinfo', required for documentation.])
 1002     fi
 1003   fi
 1004 fi
 1005 
 1006 if test "x$enable_documentation" = "xyes" ; then
 1007   IF_DOCUMENTATION=''
 1008 else
 1009   IF_DOCUMENTATION='#'
 1010 fi
 1011 
 1012 if test "x$enable_mini_gmp" = "xyes" ; then
 1013   IF_MINI_GMP=''
 1014 else
 1015   IF_MINI_GMP='#'
 1016 fi
 1017   
 1018 AC_SUBST(IF_HOGWEED)
 1019 AC_SUBST(IF_STATIC)
 1020 AC_SUBST(IF_SHARED)
 1021 AC_SUBST(IF_NOT_SHARED)
 1022 AC_SUBST(IF_DLOPEN_TEST)
 1023 AC_SUBST(IF_DOCUMENTATION)
 1024 AC_SUBST(IF_DLL)
 1025 AC_SUBST(IF_MINI_GMP)
 1026 
 1027 OPENSSL_LIBFLAGS=''
 1028 
 1029 # Check for openssl's libcrypto (used only for benchmarking)
 1030 if test x$enable_openssl = xyes ; then
 1031   AC_CHECK_LIB(crypto, EVP_CIPHER_CTX_new,
 1032     [OPENSSL_LIBFLAGS='-lcrypto'],
 1033     [enable_openssl=no])
 1034 fi
 1035 
 1036 AH_TEMPLATE([WITH_OPENSSL],
 1037         [Define if you have openssl's libcrypto (used for benchmarking)]) dnl'
 1038 
 1039 if test x$enable_openssl = xyes ; then
 1040   AC_DEFINE(WITH_OPENSSL)
 1041 fi
 1042 
 1043 AC_SUBST(OPENSSL_LIBFLAGS)
 1044 
 1045 AH_BOTTOM(
 1046 [#if defined(__x86_64__) || defined(__arch64__)
 1047 # define HAVE_NATIVE_64_BIT 1
 1048 #else
 1049 /* Needs include of <limits.h> before use. */
 1050 # define HAVE_NATIVE_64_BIT (SIZEOF_LONG * CHAR_BIT >= 64)
 1051 #endif
 1052 ])
 1053 
 1054 # clock_gettime is in librt on *-*-osf5.1 and on glibc, so add -lrt to
 1055 # BENCH_LIBS if needed. On linux (tested on x86_32, 2.6.26),
 1056 # clock_getres reports ns accuracy, while in a quick test on osf
 1057 # clock_getres said only 1 millisecond.
 1058 
 1059 old_LIBS="$LIBS"
 1060 AC_SEARCH_LIBS(clock_gettime, rt, [
 1061   AC_DEFINE([HAVE_CLOCK_GETTIME],1,[Define if clock_gettime is available])])
 1062 BENCH_LIBS="$LIBS"
 1063 LIBS="$old_LIBS"
 1064 
 1065 AC_SUBST(BENCH_LIBS)
 1066 
 1067 # Set these flags *last*, or else the test programs won't compile
 1068 if test x$GCC = xyes ; then
 1069   CFLAGS="$CFLAGS -ggdb3 -Wall -W -Wno-sign-compare \
 1070   -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes \
 1071   -Wpointer-arith -Wbad-function-cast -Wnested-externs"
 1072 
 1073 # Don't enable -Wcast-align as it results in tons of warnings in the
 1074 # DES code. And when using stdio.
 1075 # Don't enable -Waggregate-return, as that causes warnings for glibc
 1076 # inttypes.h.
 1077 fi
 1078 
 1079 AC_CONFIG_FILES([config.make config.m4 Makefile version.h])
 1080 AC_CONFIG_FILES([tools/Makefile testsuite/Makefile examples/Makefile])
 1081 AC_CONFIG_FILES([nettle.pc hogweed.pc libnettle.map libhogweed.map])
 1082 
 1083 AC_OUTPUT
 1084 
 1085 AC_MSG_NOTICE([summary of build options:
 1086 
 1087   Version:           ${PACKAGE_STRING}
 1088   Host type:         ${host}
 1089   ABI:               ${ABI}
 1090   Assembly files:    ${asm_path:-none}
 1091   Install prefix:    ${prefix}
 1092   Library directory: ${libdir}
 1093   Compiler:          ${CC}
 1094   Static libraries:  ${enable_static}
 1095   Shared libraries:  ${enable_shared}
 1096   Public key crypto: ${enable_public_key}
 1097   Using mini-gmp:    ${enable_mini_gmp}
 1098   Documentation:     ${enable_documentation}
 1099 ])