[PATCH] Create automagic option and apply it to gtk/kde toolkits

Wol anthony at youngman.org.uk
Mon Nov 1 14:42:10 PDT 2010


(a) create the --enable-automagic option
(b) disable qt3 by default
(c) autodetect qt4 and enable it by default if present
---
 configure.in                                 |   49 +++++++++++++++++++-------
 distro-configs/LibreOfficeLinuxDevel.conf.in |    3 +-
 2 files changed, 37 insertions(+), 15 deletions(-)

diff --git a/configure.in b/configure.in
index 29f245f..0d5d9e6 100755
--- a/configure.in
+++ b/configure.in
@@ -25,6 +25,13 @@ AC_ARG_ENABLE(access,
   --disable-access        Disable the Access import pieces.],
 ,)
 
+AC_ARG_ENABLE(automagic,
+[
+  --enable-automagic	  Tells autoconf to include by default any discovered
+			  dependencies. If disabled, tells autoconf to include
+			  only specifically requested dependencies],
+,)
+
 AC_ARG_ENABLE(binfilter,
 [
   --enable-binfilter      Enable legacy binary file formats filters this makes
@@ -854,8 +861,14 @@ AC_SUBST(OOOP_SAMPLES_PACK)
 AC_SUBST(OOOP_TEMPLATES_PACK)
 
 AC_MSG_CHECKING([for widget sets])
+# [FIXME] - test for qt3
+# is qt4 available?
+PKG_CHECK_MODULES( [FOO_QT4], [QtCore], have_qt4=true, have_qt4=false)
+
 OOO_WIDGET_FLAGS=
-if test "$enable_kde" != "no"; then
+# if test "$enable_kde" != "no"; then
+# only enable kde3 if it is explicitly asked for, seeing as modern distros don't have it. [FIXME] if we can auto-test.
+if test "$enable_kde" = "yes"; then
     if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" != "zCrossWin32"; then
         OOO_WIDGET_FLAGS="--enable-kde"
         widget_sets="kde"
@@ -864,24 +877,34 @@ else
     OOO_WIDGET_FLAGS="--disable-kde"
 fi
 
-if test "$enable_kde4" != "no"; then
-    if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" != "zCrossWin32"; then
-        OOO_WIDGET_FLAGS="$OOO_WIDGET_FLAGS --enable-kde4"
-        widget_sets="$widget_sets kde4"
+if test "$enable_kde4" != "no" -a "$enable_automagic" != "no"; then
+# the combination yes/false in the next line will cause a deliberate crash ...
+    if test "$enable_kde4" = "yes" -o "$have_qt4" = "true"; then
+	if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" != "zCrossWin32"; then
+	    OOO_WIDGET_FLAGS="$OOO_WIDGET_FLAGS --enable-kde4"
+	    widget_sets="$widget_sets kde4"
+
+	    if ! $have_qt4; then
+		AC_MSG_ERROR([Qt4 library requirements were not met])
+	    fi
+	fi
     fi
 else
     OOO_WIDGET_FLAGS="$OOO_WIDGET_FLAGS --disable-kde4"
 fi
 
-if test "$enable_gtk" != "no"; then
-    if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" != "zCrossWin32"; then
-        OOO_WIDGET_FLAGS="--enable-gtk $OOO_WIDGET_FLAGS"
-        widget_sets="gtk $widget_sets"
+if test "$enable_gtk" != "no" -a "$enable_automagic" != "no"; then
+    PKG_CHECK_MODULES( FOO_GTK, [ gtk+-2.0 ],
+	have_gtk=true, have_gtk=false )
+
+    if test "$enable_gtk" = "yes" -o "$have_gtk" = "true"; then
+	if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin" -a "z$with_distro" != "zCrossWin32"; then
+	    OOO_WIDGET_FLAGS="--enable-gtk $OOO_WIDGET_FLAGS"
+	    widget_sets="gtk $widget_sets"
 
-        PKG_CHECK_MODULES( FOO_GTK, [ gtk+-2.0 ],
-            have_gtk=true, have_gtk=false )
-        if ! $have_gtk; then
-            AC_MSG_ERROR([Gtk+ library requirements were not met])
+	    if ! $have_gtk; then
+		AC_MSG_ERROR([Gtk+ library requirements were not met])
+	    fi
         fi
     fi
 else
diff --git a/distro-configs/LibreOfficeLinuxDevel.conf.in b/distro-configs/LibreOfficeLinuxDevel.conf.in
index 58b9e8d..c83d126 100644
--- a/distro-configs/LibreOfficeLinuxDevel.conf.in
+++ b/distro-configs/LibreOfficeLinuxDevel.conf.in
@@ -1,6 +1,6 @@
 --with-vendor=\"The Document Foundation\"
+--enable-automagic
 --disable-dbus
---enable-kde4
 --enable-cairo
 --without-system-cairo
 --enable-gstreamer
@@ -13,7 +13,6 @@
 --with-java-target-version=1.5
 --with-jdk-home=$JAVA_HOME
 --without-myspell-dicts
---disable-kde
 --without-system-mozilla
 --without-system-jpeg
 --without-system-libxml
-- 
1.7.2.2


--------------070205070400090302030507--


More information about the LibreOffice mailing list