Use pkg-config in the libxml configure check.

This commit is contained in:
Mike McCormack 2005-08-08 18:36:53 +00:00 committed by Alexandre Julliard
parent 8a43775e2d
commit 90c75bdd5b
2 changed files with 78 additions and 25 deletions

81
configure vendored
View File

@ -311,7 +311,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DLLDEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os WIN16_FILES WIN16_INSTALL SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPPBIN ac_ct_CPPBIN TOOLSDIR CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LEX LEXLIB LEX_OUTPUT_ROOT XLEX BISON AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN EGREP LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS FONTFORGE LIBPTHREAD XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS GLUT_LIBS GLUT32FILES NASLIBS XML2LIBS XML2INCL CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS LCMSLIBS LDAPLIBS FREETYPELIBS FREETYPEINCL ft_devel ft_devel2 FONTSSUBDIRS ARTSCCONFIG ARTSLIBS ARTSINCL ESDCONFIG ESDLIBS ESDINCL ALSALIBS AUDIOIOLIBS EXTRACFLAGS DLLEXT DLLFLAGS DLLIBS LDSHARED LDDLLFLAGS LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS LDLIBWINEFLAGS COREFOUNDATIONLIB IOKITLIB CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS SOCKETLIBS WINE_BINARIES MAIN_BINARY LDD LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS DLLDEFS build build_cpu build_vendor build_os host host_cpu host_vendor host_os WIN16_FILES WIN16_INSTALL SET_MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CXX CXXFLAGS ac_ct_CXX CPPBIN ac_ct_CPPBIN TOOLSDIR CPP X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS LEX LEXLIB LEX_OUTPUT_ROOT XLEX BISON AS ac_ct_AS LD ac_ct_LD AR ac_ct_AR RANLIB ac_ct_RANLIB STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES LN_S LN EGREP LDCONFIG INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LINT LINTFLAGS FONTFORGE PKG_CONFIG LIBPTHREAD XLIB XFILES OPENGLFILES GLU32FILES OPENGL_LIBS GLUT_LIBS GLUT32FILES NASLIBS XML2LIBS XML2INCL CURSESLIBS sane_devel SANELIBS SANEINCL ICULIBS LCMSLIBS LDAPLIBS FREETYPELIBS FREETYPEINCL ft_devel ft_devel2 FONTSSUBDIRS ARTSCCONFIG ARTSLIBS ARTSINCL ESDCONFIG ESDLIBS ESDINCL ALSALIBS AUDIOIOLIBS EXTRACFLAGS DLLEXT DLLFLAGS DLLIBS LDSHARED LDDLLFLAGS LIBEXT IMPLIBEXT DLLTOOL ac_ct_DLLTOOL DLLWRAP ac_ct_DLLWRAP LDEXECFLAGS LDLIBWINEFLAGS COREFOUNDATIONLIB IOKITLIB CROSSTEST CROSSCC CROSSWINDRES LDPATH CRTLIBS SOCKETLIBS WINE_BINARIES MAIN_BINARY LDD LIBOBJS LTLIBOBJS'
ac_subst_files='MAKE_RULES MAKE_DLL_RULES MAKE_TEST_RULES MAKE_LIB_RULES MAKE_PROG_RULES'
# Initialize some variables set by options.
@ -5640,6 +5640,47 @@ fi
done
test -n "$FONTFORGE" || FONTFORGE="false"
for ac_prog in pkg-config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
if test "${ac_cv_prog_PKG_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$PKG_CONFIG"; then
ac_cv_prog_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_PKG_CONFIG="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
fi
fi
PKG_CONFIG=$ac_cv_prog_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
echo "${ECHO_T}$PKG_CONFIG" >&6
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi
test -n "$PKG_CONFIG" && break
done
test -n "$PKG_CONFIG" || PKG_CONFIG="false"
@ -8508,8 +8549,12 @@ XML2LIBS=""
XML2INCL=""
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2"
if test "$PKG_CONFIG" != "false"
then
ac_save_CPPFLAGS="$CPPFLAGS"
ac_xml_libs="`$PKG_CONFIG --libs libxml-2.0`"
ac_xml_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
CPPFLAGS="$CPPFLAGS $ac_xml_cflags"
for ac_header in libxml/parser.h
do
@ -8654,13 +8699,13 @@ if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
echo "$as_me:$LINENO: checking for xmlReadIO in -lxml2" >&5
echo $ECHO_N "checking for xmlReadIO in -lxml2... $ECHO_C" >&6
if test "${ac_cv_lib_xml2_xmlReadIO+set}" = set; then
echo "$as_me:$LINENO: checking for xmlParseMemory in -lxml2" >&5
echo $ECHO_N "checking for xmlParseMemory in -lxml2... $ECHO_C" >&6
if test "${ac_cv_lib_xml2_xmlParseMemory+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lxml2 $LIBS"
LIBS="-lxml2 $ac_xml_libs $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@ -8674,11 +8719,11 @@ extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char xmlReadIO ();
char xmlParseMemory ();
int
main ()
{
xmlReadIO ();
xmlParseMemory ();
;
return 0;
}
@ -8704,34 +8749,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_xml2_xmlReadIO=yes
ac_cv_lib_xml2_xmlParseMemory=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_xml2_xmlReadIO=no
ac_cv_lib_xml2_xmlParseMemory=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlReadIO" >&5
echo "${ECHO_T}$ac_cv_lib_xml2_xmlReadIO" >&6
if test $ac_cv_lib_xml2_xmlReadIO = yes; then
echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlParseMemory" >&5
echo "${ECHO_T}$ac_cv_lib_xml2_xmlParseMemory" >&6
if test $ac_cv_lib_xml2_xmlParseMemory = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBXML2 1
_ACEOF
XML2LIBS="-lxml2"
XML2INCL="-I/usr/include/libxml2"
XML2LIBS="$ac_xml_libs"
XML2INCL="$ac_xml_cflags"
fi
fi
done
CPPFLAGS="$ac_save_CPPFLAGS"
CPPFLAGS="$ac_save_CPPFLAGS"
fi
CURSESLIBS=""
if test "x$with_curses" != "xno"
@ -19057,6 +19103,7 @@ s,@INSTALL_DATA@,$INSTALL_DATA,;t t
s,@LINT@,$LINT,;t t
s,@LINTFLAGS@,$LINTFLAGS,;t t
s,@FONTFORGE@,$FONTFORGE,;t t
s,@PKG_CONFIG@,$PKG_CONFIG,;t t
s,@LIBPTHREAD@,$LIBPTHREAD,;t t
s,@XLIB@,$XLIB,;t t
s,@XFILES@,$XFILES,;t t

View File

@ -134,6 +134,7 @@ AC_SUBST(LINTFLAGS)
dnl Check for various programs
AC_CHECK_PROGS(FONTFORGE, fontforge, false)
AC_CHECK_PROGS(PKG_CONFIG, pkg-config, false)
dnl **** Check for some libraries ****
@ -434,14 +435,19 @@ dnl **** Check for libxml2 ****
AC_SUBST(XML2LIBS,"")
AC_SUBST(XML2INCL,"")
ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2"
AC_CHECK_HEADERS(libxml/parser.h,
[AC_CHECK_LIB(xml2, xmlReadIO,
[AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have the libxml2 library])
XML2LIBS="-lxml2"
XML2INCL="-I/usr/include/libxml2"])])
CPPFLAGS="$ac_save_CPPFLAGS"
if test "$PKG_CONFIG" != "false"
then
ac_save_CPPFLAGS="$CPPFLAGS"
ac_xml_libs="`$PKG_CONFIG --libs libxml-2.0`"
ac_xml_cflags="`$PKG_CONFIG --cflags libxml-2.0`"
CPPFLAGS="$CPPFLAGS $ac_xml_cflags"
AC_CHECK_HEADERS(libxml/parser.h,
[AC_CHECK_LIB(xml2, xmlParseMemory,
[AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have the libxml2 library])
XML2LIBS="$ac_xml_libs"
XML2INCL="$ac_xml_cflags"],,$ac_xml_libs)])
CPPFLAGS="$ac_save_CPPFLAGS"
fi
dnl **** Check which curses lib to use ***
CURSESLIBS=""