enhanced configure.ac for better ssl detection

This commit is contained in:
hyung-hwan 2014-11-10 09:24:35 +00:00
parent ca04358d50
commit f0fe04fef2
6 changed files with 71 additions and 9 deletions

View File

@ -38,9 +38,13 @@
#if defined(HAVE_SSL) #if defined(HAVE_SSL)
# include <openssl/ssl.h> # include <openssl/ssl.h>
# if defined(HAVE_OPENSSL_ERR_H)
# include <openssl/err.h> # include <openssl/err.h>
# endif
# if defined(HAVE_OPENSSL_ENGINE_H)
# include <openssl/engine.h> # include <openssl/engine.h>
# endif # endif
#endif
#if defined(HAVE_SYS_PRCTL_H) #if defined(HAVE_SYS_PRCTL_H)
# include <sys/prctl.h> # include <sys/prctl.h>
@ -2794,11 +2798,15 @@ int qse_main (int argc, qse_achar_t* argv[])
#if defined(HAVE_SSL) #if defined(HAVE_SSL)
/* ERR_remove_state() should be called for each thread if the application is thread */ /* ERR_remove_state() should be called for each thread if the application is thread */
ERR_remove_state (0); ERR_remove_state (0);
#if defined(HAVE_ENGINE_CLEANUP)
ENGINE_cleanup (); ENGINE_cleanup ();
#endif
ERR_free_strings (); ERR_free_strings ();
EVP_cleanup (); EVP_cleanup ();
#if defined(HAVE_CRYPTO_CLEANUP_ALL_EX_DATA)
CRYPTO_cleanup_all_ex_data (); CRYPTO_cleanup_all_ex_data ();
#endif #endif
#endif
#if defined(_WIN32) #if defined(_WIN32)
WSACleanup (); WSACleanup ();

35
qse/configure vendored
View File

@ -18117,8 +18117,22 @@ else
enable_ssl_is=yes enable_ssl_is=yes
fi fi
if test "$enable_ssl_is" = "yes" if test "x$enable_ssl_is" = "xyes"
then then
for ac_header in openssl/err.h openssl/engine.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
for ac_func in SSL_library_init for ac_func in SSL_library_init
do : do :
ac_fn_c_check_func "$LINENO" "SSL_library_init" "ac_cv_func_SSL_library_init" ac_fn_c_check_func "$LINENO" "SSL_library_init" "ac_cv_func_SSL_library_init"
@ -18130,7 +18144,8 @@ _ACEOF
fi fi
done done
if test "$ac_cv_func_SSL_library_init" = "yes"
if test "x$ac_cv_func_SSL_library_init" = "xyes"
then then
$as_echo "#define HAVE_SSL 1" >>confdefs.h $as_echo "#define HAVE_SSL 1" >>confdefs.h
@ -18228,6 +18243,22 @@ fi
fi fi
fi fi
OLDLIBS="$LIBS"
LIBS="$SSL_LIBS $LIBS"
for ac_func in ENGINE_cleanup CRYPTO_cleanup_all_ex_data
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
LIBS="$OLDLIBS"
fi fi

View File

@ -247,11 +247,14 @@ AC_SUBST(UNICOWS_LIBS)
AC_ARG_ENABLE([ssl], [AS_HELP_STRING([--enable-ssl],[build the library in the ssl mode (default. yes)])], AC_ARG_ENABLE([ssl], [AS_HELP_STRING([--enable-ssl],[build the library in the ssl mode (default. yes)])],
enable_ssl_is=$enableval,enable_ssl_is=yes) enable_ssl_is=$enableval,enable_ssl_is=yes)
if test "$enable_ssl_is" = "yes" if test "x$enable_ssl_is" = "xyes"
then then
AC_CHECK_HEADERS([openssl/err.h openssl/engine.h])
dnl check for an SSL library dnl check for an SSL library
AC_CHECK_FUNCS([SSL_library_init]) AC_CHECK_FUNCS([SSL_library_init])
if test "$ac_cv_func_SSL_library_init" = "yes"
if test "x$ac_cv_func_SSL_library_init" = "xyes"
then then
AC_DEFINE(HAVE_SSL, 1, [ssl support]) AC_DEFINE(HAVE_SSL, 1, [ssl support])
else else
@ -268,6 +271,11 @@ then
AC_DEFINE(HAVE_SSL_LIBRARY_INIT, 1) AC_DEFINE(HAVE_SSL_LIBRARY_INIT, 1)
]) ])
fi fi
OLDLIBS="$LIBS"
LIBS="$SSL_LIBS $LIBS"
AC_CHECK_FUNCS([ENGINE_cleanup CRYPTO_cleanup_all_ex_data])
LIBS="$OLDLIBS"
fi fi
AC_SUBST(SSL_LIBS) AC_SUBST(SSL_LIBS)

View File

@ -126,6 +126,9 @@
/* Define to 1 if you have the <crt_externs.h> header file. */ /* Define to 1 if you have the <crt_externs.h> header file. */
#undef HAVE_CRT_EXTERNS_H #undef HAVE_CRT_EXTERNS_H
/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
#undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA
/* Define if c++ supports namespace std. */ /* Define if c++ supports namespace std. */
#undef HAVE_CXX_NAMESPACE_STD #undef HAVE_CXX_NAMESPACE_STD
@ -164,6 +167,9 @@
/* Define if you have the _dyld_func_lookup function. */ /* Define if you have the _dyld_func_lookup function. */
#undef HAVE_DYLD #undef HAVE_DYLD
/* Define to 1 if you have the `ENGINE_cleanup' function. */
#undef HAVE_ENGINE_CLEANUP
/* epoll support */ /* epoll support */
#undef HAVE_EPOLL #undef HAVE_EPOLL
@ -371,6 +377,12 @@
/* Define to 1 if you have the `opendir' function. */ /* Define to 1 if you have the `opendir' function. */
#undef HAVE_OPENDIR #undef HAVE_OPENDIR
/* Define to 1 if you have the <openssl/engine.h> header file. */
#undef HAVE_OPENSSL_ENGINE_H
/* Define to 1 if you have the <openssl/err.h> header file. */
#undef HAVE_OPENSSL_ERR_H
/* Define to 1 if you have the `posix_spawn' function. */ /* Define to 1 if you have the `posix_spawn' function. */
#undef HAVE_POSIX_SPAWN #undef HAVE_POSIX_SPAWN

View File

@ -37,7 +37,6 @@ QSE_EXPORT void* qse_awk_stdmodopen (qse_awk_t* awk, const qse_awk_mod_spec_t* s
QSE_EXPORT void qse_awk_stdmodclose (qse_awk_t* awk, void* handle); QSE_EXPORT void qse_awk_stdmodclose (qse_awk_t* awk, void* handle);
QSE_EXPORT void* qse_awk_stdmodsym (qse_awk_t* awk, void* handle, const qse_char_t* name); QSE_EXPORT void* qse_awk_stdmodsym (qse_awk_t* awk, void* handle, const qse_char_t* name);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -124,9 +124,13 @@
#if defined(HAVE_SSL) #if defined(HAVE_SSL)
# include <openssl/ssl.h> # include <openssl/ssl.h>
# if defined(HAVE_OPENSSL_ERR_H)
# include <openssl/err.h> # include <openssl/err.h>
# endif
# if defined(HAVE_OPENSSL_ENGINE_H)
# include <openssl/engine.h> # include <openssl/engine.h>
# endif # endif
#endif
#if defined(__linux) && !defined(SO_REUSEPORT) #if defined(__linux) && !defined(SO_REUSEPORT)
# define SO_REUSEPORT 15 # define SO_REUSEPORT 15