diff options
| author | Bruce Momjian | 2004-10-06 09:35:23 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2004-10-06 09:35:23 +0000 |
| commit | 902ca3e2255411d709a1ffa28dea9eda92425f77 (patch) | |
| tree | d802e6b82f526711585211694850cfa38eaa0297 /configure | |
| parent | 5431393274dd9349490d56d9594782365ca8ddfc (diff) | |
Here is a patch to fix win32 ssl builds. Summary of changes:
* Links with -leay32 and -lssleay32 instead of crypto and ssl. On win32,
"crypto and ssl" is only used for static linking.
* Initializes SSL in the backend and not just in the postmaster. We
cannot pass the SSL context from the postmaster through the parameter
file, because it contains function pointers.
* Split one error check in be-secure.c. Previously we could not tell
which of three calls actually failed. The previous code also returned
incorrect error messages if SSL_accept() failed - that function needs to
use SSL_get_error() on the return value, can't just use the error queue.
* Since the win32 implementation uses non-blocking sockets "behind the
scenes" in order to deliver signals correctly, implements a version of
SSL_accept() that can handle this. Also, add a wait function in case
SSL_read or SSL_write() needs more data.
Magnus Hagander
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 141 |
1 files changed, 141 insertions, 0 deletions
diff --git a/configure b/configure index f82192ae567..59327b959d2 100755 --- a/configure +++ b/configure @@ -6558,6 +6558,7 @@ fi fi if test "$with_openssl" = yes ; then + if test "$PORTNAME" != "win32"; then echo "$as_me:$LINENO: checking for CRYPTO_new_ex_data in -lcrypto" >&5 echo $ECHO_N "checking for CRYPTO_new_ex_data in -lcrypto... $ECHO_C" >&6 @@ -6696,6 +6697,146 @@ echo "$as_me: error: library 'ssl' is required for OpenSSL" >&2;} { (exit 1); exit 1; }; } fi + else + +echo "$as_me:$LINENO: checking for CRYPTO_new_ex_data in -leay32" >&5 +echo $ECHO_N "checking for CRYPTO_new_ex_data in -leay32... $ECHO_C" >&6 +if test "${ac_cv_lib_eay32_CRYPTO_new_ex_data+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-leay32 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char CRYPTO_new_ex_data (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +CRYPTO_new_ex_data (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_eay32_CRYPTO_new_ex_data=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_eay32_CRYPTO_new_ex_data=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_eay32_CRYPTO_new_ex_data" >&5 +echo "${ECHO_T}$ac_cv_lib_eay32_CRYPTO_new_ex_data" >&6 +if test $ac_cv_lib_eay32_CRYPTO_new_ex_data = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBEAY32 1 +_ACEOF + + LIBS="-leay32 $LIBS" + +else + { { echo "$as_me:$LINENO: error: library 'eay32' is required for OpenSSL" >&5 +echo "$as_me: error: library 'eay32' is required for OpenSSL" >&2;} + { (exit 1); exit 1; }; } +fi + + +echo "$as_me:$LINENO: checking for SSL_library_init in -lssleay32" >&5 +echo $ECHO_N "checking for SSL_library_init in -lssleay32... $ECHO_C" >&6 +if test "${ac_cv_lib_ssleay32_SSL_library_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lssleay32 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char SSL_library_init (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +SSL_library_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ssleay32_SSL_library_init=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_ssleay32_SSL_library_init=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ssleay32_SSL_library_init" >&5 +echo "${ECHO_T}$ac_cv_lib_ssleay32_SSL_library_init" >&6 +if test $ac_cv_lib_ssleay32_SSL_library_init = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSSLEAY32 1 +_ACEOF + + LIBS="-lssleay32 $LIBS" + +else + { { echo "$as_me:$LINENO: error: library 'ssleay32' is required for OpenSSL" >&5 +echo "$as_me: error: library 'ssleay32' is required for OpenSSL" >&2;} + { (exit 1); exit 1; }; } +fi + + fi fi if test "$with_pam" = yes ; then |
