[cc'ing [EMAIL PROTECTED] for general configure questions]
Eric Hoch wrote:
Am Thu, 24 Jan 2008 11:25:10 +0100 schrieb Stephan Bergmann:
Then, there should be no reason to use OOo's private copy of
libxml from module libxml2, right? Then, we should change
config_office/configure to make --with-system-libxml at least the
default on Mac OS X, and at best (and if possible) remove that
switch (and its negation --without-system-libxml) completely for
Mac OS X, right?
Yes.
I tried to use --with-system-libxml with OOH680_m4 and I get:
checking for pkg-config... /opt/local/bin/pkg-config
checking for libxslt ... Package libxslt was not found in the
pkg-config search path. Perhaps you should add the directory
containing `libxslt.pc' to the PKG_CONFIG_PATH environment variable
No package 'libxslt' found
configure: error: Library requirements (libxslt ) not met; consider
adjusting the PKG_CONFIG_PATH environment variable if your
libraries are in a nonstandard prefix so pkg-config can find them.
The thing is I cannot find any libxslt.pc on my Mac.
In addition pkgconfig is needed if I use --with-system-libxml.
This is Mac OS X 10.5.1 on a Mac Intel Mini.
I think this is a deficiency of our config_office/configure.in:1.237.
When using --with-system-libxml or --with-system-libxslt (where the
former also implies the latter, anyway), configure checks for pkg-config
to get suitable values for LIBXML_CFLAGS, LIBXML_LIBS, LIBXSLT_CFLAGS,
LIBXSLT_LIBS. However, at least on Mac, there appear to always (at
least when Xcode is installed) be /usr/bin/xml2-config and
/usr/bin/xslt-config that could be called instead of pkg-config. (I
think those two executables are standard parts of the libxml2 and
libxslt packages, but I might be wrong.)
Using the general pkg-config instead of (or before) the specific
xml2|xslt-config has at least two problems:
For one, as Eric observed, it needlessly makes pkg-config a prerequisite
on Mac.
For another, it introduces a subtle problem in combination with building
moz via MacPorts: moz has as prerequisites gtk2 and libidl, which can
be satisfied by installing those two via MacPorts (which in turn also
installs MacPorts pkg-config, and many others, including libxml2 and
libxslt) and setting PATH to find MacPorts pkg-config in
/opt/local/bin/pkg-config when building OOo. Now, as MacPorts comes
with its own versions of libxml2 and libxslt, even though the system
already has (different versions of) them, pkg-config will use the
MacPorts versions, so that the resulting OOo installation set will link
against the libraries from /opt/local/lib, and not work properly when
copied to a machine that does not have those MacPorts packages installed.
Both problems can be worked around by changing configure to use
xml2|xslt-config instead of pkg-config (or resorting to the latter if
the former is not available or does not work). I used a crude patch to
verify this (see below), but I would be happy if somebody with deeper
knowledge of autoconf (Rene?) turned this into a clean patch.
-Stephan
Index: config_office/configure
===================================================================
RCS file: /cvs/tools/config_office/configure,v
retrieving revision 1.211
diff -U 8 -p -r1.211 configure
--- config_office/configure 13 Dec 2007 12:48:20 -0000 1.211
+++ config_office/configure 27 Jan 2008 20:56:44 -0000
@@ -13758,16 +13758,23 @@ if test -n "$with_system_libxslt" -o -n
test "$with_system_libxslt" != "no"; then
{ echo "$as_me:$LINENO: result: external" >&5
echo "${ECHO_T}external" >&6; }
SYSTEM_LIBXSLT=YES
succeeded=no
+#TODO:
+if test "$_os" = "Darwin"; then
+ LIBXSLT_CFLAGS=`/usr/bin/xslt-config --cflags`
+ LIBXSLT_LIBS=`/usr/bin/xslt-config --libs`
+ succeeded=yes
+else
+#:TODO
if test -z "$PKG_CONFIG"; then
# Extract the first word of "pkg-config", so it can be a program
name with args.
set dummy pkg-config; 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_path_PKG_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -13845,16 +13852,19 @@ echo "${ECHO_T}$LIBXSLT_LIBS" >&6; }
else
echo "*** Your version of pkg-config is too old. You need
version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
fi
fi
+#TODO:
+fi
+#:TODO
if test $succeeded = yes; then
:
else
{ { echo "$as_me:$LINENO: error: Library requirements (libxslt )
not met; consider adjusting the PKG_CONFIG_PATH environment variable if
your libraries are in a nonstandard prefix so pkg-config can find them." >&5
echo "$as_me: error: Library requirements (libxslt ) not met; consider
adjusting the PKG_CONFIG_PATH environment variable if your libraries are
in a nonstandard prefix so pkg-config can find them." >&2;}
{ (exit 1); exit 1; }; }
fi
@@ -13922,16 +13932,23 @@ echo $ECHO_N "checking which libxml to u
if test -n "$with_system_libxml" -o -n "$with_system_libs" && \
test "$with_system_libxml" != "no"; then
{ echo "$as_me:$LINENO: result: external" >&5
echo "${ECHO_T}external" >&6; }
SYSTEM_LIBXML=YES
succeeded=no
+#TODO:
+if test "$_os" = "Darwin"; then
+ LIBXML_CFLAGS=`/usr/bin/xml2-config --cflags`
+ LIBXML_LIBS=`/usr/bin/xml2-config --libs`
+ succeeded=yes
+else
+#:TODO
if test -z "$PKG_CONFIG"; then
# Extract the first word of "pkg-config", so it can be a program
name with args.
set dummy pkg-config; 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_path_PKG_CONFIG+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -14009,16 +14026,19 @@ echo "${ECHO_T}$LIBXML_LIBS" >&6; }
else
echo "*** Your version of pkg-config is too old. You need
version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
fi
fi
+#TODO:
+fi
+#:TODO
if test $succeeded = yes; then
:
else
{ { echo "$as_me:$LINENO: error: Library requirements (libxml-2.0
>= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment
variable if your libraries are in a nonstandard prefix so pkg-config can
find them." >&5
echo "$as_me: error: Library requirements (libxml-2.0 >= 2.0 ) not
met; consider adjusting the PKG_CONFIG_PATH environment variable if your
libraries are in a nonstandard prefix so pkg-config can find them." >&2;}
{ (exit 1); exit 1; }; }
fi
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]