Fix openssl

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9248 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2001-02-28 03:59:05 +00:00
parent 93d110285c
commit f2d3965304
6 changed files with 47 additions and 35 deletions

View file

@ -1,3 +1,10 @@
2001-02-27 Adam Fedor <fedor@gnu.org>
* 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 <nicola@brainstorm.co.uk>
* Source/NSLock.m: Commented out extra token after #endif

View file

@ -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

View file

@ -23,7 +23,7 @@
#include <config.h>
#if HAVE_OPENSSL_SSL_H
#if HAVE_OPENSSL
#include <openssl/ssl.h>
#endif
#include <base/preface.h>
@ -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 <GCFinalization>
{
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 */

View file

@ -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

55
configure vendored
View file

@ -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 <<EOF
#line 4800 "configure"
#line 4801 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -4807,7 +4808,7 @@ int main() {
CRYPTO_malloc()
; return 0; }
EOF
if { (eval echo configure:4811: \"$ac_link\") 1>&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 <<EOF
#line 4844 "configure"
#line 4845 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -4851,7 +4852,7 @@ int main() {
ssl2_clear()
; return 0; }
EOF
if { (eval echo configure:4855: \"$ac_link\") 1>&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
#line 4934 "configure"
#line 4935 "configure"
#include "confdefs.h"
#include <$ac_hdr>
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 <<EOF
#line 4979 "configure"
#line 4980 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -4986,7 +4987,7 @@ int main() {
mpf_abs()
; return 0; }
EOF
if { (eval echo configure:4990: \"$ac_link\") 1>&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 <<EOF
#line 5021 "configure"
#line 5022 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -5028,7 +5029,7 @@ int main() {
__gmpf_abs()
; return 0; }
EOF
if { (eval echo configure:5032: \"$ac_link\") 1>&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 <<EOF
#line 5084 "configure"
#line 5085 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -5103,7 +5104,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:5107: \"$ac_link\") 1>&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 <<EOF
#line 5156 "configure"
#line 5157 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
if { (eval echo configure:5163: \"$ac_link\") 1>&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

View file

@ -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