[gtk+] Add --enable-gtk2-dependency option



commit 1cba79677cb8e9023a2a25568f6447bdc55747dc
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 14 20:01:05 2011 -0500

    Add --enable-gtk2-dependency option
    
    This can be used to suppress building of gtk-update-icon-cache
    in favor of using a preexisting version. Based on a patch by
    Colin Walters,
    https://bugzilla.gnome.org/show_bug.cgi?id=639471

 configure.ac                     |   11 ++++++++++-
 docs/reference/gtk/building.sgml |   18 ++++++++++++++++++
 gtk/Makefile.am                  |   14 +++++++++-----
 3 files changed, 37 insertions(+), 6 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index f81468f..d6bfe47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -242,6 +242,13 @@ AC_ARG_ENABLE(rebuilds,
                               [disable all source autogeneration rules])],,
               [enable_rebuilds=yes])
 
+AC_ARG_ENABLE(gtk2-dependency,
+              AC_HELP_STRING([--enable-gtk2-dependency],
+                             [Do not build gtk-update-icon-cache and other shared tools]),,
+              [enable_gtk2_dependency=no])
+
+AM_CONDITIONAL(BUILD_ICON_CACHE, [test "x$enable_gtk2_dependency" = xno])
+
 AC_ARG_ENABLE(xkb,
               [AC_HELP_STRING([--enable-xkb],
                               [support XKB extension [default=maybe]])],,
@@ -875,13 +882,15 @@ dnl Look for a host system's gdk-pixbuf-csource if we are cross-compiling
 
 AM_CONDITIONAL(CROSS_COMPILING, test $cross_compiling = yes)
 
-if test $cross_compiling = yes; then
+if test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes; then
   AC_PATH_PROG(GTK_UPDATE_ICON_CACHE, gtk-update-icon-cache, no)
   if test x$GTK_UPDATE_ICON_CACHE = xno; then
     REBUILD_PNGS=#
   fi
 fi
 
+AM_CONDITIONAL(USE_EXTERNAL_ICON_CACHE, [test "x$cross_compiling" = xyes || test "x$enable_gtk2_dependency" = xyes])
+
 AC_PATH_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, no)
 
 if test ! -f $srcdir/gtk/gtkbuiltincache.h &&
diff --git a/docs/reference/gtk/building.sgml b/docs/reference/gtk/building.sgml
index ac9e348..70802e5 100644
--- a/docs/reference/gtk/building.sgml
+++ b/docs/reference/gtk/building.sgml
@@ -363,6 +363,10 @@ How to compile GTK+ itself
           <group>
             <arg>--enable-introspection=[no/auto/yes]</arg>
           </group>
+          <group>
+            <arg>--enable-gtk2-dependency</arg>
+            <arg>--disable-gtk2-dependency</arg>
+          </group>
         </cmdsynopsis>
       </para>
 
@@ -559,6 +563,7 @@ How to compile GTK+ itself
           supported backends are the quartz backend for OS X.
         </para>
       </formalpara>
+
       <formalpara>
         <title><systemitem>--enable-introspection</systemitem></title>
 
@@ -567,6 +572,19 @@ How to compile GTK+ itself
           The default is 'auto'.
         </para>
       </formalpara>
+
+      <formalpara>
+        <title><systemitem>--enable-gtk2-dependency</systemitem> or
+           <systemitem>--disable-gtk2-dependency</systemitem></title>
+
+        <para>
+          Whether to rely on an exiting gtk-update-icon-cache utility
+          instead of building our own. Distributions which are shipping
+          both GTK+ 2.x and GTK+ 3 may want to use this option to
+          avoid file conflicts between these packages.
+          The default is to build gtk-update-icon-cache.
+        </para>
+      </formalpara>
     </refsect1>
 
 </refentry>
diff --git a/gtk/Makefile.am b/gtk/Makefile.am
index db679bb..0073917 100644
--- a/gtk/Makefile.am
+++ b/gtk/Makefile.am
@@ -1000,8 +1000,11 @@ endif
 # Installed tools
 #
 bin_PROGRAMS = \
-	gtk-query-immodules-3.0 \
-	gtk-update-icon-cache
+	gtk-query-immodules-3.0
+
+if BUILD_ICON_CACHE
+bin_PROGRAMS += gtk-update-icon-cache
+endif
 
 bin_SCRIPTS = gtk-builder-convert
 
@@ -1042,8 +1045,10 @@ gtk_query_immodules_3_0_DEPENDENCIES = $(DEPS)
 gtk_query_immodules_3_0_LDADD = $(LDADDS)
 gtk_query_immodules_3_0_SOURCES = queryimmodules.c
 
+if BUILD_ICON_CACHE
 gtk_update_icon_cache_LDADD = $(GDK_PIXBUF_LIBS)
 gtk_update_icon_cache_SOURCES = updateiconcache.c
+endif
 
 .PHONY: files test test-debug
 
@@ -1336,11 +1341,10 @@ stamp-icons: $(STOCK_ICONS)
 	) done 								\
 	&& touch stamp-icons
 
-if CROSS_COMPILING
+if USE_EXTERNAL_ICON_CACHE
 gtk_update_icon_cache_program = $(GTK_UPDATE_ICON_CACHE)
 else
-gtk_update_icon_cache_program =							\
-	   ./gtk-update-icon-cache
+gtk_update_icon_cache_program = ./gtk-update-icon-cache
 endif
 
 gtkbuiltincache.h: @REBUILD@ stamp-icons



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