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 $ILIB .= $wps.$DIRECTXSDK_LIB; 1082 if ( '@COMEX@' eq "10" ) { 1083 # .NET2003 provides and compiles against DirectX 5 libraries and is 1084 # hereby still Win9x compatible. 1085 $ILIB .= $wps.'$COMPATH'.$ds.'PlatformSDK'.$LIB; 1086 $USE_DIRECTX5 = "YES"; 1087 } 1088 } 1089 # ILIB needs to use '\' directory seperators; 1090 $ILIB = WinPath( $ILIB, ";" ); 1091 } 1092 elsif ( $COM eq "GCC" ) 1093 { $ILIB .= $wps.$SOLARVER.$ds.$INPATH.$LIB. 1094 $wps.$SOLARVER.$ds.$INPATH.$BIN. 1095 $wps.$JAVA_HOME.$LIB; 1096 if ( $USE_MINGW eq "cygwin" ) 1097 { $ILIB .= $wps.PathFormat($USR.$LIB.$ds."mingw"). 1098 $wps.PathFormat($USR.$LIB.$ds."w32api"); 1099 } 1100 else 1101 { $ILIB .= $wps.$COMPATH.$LIB; 1102 } 1103 $ILIB .= $wps.PathFormat("@MINGW_CLIB_DIR@"). 1104 $wps.$PSDK_HOME.$LIB; 1105 if ( '@ENABLE_DIRECTX@' ) 1106 { $ILIB .= $wps.PathFormat("@DIRECTXSDK_LIB@"); 1107 } 1108 } 1109 1110 $JAVAHOME = '$JAVA_HOME'; 1111 1112} 1113 1114# The general environment path. 1115if ($platform =~ m/linux|netbsd|odf1|freebsd|aix|solaris/) 1116{ $PATH = $cur_dir. 1117# $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN. 1118 $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN. 1119 $ps.'$SOLARENV'.$BIN; 1120 1121 if ($platform =~ m/solaris/) { 1122 $PATH .= $ps.$USR_CCS.$BIN; 1123 } 1124 1125 $PATH .= $ps.$oldPATH; 1126 1127 my @javaBits; 1128 if (( $JAVA_HOME ne "" ) && ( $JDK ne "gcj" )) { 1129 @javaBits = ( '$JAVA_HOME'.$BIN, 'javac' ); 1130 } else { 1131 @javaBits = (); 1132 } 1133 $PATH = GetCorrectPath ($PATH, 1134 $COMPATH, $CC, 1135 $PERL_PATH, 'perl', 1136 @javaBits); 1137} 1138 1139elsif ($platform =~ m/cygwin/) 1140{ # The PATH variable is completely created from scratch. Elements 1141 # from oldPATH that are not yet included are appended to PATH at 1142 # the end. 1143 1144 my ( $tmppath ); 1145 1146 $PATH = $cur_dir. 1147# $ps.CygFormat($SOLARVER).$ds.$INPATH.$BIN. 1148 $ps.CygFormat($SOLARENV).$ds."bin". 1149 $ps.CygFormat($SOLARENV).$ds.$OUTPATH.$BIN; 1150 1151 if ( $JAVA_HOME ne "" ) 1152 { 1153 # hack either "hotspot" or "client" should be used, depending on the jdk version: 1154 # 1.2.x - no such directory, unsupported 1155 # 1.3.x - hotspot, client missing 1156 # 1.4.x - client, hotspot missing 1157 1158 $PATH .= $ps.CygFormat($JAVA_HOME).$BIN; 1159 if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot" ) { 1160 $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."hotspot"; 1161 } 1162 if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."client" ) { 1163 $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."client"; 1164 } 1165 } 1166 1167 # Add path to compiler 1168 $tmppath = CygFormat($COMPATH).$BIN; 1169 $tmppath =~ s/^\/\//\//; 1170 $PATH .= $ps.$tmppath; 1171 1172 if ( $COM eq "MSC" ) { 1173 $tmppath = CygFormat($MSPDB_PATH); 1174 # for .NET to find mspdb71.dll (needed by CL.EXE C/C++ Compiler) 1175 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1176 $PATH .= $ps.$tmppath; 1177 } 1178 if ( ( $COMEX ge "10" ) ) { 1179 # .NET needs midl.exe 1180 $tmppath = CygFormat($MIDL_PATH); 1181 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1182 $PATH .= $ps.$tmppath; 1183 } 1184 # .NET needs csc.exe 1185 $tmppath = CygFormat($CSC_PATH); 1186 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1187 $PATH .= $ps.$tmppath; 1188 } 1189 # Native installer needs some files if the Windows Installer SDK 1190 $tmppath = CygFormat($PSDK_HOME); 1191 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) { 1192 $PATH .= $ps.$tmppath.$BIN; 1193 } 1194 } 1195 } else { # Mingw is different 1196 # Native installer needs some files if the Windows Installer SDK 1197 $tmppath = CygFormat($PSDK_HOME); 1198 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) { 1199 $PATH .= $ps.$tmppath.$BIN; 1200 } 1201 } 1202 1203 if ( $ASM_PATH ne "ASM_IN_PATH" ) 1204 { $PATH .= $ps.CygFormat($ASM_PATH); 1205 } 1206 # zip.exe / unzip.exe path for Windows users. 1207 my $zip_home_path = PathFormat('@ZIP_HOME@'); 1208 $tmppath = CygFormat($zip_home_path); 1209 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1210 $PATH .= $ps.$tmppath; 1211 } 1212 1213 # Possible cygwin paths must follow behind the OOo and MS paths 1214 1215 # Check if $PERL_PATH is already set in PATH 1216 $tmppath = CygFormat($PERL_PATH); 1217 if ( ! ( $PATH =~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) ) 1218 { 1219 $PATH .= $ps.$tmppath; 1220 } 1221 # Check if $CYGWIN_PATH is already set in PATH 1222 $tmppath = CygFormat($CYGWIN_PATH); 1223 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1224 $PATH .= $ps.$tmppath; 1225 } 1226 $PATH .= $ps_STLPORT_LIB; 1227 # nsis path for Windows users. 1228 $NSIS_PATH = PathFormat('@NSIS_PATH@'); 1229 $tmppath = CygFormat($NSIS_PATH); 1230 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1231 $PATH .= $ps.$tmppath; 1232 } 1233 # path to sn.exe (signing) for Windows users. 1234 my $sn_path = PathFormat('@FRAME_HOME@/bin'); 1235 $tmppath = CygFormat($sn_path); 1236 if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) { 1237 $PATH .= $ps.$tmppath; 1238 } 1239 1240 1241 # Add the rest of the original path if it is still missing. 1242 if (($^O eq "cygwin")) { # Not for ActiveState perl 1243 my $expandedPATH = $PATH; 1244 $expandedPATH =~ s/(\$\w+)/$1/eeg; 1245 1246 # fix situations where PATH may look like /bin:"C:\blah\bleh":/ugh 1247 my $fixedPATH = $oldPATH; 1248 if ( $oldPATH =~ /"/ ) { 1249 $fixedPATH = ""; 1250 foreach my $pathentry ( split( '"',$oldPATH ) ) { 1251 if ( ( $pathentry =~ /^$ps/ ) || ( $pathentry =~ /$ps$/ ) ) { 1252 $fixedPATH .= $pathentry; 1253 } else { 1254 chomp( $pathentry = qx{cygpath -d "$pathentry"} ) ; 1255 chomp( $pathentry = qx{cygpath -u "$pathentry"} ) ; 1256 $fixedPATH .= $pathentry; 1257 } 1258 } 1259 } 1260 1261 foreach my $pathentry (split($ps,$fixedPATH)) { 1262 if ( ! ( $expandedPATH =~ /(?:$ps|\A)(?:$pathentry)(?:$ps|\Z)/ ) ) { 1263 $PATH .= $ps.$pathentry; 1264 $expandedPATH .= $ps.$pathentry; 1265 } 1266 } 1267 } else { 1268 $PATH .= $ps.$oldPATH; 1269 } 1270 1271 # The path now is in cygwin posix format 1272 1273} 1274 1275elsif ($platform =~ m/os2/) 1276{ # The PATH variable is completely created from scratch. Everything that is not 1277 # needed is appended to the end. 1278 1279 $PATH = $cur_dir. 1280# $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN. 1281 $ps.'$SOLARENV'.$ds."bin". 1282 $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN; 1283 1284 if ( $JAVA_HOME ne "" ) 1285 { 1286 # hack either "hotspot" or "client" should be used, depending on the jdk version: 1287 # 1.2.x - no such directory, unsupported 1288 # 1.3.x - hotspot, client missing 1289 # 1.4.x - client, hotspot missing 1290 1291 $PATH .= $ps.$JAVA_HOME.$BIN; 1292 if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot" ) { 1293 $PATH .= $ps.$JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot"; 1294 } 1295 if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."client" ) { 1296 $PATH .= $ps.$JAVA_HOME.$ds."jre".$ds."bin".$ds."client"; 1297 } 1298 } 1299 1300 # Append old PATH 1301 my $temp = $oldPATH; 1302 $temp =~ s/\\/\//g ; 1303 $PATH .= $ps.$temp; 1304} 1305 1306elsif ($platform =~ m/darwin/) 1307{ $PATH = $cur_dir. 1308# $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN. 1309 $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN. 1310 $ps.'$SOLARENV'.$BIN; 1311 1312 # Append old PATH 1313 $PATH .= $ps.$oldPATH; 1314} 1315else 1316{ AddWarning( "set_soenv", "$platform not configured for general environment paths" ); 1317} 1318 1319# Linker library search directory paths. 1320if ($platform =~ m/solaris/) 1321{ $SOLARLIB = $L.$par_dir.$LIB. 1322 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB. 1323 $L.'$SOLARVER'.$ds.'$INPATH'.$LIB. 1324 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB. 1325 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB."solaris.2.6". 1326 $L.$LIB. 1327 $L.$USR_LIB; 1328 if ( $CC =~ "gcc" ) { 1329 $SOLARLIB .= $L.$COMPATH.$LIB; 1330 } 1331 $SOLARLIB .= $L.$USR_LOCAL.$LIB. 1332 $L.$USR_DT.$LIB. 1333 $L.$USR_OPENWIN.$LIB. 1334 $L.'$JAVA_HOME'.$LIB. 1335 $L.$JRELIBDIR. 1336 $L.$JRETOOLKITDIR. 1337 $L.$JRETHREADDIR. 1338 $L_STLPORT_LIB. 1339 $L.$XLIB; 1340} 1341elsif ($platform =~ m/linux|netbasd|osf1|aix|freebsd/) 1342{ $SOLARLIB = $L.$par_dir.$LIB. 1343 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB. 1344 $L.'$SOLARVER'.$ds.'$INPATH'.$LIB. 1345 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB. 1346 $L.'$JAVA_HOME'.$LIB64. 1347 $L.$JRELIBDIR. 1348 $L.$JRETOOLKITDIR. 1349 $L.$JRETHREADDIR. 1350 $L_STLPORT_LIB. 1351 $L.$XLIB; 1352} 1353elsif ($platform =~ m/cygwin|os2/) 1354{ $SOLARLIB = $L.'$SOLARVER'.$ds.'$INPATH'.$LIB. 1355 $L.$par_dir.$LIB. 1356 $L_STLPORT_LIB. 1357 $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB; 1358} 1359elsif ($platform =~ m/darwin/) 1360{ $SOLARLIB = $L.'$SOLARVER'.$ds.'$INPATH'.$LIB. 1361 $L_STLPORT_LIB. 1362 $L.$USR_LIB; 1363 # [ed] 6/15/02 Add in X11 libraries onto the library path 1364 if ($GUIBASE eq "unx") { 1365 $SOLARLIB .= $L.$XLIB; 1366 } 1367 1368} 1369 1370if ($SYSTEM_MOZILLA eq "YES") 1371{ 1372 $SOLARLIB .= $L."@MOZ_LIB@" 1373} 1374 1375# Location of the compiler include search directory paths. 1376$SOLARINC = $I.$cur_dir. 1377 $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."stl". 1378 $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."external". 1379 $I.'$SOLARVER'.$ds.'$INPATH'.$INC. 1380 $I.'$SOLARENV'.$ds.'$OUTPATH'.$INC. 1381 $I.'$SOLARENV'.$INC. 1382 $I.'$SRC_ROOT'.$ds."res"; 1383 1384if ($platform =~ m/solaris|linux|osf1|freebsd|netbsd/) 1385{ 1386$SOLARINC .= $STLPORT_stlport; 1387if ($platform =~ m/linux|freebsd|netbsd/) 1388{ 1389# This simply adds an include path, so even cases that break the FHS work 1390$SOLARINC .= $STLPORT_inc_stlport; 1391} 1392if ($platform =~ m/solaris/ && ! $CC =~ "gcc") 1393{ 1394$SOLARINC .= '/SC5 '; 1395} 1396# Platform dependent include path at the top of this list of include paths 1397if ($platform =~ m/solaris/) 1398{ 1399 $SOLARINC .= $I.$COMPATH.$ds."include"; 1400} 1401if ($platform =~ m/linux/) 1402{ 1403# This simply adds an include path, so even cases that break the FHS work 1404 $SOLARINC .= $STLPORT_inc_stlport; 1405} 1406 1407 1408 $SOLARINC .= $I.'$SOLARENV'.$INC.$ds."Xp31". 1409 $I.'$JAVA_HOME'.$INCLUDE; 1410 1411 #include system dependent Java include directory 1412 if (!($JDK eq "gcj")) 1413 { 1414 if ($platform =~ m/solaris/) 1415 { $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."solaris"; 1416 } 1417 elsif ($platform =~ m/linux|osf1/) 1418 { $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."linux"; 1419 } 1420 elsif ($platform =~ m/freebsd/) 1421 { 1422 $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."freebsd"; 1423 $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."bsd"; 1424 $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."linux"; 1425 } 1426 elsif ($platform =~ m/netbsd/) 1427 { $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."netbsd"; 1428 } 1429 1430 #java threads include path 1431 1432 $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."native_threads".$ds."include"; 1433 } 1434 #The tail, if needed 1435 if ($platform =~ m/linux|freebsd|netbsd/) 1436 { $SOLARINC .= $I.$XINC; 1437 } 1438 elsif ($platform =~ m/osf1/) 1439 { $SOLARINC .= $I.$XINC. 1440 $I.$USR.$INCLUDE; 1441 } 1442} 1443elsif ($platform =~ m/cygwin/) 1444{ $SOLARINC .= $STLPORT_stlport. 1445 $I.'$JAVA_HOME'.$ds."include".$ds."win32". 1446 $I.'$JAVA_HOME'.$ds."include"; 1447 # Mingw is different 1448 if ( $COM eq "MSC" ) 1449 { $SOLARINC .= $I.'$PSDK_HOME'.$INCLUDE. 1450 $I.'$COMPATH'.$ds."include"; 1451 if ( '@ENABLE_DIRECTX@' ne "" ) { 1452 $SOLARINC .= $I.PathFormat('@DIRECTXSDK_HOME@').$INCLUDE; 1453 if ( '@COMEX@' eq "10" ) { 1454 # .NET2003 provides and compiles against DirectX 5 libraries and is 1455 # hereby still Win9x compatible. 1456 $SOLARINC .= $I.'$COMPATH'.$ds.'PlatformSDK'.$ds."include"; 1457 } 1458 } 1459 } 1460 elsif ( $COM eq "GCC" ) 1461 { $SOLARINC .= $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."external".$ds."mingw".$ds."include"; 1462 if ( $USE_MINGW eq "cygwin" ) 1463 { $SOLARINC .= $I.PathFormat($USR.$ds."include".$ds."mingw"). 1464 $I.PathFormat($USR.$ds."include".$ds."w32api"). 1465 $I.PathFormat($USR.$ds."include"); } 1466 else 1467 { $SOLARINC .= $I.'$COMPATH'.$ds."include"; } 1468 @mingw_lib_include_paths = split( / /, "@MINGW_LIB_INCLUDE_PATH@" ); 1469 $SOLARINC .= $I.PathFormat("@MINGW_BACKWARD_INCLUDE_PATH@"); 1470 foreach $mingw_lib_include_path (@mingw_lib_include_paths) 1471 { chomp $mingw_lib_include_path; 1472 if ( $mingw_lib_include_path ne $COMPATH.$ds."include" && $mingw_lib_include_path ne "" ) 1473 { 1474 $SOLARINC .= $I.PathFormat($mingw_lib_include_path); 1475 } 1476 } 1477 $SOLARINC .= $I.PathFormat("@GXX_INCLUDE_PATH@").$I.PathFormat("@GXX_INCLUDE_PATH@".$ds."mingw32"). 1478 $I.'$PSDK_HOME'.$INCLUDE; 1479 } 1480 if ( '@ENABLE_DIRECTX@' ne "" ) { 1481 $SOLARINC .= $I.PathFormat('@DIRECTXSDK_HOME@').$INCLUDE; 1482 } 1483} 1484elsif ($platform =~ m/darwin/) 1485{ $SOLARINC .= $STLPORT_stlport. 1486 $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Versions".$ds."Current".$ds."Headers". 1487 $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Headers"; 1488 # [ed] 6/15/02 Add in X11 headers as appropriate for the build 1489 if ($GUIBASE eq "unx") { 1490 $SOLARINC .= $I.$XINC. 1491 $I.$XINC.$ds."freetype2"; 1492 } 1493} 1494else 1495{ AddWarning( "set_soenv", "$platform not configured for system dependant include dir" ); 1496} 1497 1498# 1499print "done\n"; 1500$gb_REPOS = $SRC_ROOT; 1501my $BUILD_TYPE = "@BUILD_TYPE@"; 1502 1503if ('@WITH_LANG@' ne "") 1504{ 1505 $gb_REPOS .= " ".$SOURCE_ROOT_DIR."/extras"; 1506 $BUILD_TYPE = "@BUILD_TYPE@ L10N"; 1507} 1508 1509# 1510# F. Setting the different aliases. 1511# 1512print "Setting the aliases... "; 1513# 1. alias for a full product make. 1514 $mkout = '"perl $SOLARENV/bin/mkout.pl"'; 1515 $deliver = '"perl $SOLARENV/bin/deliver.pl"'; 1516 $build = '"perl $SOLARENV/bin/build.pl"'; 1517 $build_client = '"perl $SOLARENV/bin/build_client.pl"'; 1518 $zipdep = '"perl $SOLARENV/bin/zipdep.pl"'; 1519# 3. alias for a full product make 1520$nmake = '"dmake"'; 1521print "done\n"; 1522# 1523#-------------------------- 1524# VI. Open the output file. 1525#-------------------------- 1526# 1527open( OUT, ">$outfile" ) || 1528 die "Cannot open $outfile: $!\n"; 1529 1530# Create sh environment file 1531open( OUT_SH, ">$outfile_sh" ) || 1532 die "Cannot open $outfile_sh: $!\n"; 1533 1534# 1535#------------------------------------------ 1536# VII. Writing the data to the output file. 1537#------------------------------------------ 1538# 1539# Write file header. 1540CreateFileHeader( *OUT, $UPD, $platform, "(t)csh", "#" ); 1541CreateFileHeader( *OUT_SH, $UPD, $platform, "sh/bash/ksh", "#" ); 1542 1543ToFile( "SRC_ROOT", $SRC_ROOT, "e" ); 1544ToFile( "OOO_SHELL", $OOO_SHELL, "e" ); 1545ToFile( "JAVA_HOME", $JAVA_HOME, "e" ); 1546ToFile( "ANT_HOME", PathFormat("@ANT_HOME@"), "e" ); 1547ToFile( "ANT_LIB", PathFormat("@ANT_LIB@"), "e" ); 1548ToFile( "ANT", PathFormat("@ANT@"), "e" ); 1549ToFile( "JDKLIB", $JAVA_LIB, "e" ); 1550ToFile( "STLPORT4", $STLPORT4, "e" ); 1551ToFile( "STLPORT_VER", "@STLPORT_VER@", "e" ); 1552ToFile( "ASM_PATH", $ASM_PATH, "e" ); 1553ToFile( "BUILD_SOSL", $BUILD_SOSL, "e" ); 1554ToFile( "FRAMEWORKSHOME", $FRAMEWORKSHOME, "e" ); 1555ToFile( "Empty", $empty, "n" ); 1556 1557# 1558# Writing the platform independent constant values to file. 1559# (c = comment, e = environment variable, a = alias ) 1560ToFile( "Platform independent constant values.", $empty, "c" ); 1561# dictionaries 1562if ('@WITH_DICT@' =~ m/ALL,/s) 1563{ 1564 foreach $dict (@DICTIONARIES) 1565 { 1566 ToFile( "DIC_$dict", "TRUE", "e" ); 1567 } 1568 ToFile( "DIC_ALL", "TRUE", "e" ); 1569} 1570else 1571{ 1572 foreach $dict (@DICTIONARIES) 1573 { if ('@WITH_DICT@' =~ m/$dict,/s) 1574 { my $val="TRUE"; 1575 ToFile( "DIC_$dict", $val, "e" ); 1576 } 1577 else 1578 { my $val; 1579 undef $val; 1580 ToFile( "DIC_$dict", $val, "e" ); 1581 } 1582 } 1583} 1584# Languages 1585ToFile( "WITH_LANG", "@WITH_LANG@", "e" ); 1586ToFile( "INTRO_BITMAPS", "@INTRO_BITMAPS@", "e" ); 1587ToFile( "ABOUT_BITMAPS", "@ABOUT_BITMAPS@", "e" ); 1588ToFile( "OOO_VENDOR", "@OOO_VENDOR@", "e" ); 1589ToFile( "OOODMAKEMODE", "YES", "e" ); 1590ToFile( "WITH_POOR_HELP_LOCALIZATIONS", "@WITH_POOR_HELP_LOCALIZATIONS@", "e" ); 1591 1592ToFile( "CALL_CDECL", $CALL_CDECL, "e" ); 1593ToFile( "COMMON_OUTDIR", $COMMON_OUTDIR, "e" ); 1594ToFile( "common_build", $common_build, "e" ); 1595ToFile( "BMP_WRITES_FLAG", $BMP_WRITES_FLAG, "e" ); 1596ToFile( "BUILD_SOSL_RELEASE", $BUILD_SOSL_RELEASE, "e" ); 1597ToFile( "NO_REC_RES", $NO_REC_RES, "e" ); 1598ToFile( "SO3", $SO3, "e" ); 1599ToFile( "SOLAR_PLUGIN", $SOLAR_PLUGIN, "e" ); 1600ToFile( "UPDATER", $UPDATER, "e" ); 1601ToFile( "build_deliver", $BUILD_DELIVER, "e" ); 1602ToFile( "VCL", $VCL, "e" ); 1603ToFile( "ENABLEUNICODE", $ENABLEUNICODE, "e" ); 1604ToFile( "NEW_JAR_PACK", $NEW_JAR_PACK, "e" ); 1605ToFile( "NO_BSYMBOLIC", $NO_BSYMBOLIC, "e" ); 1606ToFile( "TF_FILTER", "TRUE", "e" ); 1607if ("@ENABLE_DEBUG@" eq "TRUE") { 1608ToFile( "debug", "true", "e" ); 1609} 1610if ("@ENABLE_WERROR@" eq "FALSE") { 1611ToFile( "EXTERNAL_WARNINGS_NOT_ERRORS", "TRUE", "e" ); 1612} 1613ToFile( "PRODUCT", "@PRODUCT@", "e" ); 1614ToFile( "PROFULLSWITCH", "@PROFULLSWITCH@", "e" ); 1615ToFile( "PROEXT", $PROEXT, "e" ); 1616ToFile( "VALGRIND_CFLAGS", "@VALGRIND_CFLAGS@", "e" ); 1617ToFile( "UNIXWRAPPERNAME", "@UNIXWRAPPERNAME@","e" ); 1618ToFile( "BUILD_MOZAB", "@BUILD_MOZAB@", "e" ); 1619ToFile( "PREBUILD_MOZAB", $PREBUILD_MOZAB, "e" ); 1620ToFile( "MOZILLA_VERSION", $MOZILLA_VERSION, "e" ); 1621ToFile( "DEFAULT_MOZILLA_TOOLKIT", $MOZILLA_TOOLKIT, "e" ); 1622ToFile( "ENABLE_NSS_MODULE", "@ENABLE_NSS_MODULE@", "e" ); 1623ToFile( "MOZILLABUILD", "@MOZILLABUILD@", "e" ); 1624ToFile( "BUILD_VER_STRING", "@BUILD_VER_STRING@", "e" ); 1625if ($platform =~ m/linux/ && $platform =~ m/powerpc/) { 1626ToFile( "JITC_PROCESSOR_TYPE","6", "e" ); 1627} 1628ToFile( "DEFAULT_TO_ENGLISH_FOR_PACKING", "yes", "e" ); 1629ToFile( "ENABLE_GTK", "@ENABLE_GTK@", "e" ); 1630ToFile( "GTK_CFLAGS", "@GTK_CFLAGS@", "e" ); 1631ToFile( "GTK_LIBS", "@GTK_LIBS@", "e" ); 1632ToFile( "GTHREAD_CFLAGS", "@GTHREAD_CFLAGS@", "e" ); 1633ToFile( "GTHREAD_LIBS", "@GTHREAD_LIBS@", "e" ); 1634ToFile( "ENABLE_SYSTRAY_GTK", "@ENABLE_SYSTRAY_GTK@", "e" ); 1635ToFile( "ENABLE_STATIC_GTK", "@ENABLE_STATIC_GTK@", "e" ); 1636ToFile( "ENABLE_GSTREAMER", "@ENABLE_GSTREAMER@", "e" ); 1637ToFile( "ENABLE_CAIRO", "@ENABLE_CAIRO@", "e" ); 1638ToFile( "ENABLE_CAIRO_CANVAS", "@ENABLE_CAIRO_CANVAS@", "e" ); 1639ToFile( "ENABLE_OPENGL", "@ENABLE_OPENGL@", "e" ); 1640ToFile( "ENABLE_PDFIMPORT", "@ENABLE_PDFIMPORT@", "e" ); 1641ToFile( "ENABLE_PRESENTER_EXTRA_UI","@ENABLE_PRESENTER_EXTRA_UI@","e" ); 1642ToFile( "ENABLE_MINIMIZER", "@ENABLE_MINIMIZER@","e" ); 1643ToFile( "ENABLE_PRESENTER_SCREEN","@ENABLE_PRESENTER_SCREEN@","e" ); 1644ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" ); 1645ToFile( "SYSTEM_JFREEREPORT","@SYSTEM_JFREEREPORT@","e" ); 1646ToFile( "OOO_JUNIT_JAR", "@OOO_JUNIT_JAR@", "e" ); 1647ToFile( "SAC_JAR", "@SAC_JAR@", "e" ); 1648ToFile( "LIBXML_JAR", "@LIBXML_JAR@", "e" ); 1649ToFile( "FLUTE_JAR", "@FLUTE_JAR@", "e" ); 1650ToFile( "JFREEREPORT_JAR", "@JFREEREPORT_JAR@", "e" ); 1651ToFile( "LIBLAYOUT_JAR", "@LIBLAYOUT_JAR@", "e" ); 1652ToFile( "LIBLOADER_JAR", "@LIBLOADER_JAR@", "e" ); 1653ToFile( "LIBFORMULA_JAR", "@LIBFORMULA_JAR@", "e" ); 1654ToFile( "LIBREPOSITORY_JAR", "@LIBREPOSITORY_JAR@","e" ); 1655ToFile( "LIBBASE_JAR", "@LIBBASE_JAR@", "e" ); 1656ToFile( "LIBFONTS_JAR", "@LIBFONTS_JAR@", "e" ); 1657ToFile( "LIBSERIALIZER_JAR", "@LIBSERIALIZER_JAR@","e" ); 1658ToFile( "ENABLE_MEDIAWIKI", "@ENABLE_MEDIAWIKI@", "e" ); 1659ToFile( "SYSTEM_APACHE_COMMONS","@SYSTEM_APACHE_COMMONS@","e" ); 1660ToFile( "COMMONS_CODEC_JAR", "@COMMONS_CODEC_JAR@","e" ); 1661ToFile( "COMMONS_LANG_JAR", "@COMMONS_LANG_JAR@", "e" ); 1662ToFile( "COMMONS_HTTPCLIENT_JAR","@COMMONS_HTTPCLIENT_JAR@","e" ); 1663ToFile( "COMMONS_LOGGING_JAR","@COMMONS_LOGGING_JAR@","e" ); 1664ToFile( "SYSTEM_SERVLETAPI", "@SYSTEM_SERVLETAPI@", "e" ); 1665ToFile( "SERVLETAPI_JAR", "@SERVLETAPI_JAR@", "e" ); 1666ToFile( "ENABLE_DBUS", "@ENABLE_DBUS@", "e" ); 1667ToFile( "ENABLE_GCONF", "@ENABLE_GCONF@", "e" ); 1668ToFile( "ENABLE_GNOMEVFS", "@ENABLE_GNOMEVFS@", "e" ); 1669ToFile( "ENABLE_GIO", "@ENABLE_GIO@", "e" ); 1670ToFile( "ENABLE_KDE", "@ENABLE_KDE@", "e" ); 1671ToFile( "KDE_CFLAGS", "@KDE_CFLAGS@", "e" ); 1672ToFile( "KDE_LIBS", "@KDE_LIBS@", "e" ); 1673ToFile( "MOC", "@MOC@", "e" ); 1674ToFile( "ENABLE_KDE4", "@ENABLE_KDE4@", "e" ); 1675ToFile( "KDE4_CFLAGS", "@KDE4_CFLAGS@", "e" ); 1676ToFile( "KDE4_LIBS", "@KDE4_LIBS@", "e" ); 1677ToFile( "MOC4", "@MOC4@", "e" ); 1678ToFile( "ENABLE_KAB", "@ENABLE_KAB@", "e" ); 1679ToFile( "PSPRINT", "TRUE", "e" ); 1680ToFile( "MKDEPENDSOLVER", "TRUE", "e" ); 1681ToFile( "nodep", "@nodep@", "e" ); 1682ToFile( "TARFILE_LOCATION", $TARFILE_LOCATION, "e" ); 1683ToFile( "DO_FETCH_TARBALLS", "@DO_FETCH_TARBALLS@", "e" ); 1684# 1685# Writing the platform dependent constant values to file. 1686# (c = comment, e = environment variable, a = alias ) 1687ToFile( "Platform dependent constant values.", $empty, "c" ); 1688ToFile( "SOLAR_JAVA", $SOLAR_JAVA, "e" ); 1689ToFile( "BIG_SVX", $BIG_SVX, "e" ); 1690ToFile( "COM", $COM, "e" ); 1691ToFile( "COMPATH", $COMPATH, "e" ); 1692ToFile( "CPU", $CPU, "e" ); 1693ToFile( "CPUNAME", $CPUNAME, "e" ); 1694ToFile( "CVER", $CVER, "e" ); 1695ToFile( "GUI", $GUI, "e" ); 1696ToFile( "GLIBC", $GLIBC, "e" ); 1697ToFile( "GUIBASE", $GUIBASE, "e" ); 1698ToFile( "GVER", $GVER, "e" ); 1699ToFile( "OS", $OS, "e" ); 1700ToFile( "OSVERSION", $OSVERSION, "e" ); 1701ToFile( "PTHREAD_CFLAGS", "@PTHREAD_CFLAGS@", "e" ); 1702ToFile( "PTHREAD_LIBS", "@PTHREAD_LIBS@", "e" ); 1703ToFile( "OUTPATH", $OUTPATH, "e" ); 1704ToFile( "INPATH", $INPATH, "e" ); 1705ToFile( "PATH_SEPERATOR", $PATH_SEPERATOR, "e" ); 1706ToFile( "COMEX", $COMEX, "e" ); 1707ToFile( "CDPATHx", $CDPATHx, "e" ); 1708ToFile( "DYNAMIC_CRT", $DYNAMIC_CRT, "e" ); 1709ToFile( "SET_EXCEPTIONS", $SET_EXCEPTIONS, "e" ); 1710ToFile( "use_shl_versions", $use_shl_versions, "e" ); 1711ToFile( "FLIPCMD", $FLIPCMD, "e" ); 1712ToFile( "ARM_TARGET", "@ARM_TARGET@", "e" ); 1713if ( $platform =~ m/darwin/ ) 1714{ 1715# MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build, 1716# build can assume functions/libraries of that version to be available 1717# unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk 1718# (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro) 1719# http://developer.apple.com/technotes/tn2002/tn2064.html 1720 ToFile( "MACOSX_DEPLOYMENT_TARGET", "10.4", "e" ); 1721} 1722 1723# 1724# Writing the variables to file. 1725# (c = comment, e = environment variable, a = alias, n = newline ) 1726ToFile( "Variable values.", $empty, "c" ); 1727if ( $platform =~ m/cygwin/ ) 1728{ ToFile( "CYGWIN_PATH", $CYGWIN_PATH, "e" ); 1729 ToFile( "PSDK_HOME", $PSDK_HOME, "e" ); 1730 ToFile( "WINDOWS_VISTA_PSDK","@WINDOWS_VISTA_PSDK@","e" ); 1731 ToFile( "DIRECTXSDK_LIB", $DIRECTXSDK_LIB, "e" ); 1732 ToFile( "USE_DIRECTX5", $USE_DIRECTX5, "e" ); 1733 ToFile( "ATL_LIB", $ATL_LIB, "e" ); 1734 if ( $MINGW ne "yes" ) 1735 { ToFile( "ATL_INCLUDE", $ATL_INCLUDE, "e" ); 1736 } 1737 ToFile( "MFC_LIB", $MFC_LIB, "e" ); 1738 ToFile( "MFC_INCLUDE", $MFC_INCLUDE, "e" ); 1739 ToFile( "NSIS_PATH", $NSIS_PATH, "e" ); 1740 ToFile( "DISABLE_ACTIVEX", "@DISABLE_ACTIVEX@","e" ); 1741 ToFile( "DISABLE_ATL", "@DISABLE_ATL@","e" ); 1742 ToFile( "USE_NEW_SDK", $USE_NEW_SDK, "e" ); 1743 1744 # Hack around dmake's mktmp not generating DOS paths. 1745 my $tmpdir = qx{cygpath -m "/tmp"}; 1746 chomp($tmpdir); 1747 ToFile( "TMPDIR", $tmpdir, "e" ); 1748} 1749ToFile( "DISABLE_SAXON", "@DISABLE_SAXON@", "e" ); 1750ToFile( "DISABLE_HUNSPELL", "@DISABLE_HUNSPELL@", "e" ); 1751ToFile( "DISABLE_HYPHEN", "@DISABLE_HYPHEN@", "e" ); 1752ToFile( "DISABLE_LIBWPD", "@DISABLE_LIBWPD@", "e" ); 1753 1754 1755ToFile( "PERL", $PERL, "e" ); 1756ToFile( "RPM", "@RPM@", "e" ); 1757ToFile( "DPKG", "@DPKG@", "e" ); 1758ToFile( "PKGMK", "@PKGMK@", "e" ); 1759ToFile( "GNUMAKE", "@GNUMAKE@", "e" ); 1760ToFile( "GNUTAR", "@GNUTAR@", "e" ); 1761ToFile( "UPD", $UPD, "e" ); 1762ToFile( "WORK_STAMP", $WORK_STAMP, "e" ); 1763ToFile( "SOLARVER", $SOLARVER, "e" ); 1764ToFile( "SOLARVERSION", $SOLARVERSION, "e" ); 1765ToFile( "WORKDIR", $WORKDIR, "e" ); 1766ToFile( "OUTDIR", $OUTDIR, "e" ); 1767ToFile( "SOLARENV", $SOLARENV, "e" ); 1768ToFile( "SOLARENVINC", $SOLARENVINC, "e" ); 1769ToFile( "LOCALINI", $LOCALINI, "e" ); 1770ToFile( "STAR_INIROOT", $STAR_INIROOT, "e" ); 1771ToFile( "STAR_INIROOTOLD", $STAR_INIROOTOLD, "e" ); 1772ToFile( "STAR_STANDLST", $STAR_STANDLST, "e" ); 1773ToFile( "STAR_SSCOMMON", $STAR_SSCOMMON, "e" ); 1774ToFile( "STAR_SSOLARINI", $STAR_SSOLARINI, "e" ); 1775ToFile( "DMAKEROOT", $DMAKEROOT, "e" ); 1776if ( $JDK ne "gcj" ) { 1777 ToFile( "CLASSPATH", $CLASSPATH, "e" ); 1778 ToFile( "XCLASSPATH", $XCLASSPATH, "e" ); 1779} 1780else { 1781 ToFile( "JAVACISGCJ", '@JAVACISGCJ@', "e" ); 1782} 1783if ( $GUI eq "UNX" ) { 1784 ToFile( "AWTLIB", '@AWTLIB@', "e" ); 1785} 1786if ( '@JDK@' ne '' ) 1787{ 1788 ToFile( "JDK", "@JDK@", "e" ); 1789 ToFile( "JAVAFLAGS", "@JAVAFLAGS@", "e" ); 1790 ToFile( "JAVAINTERPRETER", PathFormat("@JAVAINTERPRETER@"), "e" ); 1791 ToFile( "JAVAIFLAGS", "@JAVAIFLAGS@", "e" ); 1792 ToFile( "JAVACOMPILER", PathFormat("@JAVACOMPILER@"), "e" ); 1793 ToFile( "JAVAAOTCOMPILER", PathFormat("@JAVAAOTCOMPILER@"), "e" ); 1794 ToFile( "JAVADOC", PathFormat("@JAVADOC@"), "e" ); 1795} 1796ToFile( "SCPDEFS", '@SCPDEFS@', "e" ); 1797ToFile( "SOLAREXTRAINC", $SOLAREXTRAINC, "e" ); 1798ToFile( "SOLAREXTRALIB", $SOLAREXTRALIB, "e" ); 1799ToFile( "PATH", $PATH, "e" ); 1800ToFile( "SOLARLIB", $SOLARLIB, "e" ); 1801ToFile( "SOLARINC", $SOLARINC, "e" ); 1802ToFile( "COMP_ENV", $COMP_ENV, "e" ); 1803ToFile( "JAVAHOME", $JAVAHOME, "e" ); 1804ToFile( "CC", $CC, "e" ); 1805ToFile( "HAVE_GCC_VISIBILITY_FEATURE", 1806 "@HAVE_GCC_VISIBILITY_FEATURE@", "e" ); 1807ToFile( "HAVE_LD_HASH_STYLE","@HAVE_LD_HASH_STYLE@","e" ); 1808ToFile( "HAVE_LD_BSYMBOLIC_FUNCTIONS", 1809 "@HAVE_LD_BSYMBOLIC_FUNCTIONS@","e" ); 1810ToFile( "CXX", $CXX, "e" ); 1811ToFile( "USE_CCACHE", "@USE_CCACHE@", "e" ); 1812ToFile( "MINGWCXX", "@MINGWCXX@", "e" ); 1813ToFile( "MINGWSTRIP", "@MINGWSTRIP@", "e" ); 1814ToFile( "USE_SYSTEM_STL", "@USE_SYSTEM_STL@", "e" ); 1815ToFile( "ALLOC", "@ALLOC@", "e" ); 1816ToFile( "ENABLE_SYMBOLS", "@ENABLE_SYMBOLS@", "e" ); 1817ToFile( "DISABLE_STRIP", "@DISABLE_STRIP@", "e" ); 1818ToFile( "LFS_CFLAGS", "@LFS_CFLAGS@", "e" ); 1819ToFile( "ENABLE_CRASHDUMP", "@ENABLE_CRASHDUMP@", "e" ); 1820ToFile( "ENABLE_CUPS", "@ENABLE_CUPS@", "e" ); 1821ToFile( "ENABLE_RANDR", "@ENABLE_RANDR@", "e" ); 1822ToFile( "ENABLE_FONTCONFIG", "@ENABLE_FONTCONFIG@", "e" ); 1823ToFile( "ENABLE_DIRECTX", "@ENABLE_DIRECTX@", "e" ); 1824ToFile( "ENABLE_LAYOUT", "@ENABLE_LAYOUT@", "e" ); 1825ToFile( "ENABLE_PCH", "@ENABLE_PCH@", "e" ); 1826ToFile( "ENABLE_GRAPHITE", "@ENABLE_GRAPHITE@", "e"); 1827ToFile( "SYSTEM_GRAPHITE", "@SYSTEM_GRAPHITE@", "e"); 1828ToFile( "GRAPHITE_LIBS", "@GRAPHITE_LIBS@", "e"); 1829ToFile( "GRAPHITE_CFLAGS", "@GRAPHITE_CFLAGS@", "e"); 1830ToFile( "VC_STANDARD", "@VC_STANDARD@", "e" ); 1831ToFile( "WITH_MYSPELL_DICTS","@WITH_MYSPELL_DICTS@","e"); 1832ToFile( "SYSTEM_DICTS", "@SYSTEM_DICTS@", "e"); 1833ToFile( "DICT_SYSTEM_DIR", "@DICT_SYSTEM_DIR@", "e"); 1834ToFile( "HYPH_SYSTEM_DIR", "@HYPH_SYSTEM_DIR@", "e"); 1835ToFile( "THES_SYSTEM_DIR", "@THES_SYSTEM_DIR@", "e"); 1836ToFile( "ENABLE_LOCKDOWN", "@ENABLE_LOCKDOWN@", "e" ); 1837ToFile( "WITH_LDAP", "@WITH_LDAP@", "e" ); 1838ToFile( "WITH_OPENLDAP", "@WITH_OPENLDAP@", "e" ); 1839ToFile( "WITH_MOZILLA", "@WITH_MOZILLA@", "e" ); 1840ToFile( "SYSTEM_MOZILLA", "@SYSTEM_MOZILLA@", "e" ); 1841ToFile( "MOZ_FLAVOUR", "@MOZ_FLAVOUR@", "e" ); 1842ToFile( "NSPR_LIB", "@NSPR_LIB@", "e" ); 1843ToFile( "NSS_LIB", "@NSS_LIB@", "e" ); 1844ToFile( "MOZ_INC", "@MOZ_INC@", "e" ); 1845ToFile( "MOZ_LIB", "@MOZ_LIB@", "e" ); 1846ToFile( "MOZ_LIB_XPCOM", "@MOZ_LIB_XPCOM@", "e" ); 1847ToFile( "MOZ_NSPR_CFLAGS", "@MOZ_NSPR_CFLAGS@", "e" ); 1848ToFile( "MOZ_NSS_CFLAGS", "@MOZ_NSS_CFLAGS@", "e" ); 1849ToFile( "MOZ_LDAP_CFLAGS", "@MOZ_LDAP_CFLAGS@", "e" ); 1850ToFile( "WITH_FONTS", "@WITH_FONTS@", "e" ); 1851ToFile( "WITHOUT_AFMS", "@WITHOUT_AFMS@", "e" ); 1852ToFile( "WITHOUT_PPDS", "@WITHOUT_PPDS@", "e" ); 1853ToFile( "WITH_BINFILTER", "@WITH_BINFILTER@", "e" ); 1854ToFile( "BUILD_TYPE", "$BUILD_TYPE", "e" ); 1855ToFile( "VERBOSE", "@VERBOSE@", "e" ); 1856ToFile( "ENABLE_EVOAB2", "@ENABLE_EVOAB2@", "e" ); 1857ToFile( "GOBJECT_CFLAGS", "@GOBJECT_CFLAGS@", "e" ); 1858ToFile( "GOBJECT_LIBS", "@GOBJECT_LIBS@", "e" ); 1859if ( '@ENABLE_RPATH@' eq "no" ) { 1860 ToFile( "LINKFLAGSRUNPATH",'', "e" ); 1861} 1862ToFile( "EPM", "@EPM@", "e" ); 1863ToFile( "EPM_FLAGS", $EPM_FLAGS, "e" ); 1864ToFile( "BUILD_EPM", "@BUILD_EPM@", "e" ); 1865ToFile( "PKGFORMAT", "@PKGFORMAT@", "e" ); 1866ToFile( "SYSTEM_STDLIBS", "@SYSTEM_STDLIBS@", "e" ); 1867ToFile( "SYSTEM_ZLIB", "@SYSTEM_ZLIB@", "e" ); 1868ToFile( "SYSTEM_OPENSSL", "@SYSTEM_OPENSSL@", "e" ); 1869ToFile( "OPENSSL_CFLAGS", "@OPENSSL_CFLAGS@", "e" ); 1870ToFile( "OPENSSL_LIBS", "@OPENSSL_LIBS@", "e" ); 1871ToFile( "SYSTEM_PYTHON", "@SYSTEM_PYTHON@", "e" ); 1872ToFile( "PYTHON_CFLAGS", "@PYTHON_CFLAGS@", "e" ); 1873ToFile( "PYTHON_LIBS", "@PYTHON_LIBS@", "e" ); 1874if ($SYSTEM_PYTHON eq "NO") { 1875ToFile( "HOME", "@HOME@", "e" ); 1876} 1877ToFile( "SYSTEM_ICU", "@SYSTEM_ICU@", "e" ); 1878ToFile( "ICU_MAJOR", "@ICU_MAJOR@", "e" ); 1879ToFile( "ICU_MINOR", "@ICU_MINOR@", "e" ); 1880ToFile( "ICU_MICRO", "@ICU_MICRO@", "e" ); 1881ToFile( "SYSTEM_GENBRK", "@SYSTEM_GENBRK@", "e" ); 1882ToFile( "SYSTEM_GENCCODE", "@SYSTEM_GENCCODE@", "e" ); 1883ToFile( "SYSTEM_GENCMN", "@SYSTEM_GENCMN@", "e" ); 1884ToFile( "SYSTEM_JPEG", "@SYSTEM_JPEG@", "e" ); 1885ToFile( "FREETYPE_CFLAGS", "@FREETYPE_CFLAGS@", "e" ); 1886ToFile( "FREETYPE_LIBS", "@FREETYPE_LIBS@", "e" ); 1887ToFile( "SYSTEM_POPPLER", "@SYSTEM_POPPLER@", "e" ); 1888ToFile( "POPPLER_CFLAGS", "@POPPLER_CFLAGS@", "e" ); 1889ToFile( "POPPLER_LIBS", "@POPPLER_LIBS@", "e" ); 1890ToFile( "GSTREAMER_CFLAGS", "@GSTREAMER_CFLAGS@", "e" ); 1891ToFile( "GSTREAMER_LIBS", "@GSTREAMER_LIBS@", "e" ); 1892ToFile( "SYSTEM_CAIRO", "@SYSTEM_CAIRO@", "e" ); 1893ToFile( "BUILD_PIXMAN", "@BUILD_PIXMAN@", "e" ); 1894ToFile( "CAIRO_CFLAGS", "@CAIRO_CFLAGS@", "e" ); 1895ToFile( "CAIRO_LIBS", "@CAIRO_LIBS@", "e" ); 1896ToFile( "XRANDR_CFLAGS", "@XRANDR_CFLAGS@", "e" ); 1897ToFile( "XRANDR_LIBS", "@XRANDR_LIBS@", "e" ); 1898ToFile( "XRANDR_DLOPEN", "@XRANDR_DLOPEN@", "e" ); 1899ToFile( "SYSTEM_LIBWPD", "@SYSTEM_LIBWPD@", "e" ); 1900ToFile( "LIBWPD_CFLAGS", "@LIBWPD_CFLAGS@", "e" ); 1901ToFile( "LIBWPD_LIBS", "@LIBWPD_LIBS@", "e" ); 1902ToFile( "SYSTEM_CPPUNIT", "@SYSTEM_CPPUNIT@", "e" ); 1903ToFile( "CPPUNIT_CFLAGS", "@CPPUNIT_CFLAGS@", "e" ); 1904ToFile( "CPPUNIT_LIBS", "@CPPUNIT_LIBS@", "e" ); 1905ToFile( "SYSTEM_LIBXML", "@SYSTEM_LIBXML@", "e" ); 1906ToFile( "USE_FT_EMBOLDEN", "@USE_FT_EMBOLDEN@", "e" ); 1907ToFile( "LIBXML_CFLAGS", "@LIBXML_CFLAGS@", "e" ); 1908ToFile( "LIBXML_LIBS", "@LIBXML_LIBS@", "e" ); 1909ToFile( "SYSTEM_EXPAT", "@SYSTEM_EXPAT@", "e" ); 1910ToFile( "SYSTEM_DB", "@SYSTEM_DB@", "e" ); 1911ToFile( "DB_VERSION", "@DB_VERSION@", "e" ); 1912ToFile( "DB_INCLUDES", "@DB_INCLUDES@", "e" ); 1913ToFile( "ENABLE_MYSQLC", "@ENABLE_MYSQLC@", "e" ); 1914ToFile( "SYSTEM_MYSQL", "@SYSTEM_MYSQL@", "e" ); 1915ToFile( "SYSTEM_MYSQL_CPPCONN","@SYSTEM_MYSQL_CPPCONN@","e" ); 1916ToFile( "MYSQL_INC", "@MYSQL_INC@", "e" ); 1917ToFile( "MYSQL_LIB", "@MYSQL_LIB@", "e" ); 1918ToFile( "MYSQL_DEFINES", "@MYSQL_DEFINES@", "e" ); 1919ToFile( "LIBMYSQL_PATH", "@LIBMYSQL_PATH@", "e" ); 1920ToFile( "SYSTEM_HSQLDB", "@SYSTEM_HSQLDB@", "e" ); 1921ToFile( "HSQLDB_JAR", "@HSQLDB_JAR@", "e" ); 1922ToFile( "SYSTEM_LUCENE", "@SYSTEM_LUCENE@", "e" ); 1923ToFile( "LUCENE_CORE_JAR", "@LUCENE_CORE_JAR@", "e" ); 1924ToFile( "LUCENE_ANALYZERS_JAR", "@LUCENE_ANALYZERS_JAR@", "e" ); 1925ToFile( "SYSTEM_BSH", "@SYSTEM_BSH@", "e" ); 1926ToFile( "BSH_JAR", "@BSH_JAR@", "e" ); 1927ToFile( "SYSTEM_SAXON", "@SYSTEM_SAXON@", "e" ); 1928ToFile( "SAXON_JAR", "@SAXON_JAR@", "e" ); 1929ToFile( "SYSTEM_ODBC_HEADERS","@SYSTEM_ODBC_HEADERS@","e" ); 1930ToFile( "SYSTEM_LIBXSLT", "@SYSTEM_LIBXSLT@", "e" ); 1931ToFile( "LIBXSLT_CFLAGS", "@LIBXSLT_CFLAGS@", "e" ); 1932ToFile( "LIBXSLT_LIBS", "@LIBXSLT_LIBS@", "e" ); 1933ToFile( "SYSTEM_SANE_HEADER","@SYSTEM_SANE_HEADER@","e" ); 1934ToFile( "SYSTEM_XRENDER_HEADERS","@SYSTEM_XRENDER_HEADERS@","e" ); 1935ToFile( "SYSTEM_CURL", "@SYSTEM_CURL@", "e" ); 1936ToFile( "CURL_CFLAGS", "@CURL_CFLAGS@", "e" ); 1937ToFile( "CURL_LIBS", "@CURL_LIBS@", "e" ); 1938ToFile( "SYSTEM_BOOST", "@SYSTEM_BOOST@", "e" ); 1939ToFile( "SYSTEM_MDDS", "@SYSTEM_MDDS@", "e" ); 1940ToFile( "SYSTEM_VIGRA", "@SYSTEM_VIGRA@", "e" ); 1941ToFile( "SYSTEM_NEON", "@SYSTEM_NEON@", "e" ); 1942ToFile( "SYSTEM_LIBRSVG", "@SYSTEM_LIBRSVG@", "e" ); 1943ToFile( "SYSTEM_GDKPIXBUF", "@SYSTEM_GDKPIXBUF@", "e" ); 1944ToFile( "SYSTEM_GLIB", "@SYSTEM_GLIB@", "e" ); 1945ToFile( "SYSTEM_GETTEXT", "@SYSTEM_GETTEXT@", "e" ); 1946ToFile( "SYSTEM_LIBCROCO", "@SYSTEM_LIBCROCO@", "e" ); 1947ToFile( "SYSTEM_PANGO", "@SYSTEM_PANGO@", "e" ); 1948ToFile( "SYSTEM_LIBGSF", "@SYSTEM_LIBGSF@", "e" ); 1949ToFile( "SYSTEM_LIBPNG", "@SYSTEM_LIBPNG@", "e" ); 1950ToFile( "SYSTEM_LIBJPEG", "@SYSTEM_LIBJPEG@", "e" ); 1951ToFile( "NEON_VERSION", "@NEON_VERSION@", "e" ); 1952ToFile( "NEON_LIBS", "@NEON_LIBS@", "e" ); 1953ToFile( "NEON_CFLAGS", "@NEON_CFLAGS@", "e" ); 1954ToFile( "DISABLE_NEON", "@DISABLE_NEON@", "e" ); 1955ToFile( "DISABLE_XAW", "@DISABLE_XAW@", "e" ); 1956ToFile( "ENABLE_AGG", "@ENABLE_AGG@", "e" ); 1957ToFile( "SYSTEM_AGG", "@SYSTEM_AGG@", "e" ); 1958ToFile( "AGG_VERSION", "@AGG_VERSION@", "e" ); 1959ToFile( "BUILD_DMAKE", "@BUILD_DMAKE@", "e" ); 1960ToFile( "BUILD_STAX", "@BUILD_STAX@", "e" ); 1961ToFile( "BUILD_UNOWINREG", "@BUILD_UNOWINREG@", "e" ); 1962ToFile( "USE_XINERAMA", "@USE_XINERAMA@", "e" ); 1963ToFile( "XINERAMA_LINK", "@XINERAMA_LINK@", "e" ); 1964ToFile( "SYSTEM_REDLAND", "@SYSTEM_REDLAND@", "e" ); 1965ToFile( "REDLAND_CFLAGS", "@REDLAND_CFLAGS@", "e" ); 1966ToFile( "REDLAND_LIBS", "@REDLAND_LIBS@", "e" ); 1967ToFile( "SYSTEM_HUNSPELL", "@SYSTEM_HUNSPELL@", "e" ); 1968ToFile( "HUNSPELL_CFLAGS", "@HUNSPELL_CFLAGS@", "e" ); 1969ToFile( "HUNSPELL_LIBS", "@HUNSPELL_LIBS@", "e" ); 1970ToFile( "SYSTEM_LPSOLVE", "@SYSTEM_LPSOLVE@", "e" ); 1971ToFile( "HAVE_GETOPT", "@HAVE_GETOPT@", "e" ); 1972ToFile( "HAVE_READDIR_R", "@HAVE_READDIR_R@", "e" ); 1973ToFile( "SYSTEM_LIBC", "@SYSTEM_LIBC@", "e" ); 1974ToFile( "SYSTEM_HYPH", "@SYSTEM_HYPH@", "e" ); 1975ToFile( "HYPHEN_LIB", "@HYPHEN_LIB@", "e" ); 1976ToFile( "SYSTEM_MYTHES", "@SYSTEM_MYTHES@", "e" ); 1977ToFile( "MYTHES_CFLAGS", "@MYTHES_CFLAGS@", "e" ); 1978ToFile( "MYTHES_LIBS", "@MYTHES_LIBS@", "e" ); 1979ToFile( "SYSTEM_LIBTEXTCAT", "@SYSTEM_LIBTEXTCAT@","e" ); 1980ToFile( "SYSTEM_LIBTEXTCAT_DATA","@SYSTEM_LIBTEXTCAT_DATA@","e" ); 1981ToFile( "PAM", "@PAM@", "e" ); 1982ToFile( "NEW_SHADOW_API", "@NEW_SHADOW_API@", "e" ); 1983ToFile( "PAM_LINK", "@PAM_LINK@", "e" ); 1984ToFile( "CRYPT_LINK", "@CRYPT_LINK@", "e" ); 1985ToFile( "XAU_LIBS", "@XAU_LIBS@", "e" ); 1986ToFile( "GXX_INCLUDE_PATH", PathFormat("@GXX_INCLUDE_PATH@"), "e" ); 1987ToFile( "COMMON_BUILD_TOOLS",$COMMON_BUILD_TOOLS, "e" ); 1988if ($platform !~ m/cygwin|os2/) { 1989 if ( $ENV{"TMPDIR"} eq "" ) { 1990 ToFile( "TMPDIR", "/tmp", "e" ); 1991 } else { 1992 ToFile( "TMPDIR", "$ENV{'TMPDIR'}", "e" ); 1993 } 1994} 1995ToFile( "SOLARSRC", $SOLARSRC, "e" ); 1996ToFile( "SOURCE_ROOT_DIR", $SOURCE_ROOT_DIR, "e" ); 1997ToFile( "gb_REPOS", $gb_REPOS, "e" ); 1998 1999if ( $platform =~ m/cygwin/ ) 2000{ 2001 ToFile( "ILIB", $ILIB, "e" ); 2002 if ( $MINGW eq "yes" ) 2003 { ToFile( "ATL_INCLUDE", $ATL_INCLUDE, "e" ); 2004 ToFile( "EXCEPTIONS", "@EXCEPTIONS@", "e" ); 2005 ToFile( "DIRECTXSDK_HOME", PathFormat("@DIRECTXSDK_HOME@"), "e" ); 2006 ToFile( "USE_MINGW", $USE_MINGW, "e" ); 2007 ToFile( "MINGW_CLIB_DIR", PathFormat("@MINGW_CLIB_DIR@"), "e" ); 2008 ToFile( "MINGW_SHARED_GCCLIB", "@MINGW_SHARED_GCCLIB@", "e" ); 2009 ToFile( "MINGW_GCCLIB_EH", "@MINGW_GCCLIB_EH@", "e" ); 2010 ToFile( "MINGW_SHARED_GXXLIB", "@MINGW_SHARED_GXXLIB@", "e" ); 2011 ToFile( "MINGW_SHARED_LIBSTDCPP", "@MINGW_SHARED_LIBSTDCPP@", "e" ); 2012 ToFile( "MINGW_GCCDLL", "@MINGW_GCCDLL@", "e" ); 2013 ToFile( "MINGW_GXXDLL", "@MINGW_GXXDLL@", "e" ); 2014 } 2015 ToFile( "GREP", $WIN_GREP, "e" ); 2016 ToFile( "FIND", $WIN_FIND, "e" ); 2017 ToFile( "LS", $WIN_LS, "e" ); 2018 ToFile( "GNUCOPY", $WIN_GNUCOPY, "e" ); 2019 ToFile( "TOUCH", $WIN_TOUCH, "e" ); 2020} 2021if ( $platform =~ m/os2/ ) 2022{ 2023 #ToFile( "ILIB", $ILIB, "e" ); 2024 2025 ToFile( "GREP", "grep.exe", "e" ); 2026 ToFile( "FIND", "find.exe", "e" ); 2027 ToFile( "LS", "ls.exe", "e" ); 2028 ToFile( "GNUCOPY", "cp.exe", "e" ); 2029 ToFile( "TOUCH", "touch", "e" ); 2030} 2031 2032# $perlpre is only used for the following three variables 2033# and only set for OS2. 2034my $perlpre = ""; 2035if (( $platform =~ m/os2/ )) { 2036 $perlpre = "perl ".${SOLARENV}.${BIN}.${ds}; 2037} 2038ToFile( "DELIVER", $perlpre."deliver.pl", "e" ); 2039ToFile( "MKOUT", $perlpre."mkout.pl", "e" ); 2040ToFile( "ZIPDEP", $perlpre."zipdep.pl", "e" ); 2041 2042# 2043# Writing the aliases to file. 2044ToFile( "Aliases.", $empty, "c" ); 2045ToFile( "Don't set aliases when bootstrapping", $empty, "c" ); 2046ToFile( 'if ( ! ${?_ISBOOTSTRAP_} ) then', $empty, "y"); 2047ToFile( "if test -z \"\$_ISBOOTSTRAP_\"; then", $empty, "z"); 2048 2049ToFile( "alias mkout", $mkout, "a" ); 2050ToFile( "alias deliver", $deliver, "a" ); 2051ToFile( "alias build", $build, "a" ); 2052ToFile( "alias build_client",$build_client, "a" ); 2053ToFile( "alias zipdep", $zipdep, "a" ); 2054if ( $platform !~ m/cygwin/ ) 2055{ ToFile( "alias nmake", $nmake, "a" ); 2056} 2057if ( $platform =~ m/os2/ ) 2058{ ToFile( "alias gunzip", "gzip -d", "a" ); 2059} 2060 2061ToFile( "endif", $empty, "y"); 2062ToFile( "fi", $empty, "z"); 2063 2064# Check if the right dmake version is used. (W32 only) 2065if ( $platform =~ m/cygwin/ ) { 2066 ToFile( "Check if the right dmake version is used.", $empty, "c" ); 2067 # Invalidate build environment. 2068 ToFile( "WORK_STAMP", "_invalid_", "e" ); 2069 # Don't test the dmake version if this file is sourced by bootstrap 2070 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"); 2071 # Restore valid environment if test was successful. 2072 ToFile( "WORK_STAMP", $WORK_STAMP, "e" ); 2073 ToFile( "", $empty, "n"); 2074} 2075 2076# on Solaris, MacOSX and FreeBSD set GNUCOPY, GNUPATCH and GPERF 2077if ($platform =~ m/solaris|darwin|freebsd/) 2078{ 2079 ToFile( "GNUPATCH", "@GNUPATCH@", "e"); 2080} 2081ToFile( "GNUCOPY", "@GNUCP@", "e"); 2082ToFile( "GPERF", "@GPERF@", "e"); 2083# OS/2 define .pl as executable for 4os2 2084# use - as switch char for dmake (os2/switchar.c) 2085if ($platform =~ m/os2/) 2086{ 2087 ToFile( ".pl", "perl", "e"); 2088 ToFile( "SWITCHAR", "-", "e"); 2089} 2090ToFile( "SAL_ENABLE_FILE_LOCKING", "1", "e"); 2091# 2092# Writing unset variables you might not need to file. 2093# 2094print OUT $unsetvars; 2095 2096print OUT_SH "export $exportvars$newline"; 2097print OUT_SH "unset $unsetvarssh$newline"; 2098 2099 2100# 2101#--------------------------- 2102# VIII. Closing output file. 2103#--------------------------- 2104# 2105close( OUT ) || print "Can't close $outfile: $!"; 2106 2107close( OUT_SH ) || print "Can't close $outfile_sh: $!"; 2108 2109# 2110#------------------------------ 2111# IX. Sourcing the output file. 2112#------------------------------ 2113# 2114#--------------------------------- 2115# X. Set up the build environment. 2116#--------------------------------- 2117# 2118#-------------------------------------------------------- 2119# XI. Moving the output file to the build home directory. 2120#-------------------------------------------------------- 2121# 2122$tmp = $SRC_ROOT.$ds.$outfile; 2123if (rename( $outfile, $tmp ) ne 1) 2124{ `mv -f $outfile $tmp`; 2125} 2126 2127$tmp = $SRC_ROOT.$ds.$outfile_sh; 2128if (rename( $outfile_sh, $tmp ) ne 1) 2129{ `mv -f $outfile_sh $tmp`; 2130} 2131 2132# 2133#-------------------------------------------------------- 2134# XII. Message at the end. 2135#-------------------------------------------------------- 2136# 2137# 2138print "*********************************************************". 2139 "******************* $newline"."*"."$newline"; 2140print "* OpenOffice.org $UPD configuration. $newline"; 2141for ( $tmp = 0; $tmp < 2; $tmp++ ) 2142{ print "* $newline"; 2143} 2144print "* Configuration part of OpenOffice.org $UPD build is finished. $newline* $newline"; 2145print "* NB! Be aware that you might not be able to build OpenOffice.org if you $newline". 2146 "* ignore any warning message that were generated during this configuration $newline". 2147 "* process. $newline* $newline"; 2148 2149if ( $Warning ne "" ) 2150{ print "$Warning*"; 2151 print "$newline"; 2152} 2153 2154print "*$newline* USAGE: $newline"; 2155print "* Source $outfile (in tcsh)"; 2156print " or $outfile.sh (in sh)"; 2157print "$newline"; 2158print "* in order to set up the build-environment variables.$newline"; 2159for ( $tmp = 0; $tmp < 2; $tmp++ ) 2160{ print "* $newline"; 2161} 2162print "*********************************************************". 2163 "******************* $newline"; 2164 2165$bootfile = "bootstrap"; 2166open( OUT, ">$bootfile" ) || 2167die "Cannot open $bootfile: $!\n"; 2168print OUT "#!/bin/sh\n"; 2169print OUT "_ISBOOTSTRAP_=TRUE ; export _ISBOOTSTRAP_ ; . $SRC_ROOT/$outfile.sh\n"; 2170print OUT "unset _ISBOOTSTRAP_; export _ISBOOTSTRAP_\n"; 2171if ( $MINGW eq "yes" ) 2172{ print OUT 'PATH="/usr/bin:$PATH" : export PATH'."\n"; } 2173close( OUT ) || print "Can't close $bootfile: $!"; 2174system(`cat bootstrap.1 >> bootstrap`); 2175system(`chmod +x bootstrap`); 2176# 2177#-------------------------------------------------------- 2178# Moving the bootstrap file to the build home directory. 2179#-------------------------------------------------------- 2180# 2181$tmp = $SRC_ROOT.$ds.$bootfile; 2182if (rename( $bootfile, $tmp ) ne 1) 2183{ `mv -f $bootfile $tmp`; 2184} 2185 2186print "Configure completed"; 2187if ( $Warning ne "" ) { 2188 print ", but\n***** WARNINGS WERE ISSUED *****"; 2189} 2190print "\n\nRun ./bootstrap in $SRC_ROOT to provide build tools and get third-party packages\n"; 2191 2192# 2193#----------------- 2194# XII. Functions. 2195#----------------- 2196# 2197#------------------------------------------------------------- 2198# Function name: CheckPathName 2199# Description: chops off the '/' character if it's the last 2200# character in a pathname. also adds the '/' 2201# character if it's not the first character 2202# in a path. 2203# Arguments: 1. Path (string) 2204# Return value: Path (string) 2205#------------------------------------------------------------- 2206sub CheckPathName 2207{ my $retrn = $_[ 0 ]; 2208 if ($platform =~ m/cygwin/) 2209 { # Check if the first character is not a '/'. 2210 if ( !( $_[ 0 ] =~ /^\// ) ) 2211 { $retrn = $ds.$_[ 0 ]; 2212 } 2213 } 2214 # kill the last '/','\','\n' if they exists. 2215 $retrn =~ s![\s/\\]+$!!; 2216 # Done! 2217 return( $retrn ); 2218} 2219#------------------------------------------------------------- 2220# Function name: CheckPathExist 2221# Description: Checks whether the directory that is given 2222# as an argument exists. If not abort. 2223# Arguments: 1. Path (string) 2224# Return value: void 2225#------------------------------------------------------------- 2226sub CheckPathExist 2227{ my $dir = $_[ 0 ]; 2228 if ( !( -d $dir ) and $^O ne 'MSWin32' ) 2229 { print ( "The directory $_[ 0 ] does not exist. Please create first.\n" ); 2230 exit 1; 2231 } 2232 else 2233 { # Don't check under ActiveState Perl (Windows). The path is possibly 2234 # posix and it cannot handle it. 2235 return "true"; 2236 } 2237} 2238#------------------------------------------------------------ 2239# Function name: CreateFileHeader 2240# Description: Creates a header for the outfile. 2241# Arguments: 1. File to write to 2242# 2. UPD (string) 2243# 3. Platform (string) 2244# 4. name of shell for this file 2245# 5. comment to use for this file 2246# Return value: void 2247#------------------------------------------------------------ 2248sub CreateFileHeader 2249{ my $timestamp = `date`; 2250 chomp( $timestamp ); 2251 my $filehandle = $_[0]; 2252 my $comment = $_[4]; 2253 print { $filehandle } "$comment #################################################################"; 2254 print { $filehandle } $newline; 2255 print { $filehandle } "$comment OpenOffice.org $_[ 1 ] build environment file for: $_[ 2 ]. $newline"; 2256 print { $filehandle } "$comment Generated on: $timestamp $newline"; 2257 print { $filehandle } "$comment Source this file to set up the build environment. $newline"; 2258 print { $filehandle } "$comment 1. exec $_[3] $newline"; 2259 print { $filehandle } "$comment 2. source $outfile $newline"; 2260 print { $filehandle } "$comment #################################################################"; 2261 print { $filehandle } $newline; 2262} 2263#--------------------------------------------------------- 2264# Function name: ToFile 2265# Description: Writes the environment variable in the 2266# output file. 2267# Arguments: 1. Name of environment variable (string) 2268# 2. Value of environment variable (string) 2269# 3. e - env. var 2270# a - alias 2271# c - comment 2272# n - newline 2273# x - raw, write as is to OUT_BAT 2274# y - raw, write as is to OUT 2275# z - raw, write as is to OUT_SH 2276# Return value: void 2277#--------------------------------------------------------- 2278sub ToFile { 2279 if ( $_[ 2 ] eq "e" ) { 2280 # Write an environment variable to file. 2281 if (defined $_[ 1 ] && $_[ 1 ] ne "" ) { 2282 my $envvar = $_[ 1 ]; 2283 my $envvarbash = $envvar; 2284 2285 # Tcsh/bash needs backslashes quoted 2286 $envvar =~ s/\\/\\\\/g; 2287 $envvarbash = $envvar; 2288 2289 printf("%-12s %-17s %-10s %s\n", "The variable", $_[ 0 ], "is set to:", $envvar); 2290 print OUT "$setenv $_[ 0 ] \"$envvar\"$newline"; # to tcsh file 2291 print OUT_SH "$_[ 0 ]=\"$envvarbash\"$newline"; # to sh file 2292 $exportvars .= " $_[ 0 ]"; # add to export list for sh file 2293 2294 } else { 2295 printf("%-12s %-17s %-10s %s\n", "The variable", $_[ 0 ], "is set to:", "unset") ; # to stdout 2296 $unsetvars .= "$unsetenv $_[ 0 ] >& /dev/null$newline"; # for tcsh file 2297 $unsetvarssh .= " $_[ 0 ]"; # for sh file 2298 } 2299 } 2300 elsif ( $_[ 2 ] eq "a" ) 2301 { # Write an alias to file. 2302 print "The $_[ 0 ] is set to: $_[ 1 ]\n"; # to stdout 2303 print OUT "$_[ 0 ] $_[ 1 ]$newline"; # to tcsh file 2304 print OUT_SH "$_[ 0 ]=$_[ 1 ]$newline"; # to sh file 2305 } 2306 elsif ( $_[ 2 ] eq "c" ) 2307 { # Write a comment to file. 2308 print "$newline"; 2309 print "$comment$newline"; 2310 print "$comment $_[ 0 ]$newline"; 2311 print "$comment$newline"; 2312 print OUT "$newline"; 2313 print OUT "$comment$newline"; 2314 print OUT "$comment $_[ 0 ]$newline"; 2315 print OUT "$comment$newline"; 2316 print OUT_SH "$newline"; 2317 print OUT_SH "$comment$newline"; 2318 print OUT_SH "$comment $_[ 0 ]$newline"; 2319 print OUT_SH "$comment$newline"; 2320 } 2321 elsif ( $_[ 2 ] eq "n" ) 2322 { #Write a newline to a file 2323 print OUT "$newline"; 2324 print OUT_SH "$newline"; 2325 } 2326 elsif ( $_[ 2 ] eq "y" ) 2327 { 2328 #Write first argument as is, and nothing else 2329 print OUT "$_[ 0 ]$newline"; 2330 } 2331 elsif ( $_[ 2 ] eq "z" ) 2332 { 2333 #Write first argument as is, and nothing else 2334 print OUT_SH "$_[ 0 ]$newline"; 2335 } 2336 else 2337 { print "Unknown type!$newline"; 2338 } 2339} 2340#---------------------------------------------------------- 2341# Function name: PathFormat 2342# Description: Reformat path to either POSIX or mixed mode style. 2343# Arguments: 1. Variable (string) 2344# Return value: Reformatted String 2345#---------------------------------------------------------- 2346sub PathFormat 2347{ my ( $variable, $d1, $d2 ); 2348 $variable = $_[ 0 ]; 2349 2350 if ( $platform =~ m/cygwin/ ) 2351 { $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables 2352 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice! 2353 2354 # Complain if PosixPath is used on a PATH-like string 2355 if ( $variable =~ m/;/ ) { 2356 die( "Do not use on PATH lists (i.e., 'c:\\foo;d:\\bar')"); 2357 } 2358 2359 # Replace path with space with short dos path 2360 if ( $variable =~ / / ) { 2361 chomp( $variable = qx{cygpath -d "$variable"} ) ; 2362 } 2363 2364 # Replace absolute paths or DOS paths with ... 2365 if ( ( $variable =~ m/^\// ) or ( $variable =~ m/:/ ) ) { 2366 # mixed mode paths 2367 chomp( $variable = qx{cygpath -m "$variable"} ); 2368 } 2369 } 2370 return $variable; 2371} 2372#---------------------------------------------------------- 2373# Function name: CygFormat 2374# Description: Format variables to cygwin posix style path 2375# unless . 2376# Arguments: 1. Variable (string) 2377# Return value: Reformatted String 2378#---------------------------------------------------------- 2379sub CygFormat 2380{ my ( $variable, $d1, $d2 ); 2381 $variable = $_[ 0 ]; 2382 # ToDo: Do the replacement only if Windows and var contains "\" and ":" 2383 if ( $platform =~ m/cygwin|os2/ ) 2384 { 2385 # Complain if PosixPath is used on a PATH-like string 2386 if ( $variable =~ m/;/ ) { 2387 die( "Do not use on PATH lists (i.e., 'c:\\foo;d:\\bar')"); 2388 } 2389 2390 # Replace DOS paths with posix paths 2391 if ( ( $variable =~ m/\\/ ) or ( $variable =~ m/:/ ) ) { 2392 chomp( $variable = qx{cygpath -u "$variable"} ); 2393 } 2394 } 2395 return $variable; 2396} 2397#---------------------------------------------------------- 2398# Function name: WinFormat 2399# Description: Format variables to Windows Format. 2400# Arguments: 1. Variable (string) 2401# Return value: Reformatted String 2402#---------------------------------------------------------- 2403sub WinFormat 2404{ my ( $variable, $d1 ); 2405 $variable = $_[ 0 ]; 2406 $variable =~ s/^\s+//g ; #remove leading spaces 2407 $variable =~ s/\s+$//g ; #remove trailing spaces 2408 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables 2409 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice! 2410 $variable =~ s/:+/:/g ; # remove multiple ; 2411 2412 # Some variables are already in DOS path format, return early. 2413 if ( $variable =~ /\\/ ) { 2414 return $variable; 2415 } 2416 if ( $variable eq ";" ) { 2417 # Ignore single ';' 2418 return $variable; 2419 } 2420 if ( $variable =~ /;/ and $variable =~ /\// ) { 2421 # Mixed mode path-style entry, separated with ;, like CLASSPATH 2422 return $variable; 2423 } 2424 2425 # Search for posix path entry and replace with cygpath -w entry 2426 # ( -d if filename contains space ) 2427 2428 # Normal paths 2429 2430 # One special case is if "perl " is prepended. 2431 $variable =~ /^(perl\s+)?(.*)$/; 2432 my $perlpre = $1; 2433 if ( !defined($perlpre) ) { 2434 $perlpre = ""; 2435 } 2436 $variable = $2; 2437 2438 if ( $variable =~ /^\/[\w\.~ ]+/ ) { 2439 if ( $variable =~ / / ) { 2440 # Use DOS 8.3 style to avoid quoting 2441 chomp( $variable = qx{cygpath -d "$variable"} ); 2442 } else { 2443 # Use "normal" filenames 2444 chomp( $variable = qx{cygpath -w "$variable"} ); 2445 } 2446 } else { 2447 # relative or absolute DOS paths here 2448 $variable =~ s#/#\\#g; 2449 } 2450 2451 $variable = $perlpre.$variable; 2452 if ( ($perlpre ne "") && ($^O eq "cygwin")) { 2453 # Cygwin's perl needs quoted backslashes 2454 $variable =~ s#\\#\\\\#g; 2455 } 2456 2457 return $variable; 2458} 2459 2460#---------------------------------------------------------- 2461# Function name: WinPath 2462# Description: Reformat a $sep seperated path using DOS paths. 2463# Arguments: 1. Variable (string) 2464# 2. Separaror (string) 2465# Return value: Reformatted String 2466#---------------------------------------------------------- 2467sub WinPath 2468{ 2469 my ( $variable, $d1, $sep, @split_var ); 2470 2471 if ( $platform =~ m/cygwin/ ) { 2472 $variable = $_[ 0 ]; 2473 $sep = $_[ 1 ]; 2474 $variable =~ s/^\s+//g ; #remove leading spaces 2475 $variable =~ s/\s+$//g ; #remove trailing spaces 2476 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables 2477 $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice! 2478 2479 @split_var = split(/$sep/,$variable); 2480 foreach $d1 ( @split_var ) { 2481 if ( $d1 =~ /(?:^\/[\w\.~ ]+)+/ ) { 2482 if ( $d1 =~ / / ) { 2483 # Use DOS 8.3 style to avoid quoting 2484 chomp( $d1 = qx{cygpath -d "$d1"} ); 2485 } else { 2486 # Use "normal" filenames 2487 chomp( $d1 = qx{cygpath -w "$d1"} ); 2488 } 2489 } 2490 } 2491 $variable = join(';',@split_var); 2492 2493 $variable =~ s/\//\\/g; # Remaining \ come from e.g.: ../foo/baa 2494 } 2495 2496 return $variable; 2497} 2498 2499#-------------------------------------------------------- 2500# Function name: GetCorrectPath 2501# Description: Creates the build environment. 2502# Arguments: 1. existing / original path 2503# 2... pairs of <path, executable> 2504# Return value: String - Correct Path 2505#-------------------------------------------------------- 2506sub GetCorrectPath 2507{ 2508 sub PathLookup 2509 { 2510 my $cmd = shift; 2511 while (@_) { 2512 my $elem = shift; 2513 2514 -x "$elem/$cmd" && return $elem; 2515 } 2516 return ''; 2517 } 2518 2519 sub SaneGrep 2520 { 2521 # Perl grep is unbelievably strange. 2522 my $needle = shift; 2523 while (@_) { 2524 my $haystack = shift; 2525 if ($needle eq $haystack) { 2526 return 1; 2527 } 2528 } 2529 return 0; 2530 } 2531 2532 sub CleanupPath 2533 { 2534 my @elements = @_; 2535 my @cleanName = (); 2536 2537 while (@elements) { 2538 my $elem = shift @elements; 2539 if (!SaneGrep ($elem, @cleanName)) { 2540 push @cleanName, $elem; 2541 } 2542 } 2543 2544 return @cleanName; 2545 } 2546 2547 my $oldPath = shift; 2548 my @originalPairs = @_; 2549 my @pairs = @originalPairs; 2550 my @Path = split /$ps/, $oldPath; 2551 2552 while (@pairs) { 2553 my $path = shift @pairs; 2554 my $cmd = shift @pairs; 2555 my $to_append = 1; 2556 my $elem; 2557 2558 if (! -x "$path/$cmd") { 2559 AddWarning ("Missing executable $path/$cmd\n"); 2560 } 2561 2562 for $elem (@Path) { 2563 if ($elem eq $path) { 2564# print "Hit duplicate path in path; break\n"; 2565 $to_append = 0; 2566 last; 2567 } 2568 if (-f "$elem/$cmd") { 2569# print "Element already in path ...\n"; 2570 unshift @Path, $path; 2571 $to_append = 0; 2572 last; 2573 } else { 2574# print "No file $elem/$cmd\n"; 2575 } 2576 } 2577 if ($to_append) { 2578 push @Path, $path; 2579 } 2580 } 2581 2582 @pairs = @originalPairs; 2583 while (@pairs) { 2584 my $path = shift @pairs; 2585 my $cmd = shift @pairs; 2586 my $realpath; 2587 2588 $realpath = PathLookup ($cmd, @Path); 2589 if (!($realpath eq $path)) { 2590 AddWarning ("Path conflict for executables " . 2591 "$path/$cmd against $realpath"); 2592 } 2593 } 2594 2595 return join $ps, CleanupPath (@Path); 2596} 2597 2598#------------------------------------------------------------ 2599# Function name: AddWarning 2600# Description: Adds any kind of warning for the user. 2601# The warning will be shown at the end 2602# of this script. 2603# Arguments: 1. Add the configure warnings or the set_soenv 2604# warning (string). 2605# 2. Warning (string). 2606# Return value: void 2607#------------------------------------------------------------ 2608sub AddWarning 2609{ if ( $_[ 0 ] eq "configure" ) 2610 { open( IN, $warnfile ); 2611 while ( <IN> ) 2612 { $Warning = $Warning."* - ".$_; 2613 } 2614 close( IN ); 2615 # Remove the temporary warning file. 2616 # unlink ( $warnfile ); 2617 } 2618 elsif ( $_[ 0 ] eq "set_soenv" ) 2619 { my ( $arg1 ); 2620 $arg1 = $_[ 1 ]; 2621 chomp( $arg1 ); # cut off new line 2622 $Warning = $Warning."* - set_soenv: warning: $arg1 $newline"; # add the warning 2623 } 2624} 2625#------------------- 2626# That's all folks! 2627#------------------- 2628