From 27ad3b868c215970bb89f79bccbdd86708762001 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 19 Jan 2008 17:14:56 +0000 Subject: [PATCH] some qt4 changes for Linux (not yet working) --- configure.in | 71 +++++++++++++++++++++++++--------- linux/Makefile.am | 85 ++++++++++++----------------------------- src/audiomixerboard.h | 12 +++--- src/channel.h | 4 +- src/client.h | 10 ++--- src/clientsettingsdlg.h | 22 +++++------ src/global.h | 6 +-- src/llconclientdlg.h | 22 +++++------ src/llconserverdlg.h | 14 +++---- src/multicolorled.h | 6 +-- src/protocol.h | 6 +-- src/server.h | 9 ++--- src/settings.h | 4 +- src/socket.h | 8 ++-- src/util.h | 12 +++--- 15 files changed, 145 insertions(+), 146 deletions(-) diff --git a/configure.in b/configure.in index 23df1a58..42fad4a0 100755 --- a/configure.in +++ b/configure.in @@ -21,8 +21,7 @@ dnl Configuration Arguments AC_ARG_ENABLE( sound,[ --enable-sound generic sound support], enable_sound=$enableval, enable_sound=yes) -AC_ARG_WITH( qtdir,[ --with-qtdir=path to QT],QTDIR=$withval) - +AC_ARG_WITH( qt4dir,[ --with-qtdir=path to QT],QT4DIR=$withval) AC_CHECK_HEADER(sys/asoundlib.h, , enable_sound=no) @@ -45,25 +44,63 @@ dnl Checks for some external libraries that need to be installed AC_LANG(C++) -dnl QT -------------------------------------------------------------------------- -if test "no$QTDIR" = "no"; then - AC_MSG_ERROR( "*** Please set QTDIR ***" ) +dnl QT4 ------------------------------------------------------------------------- +dnl The QT4 check code was taken from the FreeMat-3.0 code by Samit Basu +PKG_CHECK_MODULES(QT, QtCore QtGui QtNetwork >= 4.0.1, HAVE_QT4="yes", HAVE_QT4="no") +foo=`echo $QT_LIBS | sed -e 's/-L/-Wl,-rpath,/g'` +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_PROGS(QT_MOC, [moc4 moc-qt4 moc], []) + AC_CHECK_PROGS(QT_RCC, [rcc4 rcc-qt4 rcc], []) + AC_CHECK_PROGS(QT_UIC, [uic4 uic-qt4 uic], []) + if (test "$QT_MOC" = ""); then + AC_MSG_ERROR([QT4 moc is required.]) + fi + if (test "$QT_RCC" = ""); then + AC_MSG_ERROR([QT4 rcc is required.]) + fi + if (test "$QT_UIC" = ""); then + AC_MSG_ERROR([QT4 uic is required.]) + fi fi +FOO=`echo $QT_LIBS | sed -e 's/-L/-Wl,-rpath,/' | sed -e 's/-L.*//'` +LDFLAGS="$LDFLAGS $FOO" -saved_ldflags="$LDFLAGS" -LDFLAGS="$LDFLAGS -L$QTDIR/lib" +AC_MSG_NOTICE([Set QT_CFLAGS... $QT_CFLAGS]) +AC_SUBST(QT_CFLAGS) +AC_SUBST(QT_LIBS) +AC_SUBST(QT_MOC) +AC_SUBST(QT_RCC) +AC_SUBST(QT_UIC) -AC_HAVE_LIBRARY(qt-mt,,exit 1) +dnl old QT2/QT3 code: +dnl if test "no$QTDIR" = "no"; then +dnl AC_MSG_ERROR( "*** Please set QTDIR ***" ) +dnl fi +dnl +dnl saved_ldflags="$LDFLAGS" +dnl LDFLAGS="$LDFLAGS -L$QTDIR/lib" +dnl +dnl AC_HAVE_LIBRARY(qt-mt,,exit 1) +dnl +dnl AC_PATH_PROG(MOC, moc,, "$QTDIR/bin") +dnl if test -z "$MOC"; then +dnl AC_MSG_ERROR("No moc found in $QTDIR/bin"); +dnl fi +dnl AC_PATH_PROG(UIC, uic,, "$QTDIR/bin") +dnl if test -z "$UIC"; then +dnl AC_MSG_ERROR("No uic found in $QTDIR/bin"); +dnl fi +dnl AC_SUBST(QTDIR) -AC_PATH_PROG(MOC, moc,, "$QTDIR/bin") -if test -z "$MOC"; then - AC_MSG_ERROR("No moc found in $QTDIR/bin"); -fi -AC_PATH_PROG(UIC, uic,, "$QTDIR/bin") -if test -z "$UIC"; then - AC_MSG_ERROR("No uic found in $QTDIR/bin"); -fi -AC_SUBST(QTDIR) AC_CONFIG_FILES(Makefile linux/Makefile) diff --git a/linux/Makefile.am b/linux/Makefile.am index ae9e4d28..5a2d6c2b 100755 --- a/linux/Makefile.am +++ b/linux/Makefile.am @@ -35,10 +35,10 @@ llcon_SOURCES = ../src/buffer.cpp \ ../src/llconserverdlg.h \ ../src/llconclientdlg.h \ ../src/clientsettingsdlg.h \ - ../src/llconclientdlgbase.ui \ - ../src/llconserverdlgbase.ui \ - ../src/clientsettingsdlgbase.ui \ - ../src/aboutdlgbase.ui \ + ../src/llconclientdlg.ui \ + ../src/llconserverdlg.ui \ + ../src/clientsettingsdlg.ui \ + ../src/aboutdlg.ui \ sound.h # these need to be generated before the rest can be compiled @@ -51,10 +51,10 @@ BUILT_SOURCES=moc/moc_server.cpp \ moc/moc_multicolorled.cpp \ moc/moc_audiomixerboard.cpp \ moc/moc_util.cpp \ - moc/moc_llconclientdlg.cpp moc/moc_llconclientdlgbase.cpp moc/llconclientdlgbase.h moc/llconclientdlgbase.cpp \ - moc/moc_clientsettingsdlg.cpp moc/moc_clientsettingsdlgbase.cpp moc/clientsettingsdlgbase.h moc/clientsettingsdlgbase.cpp \ - moc/moc_llconserverdlg.cpp moc/moc_llconserverdlgbase.cpp moc/llconserverdlgbase.h moc/llconserverdlgbase.cpp \ - moc/moc_aboutdlgbase.cpp moc/aboutdlgbase.h moc/aboutdlgbase.cpp + moc/moc_llconclientdlg.h \ + moc/moc_clientsettingsdlg.h \ + moc/moc_llconserverdlg.h \ + moc/moc_aboutdlg.h # and should be cleaned by make clean @@ -65,78 +65,41 @@ dist-hook: mkdir $(distdir)/moc moc/moc_server.cpp: ../src/server.h - $(MOC) ../src/server.h -o moc/moc_server.cpp + $(QT_MOC) ../src/server.h -o moc/moc_server.cpp moc/moc_client.cpp: ../src/client.h - $(MOC) ../src/client.h -o moc/moc_client.cpp + $(QT_MOC) ../src/client.h -o moc/moc_client.cpp moc/moc_socket.cpp: ../src/socket.h - $(MOC) ../src/socket.h -o moc/moc_socket.cpp + $(QT_MOC) ../src/socket.h -o moc/moc_socket.cpp moc/moc_multicolorled.cpp: ../src/multicolorled.h - $(MOC) ../src/multicolorled.h -o moc/moc_multicolorled.cpp + $(QT_MOC) ../src/multicolorled.h -o moc/moc_multicolorled.cpp moc/moc_audiomixerboard.cpp: ../src/audiomixerboard.h - $(MOC) ../src/audiomixerboard.h -o moc/moc_audiomixerboard.cpp + $(QT_MOC) ../src/audiomixerboard.h -o moc/moc_audiomixerboard.cpp moc/moc_util.cpp: ../src/util.h - $(MOC) ../src/util.h -o moc/moc_util.cpp + $(QT_MOC) ../src/util.h -o moc/moc_util.cpp moc/moc_protocol.cpp: ../src/protocol.h - $(MOC) ../src/protocol.h -o moc/moc_protocol.cpp + $(QT_MOC) ../src/protocol.h -o moc/moc_protocol.cpp moc/moc_channel.cpp: ../src/channel.h - $(MOC) ../src/channel.h -o moc/moc_channel.cpp + $(QT_MOC) ../src/channel.h -o moc/moc_channel.cpp -moc/moc_aboutdlgbase.cpp: moc/aboutdlgbase.h - $(MOC) moc/aboutdlgbase.h -o moc/moc_aboutdlgbase.cpp +moc/moc_aboutdlg.h: ../src/aboutdlg.ui + $(QT_UIC) ../src/aboutdlg.ui -o moc/aboutdlg.h -moc/aboutdlgbase.h: ../src/aboutdlgbase.ui - $(UIC) ../src/aboutdlgbase.ui -o moc/aboutdlgbase.h +moc/moc_llconclientdlg.h: ../src/llconclientdlg.ui + $(QT_UIC) ../src/llconclientdlg.ui -o moc/llconclientdlg.h -moc/aboutdlgbase.cpp: ../src/aboutdlgbase.ui moc/aboutdlgbase.h - $(UIC) ../src/aboutdlgbase.ui -i moc/aboutdlgbase.h -o moc/aboutdlgbase.cpp - - -moc/moc_llconclientdlg.cpp: ../src/llconclientdlg.h - $(MOC) ../src/llconclientdlg.h -o moc/moc_llconclientdlg.cpp - -moc/moc_llconclientdlgbase.cpp: moc/llconclientdlgbase.h - $(MOC) moc/llconclientdlgbase.h -o moc/moc_llconclientdlgbase.cpp - -moc/llconclientdlgbase.h: ../src/llconclientdlgbase.ui - $(UIC) ../src/llconclientdlgbase.ui -o moc/llconclientdlgbase.h - -moc/llconclientdlgbase.cpp: ../src/llconclientdlgbase.ui moc/llconclientdlgbase.h - $(UIC) ../src/llconclientdlgbase.ui -i moc/llconclientdlgbase.h -o moc/llconclientdlgbase.cpp - - -moc/moc_clientsettingsdlg.cpp: ../src/clientsettingsdlg.h - $(MOC) ../src/clientsettingsdlg.h -o moc/moc_clientsettingsdlg.cpp - -moc/moc_clientsettingsdlgbase.cpp: moc/clientsettingsdlgbase.h - $(MOC) moc/clientsettingsdlgbase.h -o moc/moc_clientsettingsdlgbase.cpp - -moc/clientsettingsdlgbase.h: ../src/clientsettingsdlgbase.ui - $(UIC) ../src/clientsettingsdlgbase.ui -o moc/clientsettingsdlgbase.h - -moc/clientsettingsdlgbase.cpp: ../src/clientsettingsdlgbase.ui moc/clientsettingsdlgbase.h - $(UIC) ../src/clientsettingsdlgbase.ui -i moc/clientsettingsdlgbase.h -o moc/clientsettingsdlgbase.cpp - - -moc/moc_llconserverdlg.cpp: ../src/llconserverdlg.h - $(MOC) ../src/llconserverdlg.h -o moc/moc_llconserverdlg.cpp - -moc/moc_llconserverdlgbase.cpp: moc/llconserverdlgbase.h - $(MOC) moc/llconserverdlgbase.h -o moc/moc_llconserverdlgbase.cpp - -moc/llconserverdlgbase.h: ../src/llconserverdlgbase.ui - $(UIC) ../src/llconserverdlgbase.ui -o moc/llconserverdlgbase.h - -moc/llconserverdlgbase.cpp: ../src/llconserverdlgbase.ui moc/llconserverdlgbase.h - $(UIC) ../src/llconserverdlgbase.ui -i moc/llconserverdlgbase.h -o moc/llconserverdlgbase.cpp +moc/moc_clientsettingsdlg.h: ../src/clientsettingsdlg.ui + $(QT_UIC) ../src/clientsettingsdlg.ui -o moc/clientsettingsdlg.h +moc/moc_llconserverdlg.h: ../src/llconserverdlg.ui + $(QT_UIC) ../src/llconserverdlg.ui -o moc/llconserverdlg.h llcon_CXXFLAGS=$(QWTINCL) -I../src -I$(QTDIR)/include -DQT_THREAD_SUPPORT -D_REENTRANT -g diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h index 6bd3a004..913aea03 100755 --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -28,12 +28,12 @@ #if !defined ( MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_ ) #define MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "global.h" #include "util.h" diff --git a/src/channel.h b/src/channel.h index 31181af4..cd58a25d 100755 --- a/src/channel.h +++ b/src/channel.h @@ -25,8 +25,8 @@ #if !defined ( CHANNEL_HOIH9345KJH98_3_4344_BB23945IUHF1912__INCLUDED_ ) #define CHANNEL_HOIH9345KJH98_3_4344_BB23945IUHF1912__INCLUDED_ -#include -#include +#include +#include #include "global.h" #include "buffer.h" #include "audiocompr.h" diff --git a/src/client.h b/src/client.h index b7564c7f..44af2916 100755 --- a/src/client.h +++ b/src/client.h @@ -25,11 +25,11 @@ #if !defined ( CLIENT_HOIHGE76GEKJH98_3_43445KJIUHF1912__INCLUDED_ ) #define CLIENT_HOIHGE76GEKJH98_3_43445KJIUHF1912__INCLUDED_ -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include "global.h" #include "socket.h" #include "resample.h" diff --git a/src/clientsettingsdlg.h b/src/clientsettingsdlg.h index 255c633c..35f202f6 100755 --- a/src/clientsettingsdlg.h +++ b/src/clientsettingsdlg.h @@ -22,17 +22,17 @@ * \******************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "global.h" #include "client.h" #include "multicolorled.h" diff --git a/src/global.h b/src/global.h index 2a4867df..f7e0b902 100755 --- a/src/global.h +++ b/src/global.h @@ -25,12 +25,12 @@ #if !defined ( GLOBAL_H__3B123453_4344_BB2B_23E7A0D31912__INCLUDED_ ) #define GLOBAL_H__3B123453_4344_BB2B_23E7A0D31912__INCLUDED_ +#include +#include +#include #include #include #include -#include -#include -#include #ifdef HAVE_CONFIG_H # include "config.h" #endif diff --git a/src/llconclientdlg.h b/src/llconclientdlg.h index 11d037b8..0d452d72 100755 --- a/src/llconclientdlg.h +++ b/src/llconclientdlg.h @@ -22,17 +22,17 @@ * \******************************************************************************/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "global.h" #include "client.h" #include "multicolorled.h" diff --git a/src/llconserverdlg.h b/src/llconserverdlg.h index 73aec7d0..451e2313 100755 --- a/src/llconserverdlg.h +++ b/src/llconserverdlg.h @@ -22,14 +22,14 @@ * \******************************************************************************/ -#include +#include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "global.h" #include "server.h" #include "multicolorled.h" diff --git a/src/multicolorled.h b/src/multicolorled.h index 4efb02a6..dca6c775 100755 --- a/src/multicolorled.h +++ b/src/multicolorled.h @@ -33,9 +33,9 @@ #if !defined ( AFX_MULTCOLORLED_H__FD6B49B5_87DF_48DD_A873_804E1606C2AC__INCLUDED_ ) #define AFX_MULTCOLORLED_H__FD6B49B5_87DF_48DD_A873_804E1606C2AC__INCLUDED_ -#include -#include -#include +#include +#include +#include #include #include #include "global.h" diff --git a/src/protocol.h b/src/protocol.h index 522cd1d7..c02eafa2 100755 --- a/src/protocol.h +++ b/src/protocol.h @@ -25,9 +25,9 @@ #if !defined ( PROTOCOL_H__3B123453_4344_BB2392354455IUHF1912__INCLUDED_ ) #define PROTOCOL_H__3B123453_4344_BB2392354455IUHF1912__INCLUDED_ -#include -#include -#include +#include +#include +#include #include #include "global.h" #include "util.h" diff --git a/src/server.h b/src/server.h index 56ec98a0..a99d84fa 100755 --- a/src/server.h +++ b/src/server.h @@ -25,11 +25,10 @@ #if !defined ( SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_ ) #define SERVER_HOIHGE7LOKIH83JH8_3_43445KJIUHF1912__INCLUDED_ -#include -#include -#include -#include -#include +#include +#include +#include +#include #include "global.h" #include "socket.h" #include "channel.h" diff --git a/src/settings.h b/src/settings.h index f670fd68..1ffe1612 100755 --- a/src/settings.h +++ b/src/settings.h @@ -25,11 +25,11 @@ #if !defined ( SETTINGS_H__3B0BA660_DGEG56G456G9876D31912__INCLUDED_ ) #define SETTINGS_H__3B0BA660_DGEG56G456G9876D31912__INCLUDED_ -#include "global.h" -#include "client.h" #include #include #include +#include "global.h" +#include "client.h" /* Definitions ****************************************************************/ diff --git a/src/socket.h b/src/socket.h index 5bb0cc70..f0b1acdf 100755 --- a/src/socket.h +++ b/src/socket.h @@ -25,11 +25,11 @@ #if !defined ( SOCKET_HOIHGE76GEKJH98_3_4344_BB23945IUHF1912__INCLUDED_ ) #define SOCKET_HOIHGE76GEKJH98_3_4344_BB23945IUHF1912__INCLUDED_ +#include +#include +#include +#include #include -#include -#include -#include -#include #include "global.h" #include "channel.h" #include "util.h" diff --git a/src/util.h b/src/util.h index c10ad847..08821b75 100755 --- a/src/util.h +++ b/src/util.h @@ -25,12 +25,12 @@ #if !defined ( UTIL_HOIH934256GEKJH98_3_43445KJIUHF1912__INCLUDED_ ) #define UTIL_HOIH934256GEKJH98_3_43445KJIUHF1912__INCLUDED_ -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include "global.h" using namespace std; // because of the library: "vector"