[vlc-commits] commit: Really check if Qt4 needs -lX11 ( Rémi Denis-Courmont )

git at videolan.org git at videolan.org
Wed Jul 21 20:52:56 CEST 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jul 21 21:52:45 2010 +0300| [bdb9f0c0e3a25f78e5affbc61f4198a8e25e2ed1] | committer: Rémi Denis-Courmont 

Really check if Qt4 needs -lX11

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bdb9f0c0e3a25f78e5affbc61f4198a8e25e2ed1
---

 configure.ac |   32 ++++++++++++++++++++++++++------
 1 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9a0f37f..35c7a7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3885,14 +3885,34 @@ AC_ARG_ENABLE(qt4,
 AS_IF([test "${enable_qt4}" != "no"], [
   PKG_CHECK_MODULES(QT4, [QtCore QtGui >= 4.4.0], [
     VLC_ADD_PLUGIN([qt4])
+    VLC_ADD_LIBS([qt4],[${QT4_LIBS}])
+    VLC_ADD_CXXFLAGS([qt4],[${QT4_CFLAGS}])
     ALIASES="${ALIASES} qvlc"
-    AS_IF([test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce" -a "${SYS}" != "darwin"], [
-        VLC_ADD_LIBS([qt4],[$QT4_LIBS ${X_LIBS} ${X_PRE_LIBS} -lX11])
-        need_xid_provider="no"
-        VLC_ADD_CXXFLAGS([qt4],[$QT4_CFLAGS ${X_CFLAGS}])
+
+    AC_LANG_PUSH([C++])
+    CPPFLAGS_save="${CXXFLAGS}"
+
+    AC_MSG_CHECKING([whether Qt uses X11])
+    CPPFLAGS="${CXXFLAGS} ${QT4_CFLAGS}"
+    AC_PREPROC_IFELSE([
+#include <QWidget>
+#if !defined (Q_WS_X11)
+# error Fail
+#endif
+    ], [
+      AC_MSG_RESULT([yes])
+      VLC_ADD_LIBS([qt4],[${X_LIBS} ${X_PRE_LIBS} -lX11])
+      need_xid_provider="no"
+      VLC_ADD_CXXFLAGS([qt4],[${X_CFLAGS}])
     ], [
-        VLC_ADD_LIBS([qt4],[$QT4_LIBS -lole32])
-        VLC_ADD_CXXFLAGS([qt4],[$QT4_CFLAGS])
+      AC_MSG_RESULT([no])
+    ])
+
+    CPPFLAGS="${CPPFLAGS_save}"
+    AC_LANG_POP([C++])
+
+    AS_IF([test "${SYS}" = "mingw32" -o "${SYS}" = "mingwce"], [
+        VLC_ADD_LIBS([qt4],[-lole32])
     ])
     AC_PATH_PROGS(MOC, [moc-qt4 moc], moc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)
     AC_PATH_PROG(RCC, rcc, rcc,`eval $PKG_CONFIG --variable=exec_prefix QtCore`/bin)



More information about the vlc-commits mailing list