kill TF_POOLABLE, step 2: remove dead code
[LibreOffice.git] / set_soenv.in
blob0717241e514684de82ce452716096aacdaad0a88
1 #!@PERL@ -w  # -*- Mode: perl; tab-width: 4; indent-tabs-mode: nil; -*-
3 # Program:     set_soenv.in
4 # Author:      Willem van Dorp, Ross Nicholson, Oisin Boydell - Sun Microsystems, Ireland.
6 #---------------------------------------------------------------------------
7 #---------------------------------------------------------------------------
8 # Description:
9 # set_soenv generates a file that contains all necessary
10 # environment variables for the build proces of OpenOffice
11 # on Linux, NetBSD, Solaris, Windows, Mac OS X and iOS.
13 # Program steps.
15 # I.    Checking the command-line arguments.
16 # IIa.  Declaring variables for the system commands, etc.
17 # IIb.  Declaring the environment variables.
18 # III.  Initialising the variables for the system commands, etc.
19 # IV.   Print out some important messages etc.
20 # V.    Initialising the environment variables.
21 # VI.   Open the output file.
22 # VII.  Writing the data to the output file.
23 # VIII. Closing output file.
25 #---------------------------------------------------------------------------
27 use strict;                        # pragma
28 use File::Basename;
32 #--------------------------------------------------------
33 # IIa. Declaring variables for the system commands, etc.
34 #--------------------------------------------------------
36 my ( $oldoutfile, $outfile, $bootfile, $newline, $comment,
37      $compiler, $ds, $ps,
38      $wps, $cur_dir, $par_dir, $I, $L, $tmp, $MINGW,
39      $platform,
40      $cygwinver, $empty, $no_ant, $no_gcc_include,
41      $no_gxx_include, $warnfile, $Warning, $result, $unsetvars, $exportvars, $win_format_var, $perl_os, @mingw_lib_include_paths, $mingw_lib_include_path);
43 #-------------------------------------------------
44 # IIb. Declaring environment values (constants).
45 #-------------------------------------------------
47 # Platform independent constant values.
48 my ( $CALL_CDECL, $COMMON_OUTDIR,
49      $common_build, $NO_REC_RES, $SO3, $SOLAR_JAVA,
50      $SOLAR_PLUGIN, $UPDATER, $VCL,
51      $CC, $CXX,
52      $ENABLEUNICODE, $NO_BSYMBOLIC);
54 # Platform dependent constant values.
55 my ( $COM, $ARCH, $CPU, $CPUNAME, $GUI, $GUIBASE,
56       $GVER, $OS, $OSVERSION, $OUTPATH, $INPATH, $PATH_SEPERATOR,
57       $DYNAMIC_CRT, $use_shl_versions, $JRELIBDIR,
58       $JRETOOLKITDIR, $JRETHREADDIR );
60 #-------------------------------------------
61 # IIc. Declaring the environment variables.
62 #-------------------------------------------
64 # Help variables.
65 my ( $USR, $ETC, $BIN, $LIB, $LIB64, $INC, $INCLUDE, $DEV, $OPT, $LOCAL, $SOLENV, $SOLVER, $CONFIG, $DEFIMGS,
66      $USR_BIN, $USR_LIB, $USR_LOCAL, $USR_CCS, $JAVA_BIN, $JAVA_LIB, $JAVA_INCLUDE,
67      $SOLARENVINC, $USR_DT, $USR_OPENWIN, $XLIB, $XINC,
68      $CYGWIN_PATH, $language, @languages, $ASM_PATH, $NSIS_PATH, $PERL_PATH, $CL_X64 );
70 # Environment variables.
71 my ( $oldPATH, $SRC_ROOT, $SO_HOME, $JAVA_HOME, $JDK, $JAVAFLAGS, $OOO_SHELL,
72      $L10N_MODULE, $WITH_POOR_HELP_LOCALIZATIONS,
73      $UPD, $WORK_STAMP, $gb_REPOS, $BUILD_TYPE,
74      $SOLARSRC, $DEVROOT, $SOLARVER, $SOLARVERSION, $WORKDIR, $OUTDIR, $SOLARENV, $SOLARDEFIMG,
75      $DMAKEROOT, $CLASSPATH, $XCLASSPATH, $COMPATH,
76      $MSPDB_PATH, $MIDL_PATH, $CSC_PATH, $SHOWINCLUDES_PREFIX,
77      $PATH, $SOLAREXTRAINC, $SOLAREXTRALIB, $SOLARLIB, $JAVALIB,
78      $SOLARINC, $FRAMEWORKSHOME, $COMEX, $PERL,
79      $COMP_ENV, $ILIB, $JAVAHOME, $WINDOWS_SDK_HOME, $DIRECTXSDK_LIB, $DOTNET_FRAMEWORK_HOME,
80      $USE_DIRECTX5, $ATL_LIB, $ATL_INCLUDE, $MFC_LIB, $MFC_INCLUDE, $TMPDIR,
81      $COMMON_BUILD_TOOLS, $WIN_GREP, $WIN_FIND, $WIN_LS,
82      $WIN_GNUCOPY, $WIN_TOUCH, $MOZILLA_VERSION, $MOZILLA_TOOLKIT, $PREBUILD_MOZAB, $MOZILLABUILD,
83      $PROEXT, $TARFILE_LOCATION, $GNUMAKE,
84      $PYTHON, $SYSTEM_PYTHON, $SYSTEM_MOZILLA, $EPM_FLAGS,
85      $MACOSX_SDK_PATH);
87 #-------------------------------------------
88 # IId. Declaring the aliases.
89 #-------------------------------------------
91 my ( $dmake, $build, $mkout, $deliver, $zipdep );
94 #-------------------------------------------------------------
95 # IIIa. Initialising constants.
96 #-------------------------------------------------------------
98 # $platform is needed for PathFormat()
100 $platform       = '@host@';
102 $UPD            = '@UPD@';          # the project's UPD
103 $newline        = "\n";             # Perl newline character
104 $ds             = "/";              # directory separator
105 $ps             = ":";              # path separator
106 $wps            = ":";              # path separator, will be set to ';' for windows later.
107 $cur_dir        = ".";              # current directory
108 $par_dir        = "..";             # parrent directory
109 $I              = " -I";            # include search path
110 $L              = " -L";            # library search path
111 $empty          = "";               # used as argument
112 $warnfile       = "warn";           # logfile configure warnings.
113 $Warning        = "";               # container for warning messages
114 $SYSTEM_PYTHON  = '@SYSTEM_PYTHON@';
115 if ($SYSTEM_PYTHON eq "NO") {
116     $PYTHON              = "python";
118 $SYSTEM_MOZILLA = '@SYSTEM_MOZILLA@';
119 $JDK            = '@JDK@';
120 $JAVAFLAGS              = '@JAVAFLAGS@';
121 $MINGW          = '@WITH_MINGW@';    # use MinGW for Windows build
122 $CC             = '@CC@';            # C compiler
123 $CXX            = '@CXX@';           # C++ compiler
124 $MOZILLA_VERSION        = '@MOZILLA_VERSION@'; # mozilla version to use to build mozilla
125 $MOZILLA_TOOLKIT        = '@MOZILLA_TOOLKIT@'; # GUI toolkit to use to build mozilla
126 $PROEXT         = "@PROEXT@";
127 $EPM_FLAGS      = "";
128 $CL_X64 = '@CL_X64@';
129 $GNUMAKE        = "@GNUMAKE@";
132 #--------------------------------------------------------------------
133 # IV. Initialise the warning container and print a note to the user.
134 #--------------------------------------------------------------------
136 # Add the configure (pre-requisite) warnings to the warning container
137 # , $Warning.
138 AddWarning( "configure", "" );
140 print ("Setting up the environment for building LibreOffice $newline");
142 #--------------------------------------------------
143 # V. Setting the environment variables/values.
144 #--------------------------------------------------
146 # A. Checking the platform first.
148 # get perls idea for OS
149 # needed to differentiate cygwin/native perl on windows
150 $perl_os = $^O;
153 # B. Gathering information from the system.
155 # 1. Path
156 $oldPATH = $ENV{"PATH"};
157 chomp( $oldPATH );                  # cut off new line
159 # C. Setting the constant values.
161 # Setting platform independent constant values.
162 # NB: Language options now set at 'ToFile' stage.
163 $CALL_CDECL           = "TRUE";
164 $COMMON_OUTDIR        = "";
165 $common_build         = "";
166 $NO_REC_RES           = "TRUE";
167 $SO3                  = "TRUE";
168 $SOLAR_JAVA           = "@SOLAR_JAVA@";
169 $SOLAR_PLUGIN         = "TRUE";
170 $UPDATER              = "YES";
171 $VCL                  = "TRUE";
172 $ENABLEUNICODE        = "TRUE";
173 $NO_BSYMBOLIC         = "TRUE";
174 $comment              = "#";           # UNIX script comment character
175 $TARFILE_LOCATION = "@TARFILE_LOCATION@"; # where to find tarballs with external sources
177 # Setting platform dependent constant values.
178 if ( $platform =~ m/solaris/ )
179 {     print "Setting Solaris specific values... ";
180    if ($platform =~ m/^i[3456]86/)
181    {
182       if ( $CC =~ "gcc") {
183          $oldoutfile     = "SolarisX86GccEnv.Set.sh";
184          $OUTPATH        = "unxsogi";
185       } else {
186          $oldoutfile     = "SolarisX86Env.Set.sh";
187          $OUTPATH        = "unxsoli4";
188       }
189       $CPU            = "I";
190       $CPUNAME        = "INTEL";
191           $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
192           $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."xawt";
193           $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
195    }
196    else
197    {
198       if ( $CC =~ "gcc") {
199          $oldoutfile     = "SolarisSparcGccEnv.Set.sh";
200          $OUTPATH        = "unxsogs";
201       } else {
202          $oldoutfile     = "SolarisSparcEnv.Set.sh";
203          $OUTPATH        = "unxsols4";
204       }
205       $CPU            = "S";
206       $CPUNAME        = "SPARC";
207           $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc";
208           $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."xawt";
209           $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads";
210    }
212    $COM            = "GCC";
213    $COMPATH        = '@COMPATH@';
214    $GUI            = "UNX";
215    $GUIBASE        = "unx";
216    $GVER           = "VCL";
217    $INPATH         = $OUTPATH.$PROEXT;
218    $OS             = "SOLARIS";
219    $PATH_SEPERATOR = $ps;
221 elsif ( $platform =~ m/netbsd/ )
223 #Set platform specific values:
224    if ($platform =~ m/^i[3456]86/)
225    {  print "Setting NetBSD x86 specific values... ";
226       $CPU            = "I";
227       $CPUNAME        = "INTEL";
228       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
229       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client";
230       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
231    }
232    elsif ($platform =~ m/^x86_64/)
233    {  print "Setting NetBSD x86-64 specific values... ";
234       $CPU            = "X";
235       $CPUNAME        = "X86_64";
236       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64";
237       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."client";
238       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
239    }
240    elsif ($platform =~ m/^sparc/)
241    {  print "Setting NetBSD Sparc specific values... ";
242       $CPU            = "S";
243       $CPUNAME        = "SPARC";
244       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc";
245       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."client";
246       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads";
247    }
248    elsif ($platform =~ m/powerpc/)
249    {  print "Setting NetBSD PPC specific values... ";
250       $CPU            = "P";
251       $CPUNAME        = "POWERPC";
252       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
253       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
254       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
255    }
256    else
257    { print "Unsupported NetBSD architecture: $platform \n";
258      exit 1;
259    }
260    # General NetBSD settings:
261       $COM            = "GCC";
262       $COMPATH        = '@COMPATH@';
263       $GUI            = "UNX";
264       $GUIBASE        = "unx";
265       $GVER           = "VCL";
266       $OS             = "NETBSD";
267       $PATH_SEPERATOR = $ps;
268       $OUTPATH        = "unxnbsd";
269       $oldoutfile     = "NetBSDEnv.Set.sh";
270       $INPATH         = $OUTPATH.$PROEXT;
272 elsif ( $platform =~ m/kfreebsd/ )
274 # General GNU/kFreeBSD settings:
275       $COM            = "GCC";
276       $COMPATH        = '@COMPATH@';
277       $GUI            = "UNX";
278       $GUIBASE        = "unx";
279       $GVER           = "VCL";
280       $OS             = "LINUX";
281       $PATH_SEPERATOR = $ps;
283 #Set platform specific values:
284    if ($platform =~ m/^i[3456]86/)
285    {  print "Setting GNU/kFreeBSD x86 specific values... ";
286       $oldoutfile     = "GNUkFreeBSDX86Env.Set.sh";
287       $CPU            = "I";
288       $CPUNAME        = "INTEL";
289       $OUTPATH        = "unxkfgi6";
291       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
292       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client";
293       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
295    }
296    elsif ($platform =~ m/^x86_64/)
297    {  print "Setting GNU/kFreeBSD x86-64 specific values... ";
298       $oldoutfile     = "GNUkFreeBSDX86-64Env.Set.sh";
299       $CPU            = "X";
300       $CPUNAME        = "X86_64";
301       $OUTPATH        = "unxkfgx6";
303       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64";
304       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
305       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
306    }
308    $INPATH         = $OUTPATH.$PROEXT;
310 elsif ( $platform =~ m/freebsd/ )
311 {     $COM            = "GCC";
312       $COMPATH        = '@COMPATH@';
313       $GUI            = "UNX";
314       $GUIBASE        = "unx";
315       $GVER           = "VCL";
316       $OS             = "FREEBSD";
317       $PATH_SEPERATOR = $ps;
318       $OSVERSION      = '@OSVERSION@';
319    if ($platform =~ m/^(amd64|x86_64)/)
320    {  my ( $JAVA_OS );
321       print "Setting FreeBSD AMD64 specific values... ";
322       $oldoutfile     = "FreeBSDAMDEnv.Set.sh";
323       $CPU            = "X";
324       $CPUNAME        = "X86_64";
325       $OUTPATH        = "unxfbsdx";
326       $JAVA_OS        = '@JAVA_HOME@';
327       $JAVA_OS        =~ s/.*\///;
328       if ($JAVA_OS =~ m/^linux/)
329       {  $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
330          $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client";
331          $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
332       }
333       else
334       {  $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64";
335          $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
336          $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
337       }
338    }
339    elsif ($platform =~ m/^i386/)
340    {  print "Setting FreeBSD x86 specific values... ";
341       $oldoutfile     = "FreeBSDX86Env.Set.sh";
342       $CPU            = "I";
343       $CPUNAME        = "INTEL";
344       $OUTPATH        = "unxfbsdi";
345       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
346       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client";
347       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
348    }
349    else
350    {  print "Unsupported FreeBSD architecture: $platform \n";
351          exit 1;
352    }
353       $INPATH         = $OUTPATH.$PROEXT;
355 elsif ( $platform =~ m/openbsd/ )
356 {     $COM            = "GCC";
357       $COMPATH        = '@COMPATH@';
358       $GUI            = "UNX";
359       $GUIBASE        = "unx";
360       $GVER           = "VCL";
361       $OS             = "OPENBSD";
362       $PATH_SEPERATOR = $ps;
363       $OSVERSION      = '@OSVERSION@';
364       $OUTPATH        = "unxobsd";
365       $oldoutfile     = "OpenBSDEnv.Set.sh";
366    if ($platform =~ m/^(amd64|x86_64)/)
367    {
368       print "Setting OpenBSD AMD64 specific values... ";
369       $CPU            = "X";
370       $CPUNAME        = "X86_64";
371       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64";
372       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
373       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
374    }
375    elsif ($platform =~ m/^i386/)
376    {  print "Setting OpenBSD x86 specific values... ";
377       $CPU            = "I";
378       $CPUNAME        = "INTEL";
379       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
380       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client";
381       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
382    }
383    else
384    {  print "Unsupported OpenBSD architecture: $platform \n";
385          exit 1;
386    }
387       $INPATH         = $OUTPATH.$PROEXT;
389 elsif ( $platform =~ m/linux/ )
391 # General Linux settings:
392       $COM            = "GCC";
393       $COMPATH        = '@COMPATH@';
394       $GUI            = "UNX";
395       $GUIBASE        = "unx";
396       $GVER           = "VCL";
397       $OS             = "LINUX";
398       $PATH_SEPERATOR = $ps;
400 #Set platform specific values:
401    if ($platform =~ m/^i[3456]86/)
402    {  print "Setting Linux x86 specific values... ";
403       $oldoutfile     = "LinuxX86Env.Set.sh";
404       $CPU            = "I";
405       $CPUNAME        = "INTEL";
407       if ($JDK =~ m/^[Ii][Bb][Mm]/)
408       { $JRELIBDIR     = '$JAVA_HOME'.$ds."jre".$ds."bin";
409         $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."bin".$ds."classic";
410         $JRETHREADDIR  = '$JAVA_HOME'.$ds."jre".$ds."bin"; }
412       elsif ($JDK =~ m/^[Bb][Ee][Aa]/)
413       { $JRELIBDIR     = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
414         $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."jrockit";
415         $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; }
417       else {
418       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
419       # has both server and client
420       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client";
421       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
422       }
424       $OUTPATH     = "unxlngi6";
425    }
426    elsif ($platform =~ m/^x86_64/)
427    {  print "Setting Linux x86-64 specific values... ";
428       $oldoutfile     = "LinuxX86-64Env.Set.sh";
429       $CPU            = "X";
430       $CPUNAME        = "X86_64";
431       $OUTPATH        = "unxlngx6";
432       # Blackdown.org JDK porting project uses `amd64' and `server' in JDK 1.4.2 RC1
433       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64";
434       # has both server and client
435       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
436       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
437    }
438    elsif ($platform =~ m/^ia64/)
439    {  print "Setting Linux ia64 specific values... ";
440       $oldoutfile     = "LinuxIA64Env.Set.sh";
441       $CPU            = "A";
442       $CPUNAME        = "IA64";
443       $OUTPATH        = "unxlnga";
444       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ia64";
445       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ia64".$ds."server";
446       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ia64".$ds."native_threads";
447    }
448    elsif ($platform =~ m/^sparc/)
450    {  print "Setting Linux Sparc specific values... ";
451       $oldoutfile     = "LinuxSparcEnv.Set.sh";
452       $CPU            = "S";
453       $CPUNAME        = "SPARC";
454       $OUTPATH        = "unxlngs";
455       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc";
456       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."server";
457       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads";
458    }
459    elsif ($platform =~ m/^powerpc/)
460    {
461       if (($platform =~ m/^powerpc64/) && ('@SIZEOF_LONG@' eq '8')) {
462          print "Setting Linux PPC64 specific values... ";
463          $oldoutfile = "LinuxPPC64Env.Set.sh";
464          $OUTPATH = "unxlngppc64";
465          $CPUNAME = "POWERPC64";
467          if ( $JDK eq "gcj" ) {
468             $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64";
469             $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."client";
470             $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads";
471          }
472          # OpenJDK
473          elsif ($JDK =~ m/sun/) {
474             $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64";
475             $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."server";
476             $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads";
477          }
478       }
479       else {
480          print "Setting Linux PPC specific values... ";
481          $oldoutfile = "LinuxPPCEnv.Set.sh";
482          $OUTPATH = "unxlngppc";
483          $CPUNAME = "POWERPC";
485          if ( $JDK eq "gcj" ) {
486             $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
487             $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."client";
488             $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; }
489          elsif ($JDK =~ m/^[Ii][Bb][Mm]/)
490          {  $JRELIBDIR     = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
491             $JRETOOLKITDIR = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
492             $JRETHREADDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
493          }
494          # OpenJDK
495          elsif ($JDK =~ m/sun/) {
496             $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
497             $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."server";
498             $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
499          }
500       }
502       $CPU            = "P";
504    }
505    elsif ($platform =~ m/^s390/)
506    {
507       if (($platform =~ m/^s390x/) && ('@SIZEOF_LONG@' eq '8')) {
508          print "Setting Linux zSeries specific values... ";
509          $oldoutfile     = "LinuxS390XEnv.Set.sh";
510          $CPUNAME        = "S390X";
511          $ARCH           = "s390x";
512          $OUTPATH        = "unxlngs390x";
513       }
514       else {
515          print "Setting Linux S/390 specific values... ";
516          $oldoutfile     = "LinuxS390Env.Set.sh";
517          $CPUNAME        = "S390";
518          $ARCH           = "s390";
519          $OUTPATH        = "unxlngs390";
520       }
521       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH;
522       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH.$ds."server";
523       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH.$ds."native_threads";
524       $CPU            = "3";
525    }
526    elsif ($platform =~ m/^m68k/)
527    {  print "Setting Linux m68k specific values... ";
528       $oldoutfile     = "LinuxM68KEnv.Set.sh";
529       $CPU            = "6";
530       $CPUNAME        = "M68K";
531       $OUTPATH        = "unxlngm68k";
532       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."m68k";
533       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."m68k".$ds."server";
534       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."m68k".$ds."native_threads";
535    }
536    elsif ($platform =~ m/^hppa/)
537    {  print "Setting Linux hppa specific values... ";
538       $oldoutfile     = "LinuxHPPAEnv.Set.sh";
539       $CPU            = "H";
540       $CPUNAME        = "HPPA";
541       $OUTPATH        = "unxlnghppa";
542       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."hppa";
543       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."hppa".$ds."server";
544       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."hppa".$ds."native_threads";
545       $EPM_FLAGS      = "-a hppa";
546    }
547    elsif ($platform =~ m/^alpha/)
548    {  print "Setting Linux Alpha specific values... ";
549       $oldoutfile     = "LinuxAlphaEnv.Set.sh";
550       $CPU            = "L";
551       $CPUNAME        = "AXP";
552       $OUTPATH        = "unxlngaxp";
553       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha";
554       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha".$ds."server";
555       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."alpha".$ds."native_threads";
556    }
557    elsif ($platform =~ m/^arm.*?l-/)
558    {  print "Setting Linux ARM specific values... ";
559       $oldoutfile     = "LinuxARMEnv.Set.sh";
560       $CPU            = "R";
561       $CPUNAME        = "ARM";
562       $OUTPATH        = "unxlngr";
563       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm";
564       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."server";
565       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads";
566       $EPM_FLAGS      = "-a arm";
567    }
568    elsif ($platform =~ m/^arm.*-androideabi/)
569    {  print "Setting Android ARM specific values... ";
570       $GUIBASE        = "android";
571       $OS             = "ANDROID";
572       $oldoutfile     = "AndroidARMEnv.Set.sh";
573       $CPU            = "R";
574       $CPUNAME        = "ARM";
575       $OUTPATH        = "unxandr";
576       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm";
577       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."server";
578       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads";
579       $EPM_FLAGS      = "-a arm";
580    }
581    elsif ($platform =~ m/^mips/)
582    {  print "Setting Linux MIPS specific values... ";
583       $oldoutfile     = "LinuxMIPSEnv.Set.sh";
584       $CPU            = "M";
585       $CPUNAME        = "GODSON";
586       $OUTPATH        = "unxlngmips";
588       if ('@SIZEOF_LONG@' eq '8') {
589         if ('@WORDS_BIGENDIAN@' ne 'yes') {
590           $EPM_FLAGS = "-a mips64el";
591           if ( $JDK eq "gcj" ) {
592             $ARCH = "mips64el";
593           }
594         }
595         else {
596           $ARCH = "mips64";
597         }
598       }
599       else {
600         if ('@WORDS_BIGENDIAN@' ne 'yes') {
601           $EPM_FLAGS = "-a mipsel";
602           if ( $JDK =~ m/sun/ && -d "@JAVA_HOME@".$ds."jre".$ds."lib".$ds."mips32" ) {
603            $ARCH = "mips32"; # Lemote
604           } else {
605            $ARCH = "mipsel";
606           }
607         }
608         else {
609           $ARCH = "mips";
610         }
611       }
613       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH;
614       if ( $JDK =~ m/sun/ && -d "@JAVA_HOME@".$ds."jre".$ds."lib".$ds."mips32" ) {
615         $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH.$ds."client"; # Lemote
616       } else {
617         $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH.$ds."server";
618       }
619       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds.$ARCH.$ds."native_threads";
620    }
623    $INPATH         = $OUTPATH.$PROEXT;
625 elsif ( $platform =~ m/cygwin|mingw32/ )
627       $MSPDB_PATH     = PathFormat('@MSPDB_PATH@');
628       $MIDL_PATH      = PathFormat('@MIDL_PATH@');
629       $CSC_PATH       = PathFormat('@CSC_PATH@');
630       $SHOWINCLUDES_PREFIX = '@SHOWINCLUDES_PREFIX@';
631       $WINDOWS_SDK_HOME      = PathFormat('@WINDOWS_SDK_HOME@');
632       $DIRECTXSDK_LIB = PathFormat('@DIRECTXSDK_LIB@');
633       $USE_DIRECTX5   = "";
634       $DOTNET_FRAMEWORK_HOME = PathFormat('@DOTNET_FRAMEWORK_HOME@');
635       $CPUNAME        = "INTEL";
636       $CPUNAME        = "X86_64" if $CL_X64;
637       $CPU            = "I";
638       $CPU            = "X" if $CL_X64;
639       $GUI            = "WNT";
640       $GUIBASE        = "WIN";
641       $GVER           = "NT351";
642       $OS             = "WNT";
643       $DYNAMIC_CRT    = "TRUE";
644       $use_shl_versions = "TRUE";
645       $wps = ';' if '@build_os@' eq 'cygwin'; # Windows style path seperator
646   if ( $MINGW eq "yes" )
647   {   print "Setting Windows (MinGW cross-compilation) specific values... ";
649       die 'For building natively on Windows we support only MSVC' if ('@build_os@' eq 'cygwin');
651       $PATH_SEPERATOR = ':';
652       $oldoutfile     = "WindowsMinGWEnv.Set.sh";
653       $COMPATH        = PathFormat('@COMPATH@/bin');
654       $COMPATH        =~ s/\/bin$//i;
655       $COM            = "GCC";
656       $OUTPATH        = "wntgcci";
657       $OUTPATH        = "wntgccx" if $platform =~ m/^x86_64/;
658       $INPATH         = $OUTPATH.$PROEXT;
659   }
660   else # The MSVC section starts here
661   {   print "Setting Windows (MSVC) specific values... ";
662       $oldoutfile     = "WindowsMSVCEnv.Set.sh";
663       $COMPATH        = PathFormat('@COMPATH@');
664       $COM            = "MSC";
665       $OUTPATH        = "wntmsci@COMEX@";
666       $OUTPATH        = "wntmscx@COMEX@" if $CL_X64;
667       $INPATH         = $OUTPATH.$PROEXT;
668       $COMEX          = '@COMEX@';
669       if ( "@DISABLE_ACTIVEX@" ) {
670           $ATL_LIB     = $WINDOWS_SDK_HOME.$ds."lib"; # Doesn't exist for VSE
671           $ATL_INCLUDE = $WINDOWS_SDK_HOME.$ds."include".$ds."atl";
672           $MFC_LIB     = $WINDOWS_SDK_HOME.$ds."lib"; # Doesn't exist for VSE
673           $MFC_INCLUDE = $WINDOWS_SDK_HOME.$ds."include".$ds."mfc";
674       } else {
675           $ATL_LIB     = $COMPATH.$ds."atlmfc".$ds."lib";
676           $ATL_INCLUDE = $COMPATH.$ds."atlmfc".$ds."include";
677           $MFC_LIB     = $COMPATH.$ds."atlmfc".$ds."lib";
678           $MFC_INCLUDE = $WINDOWS_SDK_HOME.$ds."include".$ds."mfc";
679       }
680       if ($CL_X64) {
681           $ATL_LIB     .= $ds."amd64";
682           $MFC_LIB     .= $ds."amd64";
683       }
684       $PATH_SEPERATOR = ';';
685   }
687 elsif ( $platform =~ m/darwin/ )
688 {     $COM            = "GCC";
689       $COMPATH        = '@COMPATH@';
690       if ($platform =~ m/^arm/)
691       {
692           print "Setting values for iOS... ";
693           $oldoutfile     = "iOSEnv.Set.sh";
694           $CPU            = "R";
695           $CPUNAME        = "ARM";
696           $OUTPATH        = "unxiosr";
697           $GUI            = "UNX";
698           $OS             = "IOS";
699           $GUIBASE        = "cocoatouch";
700       }
701       elsif ($platform =~ m/^powerpc/)
702       {
703           print "Setting values for Mac OS X/Darwin on PowerPC... ";
704           $oldoutfile     = "MacOSXPPCEnv.Set.sh";
705           $CPU            = "P";
706           $CPUNAME        = "POWERPC";
707           $OUTPATH        = "unxmacxp";
708           $OS             = "MACOSX";
709           $GUI            = "UNX";
710       }
711       else
712       {
713           print "Setting values for Mac OS X/Darwin on default x86... ";
714           $oldoutfile     = "MacOSXX86Env.Set.sh";
715           $CPU            = "I";
716           $CPUNAME        = "INTEL";
717           $OUTPATH        = "unxmacxi";
718           $OS             = "MACOSX";
719           $GUI            = "UNX";
720       }
721       $GVER           = "VCL";
722       $INPATH         = $OUTPATH.$PROEXT;
723       $PATH_SEPERATOR = $ps;
724       # GUIBASE is set below for Mac OS X; may be "aqua" or "unx".
726 elsif ( $platform =~ m/dragonfly/ )
728    if ($platform =~ m/^i386/)
729    {  print "Setting DragonFly i386 specific values... ";
730       $CPU            = "I";
731       $CPUNAME        = "INTEL";
732       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386";
733       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."client";
734       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
735    }
736    elsif ($platform =~ m/^x86_64/)
737    {  print "Setting DragonFly x86-64 specific values... ";
738       $CPU            = "X";
739       $CPUNAME        = "X86_64";
740       $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64";
741       $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
742       $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
743    }
744    else
745    { print "Unsupported DragonFly architecture: $platform \n";
746      exit 1;
747    }
748    # General DragonFly settings:
749       $COM            = "GCC";
750       $COMPATH        = '@COMPATH@';
751       $GUI            = "UNX";
752       $GUIBASE        = "unx";
753       $GVER           = "VCL";
754       $OS             = "DRAGONFLY";
755       $PATH_SEPERATOR = $ps;
756       $OUTPATH        = "unxdfly";
757       $oldoutfile     = "DragonFlyEnv.Set.sh";
758       $INPATH         = $OUTPATH.$PROEXT;
760 elsif ( $platform =~ m/aix/ )
762    print "Setting AIX PPC specific values... ";
763    $oldoutfile     = "aixPPCEnv.Set.sh";
764    $CPU            = "P";
765    $CPUNAME        = "POWERPC";
766    $OUTPATH        = "unxaigppc";
767    $JRELIBDIR      = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc";
768    $JRETOOLKITDIR  = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
769    $JRETHREADDIR   = '$JAVA_HOME'.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
770    $COM            = "GCC";
771    $COMPATH        = '@COMPATH@';
772    $GUI            = "UNX";
773    $GUIBASE        = "unx";
774    $GVER           = "VCL";
775    $INPATH         = $OUTPATH.$PROEXT;
776    $OS             = "AIX";
777    $PATH_SEPERATOR = $ps;
779 else {
780         print "\nset_soenv:  Cannot recognize the platform you are building for: $platform.\n";
781         exit 1;
783 print "done\n";
786 # D. Gathering directory information from the user.
788 # If the directory does not exist something is strange.
789 # 1. LibreOffice build home directory.
790 chomp($SRC_ROOT  = `pwd`);
791 $SRC_ROOT = PathFormat($SRC_ROOT);
792 CheckPathExist( $SRC_ROOT );
795 # 2. Java home directory.
796 # JAVA_HOME as argument from autoconf.
797 $JAVA_HOME = PathFormat('@JAVA_HOME@') ;
799 if ( $platform =~ m/cygwin/ ) {
800    $JAVA_HOME =~ s/[\s\/]+$//;  # remove trailing \n or \/ if there is any.
802 # 3. bash path.
803 $OOO_SHELL = '@BASH@';
805 # ml.exe assembler path for Windows users.
806 if ($platform =~ m/cygwin/)
807 {  $ASM_PATH = PathFormat('@ASM_HOME@');
810 # Check for prebuild mozab libraries if we don't build them # ourselves
811 # and we're also not using the external system mozilla installation.
813 # FIXME! This check should be done in configure and not here, but
814 # the $OS, $COM, $CPU variables are not yet present there.
816 if ( "@WITH_MOZILLA@" eq "YES" and "@BUILD_MOZAB@" ne "TRUE" and "@SYSTEM_MOZILLA@" ne "YES" )
817 {  print("\nChecking for prebuilt Mozilla libraries ...");
818    my $mozbinfile = $SRC_ROOT."/moz/zipped/";
819    if ( $^O eq 'MSWin32' ) {
820        chomp( $mozbinfile = qx{cygpath -d "$mozbinfile"} );
821    }
822    $mozbinfile .= $OS.$COM.$CPU;
823    if ( -e $mozbinfile."inc.zip"
824         and -e $mozbinfile."lib.zip"
825         and -e $mozbinfile."runtime.zip" )
826    {   print " found.\n";
827        $PREBUILD_MOZAB = "YES";
828    }
829    else
830    {   print " not found!\n\n";
831        print "If you don\'t use the system mozilla and also not build the needed\n";
832        print "mozilla libraries yourself you have to provide the needed files\n";
833        print "$OS$COM$CPU\{inc,lib,runtime\}.zip in moz/zipped/ .\n";
834        print "These files can be found here:\n";
835        print "  <http://tools.openoffice.org/moz_prebuild/680/>.\n\n";
836        die;
837    }
839 else
841    $PREBUILD_MOZAB = "";
845 # E. Determining the envionment values based on the information
846 #    that was gathered earlier on.
848 $USR                  = $ds."usr";
849 $ETC                  = $ds."etc";
850 $BIN                  = $ds."bin";
851 $LIB                  = $ds."lib";
852 $LIB64                = $ds."lib";
853 $LIB64               .= "64"
854 if ($platform =~ m/x86_64-.*-linux/);
855 $LIB64               .= "64"
856 if (($platform =~ m/powerpc64-.*-linux/) && ('@SIZEOF_LONG@' eq '8'));
857 $LIB64               .= "64"
858 if (($platform =~ m/s390x-.*-linux/) && ('@SIZEOF_LONG@' eq '8'));
859 $LIB64               .= $ds."x64"
860 if ($platform =~ m/cygwin/);
861 $INC                  = $ds."inc";
862 $INCLUDE              = $ds."include";
863 $DEV                  = $ds."dev";
864 $OPT                  = $ds."opt";
865 $LOCAL                = $ds."local";
866 $SOLENV               = $ds."solenv";
867 $SOLVER               = $ds."solver";
868 $DEFIMGS              = $ds."default_images";
869 $CONFIG               = $ds."config";
870 $USR_BIN              = $USR.$BIN;
871 $USR_LIB              = $USR.$LIB64;
872 $USR_LOCAL            = $USR.$ds."local";
873 $USR_CCS              = $USR.$ds."ccs";
874 $USR_OPENWIN          = $USR.$ds."openwin";
875 $USR_DT               = $USR.$ds."dt";
876 $COMMON_BUILD_TOOLS   = '$SRC_ROOT'.$ds."external".$ds."common";
878 # Windows NT only variables
879 if ($platform =~ m/cygwin/)
881    if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
882    {
883       $JAVA_LIB             = $JAVA_HOME.$LIB;
884    }
885    # Import SystemDrive enviroment variable
886    use Env qw(SYSTEMDRIVE);
887    # Change $SYSTEMDRIVE to lower case.
888    $SYSTEMDRIVE          = lc $SYSTEMDRIVE;
889    use Env qw(SYSTEMROOT);
890    $CYGWIN_PATH          = PathFormat('/usr/bin'); # Windows bash path
891    $WIN_GREP             = '$CYGWIN_PATH'.$ds."grep.exe";
892    $WIN_FIND             = '$CYGWIN_PATH'.$ds."find.exe";
893    $WIN_LS               = '$CYGWIN_PATH'.$ds."ls.exe";
894    $WIN_GNUCOPY          = '$CYGWIN_PATH'.$ds."cp.exe";
895    $WIN_TOUCH            = '$CYGWIN_PATH'.$ds."touch.exe";
898 if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
900    $JAVA_BIN             = $JAVA_HOME.$BIN;
901    $JAVA_INCLUDE         = $JAVA_HOME.$INCLUDE;
905 $PERL                 = PathFormat('@PERL@'); # Perl program
906 $PERL_PATH            = dirname('@PERL@'); # Perl Path
907 $XLIB                 = PathFormat('@XLIB@'); # X11 libraries
908 $XINC                 = PathFormat('@XINC@'); # X11 includes
911 # Mac OS X/Darwin only variables.
912 if ( $platform =~ m/darwin/ && $platform !~ m/^arm/)
914     $MACOSX_SDK_PATH='@MACOSX_SDK_PATH@';
915     $FRAMEWORKSHOME       = $MACOSX_SDK_PATH."/System/Library/Frameworks";
916     if ( $XLIB eq "no_x_libraries" )
917     {
918         $GUIBASE  = "aqua";
919     }
920     else
921     {
922         $GUIBASE  = "unx";
923     }
926 # The project's workstamp.
927 $WORK_STAMP            = "@SOURCEVERSION@";
928 # Location of the source.
929 $SOLARSRC             = '$SRC_ROOT';
931 # default TARFILE_LOCATION
932 if ('@TARFILE_LOCATION@' eq "DEFAULT")
933 {       $TARFILE_LOCATION="$SRC_ROOT/src";
937 $DEVROOT              = '$SRC_ROOT';
938 $SOLARENV             = PathFormat($SRC_ROOT.$SOLENV);
939 # Location of the solver tree.
940 if ('@LOCAL_SOLVER@' eq "DEFAULT")
941 {  $SOLARVER          = $SRC_ROOT.$SOLVER;
943 else
944 {  $SOLARVER          = PathFormat('@LOCAL_SOLVER@');
946 #Location of Solar version.
947 $SOLARVERSION         = '$SOLARVER';
949 #Location of gnu make directories.
950 $WORKDIR              = '$SRC_ROOT/workdir/$INPATH';
951 $OUTDIR              = '$SOLARVER/$INPATH';
952 #Some directories that are symlinks under rawbuild, have to use realpath on Cygwin
953 $SOLARDEFIMG          = PathFormat($SRC_ROOT.$DEFIMGS);
956 $SOLARENVINC          = '$SOLARENV'.$INC;
957 # Location of dmake resource.
958 $DMAKEROOT            = '$SOLARENVINC'.$ds."startup";
959 # Location of JDK classes .zip file.
960 # but in jdk 1.2 it is called rt.jar and it lives in jre/lib
961 $CLASSPATH            = '$JAVA_HOME'.$ds.'jre'.$LIB.$ds."rt.jar".$wps.'.';
962 # Location of the JDK supported standard classes.zip file.
963 # see above for why the change
964 $XCLASSPATH           = '$JAVA_HOME'.$ds.'jre'.$LIB.$ds."rt.jar".$wps.'.';
966 # Location of the translations module
967 $L10N_MODULE = PathFormat($SRC_ROOT."/translations");
969 # Check for poor help localizations, i.e. no help translation at all...
970 @languages=();
971 if (opendir(DIR,$L10N_MODULE . "/source"))
973     @languages = readdir(DIR);
974     closedir(DIR);
976 $WITH_POOR_HELP_LOCALIZATIONS = "";
978 foreach $language (@languages)
980     if ( ($language ne ".") && ($language ne "..") && (! -d $L10N_MODULE . "/source/" . $language . "/helpcontent2") )
981     {
982         $WITH_POOR_HELP_LOCALIZATIONS = $WITH_POOR_HELP_LOCALIZATIONS . " " . $language;
983     }
986 # Location used by the linker to create libraries.
987 if ($platform =~ m/solaris/)
988 {  $SOLAREXTRALIB     = $L.$par_dir.$LIB.
989                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$ds."lib.solaris.2.6".
990                         $L.$LIB.
991                         $L.$USR.$LIB.
992                         $L.$USR.$LOCAL.$LIB.
993                         $L.$USR_DT.$LIB.
994                         $L.$USR_OPENWIN.$LIB;
996 elsif ($platform =~ m/linux|netbsd|freebsd|aix|openbsd|dragonfly/)
998    $SOLAREXTRALIB     = $L.$par_dir.$LIB64;
1000 elsif ($platform =~ m/darwin/ && $platform !~ m/^arm/)
1002   # Nothing should be needed
1004 elsif ($platform !~ m/cygwin/ && $platform !~ m/mingw32/ && $platform !~ m/^arm-apple/)
1005 {  AddWarning( "set_soenv", "$platform not configured for linkage create libraries" );
1008 # Windows NT only variables
1009 if ($platform =~ m/cygwin/)
1010 {  $COMP_ENV          = $OUTPATH;
1012    $JAVAHOME          = '$JAVA_HOME';
1014    $ILIB             = $cur_dir;
1016    $ILIB       .=    $wps.$SOLARVER.$ds.$INPATH.$LIB;
1017    if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" ) {
1018        $ILIB   .= $wps.$JAVA_HOME.$LIB;
1019    }
1020    if ( $CL_X64 ne "TRUE" ) {
1021        $ILIB   .= $wps.$COMPATH.$LIB.
1022                   $wps.$WINDOWS_SDK_HOME.$LIB;
1023    } else {
1024        $ILIB   .= $wps.$COMPATH.$LIB.$ds."amd64".
1025                   $wps.$WINDOWS_SDK_HOME.$LIB64;
1026    }
1027    $ILIB       .= $wps.$DOTNET_FRAMEWORK_HOME.$LIB;
1028    if ( '@ENABLE_DIRECTX@' ne "" ) {
1029        $ILIB   .= $wps.$DIRECTXSDK_LIB;
1030    }
1031    # ILIB needs to use '\' directory seperators;
1032    $ILIB = WinPath( $ILIB, ";" );
1034    $JAVAHOME          = '$JAVA_HOME';
1038 # The general environment path.
1039 if ($platform =~ m/linux|netbsd|freebsd|aix|solaris|openbsd|dragonfly/)
1040 {  $PATH              = $cur_dir.
1041 #                        $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN.
1042                         $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN.
1043                         $ps.'$SOLARENV'.$BIN;
1045    if ($platform =~ m/solaris/) {
1046         $PATH .= $ps.$USR_CCS.$BIN;
1047    }
1049    $PATH             .= $ps.$oldPATH;
1051    my @javaBits;
1052    if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME"  &&  $JDK ne "gcj" ) {
1053       @javaBits = ( '$JAVA_HOME'.$BIN, 'javac' );
1054    } else {
1055       @javaBits = ();
1056    }
1057    $PATH              = GetCorrectPath ($PATH,
1058                                         $COMPATH, $CC,
1059                                         $PERL_PATH, 'perl',
1060                                         @javaBits);
1063 elsif ($platform =~ m/cygwin/)
1064 {  # The PATH variable is completely created from scratch. Elements
1065    # from oldPATH that are not yet included are appended to PATH at
1066    # the end.
1068    my ( $tmppath );
1070    $PATH              = $cur_dir.
1071 #                        $ps.CygFormat($SOLARVER).$ds.$INPATH.$BIN.
1072                         $ps.CygFormat($SOLARENV).$ds."bin".
1073                         $ps.CygFormat($SOLARENV).$ds.$OUTPATH.$BIN;
1075    if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
1076    {
1077       # hack either "hotspot" or "client" should be used, depending on the jdk version:
1078       # 1.2.x   -   no such directory, unsupported
1079       # 1.3.x   -   hotspot, client missing
1080       # 1.4.x   -   client, hotspot missing
1082       $PATH .= $ps.CygFormat($JAVA_HOME).$BIN;
1083           if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot" ) {
1084                   $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."hotspot";
1085           }
1086           if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."client" ) {
1087                   $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."client";
1088           }
1089    }
1091    # Add path to compiler
1092    $tmppath = CygFormat($COMPATH).$BIN;
1093    $tmppath .= $ds."amd64" if $CL_X64;
1094    $tmppath =~ s/^\/\//\//;
1095    $PATH .= $ps.$tmppath;
1097     $tmppath = CygFormat($MSPDB_PATH);
1098     # for MSVC to find mspdb71.dll
1099     if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1100         $PATH .= $ps.$tmppath;
1101     }
1102     # need midl.exe
1103     $tmppath = CygFormat($MIDL_PATH);
1104     if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1105         $PATH .= $ps.$tmppath;
1106     }
1107     # needs csc.exe
1108     $tmppath = CygFormat($CSC_PATH);
1109     if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1110         $PATH .= $ps.$tmppath;
1111     }
1112     # Installer needs some files if the Windows Installer SDK
1113     $tmppath = CygFormat($WINDOWS_SDK_HOME);
1114     if ( $PATH !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) {
1115         $PATH .= $ps.$tmppath.$BIN;
1116     }
1118    if ( $ASM_PATH ne "ASM_IN_PATH" )
1119    {   $PATH          .= $ps.CygFormat($ASM_PATH);
1120    }
1122    # Possible cygwin paths must follow behind the OOo and MS paths
1124    # Check if $PERL_PATH is already set in PATH
1125    $tmppath = CygFormat($PERL_PATH);
1126    if ( ! ( $PATH =~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) )
1127    {
1128       $PATH          .= $ps.$tmppath;
1129    }
1130    # Check if $CYGWIN_PATH is already set in PATH
1131    $tmppath = CygFormat($CYGWIN_PATH);
1132    if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1133       $PATH           .= $ps.$tmppath;
1134    }
1135    # makensis directory
1136    $NSIS_PATH = PathFormat('@NSIS_PATH@');
1137    $tmppath = CygFormat($NSIS_PATH);
1138    if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1139        $PATH          .= $ps.$tmppath;
1140    }
1141    # path to sn.exe (signing) for Windows users.
1142    my $sn_path = PathFormat('@DOTNET_FRAMEWORK_HOME@/bin');
1143    $tmppath = CygFormat($sn_path);
1144    if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1145        $PATH          .= $ps.$tmppath;
1146    }
1149    # Add the rest of the original path if it is still missing.
1150    if (($^O eq "cygwin")) { # Not for ActiveState perl
1151        my $expandedPATH = $PATH;
1152        $expandedPATH =~ s/(\$\w+)/$1/eeg;
1154        # fix situations where PATH may look like /bin:"C:\blah\bleh":/ugh
1155        my $fixedPATH = $oldPATH;
1156        if ( $oldPATH =~ /"/ ) {
1157            $fixedPATH = "";
1158            foreach my $pathentry ( split( '"',$oldPATH ) ) {
1159                if ( ( $pathentry =~ /^$ps/ ) || ( $pathentry =~ /$ps$/ ) ) {
1160                    $fixedPATH .= $pathentry;
1161                } else {
1162                    chomp( $pathentry = qx{cygpath -d "$pathentry"} ) ;
1163                    chomp( $pathentry = qx{cygpath -u "$pathentry"} ) ;
1164                    $fixedPATH .= $pathentry;
1165                }
1166            }
1167        }
1169        foreach my $pathentry (split($ps,$fixedPATH)) {
1170            if ( ! ( $expandedPATH =~ /(?:$ps|\A)(?:$pathentry)(?:$ps|\Z)/ ) ) {
1171                $PATH .= $ps.$pathentry;
1172                $expandedPATH .= $ps.$pathentry;
1173            }
1174        }
1175    } else {
1176        $PATH          .= $ps.$oldPATH;
1177    }
1179    # The path now is in cygwin posix format
1182 elsif ($platform =~ m/mingw32/)
1184    my ( $tmppath );
1186    $PATH              = $cur_dir.
1187 #                        $ps.CygFormat($SOLARVER).$ds.$INPATH.$BIN.
1188                         $ps.CygFormat($SOLARENV).$ds."bin".
1189                         $ps.CygFormat($SOLARENV).$ds.$OUTPATH.$BIN;
1191    # makensis directory
1192    $NSIS_PATH = PathFormat('@NSIS_PATH@');
1193    $tmppath = CygFormat($NSIS_PATH);
1194    if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1195        $PATH          .= $ps.$tmppath;
1196    }
1197    $PATH              .= $ps.$oldPATH;
1199 elsif ($platform =~ m/darwin/)
1200 {  $PATH              = $cur_dir.
1201 #                        $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN.
1202                         $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN.
1203                         $ps.'$SOLARENV'.$BIN;
1205   # Append old PATH
1206   $PATH             .= $ps.$oldPATH;
1208 else
1209 {  AddWarning( "set_soenv", "$platform not configured for general environment paths" );
1212 # Linker library search directory paths.
1213 if ($platform =~ m/solaris/)
1214 {  $SOLARLIB          = $L.$par_dir.$LIB.
1215                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
1216                         $L.'$SOLARVER'.$ds.'$INPATH'.$LIB.
1217                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
1218                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB."solaris.2.6".
1219                         $L.$LIB.
1220                         $L.$USR_LIB;
1221    if ( $CC =~ "gcc" ) {
1222       $SOLARLIB      .= $L.$COMPATH.$LIB;
1223    }
1224    $SOLARLIB         .= $L.$USR_LOCAL.$LIB.
1225                         $L.$USR_DT.$LIB.
1226                         $L.$USR_OPENWIN.$LIB.
1227                         $L.$XLIB;
1229    $JAVALIB          =  $L.'$JAVA_HOME'.$LIB.
1230                         $L.$JRELIBDIR.
1231                         $L.$JRETOOLKITDIR.
1232                         $L.$JRETHREADDIR;
1234 elsif ($platform =~ m/linux|netbsd|aix|freebsd|openbsd|dragonfly/)
1235 {  $SOLARLIB          = $L.$par_dir.$LIB.
1236                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
1237                         $L.'$SOLARVER'.$ds.'$INPATH'.$LIB.
1238                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB;
1239    if ($platform =~ m/openbsd/) {
1240       $SOLARLIB       .= $L.$USR_LOCAL.$LIB;
1241    }
1242    if ( $XLIB ne "/usr/lib" && $XLIB ne "/usr/lib64" ) {
1243       $SOLARLIB       .= $L.$XLIB;
1244    }
1245    $JAVALIB           = $L.'$JAVA_HOME'.$LIB64.
1246                         $L.$JRELIBDIR.
1247                         $L.$JRETOOLKITDIR.
1248                         $L.$JRETHREADDIR;
1250 elsif ($platform =~ m/cygwin|mingw32/)
1251 {  $SOLARLIB          = $L.$par_dir.$LIB.
1252                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
1253                         $L.'$SOLARVER'.$ds.'$INPATH'.$LIB;
1255 elsif ($platform =~ m/darwin/)
1256 {  $SOLARLIB          = $L.'$SOLARVER'.$ds.'$INPATH'.$LIB;
1257     # [ed] 6/15/02 Add in X11 libraries onto the library path
1258     if ($GUIBASE eq "unx") {
1259        $SOLARLIB      .= $L.$XLIB;
1260     }
1263 if ($SYSTEM_MOZILLA eq "YES")
1265        $SOLARLIB .= $L."@MOZ_LIB@"
1268 # Location of the compiler include search directory paths.
1269 $SOLARINC             = $I.$cur_dir.
1270                         $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."stl".
1271                         $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."external".
1272                         $I.'$SOLARVER'.$ds.'$INPATH'.$INC.
1273                         $I.'$SOLARENV'.$ds.'$OUTPATH'.$INC.
1274                         $I.'$SOLARENV'.$INC.
1275                         $I.'$SRC_ROOT'.$ds."res";
1277 if ($platform =~ m/solaris|linux|freebsd|netbsd|aix|openbsd|dragonfly/)
1279 if ($platform =~ m/solaris/ && ! $CC =~ "gcc")
1281 $SOLARINC            .= '/SC5 ';
1283 # Platform dependent include path at the top of this list of include paths
1284 if ($platform =~ m/solaris/ && ! $CC =~ "gcc")
1286     $SOLARINC         .= $I.$COMPATH.$INCLUDE;
1289         $SOLARINC      .= $I.'$SOLARENV'.$INC.$ds."Xp31";
1291         # pickup system jpeg over java jpeg on OpenBSD
1292         if ($platform =~ m/openbsd/)
1293         {   $SOLARINC  .= $I.$USR_LOCAL.$INCLUDE;
1294         }
1295     if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
1296     {   $SOLARINC  .= $I.'$JAVA_HOME'.$INCLUDE;
1297         }
1299         #include system dependent Java include directory
1300         if (!($JDK eq "gcj") && $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME")
1301         {
1302                 if ($platform =~ m/solaris/)
1303                 {  $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."solaris";
1304                 }
1305                 elsif  ($platform =~ m/linux/)
1306                 {  $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."linux";
1307                 }
1308                 elsif ($platform =~ m/freebsd/)
1309                 {
1310                 $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."freebsd";
1311                 $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."bsd";
1312                 $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."linux";
1313                 }
1314                 elsif ($platform =~ m/netbsd/)
1315                 {  $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."netbsd";
1316                 }
1317                 elsif ( $platform =~ m/aix/ )
1318                 {  $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."aix";
1319                 }
1320                 elsif ($platform =~ m/openbsd/)
1321                 {  $SOLARINC   .=$I.'$JAVA_HOME'.$INCLUDE.$ds."openbsd";
1322                 }
1324                 #java threads include path
1326         $SOLARINC .=$I.'$JAVA_HOME'.$INCLUDE.$ds."native_threads".$INCLUDE;
1327         }
1328     #The tail, if needed
1329     if ($platform =~ m/linux|freebsd|netbsd|aix|openbsd|dragonfly/)
1330     {  if ( $XINC ne "/usr/include" ) {
1331             $SOLARINC  .= $I.$XINC;
1332        }
1333     }
1335 elsif ($platform =~ m/cygwin/)
1336 {  if ($JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME")
1337    {  $SOLARINC       .= $I.'$JAVA_HOME'.$INCLUDE.$ds."win32".
1338                          $I.'$JAVA_HOME'.$INCLUDE;
1339    }
1340    $SOLARINC       .= $I.'$WINDOWS_SDK_HOME'.$INCLUDE.
1341                       $I.'$COMPATH'.$INCLUDE;
1342    if ( '@ENABLE_DIRECTX@' ne "" ) {
1343        $SOLARINC   .= $I.PathFormat('@DIRECTXSDK_HOME@').$INCLUDE;
1344    }
1346 elsif ($platform =~ m/mingw32/)
1347 {  if ($JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME")
1348    {  if (  '@build_os' eq 'cygwin' )
1349       {  # Using MinGW from Cygwin. Use the normal Windows JDK
1350          # headers
1351          $SOLARINC       .= $I.'$JAVA_HOME'.$INCLUDE.$ds."win32".
1352                             $I.'$JAVA_HOME'.$INCLUDE;
1353       }
1354       else
1355       {  # Cross-compilation. Use our fake jni_md.h
1356          # and othewise the build platform JDK headers
1357          $SOLARINC       .= $I.$SOLARENVINC.$ds."win32".
1358                             $I.'$JAVA_HOME'.$INCLUDE;
1359       }
1360    }
1362 elsif ($platform =~ m/darwin/ && $platform !~ m/^arm/)
1363 {  $SOLARINC         .= $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Versions".$ds."Current".$ds."Headers".
1364                         $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Headers";
1366 elsif ($platform =~ m/^arm-apple/)
1369 else
1370 {  AddWarning( "set_soenv", "$platform not configured for system dependant include dir" );
1373 $gb_REPOS = $SRC_ROOT;
1374 $BUILD_TYPE = "@BUILD_TYPE@";
1376 if ('@WITH_LANG@' ne "")
1378     $BUILD_TYPE = "@BUILD_TYPE@ TRANSLATIONS";
1380 else
1382     $BUILD_TYPE = "@BUILD_TYPE@";
1386 # F. Setting the different aliases.
1388 # 1. alias for a full product make.
1389         $mkout           = '"perl $SOLARENV/bin/mkout.pl"';
1390         $deliver         = '"perl $SOLARENV/bin/deliver.pl"';
1391         $build           = '"perl $SOLARENV/bin/build.pl"';
1392         $zipdep          = '"perl $SOLARENV/bin/zipdep.pl"';
1395 #--------------------------
1396 # VI. Open the output file.
1397 #--------------------------
1399 if (-f $SRC_ROOT.$ds.$oldoutfile) {
1400     print "****\n";
1401     print "**** Note: There is no $oldoutfile any more. Now it is just called Env.Host.sh\n";
1402     print "****\n";
1403     unlink($SRC_ROOT.$ds.$oldoutfile);
1405 $outfile = 'Env.Host.sh';
1407 open( OUT, ">$SRC_ROOT/$outfile" ) ||
1408    die "Cannot open $SRC_ROOT/$outfile: $!\n";
1411 #------------------------------------------
1412 # VII. Writing the data to the output file.
1413 #------------------------------------------
1415 # Write file header.
1416 CreateFileHeader( *OUT, $UPD, $platform, "sh/bash/ksh", "#" );
1418 ToFile( "SRC_ROOT",          $SRC_ROOT,          "e" );
1419 ToFile( "OOO_SHELL",         $OOO_SHELL,         "e" );
1420 ToFile( "JAVA_HOME",         $JAVA_HOME,         "e" );
1421 ToFile( "L10N_MODULE",       $L10N_MODULE,       "e" );
1422 ToFile( "ANT_HOME",          PathFormat("@ANT_HOME@"), "e" );
1423 ToFile( "ANT_LIB",           PathFormat("@ANT_LIB@"), "e" );
1424 ToFile( "ANT",               PathFormat("@ANT@"), "e" );
1425 ToFile( "JDKLIB",            $JAVA_LIB,          "e" );
1426 ToFile( "ASM_PATH",          $ASM_PATH,          "e" );
1427 ToFile( "ML_EXE",            "@ML_EXE@",         "e" );
1428 ToFile( "FRAMEWORKSHOME",    $FRAMEWORKSHOME,    "e" );
1429 ToFile( "Empty",             $empty,             "n" );
1432 # Writing the platform independent constant values to file.
1433 # (c = comment, e = environment variable, a = alias )
1434 ToFile( "Platform independent constant values.", $empty, "c" );
1435 # Languages
1436 ToFile( "WITH_LANG",         "@WITH_LANG@",      "e" );
1437 ToFile( "WITH_LANG_LIST",    "@WITH_LANG_LIST@", "e" );
1438 ToFile( "INTRO_BITMAP",      "@INTRO_BITMAP@",   "e" );
1439 ToFile( "PROGRESSBARCOLOR",  "@PROGRESSBARCOLOR@",   "e" );
1440 ToFile( "PROGRESSSIZE",      "@PROGRESSSIZE@",       "e" );
1441 ToFile( "PROGRESSPOSITION",  "@PROGRESSPOSITION@",   "e" );
1442 ToFile( "PROGRESSFRAMECOLOR","@PROGRESSFRAMECOLOR@", "e" );
1443 ToFile( "ABOUT_BITMAP",      "@ABOUT_BITMAP@",   "e" );
1444 ToFile( "STARTCENTER_LEFT_BITMAP",      "@STARTCENTER_LEFT_BITMAP@",      "e" );
1445 ToFile( "STARTCENTER_RIGHT_BITMAP",     "@STARTCENTER_RIGHT_BITMAP@",     "e" );
1446 ToFile( "STARTCENTER_RTL_LEFT_BITMAP",  "@STARTCENTER_RTL_LEFT_BITMAP@",  "e" );
1447 ToFile( "STARTCENTER_RTL_RIGHT_BITMAP", "@STARTCENTER_RTL_RIGHT_BITMAP@", "e" );
1448 ToFile( "STARTCENTER_SPACE_BITMAP",     "@STARTCENTER_SPACE_BITMAP@",     "e" );
1449 ToFile( "OOO_VENDOR",        "@OOO_VENDOR@",     "e" );
1450 ToFile( "OOODMAKEMODE",      "YES",              "e" );
1451 ToFile( "PRODUCTVERSION",    "@PRODUCTVERSION@", "e" );
1452 ToFile( "WITH_POOR_HELP_LOCALIZATIONS", $WITH_POOR_HELP_LOCALIZATIONS, "e" );
1454 ToFile( "CALL_CDECL",        $CALL_CDECL,        "e" );
1455 ToFile( "COMMON_OUTDIR",     $COMMON_OUTDIR,     "e" );
1456 ToFile( "common_build",      $common_build,      "e" );
1457 ToFile( "NO_REC_RES",        $NO_REC_RES,        "e" );
1458 ToFile( "SO3",               $SO3,               "e" );
1459 ToFile( "SOLAR_PLUGIN",      $SOLAR_PLUGIN,      "e" );
1460 ToFile( "UPDATER",           $UPDATER,           "e" );
1461 ToFile( "VCL",               $VCL,               "e" );
1462 ToFile( "ENABLEUNICODE",     $ENABLEUNICODE,     "e" );
1463 ToFile( "NO_BSYMBOLIC",      $NO_BSYMBOLIC,      "e" );
1464 if ("@ENABLE_DEBUG@" eq "TRUE") {
1465 ToFile( "debug",             "true",             "e" );
1467 if ("@ENABLE_WERROR@" eq "FALSE") {
1468 ToFile( "EXTERNAL_WARNINGS_NOT_ERRORS", "TRUE",  "e" );
1470 ToFile( "PRODUCT",           "@PRODUCT@",        "e" );
1471 ToFile( "PROFULLSWITCH",     "@PROFULLSWITCH@",  "e" );
1472 ToFile( "PROEXT",            $PROEXT,            "e" );
1473 ToFile( "VALGRIND_CFLAGS",   "@VALGRIND_CFLAGS@","e" );
1474 ToFile( "WITH_COMPAT_OOWRAPPERS", "@WITH_COMPAT_OOWRAPPERS@", "e" );
1475 ToFile( "UNIXWRAPPERNAME",   "@UNIXWRAPPERNAME@","e" );
1476 ToFile( "PRODUCTNAME",       "@PRODUCTNAME@",    "e" );
1477 ToFile( "PREFIXDIR",         "@PREFIXDIR@",      "e" );
1478 ToFile( "LIBDIR",            "@LIBDIR@",         "e" );
1479 ToFile( "DATADIR",           "@DATADIR@",        "e" );
1480 ToFile( "MANDIR",            "@MANDIR@",         "e" );
1481 ToFile( "DOCDIR",            "@DOCDIR@",          "e" );
1482 ToFile( "BUILD_MOZAB",       "@BUILD_MOZAB@",    "e" );
1483 ToFile( "PREBUILD_MOZAB",    $PREBUILD_MOZAB,    "e" );
1484 ToFile( "MOZILLA_VERSION",   $MOZILLA_VERSION,   "e" );
1485 ToFile( "DEFAULT_MOZILLA_TOOLKIT", $MOZILLA_TOOLKIT, "e" );
1486 ToFile( "ENABLE_NSS_MODULE",  "@ENABLE_NSS_MODULE@", "e" );
1487 ToFile( "MOZILLABUILD",  "@MOZILLABUILD@", "e" );
1488 ToFile( "BUILD_VER_STRING",  "@BUILD_VER_STRING@", "e" );
1489 if ($platform =~ m/linux/ && $platform =~ m/powerpc/) {
1490 ToFile( "JITC_PROCESSOR_TYPE","6",                 "e" );
1492 ToFile( "DEFAULT_TO_ENGLISH_FOR_PACKING",  "yes", "e" );
1493 ToFile( "ENABLE_GTK",        "@ENABLE_GTK@",       "e" );
1494 ToFile( "GTK_CFLAGS",        "@GTK_CFLAGS@",       "e" );
1495 ToFile( "GTK_LIBS",          "@GTK_LIBS@",         "e" );
1496 ToFile( "ENABLE_GTK3",       "@ENABLE_GTK3@",      "e" );
1497 ToFile( "GTK3_CFLAGS",       "@GTK3_CFLAGS@",      "e" );
1498 ToFile( "GTK3_LIBS",         "@GTK3_LIBS@",        "e" );
1499 ToFile( "GTHREAD_CFLAGS",    "@GTHREAD_CFLAGS@",   "e" );
1500 ToFile( "GTHREAD_LIBS",      "@GTHREAD_LIBS@",     "e" );
1501 ToFile( "ENABLE_SYSTRAY_GTK", "@ENABLE_SYSTRAY_GTK@", "e" );
1502 ToFile( "ENABLE_STATIC_GTK", "@ENABLE_STATIC_GTK@", "e" );
1503 ToFile( "SPLIT_APP_MODULES", "@SPLIT_APP_MODULES@","e" );
1504 ToFile( "SPLIT_OPT_FEATURES","@SPLIT_OPT_FEATURES@","e" );
1505 ToFile( "ENABLE_CAIRO_CANVAS", "@ENABLE_CAIRO_CANVAS@",     "e" );
1506 ToFile( "ENABLE_OPENGL",     "@ENABLE_OPENGL@",    "e" );
1507 ToFile( "ENABLE_PDFIMPORT",  "@ENABLE_PDFIMPORT@", "e" );
1508 ToFile( "ENABLE_MINIMIZER",   "@ENABLE_MINIMIZER@","e" );
1509 ToFile( "ENABLE_PRESENTER_SCREEN","@ENABLE_PRESENTER_SCREEN@","e" );
1510 ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" );
1511 ToFile( "ENABLE_SCRIPTING_BEANSHELL","@ENABLE_SCRIPTING_BEANSHELL@","e" );
1512 ToFile( "ENABLE_SCRIPTING_JAVASCRIPT","@ENABLE_SCRIPTING_JAVASCRIPT@","e" );
1513 ToFile( "ENABLE_SCRIPTING_PYTHON","@ENABLE_SCRIPTING_PYTHON@","e" );
1514 ToFile( "ENABLE_QUICKSTART_LIBPNG", "@ENABLE_QUICKSTART_LIBPNG@", "e" );
1515 ToFile( "SYSTEM_JFREEREPORT","@SYSTEM_JFREEREPORT@","e" );
1516 ToFile( "WITH_THEMES",       "@WITH_THEMES@",      "e");
1517 ToFile( "WITH_HELPPACK_INTEGRATION",       "@WITH_HELPPACK_INTEGRATION@",      "e");
1518 ToFile( "WITH_EXTENSION_INTEGRATION",       "@WITH_EXTENSION_INTEGRATION@",      "e");
1519 ToFile( "OOO_JUNIT_JAR",     "@OOO_JUNIT_JAR@",    "e" );
1520 ToFile( "SAC_JAR",           "@SAC_JAR@",          "e" );
1521 ToFile( "LIBXML_JAR",        "@LIBXML_JAR@",       "e" );
1522 ToFile( "FLUTE_JAR",         "@FLUTE_JAR@",        "e" );
1523 ToFile( "JFREEREPORT_JAR",   "@JFREEREPORT_JAR@",  "e" );
1524 ToFile( "LIBLAYOUT_JAR",     "@LIBLAYOUT_JAR@",    "e" );
1525 ToFile( "LIBLOADER_JAR",     "@LIBLOADER_JAR@",    "e" );
1526 ToFile( "LIBFORMULA_JAR",    "@LIBFORMULA_JAR@",   "e" );
1527 ToFile( "LIBREPOSITORY_JAR", "@LIBREPOSITORY_JAR@","e" );
1528 ToFile( "LIBBASE_JAR",       "@LIBBASE_JAR@",      "e" );
1529 ToFile( "LIBFONTS_JAR",      "@LIBFONTS_JAR@",     "e" );
1530 ToFile( "LIBSERIALIZER_JAR", "@LIBSERIALIZER_JAR@","e" );
1531 ToFile( "ENABLE_MEDIAWIKI",  "@ENABLE_MEDIAWIKI@", "e" );
1532 ToFile( "SYSTEM_APACHE_COMMONS","@SYSTEM_APACHE_COMMONS@","e" );
1533 ToFile( "COMMONS_CODEC_JAR", "@COMMONS_CODEC_JAR@","e" );
1534 ToFile( "COMMONS_LANG_JAR",  "@COMMONS_LANG_JAR@", "e" );
1535 ToFile( "COMMONS_HTTPCLIENT_JAR","@COMMONS_HTTPCLIENT_JAR@","e" );
1536 ToFile( "COMMONS_LOGGING_JAR","@COMMONS_LOGGING_JAR@","e" );
1537 ToFile( "SYSTEM_SERVLETAPI", "@SYSTEM_SERVLETAPI@", "e" );
1538 ToFile( "SERVLETAPI_JAR",    "@SERVLETAPI_JAR@",   "e" );
1539 ToFile( "ENABLE_DBUS",       "@ENABLE_DBUS@",      "e" );
1540 ToFile( "ENABLE_GCONF",      "@ENABLE_GCONF@",     "e" );
1541 ToFile( "ENABLE_GNOMEVFS",   "@ENABLE_GNOMEVFS@",  "e" );
1542 ToFile( "ENABLE_GSTREAMER",  "@ENABLE_GSTREAMER@", "e" );
1543 ToFile( "ENABLE_GIO",        "@ENABLE_GIO@",       "e" );
1544 ToFile( "ENABLE_KDE",        "@ENABLE_KDE@",       "e" );
1545 ToFile( "KDE_CFLAGS",        "@KDE_CFLAGS@",       "e" );
1546 ToFile( "KDE_LIBS",          "@KDE_LIBS@",         "e" );
1547 ToFile( "MOC",               "@MOC@",              "e" );
1548 ToFile( "ENABLE_KDE4",       "@ENABLE_KDE4@",      "e" );
1549 ToFile( "KDE4_CFLAGS",       "@KDE4_CFLAGS@",      "e" );
1550 ToFile( "KDE4_LIBS",         "@KDE4_LIBS@",        "e" );
1551 ToFile( "MOC4",              "@MOC4@",             "e" );
1552 ToFile( "KDE_GLIB_CFLAGS",   "@KDE_GLIB_CFLAGS@",  "e" );
1553 ToFile( "KDE_GLIB_LIBS",     "@KDE_GLIB_LIBS@",    "e" );
1554 ToFile( "KDE_HAVE_GLIB",     "@KDE_HAVE_GLIB@",    "e" );
1555 ToFile( "ENABLE_KAB",        "@ENABLE_KAB@",       "e" );
1556 ToFile( "PSPRINT",           "TRUE",             "e" );
1557 ToFile( "MKDEPENDSOLVER",    "TRUE",             "e" );
1558 ToFile( "nodep",             "@nodep@",          "e" );
1559 ToFile( "TARFILE_LOCATION",  $TARFILE_LOCATION,  "e" );
1560 ToFile( "GIT_LINK_SRC", "@GIT_LINK_SRC@",  "e" );
1561 ToFile( "GIT_REPO_NAMES", "@GIT_REPO_NAMES@",  "e" );
1564 # Writing the platform dependent constant values to file.
1565 # (c = comment, e = environment variable, a = alias )
1566 ToFile( "Platform dependent constant values.", $empty, "c" );
1567 ToFile( "SOLAR_JAVA",        $SOLAR_JAVA,        "e" );
1568 ToFile( "COM",               $COM,               "e" );
1569 ToFile( "COMPATH",           $COMPATH,           "e" );
1570 ToFile( "CPU",               $CPU,               "e" );
1571 ToFile( "CPUNAME",           $CPUNAME,           "e" );
1572 ToFile( "GUI",               $GUI,               "e" );
1573 ToFile( "GUIBASE",           $GUIBASE,           "e" );
1574 ToFile( "GVER",              $GVER,              "e" );
1575 ToFile( "OS",                $OS,                "e" );
1576 ToFile( "OSVERSION",         $OSVERSION,         "e" );
1577 ToFile( "PTHREAD_CFLAGS",    "@PTHREAD_CFLAGS@", "e" );
1578 ToFile( "PTHREAD_LIBS",      "@PTHREAD_LIBS@",   "e" );
1579 ToFile( "OUTPATH",           $OUTPATH,           "e" );
1580 ToFile( "INPATH",            $INPATH,            "e" );
1581 ToFile( "PATH_SEPERATOR",    $PATH_SEPERATOR,    "e" );
1582 ToFile( "COMEX",             $COMEX,             "e" );
1583 ToFile( "DYNAMIC_CRT",       $DYNAMIC_CRT,       "e" );
1584 ToFile( "use_shl_versions",  $use_shl_versions,  "e" );
1586 if ( $platform =~ m/darwin/ && $platform !~ m/^arm/)
1588 # MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build,
1589 # build can assume functions/libraries of that version to be available
1590 # unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk
1591 # (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
1592 # http://developer.apple.com/technotes/tn2002/tn2064.html
1593     ToFile( "MACOSX_DEPLOYMENT_TARGET",       "@MACOSX_DEPLOYMENT_TARGET@",       "e" );
1594     ToFile( "MACOSX_SDK_PATH",                "@MACOSX_SDK_PATH@",                "e" );
1595     ToFile( "MAC_OS_X_VERSION_MIN_REQUIRED",  "@MAC_OS_X_VERSION_MIN_REQUIRED@", "e" );
1596     ToFile( "MAC_OS_X_VERSION_MAX_ALLOWED",   "@MAC_OS_X_VERSION_MAX_ALLOWED@",  "e" );
1600 # Writing the variables to file.
1601 # (c = comment, e = environment variable, a = alias, n = newline )
1602 ToFile( "Variable values.",  $empty,             "c" );
1603 if ( $platform =~ m/cygwin/ )
1604 {  ToFile( "CYGWIN_PATH",       $CYGWIN_PATH,       "e" );
1605    ToFile( "WINDOWS_SDK_HOME",  $WINDOWS_SDK_HOME,  "e" );
1606    ToFile( "DIRECTXSDK_LIB",    $DIRECTXSDK_LIB,    "e" );
1607    ToFile( "USE_DIRECTX5",      $USE_DIRECTX5,      "e" );
1608    ToFile( "ATL_LIB",           $ATL_LIB,           "e" );
1609    ToFile( "ATL_INCLUDE",       $ATL_INCLUDE,       "e" );
1610    ToFile( "MFC_LIB",           $MFC_LIB,         "e" );
1611    ToFile( "MFC_INCLUDE",       $MFC_INCLUDE,       "e" );
1612    ToFile( "NSIS_PATH",         $NSIS_PATH,         "e" );
1613    ToFile( "DISABLE_ACTIVEX",   "@DISABLE_ACTIVEX@","e" );
1614    ToFile( "DISABLE_ATL",   "@DISABLE_ATL@","e" );
1615    ToFile( "INCLUDE",           "",                 "e" );
1616    # Variables used when building the parts that needs to be available
1617    # also as 64-bit versions in a 32-bit LibreOffice build, like
1618    # the Explorer extension. If the configure script hasn't
1619    # found the 64-bit (cross-)compiler, then @BUILD_X64@ will be empty.
1620    ToFile( "BUILD_X64",         "@BUILD_X64@",      "e" );
1621    if ( "@BUILD_X64@" eq "TRUE" ) {
1622        ToFile( "CC_X64_BINARY", "@CC_X64_BINARY@",  "e" );
1623        ToFile( "CXX_X64_BINARY","@CXX_X64_BINARY@", "e" );
1624        ToFile( "LINK_X64_BINARY","@LINK_X64_BINARY@","e" );
1625        ToFile( "LIBMGR_X64_BINARY","@LIBMGR_X64_BINARY@","e" );
1626    }
1628    # Hack around dmake's mktmp not generating DOS paths.
1629    my $tmpdir = qx{cygpath -m "/tmp"};
1630    chomp($tmpdir);
1631    ToFile( "TMPDIR",     $tmpdir,            "e" );
1632    if ( !defined $ENV{"TMP"} || $ENV{"TMP"} eq "" ) {
1633       ToFile( "TMP", $tmpdir, "e" );
1634    } else {
1635       ToFile( "TMP", "$ENV{'TMP'}", "e" );
1636    }
1638 elsif ( $platform =~ m/mingw32/ )
1639 {  ToFile( "NSIS_PATH",         $NSIS_PATH,         "e" );
1640    ToFile( "DISABLE_ACTIVEX",   "@DISABLE_ACTIVEX@","e" );
1641    ToFile( "DISABLE_ATL",       "@DISABLE_ATL@",    "e" );
1642    ToFile( "MINGW_CLIB_DIR",    "@MINGW_CLIB_DIR@", "e" );
1643    ToFile( "MINGW_SHARED_GCCLIB", "@MINGW_SHARED_GCCLIB@", "e" );
1644    ToFile( "MINGW_SHARED_GXXLIB", "@MINGW_SHARED_GXXLIB@", "e" );
1645    ToFile( "MINGW_SHARED_LIBSTDCPP", "@MINGW_SHARED_LIBSTDCPP@", "e" );
1646    ToFile( "MINGW_GCCDLL",      "@MINGW_GCCDLL@",   "e" );
1647    ToFile( "MINGW_GXXDLL",      "@MINGW_GXXDLL@",   "e" );
1651 if ("@WITH_VC_REDIST@" eq "TRUE") {
1652 ToFile( "WITH_VC_REDIST", "TRUE",  "e" );
1654 ToFile( "PERL",              $PERL,              "e" );
1655 ToFile( "RPM",               "@RPM@",            "e" );
1656 ToFile( "DPKG",              "@DPKG@",           "e" );
1657 ToFile( "PKGMK",             "@PKGMK@",          "e" );
1658 ToFile( "GNUMAKE",           "@GNUMAKE@",        "e" );
1659 ToFile( "GNUTAR",            "@GNUTAR@",         "e" );
1660 ToFile( "UPD",               $UPD,               "e" );
1661 ToFile( "WORK_STAMP",        $WORK_STAMP,        "e" );
1662 ToFile( "SOLARVER",          $SOLARVER,          "e" );
1663 ToFile( "SOLARVERSION",      $SOLARVERSION,      "e" );
1664 ToFile( "WORKDIR",           $WORKDIR,           "e" );
1665 ToFile( "OUTDIR",            $OUTDIR,            "e" );
1666 ToFile( "SOLARENV",          $SOLARENV,          "e" );
1667 ToFile( "SOLARDEFIMG",       $SOLARDEFIMG,       "e" );
1668 ToFile( "SOLARENVINC",       $SOLARENVINC,       "e" );
1669 ToFile( "DMAKEROOT",         $DMAKEROOT,         "e" );
1670 if ( $JDK ne "gcj" ) {
1671    ToFile( "CLASSPATH",         $CLASSPATH,         "e" );
1672    ToFile( "XCLASSPATH",        $XCLASSPATH,        "e" );
1673    ToFile( "JAVACISKAFFE",     '@JAVACISKAFFE@',    "e" );
1675 else {
1676    ToFile( "JAVACISGCJ",       '@JAVACISGCJ@',      "e" );
1678 if ( $GUI eq "UNX" ) {
1679    ToFile( "AWTLIB",           '@AWTLIB@',          "e" );
1681 if ( '@JDK@' ne '' )
1683    ToFile( "JDK",             "@JDK@",           "e" );
1684    ToFile( "JAVAFLAGS",             "@JAVAFLAGS@",           "e" );
1685    ToFile( "JAVA_SOURCE_VER", "@JAVA_SOURCE_VER@","e" );
1686    ToFile( "JAVA_TARGET_VER", "@JAVA_TARGET_VER@","e" );
1687    ToFile( "JAVAINTERPRETER", PathFormat("@JAVAINTERPRETER@"), "e" );
1688    ToFile( "JAVAIFLAGS",      "@JAVAIFLAGS@",    "e" );
1689    ToFile( "JAVACOMPILER",    PathFormat("@JAVACOMPILER@"), "e" );
1690    ToFile( "JAVADOC",         PathFormat("@JAVADOC@"), "e" );
1691    ToFile( "JVM_ONE_PATH_CHECK", "@JVM_ONE_PATH_CHECK@", "e" );
1693 ToFile( "SCPDEFS",           '@SCPDEFS@',        "e" );
1694 ToFile( "SOLAREXTRAINC",     $SOLAREXTRAINC,     "e" );
1695 ToFile( "SOLAREXTRALIB",     $SOLAREXTRALIB,     "e" );
1696 if ( '@CROSS_COMPILING@' eq 'YES' )
1698    # Obviously we shouldn't set PATH to contain host binaries
1699    ToFile( "PATH",           "@PATH_FOR_BUILD@", "e" );
1701 else
1703    ToFile( "PATH",           $PATH,              "e" );
1705 ToFile( "SOLARLIB",          $SOLARLIB,          "e" );
1706 ToFile( "JAVALIB",           $JAVALIB,           "e" );
1707 ToFile( "SOLARINC",          $SOLARINC,          "e" );
1708 ToFile( "COMP_ENV",          $COMP_ENV,          "e" );
1709 ToFile( "JAVAHOME",          $JAVAHOME,          "e" );
1710 ToFile( "CC",                $CC,                "e" );
1711 ToFile( "SYSBASE",           "$ENV{SYSBASE}",    "e" ) if defined $ENV{SYSBASE};
1712 ToFile( "CROSS_COMPILING",   "@CROSS_COMPILING@","e" );
1713 ToFile( "AR",                "@AR@",             "e" );
1714 ToFile( "DLLTOOL",           "@DLLTOOL@",        "e" );
1715 ToFile( "NM",                "@NM@",             "e" );
1716 ToFile( "OBJDUMP",           "@OBJDUMP@",        "e" );
1717 ToFile( "PKG_CONFIG",        "@PKG_CONFIG@",     "e" );
1718 ToFile( "RANLIB",            "@RANLIB@",         "e" );
1719 ToFile( "STRIP",             "@STRIP@",          "e" );
1720 ToFile( "WINDRES",           "@WINDRES@",        "e" );
1721 ToFile( "BUILD_PLATFORM",    "@build@",          "e" );
1722 ToFile( "HOST_PLATFORM",     "@host@",           "e" );
1723 if ( '@CROSS_COMPILING@' eq 'YES' )
1725    ToFile( "COM_FOR_BUILD",     "@COM_FOR_BUILD@",  "e" );
1726    ToFile( "GUI_FOR_BUILD",     "@GUI_FOR_BUILD@",  "e" );
1727    ToFile( "GUIBASE_FOR_BUILD", "@GUIBASE_FOR_BUILD@", "e" );
1728    ToFile( "OS_FOR_BUILD",      "@OS_FOR_BUILD@",   "e" );
1729    ToFile( "CPU_FOR_BUILD",     "@CPU_FOR_BUILD@",  "e" );
1730    ToFile( "CPUNAME_FOR_BUILD", "@CPUNAME_FOR_BUILD@", "e" );
1731    ToFile( "CC_FOR_BUILD",      "@CC_FOR_BUILD@",   "e" );
1732    ToFile( "CXX_FOR_BUILD",     "@CXX_FOR_BUILD@",  "e" );
1733    ToFile( "GXX_INCLUDE_PATH_FOR_BUILD", "@GXX_INCLUDE_PATH_FOR_BUILD@", "e" );
1734    ToFile( "INPATH_FOR_BUILD",  "@INPATH_FOR_BUILD@", "e" );
1735    ToFile( "OUTPATH_FOR_BUILD", "@OUTPATH_FOR_BUILD@", "e" );
1736    ToFile( "MACOSX_DEPLOYMENT_TARGET_FOR_BUILD", "@MACOSX_DEPLOYMENT_TARGET_FOR_BUILD@", "e" );
1737    ToFile( "SYSTEM_LIBXSLT_FOR_BUILD", "@SYSTEM_LIBXSLT_FOR_BUILD@", "e" );
1738    ToFile( "OUTDIR_FOR_BUILD",  "@OUTDIR_FOR_BUILD@", "e");
1739    ToFile( "SOLARINC_FOR_BUILD", "@SOLARINC_FOR_BUILD@", "e");
1740    ToFile( "SOLARLIB_FOR_BUILD", "@SOLARLIB_FOR_BUILD@", "e");
1741    ToFile( "WORKDIR_FOR_BUILD", "@WORKDIR_FOR_BUILD@", "e");
1743 else
1745    ToFile( "COM_FOR_BUILD",     $COM,            "e" );
1746    ToFile( "GUI_FOR_BUILD",     $GUI,            "e" );
1747    ToFile( "GUIBASE_FOR_BUILD", $GUIBASE,        "e" );
1748    ToFile( "OS_FOR_BUILD",      $OS,             "e" );
1749    ToFile( "CPU_FOR_BUILD",     $CPU,            "e" );
1750    ToFile( "CPUNAME_FOR_BUILD", $CPUNAME,        "e" );
1751    ToFile( "CC_FOR_BUILD",      $CC,             "e" );
1752    ToFile( "CXX_FOR_BUILD",     $CXX,            "e" );
1753    ToFile( "GXX_INCLUDE_PATH_FOR_BUILD", PathFormat("@GXX_INCLUDE_PATH@"), "e" );
1754    ToFile( "INPATH_FOR_BUILD",  $INPATH,         "e" );
1755    ToFile( "OUTPATH_FOR_BUILD", $OUTPATH,        "e" );
1756    ToFile( "SYSTEM_LIBXSLT_FOR_BUILD", "@SYSTEM_LIBXSLT@", "e" );
1757    ToFile( "OUTDIR_FOR_BUILD",  $OUTDIR,         "e" );
1758    ToFile( "PATH_FOR_BUILD",    $PATH,           "e" );
1759    ToFile( "SOLARINC_FOR_BUILD", $SOLARINC,      "e" );
1760    ToFile( "SOLARLIB_FOR_BUILD", $SOLARLIB,      "e" );
1761    ToFile( "WORKDIR_FOR_BUILD", $WORKDIR,        "e" );
1763 ToFile( "GMAKE_PARALLELISM",    "@GMAKE_PARALLELISM@", "e" );
1764 ToFile( "GMAKE_MODULE_PARALLELISM","@GMAKE_MODULE_PARALLELISM@", "e" );
1765 ToFile( "SIZEOF_SHORT",         "@SIZEOF_SHORT@", "e" );
1766 ToFile( "SIZEOF_INT",           "@SIZEOF_INT@",  "e" );
1767 ToFile( "SIZEOF_LONG",          "@SIZEOF_LONG@", "e" );
1768 ToFile( "SIZEOF_LONGLONG",      "@SIZEOF_LONGLONG@", "e" );
1769 ToFile( "SIZEOF_DOUBLE",        "@SIZEOF_DOUBLE@", "e" );
1770 ToFile( "SIZEOF_POINTER",       "@SIZEOF_POINTER@", "e" );
1771 ToFile( "ALIGNOF_SHORT",        "@ALIGNOF_SHORT@", "e" );
1772 ToFile( "ALIGNOF_INT",          "@ALIGNOF_INT@", "e" );
1773 ToFile( "ALIGNOF_LONG",         "@ALIGNOF_LONG@", "e" );
1774 ToFile( "ALIGNOF_DOUBLE",       "@ALIGNOF_DOUBLE@", "e" );
1775 ToFile( "WORDS_BIGENDIAN",      "@WORDS_BIGENDIAN@", "e" );
1776 ToFile( "HAVE_GCC_NO_LONG_DOUBLE", "@HAVE_GCC_NO_LONG_DOUBLE@", "e" );
1777 ToFile( "HAVE_GCC_AVX", "@HAVE_GCC_AVX@", "e" );
1778 ToFile( "HAVE_GCC_VISIBILITY_FEATURE",
1779                 "@HAVE_GCC_VISIBILITY_FEATURE@", "e" );
1780 ToFile( "HAVE_GCC_VISIBILITY_BROKEN",
1781         "@HAVE_GCC_VISIBILITY_BROKEN@", "e" );
1782 ToFile( "HAVE_LD_HASH_STYLE","@HAVE_LD_HASH_STYLE@","e" );
1783 ToFile( "WITH_LINKER_HASH_STYLE","@WITH_LINKER_HASH_STYLE@","e" );
1784 ToFile( "HAVE_LD_BSYMBOLIC_FUNCTIONS",
1785                 "@HAVE_LD_BSYMBOLIC_FUNCTIONS@","e" );
1786 ToFile( "HAVE_CXX0X",        "@HAVE_CXX0X@",     "e" );
1787 ToFile( "CXX",               $CXX,               "e" );
1788 ToFile( "MINGWCXX",          "@MINGWCXX@",       "e" );
1789 ToFile( "MINGWSTRIP",        "@MINGWSTRIP@",     "e" );
1790 ToFile( "WITH_STLPORT",      "@WITH_STLPORT@", "e" );
1791 ToFile( "ALLOC",             "@ALLOC@",          "e" );
1792 ToFile( "ENABLE_LTO",        "@ENABLE_LTO@",        "e" );
1793 ToFile( "ENABLE_SYMBOLS",    "@ENABLE_SYMBOLS@",    "e" );
1794 ToFile( "DISABLE_STRIP",     "@DISABLE_STRIP@",     "e" );
1795 ToFile( "LFS_CFLAGS",        "@LFS_CFLAGS@",     "e" );
1796 ToFile( "ENABLE_CRASHDUMP",  "@ENABLE_CRASHDUMP@",  "e" );
1797 ToFile( "ENABLE_RANDR",      "@ENABLE_RANDR@",      "e" );
1798 ToFile( "ENABLE_FONTCONFIG", "@ENABLE_FONTCONFIG@", "e" );
1799 ToFile( "FONTCONFIG_LIBS",   "@FONTCONFIG_LIBS@",   "e");
1800 ToFile( "FONTCONFIG_CFLAGS", "@FONTCONFIG_CFLAGS@", "e");
1801 ToFile( "ENABLE_DIRECTX",    "@ENABLE_DIRECTX@",    "e" );
1802 ToFile( "ENABLE_LAYOUT",     "@ENABLE_LAYOUT@",     "e" );
1803 ToFile( "ENABLE_PCH",        "@ENABLE_PCH@",       "e" );
1804 ToFile( "ENABLE_GRAPHITE",   "@ENABLE_GRAPHITE@",   "e");
1805 ToFile( "SYSTEM_GRAPHITE",   "@SYSTEM_GRAPHITE@",   "e");
1806 ToFile( "GRAPHITE_LIBS",     "@GRAPHITE_LIBS@",     "e");
1807 ToFile( "GRAPHITE_CFLAGS",   "@GRAPHITE_CFLAGS@",   "e");
1808 ToFile( "CL_X64",            "@CL_X64@",            "e");
1809 ToFile( "WITH_MYSPELL_DICTS","@WITH_MYSPELL_DICTS@","e");
1810 ToFile( "SYSTEM_DICTS",      "@SYSTEM_DICTS@",     "e");
1811 ToFile( "DICT_SYSTEM_DIR",   "@DICT_SYSTEM_DIR@",  "e");
1812 ToFile( "HYPH_SYSTEM_DIR",   "@HYPH_SYSTEM_DIR@",  "e");
1813 ToFile( "THES_SYSTEM_DIR",   "@THES_SYSTEM_DIR@",  "e");
1814 ToFile( "ENABLE_LOCKDOWN",   "@ENABLE_LOCKDOWN@",  "e" );
1815 ToFile( "WITH_LDAP",         "@WITH_LDAP@",        "e" );
1816 ToFile( "WITH_OPENLDAP",     "@WITH_OPENLDAP@",    "e" );
1817 ToFile( "WITH_MOZILLA",      "@WITH_MOZILLA@",     "e" );
1818 ToFile( "SYSTEM_MOZILLA",    "@SYSTEM_MOZILLA@",   "e" );
1819 ToFile( "MOZ_FLAVOUR",       "@MOZ_FLAVOUR@",      "e" );
1820 ToFile( "NSPR_LIB",          "@NSPR_LIB@",         "e" );
1821 ToFile( "NSS_LIB",           "@NSS_LIB@",          "e" );
1822 ToFile( "MOZ_INC",           "@MOZ_INC@",          "e" );
1823 ToFile( "MOZ_LIB",           "@MOZ_LIB@",          "e" );
1824 ToFile( "MOZ_LIB_XPCOM",     "@MOZ_LIB_XPCOM@",    "e" );
1825 ToFile( "MOZ_NSPR_CFLAGS",   "@MOZ_NSPR_CFLAGS@",  "e" );
1826 ToFile( "MOZ_NSS_CFLAGS",    "@MOZ_NSS_CFLAGS@",   "e" );
1827 ToFile( "MOZ_NSS_LIBS",      "@MOZ_NSS_LIBS@",     "e" );
1828 ToFile( "MOZ_LDAP_CFLAGS",   "@MOZ_LDAP_CFLAGS@",  "e" );
1829 ToFile( "OOOP_GALLERY_PACK", "@OOOP_GALLERY_PACK@","e" );
1830 ToFile( "OOOP_TEMPLATES_PACK", "@OOOP_TEMPLATES_PACK@","e" );
1831 ToFile( "OOOP_FONTS_PACK",   "@OOOP_FONTS_PACK@","e" );
1832 ToFile( "OOOP_SAMPLES_PACK", "@OOOP_SAMPLES_PACK@","e" );
1833 ToFile( "CT2N_EXTENSION_PACK", "@CT2N_EXTENSION_PACK@","e" );
1834 ToFile( "BARCODE_EXTENSION_PACK", "@BARCODE_EXTENSION_PACK@","e" );
1835 ToFile( "DIAGRAM_EXTENSION_PACK", "@DIAGRAM_EXTENSION_PACK@","e" );
1836 ToFile( "VALIDATOR_EXTENSION_PACK", "@VALIDATOR_EXTENSION_PACK@","e" );
1837 ToFile( "WATCH_WINDOW_EXTENSION_PACK", "@WATCH_WINDOW_EXTENSION_PACK@","e" );
1838 ToFile( "NUMBERTEXT_EXTENSION_PACK", "@NUMBERTEXT_EXTENSION_PACK@","e" );
1839 ToFile( "HUNART_EXTENSION_PACK", "@HUNART_EXTENSION_PACK@","e" );
1840 ToFile( "TYPO_EXTENSION_PACK", "@TYPO_EXTENSION_PACK@","e" );
1841 ToFile( "GOOGLE_DOCS_EXTENSION_PACK", "@GOOGLE_DOCS_EXTENSION_PACK@","e" );
1842 ToFile( "OOOBLOGGER_EXTENSION_PACK", "@OOOBLOGGER_EXTENSION_PACK@","e" );
1843 ToFile( "SUNTEMPLATES_LANG", "@SUNTEMPLATES_LANG@","e" );
1844 ToFile( "SUNTEMPLATES_DE_PACK", "@SUNTEMPLATES_DE_PACK@","e" );
1845 ToFile( "SUNTEMPLATES_EN_US_PACK", "@SUNTEMPLATES_EN_US_PACK@","e" );
1846 ToFile( "SUNTEMPLATES_ES_PACK", "@SUNTEMPLATES_ES_PACK@","e" );
1847 ToFile( "SUNTEMPLATES_FR_PACK", "@SUNTEMPLATES_FR_PACK@","e" );
1848 ToFile( "SUNTEMPLATES_HU_PACK", "@SUNTEMPLATES_HU_PACK@","e" );
1849 ToFile( "SUNTEMPLATES_IT_PACK", "@SUNTEMPLATES_IT_PACK@","e" );
1850 ToFile( "LIGHTPROOF_EN_US_PACK", "@LIGHTPROOF_EN_US_PACK@","e" );
1851 ToFile( "LIGHTPROOF_HU_PACK", "@LIGHTPROOF_HU_PACK@","e" );
1852 ToFile( "LIGHTPROOF_RU_PACK", "@LIGHTPROOF_RU_PACK@","e" );
1853 ToFile( "LIGHTPROOF_LANG",   "@LIGHTPROOF_LANG@",  "e" );
1854 ToFile( "WITH_FONTS",        "@WITH_FONTS@",       "e" );
1855 ToFile( "WITH_AGFA_MONOTYPE_FONTS",  "@WITH_AGFA_MONOTYPE_FONTS@", "e" );
1856 ToFile( "WITHOUT_AFMS",      "@WITHOUT_AFMS@",     "e" );
1857 ToFile( "WITHOUT_PPDS",      "@WITHOUT_PPDS@",     "e" );
1858 ToFile( "WITH_BINFILTER",    "@WITH_BINFILTER@",   "e" );
1859 ToFile( "BUILD_TYPE",        "$BUILD_TYPE",       "e" );
1860 ToFile( "VERBOSE",           "@VERBOSE@",          "e" );
1861 ToFile( "ENABLE_ZENITY",           "@ENABLE_ZENITY@",          "e" );
1862 ToFile( "ENABLE_EVOAB2",     "@ENABLE_EVOAB2@",    "e" );
1863 ToFile( "ENABLE_UGLY",       "@ENABLE_UGLY@",      "e" );
1864 ToFile( "ENABLE_RELEASE_BUILD", "@ENABLE_RELEASE_BUILD@", "e" );
1865 ToFile( "GOBJECT_CFLAGS",    "@GOBJECT_CFLAGS@",   "e" );
1866 ToFile( "GOBJECT_LIBS",      "@GOBJECT_LIBS@",     "e" );
1867 if ( '@ENABLE_RPATH@' eq "no" ) {
1868   ToFile( "LINKFLAGSRUNPATH",'',                   "e" );
1870 ToFile( "EPM",               "@EPM@",              "e" );
1871 ToFile( "EPM_FLAGS",         $EPM_FLAGS,           "e" );
1872 ToFile( "BUILD_EPM",         "@BUILD_EPM@",        "e" );
1873 ToFile( "GPERF",             "@GPERF@",            "e" );
1874 ToFile( "PKGFORMAT",         "@PKGFORMAT@",        "e" );
1875 ToFile( "SYSTEM_STDLIBS",    "@SYSTEM_STDLIBS@",   "e" );
1876 ToFile( "SYSTEM_ZLIB",       "@SYSTEM_ZLIB@",      "e" );
1877 ToFile( "SYSTEM_OPENSSL",    "@SYSTEM_OPENSSL@",   "e" );
1878 ToFile( "OPENSSL_CFLAGS",    "@OPENSSL_CFLAGS@",   "e" );
1879 ToFile( "OPENSSL_LIBS",      "@OPENSSL_LIBS@",     "e" );
1880 ToFile( "DISABLE_PYTHON",    "@DISABLE_PYTHON@",   "e" );
1881 ToFile( "SYSTEM_PYTHON",     "@SYSTEM_PYTHON@",    "e" );
1882 ToFile( "PYTHON",            "@PYTHON@",           "e" );
1883 ToFile( "PYTHON_CFLAGS",     "@PYTHON_CFLAGS@",    "e" );
1884 ToFile( "PYTHON_LIBS",       "@PYTHON_LIBS@",      "e" );
1885 ToFile( "SYSTEM_ICU",        "@SYSTEM_ICU@",       "e" );
1886 ToFile( "ICU_MAJOR",         "@ICU_MAJOR@",        "e" );
1887 ToFile( "ICU_MINOR",         "@ICU_MINOR@",        "e" );
1888 ToFile( "ICU_MICRO",         "@ICU_MICRO@",        "e" );
1889 ToFile( "SYSTEM_GENBRK",     "@SYSTEM_GENBRK@",    "e" );
1890 ToFile( "SYSTEM_GENCCODE",   "@SYSTEM_GENCCODE@",  "e" );
1891 ToFile( "SYSTEM_GENCMN",     "@SYSTEM_GENCMN@",    "e" );
1892 ToFile( "SYSTEM_JPEG",       "@SYSTEM_JPEG@",      "e" );
1893 ToFile( "FREETYPE_CFLAGS",   "@FREETYPE_CFLAGS@",  "e" );
1894 ToFile( "FREETYPE_LIBS",     "@FREETYPE_LIBS@",    "e" );
1895 ToFile( "SYSTEM_POPPLER",    "@SYSTEM_POPPLER@",   "e" );
1896 ToFile( "POPPLER_CFLAGS",    "@POPPLER_CFLAGS@",   "e" );
1897 ToFile( "POPPLER_LIBS",      "@POPPLER_LIBS@",     "e" );
1898 ToFile( "GSTREAMER_CFLAGS",  "@GSTREAMER_CFLAGS@", "e" );
1899 ToFile( "GSTREAMER_LIBS",    "@GSTREAMER_LIBS@",   "e" );
1900 ToFile( "SYSTEM_CAIRO",      "@SYSTEM_CAIRO@",     "e" );
1901 ToFile( "CAIRO_CFLAGS",      "@CAIRO_CFLAGS@",     "e" );
1902 ToFile( "CAIRO_LIBS",        "@CAIRO_LIBS@",       "e" );
1903 ToFile( "XRANDR_CFLAGS",     "@XRANDR_CFLAGS@",    "e" );
1904 ToFile( "XRANDR_LIBS",       "@XRANDR_LIBS@",      "e" );
1905 ToFile( "XRANDR_DLOPEN",     "@XRANDR_DLOPEN@",    "e" );
1906 ToFile( "LIBPNG_CFLAGS",     "@LIBPNG_CFLAGS@",    "e" );
1907 ToFile( "LIBPNG_LIBS",       "@LIBPNG_LIBS@",      "e" );
1908 ToFile( "SYSTEM_LIBWPD",     "@SYSTEM_LIBWPD@",    "e" );
1909 ToFile( "LIBWPD_CFLAGS",     "@LIBWPD_CFLAGS@",    "e" );
1910 ToFile( "LIBWPD_LIBS",       "@LIBWPD_LIBS@",      "e" );
1911 ToFile( "SYSTEM_LIBWPS",     "@SYSTEM_LIBWPS@",    "e" );
1912 ToFile( "LIBWPS_CFLAGS",     "@LIBWPS_CFLAGS@",    "e" );
1913 ToFile( "LIBWPS_LIBS",       "@LIBWPS_LIBS@",      "e" );
1914 ToFile( "SYSTEM_LIBWPG",     "@SYSTEM_LIBWPG@",    "e" );
1915 ToFile( "LIBWPG_CFLAGS",     "@LIBWPG_CFLAGS@",    "e" );
1916 ToFile( "LIBWPG_LIBS",       "@LIBWPG_LIBS@",      "e" );
1917 ToFile( "SYSTEM_LIBVISIO",   "@SYSTEM_LIBVISIO@",  "e" );
1918 ToFile( "LIBVISIO_CFLAGS",   "@LIBVISIO_CFLAGS@",  "e" );
1919 ToFile( "LIBVISIO_LIBS",     "@LIBVISIO_LIBS@",    "e" );
1920 ToFile( "SYSTEM_CPPUNIT",    "@SYSTEM_CPPUNIT@",   "e" );
1921 ToFile( "CPPUNIT_CFLAGS",    "@CPPUNIT_CFLAGS@",   "e" );
1922 ToFile( "CPPUNIT_LIBS",      "@CPPUNIT_LIBS@",     "e" );
1923 ToFile( "SYSTEM_LIBXML",     "@SYSTEM_LIBXML@",    "e" );
1924 ToFile( "USE_FT_EMBOLDEN",   "@USE_FT_EMBOLDEN@",  "e" );
1925 ToFile( "LIBXML_CFLAGS",     "@LIBXML_CFLAGS@",    "e" );
1926 ToFile( "LIBXML_LIBS",       "@LIBXML_LIBS@",      "e" );
1927 ToFile( "SYSTEM_EXPAT",      "@SYSTEM_EXPAT@",     "e" );
1928 ToFile( "WITH_EXTRA_GALLERY",       "@WITH_EXTRA_GALLERY@",      "e" );
1929 ToFile( "WITH_EXTRA_TEMPLATE",       "@WITH_EXTRA_TEMPLATE@",      "e" );
1930 ToFile( "WITH_EXTRA_SAMPLE",       "@WITH_EXTRA_SAMPLE@",      "e" );
1931 ToFile( "WITH_EXTRA_FONT",       "@WITH_EXTRA_FONT@",      "e" );
1932 ToFile( "SYSTEM_TRANSLATE_TOOLKIT", "@SYSTEM_TRANSLATE_TOOLKIT@",        "e" );
1933 ToFile( "SYSTEM_DB",         "@SYSTEM_DB@",        "e" );
1934 ToFile( "SYSTEM_DB_CFLAGS",  "@SYSTEM_DB_CFLAGS@", "e" );
1935 ToFile( "DB_LIB",            "@DB_LIB@",           "e" );
1936 ToFile( "DB_CPPLIB",         "@DB_CPPLIB@",        "e" );
1937 ToFile( "ENABLE_MYSQLC",     "@ENABLE_MYSQLC@",    "e" );
1938 ToFile( "ENABLE_LOMENUBAR",  "@ENABLE_LOMENUBAR@", "e" );
1939 ToFile( "DBUSMENUGTK_CFLAGS",  "@DBUSMENUGTK_CFLAGS@", "e" );
1940 ToFile( "DBUSMENUGTK_LIBS",  "@DBUSMENUGTK_LIBS@", "e" );
1941 ToFile( "ENABLE_ONLINE_UPDATE","@ENABLE_ONLINE_UPDATE@", "e" );
1942 ToFile( "SYSTEM_MYSQL",      "@SYSTEM_MYSQL@",     "e" );
1943 ToFile( "SYSTEM_MYSQL_CPPCONN","@SYSTEM_MYSQL_CPPCONN@","e" );
1944 ToFile( "MYSQL_INC",         "@MYSQL_INC@",        "e" );
1945 ToFile( "MYSQL_LIB",         "@MYSQL_LIB@",        "e" );
1946 ToFile( "MYSQL_DEFINES",     "@MYSQL_DEFINES@",    "e" );
1947 ToFile( "LIBMYSQL_PATH",     "@LIBMYSQL_PATH@",    "e" );
1948 ToFile( "SYSTEM_HSQLDB",     "@SYSTEM_HSQLDB@",    "e" );
1949 ToFile( "HSQLDB_JAR",        "@HSQLDB_JAR@",       "e" );
1950 ToFile( "SYSTEM_LUCENE",     "@SYSTEM_LUCENE@",    "e" );
1951 ToFile( "LUCENE_CORE_JAR",   "@LUCENE_CORE_JAR@",  "e" );
1952 ToFile( "LUCENE_ANALYZERS_JAR",   "@LUCENE_ANALYZERS_JAR@",  "e" );
1953 ToFile( "SYSTEM_BSH",        "@SYSTEM_BSH@",       "e" );
1954 ToFile( "BSH_JAR",           "@BSH_JAR@",          "e" );
1955 ToFile( "SYSTEM_SAXON",      "@SYSTEM_SAXON@",     "e" );
1956 ToFile( "SAXON_JAR",         "@SAXON_JAR@",        "e" );
1957 ToFile( "SYSTEM_ODBC_HEADERS","@SYSTEM_ODBC_HEADERS@","e" );
1958 ToFile( "SYSTEM_LIBXSLT",    "@SYSTEM_LIBXSLT@",   "e" );
1959 ToFile( "LIBXSLT_CFLAGS",    "@LIBXSLT_CFLAGS@",   "e" );
1960 ToFile( "LIBXSLT_LIBS",      "@LIBXSLT_LIBS@",     "e" );
1961 ToFile( "XSLTPROC",          "@XSLTPROC@",         "e" );
1962 ToFile( "SYSTEM_SANE_HEADER","@SYSTEM_SANE_HEADER@","e" );
1963 ToFile( "SYSTEM_XRENDER_HEADERS","@SYSTEM_XRENDER_HEADERS@","e" );
1964 ToFile( "SYSTEM_MESA_HEADERS","@SYSTEM_MESA_HEADERS@","e" );
1965 ToFile( "SYSTEM_CURL",       "@SYSTEM_CURL@",      "e" );
1966 ToFile( "CURL_CFLAGS",       "@CURL_CFLAGS@",      "e" );
1967 ToFile( "CURL_LIBS",         "@CURL_LIBS@",        "e" );
1968 ToFile( "SYSTEM_BOOST",      "@SYSTEM_BOOST@",     "e" );
1969 ToFile( "MDDS_CPPFLAGS",     "@MDDS_CPPFLAGS@",     "e" );
1970 ToFile( "SYSTEM_MDDS",       "@SYSTEM_MDDS@",      "e" );
1971 ToFile( "SYSTEM_VIGRA",      "@SYSTEM_VIGRA@",     "e" );
1972 ToFile( "SYSTEM_NEON",       "@SYSTEM_NEON@",      "e" );
1973 ToFile( "ENABLE_LIBRSVG",    "@ENABLE_LIBRSVG@",   "e" );
1974 ToFile( "SYSTEM_LIBRSVG",    "@SYSTEM_LIBRSVG@",   "e" );
1975 ToFile( "SYSTEM_GDKPIXBUF",  "@SYSTEM_GDKPIXBUF@",   "e" );
1976 ToFile( "SYSTEM_GLIB",       "@SYSTEM_GLIB@",   "e" );
1977 ToFile( "SYSTEM_GETTEXT",    "@SYSTEM_GETTEXT@",   "e" );
1978 ToFile( "SYSTEM_LIBCROCO",   "@SYSTEM_LIBCROCO@",   "e" );
1979 ToFile( "SYSTEM_PANGO",      "@SYSTEM_PANGO@",   "e" );
1980 ToFile( "SYSTEM_LIBGSF",     "@SYSTEM_LIBGSF@",   "e" );
1981 ToFile( "SYSTEM_LIBPNG",     "@SYSTEM_LIBPNG@",   "e" );
1982 ToFile( "SYSTEM_LIBJPEG",    "@SYSTEM_LIBJPEG@",   "e" );
1983 ToFile( "NEON_VERSION",      "@NEON_VERSION@",     "e" );
1984 ToFile( "NEON_LIBS",         "@NEON_LIBS@",        "e" );
1985 ToFile( "NEON_CFLAGS",       "@NEON_CFLAGS@",      "e" );
1986 ToFile( "DISABLE_NEON",      "@DISABLE_NEON@",     "e" );
1987 ToFile( "BUILD_DMAKE",       "@BUILD_DMAKE@",      "e" );
1988 ToFile( "BUILD_STAX",        "@BUILD_STAX@",       "e" );
1989 ToFile( "BUILD_UNOWINREG",   "@BUILD_UNOWINREG@",  "e" );
1990 ToFile( "USE_XINERAMA",      "@USE_XINERAMA@",     "e" );
1991 ToFile( "XINERAMA_LINK",     "@XINERAMA_LINK@",    "e" );
1992 ToFile( "SYSTEM_REDLAND",    "@SYSTEM_REDLAND@",   "e" );
1993 ToFile( "REDLAND_CFLAGS",    "@REDLAND_CFLAGS@",   "e" );
1994 ToFile( "REDLAND_LIBS",      "@REDLAND_LIBS@",     "e" );
1995 ToFile( "SYSTEM_HUNSPELL",   "@SYSTEM_HUNSPELL@",  "e" );
1996 ToFile( "HUNSPELL_CFLAGS",   "@HUNSPELL_CFLAGS@",  "e" );
1997 ToFile( "HUNSPELL_LIBS",     "@HUNSPELL_LIBS@",    "e" );
1998 ToFile( "SYSTEM_LPSOLVE",    "@SYSTEM_LPSOLVE@",   "e" );
1999 ToFile( "HAVE_GETOPT",       "@HAVE_GETOPT@",      "e" );
2000 ToFile( "HAVE_READDIR_R",    "@HAVE_READDIR_R@",   "e" );
2001 ToFile( "SYSTEM_LIBC",       "@SYSTEM_LIBC@",      "e" );
2002 ToFile( "SYSTEM_HYPH",       "@SYSTEM_HYPH@",      "e" );
2003 ToFile( "HYPHEN_LIB",        "@HYPHEN_LIB@",       "e" );
2004 ToFile( "SYSTEM_MYTHES",     "@SYSTEM_MYTHES@",    "e" );
2005 ToFile( "MYTHES_CFLAGS",     "@MYTHES_CFLAGS@",    "e" );
2006 ToFile( "MYTHES_LIBS",       "@MYTHES_LIBS@",      "e" );
2007 ToFile( "SYSTEM_LIBTEXTCAT", "@SYSTEM_LIBTEXTCAT@","e" );
2008 ToFile( "SYSTEM_LIBTEXTCAT_DATA","@SYSTEM_LIBTEXTCAT_DATA@","e" );
2009 ToFile( "XAU_LIBS",          "@XAU_LIBS@",         "e" );
2010 ToFile( "GXX_INCLUDE_PATH",  PathFormat("@GXX_INCLUDE_PATH@"), "e" );
2011 ToFile( "COMMON_BUILD_TOOLS",$COMMON_BUILD_TOOLS,  "e" );
2012 ToFile( "MERGELIBS",         "@MERGELIBS@",           "e" );
2014 if ($platform !~ m/cygwin/) {
2015    if ( !defined $ENV{"TMPDIR"} || $ENV{"TMPDIR"} eq "" ) {
2016       ToFile( "TMPDIR",      "/tmp",               "e" );
2017    } else {
2018       ToFile( "TMPDIR",      "$ENV{'TMPDIR'}",     "e" );
2019    }
2021 ToFile( "SOLARSRC",           $SOLARSRC,           "e" );
2022 ToFile( "gb_REPOS",           $gb_REPOS,           "e" );
2024 if ( $platform =~ m/cygwin/ )
2026    ToFile( "ILIB",              $ILIB,              "e" );
2027    ToFile( "GREP",              $WIN_GREP,          "e" );
2028    ToFile( "FIND",              $WIN_FIND,          "e" );
2029    ToFile( "LS",                $WIN_LS,            "e" );
2030    ToFile( "GNUCOPY",           $WIN_GNUCOPY,       "e" );
2031    ToFile( "TOUCH",             $WIN_TOUCH,         "e" );
2034 ToFile( "DELIVER",       "deliver.pl",     "e" );
2035 ToFile( "MKOUT",         "mkout.pl",       "e" );
2036 ToFile( "ZIPDEP",        "zipdep.pl",      "e" );
2039 # Writing the aliases to file.
2040 ToFile( "Aliases.",          $empty,             "c" );
2041 ToFile( "Don't set aliases when bootstrapping", $empty, "c" );
2043 ToFile( "alias mkout",       $mkout,             "a" );
2044 ToFile( "alias deliver",     $deliver,           "a" );
2045 ToFile( "alias build",       $build,             "a" );
2046 ToFile( "alias zipdep",      $zipdep,            "a" );
2048 # on Solaris, MacOSX and FreeBSD, set GNUCOPY and GNUPATCH
2049 if ($platform =~ m/solaris|darwin|freebsd/)
2051   ToFile( "GNUPATCH",   "@GNUPATCH@",   "e");
2053 ToFile( "GNUCOPY",      "@GNUCP@",      "e");
2054 ToFile( "SAL_ENABLE_FILE_LOCKING",      "1",    "e");
2056 ToFile( "ENV_SCRIPT", "$outfile", "e" );
2058 # Writing unset variables you might not need to file.
2060 print OUT "export $exportvars$newline";
2061 print OUT "unset $unsetvars$newline";
2064 #---------------------------
2065 # VIII. Closing output file.
2066 #---------------------------
2068 close( OUT ) || print "Can't close $SRC_ROOT/$outfile: $!";
2070 #--------------------------------------------------------
2071 # XII. Message at the end.
2072 #--------------------------------------------------------
2075 print "$newline";
2076 print "*********************************************************".
2077       "*******************$newline*$newline";
2078 print "* LibreOffice configuration finished. $newline*$newline";
2080 if ( $Warning ne "" )
2081 {  print "$Warning*$newline";
2084 print "*********************************************************".
2085       "******************* $newline";
2087 print "To build, issue:\n$GNUMAKE\n\n";
2088 print "To install when the build is finished, issue:\n$GNUMAKE install\n\n";
2089 print "If you want to develop LibreOffice, you might prefer:\n$GNUMAKE dev-install\n\n";
2090 print "If you want to run the smoketest, issue:\n$GNUMAKE check\n\n";
2092 $bootfile = "bootstrap";
2093 open( OUT, ">$bootfile" ) ||
2094 die "Cannot open $bootfile: $!\n";
2095 print OUT "#!/bin/sh\n";
2096 if ( $MINGW eq "yes" )
2097 {  print OUT 'PATH="/usr/bin:$PATH" : export PATH'."\n"; }
2098 close( OUT ) || print "Can't close $bootfile: $!";
2099 system(`cat bootstrap.1 >> bootstrap`);
2100 system(`chmod +x bootstrap`);
2102 #--------------------------------------------------------
2103 # Moving the bootstrap file to the build home directory.
2104 #--------------------------------------------------------
2106 $tmp = $SRC_ROOT.$ds.$bootfile;
2107 if (rename( $bootfile, $tmp ) ne 1)
2108 {  `mv -f $bootfile $tmp`;
2111 if ( $Warning ne "" ) {
2112         print "***** WARNINGS ISSUED *****\n";
2116 #-----------------
2117 # XII. Functions.
2118 #-----------------
2120 #-------------------------------------------------------------
2121 # Function name: CheckPathName
2122 # Description:   chops off the '/' character if it's the last
2123 #                character in a pathname. also adds the '/'
2124 #                character if it's not the first character
2125 #                in a path.
2126 # Arguments:     1. Path (string)
2127 # Return value:  Path (string)
2128 #-------------------------------------------------------------
2129 sub CheckPathName
2130 {  my $retrn = $_[ 0 ];
2131    if ($platform =~ m/cygwin/)
2132    {  # Check if the first character is not a '/'.
2133       if ( !( $_[ 0 ] =~ /^\// ) )
2134       {  $retrn = $ds.$_[ 0 ];
2135       }
2136    }
2137    # kill the last '/','\','\n' if they exists.
2138    $retrn =~ s![\s/\\]+$!!;
2139    # Done!
2140    return( $retrn );
2142 #-------------------------------------------------------------
2143 # Function name: CheckPathExist
2144 # Description:   Checks whether the directory that is given
2145 #                as an argument exists. If not abort.
2146 # Arguments:     1. Path (string)
2147 # Return value:  void
2148 #-------------------------------------------------------------
2149 sub CheckPathExist
2150 {  my $dir = $_[ 0 ];
2151    if ( !( -d $dir ) and $^O ne 'MSWin32' )
2152    {  print ( "The directory $_[ 0 ] does not exist. Please create first.\n" );
2153       exit 1;
2154    }
2155    else
2156    {  # Don't check under ActiveState Perl (Windows). The path is possibly
2157       # posix and it cannot handle it.
2158       return "true";
2159    }
2161 #------------------------------------------------------------
2162 # Function name: CreateFileHeader
2163 # Description:   Creates a header for the outfile.
2164 # Arguments:     1. File to write to
2165 #                2. UPD (string)
2166 #                3. Platform (string)
2167 #                4. name of shell for this file
2168 #                5. comment to use for this file
2169 # Return value:  void
2170 #------------------------------------------------------------
2171 sub CreateFileHeader
2172 {  my $timestamp = `date`;
2173    chomp( $timestamp );
2174    my $filehandle = $_[0];
2175    my $comment = $_[4];
2176    print { $filehandle } "$comment #################################################################";
2177    print { $filehandle } $newline;
2178    print { $filehandle } "$comment LibreOffice $_[ 1 ] build environment file for: $_[ 2 ]. $newline";
2179    print { $filehandle } "$comment Generated on: $timestamp $newline";
2180    print { $filehandle } "$comment Source this file to set up the build environment. $newline";
2181    print { $filehandle } "$comment 1. exec $_[3] $newline";
2182    print { $filehandle } "$comment 2. source $outfile $newline";
2183    print { $filehandle } "$comment #################################################################";
2184    print { $filehandle } $newline;
2186 #---------------------------------------------------------
2187 # Function name: ToFile
2188 # Description:   Writes the environment variable in the
2189 #                output file.
2190 # Arguments:     1. Name of environment variable (string)
2191 #                2. Value of environment variable (string)
2192 #                3. e - env. var
2193 #                   a - alias
2194 #                   c - comment
2195 #                   n - newline
2196 #                   z - raw, write as is to OUT
2197 # Return value:  void
2198 #---------------------------------------------------------
2199 sub ToFile {
2200    if ( $_[ 2 ] eq "e" ) {
2201       # Write an environment variable to file.
2202       if (defined $_[ 1 ] && $_[ 1 ] ne "" ) {
2203          my $envvar = $_[ 1 ];
2205          # Tcsh/bash needs backslashes quoted
2206          $envvar =~ s/\\/\\\\/g;
2208          printf("%-12s %-17s %-10s %s\n", "The variable", $_[ 0 ], "is set to:", $envvar) if ( '@VERBOSE@' eq 'TRUE' );
2209          print OUT "$_[ 0 ]=\"$envvar\"$newline";      # to sh file
2210          $exportvars .= " $_[ 0 ]";                        # add to export list for sh file
2212       } else {
2213          printf("%-12s %-17s %-10s %s\n", "The variable", $_[ 0 ], "is set to:", "unset") if ( '@VERBOSE@' eq 'TRUE' );
2214          $unsetvars .= " $_[ 0 ]";                             # for sh file
2215       }
2216    }
2217    elsif ( $_[ 2 ] eq "a" )
2218    {  # Write an alias to file.
2219       print "The $_[ 0 ] is set to: $_[ 1 ]\n" if ( '@VERBOSE@' eq 'TRUE' );    # to stdout
2220       print OUT "$_[ 0 ]=$_[ 1 ]$newline";      # to sh file
2221    }
2222    elsif ( $_[ 2 ] eq "c" )
2223    {  # Write a comment to file.
2224       if ( '@VERBOSE@' eq 'TRUE' )
2225       {
2226          print "$newline";
2227          print "$comment$newline";
2228          print "$comment $_[ 0 ]$newline";
2229          print "$comment$newline";
2230       }
2231       print OUT "$newline";
2232       print OUT "$comment$newline";
2233       print OUT "$comment $_[ 0 ]$newline";
2234       print OUT "$comment$newline";
2235    }
2236    elsif ( $_[ 2 ] eq "n" )
2237    {  #Write a newline to a file
2238       print OUT "$newline";
2239    }
2240    elsif ( $_[ 2 ] eq "z" )
2241    {
2242       #Write first argument as is, and nothing else
2243       print OUT "$_[ 0 ]$newline";
2244    }
2245    else
2246    {  print "Unknown type!$newline";
2247    }
2249 #----------------------------------------------------------
2250 # Function name: PathFormat
2251 # Description:   Reformat path to either POSIX or mixed mode style.
2252 # Arguments:     1. Variable (string)
2253 # Return value:  Reformatted String
2254 #----------------------------------------------------------
2255 sub PathFormat
2256 {  my ( $variable, $d1, $d2 );
2257    $variable = $_[ 0 ];
2259    if ( $platform =~ m/cygwin/ )
2260    {   $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables
2261        $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice!
2263        # Complain if PosixPath is used on a PATH-like string
2264        if ( $variable =~ m/;/ ) {
2265            die( "Do not use on PATH lists (i.e., 'c:\\foo;d:\\bar')");
2266        }
2268        # Replace path with space with short dos path
2269        if ( $variable =~ / / ) {
2270            chomp( $variable = qx{cygpath -d "$variable"} ) ;
2271        }
2273        # Replace absolute paths or DOS paths with ...
2274        if ( ( $variable =~ m/^\// ) or ( $variable =~ m/:/ ) ) {
2275            # mixed mode paths
2276            chomp( $variable = qx{realpath "$variable"} ) unless ($variable =~ m/:/);
2277            chomp( $variable = qx{cygpath -m "$variable"} );
2278        }
2279    }
2280    return $variable;
2282 #----------------------------------------------------------
2283 # Function name: CygFormat
2284 # Description:   Format variables to cygwin posix style path
2285 #                unless .
2286 # Arguments:     1. Variable (string)
2287 # Return value:  Reformatted String
2288 #----------------------------------------------------------
2289 sub CygFormat
2290 {  my ( $variable, $d1, $d2 );
2291    $variable = $_[ 0 ];
2292    # ToDo: Do the replacement only if Windows and var contains "\" and ":"
2293    if ( $platform =~ m/cygwin/ )
2294    {
2295        # Complain if PosixPath is used on a PATH-like string
2296        if ( $variable =~ m/;/ ) {
2297            die( "Do not use on PATH lists (i.e., 'c:\\foo;d:\\bar')");
2298        }
2300        # Replace DOS paths with posix paths
2301        if ( ( $variable =~ m/\\/ ) or ( $variable =~ m/:/ ) ) {
2302            chomp( $variable = qx{cygpath -u "$variable"} );
2303        }
2304    }
2305    return $variable;
2307 #----------------------------------------------------------
2308 # Function name: WinFormat
2309 # Description:   Format variables to Windows Format.
2310 # Arguments:     1. Variable (string)
2311 # Return value:  Reformatted String
2312 #----------------------------------------------------------
2313 sub WinFormat
2314 {  my ( $variable, $d1 );
2315    $variable = $_[ 0 ];
2316    $variable =~ s/^\s+//g ; #remove leading spaces
2317    $variable =~ s/\s+$//g ; #remove trailing spaces
2318    $variable =~ s/(\$\{?\w+\}?)/$1/eeg ;   # expand the variables
2319    $variable =~ s/(\$\{?\w+\}?)/$1/eeg ;   # expand the variables twice!
2320    $variable =~ s/:+/:/g ;                 # remove multiple ;
2322    # Some variables are already in DOS path format, return early.
2323    if ( $variable =~ /\\/ ) {
2324        return $variable;
2325    }
2326    if ( $variable eq ";" ) {
2327        # Ignore single ';'
2328        return $variable;
2329    }
2330    if ( $variable =~ /;/ and $variable =~ /\// ) {
2331        # Mixed mode path-style entry, separated with ;, like CLASSPATH
2332        return $variable;
2333    }
2335    # Search for posix path entry and replace with cygpath -w entry
2336    # ( -d if filename contains space )
2338    # Normal paths
2340    # One special case is if "perl " is prepended.
2341    $variable =~ /^(perl\s+)?(.*)$/;
2342    my $perlpre = $1;
2343    if ( !defined($perlpre) ) {
2344        $perlpre = "";
2345    }
2346    $variable = $2;
2348    if ( $variable =~ /^\/[\w\.~ ]+/ ) {
2349        if ( $variable =~ / / ) {
2350            # Use DOS 8.3 style to avoid quoting
2351            chomp( $variable = qx{cygpath -d "$variable"} );
2352        } else {
2353            # Use "normal" filenames
2354            chomp( $variable = qx{cygpath -w "$variable"} );
2355        }
2356    } else {
2357        # relative or absolute DOS paths here
2358        $variable =~ s#/#\\#g;
2359    }
2361    $variable = $perlpre.$variable;
2362    if ( ($perlpre ne "") && ($^O eq "cygwin")) {
2363        # Cygwin's perl needs quoted backslashes
2364        $variable =~ s#\\#\\\\#g;
2365    }
2367    return $variable;
2370 #----------------------------------------------------------
2371 # Function name: WinPath
2372 # Description:   Reformat a $sep seperated path using DOS paths.
2373 # Arguments:     1. Variable (string)
2374 #                2. Separaror (string)
2375 # Return value:  Reformatted String
2376 #----------------------------------------------------------
2377 sub WinPath
2379     my ( $variable, $d1, $sep, @split_var );
2381     if ( $platform =~ m/cygwin/ ) {
2382         $variable = $_[ 0 ];
2383         $sep = $_[ 1 ];
2384         $variable =~ s/^\s+//g ; #remove leading spaces
2385         $variable =~ s/\s+$//g ; #remove trailing spaces
2386         $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables
2387         $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice!
2389         @split_var = split(/$sep/,$variable);
2390         foreach $d1 ( @split_var ) {
2391             if ( $d1 =~ /(?:^\/[\w\.~ ]+)+/ ) {
2392                 if ( $d1 =~ / / ) {
2393                     # Use DOS 8.3 style to avoid quoting
2394                     chomp( $d1 = qx{cygpath -d "$d1"} );
2395                 } else {
2396                     # Use "normal" filenames
2397                     chomp( $d1 = qx{cygpath -w "$d1"} );
2398                 }
2399             }
2400         }
2401         $variable = join(';',@split_var);
2403         $variable =~ s/\//\\/g; # Remaining \ come from e.g.: ../foo/baa
2404     }
2406     return $variable;
2409 #--------------------------------------------------------
2410 # Function name: GetCorrectPath
2411 # Description:   Creates the build environment.
2412 # Arguments:     1.   existing / original path
2413 #                2... pairs of <path, executable>
2414 # Return value:  String - Correct Path
2415 #--------------------------------------------------------
2416 sub GetCorrectPath
2418         sub PathLookup
2419         {
2420             my $cmd = shift;
2421             while (@_) {
2422                 my $elem = shift;
2424                 -x "$elem/$cmd" && return $elem;
2425             }
2426             return '';
2427         }
2429         sub SaneGrep
2430         {
2431             # Perl grep is unbelievably strange.
2432             my $needle = shift;
2433             while (@_) {
2434                 my $haystack = shift;
2435                 if ($needle eq $haystack) {
2436                     return 1;
2437                 }
2438             }
2439             return 0;
2440         }
2442         sub CleanupPath
2443         {
2444             my @elements = @_;
2445             my @cleanName = ();
2447             while (@elements) {
2448                 my $elem = shift @elements;
2449                 if (!SaneGrep ($elem, @cleanName)) {
2450                         push @cleanName, $elem;
2451                 }
2452             }
2454             return @cleanName;
2455         }
2457         my $oldPath = shift;
2458         my @originalPairs = @_;
2459         my @pairs = @originalPairs;
2460         my @Path = split /$ps/, $oldPath;
2462         while (@pairs) {
2463             my $path = shift @pairs;
2464             my $cmd = shift @pairs;
2465             my $to_append = 1;
2466             my $elem;
2468             if (! -x "$path/$cmd") {
2469                 AddWarning ("Missing executable $path/$cmd\n");
2470             }
2472             for $elem (@Path) {
2473                 if ($elem eq $path) {
2474 #                   print "Hit duplicate path in path; break\n";
2475                     $to_append = 0;
2476                     last;
2477                 }
2478                 if (-f "$elem/$cmd") {
2479 #                   print "Element already in path ...\n";
2480                     unshift @Path, $path;
2481                     $to_append = 0;
2482                     last;
2483                 } else {
2484 #                   print "No file $elem/$cmd\n";
2485                 }
2486             }
2487             if ($to_append) {
2488                 push @Path, $path;
2489             }
2490         }
2492         @pairs = @originalPairs;
2493         while (@pairs) {
2494             my $path = shift @pairs;
2495             my $cmd = shift @pairs;
2496             my $realpath;
2498             $realpath = PathLookup ($cmd, @Path);
2499             if (!($realpath eq $path)) {
2500                 AddWarning ("Path conflict for executables " .
2501                             "$path/$cmd against $realpath");
2502             }
2503         }
2505         return join $ps, CleanupPath (@Path);
2508 #------------------------------------------------------------
2509 # Function name: AddWarning
2510 # Description:   Adds any kind of warning for the user.
2511 #                The warning will be shown at the end
2512 #                of this script.
2513 # Arguments:     1. Add the configure warnings or the set_soenv
2514 #                   warning (string).
2515 #                2. Warning (string).
2516 # Return value:  void
2517 #------------------------------------------------------------
2518 sub AddWarning
2519 {  if ( $_[ 0 ] eq "configure" )
2520    {  open( IN, $warnfile );
2521       while ( <IN> )
2522       {  $Warning = $Warning."* - ".$_;
2523       }
2524       close( IN );
2525       # Remove the temporary warning file.
2526       # unlink ( $warnfile );
2527    }
2528    elsif ( $_[ 0 ] eq "set_soenv" )
2529    {  my ( $arg1 );
2530       $arg1 = $_[ 1 ];
2531       chomp( $arg1 );                            # cut off new line
2532       $Warning = $Warning."* - set_soenv: warning: $arg1 $newline";  # add the warning
2533    }
2536 # vim:set shiftwidth=4 softtabstop=4 expandtab: #