From c0ad30b74eed5f56de66c61241e44f3ac830bf22 Mon Sep 17 00:00:00 2001 From: CaS Date: Sun, 25 Jan 2004 19:57:10 +0000 Subject: [PATCH] Insist on libxml2 presence unless told not to. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18481 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 2 ++ Source/NSPropertyList.m | 2 ++ configure | 78 ++++++++++++++++++++++++++--------------- configure.ac | 13 +++++++ 4 files changed, 66 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ea3bbe14..4c6432075 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2004-01-25 Richard Frith-Macdonald * Source/NSPropertyList.m: Fix bug in encoding integers as xml. + Fix to compile without xml if necessary. * Source/GSPrivate.h: Added internal class for handling old style arrays of items within keyed coding ... should this go elsewhere? * Source/NSCoder.m: Added internal class for keyed coding of @@ -13,6 +14,7 @@ * Source/NSKeyedUnarchiver.m: All methods now implemented, but no proper type checking/coercion done, and minimal testing done. No attempt to handle OpenStep style property lists either, just xml! + * configure.ac: Insist on libxml2 presence unless told not to. 2004-01-24 Richard Frith-Macdonald diff --git a/Source/NSPropertyList.m b/Source/NSPropertyList.m index cd22dc959..8a6617c67 100644 --- a/Source/NSPropertyList.m +++ b/Source/NSPropertyList.m @@ -2079,6 +2079,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step, { switch (format) { +#ifdef HAVE_LIBXML case NSPropertyListXMLFormat_v1_0: { GSXMLParser *parser; @@ -2102,6 +2103,7 @@ OAppend(id obj, NSDictionary *loc, unsigned lev, unsigned step, } } break; +#endif case NSPropertyListOpenStepFormat: { diff --git a/configure b/configure index d5a1d5637..dae9de727 100755 --- a/configure +++ b/configure @@ -851,6 +851,7 @@ Optional Features: --enable-libffi Enable use of libffi library --enable-ffcall Enable use of ffcall library --disable-do Compile even if DO-dependencies are not met + --disable-xml Compile even if XML-dependencies are not met --disable-xmltest Do not try to compile and run a test XML program Optional Packages: @@ -930,7 +931,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -1127,7 +1128,7 @@ _ASBOX echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && + rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 @@ -2178,8 +2179,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ - ''\ - '#include ' \ + '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ @@ -2193,8 +2193,8 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include $ac_declaration +#include int main () { @@ -2608,7 +2608,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) gcc_nested=0 fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test $gcc_nested = 0; then echo "$as_me:$LINENO: result: no" >&5 @@ -2828,7 +2828,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -3152,7 +3152,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) reuseaddr_ok=0 fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test $reuseaddr_ok = 0; then @@ -3374,7 +3374,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.$ac_objext conftest.$ac_ext @@ -3754,7 +3754,7 @@ echo "$as_me: error: cannot compute sizeof (void*), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -4121,7 +4121,7 @@ echo "$as_me: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -4484,7 +4484,7 @@ echo "$as_me: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -4847,7 +4847,7 @@ echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -5210,7 +5210,7 @@ echo "$as_me: error: cannot compute sizeof (long long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -5573,7 +5573,7 @@ echo "$as_me: error: cannot compute sizeof (float), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -5936,7 +5936,7 @@ echo "$as_me: error: cannot compute sizeof (double), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val @@ -6183,7 +6183,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) objc_cv_con_autoload=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi case "$target_os" in cygwin*) objc_cv_con_autoload=yes;; @@ -6879,7 +6879,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) objc_works=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi @@ -6946,7 +6946,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) objc_compiler_supports_constant_string_class=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi @@ -7014,7 +7014,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) objc_load_method_worked=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi @@ -7417,7 +7417,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi @@ -9489,7 +9489,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) VSPRINTF_RETURNS_LENGTH=0 fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi cat >>confdefs.h <<_ACEOF @@ -9530,7 +9530,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) VASPRINTF_RETURNS_LENGTH=0 fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi cat >>confdefs.h <<_ACEOF @@ -10627,7 +10627,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_setpgrp_void=yes fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5 @@ -11649,7 +11649,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) NEED_WORD_ALIGNMENT=1 fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi cat >>confdefs.h <<_ACEOF @@ -11778,7 +11778,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) working_register_printf=0 fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test $working_register_printf = 1; then @@ -11926,7 +11926,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) program_invocation_name_worked=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi @@ -12066,7 +12066,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) CMDLINE_TERMINATED=0 fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi cat >>confdefs.h <<_ACEOF @@ -12657,6 +12657,14 @@ fi # Check recent libxml for Properytlists, GSXML, GSDoc etc. #-------------------------------------------------------------------- +# Check whether --enable-xml or --disable-xml was given. +if test "${enable_xml+set}" = set; then + enableval="$enable_xml" + +else + enable_xml=yes +fi; + # Save CFLAGS and LIBS as AM_PATH_XML clobbers these variables regardless # of the success of the macro. saved_LIBS="$LIBS" @@ -12897,7 +12905,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) no_xml=yes fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" @@ -12950,6 +12958,18 @@ else # Restore the CFLAGS and LIBS because AM_PATH_XML messes them LIBS="$saved_LIBS" CFLAGS="$saved_CFLAGS" + if test $enable_xml = yes; then + echo + echo "You most likely do not want to build base without XML support." + echo "For instance, MacOS-X compatible property lists require XML." + echo "If you really want to build -base without XML support, add --disable-xml" + echo "to the configure arguments." + { { echo "$as_me:$LINENO: error: Missing support for XML functionality." >&5 +echo "$as_me: error: Missing support for XML functionality." >&2;} + { (exit 1); exit 1; }; } + fi + { echo "$as_me:$LINENO: WARNING: Missing support for XML funtionality." >&5 +echo "$as_me: WARNING: Missing support for XML funtionality." >&2;} fi diff --git a/configure.ac b/configure.ac index cfc179fbb..0f6620d57 100644 --- a/configure.ac +++ b/configure.ac @@ -966,6 +966,10 @@ AC_SUBST(WITH_FFI) # Check recent libxml for Properytlists, GSXML, GSDoc etc. #-------------------------------------------------------------------- +AC_ARG_ENABLE(xml, + [ --disable-xml Compile even if XML-dependencies are not met],, + enable_xml=yes) + # Save CFLAGS and LIBS as AM_PATH_XML clobbers these variables regardless # of the success of the macro. saved_LIBS="$LIBS" @@ -984,6 +988,15 @@ else # Restore the CFLAGS and LIBS because AM_PATH_XML messes them LIBS="$saved_LIBS" CFLAGS="$saved_CFLAGS" + if test $enable_xml = yes; then + echo + echo "You most likely do not want to build base without XML support." + echo "For instance, MacOS-X compatible property lists require XML." + echo "If you really want to build -base without XML support, add --disable-xml" + echo "to the configure arguments." + AC_MSG_ERROR([Missing support for XML functionality.]) + fi + AC_MSG_WARN([Missing support for XML funtionality.]) fi AC_SUBST(HAVE_LIBXML)