diff options
author | Thomas Zander <t.zander@nokia.com> | 2010-09-28 11:44:45 (GMT) |
---|---|---|
committer | Thomas Zander <t.zander@nokia.com> | 2010-09-28 11:44:45 (GMT) |
commit | 5c08412285f14d89174aef1190a1de1c35fd62bd (patch) | |
tree | 2e9bef2fdf0af18db76b011cd9c4ed4b456f507c /qmake | |
parent | 2645784f05db7b1e631621c511e94c88fc5cd211 (diff) | |
parent | 2868302626b8a31f44df1068514485a89ec27171 (diff) | |
download | Qt-5c08412285f14d89174aef1190a1de1c35fd62bd.zip Qt-5c08412285f14d89174aef1190a1de1c35fd62bd.tar.gz Qt-5c08412285f14d89174aef1190a1de1c35fd62bd.tar.bz2 |
Merge commit 'origin/master' into fileEnginesOn47
Conflicts:
qmake/Makefile.win32
qmake/qmake.pri
src/corelib/io/qdir.cpp
src/corelib/io/qfileinfo.cpp
src/corelib/io/qfileinfo_p.h
src/corelib/io/qfsfileengine_win.cpp
src/s60installs/bwins/QtGuiu.def
src/s60installs/eabi/QtCoreu.def
src/s60installs/eabi/QtGuiu.def
src/tools/bootstrap/bootstrap.pro
tests/auto/qfileinfo/tst_qfileinfo.cpp
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/Makefile.unix | 2 | ||||
-rw-r--r-- | qmake/Makefile.win32 | 377 | ||||
-rw-r--r-- | qmake/Makefile.win32-g++ | 4 | ||||
-rw-r--r-- | qmake/Makefile.win32-g++-sh | 4 | ||||
-rw-r--r-- | qmake/generators/makefile.cpp | 46 | ||||
-rw-r--r-- | qmake/generators/symbian/initprojectdeploy_symbian.cpp | 6 | ||||
-rw-r--r-- | qmake/generators/symbian/symbiancommon.cpp | 268 | ||||
-rw-r--r-- | qmake/generators/symbian/symbiancommon.h | 11 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake.cpp | 23 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_sbsv2.cpp | 391 | ||||
-rw-r--r-- | qmake/generators/symbian/symmake_sbsv2.h | 15 | ||||
-rw-r--r-- | qmake/generators/unix/unixmake.cpp | 51 | ||||
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 5 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_objectmodel.cpp | 3 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 6 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 14 | ||||
-rw-r--r-- | qmake/qmake.pri | 3 |
17 files changed, 637 insertions, 592 deletions
diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 5ea023f..f03b300 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -75,7 +75,7 @@ CPPFLAGS = -I. -Igenerators -Igenerators/unix -Igenerators/win32 -Igenerators/ma -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL \ -DQT_NO_COMPRESS -I$(QMAKESPEC) -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT \ - -DQT_NO_GEOM_VARIANT $(OPENSOURCE_CXXFLAGS) + -DQT_NO_GEOM_VARIANT -DQT_NO_DEPRECATED $(OPENSOURCE_CXXFLAGS) CXXFLAGS = @QMAKE_CXXFLAGS@ $(CPPFLAGS) diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 906d284..9b86215 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -23,11 +23,14 @@ LINK = link # specific stuff for VS2005 # !if "$(QMAKESPEC)" == "win32-msvc2005" -CFLAGS = /Zc:wchar_t- +CFLAGS_EXTRA = /Zc:wchar_t- +!elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" +CFLAGS_EXTRA = /MP !endif -CFLAGS = -c -Fo$@ \ +CFLAGS_BARE = -c -Fo./ \ -W3 -nologo -O2 \ + $(CFLAGS_EXTRA) \ -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian \ -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \ -I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \ @@ -37,38 +40,19 @@ CFLAGS = -c -Fo$@ \ -I$(SOURCE_PATH)\tools\shared \ -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL \ -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD \ - -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_NO_PCRE -DQT_BOOTSTRAPPED \ - $(CFLAGS) -CXXFLAGS = $(CFLAGS) + -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_NO_PCRE -DQT_BOOTSTRAPPED +CFLAGS = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS) + +CXXFLAGS_BARE = $(CFLAGS_BARE) +CXXFLAGS = $(CFLAGS) + LFLAGS = LIBS = ole32.lib advapi32.lib LINKQMAKE = $(LINK) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS) ADDCLEAN = vc60.pdb vc70.pdb qmake.pdb qmake.ilk -!ELSE -# -# specific stuff for Borland make -# -!if !$d(BCB) -BCB = $(MAKEDIR)\.. -!endif -CXX = bcc32 -CFLAGS = -c -o$@ \ - -tWR -w -w-hid -w-use -O1 \ - -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian \ - -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \ - -I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \ - -I$(BUILD_PATH)\src\corelib\global \ - -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ - -I$(SOURCE_PATH)\tools\shared \ - -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL \ - -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD \ - -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -CXXFLAGS = $(CFLAGS) -LFLAGS = -L$(BCB)\lib -c -x -Gn -ap -Tpe c0x32.obj -LIBS = import32.lib cw32i.lib -LINKQMAKE = ilink32 $(LFLAGS) $(OBJS) $(QTOBJS), qmake.exe,,$(LIBS) -ADDCLEAN = qmake.tds +!ELSE +!ERROR Unsupported compiler for this Makefile !ENDIF #qmake code @@ -104,6 +88,8 @@ QTOBJS= \ qtemporaryfile.obj \ qabstractfileengine.obj \ qfsfileengine_win.obj \ + qsystemlibrary.obj \ + qfsfileengine_iterator_win.obj \ qfileinfo.obj \ qglobal.obj \ qhash.obj \ @@ -136,84 +122,15 @@ QTOBJS= \ first all: qmake.exe qmake.exe: $(OBJS) $(QTOBJS) - $(LINKQMAKE) + $(LINKQMAKE) qmake_pch.obj -copy qmake.exe $(BUILD_PATH)\bin\qmake.exe clean:: - -del qbitarray.obj - -del qbuffer.obj - -del qcryptographichash.obj - -del qlinkedlist.obj - -del qfilesystementry.obj - -del qfilesystemengine.obj - -del qfilesystemengine_win.obj - -del qfilesystemiterator_win.obj - -del qfsfileengine.obj - -del qfsfileengine_iterator.obj - -del qbytearray.obj - -del qvsnprintf.obj - -del qbytearraymatcher.obj - -del qdatetime.obj - -del qdir.obj - -del qdiriterator.obj - -del qfile.obj - -del qtemporaryfile.obj - -del qabstractfileengine.obj - -del qfsfileengine_win.obj - -del qfileinfo.obj - -del qglobal.obj - -del qhash.obj - -del qiodevice.obj - -del qlist.obj - -del qlocale.obj - -del qmalloc.obj - -del qmap.obj - -del qregexp.obj - -del qtextcodec.obj - -del qutfcodec.obj - -del qstring.obj - -del qstringlist.obj - -del qtextstream.obj - -del qdatastream.obj - -del quuid.obj - -del qvector.obj - -del qsettings.obj - -del qlibraryinfo.obj - -del qvariant.obj - -del qurl.obj - -del qsettings_win.obj - -del qmetatype.obj - -del project.obj - -del main.obj - -del makefile.obj - -del unixmake.obj - -del unixmake2.obj - -del mingw_make.obj - -del option.obj - -del winmakefile.obj - -del projectgenerator.obj - -del property.obj - -del meta.obj - -del makefiledeps.obj - -del metamakefile.obj - -del xmloutput.obj - -del borland_bmake.obj - -del msvc_nmake.obj - -del msvc_vcproj.obj - -del msvc_vcxproj.obj - -del msvc_objectmodel.obj - -del msbuild_objectmodel.obj - -del symmake.obj - -del symmake_abld.obj - -del symmake_sbsv2.obj - -del symbiancommon.obj - -del initprojectdeploy_symbian.obj - -del registry.obj - -del epocroot.obj - -del pbuilder_pbx.obj - -del qxmlstream.obj - -del qxmlutils.obj - -del qnumeric.obj + -del $(QTOBJS) + -del $(OBJS) + -del qmake_pch.obj + -del qmake_pch.pch + -del qsystemlibrary.obj -del vc60.pdb -del vc70.pdb -del qmake.pdb @@ -235,236 +152,60 @@ distclean:: clean .cxx.obj: $(CXX) $(CXXFLAGS) $< -qsettings_win.obj: $(SOURCE_PATH)\src\corelib\io\qsettings_win.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qsettings_win.cpp - -qsettings.obj: $(SOURCE_PATH)\src\corelib\io\qsettings.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qsettings.cpp - -qlibraryinfo.obj: $(SOURCE_PATH)\src\corelib\global\qlibraryinfo.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\global\qlibraryinfo.cpp - -qnumeric.obj: $(SOURCE_PATH)\src\corelib\global\qnumeric.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\global\qnumeric.cpp - -qvariant.obj: $(SOURCE_PATH)\src\corelib\kernel\qvariant.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\kernel\qvariant.cpp - -qurl.obj: $(SOURCE_PATH)\src\corelib\io\qurl.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qurl.cpp - -qtextstream.obj: $(SOURCE_PATH)\src\corelib\io\qtextstream.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qtextstream.cpp - -qdatastream.obj: $(SOURCE_PATH)\src\corelib\io\qdatastream.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qdatastream.cpp - -qiodevice.obj: $(SOURCE_PATH)\src\corelib\io\qiodevice.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qiodevice.cpp - -qmalloc.obj: $(SOURCE_PATH)\src\corelib\global\qmalloc.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\global\qmalloc.cpp - -qglobal.obj: $(SOURCE_PATH)\src\corelib\global\qglobal.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\global\qglobal.cpp - -qhash.obj: $(SOURCE_PATH)\src\corelib\tools\qhash.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qhash.cpp - -qbytearray.obj: $(SOURCE_PATH)\src\corelib\tools\qbytearray.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qbytearray.cpp - -qcryptographichash.obj: $(SOURCE_PATH)\src\corelib\tools\qcryptographichash.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qcryptographichash.cpp - -qvsnprintf.obj: $(SOURCE_PATH)\src\corelib\tools\qvsnprintf.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qvsnprintf.cpp - -qbytearraymatcher.obj: $(SOURCE_PATH)\src\corelib\tools\qbytearraymatcher.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qbytearraymatcher.cpp - -qchar.obj: $(SOURCE_PATH)\src\corelib\tools\qchar.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qchar.cpp - -qutfcodec.obj: $(SOURCE_PATH)\src\corelib\codecs\qutfcodec.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\codecs\qutfcodec.cpp - -qstring.obj: $(SOURCE_PATH)\src\corelib\tools\qstring.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qstring.cpp - -qstringmatcher.obj: $(SOURCE_PATH)\src\corelib\tools\qstringmatcher.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qstringmatcher.cpp - -qlocale.obj: $(SOURCE_PATH)\src\corelib\tools\qlocale.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qlocale.cpp - -quuid.obj: $(SOURCE_PATH)\src\corelib\plugin\quuid.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\plugin\quuid.cpp - -qbuffer.obj: $(SOURCE_PATH)\src\corelib\io\qbuffer.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qbuffer.cpp - -qlist.obj: $(SOURCE_PATH)\src\corelib\tools\qlist.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qlist.cpp - -qlinkedlist.obj: $(SOURCE_PATH)\src\corelib\tools\qlinkedlist.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qlinkedlist.cpp - -qfile.obj: $(SOURCE_PATH)\src\corelib\io\qfile.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfile.cpp - -qtemporaryfile.obj: $(SOURCE_PATH)\src\corelib\io\qtemporaryfile.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qtemporaryfile.cpp - -qfilesystementry.obj: $(SOURCE_PATH)\src\corelib\io\qfilesystementry.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfilesystementry.cpp - -qfilesystemengine.obj: $(SOURCE_PATH)\src\corelib\io\qfilesystemengine.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfilesystemengine.cpp - -qfilesystemengine_win.obj: $(SOURCE_PATH)\src\corelib\io\qfilesystemengine_win.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfilesystemengine_win.cpp - -qfilesystemiterator_win.obj: $(SOURCE_PATH)\src\corelib\io\qfilesystemiterator_win.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfilesystemiterator_win.cpp - -qfsfileengine_win.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine_win.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfsfileengine_win.cpp - -qfsfileengine.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfsfileengine.cpp - -qfsfileengine_iterator.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator.cpp - -qabstractfileengine.obj: $(SOURCE_PATH)\src\corelib\io\qabstractfileengine.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qabstractfileengine.cpp +$(OBJS): qmake_pch.obj -qtextcodec.obj: $(SOURCE_PATH)\src\corelib\codecs\qtextcodec.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\codecs\qtextcodec.cpp +qsystemlibrary.obj: $(SOURCE_PATH)\src\corelib\plugin\qsystemlibrary.cpp + $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\plugin\qsystemlibrary.cpp -qregexp.obj: $(SOURCE_PATH)\src\corelib\tools\qregexp.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qregexp.cpp +$(QTOBJS): qmake_pch.obj -qvector.obj: $(SOURCE_PATH)\src\corelib\tools\qvector.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qvector.cpp +qmake_pch.obj: + $(CXX) $(CXXFLAGS_BARE) -c -Yc -Fpqmake_pch.pch -TP qmake_pch.h -qbitarray.obj: $(SOURCE_PATH)\src\corelib\tools\qbitarray.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qbitarray.cpp - -qdir.obj: $(SOURCE_PATH)\src\corelib\io\qdir.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qdir.cpp - -qdiriterator.obj: $(SOURCE_PATH)\src\corelib\io\qdiriterator.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qdiriterator.cpp - -qmetatype.obj: $(SOURCE_PATH)\src\corelib\kernel\qmetatype.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\kernel\qmetatype.cpp - -qfileinfo.obj: $(SOURCE_PATH)\src\corelib\io\qfileinfo.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfileinfo.cpp - -qdatetime.obj: $(SOURCE_PATH)\src\corelib\tools\qdatetime.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qdatetime.cpp - -qstringlist.obj: $(SOURCE_PATH)\src\corelib\tools\qstringlist.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qstringlist.cpp - -qmap.obj: $(SOURCE_PATH)\src\corelib\tools\qmap.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qmap.cpp - -qunicodetables.obj: $(SOURCE_PATH)\src\corelib\tools\qunicodetables.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qunicodetables.cpp - -makefile.obj: $(SOURCE_PATH)/qmake/generators\makefile.cpp - $(CXX) $(CXXFLAGS) generators\makefile.cpp - -unixmake.obj: $(SOURCE_PATH)/qmake/generators\unix\unixmake.cpp - $(CXX) $(CXXFLAGS) generators\unix\unixmake.cpp - -unixmake2.obj: $(SOURCE_PATH)/qmake/generators\unix\unixmake2.cpp - $(CXX) $(CXXFLAGS) generators\unix\unixmake2.cpp - -winmakefile.obj: $(SOURCE_PATH)/qmake/generators/win32/winmakefile.cpp - $(CXX) $(CXXFLAGS) generators/win32/winmakefile.cpp - -borland_bmake.obj: $(SOURCE_PATH)/qmake/generators/win32/borland_bmake.cpp - $(CXX) $(CXXFLAGS) generators/win32/borland_bmake.cpp - -mingw_make.obj: $(SOURCE_PATH)/qmake/generators/win32/mingw_make.cpp - $(CXX) $(CXXFLAGS) generators/win32/mingw_make.cpp - -msvc_nmake.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_nmake.cpp - $(CXX) $(CXXFLAGS) generators/win32/msvc_nmake.cpp - -msvc_vcproj.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp - $(CXX) $(CXXFLAGS) generators/win32/msvc_vcproj.cpp - -msvc_vcxproj.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcxproj.cpp - $(CXX) $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp - -msvc_objectmodel.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp - $(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp - -msbuild_objectmodel.obj: $(SOURCE_PATH)/qmake/generators/win32/msbuild_objectmodel.cpp - $(CXX) $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp - -symmake.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp - $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp - -symmake_abld.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp - $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp - -symmake_sbsv2.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp - $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp - -symbiancommon.obj: $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.cpp - $(CXX) $(CXXFLAGS) generators/symbian/symbiancommon.cpp - -initprojectdeploy_symbian.obj: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp - $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp +{$(SOURCE_PATH)\qmake\generators\mac}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -registry.obj: $(SOURCE_PATH)/tools/shared/windows/registry.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/tools/shared/windows/registry.cpp +{$(SOURCE_PATH)\qmake\generators\symbian}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -epocroot.obj: $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp +{$(SOURCE_PATH)\qmake\generators\unix}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -md5.obj: $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp +{$(SOURCE_PATH)\qmake\generators\win32}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -project.obj: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h - $(CXX) $(CXXFLAGS) project.cpp +{$(SOURCE_PATH)\qmake\generators}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -meta.obj: $(SOURCE_PATH)/qmake/meta.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h - $(CXX) $(CXXFLAGS) meta.cpp +{$(SOURCE_PATH)\qmake}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -main.obj: $(SOURCE_PATH)/qmake/main.cpp $(SOURCE_PATH)/qmake/project.h - $(CXX) $(CXXFLAGS) main.cpp +{$(SOURCE_PATH)\src\3rdparty\md5}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -option.obj: $(SOURCE_PATH)/qmake/option.cpp $(SOURCE_PATH)/qmake/option.h - $(CXX) $(CXXFLAGS) option.cpp +{$(SOURCE_PATH)\src\corelib\codecs}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -property.obj: $(SOURCE_PATH)/qmake/property.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h - $(CXX) $(CXXFLAGS) property.cpp +{$(SOURCE_PATH)\src\corelib\global}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -projectgenerator.obj: $(SOURCE_PATH)/qmake/generators/projectgenerator.cpp - $(CXX) $(CXXFLAGS) generators/projectgenerator.cpp +{$(SOURCE_PATH)\src\corelib\io}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -pbuilder_pbx.obj: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp - $(CXX) $(CXXFLAGS) generators/mac/pbuilder_pbx.cpp +{$(SOURCE_PATH)\src\corelib\kernel}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -makefiledeps.obj: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp - $(CXX) $(CXXFLAGS) generators/makefiledeps.cpp +{$(SOURCE_PATH)\src\corelib\plugin}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -metamakefile.obj: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp - $(CXX) $(CXXFLAGS) generators/metamakefile.cpp +{$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -xmloutput.obj: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp - $(CXX) $(CXXFLAGS) generators/xmloutput.cpp +{$(SOURCE_PATH)\src\corelib\xml}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -qxmlstream.obj: $(SOURCE_PATH)\src\corelib\xml\qxmlstream.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\xml\qxmlstream.cpp +{$(SOURCE_PATH)\tools\shared\symbian}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< -qxmlutils.obj: $(SOURCE_PATH)\src\corelib\xml\qxmlutils.cpp - $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\xml\qxmlutils.cpp +{$(SOURCE_PATH)\tools\shared\windows}.cpp{}.obj:: + $(CXX) $(CXXFLAGS) $< diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index 2bab255..da911e7 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -82,6 +82,7 @@ QTOBJS= \ qutfcodec.o \ qstring.o \ qstringlist.o \ + qsystemlibrary.o \ qtextstream.o \ quuid.o \ qvector.o \ @@ -246,6 +247,9 @@ qdatetime.o: $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp +qsystemlibrary.o: $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp + $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp + qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qmap.cpp diff --git a/qmake/Makefile.win32-g++-sh b/qmake/Makefile.win32-g++-sh index db78933..97be5b5 100644 --- a/qmake/Makefile.win32-g++-sh +++ b/qmake/Makefile.win32-g++-sh @@ -81,6 +81,7 @@ QTOBJS= \ qutfcodec.o \ qstring.o \ qstringlist.o \ + qsystemlibrary.o \ qtextstream.o \ quuid.o \ qvector.o \ @@ -241,6 +242,9 @@ qdatetime.o: $(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp qstringlist.o: $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp +qsystemlibrary.o: $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp + $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp + qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qmap.cpp diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 74c7977..9579ae4 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -466,14 +466,37 @@ MakefileGenerator::init() if(!project->isEmpty("QMAKE_SUBSTITUTES")) { const QStringList &subs = v["QMAKE_SUBSTITUTES"]; for(int i = 0; i < subs.size(); ++i) { - if(!subs.at(i).endsWith(".in")) { - warn_msg(WarnLogic, "Substitute '%s' does not end with '.in'", - subs.at(i).toLatin1().constData()); - continue; + QString inn = subs.at(i) + ".input", outn = subs.at(i) + ".output"; + if (v.contains(inn) || v.contains(outn)) { + if (!v.contains(inn) || !v.contains(outn)) { + warn_msg(WarnLogic, "Substitute '%s' has only one of .input and .output", + subs.at(i).toLatin1().constData()); + continue; + } + const QStringList &tinn = v[inn], &toutn = v[outn]; + if (tinn.length() != 1) { + warn_msg(WarnLogic, "Substitute '%s.input' does not have exactly one value", + subs.at(i).toLatin1().constData()); + continue; + } + if (toutn.length() != 1) { + warn_msg(WarnLogic, "Substitute '%s.output' does not have exactly one value", + subs.at(i).toLatin1().constData()); + continue; + } + inn = tinn.first(); + outn = toutn.first(); + } else { + inn = subs.at(i); + if(!inn.endsWith(".in")) { + warn_msg(WarnLogic, "Substitute '%s' does not end with '.in'", + inn.toLatin1().constData()); + continue; + } + outn = inn.left(inn.length()-3); } - QFile in(fileFixify(subs.at(i))), out(fileInfo(subs.at(i)).fileName()); - if(out.fileName().endsWith(".in")) - out.setFileName(out.fileName().left(out.fileName().length()-3)); + QFile in(fileFixify(inn)); + QFile out(fileFixify(outn, qmake_getpwd(), Option::output_dir)); if(in.open(QFile::ReadOnly)) { QString contents; QStack<int> state; @@ -528,7 +551,7 @@ MakefileGenerator::init() if(out.exists() && out.open(QFile::ReadOnly)) { QString old = QString::fromUtf8(out.readAll()); if(contents == old) { - v["QMAKE_INTERNAL_INCLUDED_FILES"].append(subs.at(i)); + v["QMAKE_INTERNAL_INCLUDED_FILES"].append(in.fileName()); continue; } out.close(); @@ -538,8 +561,9 @@ MakefileGenerator::init() continue; } } + mkdir(QFileInfo(out).absolutePath()); if(out.open(QFile::WriteOnly)) { - v["QMAKE_INTERNAL_INCLUDED_FILES"].append(subs.at(i)); + v["QMAKE_INTERNAL_INCLUDED_FILES"].append(in.fileName()); out.write(contents.toUtf8()); } else { warn_msg(WarnLogic, "Cannot open substitute for output '%s'", @@ -1770,10 +1794,12 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) const QString c = Option::fixPathToLocalOS(cmdline.at(argv0), true); if(exists(c)) { cmdline[argv0] = escapeFilePath(Option::fixPathToLocalOS(cmdline.at(argv0), false)); - tmp_dep_cmd = cmdline.join(" "); } else { cmdline[argv0] = escapeFilePath(cmdline.at(argv0)); } + QFileInfo cmdFileInfo(cmdline[argv0]); + if (!cmdFileInfo.isAbsolute() || cmdFileInfo.exists()) + tmp_dep_cmd = cmdline.join(" "); } dep_cd_cmd = QLatin1String("cd ") + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false)) diff --git a/qmake/generators/symbian/initprojectdeploy_symbian.cpp b/qmake/generators/symbian/initprojectdeploy_symbian.cpp index 382e012..776a646 100644 --- a/qmake/generators/symbian/initprojectdeploy_symbian.cpp +++ b/qmake/generators/symbian/initprojectdeploy_symbian.cpp @@ -353,7 +353,11 @@ void initProjectDeploySymbian(QMakeProject* project, CopyItem &item = i.next(); QFileInfo fromItem(item.from); QFileInfo toItem(item.to); - if (fromItem == toItem) +#if defined(Q_OS_WIN) + if (0 == fromItem.absoluteFilePath().compare(toItem.absoluteFilePath(), Qt::CaseInsensitive)) +#else + if (0 == fromItem.absoluteFilePath().compare(toItem.absoluteFilePath())) +#endif i.remove(); } } diff --git a/qmake/generators/symbian/symbiancommon.cpp b/qmake/generators/symbian/symbiancommon.cpp index d124b02..0da06af 100644 --- a/qmake/generators/symbian/symbiancommon.cpp +++ b/qmake/generators/symbian/symbiancommon.cpp @@ -129,7 +129,7 @@ bool SymbianCommonGenerator::containsStartWithItem(const QChar &c, const QString void SymbianCommonGenerator::removeSpecialCharacters(QString& str) { - // When modifying this method check also application_icon.prf + // When modifying this method check also symbianRemoveSpecialCharacters in symbian.conf str.replace(QString("/"), QString("_")); str.replace(QString("\\"), QString("_")); str.replace(QString(" "), QString("_")); @@ -137,7 +137,7 @@ void SymbianCommonGenerator::removeSpecialCharacters(QString& str) void SymbianCommonGenerator::removeEpocSpecialCharacters(QString& str) { - // When modifying this method check also application_icon.prf + // When modifying this method check also symbianRemoveSpecialCharacters in symbian.conf str.replace(QString("-"), QString("_")); str.replace(QString(":"), QString("_")); str.replace(QString("."), QString("_")); @@ -154,13 +154,8 @@ QString romPath(const QString& path) void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocBuild) { QMakeProject *project = generator->project; - QString pkgTarget = project->first("QMAKE_ORIG_TARGET"); - if (pkgTarget.isEmpty()) - pkgTarget = project->first("TARGET"); - pkgTarget = generator->unescapeFilePath(pkgTarget); - pkgTarget = removePathSeparators(pkgTarget); QString pkgFilename = Option::output_dir + QLatin1Char('/') + - QString("%1_template.pkg").arg(pkgTarget); + QString("%1_template.pkg").arg(fixedTarget); QFile pkgFile(pkgFilename); if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) { @@ -169,7 +164,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB } QString stubPkgFileName = Option::output_dir + QLatin1Char('/') + - QString("%1_stub.pkg").arg(pkgTarget); + QString("%1_stub.pkg").arg(fixedTarget); QFile stubPkgFile(stubPkgFileName); if (!stubPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) { @@ -193,7 +188,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB // Header info QString wrapperPkgFilename = Option::output_dir + QLatin1Char('/') + QString("%1_installer.%2") - .arg(pkgTarget).arg("pkg"); + .arg(fixedTarget).arg("pkg"); QString headerComment = "; %1 generated by qmake at %2\n" "; This file is generated by qmake and should not be modified by the user\n" @@ -202,44 +197,71 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB tw << headerComment.arg(wrapperPkgFilename).arg(dateStr); ts << headerComment.arg(stubPkgFileName).arg(dateStr); - // Construct QStringList from pkg_prerules since we need search it before printed to file - // Note: Though there can't be more than one language or header line, use stringlists + QStringList commonRawPreRules; + QStringList mainRawPreRules; + QStringList instRawPreRules; + QStringList stubRawPreRules; + + // Though there can't be more than one language or header line, use stringlists // in case user wants comments to go with the rules. - QStringList rawPkgPreRules; + // Note that it makes no sense to have file specific language or header rules, + // except what is provided for installer header via "DEPLOYMENT.installer_header" variable, + // because stub and main headers should always match. Vendor rules are similarly limited to + // make code cleaner as it is unlikely anyone will want different vendor in different files. QStringList languageRules; QStringList headerRules; - foreach(QString deploymentItem, project->values("DEPLOYMENT")) { - foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) { - QStringList pkgrulesValue = project->values(pkgrulesItem); - // If there is no stringlist defined for a rule, use rule name directly - // This is convenience for defining single line mmp statements - if (pkgrulesValue.isEmpty()) { - if (pkgrulesItem.startsWith("&")) - languageRules << pkgrulesItem; - else if (pkgrulesItem.startsWith("#")) - headerRules << pkgrulesItem; - else - rawPkgPreRules << pkgrulesItem; - } else { - if (containsStartWithItem('&', pkgrulesValue)) { - foreach(QString pkgrule, pkgrulesValue) { - languageRules << pkgrule; - } - } else if (containsStartWithItem('#', pkgrulesValue)) { - foreach(QString pkgrule, pkgrulesValue) { - headerRules << pkgrule; - } - } else { - foreach(QString pkgrule, pkgrulesValue) { - rawPkgPreRules << pkgrule; - } - } - } + QStringList vendorRules; + + QStringList commonRawPostRules; + QStringList mainRawPostRules; + QStringList instRawPostRules; + QStringList stubRawPostRules; + + QStringList failList; // Used for detecting incorrect usage + + QString emptySuffix; + QString mainSuffix(".main"); + QString instSuffix(".installer"); + QString stubSuffix(".stub"); + + foreach(QString item, project->values("DEPLOYMENT")) { + parsePreRules(item, emptySuffix, &commonRawPreRules, &languageRules, &headerRules, &vendorRules); + parsePreRules(item, mainSuffix, &mainRawPreRules, &failList, &failList, &failList); + parsePreRules(item, instSuffix, &instRawPreRules, &failList, &failList, &failList); + parsePreRules(item, stubSuffix, &stubRawPreRules, &failList, &failList, &failList); + + parsePostRules(item, emptySuffix, &commonRawPostRules); + parsePostRules(item, mainSuffix, &mainRawPostRules); + parsePostRules(item, instSuffix, &instRawPostRules); + parsePostRules(item, stubSuffix, &stubRawPostRules); + } + + if (!failList.isEmpty()) { + fprintf(stderr, "Warning: Custom language, header, or vendor definitions are not " + "supported by file specific pkg_prerules.* variables.\n" + "Use plain pkg_prerules and/or DEPLOYMENT.installer_header for customizing " + "these items.\n"); + } + + foreach(QString item, commonRawPreRules) { + if (item.startsWith("(")) { + // Only regular pkg file should have package dependencies + mainRawPreRules << item; + } else if (item.startsWith("[")) { + // stub pkg file should not have platform dependencies + mainRawPreRules << item; + instRawPreRules << item; + } else { + mainRawPreRules << item; + instRawPreRules << item; + stubRawPreRules << item; } } - // Apply some defaults if specific data does not exist in PKG pre-rules + // Currently common postrules only go to main + mainRawPostRules << commonRawPostRules; + // Apply some defaults if specific data does not exist in PKG pre-rules if (languageRules.isEmpty()) { // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS) languageRules << "; Language\n&EN\n\n"; @@ -275,6 +297,20 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB if (success) applicationVersion = QString("%1,%2,%3").arg(major).arg(minor).arg(patch); + // Append package build version number if it is set + QString pkgBuildVersion = project->first("DEPLOYMENT.pkg_build_version"); + if (!pkgBuildVersion.isEmpty()) { + success = false; + uint build = pkgBuildVersion.toUInt(&success); + if (success && build < 100) { + if (pkgBuildVersion.size() == 1) + pkgBuildVersion.prepend(QLatin1Char('0')); + applicationVersion.append(pkgBuildVersion); + } else { + fprintf(stderr, "Warning: Invalid DEPLOYMENT.pkg_build_version (%s), must be a number between 0 - 99\n", qPrintable(pkgBuildVersion)); + } + } + // Package header QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n"; QString visualTarget = generator->escapeFilePath(project->first("TARGET")); @@ -297,49 +333,38 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB ts << headerRules.join("\n") << endl; } - // Localized vendor name - QString vendorName; - if (!containsStartWithItem('%', rawPkgPreRules)) { - vendorName += "; Localised Vendor name\n%{\"Vendor\"}\n\n"; + // Vendor name + if (!containsStartWithItem('%', vendorRules)) { + vendorRules << "; Default localized vendor name\n%{\"Vendor\"}\n\n"; } - - // Unique vendor name - if (!containsStartWithItem(':', rawPkgPreRules)) { - vendorName += "; Unique Vendor name\n:\"Vendor\"\n\n"; + if (!containsStartWithItem(':', vendorRules)) { + vendorRules << "; Default unique vendor name\n:\"Vendor\"\n\n"; } - t << vendorName; - tw << vendorName; - ts << vendorName; + t << vendorRules.join("\n") << endl; + tw << vendorRules.join("\n") << endl; + ts << vendorRules.join("\n") << endl; // PKG pre-rules - these are added before actual file installations i.e. SIS package body - if (rawPkgPreRules.size()) { - QString comment = "\n; Manual PKG pre-rules from PRO files\n"; + QString comment = "\n; Manual PKG pre-rules from PRO files\n"; + + if (mainRawPreRules.size()) { t << comment; + t << mainRawPreRules.join("\n") << endl; + } + if (instRawPreRules.size()) { tw << comment; + tw << instRawPreRules.join("\n") << endl; + } + if (stubRawPreRules.size()) { ts << comment; - - foreach(QString item, rawPkgPreRules) { - // Only regular pkg file should have package dependencies - if (item.startsWith("(")) { - t << item << endl; - } - // stub pkg file should not have platform dependencies - else if (item.startsWith("[")) { - t << item << endl; - tw << item << endl; - } - else { - t << item << endl; - ts << item << endl; - tw << item << endl; - } - } - t << endl; - ts << endl; - tw << endl; + ts << stubRawPreRules.join("\n") << endl; } + t << endl; + tw << endl; + ts << endl; + // Begin Manufacturer block if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) { QString manufacturerStr("IF "); @@ -465,21 +490,19 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB ts << endl; // PKG post-rules - these are added after actual file installations i.e. SIS package body - t << "; Manual PKG post-rules from PRO files" << endl; - foreach(QString deploymentItem, project->values("DEPLOYMENT")) { - foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) { - QStringList pkgrulesValue = project->values(pkgrulesItem); - // If there is no stringlist defined for a rule, use rule name directly - // This is convenience for defining single line statements - if (pkgrulesValue.isEmpty()) { - t << pkgrulesItem << endl; - } else { - foreach(QString pkgrule, pkgrulesValue) { - t << pkgrule << endl; - } - } - t << endl; - } + comment = "; Manual PKG post-rules from PRO files\n"; + + if (mainRawPostRules.size()) { + t << comment; + t << mainRawPostRules.join("\n") << endl; + } + if (instRawPostRules.size()) { + tw << comment; + tw << instRawPostRules.join("\n") << endl; + } + if (stubRawPostRules.size()) { + ts << comment; + ts << stubRawPostRules.join("\n") << endl; } // Close Manufacturer block @@ -521,7 +544,7 @@ void SymbianCommonGenerator::generatePkgFile(const QString &iconFile, bool epocB // Wrapped files deployment QString currentPath = qmake_getpwd(); - QString sisName = QString("%1.sis").arg(pkgTarget); + QString sisName = QString("%1.sis").arg(fixedTarget); twf << "\"" << currentPath << "/" << sisName << "\" - \"c:\\private\\2002CCCE\\import\\" << sisName << "\"" << endl; QString bootStrapPath = QLibraryInfo::location(QLibraryInfo::PrefixPath); @@ -538,7 +561,7 @@ QString SymbianCommonGenerator::removePathSeparators(QString &file) if (QDir::separator().unicode() != '/') ret.replace(QDir::separator(), QLatin1Char('/')); - if (ret.indexOf(QLatin1Char('/')) > 0) + if (ret.indexOf(QLatin1Char('/')) >= 0) ret.remove(0, ret.lastIndexOf(QLatin1Char('/')) + 1); return ret; @@ -1021,3 +1044,66 @@ void SymbianCommonGenerator::fillQt2S60LangMapTable() qt2S60LangMapTable.insert("ny", "SC"); //Chewa // } +void SymbianCommonGenerator::parsePreRules(const QString &deploymentVariable, + const QString &variableSuffix, + QStringList *rawRuleList, + QStringList *languageRuleList, + QStringList *headerRuleList, + QStringList *vendorRuleList) +{ + QMakeProject *project = generator->project; + foreach(QString pkgrulesItem, project->values(deploymentVariable + ".pkg_prerules" + variableSuffix)) { + QStringList pkgrulesValue = project->values(pkgrulesItem); + // If there is no stringlist defined for a rule, use rule name directly + // This is convenience for defining single line statements + if (pkgrulesValue.isEmpty()) { + if (pkgrulesItem.startsWith("&")) + *languageRuleList << pkgrulesItem; + else if (pkgrulesItem.startsWith("#")) + *headerRuleList << pkgrulesItem; + else if (pkgrulesItem.startsWith("%") || pkgrulesItem.startsWith(":")) + *vendorRuleList << pkgrulesItem; + else + *rawRuleList << pkgrulesItem; + } else { + if (containsStartWithItem('&', pkgrulesValue)) { + foreach(QString pkgrule, pkgrulesValue) { + *languageRuleList << pkgrule; + } + } else if (containsStartWithItem('#', pkgrulesValue)) { + foreach(QString pkgrule, pkgrulesValue) { + *headerRuleList << pkgrule; + } + } else if (containsStartWithItem('%', pkgrulesValue) + || containsStartWithItem(':', pkgrulesValue)) { + foreach(QString pkgrule, pkgrulesValue) { + *vendorRuleList << pkgrule; + } + } else { + foreach(QString pkgrule, pkgrulesValue) { + *rawRuleList << pkgrule; + } + } + } + } +} + +void SymbianCommonGenerator::parsePostRules(const QString &deploymentVariable, + const QString &variableSuffix, + QStringList *rawRuleList) +{ + QMakeProject *project = generator->project; + foreach(QString pkgrulesItem, project->values(deploymentVariable + ".pkg_postrules" + variableSuffix)) { + QStringList pkgrulesValue = project->values(pkgrulesItem); + // If there is no stringlist defined for a rule, use rule name directly + // This is convenience for defining single line statements + if (pkgrulesValue.isEmpty()) { + *rawRuleList << pkgrulesItem; + } else { + foreach(QString pkgrule, pkgrulesValue) { + *rawRuleList << pkgrule; + } + } + } +} + diff --git a/qmake/generators/symbian/symbiancommon.h b/qmake/generators/symbian/symbiancommon.h index dae1e4a..80f2079 100644 --- a/qmake/generators/symbian/symbiancommon.h +++ b/qmake/generators/symbian/symbiancommon.h @@ -86,6 +86,17 @@ protected: QStringList symbianLangCodesFromTsFiles(); void fillQt2S60LangMapTable(); + void parsePreRules(const QString &deploymentVariable, + const QString &variableSuffix, + QStringList *rawRuleList, + QStringList *languageRuleList, + QStringList *headerRuleList, + QStringList *vendorRuleList); + void parsePostRules(const QString &deploymentVariable, + const QString &variableSuffix, + QStringList *rawRuleList); + + protected: MakefileGenerator *generator; diff --git a/qmake/generators/symbian/symmake.cpp b/qmake/generators/symbian/symmake.cpp index cf6bd13..09a3fc8 100644 --- a/qmake/generators/symbian/symmake.cpp +++ b/qmake/generators/symbian/symmake.cpp @@ -272,7 +272,8 @@ void SymbianMakefileGenerator::init() project->values("QMAKE_LIBS") += escapeFilePaths(project->values("LIBS")); project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE")); - // bld.inf + // Disallow renaming of bld.inf. + project->values("MAKEFILE").clear(); project->values("MAKEFILE") += BLD_INF_FILENAME; // .mmp @@ -706,25 +707,13 @@ void SymbianMakefileGenerator::writeMmpFileLibraryPart(QTextStream& t) if (lib.startsWith("-l")) { lib.remove(0, 2); QString mmpStatement; - if (lib.endsWith(".dll")) { - lib.chop(4); - mmpStatement = "LIBRARY\t\t"; - } else if (lib.endsWith(".lib")) { + if (lib.endsWith(".lib")) { lib.chop(4); mmpStatement = "STATICLIBRARY\t"; } else { - // Hacky way to find out what kind of library it is. Check the - // ARMV5 build directory for library type. We default to shared - // library, since that is more common. - QString udebStaticLibLocation(epocRoot()); - QString urelStaticLibLocation(udebStaticLibLocation); - udebStaticLibLocation += QString("epoc32/release/armv5/udeb/%1.lib").arg(lib); - urelStaticLibLocation += QString("epoc32/release/armv5/urel/%1.lib").arg(lib); - if (QFile::exists(udebStaticLibLocation) || QFile::exists(urelStaticLibLocation)) { - mmpStatement = "STATICLIBRARY\t"; - } else { - mmpStatement = "LIBRARY\t\t"; - } + if (lib.endsWith(".dll")) + lib.chop(4); + mmpStatement = "LIBRARY\t\t"; } t << mmpStatement << lib << ".lib" << endl; } diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp index 036eb1d..32c31ee 100644 --- a/qmake/generators/symbian/symmake_sbsv2.cpp +++ b/qmake/generators/symbian/symmake_sbsv2.cpp @@ -56,12 +56,21 @@ SymbianSbsv2MakefileGenerator::~SymbianSbsv2MakefileGenerator() { } #define FLM_DEST_DIR "epoc32/tools/makefile_templates/qt" #define FLM_SOURCE_DIR "/mkspecs/symbian-sbsv2/flm/qt" -#define UNDETECTED_GCCE_VERSION "0" #define PLATFORM_GCCE "gcce" #define PLATFORM_WINSCW "winscw" -#define PLATFORM_ARMV5 "armv5" +#define PLATFORM_ARM_PREFIX "arm" #define BUILD_DEBUG "udeb" #define BUILD_RELEASE "urel" +#define SBS_RVCT_PREFIX "rvct" + +static QString winscwPlatform; +static QString armPlatformPrefix; +static QString gccePlatform; +static QString sbsRvctPrefix; + +#if defined(Q_OS_UNIX) + extern char **environ; +#endif // Copies Qt FLMs to correct location under epocroot. // This is not done by configure as it is possible to change epocroot after configure. @@ -96,64 +105,95 @@ void SymbianSbsv2MakefileGenerator::exportFlm() } } -QString SymbianSbsv2MakefileGenerator::gcceVersion() +void SymbianSbsv2MakefileGenerator::findInstalledCompilerVersions(const QString &matchExpression, + const QString &versionPrefix, + QStringList *versionList) { - static QString gcceVersionStr; - - if (gcceVersionStr.isEmpty()) { - // First check if QT_GCCE_VERSION has been set, and use that if it is - QByteArray qtGcceVersion = qgetenv("QT_GCCE_VERSION"); - if (!qtGcceVersion.isEmpty()) { - // Check that QT_GCCE_VERSION is in proper format - QString check(qtGcceVersion); - check.replace(QRegExp("^\\d+\\.\\d+\\.\\d+$"),QString()); - if (check.isEmpty()) { - gcceVersionStr = PLATFORM_GCCE + QString(qtGcceVersion).replace(".","_"); - return gcceVersionStr; - } else { - fprintf(stderr, "Warning: Environment variable QT_GCCE_VERSION ('%s') is in incorrect " - "format, expected format is: '1.2.3'. Attempting to autodetect GCCE version.", - qtGcceVersion.constData()); + // No need to be able to find env variables on other operating systems, + // as only linux and windows have support for symbian-sbsv2 toolchain +#if defined(Q_OS_UNIX) || defined(Q_OS_WIN) + char *entry = 0; + int count = 0; + QRegExp matcher(matchExpression); + while ((entry = environ[count++])) { + if (matcher.exactMatch(QString::fromLocal8Bit(entry)) + && fileInfo(matcher.cap(matcher.captureCount())).exists()) { + // First capture (index 0) is the whole match, which is skipped. + // Next n captures are version numbers, which are interesting. + // Final capture is the env var value, which we alrady used, so that is skipped, too. + int capture = 1; + int finalCapture = matcher.captureCount() - 1; + QString version = versionPrefix; + while (capture <= finalCapture) { + version.append(matcher.cap(capture)); + if (capture != finalCapture) + version.append(QLatin1Char('.')); + capture++; } + *versionList << version; } - // Sbsv2 has separate env variable defined for each gcce version, so try to determine - // which user is likely to want to use by checking version 4.0.0 to 9.9.9 and taking - // the highest found version that actually points to a valid path. - // This is kind of a kludge, but since qmake doesn't bootstrap QProcess, there - // is no Qt API available to get all environment variables. - for (int i = 9; i >= 4; i--) { - for (int j = 9; j >= 0; j--) { - for (int k = 9; k >= 0; k--) { - QByteArray gcceVar = qgetenv(qPrintable(QString("SBS_GCCE%1%2%3BIN").arg(i).arg(j).arg(k))); - if (!gcceVar.isEmpty() && fileInfo(QString::fromLocal8Bit(gcceVar.constData())).exists()) { - gcceVersionStr = QString(PLATFORM_GCCE "%1_%2_%3").arg(i).arg(j).arg(k); - return gcceVersionStr; - } - } - } + } +#endif +} + +void SymbianSbsv2MakefileGenerator::findGcceVersions(QStringList *gcceVersionList, + QString *defaultVersion) +{ + QString matchStr = QLatin1String("SBS_GCCE(\\d)(\\d)(\\d)BIN=(.*)"); + findInstalledCompilerVersions(matchStr, gccePlatform, gcceVersionList); + + QString qtGcceVersion = QString::fromLocal8Bit(qgetenv("QT_GCCE_VERSION")); + + if (!qtGcceVersion.isEmpty()) { + if (QRegExp("\\d+\\.\\d+\\.\\d+").exactMatch(qtGcceVersion)) { + *defaultVersion = gccePlatform + qtGcceVersion; + } else { + fprintf(stderr, "Warning: Variable QT_GCCE_VERSION ('%s') is in incorrect " + "format, expected format is: 'x.y.z'. Attempting to autodetect GCCE version.\n", + qPrintable(qtGcceVersion)); } } - // Indicate undetected version to avoid rechecking multiple times - if (gcceVersionStr.isEmpty()) - gcceVersionStr = UNDETECTED_GCCE_VERSION; + if (defaultVersion->isEmpty() && gcceVersionList->size()) { + gcceVersionList->sort(); + *defaultVersion = gcceVersionList->last(); + } +} - return gcceVersionStr; +void SymbianSbsv2MakefileGenerator::findRvctVersions(QStringList *rvctVersionList, + QString *defaultVersion) +{ + QString matchStr = QLatin1String("RVCT(\\d)(\\d)BIN=(.*)"); + findInstalledCompilerVersions(matchStr, sbsRvctPrefix, rvctVersionList); + + QString qtRvctVersion = QString::fromLocal8Bit(qgetenv("QT_RVCT_VERSION")); + + if (!qtRvctVersion.isEmpty()) { + if (QRegExp("\\d+\\.\\d+").exactMatch(qtRvctVersion)) { + *defaultVersion = sbsRvctPrefix + qtRvctVersion; + } else { + fprintf(stderr, "Warning: Variable QT_RVCT_VERSION ('%s') is in incorrect " + "format, expected format is: 'x.y'.\n", + qPrintable(qtRvctVersion)); + } + } } -QString SymbianSbsv2MakefileGenerator::configClause(QString &platform, - QString &build, - QString &winscwClauseTemplate, - QString &gcceClauseTemplate, - QString &genericClauseTemplate) +QString SymbianSbsv2MakefileGenerator::configClause(const QString &platform, + const QString &build, + const QString &compilerVersion, + const QString &clauseTemplate) { QString retval; - if (QString::compare(platform, PLATFORM_WINSCW) == 0) - retval = winscwClauseTemplate.arg(build); - else if (QString::compare(platform, PLATFORM_GCCE) == 0) - retval = gcceClauseTemplate.arg(build); - else - retval = genericClauseTemplate.arg(platform).arg(build); + if (QString::compare(platform, winscwPlatform) == 0) { + retval = clauseTemplate.arg(build); + } else if (platform.startsWith(armPlatformPrefix)) { + QString fixedCompilerVersion = compilerVersion; + fixedCompilerVersion.replace(".","_"); + retval = clauseTemplate.arg(platform.mid(sizeof(PLATFORM_ARM_PREFIX)-1)) + .arg(build) + .arg(fixedCompilerVersion); + } // else - Unsupported platform for makefile target, return empty clause return retval; } @@ -185,44 +225,102 @@ void SymbianSbsv2MakefileGenerator::writeMkFile(const QString& wrapperFileName, void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) { - static QString debugBuild(BUILD_DEBUG); - static QString releaseBuild(BUILD_RELEASE); + static QString debugBuild; + static QString releaseBuild; + static QString defaultGcceCompilerVersion; + static QString defaultRvctCompilerVersion; + static QStringList rvctVersions; + static QStringList gcceVersions; + static QStringList allArmCompilerVersions; + + // Initialize static variables used in makefile creation + if (debugBuild.isEmpty()) { + debugBuild.append(QLatin1String(BUILD_DEBUG)); + releaseBuild.append(QLatin1String(BUILD_RELEASE)); + winscwPlatform.append(QLatin1String(PLATFORM_WINSCW)); + gccePlatform.append(QLatin1String(PLATFORM_GCCE)); + armPlatformPrefix.append(QLatin1String(PLATFORM_ARM_PREFIX)); + sbsRvctPrefix.append(QLatin1String(SBS_RVCT_PREFIX)); + + findGcceVersions(&gcceVersions, &defaultGcceCompilerVersion); + findRvctVersions(&rvctVersions, &defaultRvctCompilerVersion); + + allArmCompilerVersions << rvctVersions << gcceVersions; + + if (!allArmCompilerVersions.size()) { + fprintf(stderr, "Warning: No HW compilers detected. " + "Please install either GCCE or RVCT compiler to enable release builds.\n"); + } + } QStringList allPlatforms; foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) { allPlatforms << platform.toLower(); } + if (!gcceVersions.size()) + allPlatforms.removeAll(gccePlatform); + QString testClause; if (project->isActiveConfig(SYMBIAN_TEST_CONFIG)) testClause = QLatin1String(".test"); else testClause = QLatin1String(""); - QString genericClause = " -c %1_%2" + testClause; - QString winscwClause = " -c winscw_%1.mwccinc" + testClause; - QString gcceClause; - if (QString::compare(gcceVersion(), UNDETECTED_GCCE_VERSION) == 0) - allPlatforms.removeAll(PLATFORM_GCCE); - else - gcceClause = " -c arm.v5.%1." + gcceVersion() + ".release_gcce" + testClause; + // Note: armClause is used for gcce, too, which has a side effect + // of requiring armv* platform(s) in SYMBIAN_PLATFORMS in order + // to get any compiler version specific targets. + QString armClause = " -c " PLATFORM_ARM_PREFIX ".%1.%2.%3" + testClause; + QString genericArmClause; + if (defaultRvctCompilerVersion.isEmpty()) { + // Note: Argument %3 needs to be empty string in this version of clause + genericArmClause = " -c " PLATFORM_ARM_PREFIX "%1_%2%3" + testClause; + } else { + // If defaultRvctCompilerVersion is defined, use specific sbs clause for "generic" clause + genericArmClause = armClause; + } + QString winscwClause = " -c " PLATFORM_WINSCW "_%1.mwccinc" + testClause;; + + QStringList armPlatforms = allPlatforms.filter(QRegExp("^" PLATFORM_ARM_PREFIX)); + + if (!allArmCompilerVersions.size()) { + foreach (QString item, armPlatforms) { + allPlatforms.removeAll(item); + } + armPlatforms.clear(); + } QStringList allClauses; QStringList debugClauses; QStringList releaseClauses; + // Only winscw and arm platforms are supported QStringList debugPlatforms = allPlatforms; QStringList releasePlatforms = allPlatforms; - releasePlatforms.removeAll(PLATFORM_WINSCW); // No release for emulator + releasePlatforms.removeAll(winscwPlatform); // No release for emulator - foreach(QString item, debugPlatforms) { - debugClauses << configClause(item, debugBuild, winscwClause, gcceClause, genericClause); + if (!releasePlatforms.size()) { + fprintf(stderr, "Warning: No valid release platforms in SYMBIAN_PLATFORMS (%s)\n" + "Most likely required compiler(s) are not properly installed.\n", + qPrintable(project->values("SYMBIAN_PLATFORMS").join(" "))); } - foreach(QString item, releasePlatforms) { - releaseClauses << configClause(item, releaseBuild, winscwClause, gcceClause, genericClause); + + if (debugPlatforms.contains(winscwPlatform)) + debugClauses << configClause(winscwPlatform, debugBuild, QString(), winscwClause); + + foreach(QString item, armPlatforms) { + // Only use single clause per arm platform even if multiple compiler versions were found, + // otherwise we get makefile target collisions from sbsv2 toolchain. + if (rvctVersions.size()) { + debugClauses << configClause(item, debugBuild, defaultRvctCompilerVersion, genericArmClause); + releaseClauses << configClause(item, releaseBuild, defaultRvctCompilerVersion, genericArmClause); + } else { + debugClauses << configClause(item, debugBuild, defaultGcceCompilerVersion, armClause); + releaseClauses << configClause(item, releaseBuild, defaultGcceCompilerVersion, armClause); + } } - allClauses << debugClauses << releaseClauses; + allClauses << debugClauses << releaseClauses; QTextStream t(&wrapperFile); @@ -261,22 +359,20 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo t << " -I\"" << values.at(i) << "\" "; } } - t << endl; - t << "first: default" << endl; - if (debugPlatforms.contains(PLATFORM_WINSCW)) - t << "default: debug-winscw"; - else if (debugPlatforms.contains(PLATFORM_ARMV5)) - t << "default: debug-armv5"; - else if (debugPlatforms.size()) - t << "default: debug-" << debugPlatforms.first(); - else - t << "default: all"; t << endl; + t << "first: default" << endl << endl; if (!isPrimaryMakefile) { - t << "all:" << endl; + t << "all:" << endl << endl; + t << "default: all" << endl << endl; } else { - t << "all: debug release" << endl; + t << "all: debug release" << endl << endl; + if (debugPlatforms.contains(winscwPlatform)) + t << "default: debug-winscw"; + else if (debugPlatforms.size()) + t << "default: debug-" << debugPlatforms.first(); + else + t << "default: all"; t << endl; QString qmakeCmd = "\t$(QMAKE) \"" + project->projectFile() + "\" " + buildArgs(); @@ -293,30 +389,80 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo t << "debug: " << BLD_INF_FILENAME << endl; t << "\t$(SBS)"; - foreach(QString item, debugClauses) { - t << item; + foreach(QString clause, debugClauses) { + t << clause; + } + t << endl; + t << "clean-debug: " << BLD_INF_FILENAME << endl; + t << "\t$(SBS) reallyclean"; + foreach(QString clause, debugClauses) { + t << clause; } t << endl; t << "release: " << BLD_INF_FILENAME << endl; t << "\t$(SBS)"; - foreach(QString item, releaseClauses) { - t << item; + foreach(QString clause, releaseClauses) { + t << clause; } t << endl; + t << "clean-release: " << BLD_INF_FILENAME << endl; + t << "\t$(SBS) reallyclean"; + foreach(QString clause, releaseClauses) { + t << clause; + } + t << endl << endl; + + QString defaultGcceArmVersion; + if (armPlatforms.size()) { + defaultGcceArmVersion = armPlatforms.first(); + } else { + defaultGcceArmVersion = QLatin1String("armv5"); + } - // For more specific builds, targets are in this form: build-platform, e.g. release-armv5 + // For more specific builds, targets are in this form: + // release-armv5 - generic target, compiler version determined by toolchain or autodetection + // release-armv5-rvct4.0 - compiler version specific target foreach(QString item, debugPlatforms) { + QString clause; + if (item.compare(winscwPlatform) == 0) + clause = configClause(item, debugBuild, QString(), winscwClause); + else if (item.compare(gccePlatform) == 0 ) + clause = configClause(defaultGcceArmVersion, debugBuild, defaultGcceCompilerVersion, armClause); + else // use generic arm clause + clause = configClause(item, debugBuild, defaultRvctCompilerVersion, genericArmClause); + t << "debug-" << item << ": " << BLD_INF_FILENAME << endl; - t << "\t$(SBS)"; - t << configClause(item, debugBuild, winscwClause, gcceClause, genericClause); - t << endl; + t << "\t$(SBS)" << clause << endl; + t << "clean-debug-" << item << ": " << BLD_INF_FILENAME << endl; + t << "\t$(SBS) reallyclean" << clause << endl; } foreach(QString item, releasePlatforms) { + QString clause; + if (item.compare(gccePlatform) == 0 ) + clause = configClause(defaultGcceArmVersion, releaseBuild, defaultGcceCompilerVersion, armClause); + else // use generic arm clause + clause = configClause(item, releaseBuild, defaultRvctCompilerVersion, genericArmClause); + t << "release-" << item << ": " << BLD_INF_FILENAME << endl; - t << "\t$(SBS)"; - t << configClause(item, releaseBuild, winscwClause, gcceClause, genericClause); - t << endl; + t << "\t$(SBS)" << clause << endl; + t << "clean-release-" << item << ": " << BLD_INF_FILENAME << endl; + t << "\t$(SBS) reallyclean" << clause << endl; + } + + foreach(QString item, armPlatforms) { + foreach(QString compilerVersion, allArmCompilerVersions) { + QString debugClause = configClause(item, debugBuild, compilerVersion, armClause); + QString releaseClause = configClause(item, releaseBuild, compilerVersion, armClause); + t << "debug-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl; + t << "\t$(SBS)" << debugClause << endl; + t << "clean-debug-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl; + t << "\t$(SBS) reallyclean" << debugClause << endl; + t << "release-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl; + t << "\t$(SBS)" << releaseClause << endl; + t << "clean-release-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl; + t << "\t$(SBS) reallyclean" << releaseClause << endl; + } } t << endl; @@ -335,7 +481,7 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo t << endl << endl; } - // Add all extra targets including extra compiler targest also to wrapper makefile, + // Add all extra targets including extra compiler targets also to wrapper makefile, // even though many of them may have already been added to bld.inf as FLMs. // This is to enable use of targets like 'mocables', which call targets generated by extra compilers. if (targetType != TypeSubdirs) { @@ -356,32 +502,6 @@ void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, boo } t << endl << endl; - t << "clean-debug: " << BLD_INF_FILENAME << endl; - t << "\t$(SBS) reallyclean"; - foreach(QString clause, debugClauses) { - t << clause; - } - t << endl << endl; - t << "clean-release: " << BLD_INF_FILENAME << endl; - t << "\t$(SBS) reallyclean"; - foreach(QString clause, releaseClauses) { - t << clause; - } - t << endl << endl; - - // For more specific builds, targets are in this form: clean-build-platform, e.g. clean-release-armv5 - foreach(QString item, debugPlatforms) { - t << "clean-debug-" << item << ": " << BLD_INF_FILENAME << endl; - t << "\t$(SBS) reallyclean"; - t << configClause(item, debugBuild, winscwClause, gcceClause, genericClause); - t << endl; - } - foreach(QString item, releasePlatforms) { - t << "clean-release-" << item << ": " << BLD_INF_FILENAME << endl; - t << "\t$(SBS) reallyclean"; - t << configClause(item, releaseBuild, winscwClause, gcceClause, genericClause); - t << endl; - } t << endl; } @@ -404,6 +524,28 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t } } + QMap<QString, QString> commandsToReplace; + commandsToReplace.insert(project->values("QMAKE_COPY").join(" "), + project->values("QMAKE_SBSV2_COPY").join(" ")); + commandsToReplace.insert(project->values("QMAKE_COPY_DIR").join(" "), + project->values("QMAKE_SBSV2_COPY_DIR").join(" ")); + commandsToReplace.insert(project->values("QMAKE_MOVE").join(" "), + project->values("QMAKE_SBSV2_MOVE").join(" ")); + commandsToReplace.insert(project->values("QMAKE_DEL_FILE").join(" "), + project->values("QMAKE_SBSV2_DEL_FILE").join(" ")); + commandsToReplace.insert(project->values("QMAKE_MKDIR").join(" "), + project->values("QMAKE_SBSV2_MKDIR").join(" ")); + commandsToReplace.insert(project->values("QMAKE_DEL_DIR").join(" "), + project->values("QMAKE_SBSV2_DEL_DIR").join(" ")); + commandsToReplace.insert(project->values("QMAKE_DEL_TREE").join(" "), + project->values("QMAKE_SBSV2_DEL_TREE").join(" ")); + + // If commandItem starts with any $$QMAKE_* commands, do a replace for SBS equivalent + // Command replacement is done only for the start of the command or right after + // concatenation operators (&& and ||), as otherwise unwanted replacements might occur. + static QString cmdFind("(^|&&\\s*|\\|\\|\\s*)%1"); + static QString cmdReplace("\\1%1"); + // Write extra compilers and targets to initialize QMAKE_ET_* variables // Cache results to avoid duplicate calls when creating wrapper makefile QTextStream extraCompilerStream(&extraCompilersCache); @@ -415,13 +557,7 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t // are not necessary. QStringList allPreDeps; foreach(QString item, project->values("PRE_TARGETDEPS")) { - // Predeps get mangled in windows, so fix them to more sbsv2 friendly format -#if defined(Q_OS_WIN) - if (item.mid(1, 1) == ":") - item = item.mid(0, 1).toUpper().append(item.mid(1)); // Fix drive to uppercase -#endif - item.replace("\\", "/"); - allPreDeps << escapeDependencyPath(item); + allPreDeps.append(fileInfo(item).absoluteFilePath()); } foreach (QString item, project->values("GENERATED_SOURCES")) { @@ -451,7 +587,6 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t QStringList deps = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + item + targetItem); QString commandItem = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + item + targetItem).join(" "); - // Make sure all deps paths are absolute QString absoluteDeps; foreach (QString depItem, deps) { @@ -465,6 +600,18 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t t << "OPTION PREDEP_TARGET " << absoluteTarget << endl; t << "OPTION DEPS " << absoluteDeps << endl; + // Iterate command replacements in reverse alphabetical order of keys so + // that keys which are starts of other longer keys are iterated after longer keys. + QMapIterator<QString, QString> cmdIter(commandsToReplace); + cmdIter.toBack(); + while (cmdIter.hasPrevious()) { + cmdIter.previous(); + if (commandItem.contains(cmdIter.key())) { + commandItem.replace(QRegExp(cmdFind.arg(cmdIter.key())), + cmdReplace.arg(cmdIter.value())); + } + } + if (commandItem.indexOf("$(INCPATH)") != -1) commandItem.replace("$(INCPATH)", incPath.join(" ")); if (commandItem.indexOf("$(DEFINES)") != -1) diff --git a/qmake/generators/symbian/symmake_sbsv2.h b/qmake/generators/symbian/symmake_sbsv2.h index 6644a03..557e3dd 100644 --- a/qmake/generators/symbian/symmake_sbsv2.h +++ b/qmake/generators/symbian/symmake_sbsv2.h @@ -65,12 +65,15 @@ public: private: void exportFlm(); - QString gcceVersion(); - QString configClause(QString &platform, - QString &build, - QString &winscwClauseTemplate, - QString &gcceClauseTemplate, - QString &genericClauseTemplate); + void findGcceVersions(QStringList *gcceVersionList, QString *defaultVersion); + void findRvctVersions(QStringList *rvctVersionList, QString *defaultVersion); + void findInstalledCompilerVersions(const QString &matchExpression, + const QString &versionPrefix, + QStringList *versionList); + QString configClause(const QString &platform, + const QString &build, + const QString &compilerVersion, + const QString &clauseTemplate); void writeSbsDeploymentList(const DeploymentList& depList, QTextStream& t); diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index db5b957..da4bbb7 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -622,31 +622,42 @@ UnixMakefileGenerator::processPrlFiles() //merge them into a logical order if(!project->isActiveConfig("no_smart_library_merge") && !project->isActiveConfig("no_lflags_merge")) { - QStringList lflags; + QHash<QString, QStringList> lflags; for(int lit = 0; lit < l.size(); ++lit) { + QString arch("default"); QString opt = l.at(lit).trimmed(); if(opt.startsWith("-")) { + if (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-Xarch")) { + if (opt.length() > 7) { + arch = opt.mid(7); + opt = l.at(++lit); + } + } + if(opt.startsWith("-L") || (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-F"))) { - if(lit == 0 || l.lastIndexOf(opt, lit-1) == -1) - lflags.append(opt); + if(lit == 0 || !lflags[arch].contains(opt)) + lflags[arch].append(opt); } else if(opt.startsWith("-l")) { - if(lit == l.size()-1 || l.indexOf(opt, lit+1) == -1) - lflags.append(opt); + if(lit == l.size()-1 || !lflags[arch].contains(opt)) + lflags[arch].append(opt); } else if(Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-framework")) { if(opt.length() > 11) opt = opt.mid(11); - else + else { opt = l.at(++lit); + if (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-Xarch")) + opt = l.at(++lit); // The user has done the right thing and prefixed each part + } bool found = false; - for(int x = lit+1; x < l.size(); ++x) { - QString xf = l.at(x); + for(int x = 0; x < lflags[arch].size(); ++x) { + QString xf = lflags[arch].at(x); if(xf.startsWith("-framework")) { QString framework; if(xf.length() > 11) framework = xf.mid(11); else - framework = l.at(++x); + framework = lflags[arch].at(++x); if(framework == opt) { found = true; break; @@ -654,18 +665,30 @@ UnixMakefileGenerator::processPrlFiles() } } if(!found) { - lflags.append("-framework"); - lflags.append(opt); + lflags[arch].append("-framework"); + lflags[arch].append(opt); } } else { - lflags.append(opt); + lflags[arch].append(opt); } } else if(!opt.isNull()) { if(lit == 0 || l.lastIndexOf(opt, lit-1) == -1) - lflags.append(opt); + lflags[arch].append(opt); + } + } + + l = lflags.take("default"); + + // Process architecture specific options (Xarch) + QHash<QString, QStringList>::const_iterator archIterator = lflags.constBegin(); + while (archIterator != lflags.constEnd()) { + const QStringList archOptions = archIterator.value(); + for (int i = 0; i < archOptions.size(); ++i) { + l.append(QLatin1String("-Xarch_") + archIterator.key()); + l.append(archOptions.at(i)); } + ++archIterator; } - l = lflags; } } } diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 5685d6b..4717542 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -191,10 +191,7 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co QTextStream t(&file); t << "CREATE " << target << endl; for (QStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) { - if (QDir::isRelativePath(*it)) - t << "ADDMOD " << *it << endl; - else - t << *it << endl; + t << "ADDMOD " << *it << endl; } t << "SAVE" << endl; t.flush(); diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp index e001884..b1de302 100644 --- a/qmake/generators/win32/msvc_objectmodel.cpp +++ b/qmake/generators/win32/msvc_objectmodel.cpp @@ -1499,7 +1499,8 @@ bool VCLinkerTool::parseOption(const char* option) break; case 0x0034160: // /MAP[:filename] GenerateMapFile = _True; - MapFileName = option+5; + if (option[4] == ':') + MapFileName = option+5; break; case 0x164e1ef: // /MAPINFO:{EXPORTS|LINES} if(*(option+9) == 'E') diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index f32ba7e..3c42f14 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -280,7 +280,7 @@ bool VcprojGenerator::writeProjectMakefile() mergedProjects.at(0)->vcProject.Name == mergedProjects.at(1)->vcProject.Name) mergedProjects.at(0)->writePrlFile(); - mergedProject.Name = unescapeFilePath(project->first("QMAKE_ORIG_TARGET")); + mergedProject.Name = project->first("QMAKE_PROJECT_NAME"); mergedProject.Version = mergedProjects.at(0)->vcProject.Version; mergedProject.ProjectGUID = project->isEmpty("QMAKE_UUID") ? getProjectUUID().toString().toUpper() : project->first("QMAKE_UUID"); mergedProject.Keyword = project->first("VCPROJ_KEYWORD"); @@ -468,8 +468,8 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) } } - // We assume project filename is [QMAKE_ORIG_TARGET].vcproj - QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_ORIG_TARGET") + project->first("VCPROJ_EXTENSION")); + // We assume project filename is [QMAKE_PROJECT_NAME].vcproj + QString vcproj = unescapeFilePath(tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION")); QString vcprojDir = qmake_getpwd(); // If file doesn't exsist, then maybe the users configuration diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 64aaf34..58f21cb 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -290,6 +290,11 @@ void Win32MakefileGenerator::processVars() } project->values("QMAKE_ORIG_TARGET") = project->values("TARGET"); + if (project->isEmpty("QMAKE_PROJECT_NAME")) + project->values("QMAKE_PROJECT_NAME") = project->values("QMAKE_ORIG_TARGET"); + else if (project->first("TEMPLATE").startsWith("vc")) + project->values("MAKEFILE") = project->values("QMAKE_PROJECT_NAME"); + if (!project->values("QMAKE_INCDIR").isEmpty()) project->values("INCLUDEPATH") += project->values("QMAKE_INCDIR"); @@ -472,10 +477,13 @@ void Win32MakefileGenerator::processRcFileVar() resFile.replace(".rc", Option::res_ext); project->values("RES_FILE").prepend(fileInfo(resFile).fileName()); if (!project->values("OBJECTS_DIR").isEmpty()) { - if(project->isActiveConfig("staticlib")) - project->values("RES_FILE").first().prepend(fileInfo(project->values("DESTDIR").first()).absoluteFilePath() + Option::dir_sep); + QString resDestDir; + if (project->isActiveConfig("staticlib")) + resDestDir = fileInfo(project->first("DESTDIR")).absoluteFilePath(); else - project->values("RES_FILE").first().prepend(project->values("OBJECTS_DIR").first() + Option::dir_sep); + resDestDir = project->first("OBJECTS_DIR"); + resDestDir.append(Option::dir_sep); + project->values("RES_FILE").first().prepend(resDestDir); } project->values("RES_FILE").first() = Option::fixPathToTargetOS(project->values("RES_FILE").first(), false, false); project->values("POST_TARGETDEPS") += project->values("RES_FILE"); diff --git a/qmake/qmake.pri b/qmake/qmake.pri index 889338f..274cb70 100644 --- a/qmake/qmake.pri +++ b/qmake/qmake.pri @@ -136,7 +136,8 @@ bootstrap { #Qt code LIBS += -framework ApplicationServices } } else:win32 { - SOURCES += qfilesystemengine_win.cpp qfsfileengine_win.cpp qfilesystemiterator_win.cpp qsettings_win.cpp + SOURCES += qfilesystemengine_win.cpp qfsfileengine_win.cpp qfilesystemiterator_win.cpp qsettings_win.cpp \ + qsystemlibrary.cpp win32-msvc*:LIBS += ole32.lib advapi32.lib win32-g++*:LIBS += -lole32 -luuid } |