mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
0374b55942
Since commit 506df426dbeb0187bbd3654bd286b4100628fb16, OPENSSL_INCS is added to CPPFLAGS without any white space, as a result openssl detection fails on: configure:10395: checking openssl/ssl.h usability configure:10395: /home/fabrice/buildroot-test/buildroot/output/host/bin/riscv32-linux-gcc -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -Wall -fno-strict-aliasing -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64-I/home/fabrice/buildroot-test/buildroot/output/host/bin/../riscv32-buildroot-linux-gnu/sysroot/usr/include conftest.c >&5 <command-line>:0:0: warning: "_FILE_OFFSET_BITS" redefined <command-line>:0:0: note: this is the location of the previous definition <command-line>:0:23: error: division by zero in #if Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
57 lines
1.4 KiB
Plaintext
57 lines
1.4 KiB
Plaintext
dnl ######################################################################
|
|
dnl OpenSSL support
|
|
AC_DEFUN([LIBEVENT_OPENSSL], [
|
|
AC_REQUIRE([NTP_PKG_CONFIG])dnl
|
|
|
|
case "$enable_openssl" in
|
|
yes)
|
|
have_openssl=no
|
|
case "$PKG_CONFIG" in
|
|
'')
|
|
;;
|
|
*)
|
|
OPENSSL_LIBS=`$PKG_CONFIG --libs openssl 2>/dev/null`
|
|
case "$OPENSSL_LIBS" in
|
|
'') ;;
|
|
*) OPENSSL_LIBS="$OPENSSL_LIBS $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"
|
|
have_openssl=yes
|
|
;;
|
|
esac
|
|
OPENSSL_INCS=`$PKG_CONFIG --cflags openssl 2>/dev/null`
|
|
;;
|
|
esac
|
|
case "$have_openssl" in
|
|
yes) ;;
|
|
*)
|
|
save_LIBS="$LIBS"
|
|
LIBS=""
|
|
OPENSSL_LIBS=""
|
|
for lib in crypto eay32; do
|
|
# clear cache
|
|
unset ac_cv_search_SSL_new
|
|
AC_SEARCH_LIBS([SSL_new], [ssl ssl32],
|
|
[have_openssl=yes
|
|
OPENSSL_LIBS="$LIBS -l$lib $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD"],
|
|
[have_openssl=no],
|
|
[-l$lib $EV_LIB_GDI $EV_LIB_WS32 $OPENSSL_LIBADD])
|
|
LIBS="$save_LIBS"
|
|
test "$have_openssl" = "yes" && break
|
|
done
|
|
;;
|
|
esac
|
|
CPPFLAGS_SAVE=$CPPFLAGS
|
|
CPPFLAGS="$CPPFLAGS $OPENSSL_INCS"
|
|
AC_CHECK_HEADERS([openssl/ssl.h], [], [have_openssl=no])
|
|
CPPFLAGS=$CPPFLAGS_SAVE
|
|
AC_SUBST(OPENSSL_INCS)
|
|
AC_SUBST(OPENSSL_LIBS)
|
|
case "$have_openssl" in
|
|
yes) AC_DEFINE(HAVE_OPENSSL, 1, [Define if the system has openssl]) ;;
|
|
esac
|
|
;;
|
|
esac
|
|
|
|
# check if we have and should use openssl
|
|
AM_CONDITIONAL(OPENSSL, [test "$enable_openssl" != "no" && test "$have_openssl" = "yes"])
|
|
])
|