Fixes for libxml2 (FreeBSD).

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@8447 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fedor 2000-12-26 23:03:42 +00:00
parent dea58a8568
commit 168faebb05
9 changed files with 106 additions and 59 deletions

View file

@ -1,3 +1,12 @@
2000-12-26 Adam Fedor <fedor@gnu.org>
* configure.in: Look for libxml2 (patch from Kim Shrier
<kim@tinker.com>).
* 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 <kim@tinker.com>).
2000-12-22 Adam Fedor <fedor@gnu.org> 2000-12-22 Adam Fedor <fedor@gnu.org>
* Source/GSFFCallInvocation.m: Remove powerpc specific defs * Source/GSFFCallInvocation.m: Remove powerpc specific defs

View file

@ -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 default zone instead of creating one. Or better yet, fix the problem and
submit a patch. submit a patch.
@item Invocations (and by extension, Distributed Objects) have been well tested only @item Distributed Objects is now thread safe, but it hasn't been well tested.
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.
@end itemize @end itemize

View file

@ -31,8 +31,13 @@
#ifndef __GSXML_H__ #ifndef __GSXML_H__
#define __GSXML_H__ #define __GSXML_H__
#ifdef LIBXML2
#include <libxml2/tree.h>
#include <libxml2/entities.h>
#else
#include <libxml/tree.h> #include <libxml/tree.h>
#include <libxml/entities.h> #include <libxml/entities.h>
#endif
#include <Foundation/NSObject.h> #include <Foundation/NSObject.h>
#include <Foundation/NSString.h> #include <Foundation/NSString.h>

View file

@ -54,6 +54,9 @@
/* Define if using the ffcall library for invocations */ /* Define if using the ffcall library for invocations */
#undef USE_FFCALL #undef USE_FFCALL
/* Define if the libxml header files are in libxml2 */
#undef LIBXML2
/* The number of bytes in a double. */ /* The number of bytes in a double. */
#undef SIZEOF_DOUBLE #undef SIZEOF_DOUBLE
@ -141,8 +144,8 @@
/* Define if you have the vsprintf function. */ /* Define if you have the vsprintf function. */
#undef HAVE_VSPRINTF #undef HAVE_VSPRINTF
/* Define if you have the <callback> header file. */ /* Define if you have the <callback.h> header file. */
#undef HAVE_CALLBACK #undef HAVE_CALLBACK_H
/* Define if you have the <dirent.h> header file. */ /* Define if you have the <dirent.h> header file. */
#undef HAVE_DIRENT_H #undef HAVE_DIRENT_H
@ -159,9 +162,6 @@
/* Define if you have the <langinfo.h> header file. */ /* Define if you have the <langinfo.h> header file. */
#undef HAVE_LANGINFO_H #undef HAVE_LANGINFO_H
/* Define if you have the <libxml/xmlversion.h> header file. */
#undef HAVE_LIBXML_XMLVERSION_H
/* Define if you have the <locale.h> header file. */ /* Define if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H #undef HAVE_LOCALE_H

View file

@ -26,10 +26,19 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
*/ */
#include <config.h>
#ifdef LIBXML2
#include <libxml2/parser.h>
#include <libxml2/parserInternals.h>
#include <libxml2/SAX.h>
#include <libxml2/HTMLparser.h>
#else
#include <libxml/parser.h> #include <libxml/parser.h>
#include <libxml/parserInternals.h> #include <libxml/parserInternals.h>
#include <libxml/SAX.h> #include <libxml/SAX.h>
#include <libxml/HTMLparser.h> #include <libxml/HTMLparser.h>
#endif
#include <Foundation/GSXML.h> #include <Foundation/GSXML.h>
#include <Foundation/NSData.h> #include <Foundation/NSData.h>

View file

@ -80,6 +80,8 @@ Parameters:
.gsdoc files .gsdoc files
*/ */
#include <config.h>
#include <Foundation/Foundation.h> #include <Foundation/Foundation.h>
#if HAVE_LIBXML #if HAVE_LIBXML
@ -87,7 +89,11 @@ Parameters:
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef LIBXML2
#include <libxml2/parser.h>
#else
#include <libxml/parser.h> #include <libxml/parser.h>
#endif
NSString *pathExtension_GSDocRefs = @"gsdocrefs"; NSString *pathExtension_GSDocRefs = @"gsdocrefs";
NSString *pathExtension_GSDoc = @"gsdoc"; NSString *pathExtension_GSDoc = @"gsdoc";

View file

@ -145,3 +145,6 @@
/* Define if using the ffcall library for invocations */ /* Define if using the ffcall library for invocations */
#undef USE_FFCALL #undef USE_FFCALL
/* Define if the libxml header files are in libxml2 */
#undef LIBXML2

98
configure vendored
View file

@ -4542,62 +4542,70 @@ if test "$libxml_libdir" != "no"; then
LIBS="$LIBS -L$libxml_libdir" LIBS="$LIBS -L$libxml_libdir"
fi fi
for ac_hdr in libxml/xmlversion.h xmlhdrdir=no
do # The order of these tests is important.
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` cat > conftest.$ac_ext <<EOF
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 #line 4549 "configure"
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 <<EOF
#line 4555 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <libxml/xmlversion.h>
#if LIBXML_VERSION < 20203
#error libxml needs to be version 2.2.3 or later
#endif
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes" xmlhdrdir=libxml
else else
echo "$ac_err" >&5 echo "$ac_err" >&5
echo "configure: failed program was:" >&5 echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5 cat conftest.$ac_ext >&5
fi
rm -f conftest*
if test $xmlhdrdir = no; then
cat > conftest.$ac_ext <<EOF
#line 4570 "configure"
#include "confdefs.h"
#include <libxml2/xmlversion.h>
#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* 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 fi
rm -f conftest* rm -f conftest*
fi fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""$xmlhdrdir" 1>&6
echo "$ac_t""yes" 1>&6 if test $xmlhdrdir = no; then
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
else
echo "$ac_t""no" 1>&6
fi
done
if test $ac_cv_header_libxml_xmlversion_h = no; then
echo "Could not find libxml headers" echo "Could not find libxml headers"
echo "Check to make sure you have libxml version 2 or later installed" echo "Check to make sure you have libxml version 2 or later installed"
echo "configure: warning: Could not find libxml headers" 1>&2 echo "configure: warning: Could not find libxml headers" 1>&2
HAVE_LIBXML=0 HAVE_LIBXML=0
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4593 "configure" #line 4601 "configure"
#include "confdefs.h" #include "confdefs.h"
#include "libxml/xmlversion.h" #include "$xmlhdrdir/xmlversion.h"
#if LIBXML_VERSION < 20203 #if LIBXML_VERSION < 20203
#error #error
#endif #endif
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4601: \"$ac_try\") 1>&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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
@ -4661,17 +4669,17 @@ for ac_hdr in openssl/ssl.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4670 "configure" #line 4678 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* 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 echo "configure: warning: Could not find openssl headers" 1>&2
else else
echo $ac_n "checking for CRYPTO_malloc in -lcrypto""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo crypto'_'CRYPTO_malloc | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -4711,7 +4719,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lcrypto $LIBS" LIBS="-lcrypto $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4715 "configure" #line 4723 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -4722,7 +4730,7 @@ int main() {
CRYPTO_malloc() CRYPTO_malloc()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4726: \"$ac_link\") 1>&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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -4747,7 +4755,7 @@ fi
base_libs="$LIBS" base_libs="$LIBS"
LIBS="$LIBS -lcrypto" LIBS="$LIBS -lcrypto"
echo $ac_n "checking for ssl2_clear in -lssl""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo ssl'_'ssl2_clear | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -4755,7 +4763,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lssl $LIBS" LIBS="-lssl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4759 "configure" #line 4767 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -4766,7 +4774,7 @@ int main() {
ssl2_clear() ssl2_clear()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4770: \"$ac_link\") 1>&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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
@ -4841,17 +4849,17 @@ for ac_hdr in gmp.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4850 "configure" #line 4858 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* 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 echo "configure: warning: Could not find gmp headers" 1>&2
else else
echo $ac_n "checking for mpf_abs in -lgmp""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo gmp'_'mpf_abs | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
@ -4891,7 +4899,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lgmp $LIBS" LIBS="-lgmp $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 4895 "configure" #line 4903 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
@ -4902,7 +4910,7 @@ int main() {
mpf_abs() mpf_abs()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:4906: \"$ac_link\") 1>&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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else

View file

@ -840,14 +840,26 @@ if test "$libxml_libdir" != "no"; then
LIBS="$LIBS -L$libxml_libdir" LIBS="$LIBS -L$libxml_libdir"
fi fi
AC_CHECK_HEADERS(libxml/xmlversion.h) xmlhdrdir=no
if test $ac_cv_header_libxml_xmlversion_h = no; then # The order of these tests is important.
AC_TRY_CPP([#include <libxml/xmlversion.h>
#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 <libxml2/xmlversion.h>
#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 "Could not find libxml headers"
echo "Check to make sure you have libxml version 2 or later installed" echo "Check to make sure you have libxml version 2 or later installed"
AC_MSG_WARN(Could not find libxml headers) AC_MSG_WARN(Could not find libxml headers)
HAVE_LIBXML=0 HAVE_LIBXML=0
else else
AC_TRY_CPP([#include "libxml/xmlversion.h" AC_TRY_CPP([#include "$xmlhdrdir/xmlversion.h"
#if LIBXML_VERSION < 20203 #if LIBXML_VERSION < 20203
#error #error
#endif], libxml2plus=1, libxml2plus=0) #endif], libxml2plus=1, libxml2plus=0)