classpath-patches
[Top][All Lists]
Advanced

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

Re: [cp-patches] Make qt-peers build and run out of the box


From: Mark Wielaard
Subject: Re: [cp-patches] Make qt-peers build and run out of the box
Date: Wed, 24 Aug 2005 00:53:46 +0200

Hi,

On Tue, 2005-08-23 at 20:17 +0200, Mark Wielaard wrote:
> With the latest fixes from Sven and the following patch I am able to
> compile and run the qt-peers out of the box using ./configure
> --with-qt-peer and using -Dawt.toolkit=gnu.java.awt.peer.qt.QtToolkit
> Screenshots at: http://gnu.wildebeest.org/diary/index.php?p=108
> 
> We really need Qt 4.0.1 so this updates the requirement.
> The qt-peer/Makefile.am was also updated to not need any hacking of the
> include paths (this didn't work reliably if the path included multiple
> include directories, like with the default Debian install) and to use
> the general AM_LDFLAGS and AM_CXXFLAGS (important since the
> CLASSPATH_MODULE flags depend on the architecture/os, or Darwin is
> weird). To make this all work out of the box a small include cleanup
> patch was also needed.

After a short discussion on irc people seemed to assume that the .pc
$includedir given by pkg-config was in error. So I changed the patch a
little bit and included a simple autoconf check to make sure we always
get the include dirs in QT_CFLAGS right (in case the $includedir in
the .pc file gets "fixed" in a later release).

2005-08-23  Mark Wielaard  <address@hidden>

       * configure.ac: Check for QtGui >= 4.0.1. Check for and
       add extra include dirs ($includedir/Qt) to QT_CFLAGS.
       * native/jni/qt-peer/.cvsignore: Add slotcallbacks.moc.h.
       * native/jni/qt-peer/Makefile.am (QT_CXXFLAGS): Removed.
       (libqtpeer_la_CXXFLAGS): Removed.
       (libqtpeer_la_LDFLAGS): Removed.
       (AM_LDFLAGS): Set to @CLASSPATH_MODULE@ @address@hidden
       (AM_CXXFLAGS): Set to @address@hidden
       * native/jni/qt-peer/.cvsignore: Add slotcallbacks.moc.h.

With this no "cleanup" of the #include statements in the .cpp files is
necessary anymore. It seems to work fine for everything I throw at it.

OK to commit?

Cheers,

Mark
Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.101
diff -u -r1.101 configure.ac
--- configure.ac        23 Aug 2005 13:50:57 -0000      1.101
+++ configure.ac        23 Aug 2005 22:21:35 -0000
@@ -297,7 +297,17 @@
 
   dnl Check for AWT related Qt4
   if test "x${COMPILE_QT_PEER}" = xyes; then
-    PKG_CHECK_MODULES(QT, QtGui >= 4.0)
+    PKG_CHECK_MODULES(QT, QtGui >= 4.0.1)
+    dnl Check needed because in some cases the QtGui includedir
+    dnl doesn't contain the subsystem dir.
+    QT_INCLUDE_DIR=$($PKG_CONFIG --variable=includedir QtGui)
+    EXTRA_QT_INCLUDE_DIR="$QT_INCLUDE_DIR/Qt"
+    AC_CHECK_FILE([$QT_INCLUDE_DIR/QWidget],
+                 AC_MSG_NOTICE([No extra QT_INCLUDE_DIR needed]),
+                 AC_CHECK_FILE([$EXTRA_QT_INCLUDE_DIR/QWidget],
+                       QT_CFLAGS="$QT_CFLAGS -I$EXTRA_QT_INCLUDE_DIR",
+                       AC_MSG_WARN([QWidget not found])))
+    AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
     AC_CHECK_PROG(MOC, [moc], [moc])
     AC_SUBST(QT_CFLAGS)
     AC_SUBST(QT_LIBS)
Index: native/jni/qt-peer/.cvsignore
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/qt-peer/.cvsignore,v
retrieving revision 1.1
diff -u -r1.1 .cvsignore
--- native/jni/qt-peer/.cvsignore       17 Aug 2005 10:50:33 -0000      1.1
+++ native/jni/qt-peer/.cvsignore       23 Aug 2005 22:21:35 -0000
@@ -6,3 +6,4 @@
 .deps
 Makefile
 Makefile.in
+slotcallbacks.moc.h
Index: native/jni/qt-peer/Makefile.am
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/qt-peer/Makefile.am,v
retrieving revision 1.3
diff -u -r1.3 Makefile.am
--- native/jni/qt-peer/Makefile.am      20 Aug 2005 15:45:53 -0000      1.3
+++ native/jni/qt-peer/Makefile.am      23 Aug 2005 22:21:35 -0000
@@ -3,19 +3,10 @@
 
 pkglib_LTLIBRARIES = libqtpeer.la
 
-QT_CXXFLAGS=`echo $(QT_CFLAGS) | sed 's/include/include\/Qt/'`
-
+AM_LDFLAGS = @CLASSPATH_MODULE@ @QT_LIBS@
 AM_CPPFLAGS = @CLASSPATH_INCLUDES@
 
-libqtpeer_la_CXXFLAGS = \
-       $(QT_CFLAGS) \
-       $(QT_CXXFLAGS)
-
-libqtpeer_la_LDFLAGS = \
-       $(QT_LIBS) \
-       -no-undefined \
-       -module \
-       -release $(PACKAGE_VERSION)
+AM_CXXFLAGS = @QT_CFLAGS@
 
 libqtpeer_la_MOC = \
        slotcallbacks.moc.h

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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