pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rpl_gethostname


From: Ben Pfaff
Subject: Re: rpl_gethostname
Date: Wed, 10 Feb 2010 20:48:26 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Michel Boaventura <address@hidden> writes:

> Now it is complaining about missing libxml:
>
> src/output/odt.c:23:30: error: libxml/xmlwriter.h: File not found
>
> I think we should put libxml as a obligatory dependency, or
> disable odt output if configure do not find it.

You are right.  I was not aware of that dependency.

Please try the following patch.  Does it solve the problem?

commit 065c966829cbd3dade49372a07e2445fff46ea65
Author: Ben Pfaff <address@hidden>
Date:   Wed Feb 10 20:43:10 2010 -0800

    Build the ODT driver only if libxml2 is available.
    
    Reported by Michel Boaventura <address@hidden>.

diff --git a/INSTALL b/INSTALL
index 0f4f5c9..f391f56 100644
--- a/INSTALL
+++ b/INSTALL
@@ -66,6 +66,11 @@ Gnumeric files.
 
     * libxml2 (http://xmlsoft.org/).  
 
+Installing the following packages will allow your PSPP binary to write
+OpenDocument text (ODT) files:
+
+    * libxml2 (http://xmlsoft.org/).  
+
 The following packages are optional.
 
     * libncurses (http://www.gnu.org/software/ncurses/).  Without it,
diff --git a/README b/README
index e54877a..d1c78db 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@ is a free replacement for the proprietary program SPSS.
 PSPP development is ongoing. It already supports a large subset of
 SPSS's syntax.  Its statistical procedure support is currently
 limited, but growing.  At your option, PSPP will produce statistical
-reports in ASCII, PostScript, PDF, HTML, or SVG formats. 
+reports in ASCII, PostScript, PDF, HTML, SVG, or OpenDocument formats. 
 
 Instructions for PSPP installation are in INSTALL, including a list of
 prerequisite packages and other PSPP-specific information.  Full
diff --git a/configure.ac b/configure.ac
index e5eb13a..675a620 100644
--- a/configure.ac
+++ b/configure.ac
@@ -126,18 +126,43 @@ if test x"$with_libpq" != x"no" ; then
 fi
 AM_CONDITIONAL(PSQL_SUPPORT, test -n "$PG_CONFIG")
 
-dnl Checks needed for Gnumeric reader
-gnm_support=yes;
-PKG_CHECK_MODULES(LIBXML2, libxml-2.0,,
-                          [PSPP_OPTIONAL_PREREQ([libxml2]); gnm_support=no;]);
-AC_SEARCH_LIBS(gzopen,z,,[PSPP_OPTIONAL_PREREQ([zlib]); gnm_support=no;])
-AC_CHECK_HEADERS(zlib.h,,[PSPP_OPTIONAL_PREREQ([zlib]); gnm_support=no;])
-
-if test x"$gnm_support" = x"yes" ; then 
-   AC_DEFINE([GNM_SUPPORT], 1,
-   [Define to 1 if building in support for reading Gnumeric files.])
+dnl Check for libxml2
+PKG_CHECK_MODULES(
+  [LIBXML2], [libxml-2.0], 
+  [HAVE_LIBXML2=yes],
+  [HAVE_LIBXML2=no
+   PSPP_OPTIONAL_PREREQ([libxml2])])
+
+dnl Check for zlib.
+AC_SEARCH_LIBS(
+  [gzopen], [z],
+  [HAVE_ZLIB=yes],
+  [HAVE_ZLIB=no
+   PSPP_OPTIONAL_PREREQ([zlib])])
+AC_CHECK_HEADERS(
+  [zlib.h], 
+  [],
+  [HAVE_ZLIB=no
+   PSPP_OPTIONAL_PREREQ([zlib])])
+
+dnl Gnumeric support requires libxml2 and zlib.
+if test $HAVE_LIBXML2 = yes && test $HAVE_ZLIB = yes; then
+  GNM_SUPPORT=yes
+  AC_DEFINE(
+    [GNM_SUPPORT], [1],
+    [Define to 1 if building in support for reading Gnumeric files.])
+else
+  GNM_SUPPORT=no
 fi
-AM_CONDITIONAL(GNM_SUPPORT, test x"$gnm_support" = x"yes")
+AM_CONDITIONAL([GNM_SUPPORT], [test $GNM_SUPPORT = yes])
+
+dnl ODT support requires libxml2.
+if test $HAVE_LIBXML2 = yes; then
+  AC_DEFINE(
+    [ODT_SUPPORT], [1],
+    [Define to 1 if building in support for writing ODT files.])
+fi
+AM_CONDITIONAL([ODT_SUPPORT], [test $HAVE_LIBXML2 = yes])
 
 AC_ARG_WITH(
   gui_tools,
diff --git a/doc/invoking.texi b/doc/invoking.texi
index 86ddc31..830d176 100644
--- a/doc/invoking.texi
+++ b/doc/invoking.texi
@@ -360,6 +360,9 @@ To produce output as an OpenDocument text (ODT) document, 
specify
 @option{-o @var{file}} on the PSPP command line.  If @var{file} does
 not end in @file{.odt}, you must also specify @option{-O format=odt}.
 
+ODT support is only available if your installation of PSPP was
+compiled with the libxml2 library.
+
 The OpenDocument output format does not have any configurable options.
 
 @node Comma-Separated Value Output Options
diff --git a/src/output/automake.mk b/src/output/automake.mk
index 259f3b0..e5781b0 100644
--- a/src/output/automake.mk
+++ b/src/output/automake.mk
@@ -34,7 +34,6 @@ src_output_liboutput_la_SOURCES = \
        src/output/message-item.h \
        src/output/msglog.c \
        src/output/msglog.h \
-       src/output/odt.c \
        src/output/options.c \
        src/output/options.h \
        src/output/output-item-provider.h \
@@ -68,5 +67,8 @@ src_output_liboutput_la_SOURCES += \
        src/output/charts/roc-chart-cairo.c \
        src/output/charts/scree-cairo.c
 endif
+if ODT_SUPPORT
+src_output_liboutput_la_SOURCES += src/output/odt.c
+endif
 
 EXTRA_DIST += src/output/OChangeLog
diff --git a/src/output/driver.c b/src/output/driver.c
index 2036445..6d83635 100644
--- a/src/output/driver.c
+++ b/src/output/driver.c
@@ -246,8 +246,10 @@ output_driver_track_current_command (const struct 
output_item *output_item,
 extern const struct output_driver_factory txt_driver_factory;
 extern const struct output_driver_factory list_driver_factory;
 extern const struct output_driver_factory html_driver_factory;
-extern const struct output_driver_factory odt_driver_factory;
 extern const struct output_driver_factory csv_driver_factory;
+#ifdef ODT_SUPPORT
+extern const struct output_driver_factory odt_driver_factory;
+#endif
 #ifdef HAVE_CAIRO
 extern const struct output_driver_factory pdf_driver_factory;
 extern const struct output_driver_factory ps_driver_factory;
@@ -259,8 +261,10 @@ static const struct output_driver_factory *factories[] =
     &txt_driver_factory,
     &list_driver_factory,
     &html_driver_factory,
-    &odt_driver_factory,
     &csv_driver_factory,
+#ifdef ODT_SUPPORT
+    &odt_driver_factory,
+#endif
 #ifdef HAVE_CAIRO
     &pdf_driver_factory,
     &ps_driver_factory,

-- 
Ben Pfaff 
http://benpfaff.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]