1#!@PERL@ -w 2# 3############################################################### 4# 5# Licensed to the Apache Software Foundation (ASF) under one 6# or more contributor license agreements. See the NOTICE file 7# distributed with this work for additional information 8# regarding copyright ownership. The ASF licenses this file 9# to you under the Apache License, Version 2.0 (the 10# "License"); you may not use this file except in compliance 11# with the License. You may obtain a copy of the License at 12# 13# http://www.apache.org/licenses/LICENSE-2.0 14# 15# Unless required by applicable law or agreed to in writing, 16# software distributed under the License is distributed on an 17# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18# KIND, either express or implied. See the License for the 19# specific language governing permissions and limitations 20# under the License. 21# 22############################################################### 23 24#--------------------------------------------------------------------------- 25# Description: 26# set_soenv generates a file that contains all necessary 27# environment variables for the build process of OpenOffice 28# on Linux, NetBSD, Solaris, Windows NT and Mac OS X/Darwin. 29# 30# Program steps. 31# 32# I. Checking the command-line arguments. 33# IIa. Declaring variables for the system commands, etc. 34# IIb. Declaring the environment variables. 35# III. Initialising the variables for the system commands, etc. 36# IV. Print out some important messages etc. 37# V. Initialising the environment variables. 38# VI. Open the output file. 39# VII. Writing the data to the output file. 40# VIII. Closing output file. 41# IX. Sourcing the output file. 42# X. Set up the build environment. 43# XI. Moving the output file to the build home directory. 44# 45#--------------------------------------------------------------------------- 46# 47use strict; # pragma 48use File::Basename; 49 50 51# 52#-------------------------------------------------------- 53# IIa. Declaring variables for the system commands, etc. 54#-------------------------------------------------------- 55# 56my ( $outfile, $outfile_sh, $outfile_bat, $bootfile, $newline, $comment, 57 $compiler, $unsetenv, $setenv, $unset, $set, $ds, $ps, 58 $wps, $cur_dir, $par_dir, $I, $L, $D, $buildenv, $answer, $tmp, $MINGW, 59 $USE_MINGW, $platform, 60 $cygwinver, $empty, $no_ant, $no_stl, 61 $warnfile, $Warning, $result, $unsetvars, $unsetvarssh, $unsetvarsbat, $exportvars, $win_format_var, $perl_os, @mingw_lib_include_paths, $mingw_lib_include_path); 62# 63#------------------------------------------------- 64# IIb. Declaring environment values (constants). 65#------------------------------------------------- 66# 67# Platform independent constant values. 68my @DICTIONARIES = ("DADK", "DEDE", "ENGB", "ENUS", "HUHU", "ITIT", "RURU", "THTH", "SWTZ" ); 69my ( $CALL_CDECL, $COMMON_OUTDIR, $BMP_WRITES_FLAG, 70 $common_build, $NO_REC_RES, $SO3, $SOLAR_JAVA, 71 $SOLAR_PLUGIN, $UPDATER, $BUILD_DELIVER, $VCL, 72 $CC, $CXX, 73 $BUILD_SOSL, $ENABLEUNICODE, $NEW_JAR_PACK, $NO_BSYMBOLIC, 74 $BUILD_SOSL_RELEASE, $RSC_ONCE ); 75# 76# Platform dependent constant values. 77my ( $BIG_SVX, $ALIGN, $ARCH, $CPU, $CPUNAME, $CVER, $GLIBC, $GUI, $GUIBASE, 78 $GVER, $OS, $OSVERSION, $OUTPATH, $INPATH, $PATH_SEPERATOR, 79 $DYNAMIC_CRT, $SET_EXCEPTIONS, $use_shl_versions, $CDPATHx, $JRELIBDIR, 80 $JRETOOLKITDIR, $JRETHREADDIR, 81 $FLIPCMD ); 82# 83#------------------------------------------- 84# IIc. Declaring the environment variables. 85#------------------------------------------- 86# 87# Help variables. 88my ( $USR, $ETC, $BIN, $LIB, $LIB64, $INC, $INCLUDE, $DEV, $OPT, $LOCAL, $SOLENV, $SOLVER, $CONFIG, 89 $USR_BIN, $USR_LIB, $USR_LOCAL, $USR_CCS, $JAVA_BIN, $JAVA_LIB, $JAVA_INCLUDE, 90 $SOLARENVINC, $USR_DT, $USR_OPENWIN, $XLIB, $XINC, 91 $CYGWIN_PATH, $language, $dict, $ASM_PATH, $NASM_PATH, $NSIS_PATH, $PERL_PATH ); 92 93# Environment variables. 94my ( $oldPATH, $SRC_ROOT, $SO_HOME, $JAVA_HOME, $JDK, $JAVAFLAGS, $OOO_SHELL, 95 $UPD, $WORK_STAMP, $SOURCE_ROOT_DIR , $gb_REPOS, 96 $SOLARSRC, $DEVROOT, $SOLARVER, $SOLARVERSION, $WORKDIR, $OUTDIR, $SOLARENV, 97 $STAR_INIROOT, $STAR_INIROOTOLD, $STAR_STANDLST, $STAR_SSCOMMON, $STAR_SSOLARINI, 98 $DMAKEROOT, $CLASSPATH, $XCLASSPATH, $COMPATH, $CXX_X64_BINARY, $LINK_X64_BINARY, $LIBMGR_X64_BINARY, 99 $MSPDB_PATH, $MIDL_PATH, $CSC_PATH, $MACOSX_DEPLOYMENT_TARGET, $MACOSX_SDK_PATH, $SDKROOT, 100 $PATH, $SOLAREXTRAINC, $SOLAREXTRALIB, $SOLARLIB, 101 $SOLARINC, $LOCALINI, $FRAMEWORKSHOME, $COMEX, $PERL, 102 $COMP_ENV, $ILIB, $JAVAHOME, $PSDK_HOME, $DIRECTXSDK_LIB, $USE_NEW_SDK, $FRAME_HOME, 103 $USE_DIRECTX5, $ATL_LIB, $ATL_LIB_X64, $HAVE_ATLTHUNK, $ATL_INCLUDE, $MFC_LIB, $MFC_INCLUDE, $TMPDIR, 104 $COMMON_BUILD_TOOLS, $WIN_GREP, $WIN_FIND, $WIN_LS, 105 $WIN_GNUCOPY, $WIN_TOUCH, $MOZILLABUILD, 106 $PROEXT, $TARFILE_LOCATION, 107 $ENABLE_HUNSPELL, $ENABLE_HYPHEN, 108 $SYSTEM_PYTHON, $EPM_FLAGS, $ENABLE_UNIT_TESTS); 109# 110#------------------------------------------- 111# IId. Declaring the aliases. 112#------------------------------------------- 113# 114my ( $dmake, $build, $build_client, $nmake, $mkout, $deliver, $zipdep ); 115# 116 117#------------------------------------------------------------- 118# IIIa. Initialising constants. 119#------------------------------------------------------------- 120# 121# $platform is needed for PathFormat() 122# 123$platform = `./config.guess`; 124chomp( $platform ); 125 126$UPD = '@UPD@'; # the project's UPD 127$newline = "\n"; # Perl newline character 128$unsetenv = "unsetenv"; # c-shell command 129$setenv = "setenv"; # c-shell command 130$unset = "unset"; # msdos batch file command 131$set = "set"; # msdos batch file command 132$ds = "/"; # directory separator 133$ps = ":"; # path separator 134$wps = ":"; # path separator, will be set to ';' for windows later. 135$cur_dir = "."; # current directory 136$par_dir = ".."; # parent directory 137$I = " -I"; # include search path 138$L = " -L"; # library search path 139$D = " -D"; # define search path 140$empty = ""; # used as argument 141$warnfile = "warn"; # logfile configure warnings. 142$Warning = ""; # container for warning messages 143$SYSTEM_PYTHON = '@SYSTEM_PYTHON@'; 144$JDK = '@JDK@'; 145$JAVAFLAGS = '@JAVAFLAGS@'; 146$MINGW = '@WITH_MINGWIN@'; # use MinGW for Windows build 147$USE_MINGW = '@USE_MINGW@'; # use MinGW in cygwin or pure-mingw 148if ( $MINGW eq "yes" ) 149{ $CC = '@CC@'; # C compiler 150 $CXX = '@CXX@'; } # C++ compiler 151else 152{ $CC = PathFormat('@CC@'); # C compiler 153 $CXX = PathFormat('@CXX@'); } # C++ compiler 154$FLIPCMD = ""; # Flip '/' to '\' wrapper (only for winnt) 155$GLIBC = ""; # Whether the platform uses glibc 156$PROEXT = "@PROEXT@"; 157$EPM_FLAGS = "--aoo-mode"; 158 159# Required for OS/2 macro expansion 160my @unixroot='@unixroot'; 161 162# 163#-------------------------------------------------------------------- 164# IV. Initialise the warning container and print a note to the user. 165#-------------------------------------------------------------------- 166# 167# Add the configure (pre-requisite) warnings to the warning container 168# , $Warning. 169AddWarning( "configure", "" ); 170# 171print ("Setting up the environment for building Apache OpenOffice $newline"); 172# 173#-------------------------------------------------- 174# V. Setting the environment variables/values. 175#-------------------------------------------------- 176# 177# A. Checking the platform first. 178# 179# get perls idea for OS 180# needed to differentiate cygwin/native perl on windows 181$perl_os = $^O; 182 183# 184# B. Gathering information from the system. 185# 186# 1. Path 187$oldPATH = $ENV{"PATH"}; 188chomp( $oldPATH ); # cut off new line 189# 190# C. Setting the constant values. 191# 192# Setting platform independent constant values. 193print "Setting platform independent values... "; 194# NB: Language options now set at 'ToFile' stage. 195$BMP_WRITES_FLAG = "TRUE"; 196$BUILD_SOSL_RELEASE = "TRUE"; 197$RSC_ONCE = "TRUE"; 198$CALL_CDECL = "TRUE"; 199$COMMON_OUTDIR = ""; 200$common_build = ""; 201$NO_REC_RES = "TRUE"; 202$SO3 = "TRUE"; 203$SOLAR_JAVA = "@SOLAR_JAVA@"; 204$SOLAR_PLUGIN = "TRUE"; 205$UPDATER = "YES"; 206$BUILD_DELIVER = "true"; 207$VCL = "TRUE"; 208$BUILD_SOSL = "true"; 209$ENABLEUNICODE = "TRUE"; 210$NEW_JAR_PACK = "TRUE"; 211$NO_BSYMBOLIC = "TRUE"; 212$comment = "#"; # UNIX script comment character 213$TARFILE_LOCATION = "@TARFILE_LOCATION@"; # where to find tarballs with external sources 214 215# Setting platform dependent constant values. 216if ( $platform =~ m/solaris/ ) 217{ print "Setting Solaris specific values... "; 218 if ($platform =~ m/^i[3456]86/) 219 { 220 if ( $CC =~ "gcc") { 221 $outfile = "SolarisX86GccEnv.Set"; 222 $OUTPATH = "unxsogi"; 223 } else { 224 $outfile = "SolarisX86Env.Set"; 225 $OUTPATH = "unxsoli4"; 226 } 227 $CPU = "I"; 228 $CPUNAME = "INTEL"; 229 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386"; 230 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."xawt"; 231 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; 232 233 } 234 else 235 { 236 if ( $CC =~ "gcc") { 237 $outfile = "SolarisSparcGccEnv.Set"; 238 $OUTPATH = "unxsogs"; 239 } else { 240 $outfile = "SolarisSparcEnv.Set"; 241 $OUTPATH = "unxsols4"; 242 } 243 $CPU = "S"; 244 $CPUNAME = "SPARC"; 245 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc"; 246 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."xawt"; 247 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads"; 248 } 249 250 if ( $CC =~ "gcc") { 251 $CVER = "C300"; 252 } else { 253 $CVER = "C52"; 254 $COMEX = 4; 255 } 256 $BIG_SVX = "TRUE"; 257 $COMPATH = '@COMPATH@'; 258 $GUI = "UNX"; 259 $GUIBASE = "unx"; 260 $GVER = "VCL"; 261 $INPATH = $OUTPATH.$PROEXT; 262 $OS = "SOLARIS"; 263 $PATH_SEPERATOR = $ps; 264} 265elsif ( $platform =~ m/netbsd/ ) 266{ 267#Set platform specific values: 268 if ($platform =~ m/^i[3456]86/) 269 { print "Setting NetBSD x86 specific values... "; 270 $outfile = "NetBSDX86Env.Set"; 271 $CPU = "I"; 272 $CPUNAME = "INTEL"; 273 $OUTPATH = "unxbsdi"; 274 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386"; 275 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client"; 276 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; 277 } 278 elsif ($platform =~ m/^sparc/) 279 { print "Setting NetBSD Sparc specific values... "; 280 $outfile = "NetBSDSparcEnv.Set"; 281 $CPU = "S"; 282 $CPUNAME = "SPARC"; 283 $OUTPATH = "unxbsds"; 284 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc"; 285 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."client"; 286 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads"; 287 } 288 elsif ($platform =~ m/powerpc/) 289 { print "Setting NetBSD PPC specific values... "; 290 $outfile = "NetBSDPPCEnv.Set"; 291 $CPU = "P"; 292 $CPUNAME = "POWERPC"; 293 $OUTPATH = "unxbsdppc"; 294 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; 295 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."classic"; 296 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; 297 } 298 else 299 { print "Unsupported NetBSD architecture: $platform \n"; 300 exit 1; 301 } 302 #Conditional setting depending on gcc3: 303 $CVER = "C300"; 304 $OUTPATH = $OUTPATH."2"; 305 # General NetBSD settings: 306 $BIG_SVX = "TRUE"; 307 $COMPATH = '@COMPATH@'; 308 $GUI = "UNX"; 309 $GUIBASE = "unx"; 310 $GVER = "VCL"; 311 $INPATH = $OUTPATH.$PROEXT; 312 $OS = "NETBSD"; 313 $PATH_SEPERATOR = $ps; 314} 315elsif ( $platform =~ m/kfreebsd/ ) 316{ 317# General GNU/kFreeBSD settings: 318 $CVER = "C341"; 319 $BIG_SVX = "TRUE"; 320 $COMPATH = '@COMPATH@'; 321 $GLIBC = "2REDHAT60"; 322 $GUI = "UNX"; 323 $GUIBASE = "unx"; 324 $GVER = "VCL"; 325 $OS = "LINUX"; 326 $PATH_SEPERATOR = $ps; 327 328#Set platform specific values: 329 if ($platform =~ m/^i[3456]86/) 330 { print "Setting GNU/kFreeBSD x86 specific values... "; 331 $outfile = "GNUkFreeBSDX86Env.Set"; 332 $CPU = "I"; 333 $CPUNAME = "INTEL"; 334 $OUTPATH = "unxkfgi6"; 335 336 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386"; 337 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client"; 338 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; 339 340 } 341 elsif ($platform =~ m/^x86_64/) 342 { print "Setting GNU/kFreeBSD x86-64 specific values... "; 343 $outfile = "GNUkFreeBSDX86-64Env.Set"; 344 $CPU = "X"; 345 $CPUNAME = "X86_64"; 346 $OUTPATH = "unxkfgx6"; 347 348 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64"; 349 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."server"; 350 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads"; 351 } 352 353 $INPATH = $OUTPATH.$PROEXT; 354} 355elsif ( $platform =~ m/freebsd/ ) 356{ $BIG_SVX = "TRUE"; 357 $COMPATH = '@COMPATH@'; 358 $CVER = "C300"; 359 $GUI = "UNX"; 360 $GUIBASE = "unx"; 361 $GVER = "VCL"; 362 $OS = "FREEBSD"; 363 $PATH_SEPERATOR = $ps; 364 $OSVERSION = '@OSVERSION@'; 365 if (($platform =~ m/^amd64/) || ($platform =~ m/^x86_64/)) 366 { my ( $JAVA_OS ); 367 print "Setting FreeBSD AMD64 specific values... "; 368 $outfile = "FreeBSDAMDEnv.Set"; 369 $CPU = "X"; 370 $CPUNAME = "X86_64"; 371 $OUTPATH = "unxfbsdx"; 372 $JAVA_OS = '@JAVA_HOME@'; 373 $JAVA_OS =~ s/.*\///; 374 if ($JAVA_OS =~ m/^linux/) 375 { $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386"; 376 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client"; 377 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; 378 } 379 else 380 { $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64"; 381 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."server"; 382 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads"; 383 } 384 } 385 elsif ($platform =~ m/^i386/) 386 { print "Setting FreeBSD x86 specific values... "; 387 $outfile = "FreeBSDX86Env.Set"; 388 $CPU = "I"; 389 $CPUNAME = "INTEL"; 390 $OUTPATH = "unxfbsdi"; 391 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386"; 392 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client"; 393 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; 394 } 395 elsif ($platform =~ m/^arm.*?l-/) 396 { print "Setting FreeBSD ARM specific values... "; 397 $outfile = "FreeBSDARMEnv.Set"; 398 $CPU = "R"; 399 $CPUNAME = "ARM"; 400 $OUTPATH = "unxfbsdr"; 401 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm"; 402 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."server"; 403 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads"; 404 $EPM_FLAGS = "-a arm"; 405 } 406 elsif (($platform =~ m/^powerpc64/) && ('@SIZEOF_LONG@' eq '8')) 407 { print "Setting FreeBSD PPC64 specific values... "; 408 $outfile = "FreeBSDPPC64Env.Set"; 409 $CPU = "P"; 410 $CPUNAME = "POWERPC64"; 411 $OUTPATH = "unxfbsdppc64"; 412 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64"; 413 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."server"; 414 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads"; 415 } 416 elsif ($platform =~ m/powerpc/) 417 { print "Setting FreeBSD PPC specific values... "; 418 $outfile = "FreeBSDPPCEnv.Set"; 419 $CPU = "P"; 420 $CPUNAME = "POWERPC"; 421 $OUTPATH = "unxfbsdppc"; 422 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; 423 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."client"; 424 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; 425 } 426 else 427 { print "Unsupported FreeBSD architecture: $platform \n"; 428 exit 1; 429 } 430 if( @GCCVER@ >= 30401 ) { 431 $CVER = "C341"; 432 } 433 $INPATH = $OUTPATH.$PROEXT; 434} 435elsif ( $platform =~ m/linux/ ) 436{ 437# General Linux settings: 438 $CVER = "C341"; 439 $BIG_SVX = "TRUE"; 440 $COMPATH = '@COMPATH@'; 441 $GLIBC = "2REDHAT60"; 442 $GUI = "UNX"; 443 $GUIBASE = "unx"; 444 $GVER = "VCL"; 445 $OS = "LINUX"; 446 $PATH_SEPERATOR = $ps; 447 448#Set platform specific values: 449 if ($platform =~ m/^i[3456]86/) 450 { print "Setting Linux x86 specific values... "; 451 $outfile = "LinuxX86Env.Set"; 452 $CPU = "I"; 453 $CPUNAME = "INTEL"; 454 455 if ($JDK =~ m/^[Ii][Bb][Mm]/) 456 { $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."bin"; 457 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."bin".$ds."classic"; 458 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."bin"; } 459 460 elsif ($JDK =~ m/^[Bb][Ee][Aa]/) 461 { $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386"; 462 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."jrockit"; 463 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; } 464 465 else { 466 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386"; 467 # has both server and client 468 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client"; 469 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; 470 } 471 472 $OUTPATH = "unxlngi6"; 473 } 474 elsif ($platform =~ m/^x86_64/) 475 { print "Setting Linux x86-64 specific values... "; 476 $outfile = "LinuxX86-64Env.Set"; 477 $CPU = "X"; 478 $CPUNAME = "X86_64"; 479 $OUTPATH = "unxlngx6"; 480 # Blackdown.org JDK porting project uses `amd64' and `server' in JDK 1.4.2 RC1 481 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64"; 482 # has both server and client 483 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."server"; 484 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads"; 485 } 486 elsif ($platform =~ m/^ia64/) 487 { print "Setting Linux ia64 specific values... "; 488 $outfile = "LinuxIA64Env.Set"; 489 $CPU = "A"; 490 $CPUNAME = "IA64"; 491 $OUTPATH = "unxlnga"; 492 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ia64"; 493 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ia64".$ds."server"; 494 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ia64".$ds."native_threads"; 495 } 496 elsif ($platform =~ m/^sparc/) 497 498 { print "Setting Linux Sparc specific values... "; 499 $outfile = "LinuxSparcEnv.Set"; 500 $CPU = "S"; 501 $CPUNAME = "SPARC"; 502 $OUTPATH = "unxlngs"; 503 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc"; 504 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."server"; 505 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads"; 506 } 507 elsif ($platform =~ m/^powerpc/) 508 { 509 if (($platform =~ m/^powerpc64/) && ('@SIZEOF_LONG@' eq '8')) { 510 print "Setting Linux PPC64 specific values... "; 511 $outfile = "LinuxPPC64Env.Set"; 512 $OUTPATH = "unxlngppc64"; 513 $CPUNAME = "POWERPC64"; 514 515 if ( $JDK eq "gcj" ) { 516 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64"; 517 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."client"; 518 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads"; 519 } 520 } 521 else { 522 print "Setting Linux PPC specific values... "; 523 $outfile = "LinuxPPCEnv.Set"; 524 $OUTPATH = "unxlngppc"; 525 $CPUNAME = "POWERPC"; 526 527 if ( $JDK eq "gcj" ) { 528 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; 529 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."client"; 530 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; } 531 elsif ($JDK =~ m/^[Ii][Bb][Mm]/) 532 { $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; 533 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."classic"; 534 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; 535 } 536 # OpenJDK 537 elsif ($JDK =~ m/sun/) { 538 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; 539 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."server"; 540 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; 541 } 542 } 543 544 $CPU = "P"; 545 546 } 547 elsif ($platform =~ m/^s390/) 548 { 549 if (($platform =~ m/^s390x/) && ('@SIZEOF_LONG@' eq '8')) { 550 print "Setting Linux zSeries specific values... "; 551 $outfile = "LinuxS390XEnv.Set"; 552 $CPUNAME = "S390X"; 553 $ARCH = "s390x"; 554 $OUTPATH = "unxlngs390x"; 555 } 556 else { 557 print "Setting Linux S/390 specific values... "; 558 $outfile = "LinuxS390Env.Set"; 559 $CPUNAME = "S390"; 560 $ARCH = "s390"; 561 $OUTPATH = "unxlngs390"; 562 } 563 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH; 564 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH.$ds."server"; 565 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH.$ds."native_threads"; 566 $CPU = "3"; 567 } 568 elsif ($platform =~ m/^m68k/) 569 { print "Setting Linux m68k specific values... "; 570 $outfile = "LinuxM68KEnv.Set"; 571 $CPU = "6"; 572 $CPUNAME = "M68K"; 573 $OUTPATH = "unxlngm68k"; 574 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."m68k"; 575 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."m68k".$ds."server"; 576 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."m68k".$ds."native_threads"; 577 } 578 elsif ($platform =~ m/^hppa/) 579 { print "Setting Linux hppa specific values... "; 580 $outfile = "LinuxHPPAEnv.Set"; 581 $CPU = "H"; 582 $CPUNAME = "HPPA"; 583 $OUTPATH = "unxlnghppa"; 584 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."hppa"; 585 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."hppa".$ds."server"; 586 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."hppa".$ds."native_threads"; 587 $EPM_FLAGS = "-a hppa"; 588 } 589 elsif ($platform =~ m/^alpha/) 590 { print "Setting Linux Alpha specific values... "; 591 $outfile = "LinuxAlphaEnv.Set"; 592 $CPU = "L"; 593 $CPUNAME = "AXP"; 594 $OUTPATH = "unxlngaxp"; 595 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha"; 596 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha".$ds."server"; 597 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha".$ds."native_threads"; 598 } 599 elsif ($platform =~ m/^arm.*?l-/) 600 { print "Setting Linux ARM specific values... "; 601 $outfile = "LinuxARMEnv.Set"; 602 $CPU = "R"; 603 $CPUNAME = "ARM"; 604 $OUTPATH = "unxlngr"; 605 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm"; 606 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."server"; 607 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads"; 608 $EPM_FLAGS = "-a arm"; 609 } 610 elsif ($platform =~ m/^mips/) 611 { print "Setting Linux MIPS specific values... "; 612 $outfile = "LinuxMIPSEnv.Set"; 613 $CPU = "M"; 614 $CPUNAME = "GODSON"; 615 $OUTPATH = "unxlngmips"; 616 617 if ('@SIZEOF_LONG@' eq '8') { 618 if ('@WORDS_BIGENDIAN@' ne 'yes') { 619 $EPM_FLAGS = "-a mips64el"; 620 if ( $JDK eq "gcj" ) { 621 $ARCH = "mips64el"; 622 } 623 } 624 else { 625 $ARCH = "mips64"; 626 } 627 } 628 else { 629 if ('@WORDS_BIGENDIAN@' ne 'yes') { 630 $EPM_FLAGS = "-a mipsel"; 631 if ( $JDK =~ m/sun/ && -d "@JAVA_HOME@".$ds."jre".$ds."lib".$ds."mips32" ) { 632 $ARCH = "mips32"; # Lemote 633 } else { 634 $ARCH = "mipsel"; 635 } 636 } 637 else { 638 $ARCH = "mips"; 639 } 640 } 641 642 $JRELIBDIR = '$JAVA_HOME'.$ds."lib".$ds.$ARCH; 643 if ( $JDK =~ m/sun/ && -d "@JAVA_HOME@".$ds."jre".$ds."lib".$ds."mips32" ) { 644 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."lib".$ds.$ARCH.$ds."client"; # Lemote 645 } else { 646 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."lib".$ds.$ARCH.$ds."server"; 647 } 648 $JRETHREADDIR = '$JAVA_HOME'.$ds."lib".$ds.$ARCH.$ds."native_threads"; 649 } 650 651 652 $INPATH = $OUTPATH.$PROEXT; 653} 654elsif ( $platform =~ m/osf1/ ) 655{ print "Setting Tru64 specific values... "; 656 $outfile = "Tru64AlphaEnv.Set"; 657 $BIG_SVX = "TRUE"; 658 $COMPATH = '@COMPATH@'; 659 $CPU = "A"; 660 $CPUNAME = "ALPHA_"; 661 $CVER = "C62"; 662 $GUI = "UNX"; 663 $GUIBASE = "unx"; 664 $GVER = "VCL"; 665 $OUTPATH = "unxt64"; 666 $INPATH = $OUTPATH.$PROEXT; 667 $OS = "TRU64"; 668 $PATH_SEPERATOR = $ps; 669 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha"; 670 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha".$ds."client"; 671 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha".$ds."native_threads"; 672} 673elsif ( $platform =~ m/cygwin/ ) 674{ 675 $MSPDB_PATH = PathFormat('@MSPDB_PATH@'); 676 $MIDL_PATH = PathFormat('@MIDL_PATH@'); 677 $CSC_PATH = PathFormat('@CSC_PATH@'); 678 $PSDK_HOME = PathFormat('@PSDK_HOME@'); 679 $DIRECTXSDK_LIB = PathFormat('@DIRECTXSDK_LIB@'); 680 $USE_DIRECTX5 = ""; 681 $FRAME_HOME = PathFormat('@FRAME_HOME@'); 682 $USE_NEW_SDK = "TRUE"; 683 $GUI = "WNT"; 684 $GUIBASE = "WIN"; 685 $GVER = "NT351"; 686 $OS = "WNT"; 687 $DYNAMIC_CRT = "TRUE"; 688 $SET_EXCEPTIONS = "TRUE"; 689 $use_shl_versions = "TRUE"; 690 $wps = ';'; # Windows style path seperator 691 if ( $MINGW eq "yes" ) 692 { 693 print "Setting Windows NT cygwin MinGW specific values... "; 694 $FLIPCMD = "slfl.pl"; 695 $PATH_SEPERATOR = ';'; 696 $outfile = "winmingw.set"; 697 $COMPATH = PathFormat('@COMPATH@/bin'); 698 $COMPATH =~ s/\/bin$//i; 699 $CPUNAME = "INTEL"; 700 $CPU = "I"; 701 $CVER = "C341"; 702 $OUTPATH = "wntgcci"; 703 $ATL_INCLUDE = '$SOLARVER'.$ds.'$INPATH'.$ds."inc".$ds."external".$ds."mingw".$ds."include".$ds."atl". " ".'$PSDK_HOME'.$ds."include".$ds."atl"; 704 } 705 else # The MSVC section starts here 706 { 707 $COMPATH = PathFormat('@COMPATH@'); 708 $CXX_X64_BINARY = PathFormat('@COMPATH@/bin/amd64/cl.exe'); 709 $LINK_X64_BINARY = PathFormat('@COMPATH@/bin/amd64/link.exe'); 710 $LIBMGR_X64_BINARY = PathFormat('@COMPATH@/bin/amd64/lib.exe'); 711 $COMEX = '@COMEX@'; 712 if ( "@COMEX@" eq "10" ) { # .NET 2003 needs M1310 713 $CVER = "M1310"; 714 } elsif ( "@COMEX@" ge "11" ) { # .NET 2005 needs M1400 715 if ( "@COMEX@" eq "11" ) { 716 $CVER = "M1400"; 717 } elsif ( "@COMEX@" eq "12" ) { 718 $CVER = "M1500"; 719 } else { # Unsupported 720 die "Unsupported value for COMEX variable.\n"; 721 } 722 } 723 # No special treatment for CC and CXX anymore. 724 $FLIPCMD = "slfl.pl"; 725 $PATH_SEPERATOR = ';'; 726 if ( $platform =~ m/^i[3456]86/ || ( ( $platform =~ m/^x86_64/ ) && ( "@BUILD_WIN64@" ne "TRUE" ) ) ) { 727 print "Setting Windows x86 build with bash shell specific values... "; 728 $outfile = "winenv.set"; 729 $CPU = "I"; 730 $CPUNAME = "INTEL"; 731 $OUTPATH = "wntmsci@COMEX@"; 732 } elsif ( $platform =~ m/^x86_64/ ) { 733 print "Setting Windows x86_64 build with bash shell specific values... "; 734 $outfile = "winAMD64Env.set"; 735 $CPU = "X"; 736 $CPUNAME = "X86_64"; 737 $OUTPATH = "wntmscx@COMEX@"; 738 } else { 739 print "Unsupported Windows architecture: $platform \n"; 740 exit 1; 741 } 742 } 743 $INPATH = $OUTPATH.$PROEXT; 744} 745elsif ( $platform =~ m/os2/ ) 746{ 747 $COMPATH = PathFormat('@COMPATH@'); 748 $MSPDB_PATH = PathFormat('@MSPDB_PATH@'); 749 $MIDL_PATH = PathFormat('@MIDL_PATH@'); 750 $CSC_PATH = PathFormat('@CSC_PATH@'); 751 $PSDK_HOME = PathFormat('@PSDK_HOME@'); 752 $FRAME_HOME = PathFormat('@FRAME_HOME@'); 753 $USE_NEW_SDK = "TRUE"; 754 $CPUNAME = "INTEL"; 755 $CPU = "I"; 756 $GUI = "OS2"; 757 $GUIBASE = "os2"; 758 $GVER = "VCL"; 759 $OS = "OS2"; 760 $DYNAMIC_CRT = "TRUE"; 761 $SET_EXCEPTIONS = "TRUE"; 762 $use_shl_versions = "TRUE"; 763 { 764 print "Setting OS/2 gcc 3.3.5 specific values... \n"; 765 $outfile = "os2env.set"; 766 $CVER = "C300"; 767 $OUTPATH = "os2gcci"; 768 $INPATH = $OUTPATH.$PROEXT; 769 $COMEX = '@COMEX@'; 770 771 { print "Setting OS/2 with 4OS2 specific values... "; 772 # Change path to lower case. 773 $COMPATH = lc $COMPATH; 774 $PATH_SEPERATOR = ';'; 775 $ps = ';'; 776 $wps = ';'; # Windows style path seperator 777 } 778 779 } 780} 781elsif ( $platform =~ m/darwin/ ) 782{ print "Setting Mac OS X/Darwin specific values... "; 783 $BIG_SVX = "TRUE"; 784 $COMPATH = '@COMPATH@'; 785 print "Darwin platform = " . $platform ." "; 786 if( $CC =~ "gcc" ) 787 { 788 print "Setting values for MacOSX/Darwin for Xcode<=3"; 789 $outfile = "MacOSXX86Env.Set"; 790 $CPU = "I"; 791 $CPUNAME = "INTEL"; 792 $OUTPATH = "unxmacxi"; 793 } 794 elsif ($platform =~ m/^i[3456]86/) 795 { 796 print "Setting values for MacOSX/Darwin on x86_32... "; 797 $outfile = "MacOSXX32Env.Set"; 798 $CPU = "I"; 799 $CPUNAME = "INTEL"; 800 $OUTPATH = "unxmacci"; 801 } 802 elsif ($platform =~ m/^x86_64/) 803 { 804 print "Setting values for MacOSX/Darwin on x86_64... "; 805 $outfile = "MacOSXX64Env.Set"; 806 $CPU = "X"; 807 $CPUNAME = "X86_64"; 808 $OUTPATH = "unxmaccx"; 809 } 810 else 811 { 812 print "\nset_soenv: Unknown MacOSX/Darwin platform: $platform\n"; 813 exit 1; 814 } 815 $CVER = "DUMMY_CVER"; 816 $GUI = "UNX"; 817 $GVER = "VCL"; 818 $INPATH = $OUTPATH.$PROEXT; 819 $OS = "MACOSX"; 820 $PATH_SEPERATOR = $ps; 821 $GUIBASE = "aqua" 822} 823elsif ( $platform =~ m/aix/ ) 824{ 825 if( $platform !~ m/^powerpc/ ) 826 { 827 print "\nAIX has only been ported and tested on powerpc\n"; 828 AddWarning( "set_soenv", "Platform $platform has not been tested"); 829 } 830 print "Setting AIX PPC specific values... "; 831 $outfile = "aixPPCEnv.Set"; 832 $CPU = "P"; 833 $CPUNAME = "POWERPC"; 834 $OUTPATH = "unxlngppc"; 835 $JRELIBDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc"; 836 $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."classic"; 837 $JRETHREADDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; 838 $BIG_SVX = "TRUE"; 839 $CVER = "C300"; 840 $COMPATH = '@COMPATH@'; 841 $GUI = "UNX"; 842 $GUIBASE = "unx"; 843 $GVER = "VCL"; 844 $INPATH = $OUTPATH.$PROEXT; 845 $OS = "AIX"; 846 $PATH_SEPERATOR = $ps; 847} 848else { 849 print "\nset_soenv: Cannot figure out what platform you are running\n"; 850 print "For $platform.\n"; 851 exit 1; 852} 853 854if ( $CPUNAME eq "X86_64") { 855 $ALIGN = "NEED_ALIGN16"; 856} 857else { 858 $ALIGN = "NEED_ALIGN8"; 859} 860 861print "done\n"; 862 863# 864# D. Gathering directory information from the user. 865# 866# If the directory does not exist something is strange. 867# 1. Apache OpenOffice build home directory. 868chomp($SRC_ROOT = `pwd`); 869$SRC_ROOT =~ s/\/config_office//; 870$SRC_ROOT = PathFormat($SRC_ROOT); 871CheckPathExist( $SRC_ROOT ); 872 873 874#----------------------------------------------------------------------------------------------------- 875# Copy top level makefile from config_office/ to $SRC_ROOT 876#----------------------------------------------------------------------------------------------------- 877if (! -e "makefile.rc") 878{ AddWarning( "set_soenv", "makefile.rc not found in config_office/. Could not copy to SRC_ROOT." ); 879} 880else 881{ `cp -f makefile.rc $SRC_ROOT/makefile.mk`; 882} 883 884# 2. Java home directory. 885# JAVA_HOME as argument from autoconf. 886$JAVA_HOME = PathFormat('@JAVA_HOME@') ; 887 888if ( $platform =~ m/cygwin|os2/ ) { 889 $JAVA_HOME =~ s/[\s\/]+$//; # remove trailing \n or \/ if there is any. 890} 891# 3. shell path. 892if ( $platform =~ m/os2/ ) 893{ 894$OOO_SHELL = 'sh'; 895} 896else 897{ 898$OOO_SHELL = '@SHELLPATH@'."\/bash"; 899} 900 901# ml.exe assembler path for Windows users. 902if ($platform =~ m/cygwin/) 903{ $ASM_PATH = PathFormat('@ASM_HOME@'); 904} 905 906# nasm.exe assembler path for Windows users. 907if ($platform =~ m/cygwin/) 908{ $NASM_PATH = PathFormat('@NASM_HOME@'); 909} 910 911# 912# E. Determining the environment values based on the information 913# that was gathered earlier on. 914# 915print "Setting the environment variables... "; 916$USR = $ds."usr"; 917$ETC = $ds."etc"; 918$BIN = $ds."bin"; 919$LIB = $ds."lib"; 920$LIB64 = $ds."lib"; 921$LIB64 .= "64" 922if ($platform =~ m/x86_64-.*-linux/); 923$LIB64 .= "64" 924if (($platform =~ m/powerpc64-.*-linux/) && ('@SIZEOF_LONG@' eq '8')); 925$LIB64 .= "64" 926if (($platform =~ m/s390x-.*-linux/) && ('@SIZEOF_LONG@' eq '8')); 927$INC = $ds."inc"; 928$INCLUDE = $ds."include"; 929$DEV = $ds."dev"; 930$OPT = $ds."opt"; 931$LOCAL = $ds."local"; 932$SOLENV = $ds."solenv"; 933$SOLVER = $ds."solver"; 934$CONFIG = $ds."config"; 935$USR_BIN = $USR.$BIN; 936$USR_LIB = $USR.$LIB64; 937$USR_LOCAL = $USR.$ds."local"; 938$USR_CCS = $USR.$ds."ccs"; 939$USR_OPENWIN = $USR.$ds."openwin"; 940$USR_DT = $USR.$ds."dt"; 941$COMMON_BUILD_TOOLS = '$SRC_ROOT'.$ds."external".$ds."common"; 942 943# Generate alternate output file for sh? 944$outfile_sh = $outfile.".sh"; 945 946if ($GUI eq "OS2") 947{ 948 # Generate output file for 4os2? 949 $outfile_bat = $outfile; 950 $outfile_bat =~ s/set$/cmd/i; 951} 952 953# Windows NT only variables 954if ($platform =~ m/cygwin/) 955{ 956 if ( $JAVA_HOME ne "" ) 957 { 958 $JAVA_LIB = $JAVA_HOME.$LIB; 959 } 960 # Import SystemDrive environment variable 961 use Env qw(SYSTEMDRIVE); 962 # Change $SYSTEMDRIVE to lower case. 963 $SYSTEMDRIVE = lc $SYSTEMDRIVE; 964 use Env qw(SYSTEMROOT); 965 $CYGWIN_PATH = PathFormat('@CYGWIN_PATH@'); # Windows bash path 966 $WIN_GREP = '$CYGWIN_PATH'.$ds."grep.exe"; 967 $WIN_FIND = '$CYGWIN_PATH'.$ds."find.exe"; 968 $WIN_LS = '$CYGWIN_PATH'.$ds."ls.exe"; 969 $WIN_GNUCOPY = '$CYGWIN_PATH'.$ds."cp.exe"; 970 $WIN_TOUCH = '$CYGWIN_PATH'.$ds."touch.exe"; 971} 972 973if ( $JAVA_HOME ne "" ) 974{ 975 $JAVA_BIN = $JAVA_HOME.$BIN; 976 $JAVA_INCLUDE = $JAVA_HOME.$ds."include"; 977} 978 979 980$PERL = PathFormat('@PERL@'); # Perl program 981$PERL_PATH = dirname('@PERL@'); # Perl Path 982$XLIB = PathFormat('@XLIB@'); # X11 libraries 983$XINC = PathFormat('@XINC@'); # X11 includes 984 985# YD disable autodetection, use PATH 986if ( $platform =~ m/os2/ ) 987{ 988 $PERL = 'perl'; 989 $PERL_PATH = ''; 990} 991 992# The project's workstamp. 993$WORK_STAMP = "@SOURCEVERSION@"; 994# Location of the source. 995$SOLARSRC = '$SRC_ROOT'; 996# Location of the repository. 997my @splitlist = split( /\//, $SRC_ROOT ); 998pop @splitlist; 999$SOURCE_ROOT_DIR = join("/", @splitlist); 1000 1001# default TARFILE_LOCATION 1002if ('@TARFILE_LOCATION@' eq "DEFAULT") 1003{ $TARFILE_LOCATION="$SOURCE_ROOT_DIR/ext_sources"; 1004} 1005 1006# 1007$DEVROOT = '$SRC_ROOT'; 1008# Set solenv and solver to given or default values. 1009# Location of the solenv tree. 1010if ('@LOCAL_SOLENV@' eq "DEFAULT") 1011{ $SOLARENV = $SRC_ROOT.$SOLENV; 1012} 1013else 1014{ $SOLARENV = PathFormat('@LOCAL_SOLENV@'); 1015} 1016# Location of the solver tree. 1017if ('@LOCAL_SOLVER@' eq "DEFAULT") 1018{ $SOLARVER = $SRC_ROOT.$SOLVER.$ds.$UPD; 1019} 1020else 1021{ $SOLARVER = PathFormat('@LOCAL_SOLVER@').$ds.$UPD; 1022} 1023#Location of Solar version. 1024$SOLARVERSION = '$SOLARVER'; 1025 1026#Location of gnu make directories. 1027$WORKDIR = '$SOLARVER/$INPATH/workdir'; 1028$OUTDIR = '$SOLARVER/$INPATH'; 1029 1030$SOLARENVINC = '$SOLARENV'.$INC; 1031# Location of 1032$LOCALINI = '$SOLARENV'.$CONFIG; 1033# Location of 1034$STAR_INIROOT = '$SOLARENV'.$CONFIG; 1035# Location of 1036$STAR_INIROOTOLD = '$SOLARENV'.$CONFIG; 1037# Location of 1038$STAR_STANDLST = '$SOLARENV'.$CONFIG.$ds."stand.lst"; 1039# Location of 1040$STAR_SSCOMMON = '$SOLARENV'.$CONFIG.$ds."ssolar.cmn"; 1041# Location of 1042$STAR_SSOLARINI = '$SOLARENV'.$CONFIG.$ds."ssolar.ini"; 1043# Location of dmake resource. 1044$DMAKEROOT = '$SOLARENVINC'.$ds."startup"; 1045# Location of JDK classes .zip file. 1046# but in jdk 1.2 it is called rt.jar and it lives in jre/lib 1047$CLASSPATH = '$JAVA_HOME'.$ds.'jre'.$LIB.$ds."rt.jar".$wps.'.'; 1048# Location of the JDK supported standard classes.zip file. 1049# see above for why the change 1050$XCLASSPATH = '$JAVA_HOME'.$ds.'jre'.$LIB.$ds."rt.jar".$wps.'.'; 1051 1052# Location used by the linker to create libraries. 1053if ($platform =~ m/solaris/) 1054{ $SOLAREXTRALIB = $L.$par_dir.$LIB. 1055 $L.'$SOLARENV'.$ds.'$OUTPATH'.$ds."lib.solaris.2.6". 1056 $L.$LIB. 1057 $L.$USR.$LIB. 1058 $L.$USR.$LOCAL.$LIB. 1059 $L.$USR_DT.$LIB. 1060 $L.$USR_OPENWIN.$LIB; 1061} 1062elsif ($platform =~ m/linux|netbsd|osf1|freebsd|aix/) 1063{ 1064 $SOLAREXTRALIB = $L.$par_dir.$LIB64; 1065} 1066elsif ($platform =~ m/darwin/) 1067{ $SOLAREXTRALIB = $L.$LIB. 1068 $L.$USR.$LIB; 1069} 1070elsif ($platform !~ m/cygwin|os2/ ) 1071{ AddWarning( "set_soenv", "$platform not configured for linkage create libraries" ); 1072} 1073 1074# Windows NT only variables 1075if ($platform =~ m/cygwin|os2/) 1076{ $COMP_ENV = $OUTPATH; 1077 1078 $JAVAHOME = '$JAVA_HOME'; 1079 1080 $ILIB = $cur_dir; 1081 1082 # Mingw is different 1083 if ( "@COM@" eq "MSC" ) 1084 { $ILIB .= $wps.$SOLARVER.$ds.$INPATH.$LIB. 1085 $wps.$JAVA_HOME.$LIB; 1086 if ( ( $CPUNAME eq "INTEL" ) || ( ( $CPUNAME eq "X86_64" ) && ( "@BUILD_WIN64@" ne "TRUE" ) ) ) { 1087 $ILIB .= $wps.$PSDK_HOME.$LIB. 1088 $wps.$FRAME_HOME.$LIB. 1089 $wps.$COMPATH.$LIB; 1090 } elsif ( $CPUNAME eq "X86_64" ) { 1091 $ILIB .= $wps.$PSDK_HOME.$LIB.$ds."x64". 1092 $wps.$FRAME_HOME.$LIB. 1093 $wps.$COMPATH.$LIB.$ds."amd64"; 1094 } else { 1095 print "Unsupported Windows CPU: $CPUNAME\n"; 1096 exit 1; 1097 } 1098 if ( '@ENABLE_DIRECTX@' ne "" ) { 1099 # We may have DirectX but not DirectDraw 1100 if ( '@ENABLE_DIRECT_DRAW@' ne "") { 1101 $ILIB .= $wps.$DIRECTXSDK_LIB; 1102 if ( '@COMEX@' eq "10" ) { 1103 # .NET2003 provides and compiles against DirectX 5 libraries and is 1104 # hereby still Win9x compatible. 1105 $ILIB .= $wps.'$COMPATH'.$ds.'PlatformSDK'.$LIB; 1106 $USE_DIRECTX5 = "YES"; 1107 } 1108 } 1109 } 1110 # ILIB needs to use '\' directory seperators; 1111 $ILIB = WinPath( $ILIB, ";" ); 1112 } 1113 elsif ( "@COM@" eq "GCC" ) 1114 { $ILIB .= $wps.$SOLARVER.$ds.$INPATH.$LIB. 1115 $wps.$SOLARVER.$ds.$INPATH.$BIN. 1116 $wps.$JAVA_HOME.$LIB; 1117 if ( $USE_MINGW eq "cygwin" ) 1118 { $ILIB .= $wps.PathFormat($USR.$LIB.$ds."mingw"). 1119 $wps.PathFormat($USR.$LIB.$ds."w32api"); 1120 } 1121 else 1122 { $ILIB .= $wps.$COMPATH.$LIB; 1123 } 1124 $ILIB .= $wps.PathFormat("@MINGW_CLIB_DIR@"). 1125 $wps.$PSDK_HOME.$LIB; 1126 if ( '@ENABLE_DIRECTX@' ) 1127 { $ILIB .= $wps.PathFormat("@DIRECTXSDK_LIB@"); 1128 } 1129 } 1130 1131 $JAVAHOME = '$JAVA_HOME'; 1132 1133} 1134 1135# The general environment path. 1136if ($platform =~ m/linux|netbsd|odf1|freebsd|aix|solaris/) 1137{ $PATH = '$SOLARENV'.$ds.'$INPATH'.$BIN. 1138 $ps.'$SOLARENV'.$BIN; 1139 1140 if ($platform =~ m/solaris/) { 1141 $PATH .= $ps.$USR_CCS.$BIN; 1142 } 1143 1144 $PATH .= $ps.$oldPATH; 1145 1146 my @javaBits; 1147 if (( $JAVA_HOME ne "" ) && ( $JDK ne "gcj" )) { 1148 @javaBits = ( '$JAVA_HOME'.$BIN, 'javac' ); 1149 } else { 1150 @javaBits = (); 1151 } 1152 my $ccdir = "@CC_PATH@"; 1153 $ccdir =~ s/\/$//; 1154 $PATH = GetCorrectPath ($PATH, 1155 $ccdir, $CC, 1156 $PERL_PATH, 'perl', 1157 @javaBits); 1158} 1159 1160elsif ($platform =~ m/cygwin/) 1161{ # The PATH variable is completely created from scratch. Elements 1162 # from oldPATH that are not yet included are appended to PATH at 1163 # the end. 1164 1165 my ( $tmppath ); 1166 1167 $PATH = CygFormat($SOLARENV).$ds."bin". 1168 $ps.CygFormat($SOLARENV).$ds.$INPATH.$BIN; 1169 1170 if ( $JAVA_HOME ne "" ) 1171 { 1172 # hack either "hotspot" or "client" should be used, depending on the jdk version: 1173 # 1.2.x - no such directory, unsupported 1174 # 1.3.x - hotspot, client missing 1175 # 1.4.x - client, hotspot missing 1176 1177 $PATH .= $ps.CygFormat($JAVA_HOME).$BIN; 1178 if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot" ) { 1179 $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."hotspot"; 1180 } 1181 if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."client" ) { 1182 $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."client"; 1183 } 1184 } 1185 1186 # Add path to compiler 1187 if ( "@COM@" eq "MSC" ) { 1188 if ( ( $CPUNAME eq "INTEL" ) || ( ( $CPUNAME eq "X86_64") && ( "@BUILD_WIN64@" ne "TRUE" ) ) ) { 1189 $tmppath = CygFormat($COMPATH).$BIN; 1190 } elsif ( $CPUNAME eq "X86_64" ) { 1191 $tmppath = CygFormat($COMPATH).$BIN.$ds."amd64"; 1192 } else { 1193 print "Unsupported Windows CPU: $CPU\n"; 1194 exit 1; 1195 } 1196 $tmppath =~ s/^\/\//\//; 1197 $PATH .= $ps.$tmppath; 1198 1199 $tmppath = CygFormat($MSPDB_PATH); 1200 # for .NET to find mspdb71.dll (needed by CL.EXE C/C++ Compiler) 1201 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1202 $PATH .= $ps.$tmppath; 1203 } 1204 if ( ( $COMEX ge "10" ) ) { 1205 # .NET needs midl.exe 1206 $tmppath = CygFormat($MIDL_PATH); 1207 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1208 $PATH .= $ps.$tmppath; 1209 } 1210 # .NET needs csc.exe 1211 $tmppath = CygFormat($CSC_PATH); 1212 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1213 $PATH .= $ps.$tmppath; 1214 } 1215 # Native installer needs some files if the Windows Installer SDK 1216 $tmppath = CygFormat($PSDK_HOME); 1217 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) { 1218 $PATH .= $ps.$tmppath.$BIN; 1219 } 1220 } 1221 } else { # Mingw is different 1222 $tmppath = CygFormat($COMPATH).$BIN; 1223 $tmppath =~ s/^\/\//\//; 1224 $PATH .= $ps.$tmppath; 1225 1226 # Native installer needs some files if the Windows Installer SDK 1227 $tmppath = CygFormat($PSDK_HOME); 1228 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) { 1229 $PATH .= $ps.$tmppath.$BIN; 1230 } 1231 } 1232 1233 if ( $ASM_PATH ne "ASM_IN_PATH" ) 1234 { $PATH .= $ps.CygFormat($ASM_PATH); 1235 } 1236 if ( $NASM_PATH ne "NASM_IN_PATH" && $NASM_PATH ne "NO_NASM_HOME" && $NASM_PATH ne "" ) 1237 { $PATH .= $ps.CygFormat($NASM_PATH); 1238 } 1239 # zip.exe / unzip.exe path for Windows users. 1240 my $zip_home_path = PathFormat('@ZIP_HOME@'); 1241 $tmppath = CygFormat($zip_home_path); 1242 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1243 $PATH .= $ps.$tmppath; 1244 } 1245 1246 # Possible cygwin paths must follow behind the AOO and MS paths 1247 1248 # Check if $PERL_PATH is already set in PATH 1249 $tmppath = CygFormat($PERL_PATH); 1250 if ( ! ( $PATH =~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) ) 1251 { 1252 $PATH .= $ps.$tmppath; 1253 } 1254 # Check if $CYGWIN_PATH is already set in PATH 1255 $tmppath = CygFormat($CYGWIN_PATH); 1256 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1257 $PATH .= $ps.$tmppath; 1258 } 1259 # nsis path for Windows users. 1260 $NSIS_PATH = PathFormat('@NSIS_PATH@'); 1261 $tmppath = CygFormat($NSIS_PATH); 1262 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1263 $PATH .= $ps.$tmppath; 1264 } 1265 # path to sn.exe (signing) for Windows users. 1266 my $sn_path = PathFormat('@FRAME_HOME@/bin'); 1267 $tmppath = CygFormat($sn_path); 1268 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1269 $PATH .= $ps.$tmppath; 1270 } 1271 1272 1273 # Add the rest of the original path if it is still missing. 1274 if (($^O eq "cygwin")) { # Not for ActiveState perl 1275 my $expandedPATH = $PATH; 1276 $expandedPATH =~ s/(\$\w+)/$1/eeg; 1277 1278 # fix situations where PATH may look like /bin:"C:\blah\bleh":/ugh 1279 my $fixedPATH = $oldPATH; 1280 if ( $oldPATH =~ /"/ ) { 1281 $fixedPATH = ""; 1282 foreach my $pathentry ( split( '"',$oldPATH ) ) { 1283 if ( ( $pathentry =~ /^$ps/ ) || ( $pathentry =~ /$ps$/ ) ) { 1284 $fixedPATH .= $pathentry; 1285 } else { 1286 chomp( $pathentry = qx{cygpath -d "$pathentry"} ) ; 1287 chomp( $pathentry = qx{cygpath -u "$pathentry"} ) ; 1288 $fixedPATH .= $pathentry; 1289 } 1290 } 1291 } 1292 1293 foreach my $pathentry (split($ps,$fixedPATH)) { 1294 if ( ! ( $expandedPATH =~ /(?:$ps|\A)(?:$pathentry)(?:$ps|\Z)/ ) ) { 1295 $PATH .= $ps.$pathentry; 1296 $expandedPATH .= $ps.$pathentry; 1297 } 1298 } 1299 } else { 1300 $PATH .= $ps.$oldPATH; 1301 } 1302 1303 # The path now is in cygwin posix format 1304 1305} 1306 1307elsif ($platform =~ m/os2/) 1308{ # The PATH variable is completely created from scratch. Everything that is not 1309 # needed is appended to the end. 1310 1311 $PATH = '$SOLARENV'.$ds."bin". 1312 $ps.'$SOLARENV'.$ds.'$INPATH'.$BIN; 1313 1314 if ( $JAVA_HOME ne "" ) 1315 { 1316 # hack either "hotspot" or "client" should be used, depending on the jdk version: 1317 # 1.2.x - no such directory, unsupported 1318 # 1.3.x - hotspot, client missing 1319 # 1.4.x - client, hotspot missing 1320 1321 $PATH .= $ps.$JAVA_HOME.$BIN; 1322 if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot" ) { 1323 $PATH .= $ps.$JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot"; 1324 } 1325 if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."client" ) { 1326 $PATH .= $ps.$JAVA_HOME.$ds."jre".$ds."bin".$ds."client"; 1327 } 1328 } 1329 1330 if ( '@ANT_HOME@' ne '' ) 1331 { 1332 $PATH .= $ps.'@ANT_HOME@/bin'; 1333 } 1334 1335 # Append old PATH 1336 my $temp = $oldPATH; 1337 $temp =~ s/\\/\//g ; 1338 $PATH .= $ps.$temp; 1339} 1340 1341elsif ($platform =~ m/darwin/) 1342{ $PATH = '$SOLARENV'.$ds.'$INPATH'.$BIN. 1343 $ps.'$SOLARENV'.$BIN; 1344 1345 # Append old PATH 1346 $PATH .= $ps.$oldPATH; 1347} 1348else 1349{ AddWarning( "set_soenv", "$platform not configured for general environment paths" ); 1350} 1351 1352# Linker library search directory paths. 1353if ($platform =~ m/solaris/) 1354{ $SOLARLIB = $L.$par_dir.$LIB. 1355 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB. 1356 $L.'$SOLARVER'.$ds.'$INPATH'.$LIB. 1357 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB. 1358 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB."solaris.2.6". 1359 $L.$LIB. 1360 $L.$USR_LIB; 1361 if ( $CC =~ "gcc" ) { 1362 $SOLARLIB .= $L.$COMPATH.$LIB; 1363 } 1364 $SOLARLIB .= $L.$USR_LOCAL.$LIB. 1365 $L.$USR_DT.$LIB. 1366 $L.$USR_OPENWIN.$LIB. 1367 $L.'$JAVA_HOME'.$LIB. 1368 $L.$JRELIBDIR. 1369 $L.$JRETOOLKITDIR. 1370 $L.$JRETHREADDIR. 1371 $L.$XLIB; 1372} 1373elsif ($platform =~ m/linux|netbasd|osf1|aix|freebsd/) 1374{ $SOLARLIB = $L.$par_dir.$LIB. 1375 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB. 1376 $L.'$SOLARVER'.$ds.'$INPATH'.$LIB. 1377 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB. 1378 $L.'$JAVA_HOME'.$LIB64. 1379 $L.$JRELIBDIR. 1380 $L.$JRETOOLKITDIR. 1381 $L.$JRETHREADDIR. 1382 $L.$XLIB; 1383} 1384elsif ($platform =~ m/cygwin|os2/) 1385{ $SOLARLIB = $L.'$SOLARVER'.$ds.'$INPATH'.$LIB. 1386 $L.$par_dir.$LIB. 1387 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB; 1388} 1389elsif ($platform =~ m/darwin/) 1390{ $SOLARLIB = $L.'$SOLARVER'.$ds.'$INPATH'.$LIB. 1391 $L.$USR_LIB; 1392 # [ed] 6/15/02 Add in X11 libraries onto the library path 1393 if ($GUIBASE eq "unx") { 1394 $SOLARLIB .= $L.$XLIB; 1395 } 1396 1397} 1398 1399 1400# Location of the compiler include search directory paths. 1401$SOLARINC = $I.$cur_dir. 1402 $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."stl". 1403 $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."external". 1404 $I.'$SOLARVER'.$ds.'$INPATH'.$INC. 1405 $I.'$SOLARENV'.$ds.'$OUTPATH'.$INC. 1406 $I.'$SOLARENV'.$INC. 1407 $I.'$SRC_ROOT'.$ds."res". 1408 $I.'$SRC_ROOT'.$ds."tools".$INC. 1409 $I.'$SRC_ROOT'.$ds."comphelper".$INC; 1410 1411if ($platform =~ m/solaris|linux|osf1|freebsd|netbsd/) 1412{ 1413if ($platform =~ m/linux|freebsd|netbsd/) 1414{ 1415# This simply adds an include path, so even cases that break the FHS work 1416} 1417if ($platform =~ m/solaris/ && ! $CC =~ "gcc") 1418{ 1419$SOLARINC .= '/SC5 '; 1420} 1421# Platform dependent include path at the top of this list of include paths 1422if ($platform =~ m/solaris/) 1423{ 1424 $SOLARINC .= $I.$COMPATH.$ds."include"; 1425} 1426if ($platform =~ m/linux/) 1427{ 1428# This simply adds an include path, so even cases that break the FHS work 1429} 1430 1431 1432 $SOLARINC .= $I.'$SOLARENV'.$INC.$ds."Xp31". 1433 $I.'$JAVA_HOME'.$INCLUDE; 1434 1435 #include system dependent Java include directory 1436 if (!($JDK eq "gcj")) 1437 { 1438 if ($platform =~ m/solaris/) 1439 { $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."solaris"; 1440 } 1441 elsif ($platform =~ m/linux|osf1/) 1442 { $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."linux"; 1443 } 1444 elsif ($platform =~ m/freebsd/) 1445 { 1446 $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."freebsd"; 1447 $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."bsd"; 1448 $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."linux"; 1449 } 1450 elsif ($platform =~ m/netbsd/) 1451 { $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."netbsd"; 1452 } 1453 1454 #java threads include path 1455 1456 $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."native_threads".$ds."include"; 1457 } 1458 #The tail, if needed 1459 if ($platform =~ m/linux|freebsd|netbsd/) 1460 { if ($XINC ne $USR.$INCLUDE) 1461 { $SOLARINC .= $I.$XINC; 1462 } 1463 } 1464 elsif ($platform =~ m/osf1/) 1465 { $SOLARINC .= $I.$XINC. 1466 $I.$USR.$INCLUDE; 1467 } 1468} 1469elsif ($platform =~ m/cygwin/) 1470{ $SOLARINC .= $I.'$JAVA_HOME'.$ds."include".$ds."win32". 1471 $I.'$JAVA_HOME'.$ds."include"; 1472 # Mingw is different 1473 if ( "@COM@" eq "MSC" ) 1474 { $SOLARINC .= $I.'$PSDK_HOME'.$INCLUDE. 1475 $I.'$COMPATH'.$ds."include"; 1476 if ( '@ENABLE_DIRECTX@' ne "" ) { 1477 $SOLARINC .= $I.PathFormat('@DIRECTXSDK_HOME@').$INCLUDE; 1478 if ( '@COMEX@' eq "10" ) { 1479 # .NET2003 provides and compiles against DirectX 5 libraries and is 1480 # hereby still Win9x compatible. 1481 $SOLARINC .= $I.'$COMPATH'.$ds.'PlatformSDK'.$ds."include"; 1482 } 1483 } 1484 } 1485 elsif ( "@COM@" eq "GCC" ) 1486 { $SOLARINC .= $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."external".$ds."mingw".$ds."include"; 1487 if ( $USE_MINGW eq "cygwin" ) 1488 { $SOLARINC .= $I.PathFormat($USR.$ds."include".$ds."mingw"). 1489 $I.PathFormat($USR.$ds."include".$ds."w32api"). 1490 $I.PathFormat($USR.$ds."include"); } 1491 else 1492 { $SOLARINC .= $I.'$COMPATH'.$ds."include"; } 1493 @mingw_lib_include_paths = split( / /, "@MINGW_LIB_INCLUDE_PATH@" ); 1494 $SOLARINC .= $I.PathFormat("@MINGW_BACKWARD_INCLUDE_PATH@"); 1495 foreach $mingw_lib_include_path (@mingw_lib_include_paths) 1496 { chomp $mingw_lib_include_path; 1497 if ( $mingw_lib_include_path ne $COMPATH.$ds."include" && $mingw_lib_include_path ne "" ) 1498 { 1499 $SOLARINC .= $I.PathFormat($mingw_lib_include_path); 1500 } 1501 } 1502 $SOLARINC .= $I.'$PSDK_HOME'.$INCLUDE; 1503 } 1504 if ( '@ENABLE_DIRECTX@' ne "" ) { 1505 $SOLARINC .= $I.PathFormat('@DIRECTXSDK_HOME@').$INCLUDE; 1506 } 1507} 1508elsif ($platform =~ m/darwin/) 1509{ 1510 $FRAMEWORKSHOME = "@MACOSX_SDK_PATH@/System/Library/Frameworks"; 1511 chomp( my $TOOLSPATH = `xcode-select --print-path` ); 1512 my $STLINC = "$TOOLSPATH/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/"; 1513 if ( !(-e $STLINC) && !(-d $STLINC) ) { 1514 # Xcode 5 1515 $STLINC = "$TOOLSPATH/Toolchains/XcodeDefault.xctoolchain/usr/lib/c++/v1/"; 1516 } 1517 $SOLARINC .= $I.$STLINC . $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Headers"; 1518 $GUIBASE = "aqua"; 1519} 1520else 1521{ AddWarning( "set_soenv", "$platform not configured for system dependent include dir" ); 1522} 1523 1524# 1525print "done\n"; 1526 1527$gb_REPOS = $SRC_ROOT; 1528for my $repo (split(/ /,"@ADDITIONAL_REPOSITORIES@")) 1529{ 1530 my $abs_repo = `cd $SRC_ROOT/$repo;pwd`; 1531 chomp($abs_repo); 1532 $gb_REPOS .= " " . $abs_repo; 1533} 1534 1535 1536# 1537# F. Setting the different aliases. 1538# 1539print "Setting the aliases... "; 1540# 1. alias for a full product make. 1541 $mkout = '"$PERL $SOLARENV/bin/mkout.pl"'; 1542 $deliver = '"$PERL $SOLARENV/bin/deliver.pl"'; 1543 $build = '"$PERL $SOLARENV/bin/build.pl"'; 1544 $build_client = '"$PERL $SOLARENV/bin/build_client.pl"'; 1545 $zipdep = '"$PERL $SOLARENV/bin/zipdep.pl"'; 1546# 3. alias for a full product make 1547$nmake = '"dmake"'; 1548print "done\n"; 1549# 1550#-------------------------- 1551# VI. Open the output file. 1552#-------------------------- 1553# 1554 1555# Create sh environment file 1556open( OUT_SH, ">$outfile_sh" ) || 1557 die "Cannot open $outfile_sh: $!\n"; 1558 1559if(defined($outfile_bat)) 1560{ # Create bat environment file 1561 open( OUT_BAT, ">$outfile_bat" ) || 1562 die "Cannot open $outfile_bat: $!\n"; 1563} 1564 1565open( OUT_PROPS, ">ant.properties" ) || 1566 die "Cannot open ant.properties: $!\n"; 1567 1568# 1569#------------------------------------------ 1570# VII. Writing the data to the output file. 1571#------------------------------------------ 1572# 1573# Write file header. 1574CreateFileHeader( *OUT_SH, $UPD, $platform, "sh/bash/ksh", "#" ); 1575CreateFileHeader( *OUT_BAT, $UPD, $platform, "4nt", "rem" ) if defined($outfile_bat); 1576 1577ToFile( "SRC_ROOT", $SRC_ROOT, "e" ); 1578ToFile( "OOO_SHELL", $OOO_SHELL, "e" ); 1579ToFile( "JAVA_HOME", $JAVA_HOME, "e" ); 1580ToFile( "ANT_HOME", PathFormat("@ANT_HOME@"), "e" ); 1581ToFile( "ANT_LIB", PathFormat("@ANT_LIB@"), "e" ); 1582ToFile( "ANT", PathFormat("@ANT@"), "e" ); 1583ToFile( "JDKLIB", $JAVA_LIB, "e" ); 1584ToFile( "ASM_PATH", $ASM_PATH, "e" ); 1585ToFile( "NASM_PATH", $NASM_PATH, "e" ); 1586ToFile( "BUILD_SOSL", $BUILD_SOSL, "e" ); 1587ToFile( "FRAMEWORKSHOME", $FRAMEWORKSHOME, "e" ); 1588ToFile( "Empty", $empty, "n" ); 1589 1590# 1591# Writing the platform independent constant values to file. 1592# (c = comment, e = environment variable, a = alias ) 1593ToFile( "Platform independent constant values.", $empty, "c" ); 1594# dictionaries 1595if ('@WITH_DICT@' =~ m/ALL,/s) 1596{ 1597 foreach $dict (@DICTIONARIES) 1598 { 1599 ToFile( "DIC_$dict", "TRUE", "e" ); 1600 } 1601 ToFile( "DIC_ALL", "TRUE", "e" ); 1602} 1603else 1604{ 1605 foreach $dict (@DICTIONARIES) 1606 { if ('@WITH_DICT@' =~ m/$dict,/s) 1607 { my $val="TRUE"; 1608 ToFile( "DIC_$dict", $val, "e" ); 1609 } 1610 else 1611 { my $val; 1612 undef $val; 1613 ToFile( "DIC_$dict", $val, "e" ); 1614 } 1615 } 1616} 1617# Languages 1618ToFile( "WITH_LANG", "@WITH_LANG@", "e" ); 1619ToFile( "INTRO_BITMAPS", "@INTRO_BITMAPS@", "e" ); 1620ToFile( "ABOUT_BITMAPS", "@ABOUT_BITMAPS@", "e" ); 1621ToFile( "OOO_VENDOR", "@OOO_VENDOR@", "e" ); 1622ToFile( "OOODMAKEMODE", "YES", "e" ); 1623ToFile( "WITH_POOR_HELP_LOCALIZATIONS", "@WITH_POOR_HELP_LOCALIZATIONS@", "e" ); 1624 1625ToFile( "CALL_CDECL", $CALL_CDECL, "e" ); 1626ToFile( "COMMON_OUTDIR", $COMMON_OUTDIR, "e" ); 1627ToFile( "common_build", $common_build, "e" ); 1628ToFile( "BMP_WRITES_FLAG", $BMP_WRITES_FLAG, "e" ); 1629ToFile( "BUILD_SOSL_RELEASE", $BUILD_SOSL_RELEASE, "e" ); 1630ToFile( "NO_REC_RES", $NO_REC_RES, "e" ); 1631ToFile( "SO3", $SO3, "e" ); 1632ToFile( "SOLAR_PLUGIN", $SOLAR_PLUGIN, "e" ); 1633ToFile( "UPDATER", $UPDATER, "e" ); 1634ToFile( "build_deliver", $BUILD_DELIVER, "e" ); 1635ToFile( "VCL", $VCL, "e" ); 1636ToFile( "ENABLEUNICODE", $ENABLEUNICODE, "e" ); 1637ToFile( "NEW_JAR_PACK", $NEW_JAR_PACK, "e" ); 1638ToFile( "NO_BSYMBOLIC", $NO_BSYMBOLIC, "e" ); 1639ToFile( "TF_FILTER", "TRUE", "e" ); 1640if ("@ENABLE_DEBUG@" eq "TRUE") { 1641ToFile( "debug", "true", "e" ); 1642} else { 1643ToFile( "debug", "", "e" ); 1644} 1645if ("@ENABLE_WERROR@" eq "FALSE") { 1646ToFile( "EXTERNAL_WARNINGS_NOT_ERRORS", "TRUE", "e" ); 1647} else { 1648ToFile( "EXTERNAL_WARNINGS_NOT_ERRORS", "", "e" ); 1649} 1650ToFile( "PRODUCT", "@PRODUCT@", "e" ); 1651ToFile( "PROFULLSWITCH", "@PROFULLSWITCH@", "e" ); 1652ToFile( "PROEXT", $PROEXT, "e" ); 1653ToFile( "VALGRIND_CFLAGS", "@VALGRIND_CFLAGS@", "e" ); 1654ToFile( "UNIXWRAPPERNAME", "@UNIXWRAPPERNAME@","e" ); 1655ToFile( "ENABLE_NSS_MODULE", "@ENABLE_NSS_MODULE@", "e" ); 1656ToFile( "MOZILLABUILD", "@MOZILLABUILD@", "e" ); 1657ToFile( "BUILD_VER_STRING", "@BUILD_VER_STRING@", "e" ); 1658if ($platform =~ m/linux/ && $platform =~ m/powerpc/) { 1659ToFile( "JITC_PROCESSOR_TYPE","6", "e" ); 1660} 1661ToFile( "DEFAULT_TO_ENGLISH_FOR_PACKING", "yes", "e" ); 1662ToFile( "ENABLE_GTK", "@ENABLE_GTK@", "e" ); 1663ToFile( "GTK_CFLAGS", "@GTK_CFLAGS@", "e" ); 1664ToFile( "GTK_LIBS", "@GTK_LIBS@", "e" ); 1665ToFile( "GTHREAD_CFLAGS", "@GTHREAD_CFLAGS@", "e" ); 1666ToFile( "GTHREAD_LIBS", "@GTHREAD_LIBS@", "e" ); 1667ToFile( "ENABLE_SYSTRAY_GTK", "@ENABLE_SYSTRAY_GTK@", "e" ); 1668ToFile( "ENABLE_STATIC_GTK", "@ENABLE_STATIC_GTK@", "e" ); 1669ToFile( "ENABLE_GSTREAMER", "@ENABLE_GSTREAMER@", "e" ); 1670ToFile( "ENABLE_CAIRO", "@ENABLE_CAIRO@", "e" ); 1671ToFile( "ENABLE_CAIRO_CANVAS", "@ENABLE_CAIRO_CANVAS@", "e" ); 1672ToFile( "ENABLE_OPENGL", "@ENABLE_OPENGL@", "e" ); 1673ToFile( "ENABLE_PDFIMPORT", "@ENABLE_PDFIMPORT@", "e" ); 1674ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" ); 1675ToFile( "SYSTEM_JFREEREPORT","@SYSTEM_JFREEREPORT@","e" ); 1676ToFile( "OOO_JUNIT_JAR", "@OOO_JUNIT_JAR@", "e" ); 1677ToFile( "HAMCREST_CORE_JAR", "@HAMCREST_CORE_JAR@","e" ); 1678ToFile( "SAC_JAR", "@SAC_JAR@", "e" ); 1679ToFile( "LIBXML_JAR", "@LIBXML_JAR@", "e" ); 1680ToFile( "FLUTE_JAR", "@FLUTE_JAR@", "e" ); 1681ToFile( "JFREEREPORT_JAR", "@JFREEREPORT_JAR@", "e" ); 1682ToFile( "LIBLAYOUT_JAR", "@LIBLAYOUT_JAR@", "e" ); 1683ToFile( "LIBLOADER_JAR", "@LIBLOADER_JAR@", "e" ); 1684ToFile( "LIBFORMULA_JAR", "@LIBFORMULA_JAR@", "e" ); 1685ToFile( "LIBREPOSITORY_JAR", "@LIBREPOSITORY_JAR@","e" ); 1686ToFile( "LIBBASE_JAR", "@LIBBASE_JAR@", "e" ); 1687ToFile( "LIBFONTS_JAR", "@LIBFONTS_JAR@", "e" ); 1688ToFile( "LIBSERIALIZER_JAR", "@LIBSERIALIZER_JAR@","e" ); 1689ToFile( "ENABLE_MEDIAWIKI", "@ENABLE_MEDIAWIKI@", "e" ); 1690ToFile( "SYSTEM_APACHE_COMMONS","@SYSTEM_APACHE_COMMONS@","e" ); 1691ToFile( "COMMONS_CODEC_JAR", "@COMMONS_CODEC_JAR@","e" ); 1692ToFile( "COMMONS_LANG_JAR", "@COMMONS_LANG_JAR@", "e" ); 1693ToFile( "COMMONS_HTTPCLIENT_JAR","@COMMONS_HTTPCLIENT_JAR@","e" ); 1694ToFile( "COMMONS_LOGGING_JAR","@COMMONS_LOGGING_JAR@","e" ); 1695ToFile( "SYSTEM_SERVLETAPI", "@SYSTEM_SERVLETAPI@", "e" ); 1696ToFile( "SERVLETAPI_JAR", "@SERVLETAPI_JAR@", "e" ); 1697ToFile( "ENABLE_DBUS", "@ENABLE_DBUS@", "e" ); 1698ToFile( "ENABLE_GCONF", "@ENABLE_GCONF@", "e" ); 1699ToFile( "ENABLE_GNOMEVFS", "@ENABLE_GNOMEVFS@", "e" ); 1700ToFile( "GNOMEVFS_CFLAGS", "@GNOMEVFS_CFLAGS@", "e" ); 1701ToFile( "GNOMEVFS_LIBS", "@GNOMEVFS_LIBS@", "e" ); 1702ToFile( "ENABLE_GIO", "@ENABLE_GIO@", "e" ); 1703ToFile( "GIO_CFLAGS", "@GIO_CFLAGS@", "e" ); 1704ToFile( "GIO_LIBS", "@GIO_LIBS@", "e" ); 1705ToFile( "ENABLE_KDE", "@ENABLE_KDE@", "e" ); 1706ToFile( "KDE_CFLAGS", "@KDE_CFLAGS@", "e" ); 1707ToFile( "KDE_LIBS", "@KDE_LIBS@", "e" ); 1708ToFile( "MOC", "@MOC@", "e" ); 1709ToFile( "ENABLE_KDE4", "@ENABLE_KDE4@", "e" ); 1710ToFile( "KDE4_CFLAGS", "@KDE4_CFLAGS@", "e" ); 1711ToFile( "KDE4_LIBS", "@KDE4_LIBS@", "e" ); 1712ToFile( "MOC4", "@MOC4@", "e" ); 1713ToFile( "PSPRINT", "TRUE", "e" ); 1714ToFile( "MKDEPENDSOLVER", "TRUE", "e" ); 1715ToFile( "nodep", "@nodep@", "e" ); 1716ToFile( "TARFILE_LOCATION", $TARFILE_LOCATION, "e" ); 1717ToFile( "DO_FETCH_TARBALLS", "@DO_FETCH_TARBALLS@", "e" ); 1718ToFile( "CUSTOM_PACK_LIST", "@CUSTOM_PACK_LIST@", "e" ); 1719ToFile( "USE_PACKAGER", "@USE_PACKAGER@", "e" ); 1720ToFile( "ENABLE_ONLINE_UPDATE", "@ENABLE_ONLINE_UPDATE@", "e" ); 1721# 1722# Writing the platform dependent constant values to file. 1723# (c = comment, e = environment variable, a = alias ) 1724ToFile( "Platform dependent constant values.", $empty, "c" ); 1725ToFile( "SOLAR_JAVA", $SOLAR_JAVA, "e" ); 1726ToFile( "BIG_SVX", $BIG_SVX, "e" ); 1727ToFile( "COM", "@COM@", "e" ); 1728ToFile( "COMPATH", $COMPATH, "e" ); 1729ToFile( "CC_PATH", "@CC_PATH@", "e" ); 1730ToFile( "COMNAME", "@COMNAME@", "e" ); 1731ToFile( "COMID", "@COMID@", "e" ); 1732ToFile( "CCNUMVER", "@CCNUMVER@", "e" ); 1733ToFile( "CCVER", "@CCVER@", "e" ); 1734 1735ToFile( "CXX_X64_BINARY", $CXX_X64_BINARY, "e" ); 1736ToFile( "LINK_X64_BINARY", $LINK_X64_BINARY, "e" ); 1737ToFile( "LIBMGR_X64_BINARY", $LIBMGR_X64_BINARY, "e" ); 1738ToFile( "ALIGN", $ALIGN, "e" ); 1739ToFile( "CPU", $CPU, "e" ); 1740ToFile( "CPUNAME", $CPUNAME, "e" ); 1741ToFile( "CVER", $CVER, "e" ); 1742ToFile( "GUI", $GUI, "e" ); 1743ToFile( "GLIBC", $GLIBC, "e" ); 1744ToFile( "GUIBASE", $GUIBASE, "e" ); 1745ToFile( "GVER", $GVER, "e" ); 1746ToFile( "OS", $OS, "e" ); 1747ToFile( "OSVERSION", $OSVERSION, "e" ); 1748ToFile( "PTHREAD_CFLAGS", "@PTHREAD_CFLAGS@", "e" ); 1749ToFile( "PTHREAD_LIBS", "@PTHREAD_LIBS@", "e" ); 1750ToFile( "OUTPATH", $OUTPATH, "e" ); 1751ToFile( "INPATH", $INPATH, "e" ); 1752ToFile( "PATH_SEPERATOR", $PATH_SEPERATOR, "e" ); 1753ToFile( "COMEX", $COMEX, "e" ); 1754ToFile( "CDPATHx", $CDPATHx, "e" ); 1755ToFile( "DYNAMIC_CRT", $DYNAMIC_CRT, "e" ); 1756ToFile( "SET_EXCEPTIONS", $SET_EXCEPTIONS, "e" ); 1757ToFile( "use_shl_versions", $use_shl_versions, "e" ); 1758ToFile( "FLIPCMD", $FLIPCMD, "e" ); 1759ToFile( "ARM_TARGET", "@ARM_TARGET@", "e" ); 1760if ( $platform =~ m/darwin/ ) 1761{ 1762# MACOSX_DEPLOYMENT_TARGET : The minimum version required to run the build, 1763# build can assume functions/libraries of that version to be available 1764# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro) 1765# http://developer.apple.com/technotes/tn2002/tn2064.html 1766 ToFile( "MACOSX_DEPLOYMENT_TARGET", "@MACOSX_DEPLOYMENT_TARGET@", "e" ); 1767 ToFile( "MACOSX_SDK_PATH", "@MACOSX_SDK_PATH@", "e" ); 1768 ToFile( "SDKROOT", "@SDKROOT@", "e" ); 1769} 1770if ( $platform =~ m/freebsd/ ) 1771{ 1772 ToFile( "FBSD_GCC_RPATH", "@FBSD_GCC_RPATH@", "e" ); 1773 ToFile( "LIBINTL_PREFIX", "@LIBINTL_PREFIX@", "e" ); 1774} 1775 1776# 1777# Writing the variables to file. 1778# (c = comment, e = environment variable, a = alias, n = newline ) 1779ToFile( "Variable values.", $empty, "c" ); 1780if ( $platform =~ m/cygwin/ ) 1781{ ToFile( "CYGWIN_PATH", $CYGWIN_PATH, "e" ); 1782 ToFile( "PSDK_HOME", $PSDK_HOME, "e" ); 1783 ToFile( "WINDOWS_VISTA_PSDK","@WINDOWS_VISTA_PSDK@","e" ); 1784 ToFile( "DIRECTXSDK_LIB", $DIRECTXSDK_LIB, "e" ); 1785 ToFile( "USE_DIRECTX5", $USE_DIRECTX5, "e" ); 1786 ToFile( "ATL_LIB", "@ATL_LIB@", "e" ); 1787 ToFile( "ATL_LIB_X64", "@ATL_LIB_X64@", "e" ); 1788 ToFile( "ATL_INCLUDE", "@ATL_INCLUDE@", "e" ); 1789 ToFile( "HAVE_ATLTHUNK", "@HAVE_ATLTHUNK@", "e" ); 1790 ToFile( "MFC_LIB", "@MFC_LIB@", "e" ); 1791 ToFile( "MFC_INCLUDE", "@MFC_INCLUDE@", "e" ); 1792 ToFile( "NSIS_PATH", $NSIS_PATH, "e" ); 1793 ToFile( "DISABLE_ACTIVEX", "@DISABLE_ACTIVEX@","e" ); 1794 ToFile( "DISABLE_ATL", "@DISABLE_ATL@", "e" ); 1795 ToFile( "USE_NEW_SDK", $USE_NEW_SDK, "e" ); 1796 1797 # Hack around dmake's mktmp not generating DOS paths. 1798# my $tmpdir = qx{cygpath -m "/tmp"}; 1799# chomp($tmpdir); 1800# ToFile( "TMPDIR", $tmpdir, "e" ); 1801 ToFile( "TMPDIR", "/tmp", "e" ); 1802} 1803ToFile( "ENABLE_HUNSPELL", "@ENABLE_HUNSPELL@", "e" ); 1804ToFile( "ENABLE_HYPHEN", "@ENABLE_HYPHEN@", "e" ); 1805 1806ToFile( "PERL", $PERL, "e" ); 1807ToFile( "RPM", "@RPM@", "e" ); 1808ToFile( "DPKG", "@DPKG@", "e" ); 1809ToFile( "FAKEROOT", "@FAKEROOT@", "e" ); 1810ToFile( "PKGMK", "@PKGMK@", "e" ); 1811ToFile( "GNUMAKE", "@GNUMAKE@", "e" ); 1812ToFile( "GNUTAR", "@GNUTAR@", "e" ); 1813ToFile( "UPD", $UPD, "e" ); 1814ToFile( "WORK_STAMP", $WORK_STAMP, "e" ); 1815ToFile( "SOLARVER", $SOLARVER, "e" ); 1816ToFile( "SOLARVERSION", $SOLARVERSION, "e" ); 1817ToFile( "WORKDIR", $WORKDIR, "e" ); 1818ToFile( "OUTDIR", $OUTDIR, "e" ); 1819ToFile( "SOLARENV", $SOLARENV, "e" ); 1820ToFile( "SOLARENVINC", $SOLARENVINC, "e" ); 1821ToFile( "LOCALINI", $LOCALINI, "e" ); 1822ToFile( "STAR_INIROOT", $STAR_INIROOT, "e" ); 1823ToFile( "STAR_INIROOTOLD", $STAR_INIROOTOLD, "e" ); 1824ToFile( "STAR_STANDLST", $STAR_STANDLST, "e" ); 1825ToFile( "STAR_SSCOMMON", $STAR_SSCOMMON, "e" ); 1826ToFile( "STAR_SSOLARINI", $STAR_SSOLARINI, "e" ); 1827ToFile( "DMAKEROOT", $DMAKEROOT, "e" ); 1828if ( $JDK ne "gcj" ) { 1829 ToFile( "CLASSPATH", $CLASSPATH, "e" ); 1830 ToFile( "XCLASSPATH", $XCLASSPATH, "e" ); 1831} 1832else { 1833 ToFile( "JAVACISGCJ", '@JAVACISGCJ@', "e" ); 1834} 1835if ( $GUI eq "UNX" ) { 1836 ToFile( "AWTLIB", '@AWTLIB@', "e" ); 1837} 1838else { 1839 if ( $GUI eq "WNT" ) { 1840 if ( "@COM@" eq "GCC" ) { 1841 ToFile( "AWTLIB", '@JAVA_HOME@/lib/jawt.lib', "e" ); 1842 } else { 1843 ToFile( "AWTLIB", 'jawt.lib', "e" ); 1844 } 1845 } 1846} 1847if ( '@JDK@' ne '' ) 1848{ 1849 ToFile( "JDK", "@JDK@", "e" ); 1850 ToFile( "JAVAFLAGS", "@JAVAFLAGS@", "e" ); 1851 ToFile( "JAVAINTERPRETER", PathFormat("@JAVAINTERPRETER@"), "e" ); 1852 ToFile( "JAVAIFLAGS", "@JAVAIFLAGS@", "e" ); 1853 ToFile( "JAVACOMPILER", PathFormat("@JAVACOMPILER@"), "e" ); 1854 ToFile( "JAVAAOTCOMPILER", PathFormat("@JAVAAOTCOMPILER@"), "e" ); 1855 ToFile( "JAVADOC", PathFormat("@JAVADOC@"), "e" ); 1856} 1857ToFile( "SCPDEFS", '@SCPDEFS@', "e" ); 1858ToFile( "SOLAREXTRAINC", $SOLAREXTRAINC, "e" ); 1859ToFile( "SOLAREXTRALIB", $SOLAREXTRALIB, "e" ); 1860ToFile( "PATH", $PATH, "e" ); 1861ToFile( "SOLARLIB", $SOLARLIB, "e" ); 1862ToFile( "SOLARINC", $SOLARINC, "e" ); 1863ToFile( "COMP_ENV", $COMP_ENV, "e" ); 1864ToFile( "JAVAHOME", $JAVAHOME, "e" ); 1865ToFile( "CC", $CC, "e" ); 1866ToFile( "HAVE_GCC_VISIBILITY_FEATURE", 1867 "@HAVE_GCC_VISIBILITY_FEATURE@", "e" ); 1868ToFile( "HAVE_LD_HASH_STYLE","@HAVE_LD_HASH_STYLE@","e" ); 1869ToFile( "HAVE_LD_BSYMBOLIC_FUNCTIONS", 1870 "@HAVE_LD_BSYMBOLIC_FUNCTIONS@","e" ); 1871ToFile( "CXX", $CXX, "e" ); 1872ToFile( "USE_CCACHE", "@USE_CCACHE@", "e" ); 1873ToFile( "MINGWCXX", "@MINGWCXX@", "e" ); 1874ToFile( "MINGWSTRIP", "@MINGWSTRIP@", "e" ); 1875ToFile( "USE_SYSTEM_STL", "@USE_SYSTEM_STL@", "e" ); 1876ToFile( "ALLOC", "@ALLOC@", "e" ); 1877ToFile( "ENABLE_SYMBOLS", "@ENABLE_SYMBOLS@", "e" ); 1878ToFile( "DISABLE_STRIP", "@DISABLE_STRIP@", "e" ); 1879ToFile( "LFS_CFLAGS", "@LFS_CFLAGS@", "e" ); 1880ToFile( "ENABLE_CRASHDUMP", "@ENABLE_CRASHDUMP@", "e" ); 1881ToFile( "ENABLE_CUPS", "@ENABLE_CUPS@", "e" ); 1882ToFile( "ENABLE_RANDR", "@ENABLE_RANDR@", "e" ); 1883ToFile( "ENABLE_FONTCONFIG", "@ENABLE_FONTCONFIG@", "e" ); 1884ToFile( "ENABLE_DIRECTX", "@ENABLE_DIRECTX@", "e" ); 1885ToFile( "ENABLE_DIRECT_DRAW","@ENABLE_DIRECT_DRAW@","e" ); 1886ToFile( "ENABLE_LAYOUT", "@ENABLE_LAYOUT@", "e" ); 1887ToFile( "ENABLE_PCH", "@ENABLE_PCH@", "e" ); 1888ToFile( "ENABLE_GRAPHITE", "@ENABLE_GRAPHITE@", "e"); 1889ToFile( "SYSTEM_GRAPHITE", "@SYSTEM_GRAPHITE@", "e"); 1890ToFile( "GRAPHITE_LIBS", "@GRAPHITE_LIBS@", "e"); 1891ToFile( "GRAPHITE_CFLAGS", "@GRAPHITE_CFLAGS@", "e"); 1892ToFile( "VC_STANDARD", "@VC_STANDARD@", "e" ); 1893ToFile( "BUILD_X64", "@BUILD_X64@", "e" ); 1894ToFile( "ENABLE_CATEGORY_B", "@ENABLE_CATEGORY_B@", "e"); 1895ToFile( "BUNDLED_EXTENSION_BLOBS", "@BUNDLED_EXTENSION_BLOBS@", "e"); 1896ToFile( "BUNDLED_PREREG_EXTENSIONS", "@BUNDLED_PREREG_EXTENSIONS@", "e"); 1897ToFile( "ENABLE_BUNDLED_DICTIONARIES", "@ENABLE_BUNDLED_DICTIONARIES@", "e"); 1898ToFile( "SYSTEM_DICTS", "@SYSTEM_DICTS@", "e"); 1899ToFile( "DICT_SYSTEM_DIR", "@DICT_SYSTEM_DIR@", "e"); 1900ToFile( "HYPH_SYSTEM_DIR", "@HYPH_SYSTEM_DIR@", "e"); 1901ToFile( "THES_SYSTEM_DIR", "@THES_SYSTEM_DIR@", "e"); 1902ToFile( "ENABLE_LOCKDOWN", "@ENABLE_LOCKDOWN@", "e" ); 1903ToFile( "WITH_LDAP", "@WITH_LDAP@", "e" ); 1904ToFile( "WITH_OPENLDAP", "@WITH_OPENLDAP@", "e" ); 1905ToFile( "MOZ_INC", "@MOZ_INC@", "e" ); 1906ToFile( "WITH_CATA_FONTS", "@WITH_CATA_FONTS@", "e" ); 1907ToFile( "WITH_CATB_FONTS", "@WITH_CATB_FONTS@", "e" ); 1908ToFile( "WITH_FONTS", "@WITH_FONTS@", "e" ); 1909ToFile( "WITHOUT_AFMS", "@WITHOUT_AFMS@", "e" ); 1910ToFile( "WITHOUT_PPDS", "@WITHOUT_PPDS@", "e" ); 1911ToFile( "BUILD_TYPE", "@BUILD_TYPE@", "e" ); 1912ToFile( "ADDITIONAL_REPOSITORIES", "@ADDITIONAL_REPOSITORIES@", "e" ); 1913ToFile( "VERBOSE", "@VERBOSE@", "e" ); 1914ToFile( "ENABLE_EVOAB2", "@ENABLE_EVOAB2@", "e" ); 1915ToFile( "GOBJECT_CFLAGS", "@GOBJECT_CFLAGS@", "e" ); 1916ToFile( "GOBJECT_LIBS", "@GOBJECT_LIBS@", "e" ); 1917if ( '@ENABLE_RPATH@' eq "no" ) { 1918 ToFile( "LINKFLAGSRUNPATH",'', "e" ); 1919} 1920ToFile( "EPM", "@EPM@", "e" ); 1921ToFile( "EPM_URL", "@EPM_URL@", "e" ); 1922ToFile( "EPM_FLAGS", $EPM_FLAGS, "e" ); 1923ToFile( "BUILD_EPM", "@BUILD_EPM@", "e" ); 1924ToFile( "PKGFORMAT", "@PKGFORMAT@", "e" ); 1925ToFile( "SYSTEM_STDLIBS", "@SYSTEM_STDLIBS@", "e" ); 1926ToFile( "SYSTEM_ZLIB", "@SYSTEM_ZLIB@", "e" ); 1927ToFile( "SYSTEM_NSS", "@SYSTEM_NSS@", "e" ); 1928ToFile( "NSS_CFLAGS", "@NSS_CFLAGS@", "e" ); 1929ToFile( "NSS_LIBS", "@NSS_LIBS@", "e" ); 1930ToFile( "SYSTEM_OPENSSL", "@SYSTEM_OPENSSL@", "e" ); 1931ToFile( "OPENSSL_CFLAGS", "@OPENSSL_CFLAGS@", "e" ); 1932ToFile( "OPENSSL_LIBS", "@OPENSSL_LIBS@", "e" ); 1933ToFile( "SYSTEM_PYTHON", "@SYSTEM_PYTHON@", "e" ); 1934ToFile( "PYTHON_CFLAGS", "@PYTHON_CFLAGS@", "e" ); 1935ToFile( "PYTHON_LIBS", "@PYTHON_LIBS@", "e" ); 1936if ($SYSTEM_PYTHON eq "NO") { 1937ToFile( "HOME", "@HOME@", "e" ); 1938} 1939ToFile( "SYSTEM_ICU", "@SYSTEM_ICU@", "e" ); 1940ToFile( "ICU_MAJOR", "@ICU_MAJOR@", "e" ); 1941ToFile( "ICU_MINOR", "@ICU_MINOR@", "e" ); 1942ToFile( "ICU_MICRO", "@ICU_MICRO@", "e" ); 1943ToFile( "SYSTEM_GENBRK", "@SYSTEM_GENBRK@", "e" ); 1944ToFile( "SYSTEM_GENCCODE", "@SYSTEM_GENCCODE@", "e" ); 1945ToFile( "SYSTEM_GENCMN", "@SYSTEM_GENCMN@", "e" ); 1946ToFile( "SYSTEM_JPEG", "@SYSTEM_JPEG@", "e" ); 1947ToFile( "FREETYPE_CFLAGS", "@FREETYPE_CFLAGS@", "e" ); 1948ToFile( "FREETYPE_LIBS", "@FREETYPE_LIBS@", "e" ); 1949ToFile( "SYSTEM_POPPLER", "@SYSTEM_POPPLER@", "e" ); 1950ToFile( "POPPLER_CFLAGS", "@POPPLER_CFLAGS@", "e" ); 1951ToFile( "POPPLER_LIBS", "@POPPLER_LIBS@", "e" ); 1952ToFile( "GSTREAMER_CFLAGS", "@GSTREAMER_CFLAGS@", "e" ); 1953ToFile( "GSTREAMER_LIBS", "@GSTREAMER_LIBS@", "e" ); 1954ToFile( "SYSTEM_CAIRO", "@SYSTEM_CAIRO@", "e" ); 1955ToFile( "BUILD_PIXMAN", "@BUILD_PIXMAN@", "e" ); 1956ToFile( "CAIRO_CFLAGS", "@CAIRO_CFLAGS@", "e" ); 1957ToFile( "CAIRO_LIBS", "@CAIRO_LIBS@", "e" ); 1958ToFile( "XRANDR_CFLAGS", "@XRANDR_CFLAGS@", "e" ); 1959ToFile( "XRANDR_LIBS", "@XRANDR_LIBS@", "e" ); 1960ToFile( "XRANDR_DLOPEN", "@XRANDR_DLOPEN@", "e" ); 1961ToFile( "ENABLE_UNIT_TESTS", "@ENABLE_UNIT_TESTS@", "e" ); 1962ToFile( "SYSTEM_LIBXML", "@SYSTEM_LIBXML@", "e" ); 1963ToFile( "USE_FT_EMBOLDEN", "@USE_FT_EMBOLDEN@", "e" ); 1964ToFile( "LIBXML_CFLAGS", "@LIBXML_CFLAGS@", "e" ); 1965ToFile( "LIBXML_LIBS", "@LIBXML_LIBS@", "e" ); 1966ToFile( "SYSTEM_EXPAT", "@SYSTEM_EXPAT@", "e" ); 1967ToFile( "ENABLE_MYSQLC", "@ENABLE_MYSQLC@", "e" ); 1968ToFile( "SYSTEM_MYSQL", "@SYSTEM_MYSQL@", "e" ); 1969ToFile( "SYSTEM_MYSQL_CPPCONN","@SYSTEM_MYSQL_CPPCONN@","e" ); 1970ToFile( "MYSQL_INC", "@MYSQL_INC@", "e" ); 1971ToFile( "MYSQL_LIB", "@MYSQL_LIB@", "e" ); 1972ToFile( "MYSQL_DEFINES", "@MYSQL_DEFINES@", "e" ); 1973ToFile( "LIBMYSQL_PATH", "@LIBMYSQL_PATH@", "e" ); 1974ToFile( "SYSTEM_HSQLDB", "@SYSTEM_HSQLDB@", "e" ); 1975ToFile( "HSQLDB_JAR", "@HSQLDB_JAR@", "e" ); 1976ToFile( "SYSTEM_LUCENE", "@SYSTEM_LUCENE@", "e" ); 1977ToFile( "LUCENE_CORE_JAR", "@LUCENE_CORE_JAR@", "e" ); 1978ToFile( "LUCENE_ANALYZERS_JAR", "@LUCENE_ANALYZERS_JAR@", "e" ); 1979ToFile( "SYSTEM_BSH", "@SYSTEM_BSH@", "e" ); 1980ToFile( "BSH_JAR", "@BSH_JAR@", "e" ); 1981ToFile( "ENABLE_BEANSHELL", "@ENABLE_BEANSHELL@", "e" ); 1982ToFile( "SYSTEM_SAXON", "@SYSTEM_SAXON@", "e" ); 1983ToFile( "SAXON_JAR", "@SAXON_JAR@", "e" ); 1984ToFile( "DISABLE_SAXON", "@DISABLE_SAXON@", "e" ); 1985ToFile( "ENABLE_JAVASCRIPT", "@ENABLE_JAVASCRIPT@","e" ); 1986ToFile( "SYSTEM_COINMP", "@SYSTEM_COINMP@", "e" ); 1987ToFile( "ENABLE_COINMP", "@ENABLE_COINMP@", "e" ); 1988ToFile( "COINMP_CFLAGS", "@COINMP_CFLAGS@", "e" ); 1989ToFile( "COINMP_LIBS", "@COINMP_LIBS@", "e" ); 1990ToFile( "SYSTEM_ODBC_HEADERS","@SYSTEM_ODBC_HEADERS@","e" ); 1991ToFile( "SYSTEM_LIBXSLT", "@SYSTEM_LIBXSLT@", "e" ); 1992ToFile( "LIBXSLT_CFLAGS", "@LIBXSLT_CFLAGS@", "e" ); 1993ToFile( "LIBXSLT_LIBS", "@LIBXSLT_LIBS@", "e" ); 1994ToFile( "SYSTEM_SANE_HEADER","@SYSTEM_SANE_HEADER@","e" ); 1995ToFile( "SYSTEM_XRENDER_HEADERS","@SYSTEM_XRENDER_HEADERS@","e" ); 1996ToFile( "SYSTEM_CURL", "@SYSTEM_CURL@", "e" ); 1997ToFile( "CURL_CFLAGS", "@CURL_CFLAGS@", "e" ); 1998ToFile( "CURL_LIBS", "@CURL_LIBS@", "e" ); 1999ToFile( "SYSTEM_BOOST", "@SYSTEM_BOOST@", "e" ); 2000ToFile( "SYSTEM_MDDS", "@SYSTEM_MDDS@", "e" ); 2001ToFile( "SYSTEM_VIGRA", "@SYSTEM_VIGRA@", "e" ); 2002ToFile( "SYSTEM_GDKPIXBUF", "@SYSTEM_GDKPIXBUF@", "e" ); 2003ToFile( "SYSTEM_GLIB", "@SYSTEM_GLIB@", "e" ); 2004ToFile( "SYSTEM_GETTEXT", "@SYSTEM_GETTEXT@", "e" ); 2005ToFile( "SYSTEM_PANGO", "@SYSTEM_PANGO@", "e" ); 2006ToFile( "SYSTEM_LIBPNG", "@SYSTEM_LIBPNG@", "e" ); 2007ToFile( "SYSTEM_LIBJPEG", "@SYSTEM_LIBJPEG@", "e" ); 2008ToFile( "RAT_JAR_HOME", "@RAT_JAR_HOME@", "e" ); 2009ToFile( "DMAKE_URL", "@DMAKE_URL@", "e" ); 2010ToFile( "DMAKE_PATH", "@DMAKE_PATH@", "e" ); 2011ToFile( "IS_SYSTEM_DMAKE", "@IS_SYSTEM_DMAKE@", "e" ); 2012ToFile( "BUILD_STAX", "@BUILD_STAX@", "e" ); 2013ToFile( "BUILD_UNOWINREG", "@BUILD_UNOWINREG@", "e" ); 2014ToFile( "USE_XINERAMA", "@USE_XINERAMA@", "e" ); 2015ToFile( "XINERAMA_LINK", "@XINERAMA_LINK@", "e" ); 2016ToFile( "SYSTEM_REDLAND", "@SYSTEM_REDLAND@", "e" ); 2017ToFile( "REDLAND_CFLAGS", "@REDLAND_CFLAGS@", "e" ); 2018ToFile( "REDLAND_LIBS", "@REDLAND_LIBS@", "e" ); 2019ToFile( "SYSTEM_HUNSPELL", "@SYSTEM_HUNSPELL@", "e" ); 2020ToFile( "HUNSPELL_CFLAGS", "@HUNSPELL_CFLAGS@", "e" ); 2021ToFile( "HUNSPELL_LIBS", "@HUNSPELL_LIBS@", "e" ); 2022ToFile( "HAVE_GETOPT", "@HAVE_GETOPT@", "e" ); 2023ToFile( "HAVE_READDIR_R", "@HAVE_READDIR_R@", "e" ); 2024ToFile( "SYSTEM_LIBC", "@SYSTEM_LIBC@", "e" ); 2025ToFile( "SYSTEM_HYPH", "@SYSTEM_HYPH@", "e" ); 2026ToFile( "HYPHEN_LIB", "@HYPHEN_LIB@", "e" ); 2027ToFile( "SYSTEM_MYTHES", "@SYSTEM_MYTHES@", "e" ); 2028ToFile( "MYTHES_CFLAGS", "@MYTHES_CFLAGS@", "e" ); 2029ToFile( "MYTHES_LIBS", "@MYTHES_LIBS@", "e" ); 2030ToFile( "SYSTEM_LIBTEXTCAT", "@SYSTEM_LIBTEXTCAT@","e" ); 2031ToFile( "SYSTEM_LIBTEXTCAT_DATA","@SYSTEM_LIBTEXTCAT_DATA@","e" ); 2032ToFile( "PAM", "@PAM@", "e" ); 2033ToFile( "NEW_SHADOW_API", "@NEW_SHADOW_API@", "e" ); 2034ToFile( "PAM_LINK", "@PAM_LINK@", "e" ); 2035ToFile( "CRYPT_LINK", "@CRYPT_LINK@", "e" ); 2036ToFile( "XAU_LIBS", "@XAU_LIBS@", "e" ); 2037ToFile( "COMMON_BUILD_TOOLS",$COMMON_BUILD_TOOLS, "e" ); 2038if ($platform !~ m/cygwin|os2/) { 2039 if ( !defined $ENV{"TMPDIR"} || $ENV{"TMPDIR"} eq "" ) { 2040 ToFile( "TMPDIR", "/tmp", "e" ); 2041 } else { 2042 ToFile( "TMPDIR", "$ENV{'TMPDIR'}", "e" ); 2043 } 2044} 2045ToFile( "SOLARSRC", $SOLARSRC, "e" ); 2046ToFile( "SOURCE_ROOT_DIR", $SOURCE_ROOT_DIR, "e" ); 2047ToFile( "gb_REPOS", $gb_REPOS, "e" ); 2048 2049if ( $platform =~ m/cygwin/ ) 2050{ 2051 ToFile( "ILIB", $ILIB, "e" ); 2052 if ( $MINGW eq "yes" ) 2053 { ToFile( "ATL_INCLUDE", $ATL_INCLUDE, "e" ); 2054 ToFile( "EXCEPTIONS", "@EXCEPTIONS@", "e" ); 2055 ToFile( "DIRECTXSDK_HOME", PathFormat("@DIRECTXSDK_HOME@"), "e" ); 2056 ToFile( "USE_MINGW", $USE_MINGW, "e" ); 2057 ToFile( "MINGW_CLIB_DIR", PathFormat("@MINGW_CLIB_DIR@"), "e" ); 2058 ToFile( "MINGW_SHARED_GCCLIB", "@MINGW_SHARED_GCCLIB@", "e" ); 2059 ToFile( "MINGW_GCCLIB_EH", "@MINGW_GCCLIB_EH@", "e" ); 2060 ToFile( "MINGW_SHARED_GXXLIB", "@MINGW_SHARED_GXXLIB@", "e" ); 2061 ToFile( "MINGW_SHARED_LIBSTDCPP", "@MINGW_SHARED_LIBSTDCPP@", "e" ); 2062 ToFile( "MINGW_GCCDLL", "@MINGW_GCCDLL@", "e" ); 2063 ToFile( "MINGW_GXXDLL", "@MINGW_GXXDLL@", "e" ); 2064 } 2065 ToFile( "GREP", $WIN_GREP, "e" ); 2066 ToFile( "FIND", $WIN_FIND, "e" ); 2067 ToFile( "LS", $WIN_LS, "e" ); 2068 ToFile( "GNUCOPY", $WIN_GNUCOPY, "e" ); 2069 ToFile( "TOUCH", $WIN_TOUCH, "e" ); 2070 ToFile( "WITH_VC_REDIST", "@WITH_VC_REDIST@", "e" ); 2071} 2072if ( $platform =~ m/os2/ ) 2073{ 2074 #ToFile( "ILIB", $ILIB, "e" ); 2075 2076 ToFile( "GREP", "grep.exe", "e" ); 2077 ToFile( "FIND", "find.exe", "e" ); 2078 ToFile( "LS", "ls.exe", "e" ); 2079 ToFile( "GNUCOPY", "cp.exe", "e" ); 2080 ToFile( "TOUCH", "touch", "e" ); 2081 ToFile( "CONFIG_SITE", "/@unixroot/usr/share/config.legacy", "e" ); 2082} 2083 2084# $perlpre is only used for the following three variables 2085# and only set for OS2. 2086my $perlpre = ""; 2087if (( $platform =~ m/os2/ )) { 2088 $perlpre = "perl ".${SOLARENV}.${BIN}.${ds}; 2089} 2090ToFile( "DELIVER", $perlpre."deliver.pl", "e" ); 2091ToFile( "MKOUT", $perlpre."mkout.pl", "e" ); 2092ToFile( "ZIPDEP", $perlpre."zipdep.pl", "e" ); 2093 2094# 2095# Writing the aliases to file. 2096ToFile( "Aliases.", $empty, "c" ); 2097 2098ToFile( "alias mkout", $mkout, "a" ); 2099ToFile( "alias deliver", $deliver, "a" ); 2100ToFile( "alias build", $build, "a" ); 2101ToFile( "alias build_client",$build_client, "a" ); 2102ToFile( "alias zipdep", $zipdep, "a" ); 2103if ( $platform !~ m/cygwin/ ) 2104{ ToFile( "alias nmake", $nmake, "a" ); 2105} 2106if ( $platform =~ m/os2/ ) 2107{ ToFile( "alias gunzip", "gzip -d", "a" ); 2108} 2109 2110 2111# on Solaris, MacOSX and FreeBSD (and Windows) set GNUPATCH and GPERF 2112if ($platform =~ m/solaris|darwin|freebsd|cygwin/) 2113{ 2114 ToFile( "GNUPATCH", "@GNUPATCH@", "e"); 2115 ToFile( "GPERF", "@GPERF@", "e"); 2116} 2117ToFile( "GNUCOPY", "@GNUCP@", "e"); 2118# OS/2 define .pl as executable for 4os2 2119# use - as switch char for dmake (os2/switchar.c) 2120if ($platform =~ m/os2/) 2121{ 2122 ToFile( ".pl", "perl", "e"); 2123 ToFile( "SWITCHAR", "-", "e"); 2124} 2125ToFile( "SAL_ENABLE_FILE_LOCKING", "1", "e"); 2126# 2127# Writing unset variables you might not need to file. 2128# 2129print OUT_SH "export $exportvars$newline"; 2130print OUT_SH "unset $unsetvarssh$newline"; 2131 2132if(defined($outfile_bat)) 2133{ print OUT_BAT $unsetvarsbat; 2134} 2135 2136# 2137#--------------------------- 2138# VIII. Closing output file. 2139#--------------------------- 2140# 2141close( OUT_SH ) || print "Can't close $outfile_sh: $!"; 2142close( OUT_PROPS ) || print "Can't close ant.properties: $!"; 2143 2144if( defined($outfile_bat)) 2145{ close( OUT_BAT ) || print "Can't close $outfile_bat: $!"; 2146} 2147 2148# 2149#------------------------------ 2150# IX. Sourcing the output file. 2151#------------------------------ 2152# 2153#--------------------------------- 2154# X. Set up the build environment. 2155#--------------------------------- 2156# 2157#-------------------------------------------------------- 2158# XI. Moving the output file to the build home directory. 2159#-------------------------------------------------------- 2160# 2161$tmp = $SRC_ROOT.$ds.$outfile_sh; 2162if (rename( $outfile_sh, $tmp ) ne 1) 2163{ `mv -f $outfile_sh $tmp`; 2164} 2165 2166if(defined($outfile_bat)) 2167{ 2168 $tmp = $SRC_ROOT.$ds.$outfile_bat; 2169 if (rename( $outfile_bat, $tmp ) ne 1) 2170 { `mv -f $outfile_bat $tmp`; 2171 } 2172} 2173 2174# 2175#-------------------------------------------------------- 2176# XII. Message at the end. 2177#-------------------------------------------------------- 2178# 2179# 2180print "*********************************************************". 2181 "******************* $newline"."*"."$newline"; 2182print "* Apache OpenOffice $UPD configuration. $newline"; 2183for ( $tmp = 0; $tmp < 2; $tmp++ ) 2184{ print "* $newline"; 2185} 2186print "* Configuration part of Apache OpenOffice $UPD build is finished. $newline* $newline"; 2187print "* Note: Be aware that you might not be able to build Apache OpenOffice if $newline". 2188 "* you ignore any warnings that were generated during this configuration $newline". 2189 "* process. $newline* $newline"; 2190 2191if ( $Warning ne "" ) 2192{ print "$Warning*"; 2193 print "$newline"; 2194} 2195 2196print "*$newline* USAGE: $newline"; 2197print "* Source $outfile.sh (in sh)"; 2198print "$newline"; 2199print "* in order to set up the build-environment variables.$newline"; 2200for ( $tmp = 0; $tmp < 2; $tmp++ ) 2201{ print "* $newline"; 2202} 2203print "*********************************************************". 2204 "******************* $newline"; 2205 2206$bootfile = "bootstrap"; 2207open( OUT, ">$bootfile" ) || 2208die "Cannot open $bootfile: $!\n"; 2209print OUT "#!/bin/sh\n"; 2210if ( $MINGW eq "yes" ) 2211{ print OUT 'PATH="/usr/bin:$PATH" : export PATH'."\n"; } 2212close( OUT ) || print "Can't close $bootfile: $!"; 2213system("cat bootstrap.1 >> bootstrap"); 2214system("chmod +x bootstrap"); 2215# 2216#-------------------------------------------------------- 2217# Moving the bootstrap file to the build home directory. 2218#-------------------------------------------------------- 2219# 2220$tmp = $SRC_ROOT.$ds.$bootfile; 2221if (rename( $bootfile, $tmp ) ne 1) 2222{ `mv -f $bootfile $tmp`; 2223} 2224 2225print "Configure completed"; 2226if ( $Warning ne "" ) { 2227 print ", but\n***** WARNINGS WERE ISSUED *****"; 2228} 2229print "\n\nRun ./bootstrap in $SRC_ROOT to provide build tools and get third-party packages\n"; 2230 2231# 2232#----------------- 2233# XII. Functions. 2234#----------------- 2235# 2236#------------------------------------------------------------- 2237# Function name: CheckPathName 2238# Description: chops off the '/' character if it's the last 2239# character in a pathname. also adds the '/' 2240# character if it's not the first character 2241# in a path. 2242# Arguments: 1. Path (string) 2243# Return value: Path (string) 2244#------------------------------------------------------------- 2245sub CheckPathName 2246{ my $retrn = $_[ 0 ]; 2247 if ($platform =~ m/cygwin/) 2248 { # Check if the first character is not a '/'. 2249 if ( !( $_[ 0 ] =~ /^\// ) ) 2250 { $retrn = $ds.$_[ 0 ]; 2251 } 2252 } 2253 # kill the last '/','\','\n' if they exists. 2254 $retrn =~ s![\s/\\]+$!!; 2255 # Done! 2256 return( $retrn ); 2257} 2258#------------------------------------------------------------- 2259# Function name: CheckPathExist 2260# Description: Checks whether the directory that is given 2261# as an argument exists. If not abort. 2262# Arguments: 1. Path (string) 2263# Return value: void 2264#------------------------------------------------------------- 2265sub CheckPathExist 2266{ my $dir = $_[ 0 ]; 2267 if ( !( -d $dir ) and $^O ne 'MSWin32' ) 2268 { print ( "The directory $_[ 0 ] does not exist. Please create first.\n" ); 2269 exit 1; 2270 } 2271 else 2272 { # Don't check under ActiveState Perl (Windows). The path is possibly 2273 # posix and it cannot handle it. 2274 return "true"; 2275 } 2276} 2277#------------------------------------------------------------ 2278# Function name: CreateFileHeader 2279# Description: Creates a header for the outfile. 2280# Arguments: 1. File to write to 2281# 2. UPD (string) 2282# 3. Platform (string) 2283# 4. name of shell for this file 2284# 5. comment to use for this file 2285# Return value: void 2286#------------------------------------------------------------ 2287sub CreateFileHeader 2288{ my $timestamp = `date`; 2289 chomp( $timestamp ); 2290 my $filehandle = $_[0]; 2291 my $comment = $_[4]; 2292 print { $filehandle } "$comment #################################################################"; 2293 print { $filehandle } $newline; 2294 print { $filehandle } "$comment Apache OpenOffice $_[ 1 ] build environment file for: $_[ 2 ]. $newline"; 2295 print { $filehandle } "$comment Generated on: $timestamp $newline"; 2296 print { $filehandle } "$comment Source this file to set up the build environment. $newline"; 2297 print { $filehandle } "$comment 1. exec $_[3] $newline"; 2298 print { $filehandle } "$comment 2. source $outfile $newline"; 2299 print { $filehandle } "$comment #################################################################"; 2300 print { $filehandle } $newline; 2301} 2302#--------------------------------------------------------- 2303# Function name: ToFile 2304# Description: Writes the environment variable in the 2305# output file. 2306# Arguments: 1. Name of environment variable (string) 2307# 2. Value of environment variable (string) 2308# 3. e - env. var 2309# a - alias 2310# c - comment 2311# n - newline 2312# z - raw, write as is to OUT_SH 2313# Return value: void 2314#--------------------------------------------------------- 2315sub ToFile { 2316 if ( $_[ 2 ] eq "e" ) { 2317 # Write an environment variable to file. 2318 if (defined $_[ 1 ] && $_[ 1 ] ne "" ) { 2319 my $envvar = $_[ 1 ]; 2320 my $envvarbash = $envvar; 2321 2322 if ($platform =~ m/os2/) { 2323 # expand the variables 2324 $envvar =~ s/(\$\{?\w+\}?)/$1/eeg ; 2325 # Some variables need to be translated 2326 #if ( ($_[ 0 ] =~ /^PATH$/) and ($platform !~ m/os2/) ) { 2327 # # PATH is in cygwin format, but for 4nt it needs to be DOS. 2328 # $win_format_var = WinPath( $envvar, ":" ); 2329 #} else { 2330 # $win_format_var = WinFormat( $envvar ); 2331 #} 2332 ## The excluded variables are translated by cygwin 2333 #if ( $_[ 0 ] !~ /^PATH$|^TMP$|^TEMP$|^TMPDIR$|^HOME$/i ) { 2334 # $envvar = $win_format_var; 2335 #} 2336 } 2337 2338 # Tcsh/bash needs backslashes quoted 2339 $envvar =~ s/\\/\\\\/g; 2340 $envvarbash = $envvar; 2341 2342 my $antvar = $envvarbash; 2343 $antvar =~ s/(\$\{?\w+\}?)/$1/eeg ; 2344 2345 if ($platform =~ m/os2/) { 2346 # expand the variables 2347 $envvar =~ s/(\$\{?\w+\}?)/$1/eeg ; 2348 if ($_[ 0 ] =~ /^PATH$|^BEGINLIBPATH$/) { 2349 # always use \ for them 2350 $envvar =~ s/\//\\/g ; 2351 } 2352 $win_format_var = $envvar; 2353 } 2354 2355 printf("%-12s %-17s %-10s %s\n", "The variable", $_[ 0 ], "is set to:", $envvar); 2356 print OUT_SH "$_[ 0 ]=\"$envvarbash\"$newline"; # to sh file 2357 $exportvars .= " $_[ 0 ]"; # add to export list for sh file 2358 print OUT_PROPS "$_[ 0 ]=$antvar$newline"; # to Ant properties file 2359 2360 if(defined($outfile_bat)) { 2361 print OUT_BAT "IF DEFINED $_[ 0 ] $unset $_[ 0 ]$newline"; 2362 print OUT_BAT "$set $_[ 0 ]=$win_format_var$newline"; 2363 } 2364 2365 } else { 2366 printf("%-12s %-17s %-10s %s\n", "The variable", $_[ 0 ], "is set to:", "unset") ; # to stdout 2367 $unsetvars .= "$unsetenv $_[ 0 ] >& /dev/null$newline"; # for tcsh file 2368 $unsetvarssh .= " $_[ 0 ]"; # for sh file 2369 if(defined($outfile_bat)) { 2370 $unsetvarsbat .= "$unset $_[ 0 ] >& NUL$newline"; 2371 } 2372 } 2373 } 2374 elsif ( $_[ 2 ] eq "a" ) 2375 { # Write an alias to file. 2376 print "The $_[ 0 ] is set to: $_[ 1 ]\n"; # to stdout 2377 print OUT_SH "$_[ 0 ]=$_[ 1 ]$newline"; # to sh file 2378 if(defined($outfile_bat)) # create the correct 4nt alias format 2379 { my $aliastmp = $_[ 1 ]; 2380 $aliastmp =~ s/\$/\%/g; 2381 $aliastmp =~ s!/!\\!g; 2382 $aliastmp =~ s!"!!g; 2383 print OUT_BAT "$_[ 0 ]=".'`'.$aliastmp.'`'.$newline; 2384 } 2385 } 2386 elsif ( $_[ 2 ] eq "c" ) 2387 { # Write a comment to file. 2388 print "$newline"; 2389 print "$comment$newline"; 2390 print "$comment $_[ 0 ]$newline"; 2391 print "$comment$newline"; 2392 print OUT_SH "$newline"; 2393 print OUT_SH "$comment$newline"; 2394 print OUT_SH "$comment $_[ 0 ]$newline"; 2395 print OUT_SH "$comment$newline"; 2396 if(defined($outfile_bat)) { 2397 print OUT_BAT "$newline"; 2398 print OUT_BAT "rem $newline"; 2399 print OUT_BAT "rem $_[ 0 ]$newline"; 2400 print OUT_BAT "rem $newline"; 2401 } 2402 } 2403 elsif ( $_[ 2 ] eq "n" ) 2404 { #Write a newline to a file 2405 print OUT_SH "$newline"; 2406 print OUT_BAT "$newline" if defined($outfile_bat); 2407 } 2408 elsif ( $_[ 2 ] eq "z" ) 2409 { 2410 #Write first argument as is, and nothing else 2411 print OUT_SH "$_[ 0 ]$newline"; 2412 } 2413 else 2414 { print "Unknown type!$newline"; 2415 } 2416} 2417#---------------------------------------------------------- 2418# Function name: PathFormat 2419# Description: Reformat path to either POSIX or mixed mode style. 2420# Arguments: 1. Variable (string) 2421# Return value: Reformatted String 2422#---------------------------------------------------------- 2423sub PathFormat 2424{ my ( $variable, $d1, $d2 ); 2425 $variable = $_[ 0 ]; 2426 2427 if ( $platform =~ m/cygwin/ ) 2428 { $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables 2429 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice! 2430 2431 # Complain if PosixPath is used on a PATH-like string 2432 if ( $variable =~ m/;/ ) { 2433 die( "Do not use on PATH lists (i.e., 'c:\\foo;d:\\bar')"); 2434 } 2435 2436 # Replace path with space with short dos path 2437 if ( $variable =~ / / ) { 2438 chomp( $variable = qx{cygpath -d "$variable"} ) ; 2439 } 2440 2441 # Replace absolute paths or DOS paths with ... 2442 if ( ( $variable =~ m/^\// ) or ( $variable =~ m/:/ ) ) { 2443 # mixed mode paths 2444 chomp( $variable = qx{cygpath -m "$variable"} ); 2445 } 2446 } 2447 return $variable; 2448} 2449#---------------------------------------------------------- 2450# Function name: CygFormat 2451# Description: Format variables to cygwin posix style path 2452# unless . 2453# Arguments: 1. Variable (string) 2454# Return value: Reformatted String 2455#---------------------------------------------------------- 2456sub CygFormat 2457{ my ( $variable, $d1, $d2 ); 2458 $variable = $_[ 0 ]; 2459 # ToDo: Do the replacement only if Windows and var contains "\" and ":" 2460 if ( $platform =~ m/cygwin|os2/ ) 2461 { 2462 # Complain if PosixPath is used on a PATH-like string 2463 if ( $variable =~ m/;/ ) { 2464 die( "Do not use on PATH lists (i.e., 'c:\\foo;d:\\bar')"); 2465 } 2466 2467 # Replace DOS paths with posix paths 2468 if ( ( $variable =~ m/\\/ ) or ( $variable =~ m/:/ ) ) { 2469 chomp( $variable = qx{cygpath -u "$variable"} ); 2470 } 2471 } 2472 return $variable; 2473} 2474#---------------------------------------------------------- 2475# Function name: WinFormat 2476# Description: Format variables to Windows Format. 2477# Arguments: 1. Variable (string) 2478# Return value: Reformatted String 2479#---------------------------------------------------------- 2480sub WinFormat 2481{ my ( $variable, $d1 ); 2482 $variable = $_[ 0 ]; 2483 $variable =~ s/^\s+//g ; #remove leading spaces 2484 $variable =~ s/\s+$//g ; #remove trailing spaces 2485 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables 2486 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice! 2487 $variable =~ s/:+/:/g ; # remove multiple ; 2488 2489 # Some variables are already in DOS path format, return early. 2490 if ( $variable =~ /\\/ ) { 2491 return $variable; 2492 } 2493 if ( $variable eq ";" ) { 2494 # Ignore single ';' 2495 return $variable; 2496 } 2497 if ( $variable =~ /;/ and $variable =~ /\// ) { 2498 # Mixed mode path-style entry, separated with ;, like CLASSPATH 2499 return $variable; 2500 } 2501 2502 # Search for posix path entry and replace with cygpath -w entry 2503 # ( -d if filename contains space ) 2504 2505 # Normal paths 2506 2507 # One special case is if "perl " is prepended. 2508 $variable =~ /^(perl\s+)?(.*)$/; 2509 my $perlpre = $1; 2510 if ( !defined($perlpre) ) { 2511 $perlpre = ""; 2512 } 2513 $variable = $2; 2514 2515 if ( $variable =~ /^\/[\w\.~ ]+/ ) { 2516 if ( $variable =~ / / ) { 2517 # Use DOS 8.3 style to avoid quoting 2518 chomp( $variable = qx{cygpath -d "$variable"} ); 2519 } else { 2520 # Use "normal" filenames 2521 chomp( $variable = qx{cygpath -w "$variable"} ); 2522 } 2523 } else { 2524 # relative or absolute DOS paths here 2525 $variable =~ s#/#\\#g; 2526 } 2527 2528 $variable = $perlpre.$variable; 2529 if ( ($perlpre ne "") && ($^O eq "cygwin")) { 2530 # Cygwin's perl needs quoted backslashes 2531 $variable =~ s#\\#\\\\#g; 2532 } 2533 2534 return $variable; 2535} 2536 2537#---------------------------------------------------------- 2538# Function name: WinPath 2539# Description: Reformat a $sep separated path using DOS paths. 2540# Arguments: 1. Variable (string) 2541# 2. Separator (string) 2542# Return value: Reformatted String 2543#---------------------------------------------------------- 2544sub WinPath 2545{ 2546 my ( $variable, $d1, $sep, @split_var ); 2547 2548 if ( $platform =~ m/cygwin/ ) { 2549 $variable = $_[ 0 ]; 2550 $sep = $_[ 1 ]; 2551 $variable =~ s/^\s+//g ; #remove leading spaces 2552 $variable =~ s/\s+$//g ; #remove trailing spaces 2553 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables 2554 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice! 2555 2556 @split_var = split(/$sep/,$variable); 2557 foreach $d1 ( @split_var ) { 2558 if ( $d1 =~ /(?:^\/[\w\.~ ]+)+/ ) { 2559 if ( $d1 =~ / / ) { 2560 # Use DOS 8.3 style to avoid quoting 2561 chomp( $d1 = qx{cygpath -d "$d1"} ); 2562 } else { 2563 # Use "normal" filenames 2564 chomp( $d1 = qx{cygpath -w "$d1"} ); 2565 } 2566 } 2567 } 2568 $variable = join(';',@split_var); 2569 2570 $variable =~ s/\//\\/g; # Remaining \ come from e.g.: ../foo/baa 2571 } 2572 2573 return $variable; 2574} 2575 2576#-------------------------------------------------------- 2577# Function name: GetCorrectPath 2578# Description: Creates the build environment. 2579# Arguments: 1. existing / original path 2580# 2... pairs of <path, executable> 2581# Return value: String - Correct Path 2582#-------------------------------------------------------- 2583sub GetCorrectPath 2584{ 2585 sub PathLookup 2586 { 2587 my $cmd = shift; 2588 while (@_) { 2589 my $elem = shift; 2590 2591 -x "$elem/$cmd" && return $elem; 2592 } 2593 return ''; 2594 } 2595 2596 sub SaneGrep 2597 { 2598 # Perl grep is unbelievably strange. 2599 my $needle = shift; 2600 while (@_) { 2601 my $haystack = shift; 2602 if ($needle eq $haystack) { 2603 return 1; 2604 } 2605 } 2606 return 0; 2607 } 2608 2609 sub CleanupPath 2610 { 2611 my @elements = @_; 2612 my @cleanName = (); 2613 2614 while (@elements) { 2615 my $elem = shift @elements; 2616 if (!SaneGrep ($elem, @cleanName)) { 2617 push @cleanName, $elem; 2618 } 2619 } 2620 2621 return @cleanName; 2622 } 2623 2624 my $oldPath = shift; 2625 my @originalPairs = @_; 2626 my @pairs = @originalPairs; 2627 my @Path = split /$ps/, $oldPath; 2628 my @buildPath; 2629 my @sysPath; 2630 my $elem; 2631 2632 for $elem (@Path) { 2633 if ($elem eq '.' || $elem =~ m'^$SOLARENV/' || 2634 $elem =~ m'/solenv/') { 2635 push @buildPath, $elem; 2636 } else { 2637 push @sysPath, $elem; 2638 } 2639 } 2640 2641 while (@pairs) { 2642 my $path = shift @pairs; 2643 my $cmd = shift @pairs; 2644 my $to_append = 1; 2645 2646 if (! -x "$path/$cmd") { 2647 AddWarning ("Missing executable $path/$cmd\n"); 2648 } 2649 2650 for $elem (@sysPath) { 2651 if ($elem eq $path) { 2652# print "Hit duplicate path in path; break\n"; 2653 $to_append = 0; 2654 last; 2655 } 2656 if (-f "$elem/$cmd" && ! -l "$elem/$cmd") { 2657# print "Element already in path ...\n"; 2658 unshift @sysPath, $path; 2659 $to_append = 0; 2660 last; 2661 } else { 2662# print "No file $elem/$cmd\n"; 2663 } 2664 } 2665 if ($to_append) { 2666 push @sysPath, $path; 2667 } 2668 } 2669 2670 @pairs = @originalPairs; 2671 while (@pairs) { 2672 my $path = shift @pairs; 2673 my $cmd = shift @pairs; 2674 my $realpath; 2675 2676 $realpath = PathLookup ($cmd, @sysPath); 2677 if (!($realpath eq $path)) { 2678 AddWarning ("Path conflict for executables " . 2679 "$path/$cmd against $realpath"); 2680 } 2681 } 2682 2683 return join $ps, @buildPath, CleanupPath (@sysPath); 2684} 2685 2686#------------------------------------------------------------ 2687# Function name: AddWarning 2688# Description: Adds any kind of warning for the user. 2689# The warning will be shown at the end 2690# of this script. 2691# Arguments: 1. Add the configure warnings or the set_soenv 2692# warning (string). 2693# 2. Warning (string). 2694# Return value: void 2695#------------------------------------------------------------ 2696sub AddWarning 2697{ if ( $_[ 0 ] eq "configure" ) 2698 { open( IN, $warnfile ); 2699 while ( <IN> ) 2700 { $Warning = $Warning."* - ".$_; 2701 } 2702 close( IN ); 2703 # Remove the temporary warning file. 2704 # unlink ( $warnfile ); 2705 } 2706 elsif ( $_[ 0 ] eq "set_soenv" ) 2707 { my ( $arg1 ); 2708 $arg1 = $_[ 1 ]; 2709 chomp( $arg1 ); # cut off new line 2710 $Warning = $Warning."* - set_soenv: warning: $arg1 $newline"; # add the warning 2711 } 2712} 2713#------------------- 2714# That's all folks! 2715#------------------- 2716