Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 16f372d

Browse files
committed
Optionally use xml2-config to detect installation locations of libxml.
1 parent 0208410 commit 16f372d

File tree

3 files changed

+97
-3
lines changed

3 files changed

+97
-3
lines changed

configure

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ ac_includes_default="\
314314
# include <unistd.h>
315315
#endif"
316316

317-
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'
317+
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'
318318
ac_subst_files=''
319319

320320
# Initialize some variables set by options.
@@ -4196,6 +4196,61 @@ else
41964196
fi;
41974197

41984198

4199+
if test "$with_libxml" = yes ; then
4200+
for ac_prog in xml2-config
4201+
do
4202+
# Extract the first word of "$ac_prog", so it can be a program name with args.
4203+
set dummy $ac_prog; ac_word=$2
4204+
echo "$as_me:$LINENO: checking for $ac_word" >&5
4205+
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
4206+
if test "${ac_cv_prog_XML2_CONFIG+set}" = set; then
4207+
echo $ECHO_N "(cached) $ECHO_C" >&6
4208+
else
4209+
if test -n "$XML2_CONFIG"; then
4210+
ac_cv_prog_XML2_CONFIG="$XML2_CONFIG" # Let the user override the test.
4211+
else
4212+
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4213+
for as_dir in $PATH
4214+
do
4215+
IFS=$as_save_IFS
4216+
test -z "$as_dir" && as_dir=.
4217+
for ac_exec_ext in '' $ac_executable_extensions; do
4218+
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4219+
ac_cv_prog_XML2_CONFIG="$ac_prog"
4220+
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
4221+
break 2
4222+
fi
4223+
done
4224+
done
4225+
4226+
fi
4227+
fi
4228+
XML2_CONFIG=$ac_cv_prog_XML2_CONFIG
4229+
if test -n "$XML2_CONFIG"; then
4230+
echo "$as_me:$LINENO: result: $XML2_CONFIG" >&5
4231+
echo "${ECHO_T}$XML2_CONFIG" >&6
4232+
else
4233+
echo "$as_me:$LINENO: result: no" >&5
4234+
echo "${ECHO_T}no" >&6
4235+
fi
4236+
4237+
test -n "$XML2_CONFIG" && break
4238+
done
4239+
4240+
if test -n "$XML2_CONFIG"; then
4241+
for pgac_option in `$XML2_CONFIG --cflags`; do
4242+
case $pgac_option in
4243+
-I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
4244+
esac
4245+
done
4246+
for pgac_option in `$XML2_CONFIG --libs`; do
4247+
case $pgac_option in
4248+
-L*) LDFLAGS="$LDFLAGS $pgac_option";;
4249+
esac
4250+
done
4251+
fi
4252+
fi
4253+
41994254

42004255
#
42014256
# Zlib
@@ -23794,6 +23849,7 @@ s,@with_pam@,$with_pam,;t t
2379423849
s,@with_ldap@,$with_ldap,;t t
2379523850
s,@with_bonjour@,$with_bonjour,;t t
2379623851
s,@with_openssl@,$with_openssl,;t t
23852+
s,@XML2_CONFIG@,$XML2_CONFIG,;t t
2379723853
s,@with_zlib@,$with_zlib,;t t
2379823854
s,@EGREP@,$EGREP,;t t
2379923855
s,@ELF_SYS@,$ELF_SYS,;t t

configure.in

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.496 2007/01/07 21:10:40 petere Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.497 2007/01/18 14:07:31 petere Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -537,6 +537,22 @@ PGAC_ARG_BOOL(with, libedit-preferred, no,
537537
PGAC_ARG_BOOL(with, libxml, no, [ --with-libxml build with XML support],
538538
[AC_DEFINE([USE_LIBXML], 1, [Define to 1 to build with XML support. (--with-libxml)])])
539539

540+
if test "$with_libxml" = yes ; then
541+
AC_CHECK_PROGS(XML2_CONFIG, xml2-config)
542+
if test -n "$XML2_CONFIG"; then
543+
for pgac_option in `$XML2_CONFIG --cflags`; do
544+
case $pgac_option in
545+
-I*|-D*) CPPFLAGS="$CPPFLAGS $pgac_option";;
546+
esac
547+
done
548+
for pgac_option in `$XML2_CONFIG --libs`; do
549+
case $pgac_option in
550+
-L*) LDFLAGS="$LDFLAGS $pgac_option";;
551+
esac
552+
done
553+
fi
554+
fi
555+
540556

541557
#
542558
# Zlib

doc/src/sgml/installation.sgml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.271 2007/01/07 21:10:41 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.272 2007/01/18 14:07:31 petere Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -912,6 +912,18 @@ su - postgres
912912
Build with libxml (enables SQL/XML support). Libxml version 2.6.23 or
913913
later is required for this feature.
914914
</para>
915+
916+
<para>
917+
Libxml installs a program <command>xml2-config</command> that
918+
can be used to detect the required compiler and linker
919+
options. PostgreSQL will use it automatically if found. To
920+
specify a libxml installation at an unusual location, you can
921+
either set the environment variable
922+
<envar>XML2_CONFIG</envar> to point to the
923+
<command>xml2-config</command> program belonging to the
924+
installation, or use the options
925+
<option>--with-includes</option> and
926+
<option>--with-libraries</option>.
915927
</listitem>
916928
</varlistentry>
917929

@@ -1202,6 +1214,16 @@ su - postgres
12021214
</listitem>
12031215
</varlistentry>
12041216

1217+
<varlistentry>
1218+
<term><envar>XML2_CONFIG</envar></term>
1219+
<listitem>
1220+
<para>
1221+
<command>xml2-config</command> program used to locate the
1222+
libxml installation.
1223+
</para>
1224+
</listitem>
1225+
</varlistentry>
1226+
12051227
<varlistentry>
12061228
<term><envar>YACC</envar></term>
12071229
<listitem>

0 commit comments

Comments
 (0)