Changeset 2658


Ignore:
Timestamp:
Mar 18, 2006, 10:38:15 PM (20 years ago)
Author:
bird
Message:

out and dist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/env.cmd

    r2500 r2658  
    2727     * Constants.
    2828     */
    29     asBuildTypes.0 = 2;
     29    asBuildTypes.0 = 3;
    3030    asBuildTypes.1 = 'debug';
    31     asBuildTypes.2 = 'release';
     31    asBuildTypes.2 = 'profile';
     32    asBuildTypes.3 = 'release';
    3233    asStages.0 = 2
    3334    asStages.1 = 'stage1'
     
    4647    fUseStagedGcc = 1;
    4748    sBuildType = 'debug';
     49    sBuildTarget = 'os2';
    4850    do i = 1 to words(sArgs)
    4951        /* extract word */
     
    7375        end
    7476        else
    75             sBuildType = translate(sArg);
    76     end
    77 
    78     if (sBuildType <> 'RELEASE' & sBuildType <> 'debug') then
     77            sBuildType = ToLower(sArg);
     78    end
     79
     80    if (sBuildType <> 'release' & sBuildType <> 'debug') then
    7981    do
    8082        call syntax;
     
    8486
    8587    /*
    86      * Figure out our location which will give us the place of the tools
    87      * directory.
     88     * Assuming this script is in the root directory, we can determing
     89     * the abs path to it by using the 'parse source' feature in rexx.
    8890     */
    8991    parse source . . sSrc
    90     sPathTools  = filespec('drive', sSrc) || strip(filespec('path', sSrc), 'T', '\') || '\tools';
     92    sPathRoot   = filespec('drive', sSrc) || strip(filespec('path', sSrc), 'T', '\');
     93    sPathRootF  = translate(sPathRoot, '/', '\');
     94
     95    /*
     96     * Figure where the tools directory is.
     97     *
     98     * The tools directory is where we've got all the precompiled kNIX
     99     * binaries and headers which are required to bootstrap kNIX. In
     100     * GenToo terminology this is 'stage1'.
     101     */
     102    sPathTools  = sPathRoot || '\tools';
    91103    sPathToolsF = translate(sPathTools, '/', '\');
    92     sPathToolsFD= translate(strip(filespec('path', sSrc), 'T', '\'), '/', '\') || '\tools';
    93     sPathRoot   = filespec('drive', sPathTools) || strip(filespec('path', sPathTools), 'T', '\');
    94     sPathRootF  = translate(sPathRoot, '/', '\');
    95 
    96     sPathObj  = sPathRoot'\obj\OS2\'sBuildType
    97     sPathObjF = sPathRootF'/obj/os2/'sBuildType
    98     sPathBin  = sPathRoot'\bin\os2\'sBuildType
    99     sPathBinF = sPathRootF'/bin/os2/'sBuildType
     104    sPathToolsFD= translate(filespec('path', sPathTools), '/', '\') || 'tools';
     105
     106    /*
     107     * Figure where the output directory is.
     108     * (kBuild actually decides this)
     109     */
     110    sPathOut  = sPathRoot'\out\'sBuildTarget'\'sBuildType
     111    sPathOutF = sPathRootF'/out/'sBuildTarget'/'sBuildType
    100112
    101113    /*
     
    105117    if (sPathkBuild = '') then
    106118        sPathkBuild = sPathRoot'\kBuild';
     119    sPathkBuild  = translate(sPathkBuild, '\', '/');
    107120    sPathkBuildF = translate(sPathkBuild, '/', '\');
    108     sPathkBuild  = translate(sPathkBuild, '\', '/');
    109121    if (\FileExists(sPathkBuild'\footer.kmk')) then
    110122    do
     
    120132    do i = 1 to asBuildTypes.0
    121133        sMode = asBuildTypes.i;
    122         call EnvAddFront 1, 'PATH',                 sPathRoot'\obj\os2\'sMode'\builtunix\bin;'
    123         call EnvAddFront 1, 'PATH',                 sPathRoot'\obj\os2\'sMode'\builtunix\usr\omfhackbin;'
    124         call EnvAddFront 1, 'PATH',                 sPathRoot'\obj\os2\'sMode'\builtunix\usr\bin;'
    125         call EnvAddFront 1, 'PATH',                 sPathRootF'/obj/os2/'sMode'/builtunix/bin;'
    126         call EnvAddFront 1, 'PATH',                 sPathRootF'/obj/os2/'sMode'/builtunix/usr/bin;'
    127         call EnvAddFront 1, 'C_INCLUDE_PATH',       sPathRootF'/obj/os2/'sMode'/builtunix/usr/include;'
    128         call EnvAddFront 1, 'CPLUS_INCLUDE_PATH',   sPathRootF'/obj/os2/'sMode'/builtunix/usr/include;'
    129         call EnvAddFront 1, 'COBJ_INCLUDE_PATH',    sPathRootF'/obj/os2/'sMode'/builtunix/usr/include;'
    130         call EnvAddFront 1, 'LIBRARY_PATH',         sPathRootF'/obj/os2/'sMode'/builtunix/lib;'
    131         call EnvAddFront 1, 'LIBRARY_PATH',         sPathRootF'/obj/os2/'sMode'/builtunix/usr/lib;'
    132         call EnvAddFront 1, 'LIBRARY_PATH',         sPathRootF'/obj/os2/'sMode'/builtunix/usr/lib/gcc-lib/i386-pc-os2-emx/3.3.5;'
     134        call EnvAddFront 1, 'PATH',                 sPathRoot'\out\'sBuildTarget'\'sMode'\dist\bin;'
     135        call EnvAddFront 1, 'PATH',                 sPathRoot'\out\'sBuildTarget'\'sMode'\dist\usr\omfhackbin;'
     136        call EnvAddFront 1, 'PATH',                 sPathRoot'\out\'sBuildTarget'\'sMode'\dist\usr\bin;'
     137        call EnvAddFront 1, 'PATH',                 sPathRootF'/out/'sBuildTarget'/'sMode'/dist/bin;'
     138        call EnvAddFront 1, 'PATH',                 sPathRootF'/out/'sBuildTarget'/'sMode'/dist/usr/bin;'
     139        call EnvAddFront 1, 'C_INCLUDE_PATH',       sPathRootF'/out/'sBuildTarget'/'sMode'/dist/usr/include;'
     140        call EnvAddFront 1, 'CPLUS_INCLUDE_PATH',   sPathRootF'/out/'sBuildTarget'/'sMode'/dist/usr/include;'
     141        call EnvAddFront 1, 'COBJ_INCLUDE_PATH',    sPathRootF'/out/'sBuildTarget'/'sMode'/dist/usr/include;'
     142        call EnvAddFront 1, 'LIBRARY_PATH',         sPathRootF'/out/'sBuildTarget'/'sMode'/dist/lib;'
     143        call EnvAddFront 1, 'LIBRARY_PATH',         sPathRootF'/out/'sBuildTarget'/'sMode'/dist/usr/lib;'
     144        call EnvAddFront 1, 'LIBRARY_PATH',         sPathRootF'/out/'sBuildTarget'/'sMode'/dist/usr/lib/gcc-lib/i386-pc-os2-emx/3.3.5;'
    133145        do j = 1 to asStages.0
    134             call EnvAddFront 1,'BEGINLIBPATH',      sPathRoot'\obj\os2\'sMode'\gcc\gcc\'asStages.j';'
     146            call EnvAddFront 1,'BEGINLIBPATH',      sPathRoot'\out\'sBuildTarget'\'sMode'\obj\gcc\gcc\'asStages.j';'
    135147        end
    136         call EnvAddFront 1,  'BEGINLIBPATH',        sPathRoot'\obj\os2\'sMode'\builtunix\lib;'
    137         call EnvAddFront 1,  'BEGINLIBPATH',        sPathRoot'\obj\os2\'sMode'\builtunix\usr\lib;'
     148        call EnvAddFront 1,  'BEGINLIBPATH',        sPathRoot'\out\'sBuildTarget'\'sMode'\dist\lib;'
     149        call EnvAddFront 1,  'BEGINLIBPATH',        sPathRoot'\out\'sBuildTarget'\'sMode'\dist\usr\lib;'
    138150    end
    139151
     
    141153    'call BuildEnv.cmd unixõ vac365õ vac308õ toolkit452õ toolkit40õ emxõ emxpgccõ gcc302õ gcc303õ gcc321õ gcc322õ gcc335õ'
    142154    if (\fRm) then
    143         'call BuildEnv.cmd cvs~ emx~'
     155        'call BuildEnv.cmd cvs~ emx~ svn~'
    144156    /* We do not want any influence from the emx, that's only runtime stuff. */
    145157    if (1) then
     
    195207    call EnvSet      fRm, 'PATH_TOP',           sPathRootF
    196208    call EnvSet      fRm, 'PATH_TOPD',          substr(sPathRootF, 3)
    197     call EnvSet      fRm, 'PATH_OBJ',           sPathObjF
    198     call EnvSet      fRm, 'PATH_OBJD',          substr(sPathObjF, 3)
    199     call EnvSet      fRm, 'PATH_BIN',           sPathBinF
    200     call EnvSet      fRm, 'PATH_BIND',          substr(sPathBinF, 3)
     209    call EnvSet      fRm, 'PATH_OBJ',           sPathOutF
     210    call EnvSet      fRm, 'PATH_OBJD',          substr(sPathOutF, 3)
    201211
    202212    /* kBuild. */
     
    205215    call EnvAddFront fRm, 'BEGINLIBPATH',       sPathkBuild'\bin\x86.os2;'
    206216    call EnvSet      fRm, 'BUILD_TYPE',         sBuildType
    207     call EnvSet      fRm, 'BUILD_TARGET',       'os2'
     217    call EnvSet      fRm, 'BUILD_TARGET',       sBuildTarget
    208218    call EnvSet      fRm, 'BUILD_TARGET_ARCH',  'x86'
    209219    call EnvSet      fRm, 'BUILD_TARGET_CPU',   'i386'
    210     call EnvSet      fRm, 'BUILD_PLATFORM',     'os2'
     220    call EnvSet      fRm, 'BUILD_PLATFORM',     sBuildTarget
    211221    call EnvSet      fRm, 'BUILD_PLATFORM_ARCH','x86'
    212222    call EnvSet      fRm, 'BUILD_PLATFORM_CPU', 'i386'
     
    222232
    223233    do i = 1 to asStages.0
    224         call EnvAddFront fRm,'BEGINLIBPATH',    sPathObj'\gcc\gcc\'asStages.i';'
     234        call EnvAddFront fRm,'BEGINLIBPATH',    sPathOut'\gcc\gcc\'asStages.i';'
    225235    end
    226236
    227237    /* hmm do I actually want this in the path? */
     238/* at present we don't
    228239    call EnvAddFront fRm, 'C_INCLUDE_PATH',     sPathToolsF'/usr/include;'
    229240    call EnvAddFront fRm, 'CPLUS_INCLUDE_PATH', sPathToolsF'/usr/include;'
    230241    call EnvAddFront fRm, 'OBJC_INCLUDE_PATH',  sPathToolsF'/usr/include;'
    231242    call EnvAddFront fRm, 'LIBRARY_PATH',       sPathToolsF'/usr/lib;'
     243*/
    232244
    233245    /* build tools? */
    234     call EnvSet      fRm, 'PATH_BUILTUNIX',     sPathObjF'/builtunix'
    235     call EnvAddFront fRm, 'PATH',               sPathObjF'/builtunix/usr/bin;'
    236     call EnvAddFront fRm, 'PATH',               sPathObj'\builtunix\usr\bin;'
    237     call EnvAddFront fRm, 'PATH',               sPathObjF'/builtunix/bin;'
    238     call EnvAddFront fRm, 'PATH',               sPathObj'\builtunix\bin;'
    239     call EnvAddFront fRm, 'PATH',               sPathObj'\builtunix/usr\omfhackbin;'
    240     call EnvAddFront fRm, 'BEGINLIBPATH',       sPathObj'\builtunix\usr\lib;'
    241     call EnvAddFront fRm, 'C_INCLUDE_PATH',     sPathObjF'/builtunix/usr/include;'
    242     call EnvAddFront fRm, 'CPLUS_INCLUDE_PATH', sPathObjF'/builtunix/usr/include;'
    243     call EnvAddFront fRm, 'OBJC_INCLUDE_PATH',  sPathObjF'/builtunix/usr/include;'
    244     call EnvAddFront fRm, 'LIBRARY_PATH',       sPathObjF'/builtunix/usr/lib;'
    245     call EnvAddFront fRm, 'LIBRARY_PATH',       sPathObjF'/builtunix/usr/lib/gcc-lib/i386-pc-os2-emx/3.3.5;'
     246    call EnvSet      fRm, 'PATH_BUILTUNIX',     sPathOutF'/dist'
     247    call EnvAddFront fRm, 'PATH',               sPathOutF'/dist/usr/bin;'
     248    call EnvAddFront fRm, 'PATH',               sPathOut'\dist\usr\bin;'
     249    call EnvAddFront fRm, 'PATH',               sPathOutF'/dist/bin;'
     250    call EnvAddFront fRm, 'PATH',               sPathOut'\dist\bin;'
     251    call EnvAddFront fRm, 'PATH',               sPathOut'\dist/usr\omfhackbin;' /* remove me! */
     252    call EnvAddFront fRm, 'BEGINLIBPATH',       sPathOut'\dist\usr\lib;'
     253    call EnvAddFront fRm, 'C_INCLUDE_PATH',     sPathOutF'/dist/usr/include;'
     254    call EnvAddFront fRm, 'CPLUS_INCLUDE_PATH', sPathOutF'/dist/usr/include;'
     255    call EnvAddFront fRm, 'OBJC_INCLUDE_PATH',  sPathOutF'/dist/usr/include;'
     256    call EnvAddFront fRm, 'LIBRARY_PATH',       sPathOutF'/dist/usr/lib;'
     257    call EnvAddFront fRm, 'LIBRARY_PATH',       sPathOutF'/dist/usr/lib/gcc-lib/i386-pc-os2-emx/3.3.5;'
    246258
    247259    call EnvSet      1,   'AC_PREFIX'
     
    321333        call EnvSet fRm, 'LIBRARY_PATH', sTmp;
    322334        drop sTmp;
    323     end
    324 
    325     /*
    326      * Check for pitfalls....
    327      */
    328     rc = 0;
    329     sHome = EnvGet('HOME');
    330     if (sHome <> '') then
    331     do
    332         sHome = translate(sHome, '\', '/');
    333         if (FileExists(sHome'\.bashrc')) then
    334         do
    335             say 'warning: HOME includes a .bashrc, pray you have no weird aliases...'
    336             if (rc < 4) then rc = 4;
    337         end
    338     end
    339     else
    340     do
    341         say 'warning: no home path!?!'
    342         if (rc < 4) then rc = 4;
    343     end
    344 
    345     if ( (SysSearchPath('PATH', 'ln.exe') <> '') |  (SysSearchPath('PATH', 'ln') <> '') ) then
    346     do
    347         say 'error: Found ln.exe/ln in your PATH.'
    348         say 'info:  ln.exe/ln will ruin the build. So you better remove it.'
    349         if (rc < 8) then rc = 8;
    350335    end
    351336
     
    682667return 0;
    683668
     669
     670/**
     671 * Translate a string to lower case.
     672 */
     673ToLower: procedure
     674    parse arg sString
     675return translate(sString, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
Note: See TracChangeset for help on using the changeset viewer.