view README.Qt41 @ 190:61681a2bc1e6

keep MIN and MAX compatibility (VC and linux compilation)
author lbajardsilogic
date Tue, 27 Nov 2007 13:26:04 +0000
parents 00b5875d8c30
children
line wrap: on
line source

Building Sound Access using Qt 4.0 or 4.1
=============================================

The Sound Access source code should build fine using Qt versions
4.0, 4.1 or 4.2.

However, TrollTech introduced an incompatible change to the handling
of quoted text in version 4.2 of the qmake utility, that makes it
impossible for us to provide build scripts that will work with both
older and newer versions.

The provided scripts are for Qt 4.2.  If you try to build using Qt 4.0
or 4.1, you will get errors like these:

main/MainWindow.cpp:3737: error: parse error before `:' token
main/MainWindow.cpp:3737:66: invalid suffix "M" on integer constant
main/MainWindow.cpp:3761:95: too many decimal points in number

To fix this, you will need to patch the file sv.prf in this directory.
The easiest way to do that if you have a suitable patch utility to
hand, is to feed this file (README.Qt41) directly into patch, like this:

  patch < README.Qt41

If that succeeds, it will modify the file "sv.prf" from a Qt 4.2
compatible format into one that is compatible with Qt 4.0 and 4.1.

If you want to apply the patch some other way, here it is, in unified
diff format:

--- sv.prf	2006-11-10 11:08:04.000000000 +0000
+++ sv.prf.qt41	2006-11-10 11:08:31.000000000 +0000
@@ -83,9 +83,9 @@
             system(pkg-config --exists $$PKG) {
                 VERSION = $$system(pkg-config --modversion $$PKG)
                 PACKAGE_SYMBOL = $$system(echo $$PKG | tr '[a-z-]' '[A-Z_]')
-                VERSION_SYMBOL = $$PACKAGE_SYMBOL'_VERSION'
+                VERSION_SYMBOL = $$system(echo $$PKG"_VERSION" | tr '[a-z-]' '[A-Z_]')
                 DEFINES += HAVE_$$PACKAGE_SYMBOL
-                QMAKE_CXXFLAGS += -D"'"$$VERSION_SYMBOL='"'$$VERSION'"'"'"
+                QMAKE_CXXFLAGS += -D'$$VERSION_SYMBOL="$$VERSION"'
                 QMAKE_CXXFLAGS +=  $$system(pkg-config --cflags $$PKG)
                 LIBS += $$system(pkg-config --libs $$PKG)
                 message("Using pkg-config package $$PKG with version $$VERSION")
@@ -142,7 +142,7 @@
 contains(SV_UNIT_PACKAGES, sndfile):!contains(DEFINES, HAVE_SNDFILE):error("sndfile library required")
 contains(SV_UNIT_PACKAGES, samplerate):!contains(DEFINES, HAVE_SAMPLERATE):error("libsamplerate required")
 
-VERSION_CFLAGS += -D"'"SVNREV='"'$$system(svnversion -n .)'"'"'"
+VERSION_CFLAGS += -D'SVNREV="$$system(svnversion -n .)"'
 
 QMAKE_CXXFLAGS_DEBUG += -DBUILD_DEBUG $$VERSION_CFLAGS
 QMAKE_CXXFLAGS_RELEASE += -DBUILD_RELEASE $$VERSION_CFLAGS