Changeset 983 for trunk


Ignore:
Timestamp:
Aug 15, 2011, 2:57:00 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: Add support for shadow builds of Qt itself.

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/README.OS2

    r957 r983  
    5656script (discussed in section "COMPILING QT" below) will automatically disable
    5757the corresponding feature:
     58
     59
     60
     61
     62
     63
     64
    5865
    5966  - MAPSYM 4.00.000 (Oct 4 2001) to enable generation of symbol (.SYM) files for
     
    232239libraries) and proceed directly to the next section.
    233240
    234 When the environment is set up, go to the directory where you unpacked the
    235 Qt4 source tree and type:
    236 
    237   configure.cmd
    238 
    239 This will set up the Qt library (by creating necessary configuration and include
    240 files and a bunch of Makefiles for variuos components) and build the qmake tool.
    241 
    242 The next step is to type:
    243 
    244   make
    245 
    246 This will compile and link the Qt library. Note that by default both the release
    247 and the debug version of the library are built (please be patient, it may take
    248 quite some time depending on your hardware). The release and debug libraries can
    249 co-exist in the same source tree and may be used in parallel: all the debug DLLs
    250 get a 'd' letter in their name preceeding the Qt major version number and use
    251 separate directories for object files.
    252 
    253 To save time, you may build the release and the debug versions of the Qt library
    254 separately by typing 'make release' or 'make debug' accordingly instead of just
    255 'make'.
     241When the environment is set up as described above, you may build the Qt library.
     242There are two distinct ways of doing this: in the source tree or in a separate
     243directory of your choice. In the first case, all results of the build process
     244(intermediate object files as well as final executables and DLLs) will be placed
     245right in the source tree. In the second case, they will be placed in the
     246separate directory -- this is called a shadow build.
     247
     248Shadow builds are the recommended way to go because they keep the source
     249directories clean and also allow to use the same source tree for creating any
     250number of builds, each with its own build options.
     251
     252To perform a shadow build, do the following steps:
     253
     254  1. Create a directory outside the Qt4 source tree.
     255
     256  2. Go to that directory.
     257
     258  3. Type:
     259
     260     <source_tree>\configure.cmd
     261
     262     where <source_tree> is the directory containing the Qt4 source tree. This
     263     will create all necessary configuration files, headers, Makefiles and will
     264     also build the qmake tool which is necessary to control the rest of the
     265     build process (note that building qmake will take some time).
     266
     267  4. Once the configure process is finished, type:
     268
     269     make
     270
     271  Note that by the default the shadow build will produce the release version of
     272  the Qt library. This may be changed by passing command line options to
     273  configure.cmd at step 3.
     274
     275To perform a normal build, you execute 'configure.cmd' followed by 'make' right
     276in the directory containing the Qt4 source tree. The default in this case is to
     277build both the debug and release versions of the Qt library.
     278
     279Please keep in mind that in case of the dual debug and release build (where both
     280flavors are stored in the same build directory), only DLL and LIB files will be
     281separated (because the debug versions of them will have the 'd' suffix in the
     282file name). Executable files are normally taken from the release build but,
     283since the file names are identical, sometimes they may be overwritten by the
     284debug versions (e.g. when you rebuild parts of the library later). For this
     285reason, performing dual builds is not recommended.
     286
     287The Qt library is huge so the build process will take several hours (or even
     288several dozen of hours) depending on your hardware and configure options.
    256289
    257290Once the library is successfully built, you may try to compile the demos and
    258291examples by visiting the individual example subdirectories in the source tree
    259 and typing 'qmake' followed by one of 'make', 'make release' or 'make debug'
    260 in that subdirectory.
     292and typing 'qmake' followed by 'make'.
    261293
    262294NOTE:
  • trunk/configure.cmd

    r975 r983  
    513513    end
    514514
     515
     516
     517
     518
     519
     520
     521
     522
     523
     524
     525
     526
     527
     528
     529
     530
     531
     532
     533
     534
     535
     536
     537
     538
     539
     540
     541
     542
     543
     544
    515545    /* skip this if the user just needs help... */
    516546    if (G.OPT_HELP \== "yes") then do
     
    522552                G.CFG_DEBUG = "no"
    523553            end
     554
     555
     556
     557
     558
     559
     560
     561
    524562            else do
    525563                G.CFG_DEBUG_RELEASE = "yes"
     
    527565            end
    528566        end
     567
    529568        if (G.CFG_DEBUG_RELEASE == "yes") then
    530569            G.QMAKE_CONFIG = Join(G.QMAKE_CONFIG, "build_all")
     
    533572            G.QMAKE_CONFIG = Join(G.QMAKE_CONFIG, "silent")
    534573
    535         if (G.OPT_FAST == "auto") then
     574        /* if the source tree is different from the build tree,
     575         * symlink or copy part of the sources */
     576        if (G.OPT_SHADOW == "yes") then do
     577            call SaySay "Preparing build tree..."
     578
     579            if (G.PERL == "") then do
     580                call SayErr "You need perl in your PATH to make a shadow build."
     581                call SayErr "Cannot proceed."
     582                call Done 1
     583            end
     584
     585            if (\DirExists(G.OutPath"\bin")) then
     586                call MakeDir G.OutPath"\bin"
     587
     588            /* make a syncqt script that can be used in the shadow */
     589            call DeleteFile G.OutPath"\bin\syncqt.cmd"
     590            call MakeDir G.OutPath"\bin"
     591            call charout G.OutPath"\bin\syncqt.cmd",,
     592                "/**/"G.EOL||,
     593                "parse arg aArgs"G.EOL||,
     594                "'@set QTDIR="G.RelPath"'"G.EOL||,
     595                "'@call perl -S """G.RelPath"""\bin\syncqt",
     596                    "-outdir """G.OutPath"""' aArgs"G.EOL
     597            call charout G.OutPath"\bin\syncqt.cmd"
     598
     599            /* copy includes */
     600            cmd = ""
     601            G.SYNCQT_OPTS = ""
     602            if (G.CFG_DEV == "yes") then
     603                G.SYNCQT_OPTS = Join(G.SYNCQT_OPTS, "-check-includes")
     604            if (G.OPT_SHADOW == "yes") then
     605                cmd = 'call' G.OutPath'\bin\syncqt.cmd' G.SYNCQT_OPTS
     606            else if (G.CFG_DEV == "yes" | \DirExists(G.RelPath"\include") |,
     607                     DirExists(G.RelPath"\.git")) then
     608                cmd = 'call' G.RelPath'\bin\syncqt.cmd' G.SYNCQT_OPTS
     609            if (cmd \== '') then do
     610                cmd
     611                if (rc \= 0) then do
     612                    call SayErr cmd "failed with exit code "rc"."
     613                    call SayErr "Cannot proceed."
     614                    call Done 1
     615                end
     616            end
     617
     618            /* copy parts of the mkspecs directory */
     619            call DeleteDir G.OutPath"\mkspecs"
     620            call SysFileTree G.RelPath"\mkspecs\os2-*", 'found', 'DO'
     621            do i = 1 to found.0
     622                call CopyDir found.i, G.OutPath"\mkspecs\"filespec('N', found.i)
     623            end
     624            call CopyDir G.RelPath"\mkspecs\features", G.OutPath"\mkspecs\features"
     625            call CopyDir G.RelPath"\mkspecs\modules", G.OutPath"\mkspecs\modules"
     626            call DeleteDir G.OutPath"\mkspecs\default"
     627
     628/*@todo
     629            # symlink the doc directory
     630            rm -rf "$outpath/doc"
     631            ln -s "$relpath/doc" "$outpath/doc"
     632
     633            # make sure q3porting.xml can be found
     634            mkdir -p "$outpath/tools/porting/src"
     635            rm -f "$outpath/tools/porting/src/q3porting.xml"
     636            ln -s "$relpath/tools/porting/src/q3porting.xml" "$outpath/tools/porting/src"
     637*/
     638        end
     639
     640        if (G.OPT_FAST == "auto") then do
    536641           if (G.CFG_DEV == "yes") then G.OPT_FAST = "yes"
    537642           else G.OPT_FAST = "no"
    538 
    539         /* find a make command */
     643        end
     644
     645        /* find the make command */
    540646        G.MAKE = GetEnv("MAKE")
    541647        if (G.MAKE == "") then do
     
    8981004    call SayLog "Creating qmake. Please wait..."
    8991005
     1006
     1007
    9001008    /* take the correct Makefile and fix it */
    9011009    MakefilePlatform = G.RelPath"\qmake\Makefile."G.PLATFORM
     
    9611069    call PutToAtExitSlot exs, 'call MoveFile "'qconfig_h'", "'qmake_qconfig_h'"'
    9621070
    963     list.1 = G.OutPath"\include\QtCore\qconfig.h"
    964     list.2 = G.OutPath"\include\Qt\qconfig.h"
    965     list.0 = 2
    966     do i = 1 to list.0
    967         if (\FileExists(list.i)) then do
    968             call charout list.i, '#include "..\..\src\corelib\global\qconfig.h"'G.EOL
    969             call charout list.i
    970         end
    971     end
    972 
    9731071    curdir = directory()
    974     call directory G.RelPath"\qmake"
     1072    call directory G.Path"\qmake"
    9751073
    9761074    address "cmd" G.MAKE G.MAKE_JOBS
     
    23442442MakeDir: procedure expose (Globals)
    23452443    parse arg aDir
    2346     aDir = translate(aDir, '\', '/')
     2444    aDir = )
    23472445    curdir = directory()
    23482446    base = aDir
  • trunk/qmake/Makefile.os2-g++

    r847 r983  
    1414CXX         =   g++
    1515CFLAGS      =   -O -s -Zomf \
    16                 -I. -Igenerators -Igenerators/unix \
    17                 -Igenerators/win32 -Igenerators/mac \
    18         -Igenerators/symbian -Igenerators/os2 \
     16                -I$(SOURCE_PATH)/qmake \
     17                -I$(SOURCE_PATH)/qmake/generators \
     18                -I$(SOURCE_PATH)/qmake/generators/unix \
     19                -I$(SOURCE_PATH)/qmake/generators/win32 \
     20                -I$(SOURCE_PATH)/qmake/generators/mac \
     21        -I$(SOURCE_PATH)/qmake/generators/symbian \
     22                -I$(SOURCE_PATH)/qmake/generators/os2 \
    1923                -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \
    20                 -I$(SOURCE_PATH)/include -I$(SOURCE_PATH)/include/QtCore \
    2124                -I$(BUILD_PATH)/src/corelib/global \
    2225                -I$(BUILD_PATH)/src/corelib/xml \
     
    4750
    4851SOURCES     = \
    49                 project.cpp \
    50                 property.cpp \
    51                 main.cpp \
    52                 generators/makefile.cpp \
    53                 generators/unix/unixmake2.cpp \
    54                 generators/unix/unixmake.cpp \
    55                 meta.cpp \
    56                 option.cpp \
    57                 generators/win32/winmakefile.cpp \
    58                 generators/win32/mingw_make.cpp \
    59                 generators/makefiledeps.cpp \
    60                 generators/metamakefile.cpp \
    61                 generators/mac/pbuilder_pbx.cpp \
    62                 generators/xmloutput.cpp \
    63                 generators/win32/borland_bmake.cpp \
    64                 generators/win32/msvc_nmake.cpp \
    65                 generators/projectgenerator.cpp \
    66                 generators/win32/msvc_vcproj.cpp \
    67                 generators/win32/msvc_vcxproj.cpp \
    68                 generators/win32/msvc_objectmodel.cpp \
    69                 generators/win32/msbuild_objectmodel.cpp \
    70                 generators/symbian/symmake.cpp \
    71                 generators/symbian/symmake_abld.cpp \
    72                 generators/symbian/symmake_sbsv2.cpp \
    73                 generators/symbian/initprojectdeploy_symbian.cpp \
    74                 generators/symbian/symbiancommon.cpp \
    75                 generators/os2/gnumake.cpp
     52                project.cpp \
     53                property.cpp \
     54                main.cpp \
     55                generators/makefile.cpp \
     56                generators/unix/unixmake2.cpp \
     57                generators/unix/unixmake.cpp \
     58                meta.cpp \
     59                option.cpp \
     60                generators/win32/winmakefile.cpp \
     61                generators/win32/mingw_make.cpp \
     62                generators/makefiledeps.cpp \
     63                generators/metamakefile.cpp \
     64                generators/mac/pbuilder_pbx.cpp \
     65                generators/xmloutput.cpp \
     66                generators/win32/borland_bmake.cpp \
     67                generators/win32/msvc_nmake.cpp \
     68                generators/projectgenerator.cpp \
     69                generators/win32/msvc_vcproj.cpp \
     70                generators/win32/msvc_vcxproj.cpp \
     71                generators/win32/msvc_objectmodel.cpp \
     72                generators/win32/msbuild_objectmodel.cpp \
     73                generators/symbian/symmake.cpp \
     74                generators/symbian/symmake_abld.cpp \
     75                generators/symbian/symmake_sbsv2.cpp \
     76                generators/symbian/initprojectdeploy_symbian.cpp \
     77                generators/symbian/symbiancommon.cpp \
     78                generators/os2/gnumake.cpp
    7679
    7780# Qt code (taken from qmake.pri)
     
    139142        @mkdir $(OBJECTS_DIR)
    140143
    141 Makefile: Makefile.os2-g++
     144Makefile: Makefile.os2-g++
    142145        @echo "Out of date, please rerun configure"
    143146
  • trunk/qmake/qmake.pro

    r846 r983  
    2929           generators/symbian \
    3030           generators/os2 \
    31            $$QT_SOURCE_TREE/include \
    32            $$QT_SOURCE_TREE/include/QtCore \
    33            $$QT_SOURCE_TREE/qmake
     31           $$QT__TREE/include \
     32           $$QT__TREE/include/QtCore \
     33           $$QT_
    3434
    3535VPATH += $$QT_SOURCE_TREE/tools/shared
Note: See TracChangeset for help on using the changeset viewer.