Add --with-libxslt configure option

This commit is contained in:
Andrew Dunstan 2007-04-15 12:48:24 +00:00
parent 6041b92238
commit f97d4a267a
5 changed files with 302 additions and 5 deletions

272
configure vendored
View File

@ -314,7 +314,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 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 enable_profiling 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_libxml 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 enable_profiling 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_libxml with_libxslt 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.
@ -896,6 +896,7 @@ Optional Packages:
--without-readline do not use GNU Readline nor BSD Libedit for editing
--with-libedit-preferred prefer BSD Libedit over GNU Readline
--with-libxml build with XML support
--with-libxslt build with XSLT support
--without-zlib do not use Zlib
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
@ -4332,6 +4333,44 @@ fi
#
# XSLT
#
pgac_args="$pgac_args with_libxslt"
# Check whether --with-libxslt or --without-libxslt was given.
if test "${with_libxslt+set}" = set; then
withval="$with_libxslt"
case $withval in
yes)
cat >>confdefs.h <<\_ACEOF
#define USE_LIBXSLT 1
_ACEOF
;;
no)
:
;;
*)
{ { echo "$as_me:$LINENO: error: no argument expected for --with-libxslt option" >&5
echo "$as_me: error: no argument expected for --with-libxslt option" >&2;}
{ (exit 1); exit 1; }; }
;;
esac
else
with_libxslt=no
fi;
#
# Zlib
#
@ -7521,6 +7560,87 @@ fi
fi
if test "$with_libxslt" = yes ; then
echo "$as_me:$LINENO: checking for xsltLibxmlVersion in -lxslt" >&5
echo $ECHO_N "checking for xsltLibxmlVersion in -lxslt... $ECHO_C" >&6
if test "${ac_cv_lib_xslt_xsltLibxmlVersion+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lxslt $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
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 xsltLibxmlVersion ();
int
main ()
{
xsltLibxmlVersion ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_xslt_xsltLibxmlVersion=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_xslt_xsltLibxmlVersion=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_xslt_xsltLibxmlVersion" >&5
echo "${ECHO_T}$ac_cv_lib_xslt_xsltLibxmlVersion" >&6
if test $ac_cv_lib_xslt_xsltLibxmlVersion = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBXSLT 1
_ACEOF
LIBS="-lxslt $LIBS"
else
{ { echo "$as_me:$LINENO: error: library 'xslt' is required for XSLT support" >&5
echo "$as_me: error: library 'xslt' is required for XSLT support" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
##
## Header files
@ -10760,6 +10880,155 @@ echo "$as_me: error: header file <libxml/parser.h> is required for XML support"
fi
fi
if test "$with_libxslt" = yes ; then
if test "${ac_cv_header_libxslt_xslt_h+set}" = set; then
echo "$as_me:$LINENO: checking for libxslt/xslt.h" >&5
echo $ECHO_N "checking for libxslt/xslt.h... $ECHO_C" >&6
if test "${ac_cv_header_libxslt_xslt_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_libxslt_xslt_h" >&5
echo "${ECHO_T}$ac_cv_header_libxslt_xslt_h" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking libxslt/xslt.h usability" >&5
echo $ECHO_N "checking libxslt/xslt.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <libxslt/xslt.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking libxslt/xslt.h presence" >&5
echo $ECHO_N "checking libxslt/xslt.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <libxslt/xslt.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: libxslt/xslt.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: libxslt/xslt.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: libxslt/xslt.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: libxslt/xslt.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: libxslt/xslt.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: libxslt/xslt.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: libxslt/xslt.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: libxslt/xslt.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: libxslt/xslt.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## ---------------------------------------- ##
## Report this to pgsql-bugs@postgresql.org ##
## ---------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for libxslt/xslt.h" >&5
echo $ECHO_N "checking for libxslt/xslt.h... $ECHO_C" >&6
if test "${ac_cv_header_libxslt_xslt_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_libxslt_xslt_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_libxslt_xslt_h" >&5
echo "${ECHO_T}$ac_cv_header_libxslt_xslt_h" >&6
fi
if test $ac_cv_header_libxslt_xslt_h = yes; then
:
else
{ { echo "$as_me:$LINENO: error: header file <libxslt/xslt.h> is required for XSLT support" >&5
echo "$as_me: error: header file <libxslt/xslt.h> is required for XSLT support" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
if test "$with_ldap" = yes ; then
@ -24322,6 +24591,7 @@ s,@with_bonjour@,$with_bonjour,;t t
s,@with_openssl@,$with_openssl,;t t
s,@XML2_CONFIG@,$XML2_CONFIG,;t t
s,@with_libxml@,$with_libxml,;t t
s,@with_libxslt@,$with_libxslt,;t t
s,@with_zlib@,$with_zlib,;t t
s,@EGREP@,$EGREP,;t t
s,@ELF_SYS@,$ELF_SYS,;t t

View File

@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
dnl $PostgreSQL: pgsql/configure.in,v 1.510 2007/04/13 18:50:01 adunstan Exp $
dnl $PostgreSQL: pgsql/configure.in,v 1.511 2007/04/15 12:48:23 adunstan Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
@ -579,6 +579,15 @@ fi
AC_SUBST(with_libxml)
#
# XSLT
#
PGAC_ARG_BOOL(with, libxslt, no, [ --with-libxslt build with XSLT support],
[AC_DEFINE([USE_LIBXSLT], 1, [Define to 1 to build with XSLT support. (--with-libxslt)])])
AC_SUBST(with_libxslt)
#
# Zlib
#
@ -768,6 +777,10 @@ if test "$with_libxml" = yes ; then
AC_CHECK_LIB(xml2, xmlSaveToBuffer, [], [AC_MSG_ERROR([library 'xml2' (version >= 2.6.23) is required for XML support])])
fi
if test "$with_libxslt" = yes ; then
AC_CHECK_LIB(xslt, xsltLibxmlVersion, [], [AC_MSG_ERROR([library 'xslt' is required for XSLT support])])
fi
##
## Header files
@ -847,6 +860,10 @@ if test "$with_libxml" = yes ; then
AC_CHECK_HEADER(libxml/parser.h, [], [AC_MSG_ERROR([header file <libxml/parser.h> is required for XML support])])
fi
if test "$with_libxslt" = yes ; then
AC_CHECK_HEADER(libxslt/xslt.h, [], [AC_MSG_ERROR([header file <libxslt/xslt.h> is required for XSLT support])])
fi
if test "$with_ldap" = yes ; then
if test "$PORTNAME" != "win32"; then
AC_CHECK_HEADERS(ldap.h, [],

View File

@ -1,4 +1,4 @@
# $PostgreSQL: pgsql/contrib/Makefile,v 1.73 2007/04/14 12:57:07 adunstan Exp $
# $PostgreSQL: pgsql/contrib/Makefile,v 1.74 2007/04/15 12:48:23 adunstan Exp $
subdir = contrib
top_builddir = ..
@ -37,9 +37,15 @@ ifeq ($(with_openssl),yes)
WANTED_DIRS += sslinfo
endif
ifeq ($(with_libxml),yes)
ifeq ($(with_libxslt),yes)
WANTED_DIRS += xml2
endif
endif
# Missing:
# start-scripts \ (does not have a makefile)
# xml2 \ (requires libxml and libxslt installed)
all install installdirs uninstall distprep clean distclean maintainer-clean:
@for dir in $(WANTED_DIRS); do \

View File

@ -1,5 +1,5 @@
# -*-makefile-*-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.234 2007/04/13 18:50:01 adunstan Exp $
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.235 2007/04/15 12:48:23 adunstan Exp $
#------------------------------------------------------------------------------
# All PostgreSQL makefiles include this file and use the variables it sets,
@ -153,6 +153,7 @@ with_python = @with_python@
with_tcl = @with_tcl@
with_openssl = @with_openssl@
with_libxml = @with_libxml@
with_libxslt = @with_libxslt@
with_zlib = @with_zlib@
enable_shared = @enable_shared@
enable_rpath = @enable_rpath@

View File

@ -256,6 +256,9 @@
/* Define to 1 if you have the `xml2' library (-lxml2). */
#undef HAVE_LIBXML2
/* Define to 1 if you have the `xslt' library (-lxslt). */
#undef HAVE_LIBXSLT
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ