diff --git a/ChangeLog b/ChangeLog index f6d89576b..11c78ab5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2001-02-27 Adam Fedor + + * configure.in: Fix openssl config so it defines HAVE_OPENSSL only + if all headers and libs available. + * configure, acconfig.h, Headers/gnustep/base/config.h.in: Regen. + * Source/UnixFileHandle.m: Use HAVE_OPENSSL. + 2001-02-27 Nicola Pero * Source/NSLock.m: Commented out extra token after #endif diff --git a/Headers/gnustep/base/config.h.in b/Headers/gnustep/base/config.h.in index 6b19a9781..5bc73cc01 100644 --- a/Headers/gnustep/base/config.h.in +++ b/Headers/gnustep/base/config.h.in @@ -57,6 +57,9 @@ /* Define if libxml available */ #undef HAVE_LIBXML +/* Define if openssl available */ +#undef HAVE_OPENSSL + #undef HAVE_PTS_STREAM_MODULES #undef HAVE_UINTMAX_T diff --git a/Source/UnixFileHandle.m b/Source/UnixFileHandle.m index b5066bd07..c568edf17 100644 --- a/Source/UnixFileHandle.m +++ b/Source/UnixFileHandle.m @@ -23,7 +23,7 @@ #include -#if HAVE_OPENSSL_SSL_H +#if HAVE_OPENSSL #include #endif #include @@ -1418,7 +1418,7 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) -#if HAVE_OPENSSL_SSL_H +#if HAVE_OPENSSL @interface GSUnixSSLHandle : UnixFileHandle { SSL_CTX *ctx; @@ -1958,5 +1958,5 @@ getAddr(NSString* name, NSString* svc, NSString* pcl, struct sockaddr_in *sin) NSLog(@"SSL method called on system built without OpenSSL"); } @end -#endif /* HAVE_OPENSSL_SSL_H */ +#endif /* HAVE_OPENSSL */ diff --git a/acconfig.h b/acconfig.h index 3e974cea7..b2c7446e4 100644 --- a/acconfig.h +++ b/acconfig.h @@ -148,6 +148,9 @@ /* Define if libxml available */ #undef HAVE_LIBXML +/* Define if openssl available */ +#undef HAVE_OPENSSL + #undef HAVE_PTS_STREAM_MODULES #undef HAVE_UINTMAX_T diff --git a/configure b/configure index 7595851b8..dcaf68fd9 100755 --- a/configure +++ b/configure @@ -2410,7 +2410,7 @@ for ac_kw in inline __inline__ __inline; do #include "confdefs.h" int main() { -} int $ac_kw foo() { +} $ac_kw foo() { ; return 0; } EOF if { (eval echo configure:2417: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then @@ -4786,9 +4786,10 @@ if test $ac_cv_header_openssl_ssl_h = no; then echo "Could not find openssl headers" echo "Check to make sure you have a recent version of openssl installed" echo "configure: warning: Could not find openssl headers" 1>&2 + ssl_ok=no else echo $ac_n "checking for CRYPTO_malloc in -lcrypto""... $ac_c" 1>&6 -echo "configure:4792: checking for CRYPTO_malloc in -lcrypto" >&5 +echo "configure:4793: checking for CRYPTO_malloc in -lcrypto" >&5 ac_lib_var=`echo crypto'_'CRYPTO_malloc | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4796,7 +4797,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4832,7 +4833,7 @@ fi base_libs="$LIBS" LIBS="$LIBS -lcrypto" echo $ac_n "checking for ssl2_clear in -lssl""... $ac_c" 1>&6 -echo "configure:4836: checking for ssl2_clear in -lssl" >&5 +echo "configure:4837: checking for ssl2_clear in -lssl" >&5 ac_lib_var=`echo ssl'_'ssl2_clear | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4840,7 +4841,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lssl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4875,15 +4876,15 @@ fi if test "$ssl_ok" = yes; then LIBS="$base_libs -lssl -lcrypto" + cat >> confdefs.h <<\EOF +#define HAVE_OPENSSL 1 +EOF + fi fi fi -if test "$HAVE_LIBSSL" = "0"; then - CPPFLAGS="$cppflags_temp"; - LIBS="$libs_temp"; -fi -if test "$HAVE_LIBCRYPTO" = "0"; then +if test "$ssl_ok" = "no"; then CPPFLAGS="$cppflags_temp"; LIBS="$libs_temp"; fi @@ -4925,17 +4926,17 @@ for ac_hdr in gmp.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4929: checking for $ac_hdr" >&5 +echo "configure:4930: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4939: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4967,7 +4968,7 @@ if test $ac_cv_header_gmp_h = no; then echo "configure: warning: Could not find gmp headers" 1>&2 else echo $ac_n "checking for mpf_abs in -lgmp""... $ac_c" 1>&6 -echo "configure:4971: checking for mpf_abs in -lgmp" >&5 +echo "configure:4972: checking for mpf_abs in -lgmp" >&5 ac_lib_var=`echo gmp'_'mpf_abs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4975,7 +4976,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5009,7 +5010,7 @@ fi if test "$gmp_ok" = no; then echo $ac_n "checking for __gmpf_abs in -lgmp""... $ac_c" 1>&6 -echo "configure:5013: checking for __gmpf_abs in -lgmp" >&5 +echo "configure:5014: checking for __gmpf_abs in -lgmp" >&5 ac_lib_var=`echo gmp'_'__gmpf_abs | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5017,7 +5018,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgmp $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5075,12 +5076,12 @@ fi for ac_func in iconv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5079: checking for $ac_func" >&5 +echo "configure:5080: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -5144,7 +5145,7 @@ fi fi echo $ac_n "checking for main in -liconv""... $ac_c" 1>&6 -echo "configure:5148: checking for main in -liconv" >&5 +echo "configure:5149: checking for main in -liconv" >&5 ac_lib_var=`echo iconv'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5152,14 +5153,14 @@ else ac_save_LIBS="$LIBS" LIBS="-liconv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else diff --git a/configure.in b/configure.in index 259950494..3856370af 100644 --- a/configure.in +++ b/configure.in @@ -849,6 +849,7 @@ if test $ac_cv_header_openssl_ssl_h = no; then echo "Could not find openssl headers" echo "Check to make sure you have a recent version of openssl installed" AC_MSG_WARN(Could not find openssl headers) + ssl_ok=no else AC_CHECK_LIB(crypto, CRYPTO_malloc, ssl_ok=yes, ssl_ok=no) if test "$ssl_ok" = yes; then @@ -858,15 +859,12 @@ else if test "$ssl_ok" = yes; then LIBS="$base_libs -lssl -lcrypto" AC_SUBST(LIBS) + AC_DEFINE(HAVE_OPENSSL) fi fi fi -if test "$HAVE_LIBSSL" = "0"; then - CPPFLAGS="$cppflags_temp"; - LIBS="$libs_temp"; -fi -if test "$HAVE_LIBCRYPTO" = "0"; then +if test "$ssl_ok" = "no"; then CPPFLAGS="$cppflags_temp"; LIBS="$libs_temp"; fi