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

Commit 8c1de5f

Browse files
committed
Initial SQL/XML support: xml data type and initial set of functions.
1 parent ed1e9cd commit 8c1de5f

39 files changed

+2446
-128
lines changed

configure

Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,7 @@ Optional Packages:
894894
--with-openssl build with OpenSSL support
895895
--without-readline do not use GNU Readline nor BSD Libedit for editing
896896
--with-libedit-preferred prefer BSD Libedit over GNU Readline
897+
--with-libxml build with XML support
897898
--without-zlib do not use Zlib
898899
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
899900

@@ -4160,6 +4161,42 @@ fi;
41604161

41614162

41624163

4164+
#
4165+
# XML
4166+
#
4167+
4168+
pgac_args="$pgac_args with_libxml"
4169+
4170+
4171+
# Check whether --with-libxml or --without-libxml was given.
4172+
if test "${with_libxml+set}" = set; then
4173+
withval="$with_libxml"
4174+
4175+
case $withval in
4176+
yes)
4177+
4178+
cat >>confdefs.h <<\_ACEOF
4179+
#define USE_LIBXML 1
4180+
_ACEOF
4181+
4182+
;;
4183+
no)
4184+
:
4185+
;;
4186+
*)
4187+
{ { echo "$as_me:$LINENO: error: no argument expected for --with-libxml option" >&5
4188+
echo "$as_me: error: no argument expected for --with-libxml option" >&2;}
4189+
{ (exit 1); exit 1; }; }
4190+
;;
4191+
esac
4192+
4193+
else
4194+
with_libxml=no
4195+
4196+
fi;
4197+
4198+
4199+
41634200
#
41644201
# Zlib
41654202
#
@@ -7268,6 +7305,87 @@ fi
72687305

72697306
fi
72707307

7308+
if test "$with_libxml" = yes ; then
7309+
7310+
echo "$as_me:$LINENO: checking for xmlInitParser in -lxml2" >&5
7311+
echo $ECHO_N "checking for xmlInitParser in -lxml2... $ECHO_C" >&6
7312+
if test "${ac_cv_lib_xml2_xmlInitParser+set}" = set; then
7313+
echo $ECHO_N "(cached) $ECHO_C" >&6
7314+
else
7315+
ac_check_lib_save_LIBS=$LIBS
7316+
LIBS="-lxml2 $LIBS"
7317+
cat >conftest.$ac_ext <<_ACEOF
7318+
/* confdefs.h. */
7319+
_ACEOF
7320+
cat confdefs.h >>conftest.$ac_ext
7321+
cat >>conftest.$ac_ext <<_ACEOF
7322+
/* end confdefs.h. */
7323+
7324+
/* Override any gcc2 internal prototype to avoid an error. */
7325+
#ifdef __cplusplus
7326+
extern "C"
7327+
#endif
7328+
/* We use char because int might match the return type of a gcc2
7329+
builtin and then its argument prototype would still apply. */
7330+
char xmlInitParser ();
7331+
int
7332+
main ()
7333+
{
7334+
xmlInitParser ();
7335+
;
7336+
return 0;
7337+
}
7338+
_ACEOF
7339+
rm -f conftest.$ac_objext conftest$ac_exeext
7340+
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
7341+
(eval $ac_link) 2>conftest.er1
7342+
ac_status=$?
7343+
grep -v '^ *+' conftest.er1 >conftest.err
7344+
rm -f conftest.er1
7345+
cat conftest.err >&5
7346+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
7347+
(exit $ac_status); } &&
7348+
{ ac_try='test -z "$ac_c_werror_flag"
7349+
|| test ! -s conftest.err'
7350+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7351+
(eval $ac_try) 2>&5
7352+
ac_status=$?
7353+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
7354+
(exit $ac_status); }; } &&
7355+
{ ac_try='test -s conftest$ac_exeext'
7356+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7357+
(eval $ac_try) 2>&5
7358+
ac_status=$?
7359+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
7360+
(exit $ac_status); }; }; then
7361+
ac_cv_lib_xml2_xmlInitParser=yes
7362+
else
7363+
echo "$as_me: failed program was:" >&5
7364+
sed 's/^/| /' conftest.$ac_ext >&5
7365+
7366+
ac_cv_lib_xml2_xmlInitParser=no
7367+
fi
7368+
rm -f conftest.err conftest.$ac_objext \
7369+
conftest$ac_exeext conftest.$ac_ext
7370+
LIBS=$ac_check_lib_save_LIBS
7371+
fi
7372+
echo "$as_me:$LINENO: result: $ac_cv_lib_xml2_xmlInitParser" >&5
7373+
echo "${ECHO_T}$ac_cv_lib_xml2_xmlInitParser" >&6
7374+
if test $ac_cv_lib_xml2_xmlInitParser = yes; then
7375+
cat >>confdefs.h <<_ACEOF
7376+
#define HAVE_LIBXML2 1
7377+
_ACEOF
7378+
7379+
LIBS="-lxml2 $LIBS"
7380+
7381+
else
7382+
{ { echo "$as_me:$LINENO: error: library 'xml2' is required for XML support" >&5
7383+
echo "$as_me: error: library 'xml2' is required for XML support" >&2;}
7384+
{ (exit 1); exit 1; }; }
7385+
fi
7386+
7387+
fi
7388+
72717389

72727390
##
72737391
## Header files
@@ -10359,6 +10477,155 @@ fi
1035910477

1036010478
done
1036110479

10480+
fi
10481+
10482+
if test "$with_libxml" = yes ; then
10483+
if test "${ac_cv_header_libxml_parser_h+set}" = set; then
10484+
echo "$as_me:$LINENO: checking for libxml/parser.h" >&5
10485+
echo $ECHO_N "checking for libxml/parser.h... $ECHO_C" >&6
10486+
if test "${ac_cv_header_libxml_parser_h+set}" = set; then
10487+
echo $ECHO_N "(cached) $ECHO_C" >&6
10488+
fi
10489+
echo "$as_me:$LINENO: result: $ac_cv_header_libxml_parser_h" >&5
10490+
echo "${ECHO_T}$ac_cv_header_libxml_parser_h" >&6
10491+
else
10492+
# Is the header compilable?
10493+
echo "$as_me:$LINENO: checking libxml/parser.h usability" >&5
10494+
echo $ECHO_N "checking libxml/parser.h usability... $ECHO_C" >&6
10495+
cat >conftest.$ac_ext <<_ACEOF
10496+
/* confdefs.h. */
10497+
_ACEOF
10498+
cat confdefs.h >>conftest.$ac_ext
10499+
cat >>conftest.$ac_ext <<_ACEOF
10500+
/* end confdefs.h. */
10501+
$ac_includes_default
10502+
#include <libxml/parser.h>
10503+
_ACEOF
10504+
rm -f conftest.$ac_objext
10505+
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10506+
(eval $ac_compile) 2>conftest.er1
10507+
ac_status=$?
10508+
grep -v '^ *+' conftest.er1 >conftest.err
10509+
rm -f conftest.er1
10510+
cat conftest.err >&5
10511+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
10512+
(exit $ac_status); } &&
10513+
{ ac_try='test -z "$ac_c_werror_flag"
10514+
|| test ! -s conftest.err'
10515+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10516+
(eval $ac_try) 2>&5
10517+
ac_status=$?
10518+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
10519+
(exit $ac_status); }; } &&
10520+
{ ac_try='test -s conftest.$ac_objext'
10521+
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10522+
(eval $ac_try) 2>&5
10523+
ac_status=$?
10524+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
10525+
(exit $ac_status); }; }; then
10526+
ac_header_compiler=yes
10527+
else
10528+
echo "$as_me: failed program was:" >&5
10529+
sed 's/^/| /' conftest.$ac_ext >&5
10530+
10531+
ac_header_compiler=no
10532+
fi
10533+
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10534+
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
10535+
echo "${ECHO_T}$ac_header_compiler" >&6
10536+
10537+
# Is the header present?
10538+
echo "$as_me:$LINENO: checking libxml/parser.h presence" >&5
10539+
echo $ECHO_N "checking libxml/parser.h presence... $ECHO_C" >&6
10540+
cat >conftest.$ac_ext <<_ACEOF
10541+
/* confdefs.h. */
10542+
_ACEOF
10543+
cat confdefs.h >>conftest.$ac_ext
10544+
cat >>conftest.$ac_ext <<_ACEOF
10545+
/* end confdefs.h. */
10546+
#include <libxml/parser.h>
10547+
_ACEOF
10548+
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
10549+
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10550+
ac_status=$?
10551+
grep -v '^ *+' conftest.er1 >conftest.err
10552+
rm -f conftest.er1
10553+
cat conftest.err >&5
10554+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
10555+
(exit $ac_status); } >/dev/null; then
10556+
if test -s conftest.err; then
10557+
ac_cpp_err=$ac_c_preproc_warn_flag
10558+
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
10559+
else
10560+
ac_cpp_err=
10561+
fi
10562+
else
10563+
ac_cpp_err=yes
10564+
fi
10565+
if test -z "$ac_cpp_err"; then
10566+
ac_header_preproc=yes
10567+
else
10568+
echo "$as_me: failed program was:" >&5
10569+
sed 's/^/| /' conftest.$ac_ext >&5
10570+
10571+
ac_header_preproc=no
10572+
fi
10573+
rm -f conftest.err conftest.$ac_ext
10574+
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
10575+
echo "${ECHO_T}$ac_header_preproc" >&6
10576+
10577+
# So? What about this header?
10578+
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
10579+
yes:no: )
10580+
{ echo "$as_me:$LINENO: WARNING: libxml/parser.h: accepted by the compiler, rejected by the preprocessor!" >&5
10581+
echo "$as_me: WARNING: libxml/parser.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
10582+
{ echo "$as_me:$LINENO: WARNING: libxml/parser.h: proceeding with the compiler's result" >&5
10583+
echo "$as_me: WARNING: libxml/parser.h: proceeding with the compiler's result" >&2;}
10584+
ac_header_preproc=yes
10585+
;;
10586+
no:yes:* )
10587+
{ echo "$as_me:$LINENO: WARNING: libxml/parser.h: present but cannot be compiled" >&5
10588+
echo "$as_me: WARNING: libxml/parser.h: present but cannot be compiled" >&2;}
10589+
{ echo "$as_me:$LINENO: WARNING: libxml/parser.h: check for missing prerequisite headers?" >&5
10590+
echo "$as_me: WARNING: libxml/parser.h: check for missing prerequisite headers?" >&2;}
10591+
{ echo "$as_me:$LINENO: WARNING: libxml/parser.h: see the Autoconf documentation" >&5
10592+
echo "$as_me: WARNING: libxml/parser.h: see the Autoconf documentation" >&2;}
10593+
{ echo "$as_me:$LINENO: WARNING: libxml/parser.h: section \"Present But Cannot Be Compiled\"" >&5
10594+
echo "$as_me: WARNING: libxml/parser.h: section \"Present But Cannot Be Compiled\"" >&2;}
10595+
{ echo "$as_me:$LINENO: WARNING: libxml/parser.h: proceeding with the preprocessor's result" >&5
10596+
echo "$as_me: WARNING: libxml/parser.h: proceeding with the preprocessor's result" >&2;}
10597+
{ echo "$as_me:$LINENO: WARNING: libxml/parser.h: in the future, the compiler will take precedence" >&5
10598+
echo "$as_me: WARNING: libxml/parser.h: in the future, the compiler will take precedence" >&2;}
10599+
(
10600+
cat <<\_ASBOX
10601+
## ---------------------------------------- ##
10602+
## Report this to pgsql-bugs@postgresql.org ##
10603+
## ---------------------------------------- ##
10604+
_ASBOX
10605+
) |
10606+
sed "s/^/$as_me: WARNING: /" >&2
10607+
;;
10608+
esac
10609+
echo "$as_me:$LINENO: checking for libxml/parser.h" >&5
10610+
echo $ECHO_N "checking for libxml/parser.h... $ECHO_C" >&6
10611+
if test "${ac_cv_header_libxml_parser_h+set}" = set; then
10612+
echo $ECHO_N "(cached) $ECHO_C" >&6
10613+
else
10614+
ac_cv_header_libxml_parser_h=$ac_header_preproc
10615+
fi
10616+
echo "$as_me:$LINENO: result: $ac_cv_header_libxml_parser_h" >&5
10617+
echo "${ECHO_T}$ac_cv_header_libxml_parser_h" >&6
10618+
10619+
fi
10620+
if test $ac_cv_header_libxml_parser_h = yes; then
10621+
:
10622+
else
10623+
{ { echo "$as_me:$LINENO: error: header file <libxml/parser.h> is required for XML support" >&5
10624+
echo "$as_me: error: header file <libxml/parser.h> is required for XML support" >&2;}
10625+
{ (exit 1); exit 1; }; }
10626+
fi
10627+
10628+
1036210629
fi
1036310630

1036410631
if test "$with_ldap" = yes ; then

configure.in

Lines changed: 16 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.492 2006/12/14 21:49:54 tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.493 2006/12/21 16:05:12 petere Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -531,6 +531,13 @@ PGAC_ARG_BOOL(with, libedit-preferred, no,
531531
[ --with-libedit-preferred prefer BSD Libedit over GNU Readline])
532532

533533

534+
#
535+
# XML
536+
#
537+
PGAC_ARG_BOOL(with, libxml, no, [ --with-libxml build with XML support],
538+
[AC_DEFINE([USE_LIBXML], 1, [Define to 1 to build with XML support. (--with-libxml)])])
539+
540+
534541
#
535542
# Zlib
536543
#
@@ -716,6 +723,10 @@ if test "$with_pam" = yes ; then
716723
AC_CHECK_LIB(pam, pam_start, [], [AC_MSG_ERROR([library 'pam' is required for PAM])])
717724
fi
718725

726+
if test "$with_libxml" = yes ; then
727+
AC_CHECK_LIB(xml2, xmlInitParser, [], [AC_MSG_ERROR([library 'xml2' is required for XML support])])
728+
fi
729+
719730

720731
##
721732
## Header files
@@ -791,6 +802,10 @@ if test "$with_pam" = yes ; then
791802
[AC_MSG_ERROR([header file <security/pam_appl.h> or <pam/pam_appl.h> is required for PAM.])])])
792803
fi
793804

805+
if test "$with_libxml" = yes ; then
806+
AC_CHECK_HEADER(libxml/parser.h, [], [AC_MSG_ERROR([header file <libxml/parser.h> is required for XML support])])
807+
fi
808+
794809
if test "$with_ldap" = yes ; then
795810
if test "$PORTNAME" != "win32"; then
796811
AC_CHECK_HEADERS(ldap.h, [],

0 commit comments

Comments
 (0)