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