Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 74e2916

Browse files
committed
Allow MinGW builds to use standardly-named OpenSSL libraries.
In the Fedora variant of MinGW, the openssl libraries have their normal names, not libeay32 and libssleay32. Adjust configure probes to allow that, per bug #6486. Tomasz Ostrowski
1 parent c9d7004 commit 74e2916

File tree

4 files changed

+68
-56
lines changed

4 files changed

+68
-56
lines changed

configure

Lines changed: 66 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -9192,14 +9192,12 @@ $as_echo "$as_me: error: library 'ssl' is required for OpenSSL" >&2;}
91929192
fi
91939193

91949194
else
9195-
9196-
{ $as_echo "$as_me:$LINENO: checking for CRYPTO_new_ex_data in -leay32" >&5
9197-
$as_echo_n "checking for CRYPTO_new_ex_data in -leay32... " >&6; }
9198-
if test "${ac_cv_lib_eay32_CRYPTO_new_ex_data+set}" = set; then
9195+
{ $as_echo "$as_me:$LINENO: checking for library containing CRYPTO_new_ex_data" >&5
9196+
$as_echo_n "checking for library containing CRYPTO_new_ex_data... " >&6; }
9197+
if test "${ac_cv_search_CRYPTO_new_ex_data+set}" = set; then
91999198
$as_echo_n "(cached) " >&6
92009199
else
9201-
ac_check_lib_save_LIBS=$LIBS
9202-
LIBS="-leay32 $LIBS"
9200+
ac_func_search_save_LIBS=$LIBS
92039201
cat >conftest.$ac_ext <<_ACEOF
92049202
/* confdefs.h. */
92059203
_ACEOF
@@ -9222,7 +9220,14 @@ return CRYPTO_new_ex_data ();
92229220
return 0;
92239221
}
92249222
_ACEOF
9225-
rm -f conftest.$ac_objext conftest$ac_exeext
9223+
for ac_lib in '' eay32 crypto; do
9224+
if test -z "$ac_lib"; then
9225+
ac_res="none required"
9226+
else
9227+
ac_res=-l$ac_lib
9228+
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
9229+
fi
9230+
rm -f conftest.$ac_objext conftest$ac_exeext
92269231
if { (ac_try="$ac_link"
92279232
case "(($ac_try" in
92289233
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -9243,42 +9248,47 @@ $as_echo "$ac_try_echo") >&5
92439248
test "$cross_compiling" = yes ||
92449249
$as_test_x conftest$ac_exeext
92459250
}; then
9246-
ac_cv_lib_eay32_CRYPTO_new_ex_data=yes
9251+
ac_cv_search_CRYPTO_new_ex_data=$ac_res
92479252
else
92489253
$as_echo "$as_me: failed program was:" >&5
92499254
sed 's/^/| /' conftest.$ac_ext >&5
92509255

9251-
ac_cv_lib_eay32_CRYPTO_new_ex_data=no
9256+
92529257
fi
92539258

92549259
rm -rf conftest.dSYM
92559260
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9256-
conftest$ac_exeext conftest.$ac_ext
9257-
LIBS=$ac_check_lib_save_LIBS
9261+
conftest$ac_exeext
9262+
if test "${ac_cv_search_CRYPTO_new_ex_data+set}" = set; then
9263+
break
92589264
fi
9259-
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_eay32_CRYPTO_new_ex_data" >&5
9260-
$as_echo "$ac_cv_lib_eay32_CRYPTO_new_ex_data" >&6; }
9261-
if test "x$ac_cv_lib_eay32_CRYPTO_new_ex_data" = x""yes; then
9262-
cat >>confdefs.h <<_ACEOF
9263-
#define HAVE_LIBEAY32 1
9264-
_ACEOF
9265-
9266-
LIBS="-leay32 $LIBS"
9265+
done
9266+
if test "${ac_cv_search_CRYPTO_new_ex_data+set}" = set; then
9267+
:
9268+
else
9269+
ac_cv_search_CRYPTO_new_ex_data=no
9270+
fi
9271+
rm conftest.$ac_ext
9272+
LIBS=$ac_func_search_save_LIBS
9273+
fi
9274+
{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_CRYPTO_new_ex_data" >&5
9275+
$as_echo "$ac_cv_search_CRYPTO_new_ex_data" >&6; }
9276+
ac_res=$ac_cv_search_CRYPTO_new_ex_data
9277+
if test "$ac_res" != no; then
9278+
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
92679279

92689280
else
9269-
{ { $as_echo "$as_me:$LINENO: error: library 'eay32' is required for OpenSSL" >&5
9270-
$as_echo "$as_me: error: library 'eay32' is required for OpenSSL" >&2;}
9281+
{ { $as_echo "$as_me:$LINENO: error: library 'eay32' or 'crypto' is required for OpenSSL" >&5
9282+
$as_echo "$as_me: error: library 'eay32' or 'crypto' is required for OpenSSL" >&2;}
92719283
{ (exit 1); exit 1; }; }
92729284
fi
92739285

9274-
9275-
{ $as_echo "$as_me:$LINENO: checking for SSL_library_init in -lssleay32" >&5
9276-
$as_echo_n "checking for SSL_library_init in -lssleay32... " >&6; }
9277-
if test "${ac_cv_lib_ssleay32_SSL_library_init+set}" = set; then
9286+
{ $as_echo "$as_me:$LINENO: checking for library containing SSL_library_init" >&5
9287+
$as_echo_n "checking for library containing SSL_library_init... " >&6; }
9288+
if test "${ac_cv_search_SSL_library_init+set}" = set; then
92789289
$as_echo_n "(cached) " >&6
92799290
else
9280-
ac_check_lib_save_LIBS=$LIBS
9281-
LIBS="-lssleay32 $LIBS"
9291+
ac_func_search_save_LIBS=$LIBS
92829292
cat >conftest.$ac_ext <<_ACEOF
92839293
/* confdefs.h. */
92849294
_ACEOF
@@ -9301,7 +9311,14 @@ return SSL_library_init ();
93019311
return 0;
93029312
}
93039313
_ACEOF
9304-
rm -f conftest.$ac_objext conftest$ac_exeext
9314+
for ac_lib in '' ssleay32 ssl; do
9315+
if test -z "$ac_lib"; then
9316+
ac_res="none required"
9317+
else
9318+
ac_res=-l$ac_lib
9319+
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
9320+
fi
9321+
rm -f conftest.$ac_objext conftest$ac_exeext
93059322
if { (ac_try="$ac_link"
93069323
case "(($ac_try" in
93079324
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -9322,31 +9339,38 @@ $as_echo "$ac_try_echo") >&5
93229339
test "$cross_compiling" = yes ||
93239340
$as_test_x conftest$ac_exeext
93249341
}; then
9325-
ac_cv_lib_ssleay32_SSL_library_init=yes
9342+
ac_cv_search_SSL_library_init=$ac_res
93269343
else
93279344
$as_echo "$as_me: failed program was:" >&5
93289345
sed 's/^/| /' conftest.$ac_ext >&5
93299346

9330-
ac_cv_lib_ssleay32_SSL_library_init=no
9347+
93319348
fi
93329349

93339350
rm -rf conftest.dSYM
93349351
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9335-
conftest$ac_exeext conftest.$ac_ext
9336-
LIBS=$ac_check_lib_save_LIBS
9352+
conftest$ac_exeext
9353+
if test "${ac_cv_search_SSL_library_init+set}" = set; then
9354+
break
93379355
fi
9338-
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ssleay32_SSL_library_init" >&5
9339-
$as_echo "$ac_cv_lib_ssleay32_SSL_library_init" >&6; }
9340-
if test "x$ac_cv_lib_ssleay32_SSL_library_init" = x""yes; then
9341-
cat >>confdefs.h <<_ACEOF
9342-
#define HAVE_LIBSSLEAY32 1
9343-
_ACEOF
9344-
9345-
LIBS="-lssleay32 $LIBS"
9356+
done
9357+
if test "${ac_cv_search_SSL_library_init+set}" = set; then
9358+
:
9359+
else
9360+
ac_cv_search_SSL_library_init=no
9361+
fi
9362+
rm conftest.$ac_ext
9363+
LIBS=$ac_func_search_save_LIBS
9364+
fi
9365+
{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_SSL_library_init" >&5
9366+
$as_echo "$ac_cv_search_SSL_library_init" >&6; }
9367+
ac_res=$ac_cv_search_SSL_library_init
9368+
if test "$ac_res" != no; then
9369+
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
93469370

93479371
else
9348-
{ { $as_echo "$as_me:$LINENO: error: library 'ssleay32' is required for OpenSSL" >&5
9349-
$as_echo "$as_me: error: library 'ssleay32' is required for OpenSSL" >&2;}
9372+
{ { $as_echo "$as_me:$LINENO: error: library 'ssleay32' or 'ssl' is required for OpenSSL" >&5
9373+
$as_echo "$as_me: error: library 'ssleay32' or 'ssl' is required for OpenSSL" >&2;}
93509374
{ (exit 1); exit 1; }; }
93519375
fi
93529376

configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,8 @@ if test "$with_openssl" = yes ; then
948948
AC_CHECK_LIB(crypto, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'crypto' is required for OpenSSL])])
949949
AC_CHECK_LIB(ssl, SSL_library_init, [], [AC_MSG_ERROR([library 'ssl' is required for OpenSSL])])
950950
else
951-
AC_CHECK_LIB(eay32, CRYPTO_new_ex_data, [], [AC_MSG_ERROR([library 'eay32' is required for OpenSSL])])
952-
AC_CHECK_LIB(ssleay32, SSL_library_init, [], [AC_MSG_ERROR([library 'ssleay32' is required for OpenSSL])])
951+
AC_SEARCH_LIBS(CRYPTO_new_ex_data, eay32 crypto, [], [AC_MSG_ERROR([library 'eay32' or 'crypto' is required for OpenSSL])])
952+
AC_SEARCH_LIBS(SSL_library_init, ssleay32 ssl, [], [AC_MSG_ERROR([library 'ssleay32' or 'ssl' is required for OpenSSL])])
953953
fi
954954
fi
955955

src/include/pg_config.h.in

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,6 @@
299299
/* Define to 1 if you have the `crypto' library (-lcrypto). */
300300
#undef HAVE_LIBCRYPTO
301301

302-
/* Define to 1 if you have the `eay32' library (-leay32). */
303-
#undef HAVE_LIBEAY32
304-
305302
/* Define to 1 if you have the `ldap' library (-lldap). */
306303
#undef HAVE_LIBLDAP
307304

@@ -323,9 +320,6 @@
323320
/* Define to 1 if you have the `ssl' library (-lssl). */
324321
#undef HAVE_LIBSSL
325322

326-
/* Define to 1 if you have the `ssleay32' library (-lssleay32). */
327-
#undef HAVE_LIBSSLEAY32
328-
329323
/* Define to 1 if you have the `wldap32' library (-lwldap32). */
330324
#undef HAVE_LIBWLDAP32
331325

src/include/pg_config.h.win32

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,6 @@
220220
/* Define to 1 if you have the `crypto' library (-lcrypto). */
221221
/* #undef HAVE_LIBCRYPTO */
222222

223-
/* Define to 1 if you have the `eay32' library (-leay32). */
224-
/* #undef HAVE_LIBEAY32 */
225-
226223
/* Define to 1 if you have the `ldap' library (-lldap). */
227224
/* #undef HAVE_LIBLDAP */
228225

@@ -235,9 +232,6 @@
235232
/* Define to 1 if you have the `ssl' library (-lssl). */
236233
/* #undef HAVE_LIBSSL */
237234

238-
/* Define to 1 if you have the `ssleay32' library (-lssleay32). */
239-
/* #undef HAVE_LIBSSLEAY32 */
240-
241235
/* Define to 1 if you have the `wldap32' library (-lwldap32). */
242236
/* #undef HAVE_LIBWLDAP32 */
243237

0 commit comments

Comments
 (0)