From 81c8357f11bd7321c0ef3b7505e30485641b07e1 Mon Sep 17 00:00:00 2001 From: arjen Date: Thu, 19 Sep 2002 12:28:38 +0000 Subject: [PATCH] Bug fix: exit if libxml2 is not available. --- configure | 109 ++++++++++++++++++++--------------------------------------- configure.in | 10 ++++-- 2 files changed, 43 insertions(+), 76 deletions(-) diff --git a/configure b/configure index a96a88f..a55812a 100755 --- a/configure +++ b/configure @@ -691,7 +691,7 @@ fi PACKAGE=XMLDoc -VERSION=0.3 +VERSION=0.5 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -1034,55 +1034,18 @@ else fi - -XML_CFLAGS=`$XML_CONFIG --cflags` -CFLAGS="$CFLAGS $XML_CFLAGS" - -echo $ac_n "checking for main in -latex""... $ac_c" 1>&6 -echo "configure:1043: checking for main in -latex" >&5 -ac_lib_var=`echo atex'_'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 -else - ac_save_LIBS="$LIBS" -LIBS="-latex $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" +if test $XML_CONFIG = "no" +then + echo "XML2 library not found (see http://xmlsoft.org/)." + exit 1; fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo atex | sed -e 's/[^a-zA-Z0-9_]/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <&6 -fi +XML_CFLAGS=`$XML_CONFIG --cflags` +CFLAGS="$CFLAGS $XML_CFLAGS" echo $ac_n "checking for main in -lexslt""... $ac_c" 1>&6 -echo "configure:1086: checking for main in -lexslt" >&5 +echo "configure:1049: checking for main in -lexslt" >&5 ac_lib_var=`echo exslt'_'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 @@ -1090,14 +1053,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lexslt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1064: \"$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 @@ -1125,7 +1088,7 @@ else fi echo $ac_n "checking for xmlParseFile in -lxml2""... $ac_c" 1>&6 -echo "configure:1129: checking for xmlParseFile in -lxml2" >&5 +echo "configure:1092: checking for xmlParseFile in -lxml2" >&5 ac_lib_var=`echo xml2'_'xmlParseFile | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1133,7 +1096,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lxml2 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1111: \"$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 @@ -1172,7 +1135,7 @@ else fi echo $ac_n "checking for main in -lxslt""... $ac_c" 1>&6 -echo "configure:1176: checking for main in -lxslt" >&5 +echo "configure:1139: checking for main in -lxslt" >&5 ac_lib_var=`echo xslt'_'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 @@ -1180,14 +1143,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lxslt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1154: \"$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 @@ -1216,7 +1179,7 @@ fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1220: checking how to run the C preprocessor" >&5 +echo "configure:1183: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1231,13 +1194,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1204: \"$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 : @@ -1248,13 +1211,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1221: \"$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 : @@ -1265,13 +1228,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1275: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1238: \"$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 : @@ -1296,12 +1259,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1300: checking for ANSI C header files" >&5 +echo "configure:1263: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1309,7 +1272,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1276: \"$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* @@ -1326,7 +1289,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1344,7 +1307,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1365,7 +1328,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1376,7 +1339,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1403,17 +1366,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1407: checking for $ac_hdr" >&5 +echo "configure:1370: 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:1417: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1380: \"$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* @@ -1441,12 +1404,12 @@ done echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1445: checking for working const" >&5 +echo "configure:1408: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else diff --git a/configure.in b/configure.in index 7d8a49f..58773b6 100644 --- a/configure.in +++ b/configure.in @@ -1,19 +1,23 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(xp.c) -AM_INIT_AUTOMAKE(XMLDoc, 0.3) +AM_INIT_AUTOMAKE(XMLDoc, 0.5) dnl Checks for programs. AC_PROG_CC AC_PATH_PROG(XML_CONFIG,xml2-config,no) +if test $XML_CONFIG = "no" +then + echo "XML2 library not found (see http://xmlsoft.org/)." + exit 1; +fi + dnl Checks for libraries. XML_CFLAGS=`$XML_CONFIG --cflags` CFLAGS="$CFLAGS $XML_CFLAGS" -dnl Replace `main' with a function in -latex: -AC_CHECK_LIB(atex, main) dnl Replace `main' with a function in -lexslt: AC_CHECK_LIB(exslt, main) dnl Replace `main' with a function in -lxml2: -- 2.11.0