From 168faebb0562886f985adf04648f7ccfbfe6cd7f Mon Sep 17 00:00:00 2001 From: fedor Date: Tue, 26 Dec 2000 23:03:42 +0000 Subject: [PATCH] Fixes for libxml2 (FreeBSD). git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8447 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++ Documentation/todo.texi | 7 +-- Headers/gnustep/base/GSXML.h | 5 ++ Headers/gnustep/base/config.h.in | 10 ++-- Source/GSXML.m | 9 +++ Tools/gsdoc.m | 6 ++ acconfig.h | 3 + configure | 98 +++++++++++++++++--------------- configure.in | 18 +++++- 9 files changed, 106 insertions(+), 59 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d42e34d3..b3c7d4eca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2000-12-26 Adam Fedor + + * configure.in: Look for libxml2 (patch from Kim Shrier + ). + * Headers/gnustep/base/config.h.in: Define LIBXML2 + * Headers/gnustep/base/GSXML.h: Include libxml2.h if found. + * Source/GSXML.m: Likewise. + * Tools/gsdoc.m: Likewise. (patches from Kim Shrier ). + 2000-12-22 Adam Fedor * Source/GSFFCallInvocation.m: Remove powerpc specific defs diff --git a/Documentation/todo.texi b/Documentation/todo.texi index ded942cb4..339756df9 100644 --- a/Documentation/todo.texi +++ b/Documentation/todo.texi @@ -15,11 +15,6 @@ If you encounter a problem with NSZones, switch to using the default zone instead of creating one. Or better yet, fix the problem and submit a patch. -@item Invocations (and by extension, Distributed Objects) have been well tested only -on ix86 platforms. In particular, there are still minor problems on PPC and Sparc -platforms. - -@item Distributed Objects is now thread safe, but it hasn't been well -tested. +@item Distributed Objects is now thread safe, but it hasn't been well tested. @end itemize diff --git a/Headers/gnustep/base/GSXML.h b/Headers/gnustep/base/GSXML.h index 3030c729f..708e7dc38 100644 --- a/Headers/gnustep/base/GSXML.h +++ b/Headers/gnustep/base/GSXML.h @@ -31,8 +31,13 @@ #ifndef __GSXML_H__ #define __GSXML_H__ +#ifdef LIBXML2 +#include +#include +#else #include #include +#endif #include #include diff --git a/Headers/gnustep/base/config.h.in b/Headers/gnustep/base/config.h.in index f8b96fdab..b2e213fb4 100644 --- a/Headers/gnustep/base/config.h.in +++ b/Headers/gnustep/base/config.h.in @@ -54,6 +54,9 @@ /* Define if using the ffcall library for invocations */ #undef USE_FFCALL +/* Define if the libxml header files are in libxml2 */ +#undef LIBXML2 + /* The number of bytes in a double. */ #undef SIZEOF_DOUBLE @@ -141,8 +144,8 @@ /* Define if you have the vsprintf function. */ #undef HAVE_VSPRINTF -/* Define if you have the header file. */ -#undef HAVE_CALLBACK +/* Define if you have the header file. */ +#undef HAVE_CALLBACK_H /* Define if you have the header file. */ #undef HAVE_DIRENT_H @@ -159,9 +162,6 @@ /* Define if you have the header file. */ #undef HAVE_LANGINFO_H -/* Define if you have the header file. */ -#undef HAVE_LIBXML_XMLVERSION_H - /* Define if you have the header file. */ #undef HAVE_LOCALE_H diff --git a/Source/GSXML.m b/Source/GSXML.m index 145b01689..fbfa28c2c 100644 --- a/Source/GSXML.m +++ b/Source/GSXML.m @@ -26,10 +26,19 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ +#include + +#ifdef LIBXML2 +#include +#include +#include +#include +#else #include #include #include #include +#endif #include #include diff --git a/Tools/gsdoc.m b/Tools/gsdoc.m index 8965ca2bf..3e1938698 100644 --- a/Tools/gsdoc.m +++ b/Tools/gsdoc.m @@ -80,6 +80,8 @@ Parameters: .gsdoc files */ +#include + #include #if HAVE_LIBXML @@ -87,7 +89,11 @@ Parameters: #include #include #include +#ifdef LIBXML2 +#include +#else #include +#endif NSString *pathExtension_GSDocRefs = @"gsdocrefs"; NSString *pathExtension_GSDoc = @"gsdoc"; diff --git a/acconfig.h b/acconfig.h index 4bfa5ec34..777ea8366 100644 --- a/acconfig.h +++ b/acconfig.h @@ -145,3 +145,6 @@ /* Define if using the ffcall library for invocations */ #undef USE_FFCALL +/* Define if the libxml header files are in libxml2 */ +#undef LIBXML2 + diff --git a/configure b/configure index 8f300bedc..0b733b298 100755 --- a/configure +++ b/configure @@ -4542,62 +4542,70 @@ if test "$libxml_libdir" != "no"; then LIBS="$LIBS -L$libxml_libdir" fi -for ac_hdr in libxml/xmlversion.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4550: 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 < conftest.$ac_ext < +#include +#if LIBXML_VERSION < 20203 +#error libxml needs to be version 2.2.3 or later +#endif EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4557: \"$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* - eval "ac_cv_header_$ac_safe=yes" + xmlhdrdir=libxml else echo "$ac_err" >&5 echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 +fi +rm -f conftest* +if test $xmlhdrdir = no; then +cat > conftest.$ac_ext < +#if LIBXML_VERSION < 20203 +#error libxml needs to be version 2.2.3 or later +#endif +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:4578: \"$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* - eval "ac_cv_header_$ac_safe=no" + cat >> confdefs.h <<\EOF +#define LIBXML2 1 +EOF + xmlhdrdir=libxml2 +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 fi rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&6 -fi -done - -if test $ac_cv_header_libxml_xmlversion_h = no; then +echo "$ac_t""$xmlhdrdir" 1>&6 +if test $xmlhdrdir = no; then echo "Could not find libxml headers" echo "Check to make sure you have libxml version 2 or later installed" echo "configure: warning: Could not find libxml headers" 1>&2 HAVE_LIBXML=0 else cat > conftest.$ac_ext <&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4609: \"$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* @@ -4661,17 +4669,17 @@ for ac_hdr in openssl/ssl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4665: checking for $ac_hdr" >&5 +echo "configure:4673: 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:4675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4683: \"$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* @@ -4703,7 +4711,7 @@ if test $ac_cv_header_openssl_ssl_h = no; then echo "configure: warning: Could not find openssl headers" 1>&2 else echo $ac_n "checking for CRYPTO_malloc in -lcrypto""... $ac_c" 1>&6 -echo "configure:4707: checking for CRYPTO_malloc in -lcrypto" >&5 +echo "configure:4715: 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 @@ -4711,7 +4719,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:4734: \"$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 @@ -4747,7 +4755,7 @@ fi base_libs="$LIBS" LIBS="$LIBS -lcrypto" echo $ac_n "checking for ssl2_clear in -lssl""... $ac_c" 1>&6 -echo "configure:4751: checking for ssl2_clear in -lssl" >&5 +echo "configure:4759: 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 @@ -4755,7 +4763,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:4778: \"$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 @@ -4841,17 +4849,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:4845: checking for $ac_hdr" >&5 +echo "configure:4853: 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:4855: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4863: \"$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* @@ -4883,7 +4891,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:4887: checking for mpf_abs in -lgmp" >&5 +echo "configure:4895: 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 @@ -4891,7 +4899,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:4914: \"$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 e384bb01c..5974911d6 100644 --- a/configure.in +++ b/configure.in @@ -840,14 +840,26 @@ if test "$libxml_libdir" != "no"; then LIBS="$LIBS -L$libxml_libdir" fi -AC_CHECK_HEADERS(libxml/xmlversion.h) -if test $ac_cv_header_libxml_xmlversion_h = no; then +xmlhdrdir=no +# The order of these tests is important. +AC_TRY_CPP([#include +#if LIBXML_VERSION < 20203 +#error libxml needs to be version 2.2.3 or later +#endif], xmlhdrdir=libxml) +if test $xmlhdrdir = no; then +AC_TRY_CPP([#include +#if LIBXML_VERSION < 20203 +#error libxml needs to be version 2.2.3 or later +#endif], AC_DEFINE(LIBXML2) xmlhdrdir=libxml2) +fi +AC_MSG_RESULT($xmlhdrdir) +if test $xmlhdrdir = no; then echo "Could not find libxml headers" echo "Check to make sure you have libxml version 2 or later installed" AC_MSG_WARN(Could not find libxml headers) HAVE_LIBXML=0 else - AC_TRY_CPP([#include "libxml/xmlversion.h" + AC_TRY_CPP([#include "$xmlhdrdir/xmlversion.h" #if LIBXML_VERSION < 20203 #error #endif], libxml2plus=1, libxml2plus=0)