Changeset 2658
- Timestamp:
- Mar 18, 2006, 10:38:15 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/env.cmd
r2500 r2658 27 27 * Constants. 28 28 */ 29 asBuildTypes.0 = 2;29 asBuildTypes.0 = 3; 30 30 asBuildTypes.1 = 'debug'; 31 asBuildTypes.2 = 'release'; 31 asBuildTypes.2 = 'profile'; 32 asBuildTypes.3 = 'release'; 32 33 asStages.0 = 2 33 34 asStages.1 = 'stage1' … … 46 47 fUseStagedGcc = 1; 47 48 sBuildType = 'debug'; 49 sBuildTarget = 'os2'; 48 50 do i = 1 to words(sArgs) 49 51 /* extract word */ … … 73 75 end 74 76 else 75 sBuildType = translate(sArg);76 end 77 78 if (sBuildType <> ' RELEASE' & sBuildType <> 'debug') then77 sBuildType = ToLower(sArg); 78 end 79 80 if (sBuildType <> 'release' & sBuildType <> 'debug') then 79 81 do 80 82 call syntax; … … 84 86 85 87 /* 86 * Figure out our location which will give us the place of the tools87 * 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. 88 90 */ 89 91 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'; 91 103 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\'sBuildType97 sPathObjF = sPathRootF'/obj/os2/'sBuildType98 sPath Bin = sPathRoot'\bin\os2\'sBuildType99 sPath BinF = sPathRootF'/bin/os2/'sBuildType104 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 100 112 101 113 /* … … 105 117 if (sPathkBuild = '') then 106 118 sPathkBuild = sPathRoot'\kBuild'; 119 sPathkBuild = translate(sPathkBuild, '\', '/'); 107 120 sPathkBuildF = translate(sPathkBuild, '/', '\'); 108 sPathkBuild = translate(sPathkBuild, '\', '/');109 121 if (\FileExists(sPathkBuild'\footer.kmk')) then 110 122 do … … 120 132 do i = 1 to asBuildTypes.0 121 133 sMode = asBuildTypes.i; 122 call EnvAddFront 1, 'PATH', sPathRoot'\o bj\os2\'sMode'\builtunix\bin;'123 call EnvAddFront 1, 'PATH', sPathRoot'\o bj\os2\'sMode'\builtunix\usr\omfhackbin;'124 call EnvAddFront 1, 'PATH', sPathRoot'\o bj\os2\'sMode'\builtunix\usr\bin;'125 call EnvAddFront 1, 'PATH', sPathRootF'/o bj/os2/'sMode'/builtunix/bin;'126 call EnvAddFront 1, 'PATH', sPathRootF'/o bj/os2/'sMode'/builtunix/usr/bin;'127 call EnvAddFront 1, 'C_INCLUDE_PATH', sPathRootF'/o bj/os2/'sMode'/builtunix/usr/include;'128 call EnvAddFront 1, 'CPLUS_INCLUDE_PATH', sPathRootF'/o bj/os2/'sMode'/builtunix/usr/include;'129 call EnvAddFront 1, 'COBJ_INCLUDE_PATH', sPathRootF'/o bj/os2/'sMode'/builtunix/usr/include;'130 call EnvAddFront 1, 'LIBRARY_PATH', sPathRootF'/o bj/os2/'sMode'/builtunix/lib;'131 call EnvAddFront 1, 'LIBRARY_PATH', sPathRootF'/o bj/os2/'sMode'/builtunix/usr/lib;'132 call EnvAddFront 1, 'LIBRARY_PATH', sPathRootF'/o bj/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;' 133 145 do j = 1 to asStages.0 134 call EnvAddFront 1,'BEGINLIBPATH', sPathRoot'\o bj\os2\'sMode'\gcc\gcc\'asStages.j';'146 call EnvAddFront 1,'BEGINLIBPATH', sPathRoot'\out\'sBuildTarget'\'sMode'\obj\gcc\gcc\'asStages.j';' 135 147 end 136 call EnvAddFront 1, 'BEGINLIBPATH', sPathRoot'\o bj\os2\'sMode'\builtunix\lib;'137 call EnvAddFront 1, 'BEGINLIBPATH', sPathRoot'\o bj\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;' 138 150 end 139 151 … … 141 153 'call BuildEnv.cmd unixõ vac365õ vac308õ toolkit452õ toolkit40õ emxõ emxpgccõ gcc302õ gcc303õ gcc321õ gcc322õ gcc335õ' 142 154 if (\fRm) then 143 'call BuildEnv.cmd cvs~ emx~ '155 'call BuildEnv.cmd cvs~ emx~ svn~' 144 156 /* We do not want any influence from the emx, that's only runtime stuff. */ 145 157 if (1) then … … 195 207 call EnvSet fRm, 'PATH_TOP', sPathRootF 196 208 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) 201 211 202 212 /* kBuild. */ … … 205 215 call EnvAddFront fRm, 'BEGINLIBPATH', sPathkBuild'\bin\x86.os2;' 206 216 call EnvSet fRm, 'BUILD_TYPE', sBuildType 207 call EnvSet fRm, 'BUILD_TARGET', 'os2'217 call EnvSet fRm, 'BUILD_TARGET', sBuildTarget 208 218 call EnvSet fRm, 'BUILD_TARGET_ARCH', 'x86' 209 219 call EnvSet fRm, 'BUILD_TARGET_CPU', 'i386' 210 call EnvSet fRm, 'BUILD_PLATFORM', 'os2'220 call EnvSet fRm, 'BUILD_PLATFORM', sBuildTarget 211 221 call EnvSet fRm, 'BUILD_PLATFORM_ARCH','x86' 212 222 call EnvSet fRm, 'BUILD_PLATFORM_CPU', 'i386' … … 222 232 223 233 do i = 1 to asStages.0 224 call EnvAddFront fRm,'BEGINLIBPATH', sPathO bj'\gcc\gcc\'asStages.i';'234 call EnvAddFront fRm,'BEGINLIBPATH', sPathOut'\gcc\gcc\'asStages.i';' 225 235 end 226 236 227 237 /* hmm do I actually want this in the path? */ 238 /* at present we don't 228 239 call EnvAddFront fRm, 'C_INCLUDE_PATH', sPathToolsF'/usr/include;' 229 240 call EnvAddFront fRm, 'CPLUS_INCLUDE_PATH', sPathToolsF'/usr/include;' 230 241 call EnvAddFront fRm, 'OBJC_INCLUDE_PATH', sPathToolsF'/usr/include;' 231 242 call EnvAddFront fRm, 'LIBRARY_PATH', sPathToolsF'/usr/lib;' 243 */ 232 244 233 245 /* build tools? */ 234 call EnvSet fRm, 'PATH_BUILTUNIX', sPathO bjF'/builtunix'235 call EnvAddFront fRm, 'PATH', sPathO bjF'/builtunix/usr/bin;'236 call EnvAddFront fRm, 'PATH', sPathO bj'\builtunix\usr\bin;'237 call EnvAddFront fRm, 'PATH', sPathO bjF'/builtunix/bin;'238 call EnvAddFront fRm, 'PATH', sPathO bj'\builtunix\bin;'239 call EnvAddFront fRm, 'PATH', sPathO bj'\builtunix/usr\omfhackbin;'240 call EnvAddFront fRm, 'BEGINLIBPATH', sPathO bj'\builtunix\usr\lib;'241 call EnvAddFront fRm, 'C_INCLUDE_PATH', sPathO bjF'/builtunix/usr/include;'242 call EnvAddFront fRm, 'CPLUS_INCLUDE_PATH', sPathO bjF'/builtunix/usr/include;'243 call EnvAddFront fRm, 'OBJC_INCLUDE_PATH', sPathO bjF'/builtunix/usr/include;'244 call EnvAddFront fRm, 'LIBRARY_PATH', sPathO bjF'/builtunix/usr/lib;'245 call EnvAddFront fRm, 'LIBRARY_PATH', sPathO bjF'/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;' 246 258 247 259 call EnvSet 1, 'AC_PREFIX' … … 321 333 call EnvSet fRm, 'LIBRARY_PATH', sTmp; 322 334 drop sTmp; 323 end324 325 /*326 * Check for pitfalls....327 */328 rc = 0;329 sHome = EnvGet('HOME');330 if (sHome <> '') then331 do332 sHome = translate(sHome, '\', '/');333 if (FileExists(sHome'\.bashrc')) then334 do335 say 'warning: HOME includes a .bashrc, pray you have no weird aliases...'336 if (rc < 4) then rc = 4;337 end338 end339 else340 do341 say 'warning: no home path!?!'342 if (rc < 4) then rc = 4;343 end344 345 if ( (SysSearchPath('PATH', 'ln.exe') <> '') | (SysSearchPath('PATH', 'ln') <> '') ) then346 do347 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;350 335 end 351 336 … … 682 667 return 0; 683 668 669 670 /** 671 * Translate a string to lower case. 672 */ 673 ToLower: procedure 674 parse arg sString 675 return translate(sString, 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
Note:
See TracChangeset
for help on using the changeset viewer.