From 0869c13c58986d5a8f45f9d22f2694f41e726bc9 Mon Sep 17 00:00:00 2001 From: "J. Peter Mugaas" Date: Mon, 12 Dec 2016 08:32:01 -0500 Subject: [PATCH] Changes to configure.ac from MSYS2 Pacman project for mingw-w64. This allows you to use Bcrypt for CNG with autotools. --- configure.ac | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ffefa6c51..c35adc129 100644 --- a/configure.ac +++ b/configure.ac @@ -279,7 +279,6 @@ AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/statfs.h sys/statvfs.h AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h]) AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h]) AC_CHECK_HEADERS([windows.h]) -AC_CHECK_HEADERS([Bcrypt.h]) # check windows.h first; the other headers require it. AC_CHECK_HEADERS([wincrypt.h winioctl.h],[],[], [[#ifdef HAVE_WINDOWS_H @@ -386,6 +385,9 @@ if test "x$with_lzo2" != "xno"; then AC_CHECK_LIB(lzo2,lzo1x_decompress_safe) fi +AC_ARG_WITH([cng], + AS_HELP_STRING([--without-cng], [Don't build support of CNG(Crypto Next Generation)])) + AC_ARG_WITH([nettle], AS_HELP_STRING([--without-nettle], [Don't build with crypto support from Nettle])) AC_ARG_WITH([openssl], @@ -820,6 +822,16 @@ case "$host_os" in ;; esac +if test "x$with_cng" != "xno"; then + AC_CHECK_HEADERS([bcrypt.h],[ + LIBS="$LIBS -lbcrypt" + ],[], + [[#ifdef HAVE_WINDOWS_H + # include + #endif + ]]) +fi + if test "x$with_nettle" != "xno"; then AC_CHECK_HEADERS([nettle/md5.h nettle/ripemd160.h nettle/sha.h]) AC_CHECK_HEADERS([nettle/pbkdf2.h nettle/aes.h nettle/hmac.h]) -- 2.47.2