From 16f372d940823d08bc7271cf1057f062390efe2b Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Thu, 18 Jan 2007 14:07:31 +0000 Subject: [PATCH] Optionally use xml2-config to detect installation locations of libxml. --- configure | 58 +++++++++++++++++++++++++++++++++- configure.in | 18 ++++++++++- doc/src/sgml/installation.sgml | 24 +++++++++++++- 3 files changed, 97 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 557d1fac9d..619cd89f01 100755 --- a/configure +++ b/configure @@ -314,7 +314,7 @@ ac_includes_default="\ # include #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 configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug DTRACE DTRACEFLAGS enable_dtrace CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_ldap with_bonjour with_openssl with_zlib EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS LDAP_LIBS_FE LDAP_LIBS_BE HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build 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 configure_args build build_cpu build_vendor build_os host host_cpu host_vendor host_os PORTNAME docdir enable_nls WANTED_LANGUAGES default_port enable_shared enable_rpath enable_debug DTRACE DTRACEFLAGS enable_dtrace CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP GCC TAS autodepend INCLUDES enable_thread_safety with_tcl with_perl with_python with_krb5 krb_srvtab with_pam with_ldap with_bonjour with_openssl XML2_CONFIG with_zlib EGREP ELF_SYS LDFLAGS_SL AWK FLEX FLEXFLAGS LN_S LD with_gnu_ld ld_R_works RANLIB ac_ct_RANLIB TAR STRIP ac_ct_STRIP STRIP_STATIC_LIB STRIP_SHARED_LIB YACC YFLAGS PERL perl_archlibexp perl_privlibexp perl_useshrplib perl_embed_ldflags PYTHON python_version python_configdir python_includespec python_libdir python_libspec python_additional_libs HAVE_IPV6 LIBOBJS acx_pthread_config PTHREAD_CC PTHREAD_LIBS PTHREAD_CFLAGS LDAP_LIBS_FE LDAP_LIBS_BE HAVE_POSIX_SIGNALS MSGFMT MSGMERGE XGETTEXT localedir TCLSH TCL_CONFIG_SH TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIBS TCL_LIB_SPEC TCL_SHARED_BUILD TCL_SHLIB_LD_LIBS NSGMLS JADE have_docbook DOCBOOKSTYLE COLLATEINDEX SGMLSPL vpath_build LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -4196,6 +4196,61 @@ else fi; +if test "$with_libxml" = yes ; then + for ac_prog in xml2-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_XML2_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$XML2_CONFIG"; then + ac_cv_prog_XML2_CONFIG="$XML2_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_XML2_CONFIG="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +XML2_CONFIG=$ac_cv_prog_XML2_CONFIG +if test -n "$XML2_CONFIG"; then + echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5 +echo "${ECHO_T}$XML2_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$XML2_CONFIG" && break +done + + if test -n "$XML2_CONFIG"; then + for pgac_option in `$XML2_CONFIG --cflags`; do + case $pgac_option in + -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";; + esac + done + for pgac_option in `$XML2_CONFIG --libs`; do + case $pgac_option in + -L*) LDFLAGS="$LDFLAGS $pgac_option";; + esac + done + fi +fi + # # Zlib @@ -23794,6 +23849,7 @@ s,@with_pam@,$with_pam,;t t s,@with_ldap@,$with_ldap,;t t s,@with_bonjour@,$with_bonjour,;t t s,@with_openssl@,$with_openssl,;t t +s,@XML2_CONFIG@,$XML2_CONFIG,;t t s,@with_zlib@,$with_zlib,;t t s,@EGREP@,$EGREP,;t t s,@ELF_SYS@,$ELF_SYS,;t t diff --git a/configure.in b/configure.in index 893722fbf6..4d3fb93f68 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ dnl Process this file with autoconf to produce a configure script. -dnl $PostgreSQL: pgsql/configure.in,v 1.496 2007/01/07 21:10:40 petere Exp $ +dnl $PostgreSQL: pgsql/configure.in,v 1.497 2007/01/18 14:07:31 petere Exp $ dnl dnl Developers, please strive to achieve this order: dnl @@ -537,6 +537,22 @@ PGAC_ARG_BOOL(with, libedit-preferred, no, PGAC_ARG_BOOL(with, libxml, no, [ --with-libxml build with XML support], [AC_DEFINE([USE_LIBXML], 1, [Define to 1 to build with XML support. (--with-libxml)])]) +if test "$with_libxml" = yes ; then + AC_CHECK_PROGS(XML2_CONFIG, xml2-config) + if test -n "$XML2_CONFIG"; then + for pgac_option in `$XML2_CONFIG --cflags`; do + case $pgac_option in + -I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";; + esac + done + for pgac_option in `$XML2_CONFIG --libs`; do + case $pgac_option in + -L*) LDFLAGS="$LDFLAGS $pgac_option";; + esac + done + fi +fi + # # Zlib diff --git a/doc/src/sgml/installation.sgml b/doc/src/sgml/installation.sgml index 68644fd4aa..c214cb85b1 100644 --- a/doc/src/sgml/installation.sgml +++ b/doc/src/sgml/installation.sgml @@ -1,4 +1,4 @@ - + <![%standalone-include[<productname>PostgreSQL</>]]> @@ -912,6 +912,18 @@ su - postgres Build with libxml (enables SQL/XML support). Libxml version 2.6.23 or later is required for this feature. </para> + + <para> + Libxml installs a program <command>xml2-config</command> that + can be used to detect the required compiler and linker + options. PostgreSQL will use it automatically if found. To + specify a libxml installation at an unusual location, you can + either set the environment variable + <envar>XML2_CONFIG</envar> to point to the + <command>xml2-config</command> program belonging to the + installation, or use the options + <option>--with-includes</option> and + <option>--with-libraries</option>. </listitem> </varlistentry> @@ -1202,6 +1214,16 @@ su - postgres </listitem> </varlistentry> + <varlistentry> + <term><envar>XML2_CONFIG</envar></term> + <listitem> + <para> + <command>xml2-config</command> program used to locate the + libxml installation. + </para> + </listitem> + </varlistentry> + <varlistentry> <term><envar>YACC</envar></term> <listitem> -- 2.40.0