Changeset 846 for trunk/qmake
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 53 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/qmake/Makefile.unix
r769 r846 10 10 mingw_make.o option.o winmakefile.o projectgenerator.o \ 11 11 meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ 12 borland_bmake.o msvc_ dsp.o msvc_vcproj.o msvc_nmake.o msvc_objectmodel.o \12 borland_bmake.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o \ 13 13 symmake.o initprojectdeploy_symbian.o symmake_abld.o symmake_sbsv2.o \ 14 registry.o \ 15 epocroot.o \ 16 gnumake.o 14 symbiancommon.o registry.o epocroot.o gnumake.o 17 15 18 16 #qt code … … 34 32 generators/mac/pbuilder_pbx.cpp generators/mac/xmloutput.cpp generators/metamakefile.cpp \ 35 33 generators/makefiledeps.cpp option.cpp generators/win32/mingw_make.cpp generators/makefile.cpp \ 36 generators/win32/msvc_ objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \34 generators/win32/msvc_vcproj.cpp generators/win32/msvc_vcxproj.cpp generators/win32/msvc_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp generators/win32/msvc_nmake.cpp generators/win32/borland_bmake.cpp \ 37 35 generators/symbian/symmake.cpp generators/symbian/initprojectdeploy_symbian.cpp \ 38 36 $(SOURCE_PATH)/tools/shared/windows/registry.cpp \ 39 37 $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp \ 40 38 generators/symbian/symmake_abld.cpp generators/symbian/symmake_sbsv2.cpp \ 39 generaters/symbian/symbiancommon.cpp \ 41 40 generators/os2/gnumake.cpp \ 42 41 $(SOURCE_PATH)/src/corelib/codecs/qtextcodec.cpp $(SOURCE_PATH)/src/corelib/codecs/qutfcodec.cpp \ … … 71 70 -I$(SOURCE_PATH)/tools/shared \ 72 71 -DQT_NO_PCRE \ 73 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED \72 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT \ 74 73 -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_STL \ 75 74 -DQT_NO_COMPRESS -I$(QMAKESPEC) -DHAVE_QCONFIG_CPP -DQT_NO_THREAD -DQT_NO_QOBJECT \ … … 238 237 $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp 239 238 240 metamakefile.o: generators/metamakefile.cpp 239 metamakefile.o: generators/metamakefile.cpp generators/symbian/symbian_makefile.h 241 240 $(CXX) -c -o $@ $(CXXFLAGS) generators/metamakefile.cpp 242 241 … … 268 267 $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_vcproj.cpp 269 268 269 msbuild_objectmodel.o: generators/win32/msbuild_objectmodel.cpp 270 $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp 271 272 msvc_vcxproj.o: generators/win32/msvc_vcxproj.cpp 273 $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp 274 270 275 msvc_nmake.o: generators/win32/msvc_nmake.cpp 271 276 $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_nmake.cpp … … 274 279 $(CXX) -c -o $@ $(CXXFLAGS) generators/mac/pbuilder_pbx.cpp 275 280 276 msvc_dsp.o: generators/win32/msvc_dsp.cpp277 $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_dsp.cpp278 279 281 symmake.o: generators/symbian/symmake.cpp 280 282 $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake.cpp … … 285 287 symmake_sbsv2.o: generators/symbian/symmake_sbsv2.cpp 286 288 $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp 289 290 symbiancommon.o: generators/symbian/symbiancommon.cpp 291 $(CXX) -c -o $@ $(CXXFLAGS) generators/symbian/symbiancommon.cpp 287 292 288 293 initprojectdeploy_symbian.o: generators/symbian/initprojectdeploy_symbian.cpp -
trunk/qmake/Makefile.win32
r769 r846 1 !IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32- icc"1 !IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-icc" 2 2 3 3 !if "$(SOURCE_PATH)" == "" … … 24 24 # 25 25 !if "$(QMAKESPEC)" == "win32-msvc2005" 26 CFLAGS = /Zc:wchar_t- 27 !endif 28 29 CFLAGS = -c -Fo$@ \ 26 CFLAGS_EXTRA = /Zc:wchar_t- 27 !elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" 28 CFLAGS_EXTRA = /MP 29 !endif 30 31 CFLAGS_BARE = -c -Fo./ \ 30 32 -W3 -nologo -O2 \ 33 $(CFLAGS_EXTRA) \ 31 34 -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian -Igenerators\os2 \ 32 35 -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \ … … 39 42 -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD \ 40 43 -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_NO_PCRE -DQT_BOOTSTRAPPED \ 41 $(CFLAGS) 42 CXXFLAGS = $(CFLAGS) 44 -DQLIBRARYINFO_EPOCROOT 45 CFLAGS = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS) 46 47 CXXFLAGS_BARE = $(CFLAGS_BARE) 48 CXXFLAGS = $(CFLAGS) 49 43 50 LFLAGS = 44 51 LIBS = ole32.lib advapi32.lib 45 52 LINKQMAKE = $(LINK) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS) 46 53 ADDCLEAN = vc60.pdb vc70.pdb qmake.pdb qmake.ilk 54 47 55 !ELSE 48 49 # 50 # specific stuff for Borland make 51 # 52 !if !$d(BCB) 53 BCB = $(MAKEDIR)\.. 54 !endif 55 CXX = bcc32 56 CFLAGS = -c -o$@ \ 57 -tWR -w -w-hid -w-use -O1 \ 58 -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian \ 59 -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \ 60 -I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \ 61 -I$(BUILD_PATH)\src\corelib\global \ 62 -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ 63 -I$(SOURCE_PATH)\tools\shared \ 64 -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL \ 65 -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD \ 66 -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT 67 CXXFLAGS = $(CFLAGS) 68 LFLAGS = -L$(BCB)\lib -c -x -Gn -ap -Tpe c0x32.obj 69 LIBS = import32.lib cw32i.lib 70 LINKQMAKE = ilink32 $(LFLAGS) $(OBJS) $(QTOBJS), qmake.exe,,$(LIBS) 71 ADDCLEAN = qmake.tds 56 !ERROR Unsupported compiler for this Makefile 72 57 !ENDIF 73 58 … … 76 61 option.obj winmakefile.obj projectgenerator.obj property.obj meta.obj \ 77 62 makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \ 78 borland_bmake.obj msvc_nmake.obj msvc_dsp.obj msvc_vcproj.obj \ 79 msvc_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \ 80 registry.obj \ 81 epocroot.obj \ 82 symmake_abld.obj symmake_sbsv2.obj gnumake.obj 63 borland_bmake.obj msvc_nmake.obj msvc_vcproj.obj msvc_vcxproj.obj \ 64 msvc_objectmodel.obj msbuild_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \ 65 symmake_abld.obj symmake_sbsv2.obj symbiancommon.obj registry.obj epocroot.obj gnumake.obj 83 66 84 67 !IFDEF QMAKE_OPENSOURCE_EDITION … … 103 86 qabstractfileengine.obj \ 104 87 qfsfileengine_win.obj \ 88 qsystemlibrary.obj \ 105 89 qfsfileengine_iterator_win.obj \ 106 90 qfileinfo.obj \ … … 136 120 137 121 qmake.exe: $(OBJS) $(QTOBJS) 138 $(LINKQMAKE) 122 $(LINKQMAKE) qmake_pch.obj 139 123 -copy qmake.exe $(BUILD_PATH)\bin\qmake.exe 140 124 141 125 clean:: 142 -del qbitarray.obj 143 -del qbuffer.obj 144 -del qcryptographichash.obj 145 -del qlinkedlist.obj 146 -del qfsfileengine.obj 147 -del qfsfileengine_iterator.obj 148 -del qbytearray.obj 149 -del qvsnprintf.obj 150 -del qbytearraymatcher.obj 151 -del qdatetime.obj 152 -del qdir.obj 153 -del qdiriterator.obj 154 -del qfile.obj 155 -del qtemporaryfile.obj 156 -del qabstractfileengine.obj 157 -del qfsfileengine_win.obj 158 -del qfsfileengine_iterator_win.obj 159 -del qfileinfo.obj 160 -del qglobal.obj 161 -del qhash.obj 162 -del qiodevice.obj 163 -del qlist.obj 164 -del qlocale.obj 165 -del qmalloc.obj 166 -del qmap.obj 167 -del qregexp.obj 168 -del qtextcodec.obj 169 -del qutfcodec.obj 170 -del qstring.obj 171 -del qstringlist.obj 172 -del qtextstream.obj 173 -del qdatastream.obj 174 -del quuid.obj 175 -del qvector.obj 176 -del qsettings.obj 177 -del qlibraryinfo.obj 178 -del qvariant.obj 179 -del qurl.obj 180 -del qsettings_win.obj 181 -del qmetatype.obj 182 -del project.obj 183 -del main.obj 184 -del makefile.obj 185 -del unixmake.obj 186 -del unixmake2.obj 187 -del mingw_make.obj 188 -del option.obj 189 -del winmakefile.obj 190 -del projectgenerator.obj 191 -del property.obj 192 -del meta.obj 193 -del makefiledeps.obj 194 -del metamakefile.obj 195 -del xmloutput.obj 196 -del borland_bmake.obj 197 -del msvc_nmake.obj 198 -del msvc_dsp.obj 199 -del msvc_vcproj.obj 200 -del msvc_objectmodel.obj 201 -del symmake.obj 202 -del symmake_abld.obj 203 -del symmake_sbsv2.obj 204 -del initprojectdeploy_symbian.obj 205 -del registry.obj 206 -del epocroot.obj 207 -del gnumake.obj 208 -del pbuilder_pbx.obj 209 -del qxmlstream.obj 210 -del qxmlutils.obj 211 -del qnumeric.obj 126 -del $(QTOBJS) 127 -del $(OBJS) 128 -del qmake_pch.obj 129 -del qmake_pch.pch 130 -del qsystemlibrary.obj 212 131 -del vc60.pdb 213 132 -del vc70.pdb … … 231 150 $(CXX) $(CXXFLAGS) $< 232 151 233 qsettings_win.obj: $(SOURCE_PATH)\src\corelib\io\qsettings_win.cpp 234 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qsettings_win.cpp 235 236 qsettings.obj: $(SOURCE_PATH)\src\corelib\io\qsettings.cpp 237 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qsettings.cpp 238 239 qlibraryinfo.obj: $(SOURCE_PATH)\src\corelib\global\qlibraryinfo.cpp 240 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\global\qlibraryinfo.cpp 241 242 qnumeric.obj: $(SOURCE_PATH)\src\corelib\global\qnumeric.cpp 243 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\global\qnumeric.cpp 244 245 qvariant.obj: $(SOURCE_PATH)\src\corelib\kernel\qvariant.cpp 246 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\kernel\qvariant.cpp 247 248 qurl.obj: $(SOURCE_PATH)\src\corelib\io\qurl.cpp 249 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qurl.cpp 250 251 qtextstream.obj: $(SOURCE_PATH)\src\corelib\io\qtextstream.cpp 252 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qtextstream.cpp 253 254 qdatastream.obj: $(SOURCE_PATH)\src\corelib\io\qdatastream.cpp 255 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qdatastream.cpp 256 257 qiodevice.obj: $(SOURCE_PATH)\src\corelib\io\qiodevice.cpp 258 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qiodevice.cpp 259 260 qmalloc.obj: $(SOURCE_PATH)\src\corelib\global\qmalloc.cpp 261 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\global\qmalloc.cpp 262 263 qglobal.obj: $(SOURCE_PATH)\src\corelib\global\qglobal.cpp 264 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\global\qglobal.cpp 265 266 qhash.obj: $(SOURCE_PATH)\src\corelib\tools\qhash.cpp 267 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qhash.cpp 268 269 qbytearray.obj: $(SOURCE_PATH)\src\corelib\tools\qbytearray.cpp 270 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qbytearray.cpp 271 272 qcryptographichash.obj: $(SOURCE_PATH)\src\corelib\tools\qcryptographichash.cpp 273 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qcryptographichash.cpp 274 275 qvsnprintf.obj: $(SOURCE_PATH)\src\corelib\tools\qvsnprintf.cpp 276 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qvsnprintf.cpp 277 278 qbytearraymatcher.obj: $(SOURCE_PATH)\src\corelib\tools\qbytearraymatcher.cpp 279 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qbytearraymatcher.cpp 280 281 qchar.obj: $(SOURCE_PATH)\src\corelib\tools\qchar.cpp 282 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qchar.cpp 283 284 qutfcodec.obj: $(SOURCE_PATH)\src\corelib\codecs\qutfcodec.cpp 285 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\codecs\qutfcodec.cpp 286 287 qstring.obj: $(SOURCE_PATH)\src\corelib\tools\qstring.cpp 288 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qstring.cpp 289 290 qstringmatcher.obj: $(SOURCE_PATH)\src\corelib\tools\qstringmatcher.cpp 291 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qstringmatcher.cpp 292 293 qlocale.obj: $(SOURCE_PATH)\src\corelib\tools\qlocale.cpp 294 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qlocale.cpp 295 296 quuid.obj: $(SOURCE_PATH)\src\corelib\plugin\quuid.cpp 297 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\plugin\quuid.cpp 298 299 qbuffer.obj: $(SOURCE_PATH)\src\corelib\io\qbuffer.cpp 300 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qbuffer.cpp 301 302 qlist.obj: $(SOURCE_PATH)\src\corelib\tools\qlist.cpp 303 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qlist.cpp 304 305 qlinkedlist.obj: $(SOURCE_PATH)\src\corelib\tools\qlinkedlist.cpp 306 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qlinkedlist.cpp 307 308 qfile.obj: $(SOURCE_PATH)\src\corelib\io\qfile.cpp 309 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfile.cpp 310 311 qtemporaryfile.obj: $(SOURCE_PATH)\src\corelib\io\qtemporaryfile.cpp 312 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qtemporaryfile.cpp 313 314 qfsfileengine_win.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine_win.cpp 315 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfsfileengine_win.cpp 316 317 qfsfileengine_iterator_win.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator_win.cpp 318 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator_win.cpp 319 320 qfsfileengine.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine.cpp 321 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfsfileengine.cpp 322 323 qfsfileengine_iterator.obj: $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator.cpp 324 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfsfileengine_iterator.cpp 325 326 qabstractfileengine.obj: $(SOURCE_PATH)\src\corelib\io\qabstractfileengine.cpp 327 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qabstractfileengine.cpp 328 329 qtextcodec.obj: $(SOURCE_PATH)\src\corelib\codecs\qtextcodec.cpp 330 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\codecs\qtextcodec.cpp 331 332 qregexp.obj: $(SOURCE_PATH)\src\corelib\tools\qregexp.cpp 333 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qregexp.cpp 334 335 qvector.obj: $(SOURCE_PATH)\src\corelib\tools\qvector.cpp 336 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qvector.cpp 337 338 qbitarray.obj: $(SOURCE_PATH)\src\corelib\tools\qbitarray.cpp 339 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qbitarray.cpp 340 341 qdir.obj: $(SOURCE_PATH)\src\corelib\io\qdir.cpp 342 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qdir.cpp 343 344 qdiriterator.obj: $(SOURCE_PATH)\src\corelib\io\qdiriterator.cpp 345 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qdiriterator.cpp 346 347 qmetatype.obj: $(SOURCE_PATH)\src\corelib\kernel\qmetatype.cpp 348 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\kernel\qmetatype.cpp 349 350 qfileinfo.obj: $(SOURCE_PATH)\src\corelib\io\qfileinfo.cpp 351 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\io\qfileinfo.cpp 352 353 qdatetime.obj: $(SOURCE_PATH)\src\corelib\tools\qdatetime.cpp 354 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qdatetime.cpp 355 356 qstringlist.obj: $(SOURCE_PATH)\src\corelib\tools\qstringlist.cpp 357 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qstringlist.cpp 358 359 qmap.obj: $(SOURCE_PATH)\src\corelib\tools\qmap.cpp 360 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qmap.cpp 361 362 qunicodetables.obj: $(SOURCE_PATH)\src\corelib\tools\qunicodetables.cpp 363 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\tools\qunicodetables.cpp 364 365 makefile.obj: $(SOURCE_PATH)/qmake/generators\makefile.cpp 366 $(CXX) $(CXXFLAGS) generators\makefile.cpp 367 368 unixmake.obj: $(SOURCE_PATH)/qmake/generators\unix\unixmake.cpp 369 $(CXX) $(CXXFLAGS) generators\unix\unixmake.cpp 370 371 unixmake2.obj: $(SOURCE_PATH)/qmake/generators\unix\unixmake2.cpp 372 $(CXX) $(CXXFLAGS) generators\unix\unixmake2.cpp 373 374 winmakefile.obj: $(SOURCE_PATH)/qmake/generators/win32/winmakefile.cpp 375 $(CXX) $(CXXFLAGS) generators/win32/winmakefile.cpp 376 377 borland_bmake.obj: $(SOURCE_PATH)/qmake/generators/win32/borland_bmake.cpp 378 $(CXX) $(CXXFLAGS) generators/win32/borland_bmake.cpp 379 380 mingw_make.obj: $(SOURCE_PATH)/qmake/generators/win32/mingw_make.cpp 381 $(CXX) $(CXXFLAGS) generators/win32/mingw_make.cpp 382 383 msvc_nmake.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_nmake.cpp 384 $(CXX) $(CXXFLAGS) generators/win32/msvc_nmake.cpp 385 386 msvc_dsp.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_dsp.cpp 387 $(CXX) $(CXXFLAGS) generators/win32/msvc_dsp.cpp 388 389 msvc_vcproj.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp 390 $(CXX) $(CXXFLAGS) generators/win32/msvc_vcproj.cpp 391 392 msvc_objectmodel.obj: $(SOURCE_PATH)/qmake/generators/win32/msvc_objectmodel.cpp 393 $(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp 394 395 symmake.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp 396 $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp 397 398 symmake_abld.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_abld.cpp 399 $(CXX) $(CXXFLAGS) generators/symbian/symmake_abld.cpp 400 401 symmake_sbsv2.obj: $(SOURCE_PATH)/qmake/generators/symbian/symmake_sbsv2.cpp 402 $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp 403 404 initprojectdeploy_symbian.obj: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp 405 $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp 406 407 registry.obj: $(SOURCE_PATH)/tools/shared/windows/registry.cpp 408 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/tools/shared/windows/registry.cpp 409 410 epocroot.obj: $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp 411 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/tools/shared/symbian/epocroot.cpp 412 413 gnumake.obj: $(SOURCE_PATH)/qmake/generators/os2/gnumake.cpp 414 $(CXX) $(CXXFLAGS) generators/os2/gnumake.cpp 415 416 md5.obj: $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp 417 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\3rdparty\md5\md5.cpp 418 419 project.obj: $(SOURCE_PATH)/qmake/project.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h 420 $(CXX) $(CXXFLAGS) project.cpp 421 422 meta.obj: $(SOURCE_PATH)/qmake/meta.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h 423 $(CXX) $(CXXFLAGS) meta.cpp 424 425 main.obj: $(SOURCE_PATH)/qmake/main.cpp $(SOURCE_PATH)/qmake/project.h 426 $(CXX) $(CXXFLAGS) main.cpp 427 428 option.obj: $(SOURCE_PATH)/qmake/option.cpp $(SOURCE_PATH)/qmake/option.h 429 $(CXX) $(CXXFLAGS) option.cpp 430 431 property.obj: $(SOURCE_PATH)/qmake/property.cpp $(SOURCE_PATH)/qmake/project.h $(SOURCE_PATH)/qmake/option.h 432 $(CXX) $(CXXFLAGS) property.cpp 433 434 projectgenerator.obj: $(SOURCE_PATH)/qmake/generators/projectgenerator.cpp 435 $(CXX) $(CXXFLAGS) generators/projectgenerator.cpp 436 437 pbuilder_pbx.obj: $(SOURCE_PATH)/qmake/generators/mac/pbuilder_pbx.cpp 438 $(CXX) $(CXXFLAGS) generators/mac/pbuilder_pbx.cpp 439 440 makefiledeps.obj: $(SOURCE_PATH)/qmake/generators/makefiledeps.cpp 441 $(CXX) $(CXXFLAGS) generators/makefiledeps.cpp 442 443 metamakefile.obj: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp 444 $(CXX) $(CXXFLAGS) generators/metamakefile.cpp 445 446 xmloutput.obj: $(SOURCE_PATH)/qmake/generators/xmloutput.cpp 447 $(CXX) $(CXXFLAGS) generators/xmloutput.cpp 448 449 qxmlstream.obj: $(SOURCE_PATH)\src\corelib\xml\qxmlstream.cpp 450 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\xml\qxmlstream.cpp 451 452 qxmlutils.obj: $(SOURCE_PATH)\src\corelib\xml\qxmlutils.cpp 453 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\xml\qxmlutils.cpp 152 $(OBJS): qmake_pch.obj 153 154 qsystemlibrary.obj: $(SOURCE_PATH)\src\corelib\plugin\qsystemlibrary.cpp 155 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)\src\corelib\plugin\qsystemlibrary.cpp 156 157 $(QTOBJS): qmake_pch.obj 158 159 qmake_pch.obj: 160 $(CXX) $(CXXFLAGS_BARE) -c -Yc -Fpqmake_pch.pch -TP qmake_pch.h 161 162 {$(SOURCE_PATH)\qmake\generators\mac}.cpp{}.obj:: 163 $(CXX) $(CXXFLAGS) $< 164 165 {$(SOURCE_PATH)\qmake\generators\symbian}.cpp{}.obj:: 166 $(CXX) $(CXXFLAGS) $< 167 168 {$(SOURCE_PATH)\qmake\generators\unix}.cpp{}.obj:: 169 $(CXX) $(CXXFLAGS) $< 170 171 {$(SOURCE_PATH)\qmake\generators\win32}.cpp{}.obj:: 172 $(CXX) $(CXXFLAGS) $< 173 174 {$(SOURCE_PATH)\qmake\generators\os2}.cpp{}.obj:: 175 $(CXX) $(CXXFLAGS) $< 176 177 {$(SOURCE_PATH)\qmake\generators}.cpp{}.obj:: 178 $(CXX) $(CXXFLAGS) $< 179 180 {$(SOURCE_PATH)\qmake}.cpp{}.obj:: 181 $(CXX) $(CXXFLAGS) $< 182 183 {$(SOURCE_PATH)\src\3rdparty\md5}.cpp{}.obj:: 184 $(CXX) $(CXXFLAGS) $< 185 186 {$(SOURCE_PATH)\src\corelib\codecs}.cpp{}.obj:: 187 $(CXX) $(CXXFLAGS) $< 188 189 {$(SOURCE_PATH)\src\corelib\global}.cpp{}.obj:: 190 $(CXX) $(CXXFLAGS) $< 191 192 {$(SOURCE_PATH)\src\corelib\io}.cpp{}.obj:: 193 $(CXX) $(CXXFLAGS) $< 194 195 {$(SOURCE_PATH)\src\corelib\kernel}.cpp{}.obj:: 196 $(CXX) $(CXXFLAGS) $< 197 198 {$(SOURCE_PATH)\src\corelib\plugin}.cpp{}.obj:: 199 $(CXX) $(CXXFLAGS) $< 200 201 {$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj:: 202 $(CXX) $(CXXFLAGS) $< 203 204 {$(SOURCE_PATH)\src\corelib\xml}.cpp{}.obj:: 205 $(CXX) $(CXXFLAGS) $< 206 207 {$(SOURCE_PATH)\tools\shared\symbian}.cpp{}.obj:: 208 $(CXX) $(CXXFLAGS) $< 209 210 {$(SOURCE_PATH)\tools\shared\windows}.cpp{}.obj:: 211 $(CXX) $(CXXFLAGS) $< -
trunk/qmake/Makefile.win32-g++
r769 r846 26 26 -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ 27 27 -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ 28 -DQT_BOOTSTRAPPED 28 -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT 29 29 CXXFLAGS = $(CFLAGS) 30 LFLAGS = 30 LFLAGS = -static-libgcc -static-libstdc++ -s 31 31 LIBS = -lole32 -luuid 32 32 LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) … … 38 38 option.o winmakefile.o projectgenerator.o property.o meta.o \ 39 39 makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ 40 borland_bmake.o msvc_nmake.o msvc_dsp.o msvc_vcproj.o \ 41 msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \ 42 registry.o \ 43 epocroot.o \ 44 symmake_abld.o symmake_sbsv2.o gnumake.o 40 borland_bmake.o msvc_nmake.o msvc_vcproj.o msvc_vcxproj.o \ 41 msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o \ 42 symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o \ 43 gnumake.o 45 44 46 45 ifdef QMAKE_OPENSOURCE_EDITION … … 82 81 qstring.o \ 83 82 qstringlist.o \ 83 qsystemlibrary.o \ 84 84 qtextstream.o \ 85 85 quuid.o \ … … 237 237 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp 238 238 239 qsystemlibrary.o: $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp 240 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp 241 239 242 qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp 240 243 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qmap.cpp … … 261 264 $(CXX) $(CXXFLAGS) generators/win32/msvc_nmake.cpp 262 265 263 msvc_dsp.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_dsp.cpp264 $(CXX) $(CXXFLAGS) generators/win32/msvc_dsp.cpp265 266 266 msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp 267 267 $(CXX) $(CXXFLAGS) generators/win32/msvc_vcproj.cpp … … 270 270 $(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp 271 271 272 msvc_vcxproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcxproj.cpp 273 $(CXX) $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp 274 275 msbuild_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msbuild_objectmodel.cpp 276 $(CXX) $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp 277 272 278 symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp 273 279 $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp … … 279 285 $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp 280 286 287 symbiancommon.o: $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.cpp 288 $(CXX) $(CXXFLAGS) generators/symbian/symbiancommon.cpp 289 281 290 initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp 282 291 $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp … … 315 324 $(CXX) $(CXXFLAGS) generators/makefiledeps.cpp 316 325 317 metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp 326 metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp $(SOURCE_PATH)/qmake/generators/symbian/symbian_makefile.h 318 327 $(CXX) $(CXXFLAGS) generators/metamakefile.cpp 319 328 … … 326 335 qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp 327 336 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp 337 -
trunk/qmake/Makefile.win32-g++-sh
r769 r846 26 26 -DQT_NODLL -DQT_NO_STL -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP \ 27 27 -DQT_BUILD_QMAKE -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \ 28 -DQT_BOOTSTRAPPED 28 -DQT_BOOTSTRAPPED -DQLIBRARYINFO_EPOCROOT 29 29 CXXFLAGS = $(CFLAGS) 30 LFLAGS = 30 LFLAGS = -static-libgcc -static-libstdc++ -s 31 31 LIBS = -lole32 -luuid 32 32 LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS) … … 38 38 option.o winmakefile.o projectgenerator.o property.o meta.o \ 39 39 makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \ 40 borland_bmake.o msvc_nmake.o msvc_dsp.o msvc_vcproj.o \ 41 msvc_objectmodel.o symmake.o initprojectdeploy_symbian.o \ 42 registry.o \ 43 epocroot.o \ 44 symmake_abld.o symmake_sbsv2.o gnumake.o 40 borland_bmake.o msvc_nmake.o msvc_vcproj.o msvc_vcxproj.o \ 41 msvc_objectmodel.o msbuild_objectmodel.o symmake.o initprojectdeploy_symbian.o \ 42 symmake_abld.o symmake_sbsv2.o symbiancommon.o registry.o epocroot.o \ 43 gnumake.o 45 44 46 45 ifdef QMAKE_OPENSOURCE_EDITION … … 82 81 qstring.o \ 83 82 qstringlist.o \ 83 qsystemlibrary.o \ 84 84 qtextstream.o \ 85 85 quuid.o \ … … 236 236 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qstringlist.cpp 237 237 238 qsystemlibrary.o: $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp 239 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp 240 238 241 qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp 239 242 $(CXX) $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qmap.cpp … … 260 263 $(CXX) $(CXXFLAGS) generators/win32/msvc_nmake.cpp 261 264 262 msvc_dsp.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_dsp.cpp263 $(CXX) $(CXXFLAGS) generators/win32/msvc_dsp.cpp264 265 265 msvc_vcproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcproj.cpp 266 266 $(CXX) $(CXXFLAGS) generators/win32/msvc_vcproj.cpp … … 269 269 $(CXX) $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp 270 270 271 msvc_vcxproj.o: $(SOURCE_PATH)/qmake/generators/win32/msvc_vcxproj.cpp 272 $(CXX) $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp 273 274 msbuild_objectmodel.o: $(SOURCE_PATH)/qmake/generators/win32/msbuild_objectmodel.cpp 275 $(CXX) $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp 276 271 277 symmake.o: $(SOURCE_PATH)/qmake/generators/symbian/symmake.cpp 272 278 $(CXX) $(CXXFLAGS) generators/symbian/symmake.cpp … … 278 284 $(CXX) $(CXXFLAGS) generators/symbian/symmake_sbsv2.cpp 279 285 286 symbiancommon.o: $(SOURCE_PATH)/qmake/generators/symbian/symbiancommon.cpp 287 $(CXX) $(CXXFLAGS) generators/symbian/symbiancommon.cpp 288 280 289 initprojectdeploy_symbian.o: $(SOURCE_PATH)/qmake/generators/symbian/initprojectdeploy_symbian.cpp 281 290 $(CXX) $(CXXFLAGS) generators/symbian/initprojectdeploy_symbian.cpp … … 314 323 $(CXX) $(CXXFLAGS) generators/makefiledeps.cpp 315 324 316 metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp 325 metamakefile.o: $(SOURCE_PATH)/qmake/generators/metamakefile.cpp $(SOURCE_PATH)/qmake/generators/symbian/symbian_makefile.h 317 326 $(CXX) $(CXXFLAGS) generators/metamakefile.cpp 318 327 -
trunk/qmake/cachekeys.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/generators/mac/pbuilder_pbx.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 524 524 QTextStream mkt(&mkf); 525 525 writeHeader(mkt); 526 mkt << "QMAKE = " << (project->isEmpty("QMAKE_QMAKE") ? 527 QString((QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmake")) : 528 var("QMAKE_QMAKE")) << endl; 526 mkt << "QMAKE = " << var("QMAKE_QMAKE") << endl; 529 527 writeMakeQmake(mkt); 530 528 mkt.flush(); … … 543 541 << "\t\t\t" << writeSettings("neededFileNames", QStringList(), SettingsAsList, 4) << ";" << "\n" 544 542 << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";" << "\n" 545 << "\t\t\t" << writeSettings("shellScript", fixForOutput("make -C " + escapeFilePath(qmake_getpwd()) + " -f " + escapeFilePath(mkfile))) << ";" << "\n"543 << "\t\t\t" << writeSettings("shellScript", fixForOutput("make -C " + escapeFilePath(qmake_getpwd()) + " -f '" + escapeFilePath(mkfile) + "'")) << ";" << "\n" 546 544 << "\t\t" << "};" << "\n"; 547 545 } … … 792 790 << "\t\t\t" << writeSettings("neededFileNames", fixListForOutput("QMAKE_PBX_OBJ"), SettingsAsList, 4) << ";" << "\n" 793 791 << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";" << "\n" 794 << "\t\t\t" << writeSettings("shellScript", fixForOutput("make -C " + escapeFilePath(qmake_getpwd()) + " -f " + escapeFilePath(mkfile))) << ";" << "\n"792 << "\t\t\t" << writeSettings("shellScript", fixForOutput("make -C " + escapeFilePath(qmake_getpwd()) + " -f '" + escapeFilePath(mkfile) + "'")) << ";" << "\n" 795 793 << "\t\t" << "};" << "\n"; 796 794 } … … 971 969 << "\t\t\t" << writeSettings("neededFileNames", QStringList(), SettingsAsList, 4) << ";" << "\n" 972 970 << "\t\t\t" << writeSettings("shellPath", "/bin/sh") << "\n" 973 << "\t\t\t" << writeSettings("shellScript", fixForOutput("make -C " + escapeFilePath(qmake_getpwd()) + " -f " + escapeFilePath(mkfile))) << ";" << "\n"971 << "\t\t\t" << writeSettings("shellScript", fixForOutput("make -C " + escapeFilePath(qmake_getpwd()) + " -f '" + escapeFilePath(mkfile) + "'")) << ";" << "\n" 974 972 << "\t\t" << "};" << "\n"; 975 973 } -
trunk/qmake/generators/mac/pbuilder_pbx.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/generators/makefile.cpp
r773 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 467 467 const QStringList &subs = v["QMAKE_SUBSTITUTES"]; 468 468 for(int i = 0; i < subs.size(); ++i) { 469 if(!subs.at(i).endsWith(".in")) { 470 warn_msg(WarnLogic, "Substitute '%s' does not end with '.in'", 471 subs.at(i).toLatin1().constData()); 472 continue; 473 } 474 QFile in(fileFixify(subs.at(i))), out(fileInfo(subs.at(i)).fileName()); 475 if(out.fileName().endsWith(".in")) 476 out.setFileName(out.fileName().left(out.fileName().length()-3)); 469 QString inn = subs.at(i) + ".input", outn = subs.at(i) + ".output"; 470 if (v.contains(inn) || v.contains(outn)) { 471 if (!v.contains(inn) || !v.contains(outn)) { 472 warn_msg(WarnLogic, "Substitute '%s' has only one of .input and .output", 473 subs.at(i).toLatin1().constData()); 474 continue; 475 } 476 const QStringList &tinn = v[inn], &toutn = v[outn]; 477 if (tinn.length() != 1) { 478 warn_msg(WarnLogic, "Substitute '%s.input' does not have exactly one value", 479 subs.at(i).toLatin1().constData()); 480 continue; 481 } 482 if (toutn.length() != 1) { 483 warn_msg(WarnLogic, "Substitute '%s.output' does not have exactly one value", 484 subs.at(i).toLatin1().constData()); 485 continue; 486 } 487 inn = tinn.first(); 488 outn = toutn.first(); 489 } else { 490 inn = subs.at(i); 491 if(!inn.endsWith(".in")) { 492 warn_msg(WarnLogic, "Substitute '%s' does not end with '.in'", 493 inn.toLatin1().constData()); 494 continue; 495 } 496 outn = inn.left(inn.length()-3); 497 } 498 QFile in(fileFixify(inn)); 499 QFile out(fileFixify(outn, qmake_getpwd(), Option::output_dir)); 477 500 if(in.open(QFile::ReadOnly)) { 478 501 QString contents; … … 529 552 QString old = QString::fromUtf8(out.readAll()); 530 553 if(contents == old) { 531 v["QMAKE_INTERNAL_INCLUDED_FILES"].append( subs.at(i));554 v["QMAKE_INTERNAL_INCLUDED_FILES"].append(in.fileName()); 532 555 continue; 533 556 } … … 539 562 } 540 563 } 564 mkdir(QFileInfo(out).absolutePath()); 541 565 if(out.open(QFile::WriteOnly)) { 542 v["QMAKE_INTERNAL_INCLUDED_FILES"].append( subs.at(i));566 v["QMAKE_INTERNAL_INCLUDED_FILES"].append(in.fileName()); 543 567 out.write(contents.toUtf8()); 544 568 } else { … … 807 831 808 832 // escape qmake command 809 if (!project->isEmpty("QMAKE_QMAKE")) { 810 project->values("QMAKE_QMAKE") = escapeFilePaths(project->values("QMAKE_QMAKE")); 811 } 833 QStringList &qmk = project->values("QMAKE_QMAKE"); 834 qmk = escapeFilePaths(qmk); 812 835 } 813 836 … … 982 1005 libs << "QMAKE_LIBS_PRIVATE"; 983 1006 for(QStringList::Iterator it = libs.begin(); it != libs.end(); ++it) 984 t << project->values((*it)).join(" ") << " ";1007 t << project->values((*it)).join(" ").replace('\\', "\\\\") << " "; 985 1008 } 986 1009 t << endl; … … 1276 1299 if(!dirstr.endsWith(Option::dir_sep)) 1277 1300 dirstr += Option::dir_sep; 1278 if(exists(wild)) { //real file 1301 bool is_target = (wild == fileFixify(var("TARGET"), FileFixifyAbsolute)); 1302 if(is_target || exists(wild)) { //real file or target 1279 1303 QString file = wild; 1280 1304 QFileInfo fi(fileInfo(wild)); … … 1290 1314 if (fi.isDir()) 1291 1315 cmd = inst_prefix + "$(INSTALL_DIR)"; 1292 else if ( fi.isExecutable())1316 else if (is_target || fi.isExecutable()) 1293 1317 cmd = inst_prefix + "$(INSTALL_PROGRAM)"; 1294 1318 else … … 1786 1810 QStringList tmp_dep = project->values((*it) + ".depends"); 1787 1811 QString tmp_dep_cmd; 1812 QString dep_cd_cmd; 1788 1813 if(!project->isEmpty((*it) + ".depend_command")) { 1789 1814 int argv0 = -1; … … 1799 1824 if(exists(c)) { 1800 1825 cmdline[argv0] = escapeFilePath(Option::fixPathToLocalOS(cmdline.at(argv0), false)); 1801 tmp_dep_cmd = cmdline.join(" ");1802 1826 } else { 1803 1827 cmdline[argv0] = escapeFilePath(cmdline.at(argv0)); 1804 1828 } 1805 } 1829 QFileInfo cmdFileInfo(cmdline[argv0]); 1830 if (!cmdFileInfo.isAbsolute() || cmdFileInfo.exists()) 1831 tmp_dep_cmd = cmdline.join(" "); 1832 } 1833 dep_cd_cmd = QLatin1String("cd ") 1834 + escapeFilePath(Option::fixPathToLocalOS(Option::output_dir, false)) 1835 + QLatin1String(" && "); 1806 1836 } 1807 1837 QStringList &vars = project->values((*it) + ".variables"); … … 1860 1890 if(tmp_clean.indexOf("${QMAKE_") == -1) { 1861 1891 t << "\n\t" << del_statement << " " << tmp_clean << del_suffix; 1862 if (isForSymbian())1863 t << " 2> NUL"; // Eliminate unnecessary warnings1864 1892 wrote_clean = true; 1865 1893 } … … 1919 1947 QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input), 1920 1948 tmp_out); 1921 dep_cmd = fixEnvVariables(dep_cmd);1949 dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd); 1922 1950 if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { 1923 1951 QString indeps; … … 2017 2045 char buff[256]; 2018 2046 QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input), out); 2019 dep_cmd = fixEnvVariables(dep_cmd);2047 dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd); 2020 2048 if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) { 2021 2049 QString indeps; … … 2154 2182 MakefileGenerator::writeStubMakefile(QTextStream &t) 2155 2183 { 2156 t << "QMAKE = " << (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE")) << endl;2184 t << "QMAKE = " << var("QMAKE_QMAKE") << endl; 2157 2185 QStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); 2158 2186 for(QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) … … 2209 2237 if(!Option::mkfile::qmakespec_commandline.isEmpty()) 2210 2238 ret += " -spec " + specdir(outdir); 2211 if (Option::target_mode == Option::TARG_MAC9_MODE)2212 ret += " -mac9";2213 else if(Option::target_mode == Option::TARG_MACX_MODE)2214 ret += " -macx";2215 else if(Option::target_mode == Option::TARG_UNIX_MODE)2216 ret += " -unix";2217 else if(Option::target_mode == Option::TARG_WIN_MODE)2218 ret += " -win32";2239 if (Option::target_mode_overridden) { 2240 if (Option::target_mode == Option::TARG_MACX_MODE) 2241 ret += " -macx"; 2242 else if (Option::target_mode == Option::TARG_UNIX_MODE) 2243 ret += " -unix"; 2244 else if (Option::target_mode == Option::TARG_WIN_MODE) 2245 ret += " -win32"; 2246 } 2219 2247 else if(Option::target_mode == Option::TARG_OS2_MODE) 2220 2248 ret += " -os2"; … … 2271 2299 t << "# Template: " << var("TEMPLATE") << endl; 2272 2300 if(!project->isActiveConfig("build_pass")) 2273 t << "# Command: " << build_args().replace("$(QMAKE)", 2274 (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE"))) << endl; 2301 t << "# Command: " << build_args().replace("$(QMAKE)", var("QMAKE_QMAKE")) << endl; 2275 2302 t << "#############################################################################" << endl; 2276 2303 t << endl; … … 2405 2432 /* Calling Option::fixPathToTargetOS() is necessary for MinGW/MSYS, which requires 2406 2433 * back-slashes to be turned into slashes. */ 2407 t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl;2434 t << "QMAKE = " << var("QMAKE_QMAKE") << endl; 2408 2435 t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; 2409 2436 t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl; … … 2733 2760 if(exists(Option::fixPathToLocalOS(specdir()+QDir::separator()+"qmake.conf"))) 2734 2761 t << escapeDependencyPath(specdir() + Option::dir_sep + "qmake.conf") << " "; 2735 else if(exists(Option::fixPathToLocalOS(specdir()+QDir::separator()+"tmake.conf")))2736 t << escapeDependencyPath(specdir() + Option::dir_sep + "tmake.conf") << " ";2737 2762 } 2738 2763 const QStringList &included = project->values("QMAKE_INTERNAL_INCLUDED_FILES"); -
trunk/qmake/generators/makefile.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 248 248 virtual bool mergeBuildProject(MakefileGenerator * /*other*/) { return false; } 249 249 virtual bool openOutput(QFile &, const QString &build) const; 250 virtual bool isDosLikeShell() const { return Option::target_mode == Option::TARG_WIN_MODE || 251 Option::target_mode == Option::TARG_OS2_MODE; } 250 virtual bool isDosLikeShell() const { return Option::host_mode == Option::HOST_WIN_MODE || 251 Option::host_mode == Option::HOST_OS2_MODE; } 252 virtual bool isForSymbianSbsv2() const { return false; } // FIXME: killme - i'm ugly! 253 254 /* The next one is to avoid having SymbianCommonGenerator as a virtually 255 inherited class of this class. Instead it is without a base class 256 (avoiding the virtual inheritance problem), and is allowed to use 257 functions defined in here. 258 259 To illustrate: 260 +-------------------+ 261 | MakefileGenerator | 262 +-------------------+ 263 ^ ^ 264 | | 265 | X <-- Avoid this inheritance 266 | | 267 +------------------------+ +------------------------+ 268 | UnixMakefileGenerator | | SymbianCommonGenerator | 269 | or | | | 270 | NmakeMakefileGenerator | | | 271 +------------------------+ +------------------------+ 272 ^ ^ 273 | | 274 | | 275 | | 276 +-----------------------------+ 277 | SymbianMakefileTemplate<> | 278 +-----------------------------+ 279 280 We want to avoid the famous diamond problem, because if we have that, we need 281 virtual inheritance, which not all compilers like. Therefore, we break the 282 link as illustrated. Instead, we have a pointer to MakefileGenerator inside 283 SymbianCommonGenerator, and allows full access by making it a friend here. 284 */ 285 friend class SymbianCommonGenerator; 252 286 }; 253 287 -
trunk/qmake/generators/makefiledeps.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/generators/makefiledeps.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/generators/metamakefile.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 58 58 delete project; 59 59 } 60 61 #ifndef QT_QMAKE_PARSER_ONLY 60 62 61 63 class BuildsMetaMakefileGenerator : public MetaMakefileGenerator … … 294 296 bool hasError = false; 295 297 296 if(Option::recursive) { 298 // It might make sense to bequeath the CONFIG option to the recursed 299 // projects. OTOH, one would most likely have it in all projects anyway - 300 // either through a qmakespec, a .qmake.cache or explicitly - as otherwise 301 // running qmake in a subdirectory would have a different auto-recurse 302 // setting than in parent directories. 303 bool recurse = Option::recursive == Option::QMAKE_RECURSIVE_YES 304 || (Option::recursive == Option::QMAKE_RECURSIVE_DEFAULT 305 && project->isRecursive()); 306 if(recurse) { 297 307 QString old_output_dir = Option::output_dir; 298 308 QString old_output = Option::output.fileName(); … … 376 386 self->input_dir = qmake_getpwd(); 377 387 self->output_dir = Option::output_dir; 378 if(! Option::recursive || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir()))388 if(!recurse || (!Option::output.fileName().endsWith(Option::dir_sep) && !QFileInfo(Option::output).isDir())) 379 389 self->output_file = Option::output.fileName(); 380 390 self->makefile = new BuildsMetaMakefileGenerator(project, name, false); … … 434 444 #include "msvc_nmake.h" 435 445 #include "borland_bmake.h" 436 #include "msvc_dsp.h"437 446 #include "msvc_vcproj.h" 447 #include "msvc_vcxproj.h" 438 448 #include "symmake_abld.h" 439 449 #include "symmake_sbsv2.h" 450 #include "symbian_makefile.h" 440 451 QT_END_INCLUDE_NAMESPACE 441 452 … … 462 473 } else if(gen == "PROJECTBUILDER" || gen == "XCODE") { 463 474 mkfile = new ProjectBuilderMakefileGenerator; 464 } else if(gen == "MSVC") { 465 // Visual Studio =< v6.0 466 if(proj->first("TEMPLATE").indexOf(QRegExp("^vc.*")) != -1) 467 mkfile = new DspMakefileGenerator; 475 } else if(gen == "MSVC.NET") { 476 if (proj->first("TEMPLATE").startsWith("vc")) 477 mkfile = new VcprojGenerator; 468 478 else 469 479 mkfile = new NmakeMakefileGenerator; 470 } else if(gen == "MS VC.NET") {471 // Visual Studio >= v 7.0472 if (proj->first("TEMPLATE").indexOf(QRegExp("^vc.*")) != -1 || proj->first("TEMPLATE").indexOf(QRegExp("^ce.*")) != -1)473 mkfile = new Vc projGenerator;480 } else if(gen == "MSBUILD") { 481 // Visual Studio >= v11.0 482 if (proj->first("TEMPLATE").startsWith("vc")) 483 mkfile = new VcxprojGenerator; 474 484 else 475 485 mkfile = new NmakeMakefileGenerator; … … 480 490 } else if(gen == "SYMBIAN_SBSV2") { 481 491 mkfile = new SymbianSbsv2MakefileGenerator; 492 } else if(gen == "SYMBIAN_UNIX") { 493 mkfile = new SymbianMakefileTemplate<UnixMakefileGenerator>; 482 494 } else { 483 495 fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData()); … … 507 519 } 508 520 521 #endif // QT_QMAKE_PARSER_ONLY 522 523 bool 524 MetaMakefileGenerator::modesForGenerator(const QString &gen, 525 Option::HOST_MODE *host_mode, Option::TARG_MODE *target_mode) 526 { 527 if (gen == "UNIX") { 528 #ifdef Q_OS_MAC 529 *host_mode = Option::HOST_MACX_MODE; 530 *target_mode = Option::TARG_MACX_MODE; 531 #else 532 *host_mode = Option::HOST_UNIX_MODE; 533 *target_mode = Option::TARG_UNIX_MODE; 534 #endif 535 } else if (gen == "MSVC.NET" || gen == "BMAKE" || gen == "MSBUILD") { 536 *host_mode = Option::HOST_WIN_MODE; 537 *target_mode = Option::TARG_WIN_MODE; 538 } else if (gen == "MINGW") { 539 #if defined(Q_OS_MAC) 540 *host_mode = Option::HOST_MACX_MODE; 541 #elif defined(Q_OS_UNIX) 542 *host_mode = Option::HOST_UNIX_MODE; 543 #else 544 *host_mode = Option::HOST_WIN_MODE; 545 #endif 546 *target_mode = Option::TARG_WIN_MODE; 547 } else if (gen == "PROJECTBUILDER" || gen == "XCODE") { 548 *host_mode = Option::HOST_MACX_MODE; 549 *target_mode = Option::TARG_MACX_MODE; 550 } else if (gen == "SYMBIAN_ABLD" || gen == "SYMBIAN_SBSV2" || gen == "SYMBIAN_UNIX") { 551 #if defined(Q_OS_MAC) 552 *host_mode = Option::HOST_MACX_MODE; 553 #elif defined(Q_OS_UNIX) 554 *host_mode = Option::HOST_UNIX_MODE; 555 #else 556 *host_mode = Option::HOST_WIN_MODE; 557 #endif 558 *target_mode = Option::TARG_SYMBIAN_MODE; 559 } else { 560 fprintf(stderr, "Unknown generator specified: %s\n", gen.toLatin1().constData()); 561 return false; 562 } 563 return true; 564 } 565 509 566 QT_END_NAMESPACE -
trunk/qmake/generators/metamakefile.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 43 43 #define METAMAKEFILE_H 44 44 45 #include <option.h> 46 45 47 #include <qlist.h> 46 48 #include <qstring.h> … … 66 68 static MakefileGenerator *createMakefileGenerator(QMakeProject *proj, bool noIO = false); 67 69 70 static bool modesForGenerator(const QString &generator, 71 Option::HOST_MODE *host_mode, Option::TARG_MODE *target_mode); 72 68 73 inline QMakeProject *projectFile() const { return project; } 69 74 -
trunk/qmake/generators/projectgenerator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 112 112 if(dir.right(1) != Option::dir_sep) 113 113 dir += Option::dir_sep; 114 if(Option::recursive ) {114 if(Option::recursive == Option::QMAKE_RECURSIVE_YES) { 115 115 QStringList files = QDir(dir).entryList(QDir::Files); 116 116 for(int i = 0; i < (int)files.count(); i++) { … … 139 139 regex = regex.right(regex.length() - (s+1)); 140 140 } 141 if(Option::recursive ) {141 if(Option::recursive == Option::QMAKE_RECURSIVE_YES) { 142 142 QStringList entries = QDir(dir).entryList(QDir::Dirs); 143 143 for(int i = 0; i < (int)entries.count(); i++) { … … 194 194 } 195 195 } 196 if(Option::recursive ) {196 if(Option::recursive == Option::QMAKE_RECURSIVE_YES) { 197 197 QStringList dirs = QDir(newdir).entryList(QDir::Dirs); 198 198 for(int i = 0; i < (int)dirs.count(); i++) { … … 231 231 } 232 232 } 233 if(Option::recursive && !knownDirs.contains(newdir, Qt::CaseInsensitive)) 233 if(Option::recursive == Option::QMAKE_RECURSIVE_YES 234 && !knownDirs.contains(newdir, Qt::CaseInsensitive)) 234 235 knownDirs.append(newdir); 235 236 } -
trunk/qmake/generators/projectgenerator.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/generators/symbian/initprojectdeploy_symbian.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 48 48 49 49 // Included from tools/shared 50 #include <symbian/epocroot .h>50 #include <symbian/epocroot_p.h> 51 51 52 52 #define SYSBIN_DIR "/sys/bin" 53 #define HW_Z_DIR "epoc32/data/z" 53 54 54 55 #define SUFFIX_DLL "dll" … … 59 60 { 60 61 QString ret = Option::fixPathToTargetOS(src); 61 return ret.replace('/', '\\'); 62 63 bool pathHasDriveLetter = false; 64 if (ret.size() > 1) 65 pathHasDriveLetter = (ret.at(1) == QLatin1Char(':')); 66 67 return pathHasDriveLetter ? ret.replace('/', '\\') : QDir::toNativeSeparators(ret); 62 68 } 63 69 … … 66 72 // Libraries are plugins if deployment path is something else than 67 73 // SYSBIN_DIR with or without drive letter 68 if (0 == info.suffix().compare(QLatin1String(SUFFIX_DLL), Qt::CaseInsensitive) && 69 (devicePath.size() < 8 || 70 (0 != devicePath.compare(QLatin1String(SYSBIN_DIR), Qt::CaseInsensitive) && 71 0 != devicePath.mid(1).compare(QLatin1String(":" SYSBIN_DIR), Qt::CaseInsensitive)))) { 74 if (0 == info.suffix().compare(QLatin1String(SUFFIX_DLL), Qt::CaseInsensitive) 75 && (devicePath.size() < 8 76 || (0 != devicePath.compare(QLatin1String(SYSBIN_DIR), Qt::CaseInsensitive) 77 && 0 != devicePath.mid(1).compare(QLatin1String(":" SYSBIN_DIR), Qt::CaseInsensitive) 78 && 0 != devicePath.compare(qt_epocRoot() + QLatin1String(HW_Z_DIR SYSBIN_DIR))))) { 72 79 return true; 73 80 } else { … … 92 99 QStringList& generatedFiles) 93 100 { 94 QDir().mkpath(QLatin1String(PLUGIN_STUB_DIR)); 95 if (!generatedDirs.contains(PLUGIN_STUB_DIR)) 96 generatedDirs << PLUGIN_STUB_DIR; 101 QString pluginStubDir = Option::output_dir + QLatin1Char('/') + QLatin1String(PLUGIN_STUB_DIR); 102 QDir().mkpath(pluginStubDir); 103 if (!generatedDirs.contains(pluginStubDir)) 104 generatedDirs << pluginStubDir; 97 105 // Plugin stubs must have different name from the actual plugins, because 98 106 // the toolchain for creating ROM images cannot handle non-binary .dll files properly. 99 QFile stubFile( QLatin1String(PLUGIN_STUB_DIR "/") + info.completeBaseName() + "." SUFFIX_QTPLUGIN);107 QFile stubFile(pluginStubDir + QLatin1Char('/') + info.completeBaseName() + QLatin1Char('.') + QLatin1String(SUFFIX_QTPLUGIN)); 100 108 if (stubFile.open(QIODevice::WriteOnly)) { 101 109 if (!generatedFiles.contains(stubFile.fileName())) … … 156 164 const QString &testPath, 157 165 bool deployBinaries, 166 bool epocBuild, 158 167 const QString &platform, 159 168 const QString &build, … … 171 180 targetPathHasDriveLetter = targetPath.at(1) == QLatin1Char(':'); 172 181 } 173 QString deploymentDrive = targetPathHasDriveLetter ? targetPath.left(2) : QLatin1String("c:"); 182 183 QString deploymentDrive; 184 if (0 == platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { 185 deploymentDrive = qt_epocRoot() + HW_Z_DIR; 186 } else { 187 deploymentDrive = targetPathHasDriveLetter ? targetPath.left(2) : QLatin1String("c:"); 188 } 174 189 175 190 foreach(QString item, project->values("DEPLOYMENT")) { … … 189 204 } 190 205 if (!deployBinaries 206 && 0 != platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM)) 191 207 && !devicePathWithoutDrive.isEmpty() 192 208 && (0 == devicePathWithoutDrive.compare(project->values("APP_RESOURCE_DIR").join(""), Qt::CaseInsensitive) … … 208 224 devicePath = Option::fixPathToLocalOS(QDir::cleanPath(targetPath + QLatin1Char('/') + devicePath)); 209 225 } else { 210 if ( !platform.compare(QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM))) {226 if (0 == platform.compare(QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM))) { 211 227 if (devicePathHasDriveLetter) { 212 devicePath = epocRoot() + "epoc32/winscw/" + devicePath.remove(1, 1);228 devicePath = qt_epocRoot() + "epoc32/winscw/" + devicePath.remove(1, 1); 213 229 } else { 214 devicePath = epocRoot() + "epoc32/winscw/c" + devicePath;230 devicePath = qt_epocRoot() + "epoc32/winscw/c" + devicePath; 215 231 } 216 232 } else { 217 if (!devicePathHasDriveLetter) { 218 if (!platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { 219 //For plugin deployment under ARM no needed drive letter 220 devicePath = epocRoot() + "epoc32/data/z" + devicePath; 221 } else if (targetPathHasDriveLetter) { 222 // Drive letter needed if targetpath contains one and it is not already in 223 devicePath = deploymentDrive + devicePath; 224 } 225 } else { 226 //it is necessary to delete drive letter for ARM deployment 227 if (!platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { 228 devicePath.remove(0,2); 229 devicePath = epocRoot() + "epoc32/data/z" + devicePath; 230 } 233 if (devicePathHasDriveLetter 234 && 0 == platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { 235 devicePath.remove(0,2); 236 } 237 if (0 == platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM)) 238 || (!devicePathHasDriveLetter && targetPathHasDriveLetter)) { 239 devicePath = deploymentDrive + devicePath; 231 240 } 232 241 } … … 235 244 devicePath.replace(QLatin1String("\\"), QLatin1String("/")); 236 245 237 if (!deployBinaries && 238 0 == devicePath.right(8).compare(QLatin1String(SYSBIN_DIR), Qt::CaseInsensitive)) { 246 if (!deployBinaries 247 && 0 == devicePath.right(8).compare(QLatin1String(SYSBIN_DIR), Qt::CaseInsensitive) 248 && 0 != platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { 239 249 // Skip deploying to SYSBIN_DIR for anything but binary deployments 240 250 // Note: Deploying pre-built binaries also follow this rule, so emulator builds … … 243 253 continue; 244 254 } 255 256 QStringList flags = project->values(item + ".flags"); 245 257 246 258 foreach(QString source, project->values(item + ".sources")) { … … 265 277 if (deployBinaries) { 266 278 // Executables and libraries are deployed to \sys\bin 267 QFileInfo targetPath(epocRoot() + "epoc32/release/" + platform + "/" + build + "/"); 279 QFileInfo targetPath; 280 if (epocBuild) 281 targetPath.setFile(qt_epocRoot() + "epoc32/release/" + platform + "/" + build + "/"); 282 else 283 targetPath.setFile(info.path() + QDir::separator()); 268 284 if(devicePathHasDriveLetter) { 269 285 deploymentList.append(CopyItem( … … 271 287 false, true), 272 288 fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/") 273 + info.fileName()))); 289 + info.fileName()), 290 flags)); 274 291 } else { 275 292 deploymentList.append(CopyItem( 276 293 Option::fixPathToLocalOS(targetPath.absolutePath() + "/" + info.fileName(), 277 294 false, true), 278 fixPathToEpocOS(deploymentDrive + QLatin1String(SYSBIN_DIR "/") 279 + info.fileName()))); 295 fixPathToEpocOS(deploymentDrive + QLatin1String("/" SYSBIN_DIR "/") 296 + info.fileName()), 297 flags)); 280 298 } 281 299 } … … 288 306 // when generating .pkg files. 289 307 deploymentList.append(CopyItem(Option::fixPathToLocalOS(info.absoluteFilePath()), 290 fixPathToEpocOS(devicePath + "/" + info.fileName()))); 308 fixPathToEpocOS(devicePath + "/" + info.fileName()), 309 flags)); 291 310 continue; 292 311 } … … 309 328 // This deploys pre-built plugins. Other pre-built binaries will deploy normally, 310 329 // as they have SYSBIN_DIR target path. 311 if (deployBinaries) { 330 if (deployBinaries 331 || (0 == platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM)))) { 312 332 if (devicePathHasDriveLetter) { 313 333 deploymentList.append(CopyItem( 314 334 Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), 315 335 fixPathToEpocOS(devicePath.left(2) + QLatin1String(SYSBIN_DIR "/") 316 + iterator.fileName()))); 336 + iterator.fileName()), 337 flags)); 317 338 } else { 318 339 deploymentList.append(CopyItem( 319 340 Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), 320 fixPathToEpocOS(deploymentDrive + QLatin1String(SYSBIN_DIR "/") 321 + iterator.fileName()))); 341 fixPathToEpocOS(deploymentDrive + QLatin1String("/" SYSBIN_DIR "/") 342 + iterator.fileName()), 343 flags)); 322 344 } 323 345 } … … 329 351 Option::fixPathToLocalOS(absoluteItemPath + "/" + iterator.fileName()), 330 352 fixPathToEpocOS(devicePath + "/" + absoluteItemPath.right(diffSize) 331 + "/" + iterator.fileName()))); 353 + "/" + iterator.fileName()), 354 flags)); 332 355 } 333 356 } … … 335 358 } 336 359 } 337 } 360 361 // Remove deployments that do not actually do anything 362 if (0 == platform.compare(QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM)) 363 || 0 == platform.compare(QLatin1String(ROM_DEPLOYMENT_PLATFORM))) { 364 QMutableListIterator<CopyItem> i(deploymentList); 365 while(i.hasNext()) { 366 CopyItem &item = i.next(); 367 QFileInfo fromItem(item.from); 368 QFileInfo toItem(item.to); 369 #if defined(Q_OS_WIN) 370 if (0 == fromItem.absoluteFilePath().compare(toItem.absoluteFilePath(), Qt::CaseInsensitive)) 371 #else 372 if (0 == fromItem.absoluteFilePath().compare(toItem.absoluteFilePath())) 373 #endif 374 i.remove(); 375 } 376 } 377 } -
trunk/qmake/generators/symbian/initprojectdeploy_symbian.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 57 57 struct CopyItem 58 58 { 59 CopyItem(const QString& f, const QString& t) : from(f) , to(t) { } 59 CopyItem(const QString& f, const QString& t) 60 : from(f) , to(t) { } 61 CopyItem(const QString& f, const QString& t, const QStringList& l) 62 : from(f) , to(t), flags(l) { } 60 63 QString from; 61 64 QString to; 65 QStringList flags; 62 66 }; 63 67 typedef QList<CopyItem> DeploymentList; … … 70 74 const QString &testPath, 71 75 bool deployBinaries, 76 bool epocBuild, 72 77 const QString &platform, 73 78 const QString &build, -
trunk/qmake/generators/symbian/symmake.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 51 51 52 52 // Included from tools/shared 53 #include <symbian/epocroot .h>53 #include <symbian/epocroot_p.h> 54 54 55 55 #define RESOURCE_DIRECTORY_MMP "/resource/apps" 56 #define RESOURCE_DIRECTORY_RESOURCE "\\\\resource\\\\apps\\\\"57 56 #define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps" 58 57 #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def" 59 #define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonU.def"58 #define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1) 60 59 61 60 #define BLD_INF_RULES_BASE "BLD_INF_RULES." … … 65 64 #define BLD_INF_TAG_EXTENSIONS "prj_extensions" 66 65 #define BLD_INF_TAG_TESTEXTENSIONS "prj_testextensions" 67 68 #define RSS_RULES "RSS_RULES"69 #define RSS_RULES_BASE "RSS_RULES."70 #define RSS_TAG_NBROFICONS "number_of_icons"71 #define RSS_TAG_ICONFILE "icon_file"72 #define RSS_TAG_HEADER "header"73 #define RSS_TAG_SERVICE_LIST "service_list"74 #define RSS_TAG_FILE_OWNERSHIP_LIST "file_ownership_list"75 #define RSS_TAG_DATATYPE_LIST "datatype_list"76 #define RSS_TAG_FOOTER "footer"77 #define RSS_TAG_DEFAULT "default_rules" // Same as just giving rules without tag78 66 79 67 #define MMP_TARGET "TARGET" … … 96 84 #define VAR_LFLAGS "QMAKE_LFLAGS" 97 85 98 #define SIS_TARGET "sis" 99 #define INSTALLER_SIS_TARGET "installer_sis" 100 #define ROM_STUB_SIS_TARGET "stub_sis" 101 #define OK_SIS_TARGET "ok_sis" 102 #define OK_INSTALLER_SIS_TARGET "ok_installer_sis" 103 #define OK_ROM_STUB_SIS_TARGET "ok_stub_sis" 104 #define FAIL_SIS_NOPKG_TARGET "fail_sis_nopkg" 105 #define FAIL_SIS_NOCACHE_TARGET "fail_sis_nocache" 106 107 #define PRINT_FILE_CREATE_ERROR(filename) fprintf(stderr, "Error: Could not create '%s'\n", qPrintable(filename)); 108 109 #define MANUFACTURER_NOTE_FILE "manufacturer_note.txt" 110 #define DEFAULT_MANUFACTURER_NOTE \ 111 "The package is not supported for devices from this manufacturer. Please try the selfsigned " \ 112 "version of the package instead." 86 #define DEFINE_REPLACE_REGEXP "[^A-Z0-9_]" 113 87 114 88 QString SymbianMakefileGenerator::fixPathForMmp(const QString& origPath, const QDir& parentDir) … … 116 90 static QString epocRootStr; 117 91 if (epocRootStr.isEmpty()) { 118 epocRootStr = epocRoot();92 epocRootStr = qt_epocRoot(); 119 93 QFileInfo efi(epocRootStr); 120 94 if (!efi.exists() || epocRootStr.isEmpty()) { 121 fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable( epocRoot()));95 fprintf(stderr, "Unable to resolve epocRoot '%s' to real dir on current drive, defaulting to '/' for mmp paths\n", qPrintable(qt_epocRoot())); 122 96 epocRootStr = "/"; 123 97 } else { … … 151 125 QString resultPath = QDir::fromNativeSeparators(origPath); 152 126 if (resultPath.startsWith("/epoc32/", Qt::CaseInsensitive)) 153 resultPath = QDir::fromNativeSeparators( epocRoot()) + resultPath.mid(1);127 resultPath = QDir::fromNativeSeparators(qt_epocRoot()) + resultPath.mid(1); 154 128 155 129 QFileInfo fi(fileInfo(resultPath)); … … 169 143 } 170 144 171 SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator() { }145 SymbianMakefileGenerator::SymbianMakefileGenerator() : MakefileGenerator(), SymbianCommonGenerator(this) { } 172 146 SymbianMakefileGenerator::~SymbianMakefileGenerator() { } 173 147 … … 194 168 bldinfDefine.append("_"); 195 169 bldinfDefine.append(generate_uid(project->projectFile())); 170 bldinfDefine = bldinfDefine.toUpper(); 171 172 // replace anything not alphanumeric with underscore 173 QRegExp replacementMask(DEFINE_REPLACE_REGEXP); 174 bldinfDefine.replace(replacementMask, QLatin1String("_")); 196 175 197 176 bldinfDefine.prepend("BLD_INF_"); 198 removeSpecialCharacters(bldinfDefine); 199 200 t << "#define " << bldinfDefine.toUpper() << endl << endl; 177 178 t << "#define " << bldinfDefine << endl << endl; 201 179 } 202 180 203 181 bool SymbianMakefileGenerator::writeMakefile(QTextStream &t) 204 182 { 183 if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) { 184 fprintf(stderr, "Project files not generated because all requirements are not met:\n\t%s\n", 185 qPrintable(var("QMAKE_FAILED_REQUIREMENTS"))); 186 return false; 187 } 188 205 189 writeHeader(t); 206 190 … … 210 194 readRssRules(numberOfIcons, iconFile, userRssRules); 211 195 212 // Get the application translations and convert to symbian OS lang code, i.e. decical number213 QStringList symbianLangCodes = symbianLangCodesFromTsFiles();196 SymbianLocalizationList symbianLocalizationList; 197 parseTsFiles(&symbianLocalizationList); 214 198 215 199 // Generate pkg files if there are any actual files to deploy 216 200 bool generatePkg = false; 217 DeploymentList depList;218 201 219 202 if (targetType == TypeExe) { … … 229 212 230 213 if (generatePkg) { 231 generatePkgFile(iconFile, depList);232 } 233 234 writeBldInfContent(t, generatePkg, iconFile , depList);214 generatePkgFile(iconFile, true, symbianLocalizationList); 215 } 216 217 writeBldInfContent(t, generatePkg, iconFile); 235 218 236 219 // Generate empty wrapper makefile here, because wrapper makefile must exist before writeMkFile, 237 220 // but all required data is not yet available. 238 221 bool isPrimaryMakefile = true; 239 QString wrapperFileName ("Makefile");222 QString wrapperFileName = Option::output_dir + QLatin1Char('/') + QLatin1String("Makefile"); 240 223 QString outputFileName = fileInfo(Option::output.fileName()).fileName(); 241 224 if (outputFileName != BLD_INF_FILENAME) { … … 265 248 writeMkFile(wrapperFileName, false); 266 249 267 QString shortProFilename = project->projectFile(); 268 shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString("")); 269 shortProFilename.replace(Option::pro_ext, QString("")); 270 271 QString mmpFilename = shortProFilename; 272 mmpFilename.append("_"); 273 mmpFilename.append(uid3); 274 mmpFilename.append(Option::mmp_ext); 275 writeMmpFile(mmpFilename, symbianLangCodes); 250 QString absoluteMmpFileName = Option::output_dir + QLatin1Char('/') + mmpFileName; 251 writeMmpFile(absoluteMmpFileName, symbianLocalizationList); 276 252 277 253 if (targetType == TypeExe) { … … 279 255 writeRegRssFile(userRssRules); 280 256 writeRssFile(numberOfIcons, iconFile); 281 writeLocFile(symbianL angCodes);257 writeLocFile(symbianLocalizationList); 282 258 } 283 259 } … … 289 265 } 290 266 291 void SymbianMakefileGenerator::generatePkgFile(const QString &iconFile, DeploymentList &depList)292 {293 QString pkgFilename = QString("%1_template.%2")294 .arg(fixedTarget)295 .arg("pkg");296 QFile pkgFile(pkgFilename);297 if (!pkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {298 PRINT_FILE_CREATE_ERROR(pkgFilename);299 return;300 }301 302 generatedFiles << pkgFile.fileName();303 QTextStream t(&pkgFile);304 305 QString installerSisHeader = project->values("DEPLOYMENT.installer_header").join("\n");306 if (installerSisHeader.isEmpty())307 installerSisHeader = "0xA000D7CE"; // Use default self-signable UID if not defined308 309 QString wrapperStreamBuffer;310 QTextStream tw(&wrapperStreamBuffer);311 312 QString dateStr = QDateTime::currentDateTime().toString(Qt::ISODate);313 314 // Header info315 QString wrapperPkgFilename = QString("%1_installer.%2")316 .arg(fixedTarget)317 .arg("pkg");318 QString headerComment = "; %1 generated by qmake at %2\n"319 "; This file is generated by qmake and should not be modified by the user\n"320 ";\n\n";321 t << headerComment.arg(pkgFilename).arg(dateStr);322 tw << headerComment.arg(wrapperPkgFilename).arg(dateStr);323 324 // Construct QStringList from pkg_prerules since we need search it before printed to file325 // Note: Though there can't be more than one language or header line, use stringlists326 // in case user wants comments to go with the rules.327 QStringList rawPkgPreRules;328 QStringList languageRules;329 QStringList headerRules;330 foreach(QString deploymentItem, project->values("DEPLOYMENT")) {331 foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_prerules")) {332 QStringList pkgrulesValue = project->values(pkgrulesItem);333 // If there is no stringlist defined for a rule, use rule name directly334 // This is convenience for defining single line mmp statements335 if (pkgrulesValue.isEmpty()) {336 if (pkgrulesItem.startsWith("&"))337 languageRules << pkgrulesItem;338 else if (pkgrulesItem.startsWith("#"))339 headerRules << pkgrulesItem;340 else341 rawPkgPreRules << pkgrulesItem;342 } else {343 if (containsStartWithItem('&', pkgrulesValue)) {344 foreach(QString pkgrule, pkgrulesValue) {345 languageRules << pkgrule;346 }347 } else if (containsStartWithItem('#', pkgrulesValue)) {348 foreach(QString pkgrule, pkgrulesValue) {349 headerRules << pkgrule;350 }351 } else {352 foreach(QString pkgrule, pkgrulesValue) {353 rawPkgPreRules << pkgrule;354 }355 }356 }357 }358 }359 360 // Apply some defaults if specific data does not exist in PKG pre-rules361 362 if (languageRules.isEmpty()) {363 // language, (*** hardcoded to english atm, should be parsed from TRANSLATIONS)364 languageRules << "; Language\n&EN\n\n";365 } else if (headerRules.isEmpty()) {366 // In case user defines langs, he must take care also about SIS header367 fprintf(stderr, "Warning: If language is defined with DEPLOYMENT pkg_prerules, also the SIS header must be defined\n");368 }369 370 t << languageRules.join("\n") << endl;371 tw << languageRules.join("\n") << endl;372 373 // name of application, UID and version374 QString applicationVersion = project->first("VERSION").isEmpty() ? "1,0,0" : project->first("VERSION").replace('.', ',');375 QString sisHeader = "; SIS header: name, uid, version\n#{\"%1\"},(%2),%3\n\n";376 QString visualTarget = escapeFilePath(fileFixify(project->first("TARGET")));377 visualTarget = removePathSeparators(visualTarget);378 QString wrapperTarget = visualTarget + " installer";379 380 if (installerSisHeader.startsWith("0x", Qt::CaseInsensitive)) {381 tw << sisHeader.arg(wrapperTarget).arg(installerSisHeader).arg(applicationVersion);382 } else {383 tw << installerSisHeader << endl;384 }385 386 if (headerRules.isEmpty())387 t << sisHeader.arg(visualTarget).arg(uid3).arg(applicationVersion);388 else389 t << headerRules.join("\n") << endl;390 391 // Localized vendor name392 QString vendorName;393 if (!containsStartWithItem('%', rawPkgPreRules)) {394 vendorName += "; Localised Vendor name\n%{\"Vendor\"}\n\n";395 }396 397 // Unique vendor name398 if (!containsStartWithItem(':', rawPkgPreRules)) {399 vendorName += "; Unique Vendor name\n:\"Vendor\"\n\n";400 }401 402 t << vendorName;403 tw << vendorName;404 405 // PKG pre-rules - these are added before actual file installations i.e. SIS package body406 if (rawPkgPreRules.size()) {407 QString comment = "\n; Manual PKG pre-rules from PRO files\n";408 t << comment;409 tw << comment;410 411 foreach(QString item, rawPkgPreRules) {412 // Only regular pkg file should have package dependencies or pkg header if that is413 // defined using prerules.414 if (!item.startsWith("(") && !item.startsWith("#")) {415 tw << item << endl;416 }417 t << item << endl;418 }419 t << endl;420 tw << endl;421 }422 423 // Begin Manufacturer block424 if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {425 QString manufacturerStr("IF ");426 foreach(QString manufacturer, project->values("DEPLOYMENT.manufacturers")) {427 manufacturerStr.append(QString("(MANUFACTURER)=(%1) OR \n ").arg(manufacturer));428 }429 // Remove the final OR430 manufacturerStr.chop(8);431 t << manufacturerStr << endl;432 }433 434 // Install paths on the phone *** should be dynamic at some point435 QString installPathBin = "!:\\sys\\bin";436 QString installPathResource = "!:\\resource\\apps";437 QString installPathRegResource = "!:\\private\\10003a3f\\import\\apps";438 439 // Find location of builds440 QString epocReleasePath = QString("%1epoc32/release/$(PLATFORM)/$(TARGET)")441 .arg(epocRoot());442 443 if (targetType == TypeExe) {444 // deploy .exe file445 t << "; Executable and default resource files" << endl;446 QString exeFile = fixedTarget + ".exe";447 t << QString("\"%1/%2\" - \"%3\\%4\"")448 .arg(epocReleasePath)449 .arg(exeFile)450 .arg(installPathBin)451 .arg(exeFile) << endl;452 453 // deploy rsc & reg_rsc file454 if (!project->isActiveConfig("no_icon")) {455 t << QString("\"%1epoc32/data/z/resource/apps/%2\" - \"%3\\%4\"")456 .arg(epocRoot())457 .arg(fixedTarget + ".rsc")458 .arg(installPathResource)459 .arg(fixedTarget + ".rsc") << endl;460 461 t << QString("\"%1epoc32/data/z/private/10003a3f/import/apps/%2\" - \"%3\\%4\"")462 .arg(epocRoot())463 .arg(fixedTarget + "_reg.rsc")464 .arg(installPathRegResource)465 .arg(fixedTarget + "_reg.rsc") << endl;466 467 if (!iconFile.isEmpty()) {468 t << QString("\"%1epoc32/data/z%2\" - \"!:%3\"")469 .arg(epocRoot())470 .arg(iconFile)471 .arg(QDir::toNativeSeparators(iconFile)) << endl << endl;472 }473 }474 }475 476 // deploy any additional DEPLOYMENT files477 QString remoteTestPath;478 remoteTestPath = QString("!:\\private\\%1").arg(privateDirUid);479 QString zDir = epocRoot() + QLatin1String("epoc32/data/z");480 481 initProjectDeploySymbian(project, depList, remoteTestPath, true, "$(PLATFORM)", "$(TARGET)", generatedDirs, generatedFiles);482 if (depList.size())483 t << "; DEPLOYMENT" << endl;484 for (int i = 0; i < depList.size(); ++i) {485 QString from = depList.at(i).from;486 QString to = depList.at(i).to;487 488 // Deploy anything not already deployed from under epoc32 instead from under489 // \epoc32\data\z\ to enable using pkg file without rebuilding490 // the project, which can be useful for some binary only distributions.491 if (!from.contains(QLatin1String("epoc32"), Qt::CaseInsensitive)) {492 from = to;493 if (from.size() > 1 && from.at(1) == QLatin1Char(':'))494 from = from.mid(2);495 from.prepend(zDir);496 } else {497 if (from.size() > 1 && from.at(1) == QLatin1Char(':'))498 from = from.mid(2);499 }500 501 t << QString("\"%1\" - \"%2\"").arg(from.replace('\\','/')).arg(to) << endl;502 }503 t << endl;504 505 // PKG post-rules - these are added after actual file installations i.e. SIS package body506 t << "; Manual PKG post-rules from PRO files" << endl;507 foreach(QString deploymentItem, project->values("DEPLOYMENT")) {508 foreach(QString pkgrulesItem, project->values(deploymentItem + ".pkg_postrules")) {509 QStringList pkgrulesValue = project->values(pkgrulesItem);510 // If there is no stringlist defined for a rule, use rule name directly511 // This is convenience for defining single line statements512 if (pkgrulesValue.isEmpty()) {513 t << pkgrulesItem << endl;514 } else {515 foreach(QString pkgrule, pkgrulesValue) {516 t << pkgrule << endl;517 }518 }519 t << endl;520 }521 }522 523 // Close Manufacturer block524 if (!project->values("DEPLOYMENT.manufacturers").isEmpty()) {525 QString manufacturerFailNoteFile;526 if (project->values("DEPLOYMENT.manufacturers.fail_note").isEmpty()) {527 manufacturerFailNoteFile = QString("%1_" MANUFACTURER_NOTE_FILE).arg(uid3);528 QFile ft(manufacturerFailNoteFile);529 if (ft.open(QIODevice::WriteOnly)) {530 generatedFiles << ft.fileName();531 QTextStream t2(&ft);532 533 t2 << QString(DEFAULT_MANUFACTURER_NOTE) << endl;534 } else {535 PRINT_FILE_CREATE_ERROR(manufacturerFailNoteFile)536 }537 } else {538 manufacturerFailNoteFile = project->values("DEPLOYMENT.manufacturers.fail_note").join("");539 }540 541 t << "ELSEIF NOT(0) ; MANUFACTURER" << endl542 << "\"" << fileInfo(manufacturerFailNoteFile).absoluteFilePath() << "\""543 << " - \"\", FILETEXT, TEXTEXIT" << endl544 << "ENDIF ; MANUFACTURER" << endl;545 }546 547 // Write wrapper pkg548 if (!installerSisHeader.isEmpty()) {549 QFile wrapperPkgFile(wrapperPkgFilename);550 if (!wrapperPkgFile.open(QIODevice::WriteOnly | QIODevice::Text)) {551 PRINT_FILE_CREATE_ERROR(wrapperPkgFilename);552 return;553 }554 555 generatedFiles << wrapperPkgFile.fileName();556 QTextStream twf(&wrapperPkgFile);557 558 twf << wrapperStreamBuffer << endl;559 560 // Wrapped files deployment561 QString currentPath = qmake_getpwd();562 QString sisName = QString("%1.sis").arg(fixedTarget);563 twf << "\"" << currentPath << "/" << sisName << "\" - \"c:\\adm\\" << sisName << "\"" << endl;564 565 QString bootStrapPath = QLibraryInfo::location(QLibraryInfo::PrefixPath);566 bootStrapPath.append("/smartinstaller.sis");567 QFileInfo fi(fileInfo(bootStrapPath));568 twf << "@\"" << fi.absoluteFilePath() << "\",(0x2002CCCD)" << endl;569 }570 }571 572 bool SymbianMakefileGenerator::containsStartWithItem(const QChar &c, const QStringList& src)573 {574 bool result = false;575 foreach(QString str, src) {576 if (str.startsWith(c)) {577 result = true;578 break;579 }580 }581 return result;582 }583 584 void SymbianMakefileGenerator::writeCustomDefFile()585 {586 if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) {587 // Create custom def file for plugin588 QFile ft(QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL));589 590 if (ft.open(QIODevice::WriteOnly)) {591 generatedFiles << ft.fileName();592 QTextStream t(&ft);593 594 t << "; ==============================================================================" << endl;595 t << "; Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";596 t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;597 t << "; This file is generated by qmake and should not be modified by the" << endl;598 t << "; user." << endl;599 t << "; Name : " PLUGIN_COMMON_DEF_FILE_ACTUAL << endl;600 t << "; Part of : " << project->values("TARGET").join(" ") << endl;601 t << "; Description : Fixes common plugin symbols to known ordinals" << endl;602 t << "; Version : " << endl;603 t << ";" << endl;604 t << "; ==============================================================================" << "\n" << endl;605 606 t << endl;607 608 t << "EXPORTS" << endl;609 t << "\tqt_plugin_query_verification_data @ 1 NONAME" << endl;610 t << "\tqt_plugin_instance @ 2 NONAME" << endl;611 t << endl;612 } else {613 PRINT_FILE_CREATE_ERROR(QString(PLUGIN_COMMON_DEF_FILE_ACTUAL))614 }615 }616 }617 618 267 void SymbianMakefileGenerator::init() 619 268 { 620 269 MakefileGenerator::init(); 621 fixedTarget = escapeFilePath(fileFixify(project->first("TARGET"))); 622 fixedTarget = removePathSeparators(fixedTarget); 623 removeSpecialCharacters(fixedTarget); 270 SymbianCommonGenerator::init(); 624 271 625 272 if (0 != project->values("QMAKE_PLATFORM").size()) … … 632 279 project->values("QMAKE_LIBS_PRIVATE") += escapeFilePaths(project->values("LIBS_PRIVATE")); 633 280 634 // bld.inf 281 // Disallow renaming of bld.inf. 282 project->values("MAKEFILE").clear(); 635 283 project->values("MAKEFILE") += BLD_INF_FILENAME; 636 284 637 285 // .mmp 286 mmpFileName = fixedTarget; 287 if (targetType == TypeExe) 288 mmpFileName.append("_exe"); 289 else if (targetType == TypeDll || targetType == TypePlugin) 290 mmpFileName.append("_dll"); 291 else if (targetType == TypeLib) 292 mmpFileName.append("_lib"); 293 mmpFileName.append(Option::mmp_ext); 294 638 295 initMmpVariables(); 639 296 640 // Check TARGET.UID3 presence 641 if (0 != project->values("TARGET.UID3").size()) { 642 uid3 = project->first("TARGET.UID3"); 643 } else { 644 uid3 = generateUID3(); 645 } 646 647 if ((project->values("TEMPLATE")).contains("app")) 648 targetType = TypeExe; 649 else if ((project->values("TEMPLATE")).contains("lib")) { 650 // Check CONFIG to see if we are to build staticlib or dll 651 if (project->isActiveConfig("staticlib") || project->isActiveConfig("static")) 652 targetType = TypeLib; 653 else if (project->isActiveConfig("plugin")) 654 targetType = TypePlugin; 655 else 656 targetType = TypeDll; 657 } else { 658 targetType = TypeSubdirs; 659 } 660 661 if (0 != project->values("TARGET.UID2").size()) { 662 uid2 = project->first("TARGET.UID2"); 663 } else if (project->isActiveConfig("stdbinary")) { 664 uid2 = "0x20004C45"; 665 } else { 666 if (targetType == TypeExe) { 667 if (project->values("QT").contains("gui", Qt::CaseInsensitive)) { 668 // exe and gui -> uid2 needed 669 uid2 = "0x100039CE"; 670 } else { 671 // exe but not gui: uid2 is ignored anyway -> set it to 0 672 uid2 = "0"; 673 } 674 } else if (targetType == TypeDll || targetType == TypeLib || targetType == TypePlugin) { 675 uid2 = "0x1000008d"; 676 } 677 } 297 uid2 = project->first("TARGET.UID2"); 678 298 679 299 uid2 = uid2.trimmed(); 680 uid3 = uid3.trimmed();681 682 // UID is valid as either hex or decimal, so just convert it to number and back to hex683 // to get proper string for private dir684 bool conversionOk = false;685 uint uidNum = uid3.toUInt(&conversionOk, 0);686 687 if (!conversionOk) {688 fprintf(stderr, "Error: Invalid UID \"%s\".\n", uid3.toUtf8().constData());689 } else {690 privateDirUid.setNum(uidNum, 16);691 while (privateDirUid.length() < 8)692 privateDirUid.insert(0, QLatin1Char('0'));693 }694 300 } 695 301 … … 886 492 t << "// This file is generated by qmake and should not be modified by the" << endl; 887 493 t << "// user." << endl; 888 t << "// Name : " << escapeFilePath(fileFixify(project->projectFile().remove(project->projectFile().length() - 4, 4))) << Option::mmp_ext<< endl;494 t << "// Name : " << mmpFileName << endl; 889 495 t << "// ==============================================================================" << endl << endl; 890 496 } 891 497 892 void SymbianMakefileGenerator::writeMmpFile(QString &filename, QStringList &symbianLangCodes)498 void SymbianMakefileGenerator::writeMmpFile(QString &filename, const SymbianLocalizationList &symbianLocalizationList) 893 499 { 894 500 QFile ft(filename); … … 902 508 writeMmpFileTargetPart(t); 903 509 904 writeMmpFileResourcePart(t, symbianL angCodes);510 writeMmpFileResourcePart(t, symbianLocalizationList); 905 511 906 512 writeMmpFileMacrosPart(t); … … 1044 650 \private\10003a3f\import\apps directory. 1045 651 */ 1046 void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes)652 void SymbianMakefileGenerator::writeMmpFileResourcePart(QTextStream& t, const SymbianLocalizationList &symbianLocalizationList) 1047 653 { 1048 654 if ((targetType == TypeExe) && … … 1054 660 t << "SOURCEPATH\t\t\t. " << endl; 1055 661 t << "LANG SC "; // no endl 1056 foreach(QString lang, symbianLangCodes) { 1057 t << lang << " "; // no endl 662 SymbianLocalizationListIterator iter(symbianLocalizationList); 663 while (iter.hasNext()) { 664 const SymbianLocalization &loc = iter.next(); 665 t << loc.symbianLanguageCode << " "; // no endl 1058 666 } 1059 667 t << endl; … … 1118 726 // ARMV5 build directory for library type. We default to shared 1119 727 // library, since that is more common. 1120 QString udebStaticLibLocation( epocRoot());728 QString udebStaticLibLocation(qt_epocRoot()); 1121 729 QString urelStaticLibLocation(udebStaticLibLocation); 1122 730 udebStaticLibLocation += QString("epoc32/release/armv5/udeb/%1.lib").arg(lib); … … 1265 873 } 1266 874 1267 void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile , DeploymentList &depList)875 void SymbianMakefileGenerator::writeBldInfContent(QTextStream &t, bool addDeploymentExtension, const QString &iconFile) 1268 876 { 1269 877 // Read user defined bld inf rules … … 1296 904 // Add includes of subdirs bld.inf files 1297 905 1298 QString mmpfilename = escapeFilePath(fileFixify(project->projectFile()));1299 mmpfilename = mmpfilename.replace(mmpfilename.lastIndexOf("."), 4, Option::mmp_ext);1300 906 QString currentPath = qmake_getpwd(); 1301 907 QDir directory(currentPath); … … 1303 909 const QStringList &subdirs = project->values("SUBDIRS"); 1304 910 foreach(QString item, subdirs) { 911 bool fromFile = false; 1305 912 QString fixedItem; 1306 913 if (!project->isEmpty(item + ".file")) { 1307 914 fixedItem = project->first(item + ".file"); 915 fromFile = true; 1308 916 } else if (!project->isEmpty(item + ".subdir")) { 1309 917 fixedItem = project->first(item + ".subdir"); 918 fromFile = false; 1310 919 } else { 1311 920 fixedItem = item; 921 fromFile = item.endsWith(Option::pro_ext); 1312 922 } 1313 923 … … 1318 928 QFileInfo subdir(fileInfo(fixedItem)); 1319 929 QString relativePath = directory.relativeFilePath(fixedItem); 1320 QString subdirFileName = subdir.completeBaseName(); 1321 QString fullProName = subdir.absoluteFilePath();; 930 QString fullProName = subdir.absoluteFilePath(); 1322 931 QString bldinfFilename; 932 QString subdirFileName; 933 934 if (fromFile) { 935 subdirFileName = subdir.completeBaseName(); 936 } else { 937 subdirFileName = subdir.fileName(); 938 } 1323 939 1324 940 if (subdir.isDir()) { … … 1342 958 QString bldinfDefine = QString("BLD_INF_") + subdirFileName + QString("_") + uid; 1343 959 bldinfDefine = bldinfDefine.toUpper(); 1344 removeSpecialCharacters(bldinfDefine); 960 961 // replace anything not alphanumeric with underscore 962 QRegExp replacementMask(DEFINE_REPLACE_REGEXP); 963 bldinfDefine.replace(replacementMask, QLatin1String("_")); 1345 964 1346 965 if (!condition.isEmpty()) … … 1379 998 1380 999 writeBldInfMkFilePart(t, addDeploymentExtension); 1381 if (targetType != TypeSubdirs) { 1382 QString shortProFilename = project->projectFile(); 1383 shortProFilename.replace(0, shortProFilename.lastIndexOf("/") + 1, QString("")); 1384 shortProFilename.replace(Option::pro_ext, QString("")); 1385 1386 QString mmpFilename = shortProFilename + QString("_") + uid3 + Option::mmp_ext; 1387 1388 t << mmpFilename << endl; 1389 } 1000 if (targetType != TypeSubdirs) 1001 t << mmpFileName << endl; 1390 1002 1391 1003 userItems = userBldInfRules.value(mmpTag); … … 1421 1033 } 1422 1034 1423 void SymbianMakefileGenerator::writeRegRssFile(QMap<QString, QStringList> &userItems)1424 {1425 QString filename(fixedTarget);1426 filename.append("_reg.rss");1427 QFile ft(filename);1428 if (ft.open(QIODevice::WriteOnly)) {1429 generatedFiles << ft.fileName();1430 QTextStream t(&ft);1431 t << "// ============================================================================" << endl;1432 t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";1433 t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;1434 t << "// * This file is generated by qmake and should not be modified by the" << endl;1435 t << "// * user." << endl;1436 t << "// ============================================================================" << endl;1437 t << endl;1438 t << "#include <" << fixedTarget << ".rsg>" << endl;1439 t << "#include <appinfo.rh>" << endl;1440 foreach(QString item, userItems[RSS_TAG_HEADER])1441 t << item << endl;1442 t << endl;1443 t << "UID2 KUidAppRegistrationResourceFile" << endl;1444 t << "UID3 " << uid3 << endl << endl;1445 t << "RESOURCE APP_REGISTRATION_INFO" << endl;1446 t << "\t{" << endl;1447 t << "\tapp_file=\"" << fixedTarget << "\";" << endl;1448 t << "\tlocalisable_resource_file=\"" RESOURCE_DIRECTORY_RESOURCE << fixedTarget << "\";" << endl;1449 1450 writeRegRssList(t, userItems[RSS_TAG_SERVICE_LIST],1451 QLatin1String(RSS_TAG_SERVICE_LIST),1452 QLatin1String("SERVICE_INFO"));1453 writeRegRssList(t, userItems[RSS_TAG_FILE_OWNERSHIP_LIST],1454 QLatin1String(RSS_TAG_FILE_OWNERSHIP_LIST),1455 QLatin1String("FILE_OWNERSHIP_INFO"));1456 writeRegRssList(t, userItems[RSS_TAG_DATATYPE_LIST],1457 QLatin1String(RSS_TAG_DATATYPE_LIST),1458 QLatin1String("DATATYPE"));1459 t << endl;1460 1461 foreach(QString item, userItems[RSS_TAG_DEFAULT])1462 t << "\t" << item.replace("\n","\n\t") << endl;1463 t << "\t}" << endl;1464 1465 foreach(QString item, userItems[RSS_TAG_FOOTER])1466 t << item << endl;1467 } else {1468 PRINT_FILE_CREATE_ERROR(filename)1469 }1470 }1471 1472 void SymbianMakefileGenerator::writeRegRssList(QTextStream &t,1473 QStringList &userList,1474 const QString &listTag,1475 const QString &listItem)1476 {1477 int itemCount = userList.count();1478 if (itemCount) {1479 t << "\t" << listTag << " ="<< endl;1480 t << "\t\t{" << endl;1481 foreach(QString item, userList) {1482 t << "\t\t" << listItem << endl;1483 t << "\t\t\t{" << endl;1484 t << "\t\t\t" << item.replace("\n","\n\t\t\t") << endl;1485 t << "\t\t\t}";1486 if (--itemCount)1487 t << ",";1488 t << endl;1489 }1490 t << "\t\t}; "<< endl;1491 }1492 }1493 1494 void SymbianMakefileGenerator::writeRssFile(QString &numberOfIcons, QString &iconFile)1495 {1496 QString filename(fixedTarget);1497 filename.append(".rss");1498 QFile ft(filename);1499 if (ft.open(QIODevice::WriteOnly)) {1500 generatedFiles << ft.fileName();1501 QTextStream t(&ft);1502 t << "// ============================================================================" << endl;1503 t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";1504 t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;1505 t << "// * This file is generated by qmake and should not be modified by the" << endl;1506 t << "// * user." << endl;1507 t << "// ============================================================================" << endl;1508 t << endl;1509 t << "#include <appinfo.rh>" << endl;1510 t << "#include \"" << fixedTarget << ".loc\"" << endl;1511 t << endl;1512 t << "RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info" << endl;1513 t << "\t{" << endl;1514 t << "\tshort_caption = STRING_r_short_caption;" << endl;1515 t << "\tcaption_and_icon =" << endl;1516 t << "\tCAPTION_AND_ICON_INFO" << endl;1517 t << "\t\t{" << endl;1518 t << "\t\tcaption = STRING_r_caption;" << endl;1519 1520 QString rssIconFile = iconFile;1521 rssIconFile = rssIconFile.replace("/", "\\\\");1522 1523 if (numberOfIcons.isEmpty() || rssIconFile.isEmpty()) {1524 // There can be maximum one item in this tag, validated when parsed1525 t << "\t\tnumber_of_icons = 0;" << endl;1526 t << "\t\ticon_file = \"\";" << endl;1527 } else {1528 // There can be maximum one item in this tag, validated when parsed1529 t << "\t\tnumber_of_icons = " << numberOfIcons << ";" << endl;1530 t << "\t\ticon_file = \"" << rssIconFile << "\";" << endl;1531 }1532 t << "\t\t};" << endl;1533 t << "\t}" << endl;1534 t << endl;1535 } else {1536 PRINT_FILE_CREATE_ERROR(filename);1537 }1538 }1539 1540 void SymbianMakefileGenerator::writeLocFile(QStringList &symbianLangCodes)1541 {1542 QString filename(fixedTarget);1543 filename.append(".loc");1544 QFile ft(filename);1545 if (ft.open(QIODevice::WriteOnly)) {1546 generatedFiles << ft.fileName();1547 QTextStream t(&ft);1548 t << "// ============================================================================" << endl;1549 t << "// * Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";1550 t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;1551 t << "// * This file is generated by qmake and should not be modified by the" << endl;1552 t << "// * user." << endl;1553 t << "// ============================================================================" << endl;1554 t << endl;1555 t << "#ifdef LANGUAGE_SC" << endl;1556 t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;1557 t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;1558 foreach(QString lang, symbianLangCodes) {1559 t << "#elif defined LANGUAGE_" << lang << endl;1560 t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;1561 t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;1562 }1563 t << "#else" << endl;1564 t << "#define STRING_r_short_caption \"" << fixedTarget << "\"" << endl;1565 t << "#define STRING_r_caption \"" << fixedTarget << "\"" << endl;1566 t << "#endif" << endl;1567 } else {1568 PRINT_FILE_CREATE_ERROR(filename);1569 }1570 }1571 1572 void SymbianMakefileGenerator::readRssRules(QString &numberOfIcons,1573 QString &iconFile, QMap<QString,1574 QStringList> &userRssRules)1575 {1576 for (QMap<QString, QStringList>::iterator it = project->variables().begin(); it != project->variables().end(); ++it) {1577 if (it.key().startsWith(RSS_RULES_BASE)) {1578 QString newKey = it.key().mid(sizeof(RSS_RULES_BASE) - 1);1579 if (newKey.isEmpty()) {1580 fprintf(stderr, "Warning: Empty RSS_RULES_BASE key encountered\n");1581 continue;1582 }1583 QStringList newValues;1584 QStringList values = it.value();1585 foreach(QString item, values) {1586 // If there is no stringlist defined for a rule, use rule value directly1587 // This is convenience for defining single line statements1588 if (project->values(item).isEmpty()) {1589 newValues << item;1590 } else {1591 QStringList itemList;1592 foreach(QString itemRow, project->values(item)) {1593 itemList << itemRow;1594 }1595 newValues << itemList.join("\n");1596 }1597 }1598 // Verify thet there is exactly one value in RSS_TAG_NBROFICONS1599 if (newKey == RSS_TAG_NBROFICONS) {1600 if (newValues.count() == 1) {1601 numberOfIcons = newValues[0];1602 } else {1603 fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",1604 RSS_RULES_BASE, RSS_TAG_NBROFICONS);1605 continue;1606 }1607 // Verify thet there is exactly one value in RSS_TAG_ICONFILE1608 } else if (newKey == RSS_TAG_ICONFILE) {1609 if (newValues.count() == 1) {1610 iconFile = newValues[0];1611 } else {1612 fprintf(stderr, "Warning: There must be exactly one value in '%s%s'\n",1613 RSS_RULES_BASE, RSS_TAG_ICONFILE);1614 continue;1615 }1616 } else if (newKey == RSS_TAG_HEADER1617 || newKey == RSS_TAG_SERVICE_LIST1618 || newKey == RSS_TAG_FILE_OWNERSHIP_LIST1619 || newKey == RSS_TAG_DATATYPE_LIST1620 || newKey == RSS_TAG_FOOTER1621 || newKey == RSS_TAG_DEFAULT) {1622 userRssRules[newKey] = newValues;1623 continue;1624 } else {1625 fprintf(stderr, "Warning: Unsupported key:'%s%s'\n",1626 RSS_RULES_BASE, newKey.toLatin1().constData());1627 continue;1628 }1629 }1630 }1631 1632 QStringList newValues;1633 foreach(QString item, project->values(RSS_RULES)) {1634 // If there is no stringlist defined for a rule, use rule value directly1635 // This is convenience for defining single line statements1636 if (project->values(item).isEmpty()) {1637 newValues << item;1638 } else {1639 newValues << project->values(item);1640 }1641 }1642 userRssRules[RSS_TAG_DEFAULT] << newValues;1643 1644 // Validate that either both RSS_TAG_NBROFICONS and RSS_TAG_ICONFILE keys exist1645 // or neither of them exist1646 if (!((numberOfIcons.isEmpty() && iconFile.isEmpty()) ||1647 (!numberOfIcons.isEmpty() && !iconFile.isEmpty()))) {1648 numberOfIcons.clear();1649 iconFile.clear();1650 fprintf(stderr, "Warning: Both or neither of '%s%s' and '%s%s' keys must exist.\n",1651 RSS_RULES_BASE, RSS_TAG_NBROFICONS, RSS_RULES_BASE, RSS_TAG_ICONFILE);1652 }1653 1654 // Validate that RSS_TAG_NBROFICONS contains only numbers1655 if (!numberOfIcons.isEmpty()) {1656 bool ok;1657 numberOfIcons = numberOfIcons.simplified();1658 numberOfIcons.toInt(&ok);1659 if (!ok) {1660 numberOfIcons.clear();1661 iconFile.clear();1662 fprintf(stderr, "Warning: '%s%s' must be integer in decimal format.\n",1663 RSS_RULES_BASE, RSS_TAG_NBROFICONS);1664 }1665 }1666 }1667 1668 QStringList SymbianMakefileGenerator::symbianLangCodesFromTsFiles()1669 {1670 QStringList tsfiles;1671 QStringList symbianLangCodes;1672 tsfiles << project->values("TRANSLATIONS");1673 1674 fillQt2S60LangMapTable();1675 1676 foreach(QString file, tsfiles) {1677 int extIndex = file.lastIndexOf(".");1678 int langIndex = file.lastIndexOf("_", (extIndex - file.length()));1679 langIndex += 1;1680 QString qtlang = file.mid(langIndex, extIndex - langIndex);1681 QString s60lang = qt2S60LangMapTable.value(qtlang, QString("SC"));1682 1683 if (!symbianLangCodes.contains(s60lang) && s60lang != "SC")1684 symbianLangCodes += s60lang;1685 }1686 1687 return symbianLangCodes;1688 }1689 1690 void SymbianMakefileGenerator::fillQt2S60LangMapTable()1691 {1692 qt2S60LangMapTable.reserve(170); // 165 items at time of writing.1693 qt2S60LangMapTable.insert("ab", "SC"); //Abkhazian //1694 qt2S60LangMapTable.insert("om", "SC"); //Afan //1695 qt2S60LangMapTable.insert("aa", "SC"); //Afar //1696 qt2S60LangMapTable.insert("af", "34"); //Afrikaans //Afrikaans1697 qt2S60LangMapTable.insert("sq", "35"); //Albanian //Albanian1698 qt2S60LangMapTable.insert("am", "36"); //Amharic //Amharic1699 qt2S60LangMapTable.insert("ar", "37"); //Arabic //Arabic1700 qt2S60LangMapTable.insert("hy", "38"); //Armenian //Armenian1701 qt2S60LangMapTable.insert("as", "SC"); //Assamese //1702 qt2S60LangMapTable.insert("ay", "SC"); //Aymara //1703 qt2S60LangMapTable.insert("az", "SC"); //Azerbaijani //1704 qt2S60LangMapTable.insert("ba", "SC"); //Bashkir //1705 qt2S60LangMapTable.insert("eu", "SC"); //Basque //1706 qt2S60LangMapTable.insert("bn", "41"); //Bengali //Bengali1707 qt2S60LangMapTable.insert("dz", "SC"); //Bhutani //1708 qt2S60LangMapTable.insert("bh", "SC"); //Bihari //1709 qt2S60LangMapTable.insert("bi", "SC"); //Bislama //1710 qt2S60LangMapTable.insert("br", "SC"); //Breton //1711 qt2S60LangMapTable.insert("bg", "42"); //Bulgarian //Bulgarian1712 qt2S60LangMapTable.insert("my", "43"); //Burmese //Burmese1713 qt2S60LangMapTable.insert("be", "40"); //Byelorussian //Belarussian1714 qt2S60LangMapTable.insert("km", "SC"); //Cambodian //1715 qt2S60LangMapTable.insert("ca", "44"); //Catalan //Catalan1716 qt2S60LangMapTable.insert("zh", "SC"); //Chinese //1717 qt2S60LangMapTable.insert("co", "SC"); //Corsican //1718 qt2S60LangMapTable.insert("hr", "45"); //Croatian //Croatian1719 qt2S60LangMapTable.insert("cs", "25"); //Czech //Czech1720 qt2S60LangMapTable.insert("da", "07"); //Danish //Danish1721 qt2S60LangMapTable.insert("nl", "18"); //Dutch //Dutch1722 qt2S60LangMapTable.insert("en", "01"); //English //English(UK)1723 qt2S60LangMapTable.insert("eo", "SC"); //Esperanto //1724 qt2S60LangMapTable.insert("et", "49"); //Estonian //Estonian1725 qt2S60LangMapTable.insert("fo", "SC"); //Faroese //1726 qt2S60LangMapTable.insert("fj", "SC"); //Fiji //1727 qt2S60LangMapTable.insert("fi", "09"); //Finnish //Finnish1728 qt2S60LangMapTable.insert("fr", "02"); //French //French1729 qt2S60LangMapTable.insert("fy", "SC"); //Frisian //1730 qt2S60LangMapTable.insert("gd", "52"); //Gaelic //Gaelic1731 qt2S60LangMapTable.insert("gl", "SC"); //Galician //1732 qt2S60LangMapTable.insert("ka", "53"); //Georgian //Georgian1733 qt2S60LangMapTable.insert("de", "03"); //German //German1734 qt2S60LangMapTable.insert("el", "54"); //Greek //Greek1735 qt2S60LangMapTable.insert("kl", "SC"); //Greenlandic //1736 qt2S60LangMapTable.insert("gn", "SC"); //Guarani //1737 qt2S60LangMapTable.insert("gu", "56"); //Gujarati //Gujarati1738 qt2S60LangMapTable.insert("ha", "SC"); //Hausa //1739 qt2S60LangMapTable.insert("he", "57"); //Hebrew //Hebrew1740 qt2S60LangMapTable.insert("hi", "58"); //Hindi //Hindi1741 qt2S60LangMapTable.insert("hu", "17"); //Hungarian //Hungarian1742 qt2S60LangMapTable.insert("is", "15"); //Icelandic //Icelandic1743 qt2S60LangMapTable.insert("id", "59"); //Indonesian //Indonesian1744 qt2S60LangMapTable.insert("ia", "SC"); //Interlingua //1745 qt2S60LangMapTable.insert("ie", "SC"); //Interlingue //1746 qt2S60LangMapTable.insert("iu", "SC"); //Inuktitut //1747 qt2S60LangMapTable.insert("ik", "SC"); //Inupiak //1748 qt2S60LangMapTable.insert("ga", "60"); //Irish //Irish1749 qt2S60LangMapTable.insert("it", "05"); //Italian //Italian1750 qt2S60LangMapTable.insert("ja", "32"); //Japanese //Japanese1751 qt2S60LangMapTable.insert("jv", "SC"); //Javanese //1752 qt2S60LangMapTable.insert("kn", "62"); //Kannada //Kannada1753 qt2S60LangMapTable.insert("ks", "SC"); //Kashmiri //1754 qt2S60LangMapTable.insert("kk", "63"); //Kazakh //Kazakh1755 qt2S60LangMapTable.insert("rw", "SC"); //Kinyarwanda //1756 qt2S60LangMapTable.insert("ky", "SC"); //Kirghiz //1757 qt2S60LangMapTable.insert("ko", "65"); //Korean //Korean1758 qt2S60LangMapTable.insert("ku", "SC"); //Kurdish //1759 qt2S60LangMapTable.insert("rn", "SC"); //Kurundi //1760 qt2S60LangMapTable.insert("lo", "66"); //Laothian //Laothian1761 qt2S60LangMapTable.insert("la", "SC"); //Latin //1762 qt2S60LangMapTable.insert("lv", "67"); //Latvian //Latvian1763 qt2S60LangMapTable.insert("ln", "SC"); //Lingala //1764 qt2S60LangMapTable.insert("lt", "68"); //Lithuanian //Lithuanian1765 qt2S60LangMapTable.insert("mk", "69"); //Macedonian //Macedonian1766 qt2S60LangMapTable.insert("mg", "SC"); //Malagasy //1767 qt2S60LangMapTable.insert("ms", "70"); //Malay //Malay1768 qt2S60LangMapTable.insert("ml", "71"); //Malayalam //Malayalam1769 qt2S60LangMapTable.insert("mt", "SC"); //Maltese //1770 qt2S60LangMapTable.insert("mi", "SC"); //Maori //1771 qt2S60LangMapTable.insert("mr", "72"); //Marathi //Marathi1772 qt2S60LangMapTable.insert("mo", "73"); //Moldavian //Moldovian1773 qt2S60LangMapTable.insert("mn", "74"); //Mongolian //Mongolian1774 qt2S60LangMapTable.insert("na", "SC"); //Nauru //1775 qt2S60LangMapTable.insert("ne", "SC"); //Nepali //1776 qt2S60LangMapTable.insert("nb", "08"); //Norwegian //Norwegian1777 qt2S60LangMapTable.insert("oc", "SC"); //Occitan //1778 qt2S60LangMapTable.insert("or", "SC"); //Oriya //1779 qt2S60LangMapTable.insert("ps", "SC"); //Pashto //1780 qt2S60LangMapTable.insert("fa", "SC"); //Persian //1781 qt2S60LangMapTable.insert("pl", "27"); //Polish //Polish1782 qt2S60LangMapTable.insert("pt", "13"); //Portuguese //Portuguese1783 qt2S60LangMapTable.insert("pa", "77"); //Punjabi //Punjabi1784 qt2S60LangMapTable.insert("qu", "SC"); //Quechua //1785 qt2S60LangMapTable.insert("rm", "SC"); //RhaetoRomance //1786 qt2S60LangMapTable.insert("ro", "78"); //Romanian //Romanian1787 qt2S60LangMapTable.insert("ru", "16"); //Russian //Russian1788 qt2S60LangMapTable.insert("sm", "SC"); //Samoan //1789 qt2S60LangMapTable.insert("sg", "SC"); //Sangho //1790 qt2S60LangMapTable.insert("sa", "SC"); //Sanskrit //1791 qt2S60LangMapTable.insert("sr", "79"); //Serbian //Serbian1792 qt2S60LangMapTable.insert("sh", "SC"); //SerboCroatian //1793 qt2S60LangMapTable.insert("st", "SC"); //Sesotho //1794 qt2S60LangMapTable.insert("tn", "SC"); //Setswana //1795 qt2S60LangMapTable.insert("sn", "SC"); //Shona //1796 qt2S60LangMapTable.insert("sd", "SC"); //Sindhi //1797 qt2S60LangMapTable.insert("si", "80"); //Singhalese //Sinhalese1798 qt2S60LangMapTable.insert("ss", "SC"); //Siswati //1799 qt2S60LangMapTable.insert("sk", "26"); //Slovak //Slovak1800 qt2S60LangMapTable.insert("sl", "28"); //Slovenian //Slovenian1801 qt2S60LangMapTable.insert("so", "81"); //Somali //Somali1802 qt2S60LangMapTable.insert("es", "04"); //Spanish //Spanish1803 qt2S60LangMapTable.insert("su", "SC"); //Sundanese //1804 qt2S60LangMapTable.insert("sw", "84"); //Swahili //Swahili1805 qt2S60LangMapTable.insert("sv", "06"); //Swedish //Swedish1806 qt2S60LangMapTable.insert("tl", "39"); //Tagalog //Tagalog1807 qt2S60LangMapTable.insert("tg", "SC"); //Tajik //1808 qt2S60LangMapTable.insert("ta", "87"); //Tamil //Tamil1809 qt2S60LangMapTable.insert("tt", "SC"); //Tatar //1810 qt2S60LangMapTable.insert("te", "88"); //Telugu //Telugu1811 qt2S60LangMapTable.insert("th", "33"); //Thai //Thai1812 qt2S60LangMapTable.insert("bo", "89"); //Tibetan //Tibetan1813 qt2S60LangMapTable.insert("ti", "90"); //Tigrinya //Tigrinya1814 qt2S60LangMapTable.insert("to", "SC"); //Tonga //1815 qt2S60LangMapTable.insert("ts", "SC"); //Tsonga //1816 qt2S60LangMapTable.insert("tr", "14"); //Turkish //Turkish1817 qt2S60LangMapTable.insert("tk", "92"); //Turkmen //Turkmen1818 qt2S60LangMapTable.insert("tw", "SC"); //Twi //1819 qt2S60LangMapTable.insert("ug", "SC"); //Uigur //1820 qt2S60LangMapTable.insert("uk", "93"); //Ukrainian //Ukrainian1821 qt2S60LangMapTable.insert("ur", "94"); //Urdu //Urdu1822 qt2S60LangMapTable.insert("uz", "SC"); //Uzbek //1823 qt2S60LangMapTable.insert("vi", "96"); //Vietnamese //Vietnamese1824 qt2S60LangMapTable.insert("vo", "SC"); //Volapuk //1825 qt2S60LangMapTable.insert("cy", "97"); //Welsh //Welsh1826 qt2S60LangMapTable.insert("wo", "SC"); //Wolof //1827 qt2S60LangMapTable.insert("xh", "SC"); //Xhosa //1828 qt2S60LangMapTable.insert("yi", "SC"); //Yiddish //1829 qt2S60LangMapTable.insert("yo", "SC"); //Yoruba //1830 qt2S60LangMapTable.insert("za", "SC"); //Zhuang //1831 qt2S60LangMapTable.insert("zu", "98"); //Zulu //Zulu1832 qt2S60LangMapTable.insert("nn", "75"); //Nynorsk //NorwegianNynorsk1833 qt2S60LangMapTable.insert("bs", "SC"); //Bosnian //1834 qt2S60LangMapTable.insert("dv", "SC"); //Divehi //1835 qt2S60LangMapTable.insert("gv", "SC"); //Manx //1836 qt2S60LangMapTable.insert("kw", "SC"); //Cornish //1837 qt2S60LangMapTable.insert("ak", "SC"); //Akan //1838 qt2S60LangMapTable.insert("kok", "SC"); //Konkani //1839 qt2S60LangMapTable.insert("gaa", "SC"); //Ga //1840 qt2S60LangMapTable.insert("ig", "SC"); //Igbo //1841 qt2S60LangMapTable.insert("kam", "SC"); //Kamba //1842 qt2S60LangMapTable.insert("syr", "SC"); //Syriac //1843 qt2S60LangMapTable.insert("byn", "SC"); //Blin //1844 qt2S60LangMapTable.insert("gez", "SC"); //Geez //1845 qt2S60LangMapTable.insert("kfo", "SC"); //Koro //1846 qt2S60LangMapTable.insert("sid", "SC"); //Sidamo //1847 qt2S60LangMapTable.insert("cch", "SC"); //Atsam //1848 qt2S60LangMapTable.insert("tig", "SC"); //Tigre //1849 qt2S60LangMapTable.insert("kaj", "SC"); //Jju //1850 qt2S60LangMapTable.insert("fur", "SC"); //Friulian //1851 qt2S60LangMapTable.insert("ve", "SC"); //Venda //1852 qt2S60LangMapTable.insert("ee", "SC"); //Ewe //1853 qt2S60LangMapTable.insert("wa", "SC"); //Walamo //1854 qt2S60LangMapTable.insert("haw", "SC"); //Hawaiian //1855 qt2S60LangMapTable.insert("kcg", "SC"); //Tyap //1856 qt2S60LangMapTable.insert("ny", "SC"); //Chewa //1857 }1858 1859 1035 void SymbianMakefileGenerator::appendIfnotExist(QStringList &list, QString value) 1860 1036 { … … 1867 1043 foreach(QString item, values) 1868 1044 appendIfnotExist(list, item); 1869 }1870 1871 QString SymbianMakefileGenerator::removePathSeparators(QString &file)1872 {1873 QString ret = file;1874 while (ret.indexOf(QDir::separator()) > 0) {1875 ret.remove(0, ret.indexOf(QDir::separator()) + 1);1876 }1877 1878 return ret;1879 1045 } 1880 1046 … … 1904 1070 t << cmd << " " << cmdOptions << " \"" << QDir::toNativeSeparators(item) << "\"" << endl; 1905 1071 #else 1906 t << "\t-if test - f" << QDir::toNativeSeparators(item) << "; then ";1072 t << "\t-if test -e " << QDir::toNativeSeparators(item) << "; then "; 1907 1073 t << cmd << " " << cmdOptions << " " << QDir::toNativeSeparators(item) << "; fi" << endl; 1908 1074 #endif 1909 1075 } 1910 }1911 1912 void SymbianMakefileGenerator::removeSpecialCharacters(QString& str)1913 {1914 // When modifying this method check also application_icon.prf1915 str.replace(QString("/"), QString("_"));1916 str.replace(QString("\\"), QString("_"));1917 str.replace(QString("-"), QString("_"));1918 str.replace(QString(":"), QString("_"));1919 str.replace(QString("."), QString("_"));1920 str.replace(QString(" "), QString("_"));1921 }1922 1923 void SymbianMakefileGenerator::writeSisTargets(QTextStream &t)1924 {1925 t << "-include " MAKE_CACHE_NAME << endl;1926 t << endl;1927 1928 t << SIS_TARGET ":" << endl;1929 QString siscommand = QString::fromLatin1("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \1930 "$(MAKE) -s -f $(MAKEFILE) %4," \1931 "$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \1932 "$(MAKE) -s -f $(MAKEFILE) %5))," \1933 "$(MAKE) -s -f $(MAKEFILE) %6)")1934 .arg(fixedTarget)1935 .arg("pkg")1936 .arg(MAKE_CACHE_NAME)1937 .arg(OK_SIS_TARGET)1938 .arg(FAIL_SIS_NOCACHE_TARGET)1939 .arg(FAIL_SIS_NOPKG_TARGET);1940 t << siscommand << endl;1941 t << endl;1942 1943 t << OK_SIS_TARGET ":" << endl;1944 1945 QString pkgcommand = QString::fromLatin1("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \1946 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)")1947 .arg(fixedTarget)1948 .arg("pkg");1949 t << pkgcommand << endl;1950 t << endl;1951 1952 QString sisName = fixedTarget;1953 sisName += ".sis";1954 1955 t << sisName << ":" << endl;1956 t << "\t$(MAKE) -s -f $(MAKEFILE) " SIS_TARGET << endl << endl;1957 1958 t << ROM_STUB_SIS_TARGET ":" << endl;1959 QString stubsiscommand = QString::fromLatin1("\t$(if $(wildcard %1_template.%2),$(if $(wildcard %3)," \1960 "$(MAKE) -s -f $(MAKEFILE) %4," \1961 "$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) %4," \1962 "$(MAKE) -s -f $(MAKEFILE) %5))," \1963 "$(MAKE) -s -f $(MAKEFILE) %6)")1964 .arg(fixedTarget)1965 .arg("pkg")1966 .arg(MAKE_CACHE_NAME)1967 .arg(OK_ROM_STUB_SIS_TARGET)1968 .arg(FAIL_SIS_NOCACHE_TARGET)1969 .arg(FAIL_SIS_NOPKG_TARGET);1970 t << stubsiscommand << endl;1971 t << endl;1972 1973 t << OK_ROM_STUB_SIS_TARGET ":" << endl;1974 1975 QString stubpkgcommand = QString::fromLatin1("\tcreatepackage.bat -s $(QT_SIS_OPTIONS) %1_template.%2 $(QT_SIS_TARGET) " \1976 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)")1977 .arg(fixedTarget)1978 .arg("pkg");1979 t << stubpkgcommand << endl;1980 t << endl;1981 1982 t << INSTALLER_SIS_TARGET ": " << sisName << endl;1983 siscommand = QString::fromLatin1("\t$(if $(wildcard %1_installer.%2)," \1984 "$(MAKE) -s -f $(MAKEFILE) %3," \1985 "$(MAKE) -s -f $(MAKEFILE) %4)")1986 .arg(fixedTarget)1987 .arg("pkg")1988 .arg(OK_INSTALLER_SIS_TARGET)1989 .arg(FAIL_SIS_NOPKG_TARGET);1990 t << siscommand << endl;1991 t << endl;1992 1993 t << OK_INSTALLER_SIS_TARGET ": " << endl;1994 1995 pkgcommand = QString::fromLatin1("\tcreatepackage.bat $(QT_SIS_OPTIONS) %1_installer.%2 - " \1996 "$(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE)")1997 .arg(fixedTarget)1998 .arg("pkg");1999 t << pkgcommand << endl;2000 t << endl;2001 2002 t << FAIL_SIS_NOPKG_TARGET ":" << endl;2003 t << "\t$(error PKG file does not exist, '" SIS_TARGET "' and '" INSTALLER_SIS_TARGET "' target are only supported for executables or projects with DEPLOYMENT statement)" << endl;2004 t << endl;2005 2006 t << FAIL_SIS_NOCACHE_TARGET ":" << endl;2007 t << "\t$(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target)" << endl;2008 t << endl;2009 1076 } 2010 1077 … … 2064 1131 } 2065 1132 2066 void SymbianMakefileGenerator::generateExecutionTargets(QTextStream& t, const QStringList& platforms) 2067 { 2068 // create execution targets 2069 if (targetType == TypeExe) { 2070 if (platforms.contains("winscw")) { 2071 t << "run:" << endl; 2072 t << "\t-call " << epocRoot() << "epoc32/release/winscw/udeb/" << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl; 2073 } 2074 t << "runonphone: sis" << endl; 2075 t << "\trunonphone $(QT_RUN_ON_PHONE_OPTIONS) --sis " << fixedTarget << ".sis " << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl; 1133 // Returns a string that can be used as a dependency to loc file on other targets 1134 QString SymbianMakefileGenerator::generateLocFileTarget(QTextStream& t, const QString& locCmd) 1135 { 1136 QString locFile; 1137 if (targetType == TypeExe && !project->isActiveConfig("no_icon")) { 1138 locFile = Option::fixPathToLocalOS(generateLocFileName()); 1139 t << locFile << QLatin1String(": ") << project->values("SYMBIAN_MATCHED_TRANSLATIONS").join(" ") << endl; 1140 t << locCmd << endl; 2076 1141 t << endl; 2077 } 2078 } 1142 locFile += QLatin1Char(' '); 1143 } 1144 1145 return locFile; 1146 } -
trunk/qmake/generators/symbian/symmake.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 45 45 #include "initprojectdeploy_symbian.h" 46 #include "symbiancommon.h" 46 47 #include <makefile.h> 47 48 … … 54 55 #define SYMBIAN_TEST_CONFIG "symbian_test" 55 56 56 class SymbianMakefileGenerator : public MakefileGenerator 57 class SymbianMakefileGenerator : public MakefileGenerator, public SymbianCommonGenerator 57 58 { 58 59 protected: 59 enum TargetType {60 TypeExe,61 TypeDll,62 TypeLib,63 TypePlugin,64 TypeSubdirs65 };66 67 60 QString platform; 68 61 QString uid2; 69 QString uid3; 70 QString privateDirUid; 71 TargetType targetType; 62 QString mmpFileName; 72 63 QMap<QString, QStringList> sources; 73 64 QMap<QString, QStringList> systeminclude; … … 77 68 QStringList overriddenMmpKeywords; 78 69 79 QStringList generatedFiles;80 QStringList generatedDirs;81 QHash<QString, QString> qt2S60LangMapTable;82 83 QString fixedTarget;84 85 void removeSpecialCharacters(QString& str);86 70 QString fixPathForMmp(const QString& origPath, const QDir& parentDir); 87 71 QString absolutizePath(const QString& origPath); 88 72 89 73 virtual bool writeMakefile(QTextStream &t); 90 void generatePkgFile(const QString &iconFile, DeploymentList &depList);91 bool containsStartWithItem(const QChar &c, const QStringList& src);92 74 93 75 virtual void init(); … … 98 80 99 81 void initMmpVariables(); 82 void generateMmpFileName(); 100 83 void handleMmpRulesOverrides(QString &checkString, 101 84 bool &inResourceBlock, … … 110 93 void writeBldInfContent(QTextStream& t, 111 94 bool addDeploymentExtension, 112 const QString &iconFile, 113 DeploymentList &depList); 95 const QString &iconFile); 114 96 115 97 static bool removeDuplicatedStrings(QStringList& stringList); 116 98 117 99 void writeMmpFileHeader(QTextStream &t); 118 void writeMmpFile(QString &filename, QStringList &symbianLangCodes);100 void writeMmpFile(QString &filename, const SymbianLocalizationList &symbianLocalizationList); 119 101 void writeMmpFileMacrosPart(QTextStream& t); 120 102 void addMacro(QTextStream& t, const QString& value); 121 103 void writeMmpFileTargetPart(QTextStream& t); 122 void writeMmpFileResourcePart(QTextStream& t, QStringList &symbianLangCodes);104 void writeMmpFileResourcePart(QTextStream& t, const SymbianLocalizationList &symbianLocalizationList); 123 105 void writeMmpFileSystemIncludePart(QTextStream& t); 124 106 void writeMmpFileIncludePart(QTextStream& t); … … 138 120 void writeMmpFileRulesPart(QTextStream& t); 139 121 140 void writeCustomDefFile();141 142 void writeRegRssFile(QMap<QString, QStringList> &useritems);143 void writeRegRssList(QTextStream &t, QStringList &userList,144 const QString &listTag,145 const QString &listItem);146 void writeRssFile(QString &numberOfIcons, QString &iconfile);147 void writeLocFile(QStringList &symbianLangCodes);148 void readRssRules(QString &numberOfIcons,149 QString &iconFile,150 QMap<QString, QStringList> &userRssRules);151 152 QStringList symbianLangCodesFromTsFiles();153 void fillQt2S60LangMapTable();154 155 122 void appendIfnotExist(QStringList &list, QString value); 156 123 void appendIfnotExist(QStringList &list, QStringList values); 157 124 158 QString removePathSeparators(QString &file);159 125 QString removeTrailingPathSeparators(QString &file); 160 126 void generateCleanCommands(QTextStream& t, … … 165 131 const QString& itemSuffix); 166 132 167 void writeSisTargets(QTextStream &t);168 133 void generateDistcleanTargets(QTextStream& t); 169 void generateExecutionTargets(QTextStream& t, const QStringList& platforms);134 QString generateLocFileTarget(QTextStream& t, const QString& locCmd); 170 135 171 136 // Subclass implements -
trunk/qmake/generators/symbian/symmake_abld.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 50 50 51 51 // Included from tools/shared 52 #include <symbian/epocroot .h>52 #include <symbian/epocroot_p.h> 53 53 54 54 #define DO_NOTHING_TARGET "do_nothing" … … 71 71 void SymbianAbldMakefileGenerator::writeMkFile(const QString& wrapperFileName, bool deploymentOnly) 72 72 { 73 QString gnuMakefileName = QLatin1String("Makefile_") + uid3;74 removeSpecialCharacters(gnuMakefileName);75 gnuMakefileName.append(".mk");76 77 73 QFile ft(gnuMakefileName); 78 74 if (ft.open(QIODevice::WriteOnly)) { … … 189 185 QTextStream t(&wrapperFile); 190 186 191 t << "# ==============================================================================" << endl; 192 t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; 193 t << QDateTime::currentDateTime().toString() << endl; 194 t << "# This file is generated by qmake and should not be modified by the" << endl; 195 t << "# user." << endl; 196 t << "# Name : " << wrapperFile.fileName() << endl; 197 t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl; 198 t << "#" << endl; 199 t << "# ==============================================================================" << "\n" << endl; 200 t << endl; 201 202 t << "MAKEFILE = " << wrapperFile.fileName() << endl; 203 t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl; 187 MakefileGenerator::writeHeader(t); 188 189 t << "MAKEFILE = " << fileInfo(wrapperFile.fileName()).fileName() << endl; 190 t << "QMAKE = " << var("QMAKE_QMAKE") << endl; 204 191 t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; 205 192 t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; … … 207 194 t << "CHK_DIR_EXISTS = " << var("QMAKE_CHK_DIR_EXISTS") << endl; 208 195 t << "MKDIR = " << var("QMAKE_MKDIR") << endl; 196 #ifdef Q_OS_WIN32 209 197 t << "XCOPY = xcopy /d /f /h /r /y /i" << endl; 210 198 t << "ABLD = ABLD.BAT" << endl; 199 #elif defined(Q_OS_MAC) 200 t << "XCOPY = cp -R -v" << endl; 201 t << "ABLD = abld" << endl; 202 #else 203 t << "XCOPY = cp -R -u -v" << endl; 204 t << "ABLD = abld" << endl; 205 #endif 211 206 t << "DEBUG_PLATFORMS = " << debugPlatforms.join(" ") << endl; 212 207 t << "RELEASE_PLATFORMS = " << releasePlatforms.join(" ") << endl; … … 214 209 t << endl; 215 210 t << "ifeq (WINS,$(findstring WINS, $(PLATFORM)))" << endl; 216 t << "ZDIR=$(EPOCROOT) epoc32\\release\\$(PLATFORM)\\$(CFG)\\Z"<< endl;211 t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/release/$(PLATFORM)/$(CFG)/z") << endl; 217 212 t << "else" << endl; 218 t << "ZDIR=$(EPOCROOT) epoc32\\data\\z"<< endl;213 t << "ZDIR=$(EPOCROOT)" << QDir::toNativeSeparators("epoc32/data/z") << endl; 219 214 t << "endif" << endl; 220 215 t << endl; … … 249 244 t << "all: debug release" << endl; 250 245 t << endl; 246 247 QString qmakeCmd = "\t$(QMAKE) \"" + project->projectFile() + "\" " + buildArgs(); 248 251 249 t << "qmake:" << endl; 252 t << "\t$(QMAKE) -spec symbian-abld -o \"" << fileInfo(Option::output.fileName()).fileName() 253 << "\" \"" << project->projectFile() << "\"" << endl; 254 t << endl; 255 t << BLD_INF_FILENAME ":" << endl; 256 t << "\t$(QMAKE)" << endl; 257 t << endl; 250 t << qmakeCmd << endl; 251 t << endl; 252 253 t << BLD_INF_FILENAME ": " << project->projectFile() << endl; 254 t << qmakeCmd << endl; 255 t << endl; 256 258 257 t << "$(ABLD): " BLD_INF_FILENAME << endl; 259 258 t << "\tbldmake bldfiles" << endl; 260 259 t << endl; 261 260 262 t << "debug: $(ABLD)" << endl; 261 QString locFileDep = generateLocFileTarget(t, qmakeCmd); 262 263 t << "debug: " << locFileDep << "$(ABLD)" << endl; 263 264 foreach(QString item, debugPlatforms) { 264 265 t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl; 265 266 } 266 267 t << endl; 267 t << "release: $(ABLD)" << endl;268 t << "release: " << locFileDep << "$(ABLD)" << endl; 268 269 foreach(QString item, releasePlatforms) { 269 270 t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl; … … 273 274 // For more specific builds, targets are in this form: build-platform, e.g. release-armv5 274 275 foreach(QString item, debugPlatforms) { 275 t << "debug-" << item << ": $(ABLD)" << endl;276 t << "debug-" << item << ": " << locFileDep << "$(ABLD)" << endl; 276 277 t << "\t$(ABLD)" << testClause << " build " << item << " udeb" << endl; 277 278 } 278 279 279 280 foreach(QString item, releasePlatforms) { 280 t << "release-" << item << ": $(ABLD)" << endl;281 t << "release-" << item << ": " << locFileDep << "$(ABLD)" << endl; 281 282 t << "\t$(ABLD)" << testClause << " build " << item << " urel" << endl; 282 283 } … … 310 311 // -@ if NOT EXIST ".\somedir" mkdir ".\somedir" 311 312 QStringList dirsToClean; 313 QString dirExists = var("QMAKE_CHK_DIR_EXISTS"); 314 QString mkdir = var("QMAKE_MKDIR"); 312 315 for (QMap<QString, QStringList>::iterator it = systeminclude.begin(); it != systeminclude.end(); ++it) { 313 316 QStringList values = it.value(); … … 316 319 QString fixedValue(QDir::toNativeSeparators(values.at(i))); 317 320 dirsToClean << fixedValue; 318 t << "\t-@ if NOT EXIST \"" << fixedValue << "\" mkdir \"" 319 << fixedValue << "\"" << endl; 321 t << "\t-@ " << dirExists << " \"" << fixedValue << "\" " 322 << (isWindowsShell() ? "" : "|| ") 323 << mkdir << " \"" << fixedValue << "\"" << endl; 320 324 } 321 325 } … … 326 330 // This is why the "2> NUL" gets appended to generated clean targets in makefile.cpp. 327 331 t << EXTENSION_CLEAN ": " COMPILER_CLEAN_TARGET << endl; 328 generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_ DIR"), " /S /Q", "", "");332 generateCleanCommands(t, dirsToClean, var("QMAKE_DEL_TREE"), "", "", ""); 329 333 t << endl; 330 334 … … 375 379 writeDeploymentTargets(t, true); 376 380 377 writeSisTargets(t);378 379 writeStoreBuildTarget(t);380 381 381 generateDistcleanTargets(t); 382 382 … … 408 408 t << endl; 409 409 410 generateExecutionTargets(t, debugPlatforms); 410 t << "freeze: $(ABLD)" << endl; 411 t << "\t$(ABLD)" << testClause << " freeze" << endl; 412 t << endl; 413 414 // Abld toolchain doesn't differentiate between freezing release or debug 415 t << "freeze-debug: freeze" << endl << endl; 416 t << "freeze-release: freeze" << endl << endl; 417 418 // For more specific builds, targets are in this form: freeze-build-platform, e.g. freeze-release-armv5, 419 // though note that debug and release targets of each platform are identical in symbian-abld. 420 foreach(QString item, debugPlatforms) { 421 t << "freeze-debug-" << item << ": $(ABLD)" << endl; 422 t << "\t$(ABLD)" << testClause << " freeze " << item << endl; 423 } 424 foreach(QString item, releasePlatforms) { 425 t << "freeze-release-" << item << ": $(ABLD)" << endl; 426 t << "\t$(ABLD)" << testClause << " freeze " << item << endl; 427 } 428 429 t << endl; 411 430 } 412 431 … … 425 444 t << WINSCW_DEPLOYMENT_TARGET ":" << endl; 426 445 427 QString remoteTestPath = epocRoot() 428 + QLatin1String(isRom ? "epoc32\\data\\z\\private\\" : "epoc32\\winscw\\c\\private\\") 446 QString remoteTestPath = qt_epocRoot() 447 + QDir::toNativeSeparators(QLatin1String(isRom ? "epoc32/data/z/private/" 448 : "epoc32/winscw/c/private/")) 429 449 + privateDirUid; 430 450 DeploymentList depList; 431 451 432 initProjectDeploySymbian(project, depList, remoteTestPath, false, 452 initProjectDeploySymbian(project, depList, remoteTestPath, false, true, 433 453 QLatin1String(isRom ? ROM_DEPLOYMENT_PLATFORM : EMULATOR_DEPLOYMENT_PLATFORM), 434 454 QString(), generatedDirs, generatedFiles); … … 438 458 439 459 for (int i = 0; i < depList.size(); ++i) { 460 #ifdef Q_OS_WIN32 440 461 // Xcopy prompts for selecting file or directory if target doesn't exist, 441 462 // and doesn't provide switch to force file selection. It does provide dir forcing, though, … … 443 464 t << "\t-$(XCOPY) \"" << depList.at(i).from << "\" \"" 444 465 << depList.at(i).to.left(depList.at(i).to.lastIndexOf("\\") + 1) << "\"" << endl; 466 #else 467 QString dirExists = var("QMAKE_CHK_DIR_EXISTS"); 468 QString mkdir = var("QMAKE_MKDIR"); 469 QString dir = QFileInfo(depList.at(i).to).dir().path(); 470 t << "\t-@ " << dirExists << " \"" << dir << "\" || " 471 << mkdir << " \"" << dir << "\"" << endl; 472 t << "\t-$(XCOPY) \"" << QDir::toNativeSeparators(depList.at(i).from) << "\" \"" 473 << QDir::toNativeSeparators(depList.at(i).to) << "\"" << endl; 474 #endif 445 475 } 446 476 … … 454 484 QStringList cleanList; 455 485 for (int i = 0; i < depList.size(); ++i) { 456 cleanList.append( depList.at(i).to);486 cleanList.append(QDir::toNativeSeparators(depList.at(i).to)); 457 487 } 458 488 generateCleanCommands(t, cleanList, "$(DEL_FILE)", "", "", ""); … … 464 494 465 495 return true; 466 }467 468 void SymbianAbldMakefileGenerator::writeStoreBuildTarget(QTextStream &t)469 {470 t << STORE_BUILD_TARGET ":" << endl;471 t << "\t@echo # ============================================================================== > " MAKE_CACHE_NAME << endl;472 t << "\t@echo # This file is generated by make and should not be modified by the user >> " MAKE_CACHE_NAME << endl;473 t << "\t@echo # Name : " << MAKE_CACHE_NAME << " >> " MAKE_CACHE_NAME << endl;474 t << "\t@echo # Part of : " << project->values("TARGET").join(" ") << " >> " MAKE_CACHE_NAME << endl;475 t << "\t@echo # Description : This file is used to cache last build target for >> " MAKE_CACHE_NAME << endl;476 t << "\t@echo # make sis target. >> " MAKE_CACHE_NAME << endl;477 t << "\t@echo # Version : >> " MAKE_CACHE_NAME << endl;478 t << "\t@echo # >> " MAKE_CACHE_NAME << endl;479 t << "\t@echo # ============================================================================== >> " MAKE_CACHE_NAME << endl;480 t << "\t@echo. >> " MAKE_CACHE_NAME << endl;481 t << "\t@echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> " MAKE_CACHE_NAME << endl;482 t << endl;483 484 generatedFiles << MAKE_CACHE_NAME;485 496 } 486 497 … … 490 501 // do not get that, special deployment only makefile is generated for them if needed. 491 502 if (targetType != TypeSubdirs || addDeploymentExtension) { 492 QString gnuMakefileName = QLatin1String("Makefile_") + uid3; 493 removeSpecialCharacters(gnuMakefileName); 494 gnuMakefileName.append(".mk"); 503 gnuMakefileName = QLatin1String("Makefile_") + fileInfo(mmpFileName).completeBaseName() 504 + QLatin1String(".mk"); 495 505 t << "gnumakefile " << gnuMakefileName << endl; 496 506 } -
trunk/qmake/generators/symbian/symmake_abld.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 58 58 virtual void appendAbldTempDirs(QStringList& sysincspaths, QString includepath); 59 59 60 void writeStoreBuildTarget(QTextStream &t);61 60 bool writeDeploymentTargets(QTextStream &t, bool isRom); 62 61 QString gnuMakefileName; 63 62 public: 64 63 -
trunk/qmake/generators/symbian/symmake_sbsv2.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 50 50 51 51 // Included from tools/shared 52 #include <symbian/epocroot .h>52 #include <symbian/epocroot_p.h> 53 53 54 54 SymbianSbsv2MakefileGenerator::SymbianSbsv2MakefileGenerator() : SymbianMakefileGenerator() { } … … 57 57 #define FLM_DEST_DIR "epoc32/tools/makefile_templates/qt" 58 58 #define FLM_SOURCE_DIR "/mkspecs/symbian-sbsv2/flm/qt" 59 #define PLATFORM_GCCE "gcce" 60 #define PLATFORM_WINSCW "winscw" 61 #define PLATFORM_ARM_PREFIX "arm" 62 #define BUILD_DEBUG "udeb" 63 #define BUILD_RELEASE "urel" 64 #define SBS_RVCT_PREFIX "rvct" 65 66 static QString winscwPlatform; 67 static QString armPlatformPrefix; 68 static QString gccePlatform; 69 static QString sbsRvctPrefix; 70 71 #if defined(Q_OS_UNIX) 72 extern char **environ; 73 #endif 74 75 static void fixFlmCmd(QString *cmdLine, const QMap<QString, QString> &commandsToReplace) 76 { 77 // If commandItem starts with any $$QMAKE_* commands, do a replace for SBS equivalent. 78 // Command replacement is done only for the start of the command or right after 79 // concatenation operators (&& and ||), as otherwise unwanted replacements might occur. 80 static QString cmdFind(QLatin1String("(^|&&\\s*|\\|\\|\\s*)%1")); 81 static QString cmdReplace(QLatin1String("\\1%1")); 82 83 // $$escape_expand(\\n\\t) doesn't work for bld.inf files, but is often used as command 84 // separator, so replace it with "&&" command concatenator. 85 cmdLine->replace("\n\t", "&&"); 86 87 // Iterate command replacements in reverse alphabetical order of keys so 88 // that keys which are starts of other longer keys are iterated after longer keys. 89 QMapIterator<QString, QString> cmdIter(commandsToReplace); 90 cmdIter.toBack(); 91 while (cmdIter.hasPrevious()) { 92 cmdIter.previous(); 93 if (cmdLine->contains(cmdIter.key())) 94 cmdLine->replace(QRegExp(cmdFind.arg(cmdIter.key())), cmdReplace.arg(cmdIter.value())); 95 } 96 97 // Sbsv2 toolchain strips all backslashes (even double ones) from option parameters, so just 98 // assume all backslashes are directory separators and replace them with slashes. 99 // Problem: If some command actually needs backslashes for something else than dir separator, 100 // we are out of luck. 101 cmdLine->replace("\\", "/"); 102 } 59 103 60 104 // Copies Qt FLMs to correct location under epocroot. … … 68 112 QFileInfoList sourceInfos = sourceDir.entryInfoList(QDir::Files); 69 113 70 QDir destDir( epocRoot() + FLM_DEST_DIR);114 QDir destDir(qt_epocRoot() + FLM_DEST_DIR); 71 115 if (!destDir.exists()) { 72 116 if (destDir.mkpath(destDir.absolutePath())) … … 91 135 } 92 136 137 void SymbianSbsv2MakefileGenerator::findInstalledCompilerVersions(const QString &matchExpression, 138 const QString &versionPrefix, 139 QStringList *versionList) 140 { 141 // No need to be able to find env variables on other operating systems, 142 // as only linux and windows have support for symbian-sbsv2 toolchain 143 #if defined(Q_OS_UNIX) || defined(Q_OS_WIN) 144 char *entry = 0; 145 int count = 0; 146 QRegExp matcher(matchExpression); 147 while ((entry = environ[count++])) { 148 if (matcher.exactMatch(QString::fromLocal8Bit(entry)) 149 && fileInfo(matcher.cap(matcher.captureCount())).exists()) { 150 // First capture (index 0) is the whole match, which is skipped. 151 // Next n captures are version numbers, which are interesting. 152 // Final capture is the env var value, which we already used, so that is skipped, too. 153 int capture = 1; 154 int finalCapture = matcher.captureCount() - 1; 155 QString version = versionPrefix; 156 while (capture <= finalCapture) { 157 version.append(matcher.cap(capture)); 158 if (capture != finalCapture) 159 version.append(QLatin1Char('.')); 160 capture++; 161 } 162 *versionList << version; 163 } 164 } 165 #endif 166 } 167 168 void SymbianSbsv2MakefileGenerator::findGcceVersions(QStringList *gcceVersionList, 169 QString *defaultVersion) 170 { 171 QString matchStr = QLatin1String("SBS_GCCE(\\d)(\\d)(\\d)BIN=(.*)"); 172 findInstalledCompilerVersions(matchStr, gccePlatform, gcceVersionList); 173 174 QString qtGcceVersion = QString::fromLocal8Bit(qgetenv("QT_GCCE_VERSION")); 175 176 if (!qtGcceVersion.isEmpty()) { 177 if (QRegExp("\\d+\\.\\d+\\.\\d+").exactMatch(qtGcceVersion)) { 178 *defaultVersion = gccePlatform + qtGcceVersion; 179 } else { 180 fprintf(stderr, "Warning: Variable QT_GCCE_VERSION ('%s') is in incorrect " 181 "format, expected format is: 'x.y.z'. Attempting to autodetect GCCE version.\n", 182 qPrintable(qtGcceVersion)); 183 } 184 } 185 186 if (defaultVersion->isEmpty() && gcceVersionList->size()) { 187 gcceVersionList->sort(); 188 *defaultVersion = gcceVersionList->last(); 189 } 190 } 191 192 void SymbianSbsv2MakefileGenerator::findRvctVersions(QStringList *rvctVersionList, 193 QString *defaultVersion) 194 { 195 QString matchStr = QLatin1String("RVCT(\\d)(\\d)BIN=(.*)"); 196 findInstalledCompilerVersions(matchStr, sbsRvctPrefix, rvctVersionList); 197 198 QString qtRvctVersion = QString::fromLocal8Bit(qgetenv("QT_RVCT_VERSION")); 199 200 if (!qtRvctVersion.isEmpty()) { 201 if (QRegExp("\\d+\\.\\d+").exactMatch(qtRvctVersion)) { 202 *defaultVersion = sbsRvctPrefix + qtRvctVersion; 203 } else { 204 fprintf(stderr, "Warning: Variable QT_RVCT_VERSION ('%s') is in incorrect " 205 "format, expected format is: 'x.y'.\n", 206 qPrintable(qtRvctVersion)); 207 } 208 } 209 } 210 211 QString SymbianSbsv2MakefileGenerator::configClause(const QString &platform, 212 const QString &build, 213 const QString &compilerVersion, 214 const QString &clauseTemplate) 215 { 216 QString retval; 217 if (QString::compare(platform, winscwPlatform) == 0) { 218 retval = clauseTemplate.arg(build); 219 } else if (platform.startsWith(armPlatformPrefix)) { 220 QString fixedCompilerVersion = compilerVersion; 221 fixedCompilerVersion.replace(".","_"); 222 retval = clauseTemplate.arg(platform.mid(sizeof(PLATFORM_ARM_PREFIX)-1)) 223 .arg(build) 224 .arg(fixedCompilerVersion); 225 } // else - Unsupported platform for makefile target, return empty clause 226 return retval; 227 } 228 93 229 void SymbianSbsv2MakefileGenerator::writeSbsDeploymentList(const DeploymentList& depList, QTextStream& t) 94 230 { … … 100 236 toItem.replace("\\", "/"); 101 237 #if defined(Q_OS_WIN) 102 toItem.prepend(QDir::current().absolutePath().left(2)); // add drive 238 // add drive if it doesn't have one yet 239 if (toItem.size() > 1 && toItem[1] != QLatin1Char(':')) 240 toItem.prepend(QDir::current().absolutePath().left(2)); 103 241 #endif 104 242 t << "OPTION DEPLOY_SOURCE " << fromItem << endl; … … 117 255 void SymbianSbsv2MakefileGenerator::writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile) 118 256 { 257 static QString debugBuild; 258 static QString releaseBuild; 259 static QString defaultGcceCompilerVersion; 260 static QString defaultRvctCompilerVersion; 261 static QStringList rvctVersions; 262 static QStringList gcceVersions; 263 static QStringList allArmCompilerVersions; 264 265 // Initialize static variables used in makefile creation 266 if (debugBuild.isEmpty()) { 267 debugBuild.append(QLatin1String(BUILD_DEBUG)); 268 releaseBuild.append(QLatin1String(BUILD_RELEASE)); 269 winscwPlatform.append(QLatin1String(PLATFORM_WINSCW)); 270 gccePlatform.append(QLatin1String(PLATFORM_GCCE)); 271 armPlatformPrefix.append(QLatin1String(PLATFORM_ARM_PREFIX)); 272 sbsRvctPrefix.append(QLatin1String(SBS_RVCT_PREFIX)); 273 274 findGcceVersions(&gcceVersions, &defaultGcceCompilerVersion); 275 findRvctVersions(&rvctVersions, &defaultRvctCompilerVersion); 276 277 allArmCompilerVersions << rvctVersions << gcceVersions; 278 279 if (!allArmCompilerVersions.size()) { 280 fprintf(stderr, "Warning: No HW compilers detected. " 281 "Please install either GCCE or RVCT compiler to enable release builds.\n"); 282 } 283 } 284 119 285 QStringList allPlatforms; 120 286 foreach(QString platform, project->values("SYMBIAN_PLATFORMS")) { … … 122 288 } 123 289 124 QStringList debugPlatforms = allPlatforms; 125 QStringList releasePlatforms = allPlatforms; 126 releasePlatforms.removeAll("winscw"); // No release for emulator 290 if (!gcceVersions.size()) 291 allPlatforms.removeAll(gccePlatform); 127 292 128 293 QString testClause; … … 132 297 testClause = QLatin1String(""); 133 298 299 // Note: armClause is used for gcce, too, which has a side effect 300 // of requiring armv* platform(s) in SYMBIAN_PLATFORMS in order 301 // to get any compiler version specific targets. 302 QString armClause = " -c " PLATFORM_ARM_PREFIX ".%1.%2.%3" + testClause; 303 QString genericArmClause; 304 if (defaultRvctCompilerVersion.isEmpty()) { 305 // Note: Argument %3 needs to be empty string in this version of clause 306 genericArmClause = " -c " PLATFORM_ARM_PREFIX "%1_%2%3" + testClause; 307 } else { 308 // If defaultRvctCompilerVersion is defined, use specific sbs clause for "generic" clause 309 genericArmClause = armClause; 310 } 311 QString winscwClause = " -c " PLATFORM_WINSCW "_%1.mwccinc" + testClause;; 312 313 QStringList armPlatforms = allPlatforms.filter(QRegExp("^" PLATFORM_ARM_PREFIX)); 314 315 if (!allArmCompilerVersions.size()) { 316 foreach (QString item, armPlatforms) { 317 allPlatforms.removeAll(item); 318 } 319 armPlatforms.clear(); 320 } 321 322 QStringList allClauses; 323 QStringList debugClauses; 324 QStringList releaseClauses; 325 326 // Only winscw and arm platforms are supported 327 QStringList debugPlatforms = allPlatforms; 328 QStringList releasePlatforms = allPlatforms; 329 releasePlatforms.removeAll(winscwPlatform); // No release for emulator 330 331 if (!releasePlatforms.size()) { 332 fprintf(stderr, "Warning: No valid release platforms in SYMBIAN_PLATFORMS (%s)\n" 333 "Most likely required compiler(s) are not properly installed.\n", 334 qPrintable(project->values("SYMBIAN_PLATFORMS").join(" "))); 335 } 336 337 if (debugPlatforms.contains(winscwPlatform)) 338 debugClauses << configClause(winscwPlatform, debugBuild, QString(), winscwClause); 339 340 foreach(QString item, armPlatforms) { 341 // Only use single clause per arm platform even if multiple compiler versions were found, 342 // otherwise we get makefile target collisions from sbsv2 toolchain. 343 if (rvctVersions.size()) { 344 debugClauses << configClause(item, debugBuild, defaultRvctCompilerVersion, genericArmClause); 345 releaseClauses << configClause(item, releaseBuild, defaultRvctCompilerVersion, genericArmClause); 346 } else { 347 debugClauses << configClause(item, debugBuild, defaultGcceCompilerVersion, armClause); 348 releaseClauses << configClause(item, releaseBuild, defaultGcceCompilerVersion, armClause); 349 } 350 } 351 352 allClauses << debugClauses << releaseClauses; 353 134 354 QTextStream t(&wrapperFile); 135 355 136 t << "# ==============================================================================" << endl; 137 t << "# Generated by qmake (" << qmake_version() << ") (Qt " << QT_VERSION_STR << ") on: "; 138 t << QDateTime::currentDateTime().toString() << endl; 139 t << "# This file is generated by qmake and should not be modified by the" << endl; 140 t << "# user." << endl; 141 t << "# Name : " << wrapperFile.fileName() << endl; 142 t << "# Description : Wrapper Makefile for calling Symbian build tools" << endl; 143 t << "#" << endl; 144 t << "# ==============================================================================" << "\n" << endl; 145 t << endl; 146 t << "MAKEFILE = " << wrapperFile.fileName() << endl; 147 t << "QMAKE = " << Option::fixPathToTargetOS(var("QMAKE_QMAKE")) << endl; 356 MakefileGenerator::writeHeader(t); 357 358 t << "MAKEFILE = " << fileInfo(wrapperFile.fileName()).fileName() << endl; 359 t << "QMAKE = " << var("QMAKE_QMAKE") << endl; 148 360 t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; 149 361 t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; … … 169 381 } 170 382 } 383 171 384 t << endl; 172 t << "first: default" << endl; 173 if (debugPlatforms.contains("winscw")) 174 t << "default: debug-winscw"; 175 else if (debugPlatforms.contains("armv5")) 176 t << "default: debug-armv5"; 177 else if (debugPlatforms.size()) 178 t << "default: debug-" << debugPlatforms.first(); 179 else 180 t << "default: all"; 181 182 t << endl; 385 t << "first: default" << endl << endl; 183 386 if (!isPrimaryMakefile) { 184 t << "all:" << endl; 387 t << "all:" << endl << endl; 388 t << "default: all" << endl << endl; 185 389 } else { 186 t << "all: debug release" << endl; 187 t << endl; 390 t << "all: debug release" << endl << endl; 391 if (debugPlatforms.contains(winscwPlatform)) 392 t << "default: debug-winscw"; 393 else if (debugPlatforms.size()) 394 t << "default: debug-" << debugPlatforms.first(); 395 else 396 t << "default: all"; 397 t << endl; 398 399 QString qmakeCmd = "\t$(QMAKE) \"" + project->projectFile() + "\" " + buildArgs(); 400 188 401 t << "qmake:" << endl; 189 t << "\t$(QMAKE) -spec symbian-sbsv2 -o \"" << fileInfo(Option::output.fileName()).fileName() 190 << "\" \"" << project->projectFile() << "\"" << endl; 191 t << endl; 192 t << BLD_INF_FILENAME ":" << endl; 193 t << "\t$(QMAKE)" << endl; 194 t << endl; 195 196 QString winscw("winscw"); 197 t << "debug: " << BLD_INF_FILENAME << endl; 402 t << qmakeCmd << endl; 403 t << endl; 404 405 t << BLD_INF_FILENAME ": " << project->projectFile() << endl; 406 t << qmakeCmd << endl; 407 t << endl; 408 409 QString locFileDep = generateLocFileTarget(t, qmakeCmd); 410 411 t << "debug: " << locFileDep << BLD_INF_FILENAME << endl; 198 412 t << "\t$(SBS)"; 413 foreach(QString clause, debugClauses) { 414 t << clause; 415 } 416 t << endl; 417 t << "clean-debug: " << BLD_INF_FILENAME << endl; 418 t << "\t$(SBS) reallyclean --toolcheck=off"; 419 foreach(QString clause, debugClauses) { 420 t << clause; 421 } 422 t << endl; 423 424 t << "freeze-debug: " << BLD_INF_FILENAME << endl; 425 t << "\t$(SBS) freeze"; 426 foreach(QString clause, debugClauses) { 427 t << clause; 428 } 429 t << endl; 430 431 t << "release: " << locFileDep << BLD_INF_FILENAME << endl; 432 t << "\t$(SBS)"; 433 foreach(QString clause, releaseClauses) { 434 t << clause; 435 } 436 t << endl; 437 t << "clean-release: " << BLD_INF_FILENAME << endl; 438 t << "\t$(SBS) reallyclean --toolcheck=off"; 439 foreach(QString clause, releaseClauses) { 440 t << clause; 441 } 442 t << endl; 443 444 t << "freeze-release: " << BLD_INF_FILENAME << endl; 445 t << "\t$(SBS) freeze"; 446 foreach(QString clause, releaseClauses) { 447 t << clause; 448 } 449 t << endl << endl; 450 451 QString defaultGcceArmVersion; 452 if (armPlatforms.size()) { 453 defaultGcceArmVersion = armPlatforms.first(); 454 } else { 455 defaultGcceArmVersion = QLatin1String("armv5"); 456 } 457 458 // For more specific builds, targets are in this form: 459 // release-armv5 - generic target, compiler version determined by toolchain or autodetection 460 // release-armv5-rvct4.0 - compiler version specific target 199 461 foreach(QString item, debugPlatforms) { 200 if(QString::compare(item, winscw) == 0) 201 t << " -c " << item << "_udeb.mwccinc" << testClause; 202 else 203 t << " -c " << item << "_udeb" << testClause; 204 } 205 t << endl; 206 t << "release: " << BLD_INF_FILENAME << endl; 207 t << "\t$(SBS)"; 462 QString clause; 463 if (item.compare(winscwPlatform) == 0) 464 clause = configClause(item, debugBuild, QString(), winscwClause); 465 else if (item.compare(gccePlatform) == 0 ) 466 clause = configClause(defaultGcceArmVersion, debugBuild, defaultGcceCompilerVersion, armClause); 467 else // use generic arm clause 468 clause = configClause(item, debugBuild, defaultRvctCompilerVersion, genericArmClause); 469 470 t << "debug-" << item << ": " << locFileDep << BLD_INF_FILENAME << endl; 471 t << "\t$(SBS)" << clause << endl; 472 t << "clean-debug-" << item << ": " << BLD_INF_FILENAME << endl; 473 t << "\t$(SBS) reallyclean" << clause << endl; 474 t << "freeze-debug-" << item << ": " << BLD_INF_FILENAME << endl; 475 t << "\t$(SBS) freeze" << clause << endl; 476 } 477 208 478 foreach(QString item, releasePlatforms) { 209 if(QString::compare(item, winscw) == 0) 210 t << " -c " << item << "_urel.mwccinc" << testClause; 211 else 212 t << " -c " << item << "_urel" << testClause; 213 } 214 t << endl; 215 216 // For more specific builds, targets are in this form: build-platform, e.g. release-armv5 217 foreach(QString item, debugPlatforms) { 218 t << "debug-" << item << ": " << BLD_INF_FILENAME << endl; 219 if(QString::compare(item, winscw) == 0) 220 t << "\t$(SBS) -c " << item << "_udeb.mwccinc" << testClause << endl; 221 else 222 t << "\t$(SBS) -c " << item << "_udeb" << testClause << endl; 223 } 224 225 foreach(QString item, releasePlatforms) { 226 t << "release-" << item << ": " << BLD_INF_FILENAME << endl; 227 if(QString::compare(item, winscw) == 0) 228 t << "\t$(SBS) -c " << item << "_urel.mwccinc" << testClause << endl; 229 else 230 t << "\t$(SBS) -c " << item << "_urel" << testClause << endl; 479 QString clause; 480 if (item.compare(gccePlatform) == 0 ) 481 clause = configClause(defaultGcceArmVersion, releaseBuild, defaultGcceCompilerVersion, armClause); 482 else // use generic arm clause 483 clause = configClause(item, releaseBuild, defaultRvctCompilerVersion, genericArmClause); 484 485 t << "release-" << item << ": " << locFileDep << BLD_INF_FILENAME << endl; 486 t << "\t$(SBS)" << clause << endl; 487 t << "clean-release-" << item << ": " << BLD_INF_FILENAME << endl; 488 t << "\t$(SBS) reallyclean" << clause << endl; 489 t << "freeze-release-" << item << ": " << BLD_INF_FILENAME << endl; 490 t << "\t$(SBS) freeze" << clause << endl; 491 } 492 493 foreach(QString item, armPlatforms) { 494 foreach(QString compilerVersion, allArmCompilerVersions) { 495 QString debugClause = configClause(item, debugBuild, compilerVersion, armClause); 496 QString releaseClause = configClause(item, releaseBuild, compilerVersion, armClause); 497 t << "debug-" << item << "-" << compilerVersion << ": " << locFileDep << BLD_INF_FILENAME << endl; 498 t << "\t$(SBS)" << debugClause << endl; 499 t << "clean-debug-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl; 500 t << "\t$(SBS) reallyclean" << debugClause << endl; 501 t << "freeze-debug-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl; 502 t << "\t$(SBS) freeze" << debugClause << endl; 503 t << "release-" << item << "-" << compilerVersion << ": " << locFileDep << BLD_INF_FILENAME << endl; 504 t << "\t$(SBS)" << releaseClause << endl; 505 t << "clean-release-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl; 506 t << "\t$(SBS) reallyclean" << releaseClause << endl; 507 t << "freeze-release-" << item << "-" << compilerVersion << ": " << BLD_INF_FILENAME << endl; 508 t << "\t$(SBS) freeze" << releaseClause << endl; 509 } 231 510 } 232 511 233 512 t << endl; 234 513 t << "export: " << BLD_INF_FILENAME << endl; 235 t << "\t$(SBS) export" << endl; 236 t << endl; 514 t << "\t$(SBS) export"; 515 foreach(QString clause, allClauses) { 516 t << clause; 517 } 518 t << endl << endl; 237 519 238 520 t << "cleanexport: " << BLD_INF_FILENAME << endl; 239 t << "\t$(SBS) cleanexport" << endl; 240 t << endl; 241 242 } 243 244 // Add all extra targets including extra compiler targest also to wrapper makefile, 521 t << "\t$(SBS) cleanexport"; 522 foreach(QString clause, allClauses) { 523 t << clause; 524 } 525 t << endl << endl; 526 527 // Typically one wants to freeze release binaries, so make plain freeze target equal to 528 // freeze-release. If freezing of debug binaries is needed for some reason, then 529 // freeze-debug target should be used. There is no point to try freezing both with one 530 // target as both produce the same def file. 531 t << "freeze: freeze-release" << endl << endl; 532 } 533 534 // Add all extra targets including extra compiler targets also to wrapper makefile, 245 535 // even though many of them may have already been added to bld.inf as FLMs. 246 536 // This is to enable use of targets like 'mocables', which call targets generated by extra compilers. … … 254 544 } 255 545 256 writeSisTargets(t);257 258 546 generateDistcleanTargets(t); 259 547 548 // Do not check for tools when doing generic clean, as most tools are not actually needed for 549 // cleaning. Mainly this is relevant for environments that do not have winscw compiler. 260 550 t << "clean: " << BLD_INF_FILENAME << endl; 261 t << "\t-$(SBS) reallyclean" << endl; 551 t << "\t-$(SBS) reallyclean --toolcheck=off"; 552 foreach(QString clause, allClauses) { 553 t << clause; 554 } 555 t << endl << endl; 556 262 557 t << endl; 263 264 t << "clean-debug: " << BLD_INF_FILENAME << endl;265 t << "\t$(SBS) reallyclean";266 foreach(QString item, debugPlatforms) {267 t << " -c " << item << "_udeb" << testClause;268 }269 t << endl;270 t << "clean-release: " << BLD_INF_FILENAME << endl;271 t << "\t$(SBS) reallyclean";272 foreach(QString item, releasePlatforms) {273 t << " -c " << item << "_urel" << testClause;274 }275 t << endl;276 277 // For more specific builds, targets are in this form: clean-build-platform, e.g. clean-release-armv5278 foreach(QString item, debugPlatforms) {279 t << "clean-debug-" << item << ": " << BLD_INF_FILENAME << endl;280 t << "\t$(SBS) reallyclean -c " << item << "_udeb" << testClause << endl;281 }282 foreach(QString item, releasePlatforms) {283 t << "clean-release-" << item << ": " << BLD_INF_FILENAME << endl;284 t << "\t$(SBS) reallyclean -c " << item << "_urel" << testClause << endl;285 }286 t << endl;287 288 generateExecutionTargets(t, debugPlatforms);289 558 } 290 559 … … 308 577 } 309 578 579 QMap<QString, QString> commandsToReplace; 580 commandsToReplace.insert(project->values("QMAKE_COPY").join(" "), 581 project->values("QMAKE_SBSV2_COPY").join(" ")); 582 commandsToReplace.insert(project->values("QMAKE_COPY_DIR").join(" "), 583 project->values("QMAKE_SBSV2_COPY_DIR").join(" ")); 584 commandsToReplace.insert(project->values("QMAKE_MOVE").join(" "), 585 project->values("QMAKE_SBSV2_MOVE").join(" ")); 586 commandsToReplace.insert(project->values("QMAKE_DEL_FILE").join(" "), 587 project->values("QMAKE_SBSV2_DEL_FILE").join(" ")); 588 commandsToReplace.insert(project->values("QMAKE_MKDIR").join(" "), 589 project->values("QMAKE_SBSV2_MKDIR").join(" ")); 590 commandsToReplace.insert(project->values("QMAKE_DEL_DIR").join(" "), 591 project->values("QMAKE_SBSV2_DEL_DIR").join(" ")); 592 commandsToReplace.insert(project->values("QMAKE_DEL_TREE").join(" "), 593 project->values("QMAKE_SBSV2_DEL_TREE").join(" ")); 594 310 595 // Write extra compilers and targets to initialize QMAKE_ET_* variables 311 596 // Cache results to avoid duplicate calls when creating wrapper makefile … … 319 604 QStringList allPreDeps; 320 605 foreach(QString item, project->values("PRE_TARGETDEPS")) { 321 // Predeps get mangled in windows, so fix them to more sbsv2 friendly format 322 #if defined(Q_OS_WIN) 323 if (item.mid(1, 1) == ":") 324 item = item.mid(0, 1).toUpper().append(item.mid(1)); // Fix drive to uppercase 325 #endif 326 item.replace("\\", "/"); 327 allPreDeps << escapeDependencyPath(item); 606 allPreDeps.append(fileInfo(item).absoluteFilePath()); 328 607 } 329 608 … … 355 634 QString commandItem = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + item + targetItem).join(" "); 356 635 357 358 636 // Make sure all deps paths are absolute 359 637 QString absoluteDeps; … … 374 652 commandItem.replace("$(DEFINES)", defines.join(" ")); 375 653 376 // Sbsv2 strips all backslashes (even doubles ones) from option parameters, so just replace them with slashes 377 // Problem: If some command actually needs backslashes for something else than dir separator, we are out of luck... 378 commandItem.replace("\\", "/"); 654 fixFlmCmd(&commandItem, commandsToReplace); 655 379 656 t << "OPTION COMMAND " << commandItem << endl; 380 657 t << "END" << endl; … … 386 663 387 664 // Write deployment rules 388 QString remoteTestPath = epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid;665 QString remoteTestPath = qt_epocRoot() + QLatin1String("epoc32/winscw/c/private/") + privateDirUid; 389 666 DeploymentList depList; 390 667 391 668 //write emulator deployment 392 669 t << "#if defined(WINSCW)" << endl; 393 initProjectDeploySymbian(project, depList, remoteTestPath, false, 670 initProjectDeploySymbian(project, depList, remoteTestPath, false, true, 394 671 QLatin1String(EMULATOR_DEPLOYMENT_PLATFORM), QString(), generatedDirs, generatedFiles); 395 672 writeSbsDeploymentList(depList, t); … … 397 674 398 675 //write ROM deployment 399 remoteTestPath = epocRoot() + QLatin1String("epoc32/data/z/private/") + privateDirUid;676 remoteTestPath = qt_epocRoot() + QLatin1String("epoc32/data/z/private/") + privateDirUid; 400 677 depList.clear(); 401 initProjectDeploySymbian(project, depList, remoteTestPath, false, 678 initProjectDeploySymbian(project, depList, remoteTestPath, false, true, 402 679 QLatin1String(ROM_DEPLOYMENT_PLATFORM), QString(), generatedDirs, generatedFiles); 403 680 writeSbsDeploymentList(depList, t); … … 406 683 // Write post link rules 407 684 if (!project->isEmpty("QMAKE_POST_LINK")) { 685 QString postLinkCmd = var("QMAKE_POST_LINK"); 686 fixFlmCmd(&postLinkCmd, commandsToReplace); 408 687 t << "START EXTENSION qt/qmake_post_link" << endl; 409 t << "OPTION POST_LINK_CMD " << var("QMAKE_POST_LINK")<< endl;410 t << "OPTION LINK_TARGET " << removePathSeparators(escapeFilePath(fileFixify(project->first("TARGET"))).append(".").append(getTargetExtension())) << endl;688 t << "OPTION POST_LINK_CMD " << postLinkCmd << endl; 689 t << "OPTION LINK_TARGET " << fixedTarget << QLatin1String(".") << getTargetExtension() << endl; 411 690 t << "END" << endl; 412 691 t << endl; -
trunk/qmake/generators/symbian/symmake_sbsv2.h
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 57 57 virtual void writeWrapperMakefile(QFile& wrapperFile, bool isPrimaryMakefile); 58 58 virtual void appendAbldTempDirs(QStringList& sysincspaths, QString includepath); 59 virtual bool isForSymbianSbsv2() const { return true; } // FIXME: killme - i'm ugly! 59 60 60 61 public: … … 65 66 private: 66 67 void exportFlm(); 68 void findGcceVersions(QStringList *gcceVersionList, QString *defaultVersion); 69 void findRvctVersions(QStringList *rvctVersionList, QString *defaultVersion); 70 void findInstalledCompilerVersions(const QString &matchExpression, 71 const QString &versionPrefix, 72 QStringList *versionList); 73 QString configClause(const QString &platform, 74 const QString &build, 75 const QString &compilerVersion, 76 const QString &clauseTemplate); 77 67 78 void writeSbsDeploymentList(const DeploymentList& depList, QTextStream& t); 68 79 -
trunk/qmake/generators/unix/unixmake.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 66 66 } 67 67 68 if (project->isEmpty("QMAKE_PREFIX_SHLIB")) 69 // Prevent crash when using the empty variable. 70 project->values("QMAKE_PREFIX_SHLIB").append(""); 71 68 72 if(!project->isEmpty("QMAKE_FAILED_REQUIREMENTS")) /* no point */ 69 73 return; … … 100 104 if(project->isEmpty("MAKEFILE")) 101 105 project->values("MAKEFILE").append("Makefile"); 102 if(project->isEmpty("QMAKE_QMAKE"))103 project->values("QMAKE_QMAKE").append("qmake");104 106 if(project->values("QMAKE_INTERNAL_QMAKE_DEPS").indexOf("qmake_all") == -1) 105 107 project->values("QMAKE_INTERNAL_QMAKE_DEPS").append("qmake_all"); … … 452 454 libdirs.append(f); 453 455 } else if(opt.startsWith("-l")) { 454 if (project->isActiveConfig("rvct_linker")) { 456 if (!project->isEmpty("QMAKE_RVCT_LINKSTYLE")) { 457 (*it) = opt.mid(2); 458 } else if (project->isActiveConfig("rvct_linker")) { 455 459 (*it) = "lib" + opt.mid(2) + ".so"; 456 460 } else { … … 492 496 if(!extn.isNull()) 493 497 extens << extn; 498 else if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) 499 // In Symbian you link to the stub .lib file, but run with the .dll file. 500 extens << "lib"; 494 501 else 495 502 extens << project->values("QMAKE_EXTENSION_SHLIB").first() << "a"; 496 503 for(QStringList::Iterator extit = extens.begin(); extit != extens.end(); ++extit) { 497 504 if(dir.isNull()) { 498 QString lib_stub;499 505 for(QList<QMakeLocalFileName>::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) { 500 if(exists((*dep_it).local() + Option::dir_sep + "lib" + stub + 501 "." + (*extit))) { 502 lib_stub = stub; 506 QString pathToLib = ((*dep_it).local() + Option::dir_sep 507 + project->values("QMAKE_PREFIX_SHLIB").first() 508 + stub + "." + (*extit)); 509 if(exists(pathToLib)) { 510 if (!project->isEmpty("QMAKE_RVCT_LINKSTYLE")) 511 (*it) = pathToLib; 512 else 513 (*it) = "-l" + stub; 514 found = true; 503 515 break; 504 516 } 505 517 } 506 if(!lib_stub.isNull()) { 507 (*it) = "-l" + lib_stub; 518 } else { 519 if(exists(project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit))) { 520 (*it) = project->values("QMAKE_PREFIX_SHLIB").first() + stub + "." + (*extit); 508 521 found = true; 509 522 break; 510 523 } 511 } else {512 if(exists("lib" + stub + "." + (*extit))) {513 (*it) = "lib" + stub + "." + (*extit);514 found = true;515 break;516 }517 524 } 518 525 } 519 526 if(!found && project->isActiveConfig("compile_libtool")) { 520 527 for(int dep_i = 0; dep_i < libdirs.size(); ++dep_i) { 521 if(exists(libdirs[dep_i].local() + Option::dir_sep + "lib"+ stub + Option::libtool_ext)) {522 (*it) = libdirs[dep_i].real() + Option::dir_sep + "lib"+ stub + Option::libtool_ext;528 if(exists(libdirs[dep_i].local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext)) { 529 (*it) = libdirs[dep_i].real() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + stub + Option::libtool_ext; 523 530 found = true; 524 531 break; … … 545 552 QList<QMakeLocalFileName> libdirs, frameworkdirs; 546 553 frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); 547 frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks"));548 554 const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", QString() }; 549 555 for(int i = 0; !lflags[i].isNull(); i++) { … … 561 567 const QMakeLocalFileName &lfn = libdirs[dep_i]; 562 568 if(!project->isActiveConfig("compile_libtool")) { //give them the .libs.. 563 QString la = lfn.local() + Option::dir_sep + "lib"+ lib + Option::libtool_ext;569 QString la = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib + Option::libtool_ext; 564 570 if(exists(la) && QFile::exists(lfn.local() + Option::dir_sep + ".libs")) { 565 571 QString dot_libs = lfn.real() + Option::dir_sep + ".libs"; … … 569 575 } 570 576 571 QString prl = lfn.local() + Option::dir_sep + "lib"+ lib;577 QString prl = lfn.local() + Option::dir_sep + project->values("QMAKE_PREFIX_SHLIB").first() + lib; 572 578 if(!project->isEmpty("QMAKE_" + lib.toUpper() + "_SUFFIX")) 573 579 prl += project->first("QMAKE_" + lib.toUpper() + "_SUFFIX"); … … 617 623 //merge them into a logical order 618 624 if(!project->isActiveConfig("no_smart_library_merge") && !project->isActiveConfig("no_lflags_merge")) { 619 Q StringListlflags;625 QHash<QString, QStringList> lflags; 620 626 for(int lit = 0; lit < l.size(); ++lit) { 627 QString arch("default"); 621 628 QString opt = l.at(lit).trimmed(); 622 629 if(opt.startsWith("-")) { 630 if (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-Xarch")) { 631 if (opt.length() > 7) { 632 arch = opt.mid(7); 633 opt = l.at(++lit); 634 } 635 } 636 623 637 if(opt.startsWith("-L") || 624 638 (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-F"))) { 625 if(lit == 0 || l.lastIndexOf(opt, lit-1) == -1) 626 lflags.append(opt); 627 } else if(opt.startsWith("-l")) { 628 if(lit == l.size()-1 || l.indexOf(opt, lit+1) == -1) 629 lflags.append(opt); 639 if(!lflags[arch].contains(opt)) 640 lflags[arch].append(opt); 641 } else if(opt.startsWith("-l") || opt == "-pthread") { 642 // Make sure we keep the dependency-order of libraries 643 if (lflags[arch].contains(opt)) 644 lflags[arch].removeAll(opt); 645 lflags[arch].append(opt); 630 646 } else if(Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-framework")) { 631 647 if(opt.length() > 11) 632 648 opt = opt.mid(11); 633 else 649 else { 634 650 opt = l.at(++lit); 651 if (Option::target_mode == Option::TARG_MACX_MODE && opt.startsWith("-Xarch")) 652 opt = l.at(++lit); // The user has done the right thing and prefixed each part 653 } 635 654 bool found = false; 636 for(int x = lit+1; x < l.size(); ++x) {637 QString xf = l .at(x);655 for(int x = 0; x < lflags[arch].size(); ++x) { 656 QString xf = lflags[arch].at(x); 638 657 if(xf.startsWith("-framework")) { 639 658 QString framework; … … 641 660 framework = xf.mid(11); 642 661 else 643 framework = l .at(++x);662 framework = lflags[arch].at(++x); 644 663 if(framework == opt) { 645 664 found = true; … … 649 668 } 650 669 if(!found) { 651 lflags .append("-framework");652 lflags .append(opt);670 lflags[arch].append("-framework"); 671 lflags[arch].append(opt); 653 672 } 654 673 } else { 655 lflags .append(opt);674 lflags[arch].append(opt); 656 675 } 657 676 } else if(!opt.isNull()) { 658 if(lit == 0 || l.lastIndexOf(opt, lit-1) == -1) 659 lflags.append(opt); 660 } 661 } 662 l = lflags; 677 if(!lflags[arch].contains(opt)) 678 lflags[arch].append(opt); 679 } 680 } 681 682 l = lflags.take("default"); 683 684 // Process architecture specific options (Xarch) 685 QHash<QString, QStringList>::const_iterator archIterator = lflags.constBegin(); 686 while (archIterator != lflags.constEnd()) { 687 const QStringList archOptions = archIterator.value(); 688 for (int i = 0; i < archOptions.size(); ++i) { 689 l.append(QLatin1String("-Xarch_") + archIterator.key()); 690 l.append(archOptions.at(i)); 691 } 692 ++archIterator; 693 } 663 694 } 664 695 } … … 780 811 if(!links.isEmpty()) { 781 812 for(int i = 0; i < links.size(); ++i) { 782 if(Option::target_mode == Option::TARG_WIN_MODE || 783 Option::target_mode == Option::TARG_OS2_MODE || 784 Option::target_mode == Option::TARG_MAC9_MODE) { 785 } else if(Option::target_mode == Option::TARG_UNIX_MODE || 786 Option::target_mode == Option::TARG_MACX_MODE) { 813 if(Option::target_mode == Option::TARG_UNIX_MODE || 814 Option::target_mode == Option::TARG_MACX_MODE) { 787 815 QString link = Option::fixPathToTargetOS(destdir + links[i], false); 788 816 int lslash = link.lastIndexOf(Option::dir_sep); -
trunk/qmake/generators/unix/unixmake.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 50 50 { 51 51 bool init_flag, include_deps; 52 bool writeMakefile(QTextStream &);53 52 QString libtoolFileName(bool fixify=true); 54 53 void writeLibtoolFile(); // for libtool … … 76 75 77 76 void writeMakeParts(QTextStream &); 77 bool writeMakefile(QTextStream &); 78 78 79 79 private: -
trunk/qmake/generators/unix/unixmake2.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 82 82 writeHeader(t); 83 83 if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) { 84 t << "QMAKE = " << (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE")) << endl;84 t << "QMAKE = " << var("QMAKE_QMAKE") << endl; 85 85 QStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); 86 86 for(QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) … … 149 149 t << "LINK = " << var("QMAKE_LINK") << endl; 150 150 t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; 151 t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_FRAMEWORK DIR_FLAGS") << " "151 t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_FRAMEWORKPATH_FLAGS") << " " 152 152 << var("QMAKE_LIBDIR_FLAGS") << " " << var("QMAKE_LIBS") << " " << var("QMAKE_LIBS_PRIVATE") << endl; 153 153 } … … 155 155 t << "AR = " << var("QMAKE_AR") << endl; 156 156 t << "RANLIB = " << var("QMAKE_RANLIB") << endl; 157 t << "QMAKE = " << (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE")) << endl;157 t << "QMAKE = " << var("QMAKE_QMAKE") << endl; 158 158 t << "TAR = " << var("QMAKE_TAR") << endl; 159 159 t << "COMPRESS = " << var("QMAKE_GZIP") << endl; … … 178 178 t << "export MACOSX_DEPLOYMENT_TARGET = " //exported to children processes 179 179 << project->first("QMAKE_MACOSX_DEPLOYMENT_TARGET") << endl; 180 181 if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) { 182 t << "vpath %.dso " << project->values("QMAKE_LIBDIR").join(":") << endl; 183 t << "vpath %.lib " << project->values("QMAKE_LIBDIR").join(":") << endl; 184 } 185 180 186 t << endl; 181 187 … … 234 240 t << "TARGETD = " << escapeFilePath(var("TARGET_x.y")) << endl; 235 241 t << "TARGET0 = " << escapeFilePath(var("TARGET_")) << endl; 242 } else if(!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) { 243 t << "TARGETD = " << escapeFilePath(var("TARGET")) << endl; 236 244 } else if(project->isEmpty("QMAKE_HPUX_SHLIB")) { 237 245 t << "TARGETD = " << escapeFilePath(var("TARGET_x.y.z")) << endl; … … 333 341 QStringList &l = project->values("SUBLIBS"); 334 342 for(QStringList::Iterator it = l.begin(); it != l.end(); ++it) 335 t << libdir << "lib" << (*it) << ".a "; 343 t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." 344 << project->first("QMAKE_EXTENSION_STATICLIB") << " "; 336 345 t << endl << endl; 337 346 } … … 543 552 << varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") + 544 553 " " + destdir + "Versions/Current") << "\n\t"; 554 if(!project->isEmpty("QMAKE_POST_LINK")) 555 t << "\n\t" << var("QMAKE_POST_LINK"); 556 t << endl << endl; 557 } else if(!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) { 558 t << "\n\t" 559 << "-$(DEL_FILE) $(TARGET)" << "\n\t" 560 << var("QMAKE_LINK_SHLIB_CMD"); 561 if(!destdir.isEmpty()) 562 t << "\n\t" 563 << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t" 564 << "-$(MOVE) $(TARGET) " << destdir; 545 565 if(!project->isEmpty("QMAKE_POST_LINK")) 546 566 t << "\n\t" << var("QMAKE_POST_LINK"); … … 861 881 QStringList &l = project->values("SUBLIBS"); 862 882 for(it = l.begin(); it != l.end(); ++it) 863 t << libdir << "lib" << (*it) << ".a" << ":\n\t" 883 t << libdir << project->first("QMAKE_PREFIX_STATICLIB") << (*it) << "." 884 << project->first("QMAKE_EXTENSION_STATICLIB") << ":\n\t" 864 885 << var(QString("MAKELIB") + (*it)) << endl << endl; 865 886 } … … 876 897 } else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty() && 877 898 !project->isActiveConfig("plugin")) { 878 t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl 879 << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) " 880 << destdir << "$(TARGET2) $(TARGETA)" << endl; 899 t << "\t-$(DEL_FILE) " << destdir << "$(TARGET)" << " " << endl; 900 if (project->values("QMAKE_SYMBIAN_SHLIB").isEmpty()) 901 t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) " 902 << destdir << "$(TARGET2) $(TARGETA)" << endl; 881 903 } else { 882 904 t << "\t-$(DEL_FILE) " << "$(TARGET)" << " " << endl; … … 993 1015 project->values("TARGET_EXT").append(".exe"); 994 1016 } else if (project->isActiveConfig("staticlib")) { 995 project->values("TARGET").first().prepend( "lib");996 project->values("TARGET").first() += ". a";1017 project->values("TARGET").first().prepend(project->first("QMAKE_PREFIX_STATICLIB")); 1018 project->values("TARGET").first() += "." + project->first("QMAKE_EXTENSION_STATICLIB"); 997 1019 if(project->values("QMAKE_AR_CMD").isEmpty()) 998 1020 project->values("QMAKE_AR_CMD").append("$(AR) $(TARGET) $(OBJECTS)"); 999 1021 } else { 1000 project->values("TARGETA").append(project->first("DESTDIR") + "lib" + project->first("TARGET") + ".a"); 1022 project->values("TARGETA").append(project->first("DESTDIR") + project->first("QMAKE_PREFIX_STATICLIB") 1023 + project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_STATICLIB")); 1001 1024 if(project->isActiveConfig("compile_libtool")) 1002 1025 project->values("TARGET_la") = QStringList(project->first("DESTDIR") + "lib" + project->first("TARGET") + Option::libtool_ext); … … 1046 1069 project->values("TARGET") = project->values("TARGET_x"); 1047 1070 } else if (!project->isEmpty("QMAKE_AIX_SHLIB")) { 1048 project->values("TARGET_").append("lib" + project->first("TARGET") + ".a"); 1071 project->values("TARGET_").append(project->first("QMAKE_PREFIX_STATICLIB") + project->first("TARGET") 1072 + "." + project->first("QMAKE_EXTENSION_STATICLIB")); 1049 1073 if(project->isActiveConfig("lib_version_first")) { 1050 1074 project->values("TARGET_x").append("lib" + project->first("TARGET") + "." + … … 1075 1099 } 1076 1100 project->values("TARGET") = project->values("TARGET_x.y.z"); 1101 } else if (!project->isEmpty("QMAKE_SYMBIAN_SHLIB")) { 1102 project->values("TARGET_").append(project->first("TARGET") + "." + 1103 project->first("QMAKE_EXTENSION_SHLIB")); 1104 project->values("TARGET") = project->values("TARGET_"); 1077 1105 } else { 1078 1106 project->values("TARGET_").append("lib" + project->first("TARGET") + "." + -
trunk/qmake/generators/win32/borland_bmake.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 116 116 if(project->values("MAKEFILE").isEmpty()) 117 117 project->values("MAKEFILE").append("Makefile"); 118 if(project->values("QMAKE_QMAKE").isEmpty())119 project->values("QMAKE_QMAKE").append("qmake");120 118 return; 121 119 } -
trunk/qmake/generators/win32/borland_bmake.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/generators/win32/mingw_make.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 144 144 project->first("TEMPLATE") == "lib") { 145 145 if(Option::mkfile::do_stub_makefile) { 146 t << "QMAKE = " << (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE")) << endl;146 t << "QMAKE = " << var("QMAKE_QMAKE") << endl; 147 147 QStringList &qut = project->values("QMAKE_EXTRA_TARGETS"); 148 148 for(QStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it) … … 192 192 t << "CREATE " << target << endl; 193 193 for (QStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) { 194 if (QDir::isRelativePath(*it)) 195 t << "ADDMOD " << *it << endl; 196 else 197 t << *it << endl; 194 t << "ADDMOD " << *it << endl; 198 195 } 199 196 t << "SAVE" << endl; … … 249 246 if(project->values("MAKEFILE").isEmpty()) 250 247 project->values("MAKEFILE").append("Makefile"); 251 if(project->values("QMAKE_QMAKE").isEmpty())252 project->values("QMAKE_QMAKE").append("qmake");253 248 return; 254 249 } … … 374 369 } 375 370 createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS")); 376 objectsLinkLine = "ar -M < " + ar_script_file; 371 // QMAKE_LIB is used for win32, including mingw, whereas QMAKE_AR is used on Unix. 372 // Strip off any options since the ar commands will be read from file. 373 QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);; 374 if (ar_cmd.isEmpty()) 375 ar_cmd = "ar"; 376 objectsLinkLine = ar_cmd + " -M < " + ar_script_file; 377 377 } else { 378 378 QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET"); … … 418 418 t << escapeDependencyPath(var("RES_FILE")) << ": " << rc_file << "\n\t" 419 419 << var("QMAKE_RC") << " -i " << rc_file << " -o " << var("RES_FILE") 420 << " --include-dir=" << incPathStr << endl << endl;420 << " --include-dir=" << incPathStr << " $(DEFINES)" << endl << endl; 421 421 } 422 422 } -
trunk/qmake/generators/win32/mingw_make.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/generators/win32/msvc_nmake.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 157 157 if(project->values("MAKEFILE").isEmpty()) 158 158 project->values("MAKEFILE").append("Makefile"); 159 if(project->values("QMAKE_QMAKE").isEmpty())160 project->values("QMAKE_QMAKE").append("qmake");161 159 if(project->isEmpty("QMAKE_COPY_FILE")) 162 160 project->values("QMAKE_COPY_FILE").append("$(COPY)"); … … 216 214 } 217 215 if(project->isActiveConfig("debug")) { 218 project->values("QMAKE_ CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".pdb");216 project->values("QMAKE_DISTCLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".pdb"); 219 217 project->values("QMAKE_CLEAN").append(project->first("DESTDIR") + project->first("TARGET") + version + ".ilk"); 220 218 project->values("QMAKE_CLEAN").append("vc*.pdb"); … … 313 311 } 314 312 if(!project->isEmpty("QMAKE_POST_LINK")) { 315 if (useSignature) 316 t << " && " << var("QMAKE_POST_LINK"); 317 else 318 t << "\n\t" << var("QMAKE_POST_LINK"); 313 t << "\n\t" << var("QMAKE_POST_LINK"); 319 314 } 320 315 t << endl; -
trunk/qmake/generators/win32/msvc_nmake.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/generators/win32/msvc_objectmodel.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 42 42 #include "msvc_objectmodel.h" 43 43 #include "msvc_vcproj.h" 44 #include "msvc_vcxproj.h" 44 45 #include <qstringlist.h> 45 46 #include <qfileinfo.h> … … 280 281 } 281 282 283 // VCToolBase ------------------------------------------------- 284 QStringList VCToolBase::fixCommandLine(const QString &input) 285 { 286 // The splitting regexp is a bit bizarre for backwards compat reasons (why else ...). 287 return input.split(QRegExp(QLatin1String("\n\t|\r\\\\h|\r\n"))); 288 } 289 290 static QString vcCommandSeparator() 291 { 292 // MSVC transforms the build tree into a single batch file, simply pasting the contents 293 // of the custom commands into it, and putting an "if errorlevel goto" statement behind it. 294 // As we want every sub-command to be error-checked (as is done by makefile-based 295 // backends), we insert the checks ourselves, using the undocumented jump target. 296 static QString cmdSep = 297 QLatin1String("
if errorlevel 1 goto VCReportError
"); 298 return cmdSep; 299 } 300 282 301 // VCCLCompilerTool ------------------------------------------------- 283 302 VCCLCompilerTool::VCCLCompilerTool() … … 673 692 if(third == 'd') 674 693 RuntimeLibrary = rtMultiThreadedDebug; 694 break; 695 } else if (second == 'P') { 696 if (config->CompilerVersion >= NET2005) 697 AdditionalOptions += option; 698 else 699 warn_msg(WarnLogic, "/MP option is not supported in Visual C++ < 2005, ignoring."); 675 700 break; 676 701 } … … 1424 1449 case 0x0034160: // /MAP[:filename] 1425 1450 GenerateMapFile = _True; 1426 MapFileName = option+5; 1451 if (option[4] == ':') 1452 MapFileName = option+5; 1427 1453 break; 1428 1454 case 0x164e1ef: // /MAPINFO:{EXPORTS|LINES} … … 1906 1932 XmlOutput &operator<<(XmlOutput &xml, const VCCustomBuildTool &tool) 1907 1933 { 1908 // The code below offers two ways to split custom build step commands.1909 // Normally the $$escape_expand(\n\t) is used in a project file, which is correctly translated1910 // in all generators. However, if you use $$escape_expand(\n\r) (or \n\h) instead, the VCPROJ1911 // generator will instead of binding the commands with " && " will insert a proper newline into1912 // the VCPROJ file. We sometimes use this method of splitting commands if the custom buildstep1913 // contains a command-line which is too big to run on certain OS.1914 QString cmds;1915 int end = tool.CommandLine.count();1916 for(int i = 0; i < end; ++i) {1917 QString cmdl = tool.CommandLine.at(i);1918 if (cmdl.contains("\r\t")) {1919 if (i == end - 1)1920 cmdl = cmdl.trimmed();1921 cmdl.replace("\r\t", " && ");1922 } else if (cmdl.contains("\r\n")) {1923 ;1924 } else if (cmdl.contains("\r\\h")) {1925 // The above \r\n should work, but doesn't, so we have this hack1926 cmdl.replace("\r\\h", "\r\n");1927 } else {1928 if (i < end - 1)1929 cmdl += " && ";1930 }1931 cmds += cmdl;1932 }1933 1934 return xml 1934 1935 << tag(_Tool) 1935 1936 << attrS(_Name, tool.ToolName) 1936 1937 << attrX(_AdditionalDependencies, tool.AdditionalDependencies, ";") 1937 << attrS(_CommandLine, cmds)1938 << attrS(_CommandLine, tool.CommandLine.join(vcCommandSeparator())) 1938 1939 << attrS(_Description, tool.Description) 1939 1940 << attrX(_Outputs, tool.Outputs, ";") … … 1995 1996 << attrS(_Name, tool.ToolName) 1996 1997 << attrS(_Path, tool.ToolPath) 1997 << attrS(_CommandLine, tool.CommandLine )1998 << attrS(_CommandLine, tool.CommandLine.join(vcCommandSeparator())) 1998 1999 << attrS(_Description, tool.Description) 1999 2000 << attrT(_ExcludedFromBuild, tool.ExcludedFromBuild) … … 2289 2290 CustomBuildTool.Description += " & "; 2290 2291 CustomBuildTool.Description += cmd_name; 2291 CustomBuildTool.CommandLine += cmd.trimmed().split("\n", QString::SkipEmptyParts);2292 CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed()); 2292 2293 int space = cmd.indexOf(' '); 2293 2294 QFileInfo finf(cmd.left(space)); -
trunk/qmake/generators/win32/msvc_objectmodel.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 59 59 NET2003 = 0x71, 60 60 NET2005 = 0x80, 61 NET2008 = 0x90 61 NET2008 = 0x90, 62 NET2010 = 0xa0 62 63 }; 63 64 … … 475 476 parseOption((*it).toLatin1()); 476 477 } 478 static QStringList fixCommandLine(const QString &input); 477 479 }; 478 480 … … 746 748 public: 747 749 // Variables 748 QString 750 QStringList CommandLine; 749 751 QString Description; 750 752 triState ExcludedFromBuild; … … 868 870 customBuildCheck CustomBuild; 869 871 870 bool 872 bool useCustomBuildTool; 871 873 VCCustomBuildTool CustomBuildTool; 872 874 -
trunk/qmake/generators/win32/msvc_vcproj.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 68 68 #ifdef Q_OS_WIN32 69 69 #include <qt_windows.h> 70 #include <windows/registry .h>70 #include <windows/registry_p.h> 71 71 72 72 QT_BEGIN_NAMESPACE … … 78 78 } dotNetCombo[] = { 79 79 #ifdef Q_OS_WIN64 80 {NET2010, "MSVC.NET 2010 (10.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir"}, 81 {NET2010, "MSVC.NET 2010 Express Edition (10.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir"}, 80 82 {NET2008, "MSVC.NET 2008 (9.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir"}, 81 83 {NET2008, "MSVC.NET 2008 Express Edition (9.0)", "Software\\Wow6432Node\\Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir"}, … … 85 87 {NET2002, "MSVC.NET 2002 (7.0)", "Software\\Wow6432Node\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir"}, 86 88 #else 89 {NET2010, "MSVC.NET 2010 (10.0)", "Software\\Microsoft\\VisualStudio\\10.0\\Setup\\VC\\ProductDir"}, 90 {NET2010, "MSVC.NET 2010 Express Edition (10.0)", "Software\\Microsoft\\VCExpress\\10.0\\Setup\\VC\\ProductDir"}, 87 91 {NET2008, "MSVC.NET 2008 (9.0)", "Software\\Microsoft\\VisualStudio\\9.0\\Setup\\VC\\ProductDir"}, 88 92 {NET2008, "MSVC.NET 2008 Express Edition (9.0)", "Software\\Microsoft\\VCExpress\\9.0\\Setup\\VC\\ProductDir"}, … … 116 120 int i = 0; 117 121 for(; dotNetCombo[i].version; ++i) { 118 QString path = readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey);122 QString path = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey); 119 123 if(!path.isEmpty()) { 120 124 ++installed; … … 133 137 i = installed = 0; 134 138 for(; dotNetCombo[i].version; ++i) { 135 QString productPath = readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey).toLower();139 QString productPath = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey).toLower(); 136 140 if (productPath.isEmpty()) 137 141 continue; … … 166 170 const char _slnHeader70[] = "Microsoft Visual Studio Solution File, Format Version 7.00"; 167 171 const char _slnHeader71[] = "Microsoft Visual Studio Solution File, Format Version 8.00"; 168 const char _slnHeader80[] = "Microsoft Visual Studio Solution File, Format Version 9.00"; 169 const char _slnHeader90[] = "Microsoft Visual Studio Solution File, Format Version 10.00"; 172 const char _slnHeader80[] = "Microsoft Visual Studio Solution File, Format Version 9.00" 173 "\n# Visual Studio 2005"; 174 const char _slnHeader90[] = "Microsoft Visual Studio Solution File, Format Version 10.00" 175 "\n# Visual Studio 2008"; 176 const char _slnHeader100[] = "Microsoft Visual Studio Solution File, Format Version 11.00" 177 "\n# Visual Studio 2010"; 170 178 // The following UUID _may_ change for later servicepacks... 171 179 // If so we need to search through the registry at … … 355 363 356 364 switch(which_dotnet_version()) { 365 case NET2010: 366 t << _slnHeader100; 367 break; 357 368 case NET2008: 358 369 t << _slnHeader90; … … 890 901 conf.compiler.ProgramDataBaseFileName = ".\\" ; 891 902 conf.compiler.ObjectFile = placement ; 903 conf.compiler.ExceptionHandling = ehNone; 892 904 // PCH 893 905 if (usePCH) { … … 907 919 if(project->isActiveConfig("debug")){ 908 920 // Debug version 909 conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_DEBUG"));910 921 if((projectTarget == Application) || (projectTarget == StaticLib)) 911 922 conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_MT_DBG")); … … 914 925 } else { 915 926 // Release version 916 conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_RELEASE"));917 927 conf.compiler.PreprocessorDefinitions += "QT_NO_DEBUG"; 918 928 conf.compiler.PreprocessorDefinitions += "NDEBUG"; … … 924 934 925 935 // Common for both release and debug 926 if(project->isActiveConfig("warn_off"))927 conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_WARN_OFF"));928 else if(project->isActiveConfig("warn_on"))929 conf.compiler.parseOptions(project->values("QMAKE_CXXFLAGS_WARN_ON"));930 936 if(project->isActiveConfig("windows")) 931 937 conf.compiler.PreprocessorDefinitions += project->values("MSVCPROJ_WINCONDEF"); … … 990 996 conf.linker.OutputFile += project->first("MSVCPROJ_TARGET"); 991 997 992 if(project->isActiveConfig("debug")){993 conf.linker.parseOptions(project->values("QMAKE_LFLAGS_DEBUG"));994 } else {995 conf.linker.parseOptions(project->values("QMAKE_LFLAGS_RELEASE"));996 }997 998 998 if(project->isActiveConfig("dll")){ 999 999 conf.linker.parseOptions(project->values("QMAKE_LFLAGS_QT_DLL")); 1000 1000 } 1001 1002 if(project->isActiveConfig("console")){1003 conf.linker.parseOptions(project->values("QMAKE_LFLAGS_CONSOLE"));1004 } else {1005 conf.linker.parseOptions(project->values("QMAKE_LFLAGS_WINDOWS"));1006 }1007 1008 1001 } 1009 1002 … … 1035 1028 } 1036 1029 1037 QString VcprojGenerator::fixCommandLine(DotNET version, const QString &input) const1038 {1039 QString result = input;1040 1041 if (version >= NET2005)1042 result = result.replace(QLatin1Char('\n'), QLatin1String("
"));1043 1044 return result;1045 }1046 1047 1030 void VcprojGenerator::initPostBuildEventTools() 1048 1031 { 1049 1032 VCConfiguration &conf = vcProject.Configuration; 1050 1033 if(!project->values("QMAKE_POST_LINK").isEmpty()) { 1051 QString cmdline = fixCommandLine(conf.CompilerVersion,var("QMAKE_POST_LINK"));1034 QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_POST_LINK")); 1052 1035 conf.postBuild.CommandLine = cmdline; 1053 if (conf.CompilerVersion < NET2005) 1054 cmdline = cmdline.replace("\n", "&&"); 1055 conf.postBuild.Description = cmdline; 1036 conf.postBuild.Description = cmdline.join(QLatin1String("\r\n")); 1056 1037 } 1057 1038 … … 1060 1041 !project->isEmpty("CE_SDK") && !project->isEmpty("CE_ARCH"); 1061 1042 if(useSignature) 1062 conf.postBuild.CommandLine.prepend( QLatin1String("signtool sign /F ") + signature + " \"$(TargetPath)\"\n" +1063 (!conf.postBuild.CommandLine.isEmpty() ? " && " :""));1043 conf.postBuild.CommandLine.prepend( 1044 QLatin1String("signtool sign /F ") + signature + QLatin1String(" \"$(TargetPath)\"")); 1064 1045 1065 1046 if(!project->values("MSVCPROJ_COPY_DLL").isEmpty()) { 1066 if(!conf.postBuild.CommandLine.isEmpty())1067 conf.postBuild.CommandLine += " && ";1068 1047 conf.postBuild.Description += var("MSVCPROJ_COPY_DLL_DESC"); 1069 1048 conf.postBuild.CommandLine += var("MSVCPROJ_COPY_DLL"); … … 1194 1173 VCConfiguration &conf = vcProject.Configuration; 1195 1174 if(!project->values("QMAKE_PRE_LINK").isEmpty()) { 1196 QString cmdline = fixCommandLine(conf.CompilerVersion, var("QMAKE_PRE_LINK")); 1197 conf.preLink.Description = cmdline; 1175 QStringList cmdline = VCToolBase::fixCommandLine(var("QMAKE_PRE_LINK")); 1198 1176 conf.preLink.CommandLine = cmdline; 1177 conf.preLink.Description = cmdline.join(QLatin1String("\r\n")); 1199 1178 } 1200 1179 } … … 1609 1588 ofile = ofile.replace('-', '_'); 1610 1589 } else { 1611 int hyp enfind = ofile.indexOf('-', slashfind);1612 while (hyp enfind != -1 && slashfind < hypenfind) {1613 ofile = ofile.replace(hyp enfind, 1, '_');1614 hyp enfind = ofile.indexOf('-', hypenfind + 1);1590 int hyphenfind = ofile.indexOf('-', slashfind); 1591 while (hyphenfind != -1 && slashfind < hyphenfind) { 1592 ofile = ofile.replace(hyphenfind, 1, '_'); 1593 hyphenfind = ofile.indexOf('-', hyphenfind + 1); 1615 1594 } 1616 1595 } … … 1627 1606 !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::DataPath) + "/win32-msvc2003/" + file))) && 1628 1607 !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::DataPath) + "/win32-msvc2005/" + file))) && 1629 !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::DataPath) + "/win32-msvc2008/" + file))) && 1630 !exists((ret = (QString(qgetenv("HOME")) + "/.tmake/" + file)))) 1608 !exists((ret = QString(QLibraryInfo::location(QLibraryInfo::DataPath) + "/win32-msvc2008/" + file)))) 1631 1609 return ""; 1632 1610 debug_msg(1, "Generator: MSVC.NET: Found template \'%s\'", ret.toLatin1().constData()); -
trunk/qmake/generators/win32/msvc_vcproj.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 62 62 bool writeMakefile(QTextStream &); 63 63 bool writeProjectMakefile(); 64 void writeSubDirs(QTextStream &t);65 64 66 65 QString findTemplate(QString file); … … 120 119 void initExtraCompilerOutputs(); 121 120 121 void writeSubDirs(QTextStream &t); // Called from VCXProj backend 122 QUuid getProjectUUID(const QString &filename=QString()); // Called from VCXProj backend 123 122 124 Target projectTarget; 123 125 … … 129 131 130 132 private: 131 QString fixCommandLine(DotNET version, const QString &input) const;132 QUuid getProjectUUID(const QString &filename=QString());133 133 QUuid increaseUUID(const QUuid &id); 134 134 friend class VCFilter; -
trunk/qmake/generators/win32/winmakefile.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 473 473 project->values("RES_FILE").prepend(fileInfo(resFile).fileName()); 474 474 if (!project->values("OBJECTS_DIR").isEmpty()) { 475 if(project->isActiveConfig("staticlib")) 476 project->values("RES_FILE").first().prepend(fileInfo(project->values("DESTDIR").first()).absoluteFilePath() + Option::dir_sep); 475 QString resDestDir; 476 if (project->isActiveConfig("staticlib")) 477 resDestDir = fileInfo(project->first("DESTDIR")).absoluteFilePath(); 477 478 else 478 project->values("RES_FILE").first().prepend(project->values("OBJECTS_DIR").first() + Option::dir_sep); 479 resDestDir = project->first("OBJECTS_DIR"); 480 resDestDir.append(Option::dir_sep); 481 project->values("RES_FILE").first().prepend(resDestDir); 479 482 } 480 483 project->values("RES_FILE").first() = Option::fixPathToTargetOS(project->values("RES_FILE").first(), false, false); … … 605 608 writeLibsPart(t); 606 609 607 t << "QMAKE = " << (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : 608 Option::fixPathToTargetOS(var("QMAKE_QMAKE"), false)) << endl; 610 t << "QMAKE = " << var("QMAKE_QMAKE") << endl; 609 611 t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : 610 612 Option::fixPathToTargetOS(var("QMAKE_IDC"), false)) << endl; … … 658 660 t << "DIST = " << varList("DISTFILES") << endl; 659 661 t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl; 660 // The comment is important to maintain variable compat ability with Unix662 // The comment is important to maintain variable compatibility with Unix 661 663 // Makefiles, while not interpreting a trailing-slash as a linebreak 662 664 t << "DESTDIR = " << escapeFilePath(destDir) << " #avoid trailing-slash linebreak" << endl; … … 789 791 target = project->first("TARGET"); 790 792 return QString(target + project->first("TARGET_VERSION_EXT") + ".lib"); 793 } 794 795 QString Win32MakefileGenerator::getPdbTarget() 796 { 797 return QString(project->first("TARGET") + project->first("TARGET_VERSION_EXT") + ".pdb"); 791 798 } 792 799 … … 841 848 uninst.append("-$(DEL_FILE) \"" + dst_targ + "\"" + del_suffix); 842 849 } 850 if(project->isActiveConfig("shared") && project->isActiveConfig("debug")) { 851 QString pdb_target = getPdbTarget(); 852 pdb_target.remove('"'); 853 QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target; 854 QString dst_targ = filePrefixRoot(root, fileFixify(targetdir + pdb_target, FileFixifyAbsolute)); 855 if(!ret.isEmpty()) 856 ret += "\n\t"; 857 ret += QString("-$(INSTALL_FILE)") + " \"" + src_targ + "\" \"" + dst_targ + "\""; 858 if(!uninst.isEmpty()) 859 uninst.append("\n\t"); 860 uninst.append("-$(DEL_FILE) \"" + dst_targ + "\""); 861 } 843 862 } 844 863 -
trunk/qmake/generators/win32/winmakefile.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 85 85 virtual void processFileTagsVar(); 86 86 virtual QString getLibTarget(); 87 virtual QString getPdbTarget(); 87 88 }; 88 89 -
trunk/qmake/generators/xmloutput.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 80 80 { 81 81 currentState = state; 82 } 83 84 void XmlOutput::setFormat(XMLFormat newFormat) 85 { 86 format = newFormat; 82 87 } 83 88 … … 173 178 newTagOpen(o.xo_text); 174 179 break; 180 case tTagValue: 181 addRaw(QString("\n%1<%2>").arg(currentIndent).arg(o.xo_text)); 182 addRaw(QString("%1").arg(o.xo_value)); 183 addRaw(QString("</%1>").arg(o.xo_text)); 184 break; 185 case tValueTag: 186 addRaw(QString("%1").arg(doConversion(o.xo_text))); 187 setFormat(NoNewLine); 188 closeTag(); 189 setFormat(NewLine); 190 break; 191 case tImport: 192 addRaw(QString("\n%1<Import %2=\"%3\" />").arg(currentIndent).arg(o.xo_text).arg(o.xo_value)); 193 break; 175 194 case tCloseTag: 176 195 if (o.xo_value.count()) … … 183 202 case tAttribute: 184 203 addAttribute(o.xo_text, o.xo_value); 204 break; 205 case tAttributeTag: 206 addAttributeTag(o.xo_text, o.xo_value); 185 207 break; 186 208 case tData: … … 267 289 break; 268 290 case Attribute: 269 xmlFile << " />";291 xmlFile << " />"; 270 292 tagStack.pop_back(); 271 293 currentState = Tag; … … 308 330 return; 309 331 } 310 QString outData = QString("<?xml version=\"%1\" encoding =\"%2\"?>")332 QString outData = QString("<?xml version=\"%1\" encoding=\"%2\"?>") 311 333 .arg(doConversion(version)) 312 334 .arg(doConversion(encoding)); … … 338 360 } 339 361 362 void XmlOutput::addAttributeTag(const QString &attribute, const QString &value) 363 { 364 switch(currentState) { 365 case Bare: 366 case Tag: 367 //warn_msg(WarnLogic, "<%s>: Cannot add attribute since tags not open", tagStack.last().toLatin1().constData()); 368 qDebug("<%s>: Cannot add attribute (%s) since tag's not open", 369 (tagStack.count() ? tagStack.last().toLatin1().constData() : "Root"), 370 attribute.toLatin1().constData()); 371 return; 372 case Attribute: 373 break; 374 } 375 xmlFile << " " << doConversion(attribute) << "=\"" << doConversion(value) << "\""; 376 } 377 340 378 QT_END_NAMESPACE -
trunk/qmake/generators/xmloutput.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 70 70 tDeclaration, // <?xml version="x.x" encoding="xxx"?> 71 71 tTag, // <tagname attribute1="value" 72 tTagValue, // <tagname>value</tagname> 73 tValueTag, // value</tagname> 72 74 tCloseTag, // Closes an open tag 73 75 tAttribute, // attribute2="value"> 76 tAttributeTag, // attribute on the same line as a tag 74 77 tData, // Tag data (formating done) 78 tImport, // <import "type"="path" /> 75 79 tComment, // <!-- Comment --> 76 80 tCDATA // <![CDATA[ ... ]]> … … 86 90 int indentLevel(); 87 91 void setState(XMLState state); 92 void setFormat(XMLFormat newFormat); 88 93 XMLState state(); 89 94 … … 122 127 void addRaw(const QString &rawText); 123 128 void addAttribute(const QString &attribute, const QString &value); 129 void addAttributeTag(const QString &attribute, const QString &value); 124 130 void addData(const QString &data); 125 131 … … 164 170 } 165 171 172 173 inline XmlOutput::xml_output valueTag(const QString &value) 174 { 175 return XmlOutput::xml_output(XmlOutput::tValueTag, value, QString()); 176 } 177 178 inline XmlOutput::xml_output tagValue(const QString &tagName, const QString &value) 179 { 180 return XmlOutput::xml_output(XmlOutput::tTagValue, tagName, value); 181 } 182 183 inline XmlOutput::xml_output import(const QString &tagName, const QString &value) 184 { 185 return XmlOutput::xml_output(XmlOutput::tImport, tagName, value); 186 } 187 166 188 inline XmlOutput::xml_output closetag() 167 189 { … … 185 207 } 186 208 209 inline XmlOutput::xml_output attributeTag(const QString &name, 210 const QString &value) 211 { 212 return XmlOutput::xml_output(XmlOutput::tAttributeTag, name, value); 213 } 214 187 215 inline XmlOutput::xml_output attr(const QString &name, 188 216 const QString &value) … … 191 219 } 192 220 221 inline XmlOutput::xml_output attrTag(const QString &name, 222 const QString &value) 223 { 224 return attributeTag(name, value); 225 } 226 193 227 inline XmlOutput::xml_output data(const QString &text = QString()) 194 228 { -
trunk/qmake/main.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 154 154 debug_msg(1, "Resetting dir to: %s", oldpwd.toLatin1().constData()); 155 155 qmake_setpwd(oldpwd); //reset the old pwd 156 int di = fn.lastIndexOf( Option::dir_sep);156 int di = fn.lastIndexOf(QDir::separator()); 157 157 if(di != -1) { 158 158 debug_msg(1, "Changing dir to: %s", fn.left(di).toLatin1().constData()); -
trunk/qmake/meta.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/meta.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/option.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 85 85 //all modes 86 86 QString Option::qmake_abslocation; 87 int Option::warn_level = WarnLogic ;87 int Option::warn_level = WarnLogic | WarnDeprecated; 88 88 int Option::debug_level = 0; 89 89 QFile Option::output; 90 90 QString Option::output_dir; 91 bool Option::recursive = false;91 Option::QMAKE_RECURSIVE Option::recursive = Option::QMAKE_RECURSIVE_DEFAULT; 92 92 QStringList Option::before_user_vars; 93 93 QStringList Option::after_user_vars; … … 97 97 QString Option::user_template_prefix; 98 98 QStringList Option::shellPath; 99 #if defined(Q_OS_WIN32) 100 Option::TARG_MODE Option::target_mode = Option::TARG_WIN_MODE; 101 #elif defined(Q_OS_OS2) 102 Option::TARG_MODE Option::target_mode = Option::TARG_OS2_MODE; 103 #elif defined(Q_OS_MAC) 104 Option::TARG_MODE Option::target_mode = Option::TARG_MACX_MODE; 105 #else 106 Option::TARG_MODE Option::target_mode = Option::TARG_UNIX_MODE; 107 #endif 99 Option::HOST_MODE Option::host_mode = Option::HOST_UNKNOWN_MODE; 100 Option::TARG_MODE Option::target_mode = Option::TARG_UNKNOWN_MODE; 101 bool Option::target_mode_overridden = false; 108 102 109 103 //QMAKE_*_PROPERTY stuff … … 129 123 static Option::QMAKE_MODE default_mode(QString progname) 130 124 { 131 int s = progname.lastIndexOf( Option::dir_sep);125 int s = progname.lastIndexOf(QDir::separator()); 132 126 if(s != -1) 133 127 progname = progname.right(progname.length() - (s + 1)); … … 137 131 return Option::QMAKE_QUERY_PROPERTY; 138 132 return Option::QMAKE_GENERATE_MAKEFILE; 133 } 134 135 static QString detectProjectFile(const QString &path) 136 { 137 QString ret; 138 QDir dir(path); 139 if(dir.exists(dir.dirName() + Option::pro_ext)) { 140 ret = dir.filePath(dir.dirName()) + Option::pro_ext; 141 } else { //last try.. 142 QStringList profiles = dir.entryList(QStringList("*" + Option::pro_ext)); 143 if(profiles.count() == 1) 144 ret = dir.filePath(profiles.at(0)); 145 } 146 return ret; 139 147 } 140 148 … … 163 171 "\n" 164 172 "Warnings Options:\n" 165 " -Wnone Turn off all warnings\n" 173 " -Wnone Turn off all warnings; specific ones may be re-enabled by\n" 174 " later -W options\n" 166 175 " -Wall Turn on all warnings\n" 167 176 " -Wparser Turn on parser warnings\n" 168 " -Wlogic Turn on logic warnings\n" 177 " -Wlogic Turn on logic warnings (on by default)\n" 178 " -Wdeprecated Turn on deprecation warnings (on by default)\n" 169 179 "\n" 170 180 "Options:\n" … … 173 183 " * before [files]. *\n" 174 184 " -o file Write output to file\n" 175 " -unix Run in unix mode\n"176 " -win32 Run in win32 mode\n"177 " -os2 Run in OS/2 mode\n"178 " -macx Run in Mac OS X mode\n"179 185 " -d Increase debug level\n" 180 186 " -t templ Overrides TEMPLATE as templ\n" … … 213 219 bool specified = true; 214 220 if(opt == "project") { 215 Option::recursive = true;221 Option::recursive = Option::QMAKE_RECURSIVE_YES; 216 222 Option::qmake_mode = Option::QMAKE_GENERATE_PROJECT; 217 223 } else if(opt == "prl") { … … 240 246 } else if(opt == "tp" || opt == "template_prefix") { 241 247 Option::user_template_prefix = argv[++x]; 242 } else if(opt == "mac9") {243 Option::target_mode = TARG_MAC9_MODE;244 248 } else if(opt == "macx") { 249 fprintf(stderr, "-macx is deprecated.\n"); 250 Option::host_mode = HOST_MACX_MODE; 245 251 Option::target_mode = TARG_MACX_MODE; 252 Option::target_mode_overridden = true; 246 253 } else if(opt == "unix") { 254 fprintf(stderr, "-unix is deprecated.\n"); 255 Option::host_mode = HOST_UNIX_MODE; 247 256 Option::target_mode = TARG_UNIX_MODE; 257 Option::target_mode_overridden = true; 248 258 } else if(opt == "win32") { 259 fprintf(stderr, "-win32 is deprecated.\n"); 260 Option::host_mode = HOST_WIN_MODE; 249 261 Option::target_mode = TARG_WIN_MODE; 262 Option::target_mode_overridden = true; 250 263 } else if(opt == "os2") { 264 fprintf(stderr, "-os2 is deprecated.\n"); 265 Option::host_mode = TARG_OS2_MODE; 251 266 Option::target_mode = TARG_OS2_MODE; 267 Option::target_mode_overridden = true; 252 268 } else if(opt == "d") { 253 269 Option::debug_level++; … … 270 286 } else if(opt == "Wlogic") { 271 287 Option::warn_level |= WarnLogic; 288 } else if(opt == "Wdeprecated") { 289 Option::warn_level |= WarnDeprecated; 272 290 } else if(opt == "Wnone") { 273 291 Option::warn_level = WarnNone; 274 292 } else if(opt == "r" || opt == "recursive") { 275 Option::recursive = true;276 } else if(opt == "n orecursive") {277 Option::recursive = false;293 Option::recursive = Option::QMAKE_RECURSIVE_YES; 294 } else if(opt == "nr" || opt == "norecursive") { 295 Option::recursive = Option::QMAKE_RECURSIVE_NO; 278 296 } else if(opt == "config") { 279 297 Option::user_configs += argv[++x]; … … 292 310 Option::mkfile::do_dep_heuristics = false; 293 311 } else if(opt == "E") { 312 fprintf(stderr, "-E is deprecated. Use -d instead.\n"); 294 313 Option::mkfile::do_preprocess = true; 295 314 } else if(opt == "cache") { … … 328 347 arg = fi.filePath(); 329 348 if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE || 330 Option::qmake_mode == Option::QMAKE_GENERATE_PRL) 349 Option::qmake_mode == Option::QMAKE_GENERATE_PRL) { 350 if(fi.isDir()) { 351 QString proj = detectProjectFile(arg); 352 if (!proj.isNull()) 353 arg = proj; 354 } 331 355 Option::mkfile::project_files.append(arg); 332 else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT)356 } else if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) { 333 357 Option::projfile::project_dirs.append(arg); 334 else358 } else { 335 359 handled = false; 360 } 336 361 } 337 362 if(!handled) { … … 401 426 Option::dirlist_sep = ";"; 402 427 Option::shellPath = detectShellPath(); 428 Option::res_ext = ".res"; 403 429 #else 404 430 Option::dirlist_sep = ":"; 431 Option::shellPath = QStringList("sh"); 405 432 #endif 406 433 Option::sysenv_mod = "QMAKE_ENV_"; … … 508 535 //try REALLY hard to do it for them, lazy.. 509 536 if(Option::mkfile::project_files.isEmpty()) { 510 QString pwd = qmake_getpwd(), 511 proj = pwd + "/" + pwd.right(pwd.length() - (pwd.lastIndexOf('/') + 1)) + Option::pro_ext; 512 if(QFile::exists(proj)) { 537 QString proj = detectProjectFile(qmake_getpwd()); 538 if(!proj.isNull()) 513 539 Option::mkfile::project_files.append(proj); 514 } else { //last try..515 QStringList profiles = QDir(pwd).entryList(QStringList("*" + Option::pro_ext));516 if(profiles.count() == 1)517 Option::mkfile::project_files.append(pwd + "/" + profiles[0]);518 }519 540 #ifndef QT_BUILD_QMAKE_LIBRARY 520 541 if(Option::mkfile::project_files.isEmpty()) { … … 524 545 #endif 525 546 } 547 } else if (Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) { 548 #if defined(Q_OS_MAC) 549 Option::host_mode = Option::HOST_MACX_MODE; 550 Option::target_mode = Option::TARG_MACX_MODE; 551 #elif defined(Q_OS_UNIX) 552 Option::host_mode = Option::HOST_UNIX_MODE; 553 Option::target_mode = Option::TARG_UNIX_MODE; 554 #elif defined(Q_OS_OS2) 555 Option::host_mode = Option::HOST_OS2_MODE; 556 Option::target_mode = Option::TARG_OS2_MODE; 557 #else 558 Option::host_mode = Option::HOST_WIN_MODE; 559 Option::target_mode = Option::TARG_WIN_MODE; 560 #endif 526 561 } 527 562 528 563 //defaults for globals 529 if(Option::target_mode == Option::TARG_WIN_MODE || 530 Option::target_mode == Option::TARG_OS2_MODE) { 531 Option::dir_sep = "\\"; 532 Option::obj_ext = ".obj"; 533 Option::res_ext = ".res"; 534 } else { 535 if(Option::target_mode == Option::TARG_MAC9_MODE) 536 Option::dir_sep = ":"; 537 else 538 Option::dir_sep = "/"; 539 Option::obj_ext = ".o"; 540 } 541 Option::qmake_abslocation = Option::fixPathToTargetOS(Option::qmake_abslocation); 564 if (Option::host_mode != Option::HOST_UNKNOWN_MODE) 565 applyHostMode(); 542 566 return QMAKE_CMDLINE_SUCCESS; 567 } 568 569 void Option::applyHostMode() 570 { 571 if (Option::host_mode == Option::HOST_WIN_MODE || 572 Option::host_mode == Option::HOST_OS2_MODE) { 573 Option::dir_sep = "\\"; 574 Option::obj_ext = ".obj"; 575 } else { 576 Option::dir_sep = "/"; 577 Option::obj_ext = ".o"; 578 } 543 579 } 544 580 … … 599 635 Option::fixString(QString string, uchar flags) 600 636 { 601 const QString orig_string = string;637 //const QString orig_string = string; 602 638 static QHash<FixStringCacheKey, QString> *cache = 0; 603 639 if(!cache) { -
trunk/qmake/option.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 64 64 WarnParser = 0x01, 65 65 WarnLogic = 0x02, 66 WarnDeprecated = 0x04, 66 67 WarnAll = 0xFF 67 68 }; … … 107 108 //both of these must be called.. 108 109 static int init(int argc=0, char **argv=0); //parse cmdline 110 static void applyHostMode(); 109 111 static bool postProcessProject(QMakeProject *); 110 112 … … 149 151 static int debug_level; 150 152 static int warn_level; 151 static bool recursive; 153 enum QMAKE_RECURSIVE { QMAKE_RECURSIVE_DEFAULT, QMAKE_RECURSIVE_YES, QMAKE_RECURSIVE_NO }; 154 static QMAKE_RECURSIVE recursive; 152 155 static QStringList before_user_vars, after_user_vars, user_configs, after_user_configs; 153 enum TARG_MODE { TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE, TARG_MAC9_MODE, TARG_OS2_MODE }; 156 enum HOST_MODE { HOST_UNKNOWN_MODE, HOST_UNIX_MODE, HOST_WIN_MODE, HOST_MACX_MODE, 157 HOST_OS2_MODE }; 158 static HOST_MODE host_mode; 159 enum TARG_MODE { TARG_UNKNOWN_MODE, TARG_UNIX_MODE, TARG_WIN_MODE, TARG_MACX_MODE, 160 TARG_SYMBIAN_MODE, TARG_OS2_MODE }; 154 161 static TARG_MODE target_mode; 162 static bool target_mode_overridden; 155 163 static QString user_template, user_template_prefix; 156 164 static QStringList shellPath; … … 206 214 SettingsPath, 207 215 DemosPath, 208 ExamplesPath 216 ExamplesPath, 217 ImportsPath 209 218 }; 210 219 static QString location(LibraryLocation); -
trunk/qmake/project.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 44 44 #include "option.h" 45 45 #include "cachekeys.h" 46 #include "generators/metamakefile.h" 46 47 47 48 #include <qdatetime.h> … … 66 67 67 68 // Included from tools/shared 68 #include <symbian/epocroot .h>69 #include <symbian/epocroot_p.h> 69 70 70 71 #ifdef Q_OS_WIN32 … … 78 79 QT_BEGIN_NAMESPACE 79 80 80 //expand fu cntions81 //expand functions 81 82 enum ExpandFunc { E_MEMBER=1, E_FIRST, E_LAST, E_CAT, E_FROMFILE, E_EVAL, E_LIST, 82 83 E_SPRINTF, E_JOIN, E_SPLIT, E_BASENAME, E_DIRNAME, E_SECTION, … … 124 125 T_RETURN, T_BREAK, T_NEXT, T_DEFINED, T_CONTAINS, T_INFILE, 125 126 T_COUNT, T_ISEMPTY, T_INCLUDE, T_LOAD, T_DEBUG, T_ERROR, 126 T_MESSAGE, T_WARNING, T_IF };127 T_MESSAGE, T_WARNING, T_IF, T_OPTION }; 127 128 QMap<QString, TestFunc> qmake_testFunctions() 128 129 { … … 158 159 qmake_test_functions->insert("message", T_MESSAGE); 159 160 qmake_test_functions->insert("warning", T_WARNING); 161 qmake_test_functions->insert("option", T_OPTION); 160 162 } 161 163 return *qmake_test_functions; … … 187 189 { 188 190 QString ret(x); 189 if(ret.startsWith("TMAKE")) //tmake no more! 190 ret = "QMAKE" + ret.mid(5); 191 else if(ret == "INTERFACES") 191 if(ret == "INTERFACES") 192 192 ret = "FORMS"; 193 193 else if(ret == "QMAKE_POST_BUILD") … … 223 223 else if(ret == "QMAKE_FRAMEWORKDIR_FLAGS") 224 224 ret = "QMAKE_FRAMEWORKPATH_FLAGS"; 225 else 226 return ret; 227 warn_msg(WarnDeprecated, "%s:%d: Variable %s is deprecated; use %s instead.", 228 parser.file.toLatin1().constData(), parser.line_no, 229 x.toLatin1().constData(), ret.toLatin1().constData()); 225 230 return ret; 226 231 } … … 281 286 } 282 287 283 static QStringList split_value_list(const QString &vals , bool do_semicolon=false)288 static QStringList split_value_list(const QString &vals) 284 289 { 285 290 QString build; … … 292 297 const ushort DOUBLEQUOTE = '"'; 293 298 const ushort BACKSLASH = '\\'; 294 const ushort SEMICOLON = ';';295 299 296 300 ushort unicode; … … 312 316 } 313 317 314 if(!parens && quote.isEmpty() && ((do_semicolon && unicode == SEMICOLON) || 315 vals_data[x] == Option::field_sep)) { 318 if(!parens && quote.isEmpty() && (vals_data[x] == Option::field_sep)) { 316 319 ret << build; 317 320 build.clear(); … … 512 515 } 513 516 514 enum isForSymbian_enum {515 isForSymbian_NOT_SET = -1,516 isForSymbian_FALSE = 0,517 isForSymbian_ABLD = 1,518 isForSymbian_SBSV2 = 2,519 };520 521 static isForSymbian_enum isForSymbian_value = isForSymbian_NOT_SET;522 523 // Checking for symbian build is primarily determined from the qmake spec,524 // but if that is not specified, detect if symbian is the default spec525 // by checking the MAKEFILE_GENERATOR variable value.526 static void init_symbian(const QMap<QString, QStringList>& vars)527 {528 if (isForSymbian_value != isForSymbian_NOT_SET)529 return;530 531 QString spec = QFileInfo(Option::mkfile::qmakespec).fileName();532 if (spec.startsWith("symbian-abld", Qt::CaseInsensitive)) {533 isForSymbian_value = isForSymbian_ABLD;534 } else if (spec.startsWith("symbian-sbsv2", Qt::CaseInsensitive)) {535 isForSymbian_value = isForSymbian_SBSV2;536 } else {537 QStringList generatorList = vars["MAKEFILE_GENERATOR"];538 539 if (!generatorList.isEmpty()) {540 QString generator = generatorList.first();541 if (generator.startsWith("SYMBIAN_ABLD"))542 isForSymbian_value = isForSymbian_ABLD;543 else if (generator.startsWith("SYMBIAN_SBSV2"))544 isForSymbian_value = isForSymbian_SBSV2;545 else546 isForSymbian_value = isForSymbian_FALSE;547 } else {548 isForSymbian_value = isForSymbian_FALSE;549 }550 }551 552 // Force recursive on Symbian, as non-recursive is not really a viable option there553 if (isForSymbian_value != isForSymbian_FALSE)554 Option::recursive = true;555 }556 557 bool isForSymbian()558 {559 // If isForSymbian_value has not been initialized explicitly yet,560 // call initializer with dummy map to check qmake spec.561 if (isForSymbian_value == isForSymbian_NOT_SET)562 init_symbian(QMap<QString, QStringList>());563 564 return (isForSymbian_value != isForSymbian_FALSE);565 }566 567 bool isForSymbianSbsv2()568 {569 // If isForSymbian_value has not been initialized explicitly yet,570 // call initializer with dummy map to check qmake spec.571 if (isForSymbian_value == isForSymbian_NOT_SET)572 init_symbian(QMap<QString, QStringList>());573 574 return (isForSymbian_value == isForSymbian_SBSV2);575 }576 577 517 /* 578 518 1) environment variable QMAKEFEATURES (as separated by colons) … … 600 540 concat << base_concat + QDir::separator() + "unix"; 601 541 break; 542 default: // Can't happen, just make the compiler shut up 602 543 case Option::TARG_UNIX_MODE: 603 { 604 if (isForSymbian()) 605 concat << base_concat + QDir::separator() + "symbian"; 606 else 607 concat << base_concat + QDir::separator() + "unix"; 608 break; 609 } 544 concat << base_concat + QDir::separator() + "unix"; 545 break; 610 546 case Option::TARG_WIN_MODE: 611 { 612 if (isForSymbian()) 613 concat << base_concat + QDir::separator() + "symbian"; 614 else 615 concat << base_concat + QDir::separator() + "win32"; 616 break; 617 } 547 concat << base_concat + QDir::separator() + "win32"; 548 break; 549 case Option::TARG_SYMBIAN_MODE: 550 concat << base_concat + QDir::separator() + "symbian"; 551 break; 618 552 case Option::TARG_OS2_MODE: 619 553 concat << base_concat + QDir::separator() + "os2"; 620 break;621 case Option::TARG_MAC9_MODE:622 concat << base_concat + QDir::separator() + "mac";623 concat << base_concat + QDir::separator() + "mac9";624 554 break; 625 555 } … … 635 565 if(!Option::mkfile::cachefile.isEmpty()) { 636 566 QString path; 637 int last_slash = Option::mkfile::cachefile.lastIndexOf( Option::dir_sep);567 int last_slash = Option::mkfile::cachefile.lastIndexOf(QDir::separator()); 638 568 if(last_slash != -1) 639 path = Option::fixPathToLocalOS(Option::mkfile::cachefile.left(last_slash) );569 path = Option::fixPathToLocalOS(Option::mkfile::cachefile.left(last_slash), false); 640 570 for(QStringList::Iterator concat_it = concat.begin(); 641 571 concat_it != concat.end(); ++concat_it) … … 693 623 } 694 624 695 class QMakeProjectEnv696 {697 QStringList envs;698 public:699 QMakeProjectEnv() { }700 QMakeProjectEnv(QMakeProject *p) { execute(p->variables()); }701 QMakeProjectEnv(const QMap<QString, QStringList> &values) { execute(values); }702 703 void execute(QMakeProject *p) { execute(p->variables()); }704 void execute(const QMap<QString, QStringList> &values) {705 #ifdef Q_OS_UNIX706 for(QMap<QString, QStringList>::ConstIterator it = values.begin(); it != values.end(); ++it) {707 const QString var = it.key(), val = it.value().join(" ");708 if(!var.startsWith(".")) {709 const QString env_var = Option::sysenv_mod + var;710 if(!putenv(strdup(QString(env_var + "=" + val).toAscii().data())))711 envs.append(env_var);712 }713 }714 #else715 Q_UNUSED(values);716 #endif717 }718 ~QMakeProjectEnv() {719 #ifdef Q_OS_UNIX720 for(QStringList::ConstIterator it = envs.begin();it != envs.end(); ++it) {721 putenv(strdup(QString(*it + "=").toAscii().data()));722 }723 #endif724 }725 };726 727 625 QMakeProject::~QMakeProject() 728 626 { … … 754 652 own_prop = false; 755 653 } 654 recursive = false; 756 655 reset(); 757 656 } … … 778 677 iterator = 0; 779 678 function = 0; 679 backslashWarned = false; 780 680 } 781 681 … … 783 683 QMakeProject::parse(const QString &t, QMap<QString, QStringList> &place, int numLines) 784 684 { 785 QString s = t.simplified(); 685 // To preserve the integrity of any UTF-8 characters in .pro file, temporarily replace the 686 // non-breaking space (0xA0) characters with another non-space character, so that 687 // QString::simplified() call will not replace it with space. 688 // Note: There won't be any two byte characters in .pro files, so 0x10A0 should be a safe 689 // replacement character. 690 static QChar nbsp(0xA0); 691 static QChar nbspFix(0x01A0); 692 QString s; 693 if (t.indexOf(nbsp) != -1) { 694 s = t; 695 s.replace(nbsp, nbspFix); 696 s = s.simplified(); 697 s.replace(nbspFix, nbsp); 698 } else { 699 s = t.simplified(); 700 } 701 786 702 int hash_mark = s.indexOf("#"); 787 703 if(hash_mark != -1) //good bye comments … … 1153 1069 QString vals = s.mid(d_off); // vals now contains the space separated list of values 1154 1070 int rbraces = vals.count('}'), lbraces = vals.count('{'); 1155 if(scope_blocks.count() > 1 && rbraces - lbraces == 1 ) {1071 if(scope_blocks.count() > 1 && rbraces - lbraces == 1 && vals.endsWith('}')) { 1156 1072 debug_msg(1, "Project Parser: %s:%d : Leaving block %d", parser.file.toLatin1().constData(), 1157 1073 parser.line_no, scope_blocks.count()); … … 1169 1085 1170 1086 doVariableReplace(var, place); 1171 var = varMap(var); //backwards compat ability1087 var = varMap(var); //backwards compatibility 1172 1088 if(!var.isEmpty() && Option::mkfile::do_preprocess) { 1173 1089 static QString last_file("*none*"); … … 1180 1096 1181 1097 if(vals.contains('=') && numLines > 1) 1182 warn_msg(WarnParser, " Detected possible line continuation: {%s}%s:%d",1098 warn_msg(WarnParser, "Possible accidental line continuation: {%s} at %s:%d", 1183 1099 var.toLatin1().constData(), parser.file.toLatin1().constData(), parser.line_no); 1184 1100 … … 1233 1149 { 1234 1150 //doVariableReplace(vals, place); 1235 QStringList tmp = split_value_list(vals , (var == "DEPENDPATH" || var == "INCLUDEPATH"));1151 QStringList tmp = split_value_list(vals); 1236 1152 for(int i = 0; i < tmp.size(); ++i) 1237 1153 vallist += doVariableReplaceExpand(tmp[i], place); … … 1323 1239 1324 1240 const QString oldpwd = qmake_getpwd(); 1325 QString filename = Option::fixPathToLocalOS(file); 1326 doVariableReplace(filename, place); 1241 QString filename = Option::fixPathToLocalOS(file, false); 1327 1242 bool ret = false, using_stdin = false; 1328 1243 QFile qfile; … … 1368 1283 { 1369 1284 if(cfile.isEmpty()) { 1370 //find out where qmake (myself) lives1371 if (!base_vars.contains("QMAKE_QMAKE")) {1372 if (!Option::qmake_abslocation.isNull())1373 base_vars["QMAKE_QMAKE"] = QStringList(Option::qmake_abslocation);1374 else1375 base_vars["QMAKE_QMAKE"] = QStringList("qmake");1376 }1377 1378 1285 // hack to get the Option stuff in there 1379 base_vars["QMAKE_EXT_OBJ"] = QStringList(Option::obj_ext);1380 1286 base_vars["QMAKE_EXT_CPP"] = Option::cpp_ext; 1381 1287 base_vars["QMAKE_EXT_C"] = Option::c_ext; … … 1463 1369 qmakespec.truncate(qmakespec.length()-1); 1464 1370 QString spec = qmakespec + QDir::separator() + "qmake.conf"; 1465 if(!QFile::exists(spec) &&1466 QFile::exists(qmakespec + QDir::separator() + "tmake.conf"))1467 spec = qmakespec + QDir::separator() + "tmake.conf";1468 1371 debug_msg(1, "QMAKESPEC conf: reading %s", spec.toLatin1().constData()); 1469 1372 if(!read(spec, base_vars)) { … … 1471 1374 return false; 1472 1375 } 1473 1474 init_symbian(base_vars); 1376 validateModes(); 1475 1377 1476 1378 if(Option::mkfile::do_cache && !Option::mkfile::cachefile.isEmpty()) { … … 1524 1426 if(!read(pfile, vars)) 1525 1427 return false; 1526 }1527 1528 if(cmd & ReadPostFiles) { // parse post files1529 const QStringList l = vars["QMAKE_POST_INCLUDE_FILES"];1530 for(QStringList::ConstIterator it = l.begin(); it != l.end(); ++it) {1531 if(read((*it), vars)) {1532 if(vars["QMAKE_INTERNAL_INCLUDED_FILES"].indexOf((*it)) == -1)1533 vars["QMAKE_INTERNAL_INCLUDED_FILES"].append((*it));1534 }1535 }1536 1428 } 1537 1429 … … 1596 1488 } 1597 1489 1490 void QMakeProject::validateModes() 1491 { 1492 if (Option::host_mode == Option::HOST_UNKNOWN_MODE 1493 || Option::target_mode == Option::TARG_UNKNOWN_MODE) { 1494 Option::HOST_MODE host_mode; 1495 Option::TARG_MODE target_mode; 1496 const QStringList &gen = base_vars.value("MAKEFILE_GENERATOR"); 1497 if (gen.isEmpty()) { 1498 fprintf(stderr, "%s:%d: Using OS scope before setting MAKEFILE_GENERATOR\n", 1499 parser.file.toLatin1().constData(), parser.line_no); 1500 } else if (MetaMakefileGenerator::modesForGenerator(gen.first(), 1501 &host_mode, &target_mode)) { 1502 if (Option::host_mode == Option::HOST_UNKNOWN_MODE) { 1503 Option::host_mode = host_mode; 1504 Option::applyHostMode(); 1505 } 1506 1507 if (Option::target_mode == Option::TARG_UNKNOWN_MODE) { 1508 const QStringList &tgt = base_vars.value("TARGET_PLATFORM"); 1509 if (!tgt.isEmpty()) { 1510 const QString &os = tgt.first(); 1511 if (os == "unix") 1512 Option::target_mode = Option::TARG_UNIX_MODE; 1513 else if (os == "macx") 1514 Option::target_mode = Option::TARG_MACX_MODE; 1515 else if (os == "symbian") 1516 Option::target_mode = Option::TARG_SYMBIAN_MODE; 1517 else if (os == "win32") 1518 Option::target_mode = Option::TARG_WIN_MODE; 1519 else 1520 fprintf(stderr, "Unknown target platform specified: %s\n", 1521 os.toLatin1().constData()); 1522 } else { 1523 Option::target_mode = target_mode; 1524 } 1525 } 1526 } 1527 } 1528 } 1529 1598 1530 bool 1599 1531 QMakeProject::isActiveConfig(const QString &x, bool regex, QMap<QString, QStringList> *place) … … 1608 1540 return false; 1609 1541 1542 if (x == "unix") { 1543 validateModes(); 1544 return Option::target_mode == Option::TARG_UNIX_MODE 1545 || Option::target_mode == Option::TARG_MACX_MODE 1546 || Option::target_mode == Option::TARG_SYMBIAN_MODE; 1547 } else if (x == "macx" || x == "mac") { 1548 validateModes(); 1549 return Option::target_mode == Option::TARG_MACX_MODE; 1550 } else if (x == "symbian") { 1551 validateModes(); 1552 return Option::target_mode == Option::TARG_SYMBIAN_MODE; 1553 } else if (x == "win32") { 1554 validateModes(); 1555 return Option::target_mode == Option::TARG_WIN_MODE; 1556 } 1557 1558 //mkspecs 1610 1559 static QString spec; 1611 1560 if(spec.isEmpty()) 1612 1561 spec = QFileInfo(Option::mkfile::qmakespec).fileName(); 1613 1614 // Symbian is an exception to how scopes are resolved. Since we do not1615 // have a separate target mode for Symbian, but we expect the scope to resolve1616 // on other platforms we base it entirely on the mkspec. This means that1617 // using a mkspec starting with 'symbian*' will resolve both the 'symbian'1618 // and the 'unix' (because of Open C) scopes to true.1619 if(isForSymbian() && (x == "symbian" || x == "unix"))1620 return true;1621 1622 //mkspecs1623 if((Option::target_mode == Option::TARG_MACX_MODE ||1624 Option::target_mode == Option::TARG_UNIX_MODE) && x == "unix")1625 return !isForSymbian();1626 else if(Option::target_mode == Option::TARG_MACX_MODE && x == "macx")1627 return !isForSymbian();1628 else if(Option::target_mode == Option::TARG_MAC9_MODE && x == "mac9")1629 return !isForSymbian();1630 else if((Option::target_mode == Option::TARG_MAC9_MODE || Option::target_mode == Option::TARG_MACX_MODE) &&1631 x == "mac")1632 return !isForSymbian();1633 else if(Option::target_mode == Option::TARG_WIN_MODE && x == "win32")1634 return !isForSymbian();1635 1562 else if(Option::target_mode == Option::TARG_OS2_MODE && x == "os2") 1636 1563 return true; … … 1723 1650 static QStringList *feature_roots = 0; 1724 1651 if(!feature_roots) { 1725 init_symbian(base_vars);1652 validateModes(); 1726 1653 feature_roots = new QStringList(qmake_feature_paths(prop)); 1727 1654 qmakeAddCacheClear(qmakeDeleteCacheClear_QStringList, (void**)&feature_roots); … … 1804 1731 return IncludeFailure; 1805 1732 } 1806 file = file.right(file.length() - di - 1);1807 1733 } 1808 1734 bool parsed = false; … … 1824 1750 proj.doProjectInclude("default", IncludeFlagFeature, proj.variables()); 1825 1751 #endif 1826 parsed = proj.read(file, proj.variables()); 1752 parsed = proj.read(file, proj.variables()); // parse just that file (fromfile, infile) 1827 1753 } else { 1828 parsed = proj.read(file); 1754 parsed = proj.read(file); // parse all aux files (load/include into) 1829 1755 } 1830 1756 place = proj.variables(); … … 1894 1820 args += args_list[i].join(QString(Option::field_sep)); 1895 1821 1896 ExpandFunc func_t = qmake_expandFunctions().value(func.toLower()); 1822 ExpandFunc func_t = qmake_expandFunctions().value(func); 1823 if (!func_t && (func_t = qmake_expandFunctions().value(func.toLower()))) 1824 warn_msg(WarnDeprecated, "%s:%d: Using uppercased builtin functions is deprecated.", 1825 parser.file.toLatin1().constData(), parser.line_no); 1897 1826 debug_msg(1, "Running project expand: %s(%s) [%d]", 1898 1827 func.toLatin1().constData(), args.join("::").toLatin1().constData(), func_t); … … 2148 2077 parser.file.toLatin1().constData(), parser.line_no); 2149 2078 } else { 2150 QMakeProjectEnv env(place);2151 2079 char buff[256]; 2152 2080 bool singleLine = true; … … 2252 2180 for(int d = 0; d < dirs.count(); d++) { 2253 2181 QString dir = dirs[d]; 2254 if(!dir.isEmpty() && !dir.endsWith( Option::dir_sep))2182 if(!dir.isEmpty() && !dir.endsWith(QDir::separator())) 2255 2183 dir += "/"; 2256 2184 … … 2274 2202 fprintf(stderr, "%s:%d prompt(question) requires one argument.\n", 2275 2203 parser.file.toLatin1().constData(), parser.line_no); 2276 } else if(p rojectFile()== "-") {2204 } else if(pfile == "-") { 2277 2205 fprintf(stderr, "%s:%d prompt(question) cannot be used when '-o -' is used.\n", 2278 2206 parser.file.toLatin1().constData(), parser.line_no); … … 2308 2236 parser.file.toLatin1().constData(), parser.line_no); 2309 2237 } else { 2310 //QString target = args[0]; 2311 int size = values(args[0]).size(); 2238 int size = values(args[0], place).size(); 2312 2239 ret += QString::number(size); 2313 2240 } … … 2437 2364 test += *(d+d_off); 2438 2365 if(!test.isEmpty()) { 2439 const bool success = doProjectTest(test, place); 2440 test = ""; 2441 if(or_op) 2442 ret = ret || success; 2443 else 2444 ret = ret && success; 2366 if (or_op != ret) 2367 ret = doProjectTest(test, place); 2368 test.clear(); 2445 2369 } 2446 2370 if(*(d+d_off) == QLatin1Char(':')) { … … 2474 2398 //regular expression I guess 2475 2399 QString dirstr = qmake_getpwd(); 2476 int slsh = file.lastIndexOf( Option::dir_sep);2400 int slsh = file.lastIndexOf(QDir::separator()); 2477 2401 if(slsh != -1) { 2478 2402 dirstr = file.left(slsh+1); … … 2545 2469 } 2546 2470 return false; } 2547 case T_SYSTEM: { 2548 bool setup_env = true; 2471 case T_SYSTEM: 2549 2472 if(args.count() < 1 || args.count() > 2) { 2550 2473 fprintf(stderr, "%s:%d: system(exec) requires one argument.\n", parser.file.toLatin1().constData(), … … 2554 2477 if(args.count() == 2) { 2555 2478 const QString sarg = args[1]; 2556 setup_env = (sarg.toLower() == "true" || sarg.toInt()); 2557 } 2558 QMakeProjectEnv env; 2559 if(setup_env) 2560 env.execute(place); 2561 bool ret = system(args[0].toLatin1().constData()) == 0; 2562 return ret; } 2479 if (sarg.toLower() == "true" || sarg.toInt()) 2480 warn_msg(WarnParser, "%s:%d: system()'s second argument is now hard-wired to false.\n", 2481 parser.file.toLatin1().constData(), parser.line_no); 2482 } 2483 return system(args[0].toLatin1().constData()) == 0; 2563 2484 case T_RETURN: 2564 2485 if(function_blocks.isEmpty()) { … … 2575 2496 if(iterator) 2576 2497 iterator->cause_break = true; 2577 else if(!scope_blocks.isEmpty())2578 scope_blocks.top().ignore = true;2579 2498 else 2580 2499 fprintf(stderr, "%s:%d unexpected break()\n", … … 2791 2710 #endif 2792 2711 return true; } 2712 case T_OPTION: 2713 if (args.count() != 1) { 2714 fprintf(stderr, "%s:%d: option() requires one argument.\n", 2715 parser.file.toLatin1().constData(), parser.line_no); 2716 return false; 2717 } 2718 if (args.first() == "recursive") { 2719 recursive = true; 2720 } else { 2721 fprintf(stderr, "%s:%d: unrecognized option() argument '%s'.\n", 2722 parser.file.toLatin1().constData(), parser.line_no, 2723 args.first().toLatin1().constData()); 2724 return false; 2725 } 2726 return true; 2793 2727 default: 2794 2728 fprintf(stderr, "%s:%d: Unknown test function: %s\n", parser.file.toLatin1().constData(), parser.line_no, … … 3012 2946 break; 3013 2947 } 2948 } 2949 if(!escape && !backslashWarned) { 2950 backslashWarned = true; 2951 warn_msg(WarnDeprecated, "%s:%d: Unescaped backslashes are deprecated.", 2952 parser.file.toLatin1().constData(), parser.line_no); 3014 2953 } 3015 2954 if(escape || !replaced) … … 3090 3029 if(!Option::user_template_prefix.isEmpty() && !orig_template.startsWith(Option::user_template_prefix)) 3091 3030 real_template = Option::user_template_prefix + orig_template; 3092 if(real_template.endsWith(".t"))3093 real_template = real_template.left(real_template.length()-2);3094 3031 if(!real_template.isEmpty()) { 3095 3032 var = ".BUILTIN." + var; … … 3206 3143 if (place[var].isEmpty()) 3207 3144 return values("DIR_SEPARATOR", place); 3145 } else if (var == QLatin1String("QMAKE_EXT_OBJ")) { 3146 if (place[var].isEmpty()) { 3147 var = ".BUILTIN." + var; 3148 place[var] = QStringList(Option::obj_ext); 3149 } 3150 } else if (var == QLatin1String("QMAKE_QMAKE")) { 3151 if (place[var].isEmpty()) 3152 place[var] = QStringList(Option::fixPathToTargetOS( 3153 !Option::qmake_abslocation.isEmpty() 3154 ? Option::qmake_abslocation 3155 : QLibraryInfo::location(QLibraryInfo::BinariesPath) + "/qmake", 3156 false)); 3208 3157 } else if (var == QLatin1String("EPOCROOT")) { 3209 3158 if (place[var].isEmpty()) 3210 place[var] = QStringList(epocRoot()); 3211 } 3159 place[var] = QStringList(qt_epocRoot()); 3160 } 3161 #if defined(Q_OS_WIN32) && defined(Q_CC_MSVC) 3162 else if(var.startsWith(QLatin1String("QMAKE_TARGET."))) { 3163 QString ret, type = var.mid(13); 3164 if(type == "arch") { 3165 QString paths = qgetenv("PATH"); 3166 QString vcBin64 = qgetenv("VCINSTALLDIR").append("\\bin\\amd64"); 3167 QString vcBinX86_64 = qgetenv("VCINSTALLDIR").append("\\bin\\x86_amd64"); 3168 if(paths.contains(vcBin64,Qt::CaseInsensitive) || paths.contains(vcBinX86_64,Qt::CaseInsensitive)) 3169 ret = "x86_64"; 3170 else 3171 ret = "x86"; 3172 } 3173 place[var] = QStringList(ret); 3174 } 3175 #endif 3212 3176 //qDebug("REPLACE [%s]->[%s]", qPrintable(var), qPrintable(place[var].join("::"))); 3213 3177 return place[var]; 3214 3178 } 3215 3179 3180 bool QMakeProject::isEmpty(const QString &v) 3181 { 3182 QMap<QString, QStringList>::ConstIterator it = vars.constFind(varMap(v)); 3183 return it == vars.constEnd() || it->isEmpty(); 3184 } 3185 3216 3186 QT_END_NAMESPACE -
trunk/qmake/project.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 79 79 QMap<QString, FunctionBlock*> testFunctions, replaceFunctions; 80 80 81 bool recursive; 81 82 bool own_prop; 83 bool backslashWarned; 82 84 QString pfile, cfile; 83 85 QMakeProperty *prop; … … 106 108 void init(QMakeProperty *, const QMap<QString, QStringList> *); 107 109 QStringList &values(const QString &v, QMap<QString, QStringList> &place); 110 void validateModes(); 108 111 109 112 public: … … 116 119 117 120 enum { ReadCache=0x01, ReadConf=0x02, ReadCmdLine=0x04, ReadProFile=0x08, 118 Read PostFiles=0x10, ReadFeatures=0x20, ReadConfigs=0x40, ReadAll=0xFF };121 ReadFeatures=0x20, ReadConfigs=0x40, ReadAll=0xFF }; 119 122 inline bool parse(const QString &text) { return parse(text, vars); } 120 123 bool read(const QString &project, uchar cmd=ReadAll); … … 125 128 126 129 QString projectFile(); 127 QString configFile();128 130 inline QMakeProperty *properties() { return prop; } 129 131 … … 149 151 QMap<QString, QStringList> *place=NULL); 150 152 151 bool isSet(const QString &v); 152 bool isEmpty(const QString &v); 153 QStringList &values(const QString &v); 154 QString first(const QString &v); 155 QMap<QString, QStringList> &variables(); 153 bool isSet(const QString &v); // No compat mapping, no magic variables 154 bool isEmpty(const QString &v); // With compat mapping, but no magic variables 155 QStringList &values(const QString &v); // With compat mapping and magic variables 156 QString first(const QString &v); // ditto 157 QMap<QString, QStringList> &variables(); // No compat mapping and magic, obviously 158 159 bool isRecursive() const { return recursive; } 156 160 157 161 protected: … … 170 174 } 171 175 172 inline QString QMakeProject::configFile()173 { return cfile; }174 175 176 inline QStringList &QMakeProject::values(const QString &v) 176 177 { return values(v, vars); } 177 178 inline bool QMakeProject::isEmpty(const QString &v)179 { return !isSet(v) || values(v).isEmpty(); }180 178 181 179 inline bool QMakeProject::isSet(const QString &v) … … 193 191 { return vars; } 194 192 195 // Helper functions needed for Symbian196 bool isForSymbian();197 bool isForSymbianSbsv2();198 199 193 QT_END_NAMESPACE 200 194 -
trunk/qmake/property.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 96 96 else if(v == "QT_INSTALL_PLUGINS") 97 97 return QLibraryInfo::location(QLibraryInfo::PluginsPath); 98 else if(v == "QT_INSTALL_IMPORTS") 99 return QLibraryInfo::location(QLibraryInfo::ImportsPath); 98 100 else if(v == "QT_INSTALL_TRANSLATIONS") 99 101 return QLibraryInfo::location(QLibraryInfo::TranslationsPath); … … 105 107 return QLibraryInfo::location(QLibraryInfo::DemosPath); 106 108 else if(v == "QMAKE_MKSPECS") 107 return qmake_mkspec_paths().join(Option::target_mode == Option::TARG_WIN_MODE || 108 Option::target_mode == Option::TARG_OS2_MODE ? ";" : ":"); 109 return qmake_mkspec_paths().join(Option::dirlist_sep); 109 110 else if(v == "QMAKE_VERSION") 110 111 return qmake_version(); … … 193 194 specialProps.append("QT_INSTALL_BINS"); 194 195 specialProps.append("QT_INSTALL_PLUGINS"); 196 specialProps.append("QT_INSTALL_IMPORTS"); 195 197 specialProps.append("QT_INSTALL_TRANSLATIONS"); 196 198 specialProps.append("QT_INSTALL_CONFIGURATION"); -
trunk/qmake/property.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) -
trunk/qmake/qmake.pri
r769 r846 8 8 generators/xmloutput.cpp generators/win32/borland_bmake.cpp \ 9 9 generators/win32/msvc_nmake.cpp generators/projectgenerator.cpp \ 10 generators/win32/msvc_dsp.cpp generators/win32/msvc_vcproj.cpp \ 11 generators/win32/msvc_objectmodel.cpp \ 10 generators/win32/msvc_vcproj.cpp \ 11 generators/win32/msvc_vcxproj.cpp \ 12 generators/win32/msvc_objectmodel.cpp generators/win32/msbuild_objectmodel.cpp \ 13 generators/symbian/symbiancommon.cpp \ 12 14 generators/symbian/symmake.cpp \ 13 15 generators/symbian/symmake_abld.cpp \ 14 16 generators/symbian/symmake_sbsv2.cpp \ 15 17 generators/symbian/initprojectdeploy_symbian.cpp \ 18 generators/os2/gnumake.cpp \ 16 19 windows/registry.cpp \ 17 symbian/epocroot.cpp \ 18 generators/os2/gnumake.cpp 20 symbian/epocroot.cpp 19 21 20 22 HEADERS += project.h property.h generators/makefile.h \ 21 23 generators/unix/unixmake.h meta.h option.h cachekeys.h \ 22 generators/win32/winmakefile.h generators/ projectgenerator.h \24 generators/win32/winmakefile.h generators/win32/mingw_make.h generators/projectgenerator.h \ 23 25 generators/makefiledeps.h generators/metamakefile.h generators/mac/pbuilder_pbx.h \ 24 26 generators/xmloutput.h generators/win32/borland_bmake.h generators/win32/msvc_nmake.h \ 25 generators/win32/msvc_dsp.h generators/win32/msvc_vcproj.h \ 26 generators/win32/mingw_make.h generators/win32/msvc_objectmodel.h \ 27 generators/win32/msvc_vcproj.h \ 28 generators/win32/msvc_vcxproj.h \ 29 generators/win32/msvc_objectmodel.h generators/win32/msbuild_objectmodel.h \ 30 generators/symbian/symbiancommon.h \ 27 31 generators/symbian/symmake.h \ 28 32 generators/symbian/symmake_abld.h \ 29 33 generators/symbian/symmake_sbsv2.h \ 30 34 generators/symbian/initprojectdeploy_symbian.h \ 31 windows/registry.h \32 symbian/epocroot.h \33 35 generators/os2/gnumake.h 36 windows/registry_p.h \ 37 symbian/epocroot_p.h 34 38 35 39 contains(QT_EDITION, OpenSource) { … … 41 45 SKIP_DEPENDS += qconfig.h qmodules.h 42 46 DEFINES += QT_NO_TEXTCODEC QT_NO_LIBRARY QT_NO_STL QT_NO_COMPRESS QT_NO_UNICODETABLES \ 43 QT_NO_GEOM_VARIANT QT_NO_DATASTREAM 47 QT_NO_GEOM_VARIANT QT_NO_DATASTREAM QLIBRARYINFO_EPOCROOT 44 48 DEFINES+=QT_NODLL QT_NO_THREAD 45 49 SOURCES+= \ … … 130 134 } 131 135 } else:win32 { 132 SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp 136 SOURCES += qfsfileengine_win.cpp qfsfileengine_iterator_win.cpp qsettings_win.cpp \ 137 qsystemlibrary.cpp 133 138 win32-msvc*:LIBS += ole32.lib advapi32.lib 134 win32-g++ :LIBS += -lole32 -luuid139 win32-g++*:LIBS += -lole32 -luuid 135 140 } else:os2 { 136 141 SOURCES += qfsfileengine_os2.cpp qfsfileengine_iterator_os2.cpp qsettings_os2.cpp -
trunk/qmake/qmake.pro
r769 r846 22 22 $$QT_SOURCE_TREE/src/corelib/xml \ 23 23 $$QT_SOURCE_TREE/src/corelib/io 24 INCPATH += generators \ 24 INCLUDEPATH += . \ 25 generators \ 25 26 generators/unix \ 26 27 generators/win32 \ … … 33 34 34 35 VPATH += $$QT_SOURCE_TREE/tools/shared 35 INC PATH += $$QT_SOURCE_TREE/tools/shared36 INCLUDEPATH += $$QT_SOURCE_TREE/tools/shared 36 37 37 38 include(qmake.pri) -
trunk/qmake/qmake_pch.h
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com)
Note:
See TracChangeset
for help on using the changeset viewer.