Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


I've now got configure autodetecting Qt4, and created an "automagic"
patch. Things are still partly broken because to fix things properly I
need to get rid of OOO_WIDGET_FLAGS, and that's probably a big job ...

Anyways, the patch does the following:

Adds a new --enable-automagic option. As the help says, if enabled, the
default is to switch on everything it finds. If disabled it won't switch
anything on by default. But at present, the only thing it works on is
Qt4 and gtk2.

kde3 support is now disabled by default.

kde4 support is now autodetected, and enabled by default unless you
specify otherwise. Like gtk2, if you specify it and it isn't there, it
will give you an error (can someone test this, I've got kde4 on my
system so I haven't ... :-)

I said it's partly broken because of OOO_WIDGET_FLAGS - I know I've
added enable-automagic to LibreOfficeLinuxDevel.conf.in but it doesn't
do anything there because of OOO_WIDGET_FLAGS, you have to specify it on
the ./autogen.sh command line instead :-( So fixing that is on my todo
list ... :-)

But at least we can get rid of all that "you need
--enable/disable-kde/kde4" crap on the "how to build" and tell newbies
"just use --enable-automagic".

Has anybody still got a KDE3 system? Can you send me the relevant
pkg-config file from /usr/libX/pkgconfig/ so I can try and get that to
autodetect?

And does anybody just happen to know how important OOO_WIDGET_FLAGS is?
If I can just ditch it and move the autodetect stuff into
libreoffice.../configure.in, it'll make life much simpler ...

Cheers,
Wol
From 0ae67f8182f315976f1083eeddd983dd45d2ff19 Mon Sep 17 00:00:00 2001
From: Wol <anthony@youngman.org.uk>
Date: Mon, 1 Nov 2010 21:42:10 +0000
Subject: [PATCH] Create automagic option and apply it to gtk/kde toolkits

(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


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.