classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] QT4 configury bits for OS-X


From: Andreas Tobler
Subject: [cp-patches] QT4 configury bits for OS-X
Date: Tue, 27 Sep 2005 20:57:02 +0200
User-agent: Mozilla Thunderbird 1.0.5 (Macintosh/20050711)

Hello all,

this patch is mainly for me :) I'm tired of hand editing the configure after an autogen.sh run. So I tried to put in the needed bits for OS-X. The Qt4 build for OS-X does not use pkg-config stuff so I have to pass the directory where it is installed.
Also, the flags are quite different from what other systems use.

I tested this patch on ppclinux, sparc solaris10 and ppc-darwin8.2 with positive and negative configs. I hope I catched all.

Comments welcome.

Andreas

2005-09-27  Andreas Tobler  <address@hidden>

        * configure.ac: Add Qt4 configury bits for OS-X.
Index: configure.ac
===================================================================
RCS file: /cvsroot/classpath/classpath/configure.ac,v
retrieving revision 1.108
diff -u -r1.108 configure.ac
--- configure.ac        17 Sep 2005 21:19:35 -0000      1.108
+++ configure.ac        27 Sep 2005 18:43:33 -0000
@@ -297,21 +297,52 @@
 
   dnl Check for AWT related Qt4
   if test "x${COMPILE_QT_PEER}" = xyes; then
-    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)
+    PKG_CHECK_MODULES(QT, QtGui >= 4.0.1, HAVE_QT4="yes", HAVE_QT4="no")
+    if test "x$HAVE_QT4" = "xyes"; then
+      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_CHECK_PROG(MOC, [moc], [moc])
+    fi
+  if test "x$HAVE_QT4" = "xno"; then
+    AC_MSG_NOTICE([Looking for QT_CFLAGS and QT_LIBS without pkg-config])
+    case "$host_os" in
+      darwin*)
+       AC_ARG_WITH([qtdir],
+         [AS_HELP_STRING([--with-qtdir=DIR],
+         [Qt4 installation directory used for OS-X.
+         For other systems use pkg-config.])],
+         [QT4DIR=$withval]
+         )
+       if test x"$QT4DIR" = x ; then
+         AC_MSG_ERROR([*** No path for Qt4 --with-qtdir option given])
+       fi
+       AC_MSG_RESULT([QT4DIR... $QT4DIR])
+       AC_CHECK_PROG(MOC, [moc], [$QT4DIR/bin/moc], [], $QT4DIR/bin)
+       if test x"$MOC" = x; then
+         AC_MSG_ERROR([*** This is not the right Qt installation])
+       fi
+       QT_CFLAGS="-F$QT4DIR/lib -I$QT4DIR/lib/QtCore.framework/Headers"
+       QT_CFLAGS="$QT_CFLAGS -I$QT4DIR/lib/QtGui.framework/Headers"
+       QT_LIBS="-Xlinker -F$QT4DIR/lib -Xlinker -framework -Xlinker QtCore"
+       QT_LIBS="$QT_LIBS -Xlinker -framework -Xlinker QtGui"
+       ;;
+      *)
+       AC_MSG_ERROR([*** Please check PKG_CONFIG_PATH or the version
+       of your installed Qt4 installation.])
+       ;;
+    esac
   fi
+  AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS])
+  AC_SUBST(QT_CFLAGS)
+  AC_SUBST(QT_LIBS)
+fi
 
   if test "x${enable_gtk_cairo}" = xyes; then
     PKG_CHECK_MODULES(CAIRO, cairo >= 0.5.0)

reply via email to

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