From b3edcbca480d3613edef8df300d68a94bec9f818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Tue, 20 Mar 2007 16:37:46 +0000 Subject: [PATCH] Do not check for and link against gnomeprint if gtkhtml uses gtkprint. If GtkHTML uses GtkPrint, reports and checks will use it, so GnomePrint is not needed. Also, remove some spurious GNOME_PRINT_{CFLAGS,LIBS} from Makefile.am files. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15742 57a11ea4-9604-0410-9ed3-97b8803252fd --- configure.in | 15 +++++++++------ src/business/business-gnome/Makefile.am | 1 - src/business/dialog-tax-table/Makefile.am | 1 - src/gnome-search/Makefile.am | 6 ++---- src/gnome-utils/Makefile.am | 13 +++++++++---- src/gnome-utils/gnc-html-graph-gog.c | 4 +++- src/gnome-utils/print-session.h | 4 ++++ src/gnome/Makefile.am | 1 - src/import-export/qif-import/Makefile.am | 1 - src/report/report-gnome/Makefile.am | 2 -- 10 files changed, 27 insertions(+), 21 deletions(-) diff --git a/configure.in b/configure.in index 51b3194b06..7126087757 100644 --- a/configure.in +++ b/configure.in @@ -1089,11 +1089,6 @@ then AC_SUBST(GDK_PIXBUF_CFLAGS) AC_SUBST(GDK_PIXBUF_LIBS) - PKG_CHECK_MODULES(GNOME_PRINT, libgnomeprint-2.2 libgnomeprintui-2.2) - AS_SCRUB_INCLUDE(GNOME_PRINT_CFLAGS) - AC_SUBST(GNOME_PRINT_CFLAGS) - AC_SUBST(GNOME_PRINT_LIBS) - PKG_CHECK_MODULES(GLADE, libglade-2.0 >= 2.4) AS_SCRUB_INCLUDE(GLADE_CFLAGS) AC_SUBST(GLADE_CFLAGS) @@ -1118,7 +1113,7 @@ then ]) CPPFLAGS="${saved_CPPFLAGS}" - # check for gtkhtml 3.x versions. + # check for gtkhtml >= 3.14 with gtkprint support gtkhtml=0 PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.14, [ if test "x$HAVE_GTK_2_10" != "xyes"; then @@ -1130,6 +1125,9 @@ then AC_DEFINE(GTKHTML_USES_GTKPRINT,1,[GtkHTML uses GtkPrint for printing operations]) fi ], [gtkhtml=0]) + AM_CONDITIONAL(GTKHTML_USES_GTKPRINT,test "x$gtkhtml" = "x1") + + # fallback to older gtkhtml versions and gnomeprint if test x$gtkhtml = x0 then PKG_CHECK_MODULES(GTKHTML, libgtkhtml-3.8 , [gtkhtml=1], [ @@ -1141,6 +1139,11 @@ then ]) ]) ]) + + PKG_CHECK_MODULES(GNOME_PRINT, libgnomeprint-2.2 libgnomeprintui-2.2) + AS_SCRUB_INCLUDE(GNOME_PRINT_CFLAGS) + AC_SUBST(GNOME_PRINT_CFLAGS) + AC_SUBST(GNOME_PRINT_LIBS) fi AS_SCRUB_INCLUDE(GTKHTML_CFLAGS) dnl if Mac OSX, also scrub /sw/include diff --git a/src/business/business-gnome/Makefile.am b/src/business/business-gnome/Makefile.am index f5a881584a..744a8f6a5b 100644 --- a/src/business/business-gnome/Makefile.am +++ b/src/business/business-gnome/Makefile.am @@ -16,7 +16,6 @@ AM_CFLAGS = \ -I${top_srcdir}/src/business/business-core \ -I${top_srcdir}/src/business/business-ledger \ -I${top_srcdir}/src/business/dialog-tax-table \ - ${GNOME_PRINT_CFLAGS} \ ${GNOME_CFLAGS} \ ${GLADE_CFLAGS} \ ${GTKHTML_CFLAGS} \ diff --git a/src/business/dialog-tax-table/Makefile.am b/src/business/dialog-tax-table/Makefile.am index 3cf8da4797..9b2e82ce6f 100644 --- a/src/business/dialog-tax-table/Makefile.am +++ b/src/business/dialog-tax-table/Makefile.am @@ -8,7 +8,6 @@ AM_CFLAGS = \ -I${top_srcdir}/src/gnome-utils \ -I${top_srcdir}/src/app-utils \ -I${top_srcdir}/src/business/business-core \ - ${GNOME_PRINT_CFLAGS} \ ${GNOME_CFLAGS} \ ${GLADE_CFLAGS} \ ${GTKHTML_CFLAGS} \ diff --git a/src/gnome-search/Makefile.am b/src/gnome-search/Makefile.am index e70ea43f64..7866c49488 100644 --- a/src/gnome-search/Makefile.am +++ b/src/gnome-search/Makefile.am @@ -14,8 +14,7 @@ AM_CFLAGS = \ ${GLADE_CFLAGS} \ ${GNOME_CFLAGS} \ ${GLIB_CFLAGS} \ - ${QOF_CFLAGS} \ - ${GNOME_PRINT_CFLAGS} + ${QOF_CFLAGS} libgncmod_gnome_search_la_SOURCES = \ gncmod-gnome-search.c \ @@ -62,8 +61,7 @@ libgncmod_gnome_search_la_LIBADD = \ ${GLADE_LIBS} \ ${GLIB_LIBS} \ ${REGEX_LIBS} \ - ${QOF_LIBS} \ - ${GNOME_PRINT_LIBS} + ${QOF_LIBS} gladedir = $(GNC_GLADE_DIR) glade_DATA = \ diff --git a/src/gnome-utils/Makefile.am b/src/gnome-utils/Makefile.am index 340f197a82..ae6fd0a7d2 100644 --- a/src/gnome-utils/Makefile.am +++ b/src/gnome-utils/Makefile.am @@ -16,7 +16,6 @@ AM_CFLAGS = \ ${GLIB_CFLAGS} \ ${GLADE_CFLAGS} \ ${GTK_CFLAGS} \ - ${GNOME_PRINT_CFLAGS} \ ${GNOME_CFLAGS} \ ${GTKHTML_CFLAGS} \ ${GUILE_INCS} \ @@ -90,7 +89,6 @@ libgncmod_gnome_utils_la_SOURCES = \ gnc-window.c \ gncmod-gnome-utils.c \ misc-gnome-utils.c \ - print-session.c \ search-param.c \ gnc-dialog.c \ swig-gnome-utils.c \ @@ -181,7 +179,6 @@ libgncmod_gnome_utils_la_LIBADD = \ ${top_builddir}/src/app-utils/libgncmod-app-utils.la \ $(top_builddir)/lib/libc/libc-missing.la \ ${GNOME_LIBS} \ - ${GNOME_PRINT_LIBS} \ ${GTKHTML_LIBS} \ ${GUILE_LIBS} \ ${GDK_PIXBUF_LIBS} \ @@ -195,7 +192,7 @@ libgncmod_gnome_utils_la_LIBADD = \ ${LIBXML2_LIBS} if BUILDING_FROM_SVN -swig-gnome-utils.c: gnome-utils.i gnc-html.h print-session.h \ +swig-gnome-utils.c: gnome-utils.i gnc-html.h \ ${top_srcdir}/src/base-typemaps.i $(SWIG) -guile $(SWIG_ARGS) -Linkage module \ -I${top_srcdir}/src -o $@ $< @@ -213,6 +210,14 @@ EXTRA_DIST = \ ${gncmod_DATA} \ ${gncscm_DATA} +if GTKHTML_USES_GTKPRINT + EXTRA_DIST += print-session.c +else + AM_CFLAGS += ${GNOME_PRINT_CFLAGS} + libgncmod_gnome_utils_la_LIBADD += ${GNOME_PRINT_LIBS} \ + libgncmod_gnome_utils_la_SOURCES += print-session.c +endif + ## We borrow guile's convention and use @-...-@ as the substitution ## brackets here, instead of the usual @...@. This prevents autoconf ## from substituting the values directly into the left-hand sides of diff --git a/src/gnome-utils/gnc-html-graph-gog.c b/src/gnome-utils/gnc-html-graph-gog.c index 6516654d2e..10a5d3f5a0 100644 --- a/src/gnome-utils/gnc-html-graph-gog.c +++ b/src/gnome-utils/gnc-html-graph-gog.c @@ -40,7 +40,9 @@ #else # include #endif -#include +#ifndef GTKHTML_USES_GTKPRINT +# include +#endif #include #include #include diff --git a/src/gnome-utils/print-session.h b/src/gnome-utils/print-session.h index c3afd0da30..bbd6f4f68e 100644 --- a/src/gnome-utils/print-session.h +++ b/src/gnome-utils/print-session.h @@ -24,6 +24,8 @@ #ifndef PRINT_SESSION_H #define PRINT_SESSION_H +#ifndef GTKHTML_USES_GTKPRINT + /** @addtogroup Printing @{ */ /** @file print-session.h @@ -85,4 +87,6 @@ void gnc_print_session_done(PrintSession * ps); /** @} */ /** @} */ +#endif /* GTKHTML_USES_GTKPRINT */ + #endif diff --git a/src/gnome/Makefile.am b/src/gnome/Makefile.am index 68906c41a8..e39897e5e6 100644 --- a/src/gnome/Makefile.am +++ b/src/gnome/Makefile.am @@ -118,7 +118,6 @@ AM_CFLAGS = \ -I${top_srcdir}/lib/libc \ ${GUILE_INCS} \ ${GNOME_CFLAGS} \ - ${GNOME_PRINT_CFLAGS} \ ${GDK_PIXBUF_CFLAGS} \ ${GTKHTML_CFLAGS} \ ${GLADE_CFLAGS} \ diff --git a/src/import-export/qif-import/Makefile.am b/src/import-export/qif-import/Makefile.am index 430e35c5e9..8df0d1d9c1 100644 --- a/src/import-export/qif-import/Makefile.am +++ b/src/import-export/qif-import/Makefile.am @@ -64,7 +64,6 @@ AM_CFLAGS = \ ${GUILE_INCS} \ ${GLIB_CFLAGS} \ ${GLADE_CFLAGS} \ - ${GNOME_PRINT_CFLAGS} \ ${GNOME_CFLAGS} \ ${GDK_PIXBUF_CFLAGS} \ ${QOF_CFLAGS} \ diff --git a/src/report/report-gnome/Makefile.am b/src/report/report-gnome/Makefile.am index d4223ead41..bc5e60a3ff 100644 --- a/src/report/report-gnome/Makefile.am +++ b/src/report/report-gnome/Makefile.am @@ -15,7 +15,6 @@ AM_CFLAGS = \ ${GLADE_CFLAGS} \ ${GUILE_INCS} \ ${GTKHTML_CFLAGS} \ - ${GNOME_PRINT_CFLAGS} \ ${GNOME_CFLAGS} \ ${QOF_CFLAGS} \ ${GLIB_CFLAGS} @@ -45,7 +44,6 @@ libgncmod_report_gnome_la_LIBADD = \ ${top_builddir}/src/report/report-system/libgncmod-report-system.la \ ${GLADE_LIBS} \ ${GUILE_LIBS} \ - ${GNOME_PRINT_LIBS} \ ${GNOME_LIBS} \ ${QOF_LIBS} \ ${GLIB_LIBS}