All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Roskin <proski@gnu.org>
To: Marco Costalba <mcostalba@gmail.com>
Cc: git@vger.kernel.org
Subject: [PATCH] Actually support embedded Qt, make configuration code more robust
Date: Fri, 26 May 2006 22:27:35 -0400	[thread overview]
Message-ID: <20060527022735.5879.58043.stgit@dv.roinet.com> (raw)

Add -DQWS and -fno-rtti flags for embedded Qt.

Don't add X11 flags for embedded Qt and threading specific flags for
non-multithreaded Qt.

Before checking for the Qt library, make sure it actually exists in the
Qt library path and not elsewhere.

Fix missing ";;" before "esac" (potentially non-portable).

Signed-off-by: Pavel Roskin <proski@gnu.org>

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 config/gwqt.m4 |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/config/gwqt.m4 b/config/gwqt.m4
index 78bed1d..cccccfe 100644
--- a/config/gwqt.m4
+++ b/config/gwqt.m4
@@ -91,17 +91,19 @@ fi
 
 # Checking for possible dependencies of the Qt library
 gwqt_save_LDFLAGS="$LDFLAGS"
-QT_LIBS="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
-AC_CHECK_LIB(pthread, pthread_exit, [QT_LIBS="-lpthread $QT_LIBS"])
+QT_LIBS_X="$X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+AC_CHECK_LIB(pthread, pthread_exit, [QT_LIBS_MT="-lpthread $QT_LIBS"])
 
 LDFLAGS="$LDFLAGS $X_LIBS"
-AC_CHECK_LIB(Xft, XftFontOpen, [QT_LIBS="-lXft $QT_LIBS"], , [$QT_LIBS])
+AC_CHECK_LIB(Xft, XftFontOpen, [QT_LIBS_X="-lXft $QT_LIBS_X"], , [$QT_LIBS_X])
 
 
 # Checking for the Qt library
 LDFLAGS="$LDFLAGS -L$QTLIBDIR"
 for i in qt-mt qt qte-mt qte qt-gl; do
-    AC_CHECK_LIB([$i], Get_Class, [qtlib="$i"; break], , [$QT_LIBS])
+    set X "$QTLIBDIR/lib$i."*
+    test "$[2]" = "$QTLIBDIR/lib$i.*" && continue
+    AC_CHECK_LIB([$i], main, [qtlib="$i"; break], , [$QT_LIBS_X $QT_LIBS_MT])
 done
 
 if test -z "$qtlib"; then
@@ -110,30 +112,40 @@ fi
 
 LDFLAGS="$gwqt_save_LDFLAGS"
 
-# Calculate QT_CPPFLAGS
+# Calculate QT_CPPFLAGS, QT_LDFLAGS and QT_LIBS
+QT_LIBS="-l$qtlib"
 case "$qtlib" in
-    *-mt) QT_CPPFLAGS="-D_REENTRANT -DQT_THREAD_SUPPORT";;
+    *-mt)
+	QT_CPPFLAGS="-D_REENTRANT -DQT_THREAD_SUPPORT"
+	QT_LIBS="$QT_LIBS $QT_LIBS_MT";;
 esac
 
+case "$qtlib" in
+    qte*)
+	QT_CPPFLAGS="-DQWS -fno-rtti";;
+    *)
+	QT_LIBS="$QT_LIBS $QT_LIBS_X"
+	QT_LDFLAGS="$X_LIBS";;
+esac
+
+# Add Qt include path
 if test "$QTINCDIR" != "/usr/include"; then
     QT_CPPFLAGS="-I$QTINCDIR $QT_CPPFLAGS"
 fi
-AC_MSG_NOTICE([QT_CPPFLAGS = $QT_CPPFLAGS])
-AC_SUBST(QT_CPPFLAGS)
 
-# Calculate QT_LDFLAGS
-QT_LDFLAGS="$X_LIBS"
+# Add Qt library path
 case "$QTLIBDIR" in
     /usr/lib) ;;
     /usr/lib64) ;;
     /usr/X11R6/lib) ;;
-    *) QT_LDFLAGS="$QT_LDFLAGS -L$QTLIBDIR";
+    *) QT_LDFLAGS="$QT_LDFLAGS -L$QTLIBDIR";;
 esac
+
+# Report the results
+AC_MSG_NOTICE([QT_CPPFLAGS = $QT_CPPFLAGS])
+AC_SUBST(QT_CPPFLAGS)
 AC_MSG_NOTICE([QT_LDFLAGS = $QT_LDFLAGS])
 AC_SUBST(QT_LDFLAGS)
-
-# Calculate QT_LIBS
-QT_LIBS="-l$qtlib $QT_LIBS"
 AC_MSG_NOTICE([QT_LIBS = $QT_LIBS])
 AC_SUBST(QT_LIBS)
 ])

             reply	other threads:[~2006-05-27  2:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-27  2:27 Pavel Roskin [this message]
2006-05-27  6:22 ` [PATCH] Actually support embedded Qt, make configuration code more robust Marco Costalba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060527022735.5879.58043.stgit@dv.roinet.com \
    --to=proski@gnu.org \
    --cc=git@vger.kernel.org \
    --cc=mcostalba@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.