Page Breaks: IsLeaveWindow() is unreliable, we do not need it here.
[LibreOffice.git] / set_soenv.in
blob5347a84d0a39f0ab179cdf98eebc77b79cdd2447
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, $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@";
131 # JAVA_HOME as argument from autoconf.
132 $JAVA_HOME = PathFormat('@JAVA_HOME@') ;
134 if ( $platform =~ m/cygwin/ ) {
135    $JAVA_HOME =~ s/[\s\/]+$//;  # remove trailing \n or \/ if there is any.
138 #--------------------------------------------------------------------
139 # IV. Initialise the warning container and print a note to the user.
140 #--------------------------------------------------------------------
142 # Add the configure (pre-requisite) warnings to the warning container
143 # , $Warning.
144 AddWarning( "configure", "" );
146 print ("Setting up the environment for building LibreOffice $newline");
148 #--------------------------------------------------
149 # V. Setting the environment variables/values.
150 #--------------------------------------------------
152 # A. Checking the platform first.
154 # get perls idea for OS
155 # needed to differentiate cygwin/native perl on windows
156 $perl_os = $^O;
159 # B. Gathering information from the system.
161 # 1. Path
162 $oldPATH = $ENV{"PATH"};
163 chomp( $oldPATH );                  # cut off new line
165 # C. Setting the constant values.
167 # Setting platform independent constant values.
168 # NB: Language options now set at 'ToFile' stage.
169 $CALL_CDECL           = "TRUE";
170 $COMMON_OUTDIR        = "";
171 $common_build         = "";
172 $NO_REC_RES           = "TRUE";
173 $SO3                  = "TRUE";
174 $SOLAR_JAVA           = "@SOLAR_JAVA@";
175 $SOLAR_PLUGIN         = "TRUE";
176 $UPDATER              = "YES";
177 $VCL                  = "TRUE";
178 $ENABLEUNICODE        = "TRUE";
179 $NO_BSYMBOLIC         = "TRUE";
180 $comment              = "#";           # UNIX script comment character
181 $TARFILE_LOCATION = "@TARFILE_LOCATION@"; # where to find tarballs with external sources
183 # Setting platform dependent constant values.
184 if ( $platform =~ m/solaris/ )
185 {     print "Setting Solaris specific values... ";
186    if ($platform =~ m/^i[3456]86/)
187    {
188       if ( $CC =~ "gcc") {
189          $oldoutfile     = "SolarisX86GccEnv.Set.sh";
190          $OUTPATH        = "unxsogi";
191       } else {
192          $oldoutfile     = "SolarisX86Env.Set.sh";
193          $OUTPATH        = "unxsoli4";
194       }
195       $CPU            = "I";
196       $CPUNAME        = "INTEL";
197           $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
198           $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."xawt";
199           $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
201    }
202    else
203    {
204       if ( $CC =~ "gcc") {
205          $oldoutfile     = "SolarisSparcGccEnv.Set.sh";
206          $OUTPATH        = "unxsogs";
207       } else {
208          $oldoutfile     = "SolarisSparcEnv.Set.sh";
209          $OUTPATH        = "unxsols4";
210       }
211       $CPU            = "S";
212       $CPUNAME        = "SPARC";
213           $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc";
214           $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."xawt";
215           $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads";
216    }
218    $COM            = "GCC";
219    $COMPATH        = '@COMPATH@';
220    $GUI            = "UNX";
221    $GUIBASE        = "unx";
222    $GVER           = "VCL";
223    $INPATH         = $OUTPATH.$PROEXT;
224    $OS             = "SOLARIS";
225    $PATH_SEPERATOR = $ps;
227 elsif ( $platform =~ m/netbsd/ )
229 #Set platform specific values:
230    if ($platform =~ m/^i[3456]86/)
231    {  print "Setting NetBSD x86 specific values... ";
232       $CPU            = "I";
233       $CPUNAME        = "INTEL";
234       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
235       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
236       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
237    }
238    elsif ($platform =~ m/^x86_64/)
239    {  print "Setting NetBSD x86-64 specific values... ";
240       $CPU            = "X";
241       $CPUNAME        = "X86_64";
242       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
243       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."client";
244       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
245    }
246    elsif ($platform =~ m/^sparc/)
247    {  print "Setting NetBSD Sparc specific values... ";
248       $CPU            = "S";
249       $CPUNAME        = "SPARC";
250       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc";
251       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."client";
252       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads";
253    }
254    elsif ($platform =~ m/powerpc/)
255    {  print "Setting NetBSD PPC specific values... ";
256       $CPU            = "P";
257       $CPUNAME        = "POWERPC";
258       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
259       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
260       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
261    }
262    else
263    { print "Unsupported NetBSD architecture: $platform \n";
264      exit 1;
265    }
266    # General NetBSD settings:
267       $COM            = "GCC";
268       $COMPATH        = '@COMPATH@';
269       $GUI            = "UNX";
270       $GUIBASE        = "unx";
271       $GVER           = "VCL";
272       $OS             = "NETBSD";
273       $PATH_SEPERATOR = $ps;
274       $OUTPATH        = "unxnbsd";
275       $oldoutfile     = "NetBSDEnv.Set.sh";
276       $INPATH         = $OUTPATH.$PROEXT;
278 elsif ( $platform =~ m/kfreebsd/ )
280 # General GNU/kFreeBSD settings:
281       $COM            = "GCC";
282       $COMPATH        = '@COMPATH@';
283       $GUI            = "UNX";
284       $GUIBASE        = "unx";
285       $GVER           = "VCL";
286       $OS             = "LINUX";
287       $PATH_SEPERATOR = $ps;
289 #Set platform specific values:
290    if ($platform =~ m/^i[3456]86/)
291    {  print "Setting GNU/kFreeBSD x86 specific values... ";
292       $oldoutfile     = "GNUkFreeBSDX86Env.Set.sh";
293       $CPU            = "I";
294       $CPUNAME        = "INTEL";
295       $OUTPATH        = "unxkfgi6";
297       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
298       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
299       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
301    }
302    elsif ($platform =~ m/^x86_64/)
303    {  print "Setting GNU/kFreeBSD x86-64 specific values... ";
304       $oldoutfile     = "GNUkFreeBSDX86-64Env.Set.sh";
305       $CPU            = "X";
306       $CPUNAME        = "X86_64";
307       $OUTPATH        = "unxkfgx6";
309       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
310       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
311       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
312    }
314    $INPATH         = $OUTPATH.$PROEXT;
316 elsif ( $platform =~ m/freebsd/ )
317 {     $COM            = "GCC";
318       $COMPATH        = '@COMPATH@';
319       $GUI            = "UNX";
320       $GUIBASE        = "unx";
321       $GVER           = "VCL";
322       $OS             = "FREEBSD";
323       $PATH_SEPERATOR = $ps;
324       $OSVERSION      = '@OSVERSION@';
325       $OUTPATH        = 'unxfbsd';
326       $oldoutfile     = 'FreeBSDEnv.Set.sh';
327    if ($platform =~ m/^(amd64|x86_64)/)
328    {  my ( $JAVA_OS );
329       print "Setting FreeBSD AMD64 specific values... ";
330       $CPU            = "X";
331       $CPUNAME        = "X86_64";
332       $JAVA_OS        = '@JAVA_HOME@';
333       $JAVA_OS        =~ s/.*\///;
334       if ($JAVA_OS =~ m/^linux/)
335       {  $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
336          $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
337          $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
338       }
339       else
340       {  $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
341          $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
342          $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
343       }
344    }
345    elsif ($platform =~ m/^i386/)
346    {  print "Setting FreeBSD x86 specific values... ";
347       $CPU            = "I";
348       $CPUNAME        = "INTEL";
349       $OUTPATH        = "unxfbsdi";
350       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
351       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
352       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
353    }
354    else
355    {  print "Unsupported FreeBSD architecture: $platform \n";
356          exit 1;
357    }
358       $INPATH         = $OUTPATH.$PROEXT;
360 elsif ( $platform =~ m/openbsd/ )
361 {     $COM            = "GCC";
362       $COMPATH        = '@COMPATH@';
363       $GUI            = "UNX";
364       $GUIBASE        = "unx";
365       $GVER           = "VCL";
366       $OS             = "OPENBSD";
367       $PATH_SEPERATOR = $ps;
368       $OSVERSION      = '@OSVERSION@';
369       $OUTPATH        = "unxobsd";
370       $oldoutfile     = "OpenBSDEnv.Set.sh";
371    if ($platform =~ m/^(amd64|x86_64)/)
372    {
373       print "Setting OpenBSD AMD64 specific values... ";
374       $CPU            = "X";
375       $CPUNAME        = "X86_64";
376       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
377       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
378       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
379    }
380    elsif ($platform =~ m/^i386/)
381    {  print "Setting OpenBSD x86 specific values... ";
382       $CPU            = "I";
383       $CPUNAME        = "INTEL";
384       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
385       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
386       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
387    }
388    else
389    {  print "Unsupported OpenBSD architecture: $platform \n";
390          exit 1;
391    }
392       $INPATH         = $OUTPATH.$PROEXT;
394 elsif ( $platform =~ m/linux/ )
396 # General Linux settings:
397       $COM            = "GCC";
398       $COMPATH        = '@COMPATH@';
399       $GUI            = "UNX";
400       $GUIBASE        = "unx";
401       $GVER           = "VCL";
402       $OS             = "LINUX";
403       $PATH_SEPERATOR = $ps;
405 #Set platform specific values:
406    if ($platform =~ m/^i[3456]86/)
407    {  print "Setting Linux x86 specific values... ";
408       $oldoutfile     = "LinuxX86Env.Set.sh";
409       $CPU            = "I";
410       $CPUNAME        = "INTEL";
412       if ($JDK =~ m/^[Ii][Bb][Mm]/)
413       { $JRELIBDIR     = $JAVA_HOME.$ds."jre".$ds."bin";
414         $JRETOOLKITDIR = $JAVA_HOME.$ds."jre".$ds."bin".$ds."classic";
415         $JRETHREADDIR  = $JAVA_HOME.$ds."jre".$ds."bin"; }
417       elsif ($JDK =~ m/^[Bb][Ee][Aa]/)
418       { $JRELIBDIR     = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
419         $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."jrockit";
420         $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads"; }
422       else {
423       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
424       # has both server and client
425       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
426       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
427       }
429       $OUTPATH     = "unxlngi6";
430    }
431    elsif ($platform =~ m/^x86_64/)
432    {  print "Setting Linux x86-64 specific values... ";
433       $oldoutfile     = "LinuxX86-64Env.Set.sh";
434       $CPU            = "X";
435       $CPUNAME        = "X86_64";
436       $OUTPATH        = "unxlngx6";
437       # Blackdown.org JDK porting project uses `amd64' and `server' in JDK 1.4.2 RC1
438       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
439       # has both server and client
440       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
441       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
442    }
443    elsif ($platform =~ m/^ia64/)
444    {  print "Setting Linux ia64 specific values... ";
445       $oldoutfile     = "LinuxIA64Env.Set.sh";
446       $CPU            = "A";
447       $CPUNAME        = "IA64";
448       $OUTPATH        = "unxlnga";
449       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ia64";
450       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ia64".$ds."server";
451       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ia64".$ds."native_threads";
452    }
453    elsif ($platform =~ m/^sparc/)
455    {  print "Setting Linux Sparc specific values... ";
456       $oldoutfile     = "LinuxSparcEnv.Set.sh";
457       $CPU            = "S";
458       $CPUNAME        = "SPARC";
459       $OUTPATH        = "unxlngs";
460       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc";
461       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."server";
462       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."sparc".$ds."native_threads";
463    }
464    elsif ($platform =~ m/^powerpc/)
465    {
466       if (($platform =~ m/^powerpc64/) && ('@SIZEOF_LONG@' eq '8')) {
467          print "Setting Linux PPC64 specific values... ";
468          $oldoutfile = "LinuxPPC64Env.Set.sh";
469          $OUTPATH = "unxlngppc64";
470          $CPUNAME = "POWERPC64";
472          if ( $JDK eq "gcj" ) {
473             $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64";
474             $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64".$ds."client";
475             $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads";
476          }
477          # OpenJDK
478          elsif ($JDK =~ m/sun/) {
479             $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64";
480             $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64".$ds."server";
481             $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc64".$ds."native_threads";
482          }
483       }
484       else {
485          print "Setting Linux PPC specific values... ";
486          $oldoutfile = "LinuxPPCEnv.Set.sh";
487          $OUTPATH = "unxlngppc";
488          $CPUNAME = "POWERPC";
490          if ( $JDK eq "gcj" ) {
491             $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
492             $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."client";
493             $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads"; }
494          elsif ($JDK =~ m/^[Ii][Bb][Mm]/)
495          {  $JRELIBDIR     = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
496             $JRETOOLKITDIR = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
497             $JRETHREADDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
498          }
499          # OpenJDK
500          elsif ($JDK =~ m/sun/) {
501             $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
502             $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."server";
503             $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
504          }
505       }
507       $CPU            = "P";
509    }
510    elsif ($platform =~ m/^s390/)
511    {
512       if (($platform =~ m/^s390x/) && ('@SIZEOF_LONG@' eq '8')) {
513          print "Setting Linux zSeries specific values... ";
514          $oldoutfile     = "LinuxS390XEnv.Set.sh";
515          $CPUNAME        = "S390X";
516          $ARCH           = "s390x";
517          $OUTPATH        = "unxlngs390x";
518       }
519       else {
520          print "Setting Linux S/390 specific values... ";
521          $oldoutfile     = "LinuxS390Env.Set.sh";
522          $CPUNAME        = "S390";
523          $ARCH           = "s390";
524          $OUTPATH        = "unxlngs390";
525       }
526       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH;
527       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."server";
528       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."native_threads";
529       $CPU            = "3";
530    }
531    elsif ($platform =~ m/^m68k/)
532    {  print "Setting Linux m68k specific values... ";
533       $oldoutfile     = "LinuxM68KEnv.Set.sh";
534       $CPU            = "6";
535       $CPUNAME        = "M68K";
536       $OUTPATH        = "unxlngm68k";
537       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."m68k";
538       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."m68k".$ds."server";
539       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."m68k".$ds."native_threads";
540    }
541    elsif ($platform =~ m/^hppa/)
542    {  print "Setting Linux hppa specific values... ";
543       $oldoutfile     = "LinuxHPPAEnv.Set.sh";
544       $CPU            = "H";
545       $CPUNAME        = "HPPA";
546       $OUTPATH        = "unxlnghppa";
547       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."hppa";
548       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."hppa".$ds."server";
549       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."hppa".$ds."native_threads";
550       $EPM_FLAGS      = "-a hppa";
551    }
552    elsif ($platform =~ m/^alpha/)
553    {  print "Setting Linux Alpha specific values... ";
554       $oldoutfile     = "LinuxAlphaEnv.Set.sh";
555       $CPU            = "L";
556       $CPUNAME        = "AXP";
557       $OUTPATH        = "unxlngaxp";
558       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."alpha";
559       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."alpha".$ds."server";
560       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."alpha".$ds."native_threads";
561    }
562    elsif ($platform =~ m/^arm.*?l-/)
563    {  print "Setting Linux ARM specific values... ";
564       $oldoutfile     = "LinuxARMEnv.Set.sh";
565       $CPU            = "R";
566       $CPUNAME        = "ARM";
567       $OUTPATH        = "unxlngr";
568       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm";
569       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm".$ds."server";
570       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads";
571       $EPM_FLAGS      = "-a arm";
572    }
573    elsif ($platform =~ m/^arm.*-androideabi/)
574    {  print "Setting Android ARM specific values... ";
575       $GUIBASE        = "android";
576       $OS             = "ANDROID";
577       $oldoutfile     = "AndroidARMEnv.Set.sh";
578       $CPU            = "R";
579       $CPUNAME        = "ARM";
580       $OUTPATH        = "unxandr";
581       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm";
582       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm".$ds."server";
583       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."arm".$ds."native_threads";
584       $EPM_FLAGS      = "-a arm";
585    }
586    elsif ($platform =~ m/^mips/)
587    {  print "Setting Linux MIPS specific values... ";
588       $oldoutfile     = "LinuxMIPSEnv.Set.sh";
589       $CPU            = "M";
590       $CPUNAME        = "GODSON";
591       $OUTPATH        = "unxlngmips";
593       if ('@SIZEOF_LONG@' eq '8') {
594         if ('@WORDS_BIGENDIAN@' ne 'yes') {
595           $EPM_FLAGS = "-a mips64el";
596           if ( $JDK eq "gcj" ) {
597             $ARCH = "mips64el";
598           }
599         }
600         else {
601           $ARCH = "mips64";
602         }
603       }
604       else {
605         if ('@WORDS_BIGENDIAN@' ne 'yes') {
606           $EPM_FLAGS = "-a mipsel";
607           if ( $JDK =~ m/sun/ && -d "@JAVA_HOME@".$ds."jre".$ds."lib".$ds."mips32" ) {
608            $ARCH = "mips32"; # Lemote
609           } else {
610            $ARCH = "mipsel";
611           }
612         }
613         else {
614           $ARCH = "mips";
615         }
616       }
618       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH;
619       if ( $JDK =~ m/sun/ && -d "@JAVA_HOME@".$ds."jre".$ds."lib".$ds."mips32" ) {
620         $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."client"; # Lemote
621       } else {
622         $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."server";
623       }
624       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds.$ARCH.$ds."native_threads";
625    }
628    $INPATH         = $OUTPATH.$PROEXT;
630 elsif ( $platform =~ m/cygwin|mingw32/ )
632       $MSPDB_PATH     = PathFormat('@MSPDB_PATH@');
633       $MIDL_PATH      = PathFormat('@MIDL_PATH@');
634       $CSC_PATH       = PathFormat('@CSC_PATH@');
635       $SHOWINCLUDES_PREFIX = '@SHOWINCLUDES_PREFIX@';
636       $WINDOWS_SDK_HOME      = PathFormat('@WINDOWS_SDK_HOME@');
637       $DIRECTXSDK_LIB = PathFormat('@DIRECTXSDK_LIB@');
638       $USE_DIRECTX5   = "";
639       $DOTNET_FRAMEWORK_HOME = PathFormat('@DOTNET_FRAMEWORK_HOME@');
640       $CPUNAME        = "INTEL";
641       $CPUNAME        = "X86_64" if $CL_X64;
642       $CPU            = "I";
643       $CPU            = "X" if $CL_X64;
644       $GUI            = "WNT";
645       $GUIBASE        = "WIN";
646       $GVER           = "NT351";
647       $OS             = "WNT";
648       $DYNAMIC_CRT    = "TRUE";
649       $use_shl_versions = "TRUE";
650       $wps = ';' if '@build_os@' eq 'cygwin'; # Windows style path seperator
651   if ( $MINGW eq "yes" )
652   {   print "Setting Windows (MinGW cross-compilation) specific values... ";
654       die 'For building natively on Windows we support only MSVC' if ('@build_os@' eq 'cygwin');
656       $PATH_SEPERATOR = ':';
657       $oldoutfile     = "WindowsMinGWEnv.Set.sh";
658       $COMPATH        = PathFormat('@COMPATH@/bin');
659       $COMPATH        =~ s/\/bin$//i;
660       $COM            = "GCC";
661       $OUTPATH        = "wntgcci";
662       $OUTPATH        = "wntgccx" if $platform =~ m/^x86_64/;
663       $INPATH         = $OUTPATH.$PROEXT;
664   }
665   else # The MSVC section starts here
666   {   print "Setting Windows (MSVC) specific values... ";
667       $oldoutfile     = "WindowsMSVCEnv.Set.sh";
668       $COMPATH        = PathFormat('@COMPATH@');
669       $COM            = "MSC";
670       $OUTPATH        = "wntmsci@COMEX@";
671       $OUTPATH        = "wntmscx@COMEX@" if $CL_X64;
672       $INPATH         = $OUTPATH.$PROEXT;
673       $COMEX          = '@COMEX@';
674       if ( "@DISABLE_ACTIVEX@" ) {
675           $ATL_LIB     = $WINDOWS_SDK_HOME.$ds."lib"; # Doesn't exist for VSE
676           $ATL_INCLUDE = $WINDOWS_SDK_HOME.$ds."include".$ds."atl";
677           $MFC_LIB     = $WINDOWS_SDK_HOME.$ds."lib"; # Doesn't exist for VSE
678           $MFC_INCLUDE = $WINDOWS_SDK_HOME.$ds."include".$ds."mfc";
679       } else {
680           $ATL_LIB     = $COMPATH.$ds."atlmfc".$ds."lib";
681           $ATL_INCLUDE = $COMPATH.$ds."atlmfc".$ds."include";
682           $MFC_LIB     = $COMPATH.$ds."atlmfc".$ds."lib";
683           $MFC_INCLUDE = $WINDOWS_SDK_HOME.$ds."include".$ds."mfc";
684       }
685       if ($CL_X64) {
686           $ATL_LIB     .= $ds."amd64";
687           $MFC_LIB     .= $ds."amd64";
688       }
689       $PATH_SEPERATOR = ';';
690   }
692 elsif ( $platform =~ m/darwin/ )
694     $COM            = "GCC";
695     $COMPATH        = '@COMPATH@';
696     if ($platform =~ m/^arm/)
697     {
698         print "Setting values for iOS... ";
699         $oldoutfile     = "iOSEnv.Set.sh";
700         $CPU            = "R";
701         $CPUNAME        = "ARM";
702         $OUTPATH        = "unxiosr";
703         $GUI            = "UNX";
704         $OS             = "IOS";
705         $GUIBASE        = "cocoatouch";
706     }
707     elsif ($platform =~ m/^powerpc/)
708     {
709         print "Setting values for Mac OS X/Darwin on PowerPC... ";
710         $oldoutfile     = "MacOSXPPCEnv.Set.sh";
711         $CPU            = "P";
712         $CPUNAME        = "POWERPC";
713         $OUTPATH        = "unxmacxp";
714         $OS             = "MACOSX";
715         $GUI            = "UNX";
716         $GUIBASE        = "aqua";
717         $MACOSX_SDK_PATH='@MACOSX_SDK_PATH@';
718         $FRAMEWORKSHOME = $MACOSX_SDK_PATH."/System/Library/Frameworks";
719     }
720     else
721     {
722         print "Setting values for Mac OS X/Darwin on default x86... ";
723         $oldoutfile     = "MacOSXX86Env.Set.sh";
724         $CPU            = "I";
725         $CPUNAME        = "INTEL";
726         $OUTPATH        = "unxmacxi";
727         $OS             = "MACOSX";
728         $GUI            = "UNX";
729         $GUIBASE        = "aqua";
730         $MACOSX_SDK_PATH='@MACOSX_SDK_PATH@';
731         $FRAMEWORKSHOME = $MACOSX_SDK_PATH."/System/Library/Frameworks";
732     }
733     $GVER           = "VCL";
734     $INPATH         = $OUTPATH.$PROEXT;
735     $PATH_SEPERATOR = $ps;
737 elsif ( $platform =~ m/dragonfly/ )
739    if ($platform =~ m/^i386/)
740    {  print "Setting DragonFly i386 specific values... ";
741       $CPU            = "I";
742       $CPUNAME        = "INTEL";
743       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386";
744       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."client";
745       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."i386".$ds."native_threads";
746    }
747    elsif ($platform =~ m/^x86_64/)
748    {  print "Setting DragonFly x86-64 specific values... ";
749       $CPU            = "X";
750       $CPUNAME        = "X86_64";
751       $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64";
752       $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."server";
753       $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."amd64".$ds."native_threads";
754    }
755    else
756    { print "Unsupported DragonFly architecture: $platform \n";
757      exit 1;
758    }
759    # General DragonFly settings:
760       $COM            = "GCC";
761       $COMPATH        = '@COMPATH@';
762       $GUI            = "UNX";
763       $GUIBASE        = "unx";
764       $GVER           = "VCL";
765       $OS             = "DRAGONFLY";
766       $PATH_SEPERATOR = $ps;
767       $OUTPATH        = "unxdfly";
768       $oldoutfile     = "DragonFlyEnv.Set.sh";
769       $INPATH         = $OUTPATH.$PROEXT;
771 elsif ( $platform =~ m/aix/ )
773    print "Setting AIX PPC specific values... ";
774    $oldoutfile     = "aixPPCEnv.Set.sh";
775    $CPU            = "P";
776    $CPUNAME        = "POWERPC";
777    $OUTPATH        = "unxaigppc";
778    $JRELIBDIR      = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc";
779    $JRETOOLKITDIR  = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."classic";
780    $JRETHREADDIR   = $JAVA_HOME.$ds."jre".$ds."lib".$ds."ppc".$ds."native_threads";
781    $COM            = "GCC";
782    $COMPATH        = '@COMPATH@';
783    $GUI            = "UNX";
784    $GUIBASE        = "unx";
785    $GVER           = "VCL";
786    $INPATH         = $OUTPATH.$PROEXT;
787    $OS             = "AIX";
788    $PATH_SEPERATOR = $ps;
790 else {
791         print "\nset_soenv:  Cannot recognize the platform you are building for: $platform.\n";
792         exit 1;
794 print "done\n";
797 # D. Gathering directory information from the user.
799 # If the directory does not exist something is strange.
800 # 1. LibreOffice build home directory.
801 chomp($SRC_ROOT  = `pwd`);
802 $SRC_ROOT = PathFormat($SRC_ROOT);
803 CheckPathExist( $SRC_ROOT );
806 # 3. bash path.
807 $OOO_SHELL = '@BASH@';
809 # ml.exe assembler path for Windows users.
810 if ($platform =~ m/cygwin/)
811 {  $ASM_PATH = PathFormat('@ASM_HOME@');
814 # Check for prebuild mozab libraries if we don't build them # ourselves
815 # and we're also not using the external system mozilla installation.
817 # FIXME! This check should be done in configure and not here, but
818 # the $OS, $COM, $CPU variables are not yet present there.
820 if ( "@WITH_MOZILLA@" eq "YES" and "@BUILD_MOZAB@" ne "TRUE" and "@SYSTEM_MOZILLA@" ne "YES" )
822    print("Checking for prebuilt Mozilla libraries ...");
823    my $mozbinfile = $SRC_ROOT."/moz/zipped/";
824    if ( $^O eq 'MSWin32' ) {
825        chomp( $mozbinfile = qx{cygpath -d "$mozbinfile"} );
826    }
827    $mozbinfile .= $OS.$COM.$CPU;
828    if ( -e $mozbinfile."inc.zip"
829         and -e $mozbinfile."lib.zip"
830         and -e $mozbinfile."runtime.zip" )
831    {   print " found.\n";
832        $PREBUILD_MOZAB = "YES";
833    }
834    else
835    {   print " not found!\n\n";
836        print "If you don\'t use the system mozilla and also not build the needed\n";
837        print "mozilla libraries yourself you have to provide the needed files\n";
838        print "$OS$COM$CPU\{inc,lib,runtime\}.zip in moz/zipped/ .\n";
839        print "These files can be found here:\n";
840        print "  <http://dev-www.libreoffice.org/mozilla/>.\n\n";
841        die;
842    }
843    if ( $OS eq 'WNT' ) {
844        my $ext_msvc = $SRC_ROOT."/external/msvcp80";
845        chomp( $ext_msvc = qx{cygpath -d "$ext_msvc"} );
846        print("Checking for MSVC 2005 runtime needed for the prebuilt Mozilla ...");
847        if ( -e $ext_msvc."/Microsoft.VC80.CRT.manifest" and
848                -e $ext_msvc."/msvcp80.dll" and
849                -e $ext_msvc."/msvcr80.dll" ) 
850        {
851            print " found.\n";
852        }
853        else
854        {   print " not found!\n\n";
855            print "For the pre-built Mozilla libraries, you need MSVC 2005 runtime\n";
856            print "files Microsoft.VC80.CRT.manifest, msvcp80.dll, and msvcr80.dll\n";
857            print "in external/msvcp80.\n\n";
858            print "You can get them by installing:\n";
859            print "  <http://download.microsoft.com/download/8/B/4/8B42259F-5D70-43F4-AC2E-4B208FD8D66A/vcredist_x86.EXE>.\n";
860            print "and copying the abovementioned files from:\n";
861            print "  c:/windows/winsxs/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989/\n";
862            print "and\n";
863            print "  c:/windows/winsxs/manifests/x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.4053_x-ww_e6967989.manifest\n\n";
864            die;
865        }
866     }
868 else
870    $PREBUILD_MOZAB = "";
874 # E. Determining the envionment values based on the information
875 #    that was gathered earlier on.
877 $USR                  = $ds."usr";
878 $ETC                  = $ds."etc";
879 $BIN                  = $ds."bin";
880 $LIB                  = $ds."lib";
881 $LIB64                = $ds."lib";
882 $LIB64               .= "64" if ($platform =~ m/x86_64-.*-linux/);
883 $LIB64               .= "64" if (($platform =~ m/powerpc64-.*-linux/) && ('@SIZEOF_LONG@' eq '8'));
884 $LIB64               .= "64" if (($platform =~ m/s390x-.*-linux/) && ('@SIZEOF_LONG@' eq '8'));
885 $LIB64               .= $ds."x64" if ($platform =~ m/cygwin/);
886 $INC                  = $ds."inc";
887 $INCLUDE              = $ds."include";
888 $DEV                  = $ds."dev";
889 $OPT                  = $ds."opt";
890 $LOCAL                = $ds."local";
891 $SOLENV               = $ds."solenv";
892 $SOLVER               = $ds."solver";
893 $DEFIMGS              = $ds."default_images";
894 $CONFIG               = $ds."config";
895 $USR_BIN              = $USR.$BIN;
896 $USR_LIB              = $USR.$LIB64;
897 $USR_LOCAL            = $USR.$ds."local";
898 $USR_CCS              = $USR.$ds."ccs";
899 $USR_OPENWIN          = $USR.$ds."openwin";
900 $USR_DT               = $USR.$ds."dt";
901 $COMMON_BUILD_TOOLS   = '$SRC_ROOT'.$ds."external".$ds."common";
903 # Windows NT only variables
904 if ($platform =~ m/cygwin/)
906    if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
907    {
908       $JAVA_LIB             = $JAVA_HOME.$LIB;
909    }
910    # Import SystemDrive enviroment variable
911    use Env qw(SYSTEMDRIVE);
912    # Change $SYSTEMDRIVE to lower case.
913    $SYSTEMDRIVE          = lc $SYSTEMDRIVE;
914    use Env qw(SYSTEMROOT);
915    $CYGWIN_PATH          = PathFormat('/usr/bin'); # Windows bash path
916    $WIN_GREP             = '$CYGWIN_PATH'.$ds."grep.exe";
917    $WIN_FIND             = '$CYGWIN_PATH'.$ds."find.exe";
918    $WIN_LS               = '$CYGWIN_PATH'.$ds."ls.exe";
919    $WIN_GNUCOPY          = '$CYGWIN_PATH'.$ds."cp.exe";
920    $WIN_TOUCH            = '$CYGWIN_PATH'.$ds."touch.exe";
923 if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
925    $JAVA_BIN             = $JAVA_HOME.$BIN;
926    $JAVA_INCLUDE         = $JAVA_HOME.$INCLUDE;
930 $PERL                 = PathFormat('@PERL@'); # Perl program
931 $PERL_PATH            = dirname('@PERL@'); # Perl Path
932 $XLIB                 = PathFormat('@XLIB@'); # X11 libraries
933 $XINC                 = PathFormat('@XINC@'); # X11 includes
935 # The project's workstamp.
936 $WORK_STAMP            = "@SOURCEVERSION@";
937 # Location of the source.
938 $SOLARSRC             = '$SRC_ROOT';
940 # default TARFILE_LOCATION
941 if ('@TARFILE_LOCATION@' eq "DEFAULT")
942 {       $TARFILE_LOCATION="$SRC_ROOT/src";
946 $DEVROOT              = '$SRC_ROOT';
947 $SOLARENV             = PathFormat($SRC_ROOT.$SOLENV);
948 # Location of the solver tree.
949 if ('@LOCAL_SOLVER@' eq "DEFAULT")
950 {  $SOLARVER          = $SRC_ROOT.$SOLVER;
952 else
953 {  $SOLARVER          = PathFormat('@LOCAL_SOLVER@');
955 #Location of Solar version.
956 $SOLARVERSION         = '$SOLARVER';
958 #Location of gnu make directories.
959 $WORKDIR              = '$SRC_ROOT/workdir/$INPATH';
960 $OUTDIR              = '$SOLARVER/$INPATH';
961 #Some directories that are symlinks under rawbuild, have to use realpath on Cygwin
962 $SOLARDEFIMG          = PathFormat($SRC_ROOT.$DEFIMGS);
965 $SOLARENVINC          = '$SOLARENV'.$INC;
966 # Location of dmake resource.
967 $DMAKEROOT            = '$SOLARENVINC'.$ds."startup";
968 # Location of JDK classes .zip file.
969 # but in jdk 1.2 it is called rt.jar and it lives in jre/lib
970 $CLASSPATH            = '';
971 $CLASSPATH           .= $JAVA_HOME.$ds.'jre'.$LIB.$ds."rt.jar" if (-f $JAVA_HOME.$ds.'jre'.$LIB.$ds."rt.jar");
972 $CLASSPATH           .= $wps.'.' if ($CLASSPATH ne '');
974 # Why do we need XCLASSPATH when it has the exact same value as CLASSPATH?
975 $XCLASSPATH           = $CLASSPATH;
977 # Location of the translations module
978 $L10N_MODULE = PathFormat($SRC_ROOT."/translations");
980 # Check for poor help localizations, i.e. no help translation at all...
981 @languages=();
982 if (opendir(DIR,$L10N_MODULE . "/source"))
984     @languages = readdir(DIR);
985     closedir(DIR);
987 $WITH_POOR_HELP_LOCALIZATIONS = "";
989 foreach $language (@languages)
991     if ( ($language ne ".") && ($language ne "..") && (! -d $L10N_MODULE . "/source/" . $language . "/helpcontent2") )
992     {
993         $WITH_POOR_HELP_LOCALIZATIONS = $WITH_POOR_HELP_LOCALIZATIONS . " " . $language;
994     }
997 # Location used by the linker to create libraries.
998 if ($platform =~ m/solaris/)
999 {  $SOLAREXTRALIB     = $L.$par_dir.$LIB.
1000                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$ds."lib.solaris.2.6".
1001                         $L.$LIB.
1002                         $L.$USR.$LIB.
1003                         $L.$USR.$LOCAL.$LIB.
1004                         $L.$USR_DT.$LIB.
1005                         $L.$USR_OPENWIN.$LIB;
1007 elsif ($platform =~ m/linux|netbsd|freebsd|aix|openbsd|dragonfly/)
1009    $SOLAREXTRALIB     = $L.$par_dir.$LIB64;
1011 elsif ($platform =~ m/darwin/ && $platform !~ m/^arm/)
1013   # Nothing should be needed
1015 elsif ($platform !~ m/cygwin/ && $platform !~ m/mingw32/ && $platform !~ m/^arm-apple/)
1016 {  AddWarning( "set_soenv", "$platform not configured for linkage create libraries" );
1019 # Windows NT only variables
1020 if ($platform =~ m/cygwin/)
1021 {  $COMP_ENV          = $OUTPATH;
1023    $JAVAHOME          = $JAVA_HOME;
1025    $ILIB             = $cur_dir;
1027    $ILIB       .=    $wps.$SOLARVER.$ds.$INPATH.$LIB;
1028    if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" ) {
1029        $ILIB   .= $wps.$JAVA_HOME.$LIB;
1030    }
1031    if ( $CL_X64 ne "TRUE" ) {
1032        $ILIB   .= $wps.$COMPATH.$LIB.
1033                   $wps.$WINDOWS_SDK_HOME.$LIB;
1034    } else {
1035        $ILIB   .= $wps.$COMPATH.$LIB.$ds."amd64".
1036                   $wps.$WINDOWS_SDK_HOME.$LIB64;
1037    }
1038    $ILIB       .= $wps.$DOTNET_FRAMEWORK_HOME.$LIB;
1039    if ( '@ENABLE_DIRECTX@' ne "" ) {
1040        $ILIB   .= $wps.$DIRECTXSDK_LIB;
1041    }
1042    # ILIB needs to use '\' directory seperators;
1043    $ILIB = WinPath( $ILIB, ";" );
1045    $JAVAHOME          = $JAVA_HOME;
1049 # The general environment path.
1050 if ($platform =~ m/linux|netbsd|freebsd|aix|solaris|openbsd|dragonfly/)
1051 {  $PATH              = $cur_dir.
1052 #                        $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN.
1053                         $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN.
1054                         $ps.'$SOLARENV'.$BIN;
1056    if ($platform =~ m/solaris/) {
1057         $PATH .= $ps.$USR_CCS.$BIN;
1058    }
1060    $PATH             .= $ps.$oldPATH;
1062    my @javaBits;
1063    if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME"  &&  $JDK ne "gcj" ) {
1064       @javaBits = ( $JAVA_HOME.$BIN, 'javac' );
1065    } else {
1066       @javaBits = ();
1067    }
1068    $PATH              = GetCorrectPath ($PATH,
1069                                         $COMPATH, $CC,
1070                                         $PERL_PATH, 'perl',
1071                                         @javaBits);
1074 elsif ($platform =~ m/cygwin/)
1075 {  # The PATH variable is completely created from scratch. Elements
1076    # from oldPATH that are not yet included are appended to PATH at
1077    # the end.
1079    my ( $tmppath );
1081    $PATH              = $cur_dir.
1082 #                        $ps.CygFormat($SOLARVER).$ds.$INPATH.$BIN.
1083                         $ps.CygFormat($SOLARENV).$ds."bin".
1084                         $ps.CygFormat($SOLARENV).$ds.$OUTPATH.$BIN;
1086    if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
1087    {
1088       # hack either "hotspot" or "client" should be used, depending on the jdk version:
1089       # 1.2.x   -   no such directory, unsupported
1090       # 1.3.x   -   hotspot, client missing
1091       # 1.4.x   -   client, hotspot missing
1093       $PATH .= $ps.CygFormat($JAVA_HOME).$BIN;
1094           if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot" ) {
1095                   $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."hotspot";
1096           }
1097           if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."client" ) {
1098                   $PATH .= $ps.CygFormat($JAVA_HOME).$ds."jre".$ds."bin".$ds."client";
1099           }
1100    }
1102    # Add path to compiler
1103    $tmppath = CygFormat($COMPATH).$BIN;
1104    $tmppath .= $ds."amd64" if $CL_X64;
1105    $tmppath =~ s/^\/\//\//;
1106    if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1107        $PATH .= $ps.$tmppath;
1108    }
1110     $tmppath = CygFormat($MSPDB_PATH);
1111     # for MSVC to find mspdb*.dll
1112     if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1113         $PATH .= $ps.$tmppath;
1114     }
1115     # need midl.exe
1116     $tmppath = CygFormat($MIDL_PATH);
1117     if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1118         $PATH .= $ps.$tmppath;
1119     }
1120     # needs csc.exe
1121     $tmppath = CygFormat($CSC_PATH);
1122     if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1123         $PATH .= $ps.$tmppath;
1124     }
1125     # Installer needs some files if the Windows Installer SDK
1126     $tmppath = CygFormat($WINDOWS_SDK_HOME);
1127     if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) {
1128         $PATH .= $ps.$tmppath.$BIN;
1129     }
1131    if ( $ASM_PATH ne "ASM_IN_PATH" )
1132    {   $PATH          .= $ps.CygFormat($ASM_PATH);
1133    }
1135    # Possible cygwin paths must follow behind the OOo and MS paths.
1136    # What the above comment means I have no idea.
1138    # Check if $PERL_PATH is already set in PATH
1139    $tmppath = CygFormat($PERL_PATH);
1140    if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1141       $PATH          .= $ps.$tmppath;
1142    }
1143    # path to sn.exe (signing) for Windows users.
1144    my $sn_path = PathFormat('@DOTNET_FRAMEWORK_HOME@/bin');
1145    $tmppath = CygFormat($sn_path);
1146    if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
1147        $PATH          .= $ps.$tmppath;
1148    }
1150    # Add the rest of the original path if it is still missing.
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    }
1176    # The path now is in cygwin posix format
1179 elsif ($platform =~ m/mingw32/)
1181    my ( $tmppath );
1183    $PATH              = $cur_dir.
1184 #                        $ps.CygFormat($SOLARVER).$ds.$INPATH.$BIN.
1185                         $ps.CygFormat($SOLARENV).$ds."bin".
1186                         $ps.CygFormat($SOLARENV).$ds.$OUTPATH.$BIN;
1188    $PATH              .= $ps.$oldPATH;
1190 elsif ($platform =~ m/darwin/)
1191 {  $PATH              = $cur_dir.
1192 #                        $ps.'$SOLARVER'.$ds.'$INPATH'.$BIN.
1193                         $ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN.
1194                         $ps.'$SOLARENV'.$BIN;
1196   # Append old PATH
1197   $PATH             .= $ps.$oldPATH;
1199 else
1200 {  AddWarning( "set_soenv", "$platform not configured for general environment paths" );
1203 # Linker library search directory paths.
1204 if ($platform =~ m/solaris/)
1205 {  $SOLARLIB          = $L.$par_dir.$LIB.
1206                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
1207                         $L.'$SOLARVER'.$ds.'$INPATH'.$LIB.
1208                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
1209                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB."solaris.2.6".
1210                         $L.$LIB.
1211                         $L.$USR_LIB;
1212    if ( $CC =~ "gcc" ) {
1213       $SOLARLIB      .= $L.$COMPATH.$LIB;
1214    }
1215    $SOLARLIB         .= $L.$USR_LOCAL.$LIB.
1216                         $L.$USR_DT.$LIB.
1217                         $L.$USR_OPENWIN.$LIB.
1218                         $L.$XLIB;
1220    $JAVALIB          =  $L.$JAVA_HOME.$LIB.
1221                         $L.$JRELIBDIR.
1222                         $L.$JRETOOLKITDIR.
1223                         $L.$JRETHREADDIR;
1225 elsif ($platform =~ m/linux|netbsd|aix|freebsd|openbsd|dragonfly/)
1226 {  $SOLARLIB          = $L.$par_dir.$LIB.
1227                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
1228                         $L.'$SOLARVER'.$ds.'$INPATH'.$LIB.
1229                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB;
1230    if ($platform =~ m/openbsd/) {
1231       $SOLARLIB       .= $L.$USR_LOCAL.$LIB;
1232    }
1233    if ( $XLIB ne "/usr/lib" && $XLIB ne "/usr/lib64" && $XLIB ne "no_x_libraries" ) {
1234       $SOLARLIB       .= $L.$XLIB;
1235    }
1236    $JAVALIB           = '';
1237    $JAVALIB          .= $L.$JAVA_HOME.$LIB64 if (-d $JAVA_HOME.$LIB64);
1238    $JAVALIB          .= $L.$JRELIBDIR if (-d $JRELIBDIR);
1239    $JAVALIB          .= $L.$JRETOOLKITDIR if (-d $JRETOOLKITDIR);
1240    $JAVALIB          .= $L.$JRETHREADDIR if (-d $JRETHREADDIR);;
1242 elsif ($platform =~ m/cygwin|mingw32/)
1243 {  $SOLARLIB          = $L.$par_dir.$LIB.
1244                         $L.'$SOLARENV'.$ds.'$OUTPATH'.$LIB.
1245                         $L.'$SOLARVER'.$ds.'$INPATH'.$LIB;
1247 elsif ($platform =~ m/darwin/)
1248 {  $SOLARLIB          = $L.'$SOLARVER'.$ds.'$INPATH'.$LIB;
1251 if ($SYSTEM_MOZILLA eq "YES")
1253        $SOLARLIB .= $L."@MOZ_LIB@"
1256 # Location of the compiler include search directory paths.
1257 $SOLARINC             = $I.$cur_dir.
1258                         $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."stl".
1259                         $I.'$SOLARVER'.$ds.'$INPATH'.$INC.$ds."external".
1260                         $I.'$SOLARVER'.$ds.'$INPATH'.$INC.
1261                         $I.'$SOLARENV'.$INC.$ds.'$OUTPATH'.
1262                         $I.'$SOLARENV'.$INC.
1263                         $I.'$SRC_ROOT'.$ds."res";
1265 if ($platform =~ m/solaris|linux|freebsd|netbsd|aix|openbsd|dragonfly/ && '@CROSS_COMPILING@' ne 'YES')
1267     if ($platform =~ m/solaris/ && ! $CC =~ "gcc")
1268     {
1269         $SOLARINC            .= '/SC5 ';
1270     }
1271     # Platform dependent include path at the top of this list of include paths
1272     if ($platform =~ m/solaris/ && ! $CC =~ "gcc")
1273     {
1274         $SOLARINC         .= $I.$COMPATH.$INCLUDE;
1275     }
1277         # pickup system jpeg over java jpeg on OpenBSD
1278         if ($platform =~ m/openbsd/)
1279         {   $SOLARINC  .= $I.$USR_LOCAL.$INCLUDE;
1280         }
1281     if ( $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME" )
1282     {   $SOLARINC  .= $I.$JAVA_HOME.$INCLUDE;
1283         }
1285         #include system dependent Java include directory
1286         if (!($JDK eq "gcj") && $JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME")
1287         {
1288                 if ($platform =~ m/solaris/)
1289                 {  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."solaris";
1290                 }
1291                 elsif  ($platform =~ m/linux/)
1292                 {  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."linux";
1293                 }
1294                 elsif ($platform =~ m/freebsd/)
1295                 {
1296                 $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."freebsd";
1297                 $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."bsd";
1298                 $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."linux";
1299                 }
1300                 elsif ($platform =~ m/netbsd/)
1301                 {  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."netbsd";
1302                 }
1303                 elsif ( $platform =~ m/aix/ )
1304                 {  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."aix";
1305                 }
1306                 elsif ($platform =~ m/openbsd/)
1307                 {  $SOLARINC   .=$I.$JAVA_HOME.$INCLUDE.$ds."openbsd";
1308                 }
1310                 #java threads include path
1312         $SOLARINC .=$I.$JAVA_HOME.$INCLUDE.$ds."native_threads".$INCLUDE;
1313         }
1314     #The tail, if needed
1315     if ($platform =~ m/linux|freebsd|netbsd|aix|openbsd|dragonfly/)
1316     {  if ( $XINC ne "/usr/include" && $XINC ne 'no_x_includes' ) {
1317             $SOLARINC  .= $I.$XINC;
1318        }
1319     }
1321 elsif ($platform =~ m/cygwin/)
1322 {  if ($JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME")
1323    {  $SOLARINC       .= $I.$JAVA_HOME.$INCLUDE.$ds."win32".
1324                          $I.$JAVA_HOME.$INCLUDE;
1325    }
1326    $SOLARINC       .= $I.'$WINDOWS_SDK_HOME'.$INCLUDE.
1327                       $I.'$COMPATH'.$INCLUDE;
1328    if ( '@ENABLE_DIRECTX@' ne "" ) {
1329        $SOLARINC   .= $I.PathFormat('@DIRECTXSDK_HOME@').$INCLUDE;
1330    }
1332 elsif ($platform =~ m/mingw32/)
1333 {  if ($JAVA_HOME ne "" && $JAVA_HOME ne "NO_JAVA_HOME")
1334    {  if (  '@build_os' eq 'cygwin' )
1335       {  # Using MinGW from Cygwin. Use the normal Windows JDK
1336          # headers
1337          $SOLARINC       .= $I.$JAVA_HOME.$INCLUDE.$ds."win32".
1338                             $I.$JAVA_HOME.$INCLUDE;
1339       }
1340       else
1341       {  # Cross-compilation. Use our fake jni_md.h
1342          # and othewise the build platform JDK headers
1343          $SOLARINC       .= $I.$SOLARENVINC.$ds."win32".
1344                             $I.$JAVA_HOME.$INCLUDE;
1345       }
1346    }
1348 elsif ($platform =~ m/darwin/ && $platform !~ m/^arm/)
1349 {  $SOLARINC         .= $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Versions".$ds."Current".$ds."Headers".
1350                         $I.$FRAMEWORKSHOME.$ds."JavaVM.framework".$ds."Headers";
1352 elsif ($platform =~ m/^arm-apple/)
1355 else
1356 {  AddWarning( "set_soenv", "$platform not configured for system dependant include dir" );
1359 $gb_REPOS = $SRC_ROOT;
1360 $BUILD_TYPE = "@BUILD_TYPE@";
1362 if ('@WITH_LANG@' ne "")
1364     $BUILD_TYPE = "@BUILD_TYPE@ TRANSLATIONS";
1366 else
1368     $BUILD_TYPE = "@BUILD_TYPE@";
1372 # F. Setting the different aliases.
1374 # 1. alias for a full product make.
1375         $mkout           = '"perl $SOLARENV/bin/mkout.pl"';
1376         $deliver         = '"perl $SOLARENV/bin/deliver.pl"';
1377         $build           = '"perl $SOLARENV/bin/build.pl"';
1378         $zipdep          = '"perl $SOLARENV/bin/zipdep.pl"';
1381 #--------------------------
1382 # VI. Open the output file.
1383 #--------------------------
1385 if (-f $SRC_ROOT.$ds.$oldoutfile) {
1386     print "****\n";
1387     print "**** Note: There is no $oldoutfile any more. Now it is just called Env.Host.sh\n";
1388     print "****\n";
1389     unlink($SRC_ROOT.$ds.$oldoutfile);
1391 $outfile = 'Env.Host.sh';
1393 open( OUT, ">$SRC_ROOT/$outfile" ) ||
1394    die "Cannot open $SRC_ROOT/$outfile: $!\n";
1397 #------------------------------------------
1398 # VII. Writing the data to the output file.
1399 #------------------------------------------
1401 # Write file header.
1402 CreateFileHeader( *OUT, $UPD, $platform, "sh/bash/ksh", "#" );
1404 ToFile( "SRC_ROOT",          $SRC_ROOT,          "e" );
1405 ToFile( "OOO_SHELL",         $OOO_SHELL,         "e" );
1406 ToFile( "JAVA_HOME",         $JAVA_HOME,         "e" );
1407 ToFile( "L10N_MODULE",       $L10N_MODULE,       "e" );
1408 ToFile( "ANT_HOME",          PathFormat("@ANT_HOME@"), "e" );
1409 ToFile( "ANT_LIB",           PathFormat("@ANT_LIB@"), "e" );
1410 ToFile( "ANT",               PathFormat("@ANT@"), "e" );
1411 ToFile( "JDKLIB",            $JAVA_LIB,          "e" );
1412 ToFile( "ASM_PATH",          $ASM_PATH,          "e" );
1413 ToFile( "ML_EXE",            "@ML_EXE@",         "e" );
1414 ToFile( "FRAMEWORKSHOME",    $FRAMEWORKSHOME,    "e" );
1415 ToFile( "Empty",             $empty,             "n" );
1418 # Writing the platform independent constant values to file.
1419 # (c = comment, e = environment variable, a = alias )
1420 ToFile( "Platform independent constant values.", $empty, "c" );
1421 # Languages
1422 ToFile( "WITH_LANG",         "@WITH_LANG@",      "e" );
1423 ToFile( "WITH_LANG_LIST",    "@WITH_LANG_LIST@", "e" );
1424 ToFile( "INTRO_BITMAP",      "@INTRO_BITMAP@",   "e" );
1425 ToFile( "PROGRESSBARCOLOR",  "@PROGRESSBARCOLOR@",   "e" );
1426 ToFile( "PROGRESSSIZE",      "@PROGRESSSIZE@",       "e" );
1427 ToFile( "PROGRESSPOSITION",  "@PROGRESSPOSITION@",   "e" );
1428 ToFile( "PROGRESSFRAMECOLOR","@PROGRESSFRAMECOLOR@", "e" );
1429 ToFile( "ABOUT_BITMAP",      "@ABOUT_BITMAP@",   "e" );
1430 ToFile( "STARTCENTER_LEFT_BITMAP",      "@STARTCENTER_LEFT_BITMAP@",      "e" );
1431 ToFile( "STARTCENTER_RIGHT_BITMAP",     "@STARTCENTER_RIGHT_BITMAP@",     "e" );
1432 ToFile( "STARTCENTER_RTL_LEFT_BITMAP",  "@STARTCENTER_RTL_LEFT_BITMAP@",  "e" );
1433 ToFile( "STARTCENTER_RTL_RIGHT_BITMAP", "@STARTCENTER_RTL_RIGHT_BITMAP@", "e" );
1434 ToFile( "STARTCENTER_SPACE_BITMAP",     "@STARTCENTER_SPACE_BITMAP@",     "e" );
1435 ToFile( "OOO_VENDOR",        "@OOO_VENDOR@",     "e" );
1436 ToFile( "OOODMAKEMODE",      "YES",              "e" );
1437 ToFile( "PRODUCTVERSION",    "@PRODUCTVERSION@", "e" );
1438 ToFile( "WITH_POOR_HELP_LOCALIZATIONS", $WITH_POOR_HELP_LOCALIZATIONS, "e" );
1440 ToFile( "CALL_CDECL",        $CALL_CDECL,        "e" );
1441 ToFile( "COMMON_OUTDIR",     $COMMON_OUTDIR,     "e" );
1442 ToFile( "common_build",      $common_build,      "e" );
1443 ToFile( "NO_REC_RES",        $NO_REC_RES,        "e" );
1444 ToFile( "SO3",               $SO3,               "e" );
1445 ToFile( "SOLAR_PLUGIN",      $SOLAR_PLUGIN,      "e" );
1446 ToFile( "UPDATER",           $UPDATER,           "e" );
1447 ToFile( "VCL",               $VCL,               "e" );
1448 ToFile( "ENABLEUNICODE",     $ENABLEUNICODE,     "e" );
1449 ToFile( "NO_BSYMBOLIC",      $NO_BSYMBOLIC,      "e" );
1450 if ("@ENABLE_DEBUG@" eq "TRUE") {
1451 ToFile( "debug",             "true",             "e" );
1453 if ("@ENABLE_WERROR@" eq "FALSE") {
1454 ToFile( "EXTERNAL_WARNINGS_NOT_ERRORS", "TRUE",  "e" );
1456 ToFile( "PRODUCT",           "@PRODUCT@",        "e" );
1457 ToFile( "PROEXT",            $PROEXT,            "e" );
1458 ToFile( "VALGRIND_CFLAGS",   "@VALGRIND_CFLAGS@","e" );
1459 ToFile( "WITH_COMPAT_OOWRAPPERS", "@WITH_COMPAT_OOWRAPPERS@", "e" );
1460 ToFile( "UNIXWRAPPERNAME",   "@UNIXWRAPPERNAME@","e" );
1461 ToFile( "PRODUCTNAME",       "@PRODUCTNAME@",    "e" );
1462 ToFile( "INSTALLDIRNAME",    "@INSTALLDIRNAME@", "e" );
1463 ToFile( "PREFIXDIR",         "@PREFIXDIR@",      "e" );
1464 ToFile( "INSTALLDIR",        "@INSTALLDIR@",     "e" );
1465 ToFile( "LIBDIR",            "@LIBDIR@",         "e" );
1466 ToFile( "DATADIR",           "@DATADIR@",        "e" );
1467 ToFile( "MANDIR",            "@MANDIR@",         "e" );
1468 ToFile( "DOCDIR",            "@DOCDIR@",          "e" );
1469 ToFile( "DO_FETCH_TARBALLS", "@DO_FETCH_TARBALLS@", "e" );
1470 ToFile( "BUILD_MOZAB",       "@BUILD_MOZAB@",    "e" );
1471 ToFile( "PREBUILD_MOZAB",    $PREBUILD_MOZAB,    "e" );
1472 ToFile( "MOZILLA_VERSION",   $MOZILLA_VERSION,   "e" );
1473 ToFile( "DEFAULT_MOZILLA_TOOLKIT", $MOZILLA_TOOLKIT, "e" );
1474 ToFile( "SYSTEM_NSS",  "@SYSTEM_NSS@", "e" );
1475 ToFile( "MOZILLA_HEADERS_CFLAGS",  "@MOZILLA_HEADERS_CFLAGS@", "e" );
1476 ToFile( "SYSTEM_MOZILLA_HEADERS",  "@SYSTEM_MOZILLA_HEADERS@", "e" );
1477 ToFile( "MOZILLABUILD",  "@MOZILLABUILD@", "e" );
1478 ToFile( "BUILD_VER_STRING",  "@BUILD_VER_STRING@", "e" );
1479 if ($platform =~ m/linux/ && $platform =~ m/powerpc/) {
1480 ToFile( "JITC_PROCESSOR_TYPE","6",                 "e" );
1482 ToFile( "DEFAULT_TO_ENGLISH_FOR_PACKING",  "yes", "e" );
1483 ToFile( "ENABLE_GTK",        "@ENABLE_GTK@",       "e" );
1484 ToFile( "GTK_CFLAGS",        "@GTK_CFLAGS@",       "e" );
1485 ToFile( "GTK_LIBS",          "@GTK_LIBS@",         "e" );
1486 ToFile( "ENABLE_GTK3",       "@ENABLE_GTK3@",      "e" );
1487 ToFile( "GTK3_CFLAGS",       "@GTK3_CFLAGS@",      "e" );
1488 ToFile( "GTK3_LIBS",         "@GTK3_LIBS@",        "e" );
1489 ToFile( "GTHREAD_CFLAGS",    "@GTHREAD_CFLAGS@",   "e" );
1490 ToFile( "GTHREAD_LIBS",      "@GTHREAD_LIBS@",     "e" );
1491 ToFile( "ENABLE_SYSTRAY_GTK", "@ENABLE_SYSTRAY_GTK@", "e" );
1492 ToFile( "ENABLE_STATIC_GTK", "@ENABLE_STATIC_GTK@", "e" );
1493 ToFile( "SPLIT_APP_MODULES", "@SPLIT_APP_MODULES@","e" );
1494 ToFile( "SPLIT_OPT_FEATURES","@SPLIT_OPT_FEATURES@","e" );
1495 ToFile( "ENABLE_CAIRO_CANVAS", "@ENABLE_CAIRO_CANVAS@",     "e" );
1496 ToFile( "ENABLE_OPENGL",     "@ENABLE_OPENGL@",    "e" );
1497 ToFile( "ENABLE_NSPLUGIN",     "@ENABLE_NSPLUGIN@",    "e" );
1498 ToFile( "ENABLE_PDFIMPORT",  "@ENABLE_PDFIMPORT@", "e" );
1499 ToFile( "ENABLE_MINIMIZER",   "@ENABLE_MINIMIZER@","e" );
1500 ToFile( "ENABLE_PRESENTER_SCREEN","@ENABLE_PRESENTER_SCREEN@","e" );
1501 ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" );
1502 ToFile( "ENABLE_SCRIPTING_BEANSHELL","@ENABLE_SCRIPTING_BEANSHELL@","e" );
1503 ToFile( "ENABLE_SCRIPTING_JAVASCRIPT","@ENABLE_SCRIPTING_JAVASCRIPT@","e" );
1504 ToFile( "ENABLE_SCRIPTING_PYTHON","@ENABLE_SCRIPTING_PYTHON@","e" );
1505 ToFile( "ENABLE_QUICKSTART_LIBPNG", "@ENABLE_QUICKSTART_LIBPNG@", "e" );
1506 ToFile( "SYSTEM_JFREEREPORT","@SYSTEM_JFREEREPORT@","e" );
1507 ToFile( "WITH_THEMES",       "@WITH_THEMES@",      "e");
1508 ToFile( "WITH_HELPPACK_INTEGRATION",       "@WITH_HELPPACK_INTEGRATION@",      "e");
1509 ToFile( "WITH_EXTENSION_INTEGRATION",       "@WITH_EXTENSION_INTEGRATION@",      "e");
1510 ToFile( "OOO_JUNIT_JAR",     "@OOO_JUNIT_JAR@",    "e" );
1511 ToFile( "SAC_JAR",           "@SAC_JAR@",          "e" );
1512 ToFile( "LIBXML_JAR",        "@LIBXML_JAR@",       "e" );
1513 ToFile( "FLUTE_JAR",         "@FLUTE_JAR@",        "e" );
1514 ToFile( "JFREEREPORT_JAR",   "@JFREEREPORT_JAR@",  "e" );
1515 ToFile( "LIBLAYOUT_JAR",     "@LIBLAYOUT_JAR@",    "e" );
1516 ToFile( "LIBLOADER_JAR",     "@LIBLOADER_JAR@",    "e" );
1517 ToFile( "LIBFORMULA_JAR",    "@LIBFORMULA_JAR@",   "e" );
1518 ToFile( "LIBREPOSITORY_JAR", "@LIBREPOSITORY_JAR@","e" );
1519 ToFile( "LIBBASE_JAR",       "@LIBBASE_JAR@",      "e" );
1520 ToFile( "LIBFONTS_JAR",      "@LIBFONTS_JAR@",     "e" );
1521 ToFile( "LIBSERIALIZER_JAR", "@LIBSERIALIZER_JAR@","e" );
1522 ToFile( "ENABLE_MEDIAWIKI",  "@ENABLE_MEDIAWIKI@", "e" );
1523 ToFile( "SYSTEM_APACHE_COMMONS","@SYSTEM_APACHE_COMMONS@","e" );
1524 ToFile( "COMMONS_CODEC_JAR", "@COMMONS_CODEC_JAR@","e" );
1525 ToFile( "COMMONS_LANG_JAR",  "@COMMONS_LANG_JAR@", "e" );
1526 ToFile( "COMMONS_HTTPCLIENT_JAR","@COMMONS_HTTPCLIENT_JAR@","e" );
1527 ToFile( "COMMONS_LOGGING_JAR","@COMMONS_LOGGING_JAR@","e" );
1528 ToFile( "SYSTEM_SERVLETAPI", "@SYSTEM_SERVLETAPI@", "e" );
1529 ToFile( "SYSTEM_SAMPLEICC", "@SYSTEM_SAMPLEICC@", "e" );
1530 ToFile( "SAMPLEICC_CFLAGS", "@SAMPLEICC_CFLAGS@", "e" );
1531 ToFile( "SAMPLEICC_LIBS", "@SAMPLEICC_LIBS@", "e" );
1532 ToFile( "SERVLETAPI_JAR",    "@SERVLETAPI_JAR@",   "e" );
1533 ToFile( "ENABLE_DBUS",       "@ENABLE_DBUS@",      "e" );
1534 ToFile( "DBUS_CFLAGS",       "@DBUS_CFLAGS@",      "e" );
1535 ToFile( "DBUS_LIBS",         "@DBUS_LIBS@",        "e" );
1536 ToFile( "ENABLE_GTK_PRINT",  "@ENABLE_GTK_PRINT@",  "e" );
1537 ToFile( "GTK_PRINT_CFLAGS",  "@GTK_PRINT_CFLAGS@",  "e" );
1538 ToFile( "GTK_PRINT_LIBS",    "@GTK_PRINT_LIBS@",    "e" );
1539 ToFile( "ENABLE_GCONF",      "@ENABLE_GCONF@",     "e" );
1540 ToFile( "ENABLE_GNOMEVFS",   "@ENABLE_GNOMEVFS@",  "e" );
1541 ToFile( "ENABLE_GSTREAMER",  "@ENABLE_GSTREAMER@", "e" );
1542 ToFile( "ENABLE_GIO",        "@ENABLE_GIO@",       "e" );
1543 ToFile( "ENABLE_KDE",        "@ENABLE_KDE@",       "e" );
1544 ToFile( "KDE_CFLAGS",        "@KDE_CFLAGS@",       "e" );
1545 ToFile( "KDE_LIBS",          "@KDE_LIBS@",         "e" );
1546 ToFile( "MOC",               "@MOC@",              "e" );
1547 ToFile( "ENABLE_KDE4",       "@ENABLE_KDE4@",      "e" );
1548 ToFile( "KDE4_CFLAGS",       "@KDE4_CFLAGS@",      "e" );
1549 ToFile( "KDE4_LIBS",         "@KDE4_LIBS@",        "e" );
1550 ToFile( "MOC4",              "@MOC4@",             "e" );
1551 ToFile( "KDE_GLIB_CFLAGS",   "@KDE_GLIB_CFLAGS@",  "e" );
1552 ToFile( "KDE_GLIB_LIBS",     "@KDE_GLIB_LIBS@",    "e" );
1553 ToFile( "KDE_HAVE_GLIB",     "@KDE_HAVE_GLIB@",    "e" );
1554 ToFile( "ENABLE_KAB",        "@ENABLE_KAB@",       "e" );
1555 ToFile( "PSPRINT",           "TRUE",             "e" );
1556 ToFile( "MKDEPENDSOLVER",    "TRUE",             "e" );
1557 ToFile( "nodep",             "@nodep@",          "e" );
1558 ToFile( "TARFILE_LOCATION",  $TARFILE_LOCATION,  "e" );
1559 ToFile( "GIT_LINK_SRC", "@GIT_LINK_SRC@",  "e" );
1560 ToFile( "GIT_REPO_NAMES", "@GIT_REPO_NAMES@",  "e" );
1563 # Writing the platform dependent constant values to file.
1564 # (c = comment, e = environment variable, a = alias )
1565 ToFile( "Platform dependent constant values.", $empty, "c" );
1566 ToFile( "SOLAR_JAVA",        $SOLAR_JAVA,        "e" );
1567 ToFile( "COM",               $COM,               "e" );
1568 ToFile( "COMPATH",           $COMPATH,           "e" );
1569 ToFile( "CPU",               $CPU,               "e" );
1570 ToFile( "CPUNAME",           $CPUNAME,           "e" );
1571 ToFile( "GUI",               $GUI,               "e" );
1572 ToFile( "GUIBASE",           $GUIBASE,           "e" );
1573 ToFile( "GVER",              $GVER,              "e" );
1574 ToFile( "OS",                $OS,                "e" );
1575 ToFile( "OSVERSION",         $OSVERSION,         "e" );
1576 ToFile( "PTHREAD_CFLAGS",    "@PTHREAD_CFLAGS@", "e" );
1577 ToFile( "PTHREAD_LIBS",      "@PTHREAD_LIBS@",   "e" );
1578 ToFile( "OUTPATH",           $OUTPATH,           "e" );
1579 ToFile( "INPATH",            $INPATH,            "e" );
1580 ToFile( "PATH_SEPERATOR",    $PATH_SEPERATOR,    "e" );
1581 ToFile( "COMEX",             $COMEX,             "e" );
1582 ToFile( "DYNAMIC_CRT",       $DYNAMIC_CRT,       "e" );
1583 ToFile( "use_shl_versions",  $use_shl_versions,  "e" );
1585 if ( $platform =~ m/darwin/ && $platform !~ m/^arm/)
1587 # MAXOSX_DEPLOYMENT_TARGET : The minimum version required to run the build,
1588 # build can assume functions/libraries of that version to be available
1589 # unless you want to do runtime checks for 10.5 api, you also want to use the 10.4 sdk
1590 # (safer/easier than dealing with the MAC_OS_X_VERSION_MAX_ALLOWED macro)
1591 # http://developer.apple.com/technotes/tn2002/tn2064.html
1592     ToFile( "MACOSX_DEPLOYMENT_TARGET",       "@MACOSX_DEPLOYMENT_TARGET@",       "e" );
1593     ToFile( "MACOSX_SDK_PATH",                "@MACOSX_SDK_PATH@",                "e" );
1594     ToFile( "MAC_OS_X_VERSION_MIN_REQUIRED",  "@MAC_OS_X_VERSION_MIN_REQUIRED@", "e" );
1595     ToFile( "MAC_OS_X_VERSION_MAX_ALLOWED",   "@MAC_OS_X_VERSION_MAX_ALLOWED@",  "e" );
1599 # Writing the variables to file.
1600 # (c = comment, e = environment variable, a = alias, n = newline )
1601 ToFile( "Variable values.",  $empty,             "c" );
1602 if ( $platform =~ m/cygwin/ )
1603 {  ToFile( "CYGWIN_PATH",       $CYGWIN_PATH,       "e" );
1604    ToFile( "WINDOWS_SDK_HOME",  $WINDOWS_SDK_HOME,  "e" );
1605    ToFile( "DIRECTXSDK_LIB",    $DIRECTXSDK_LIB,    "e" );
1606    ToFile( "USE_DIRECTX5",      $USE_DIRECTX5,      "e" );
1607    ToFile( "ATL_LIB",           $ATL_LIB,           "e" );
1608    ToFile( "ATL_INCLUDE",       $ATL_INCLUDE,       "e" );
1609    ToFile( "MFC_LIB",           $MFC_LIB,         "e" );
1610    ToFile( "MFC_INCLUDE",       $MFC_INCLUDE,       "e" );
1611    ToFile( "DISABLE_ACTIVEX",   "@DISABLE_ACTIVEX@","e" );
1612    ToFile( "DISABLE_ATL",   "@DISABLE_ATL@","e" );
1613    ToFile( "INCLUDE",           "",                 "e" );
1614    # Variables used when building the parts that needs to be available
1615    # also as 64-bit versions in a 32-bit LibreOffice build, like
1616    # the Explorer extension. If the configure script hasn't
1617    # found the 64-bit (cross-)compiler, then @BUILD_X64@ will be empty.
1618    ToFile( "BUILD_X64",         "@BUILD_X64@",      "e" );
1619    if ( "@BUILD_X64@" eq "TRUE" ) {
1620        ToFile( "CC_X64_BINARY", "@CC_X64_BINARY@",  "e" );
1621        ToFile( "CXX_X64_BINARY","@CXX_X64_BINARY@", "e" );
1622        ToFile( "LINK_X64_BINARY","@LINK_X64_BINARY@","e" );
1623        ToFile( "LIBMGR_X64_BINARY","@LIBMGR_X64_BINARY@","e" );
1624    }
1626    # Hack around dmake's mktmp not generating DOS paths.
1627    my $tmpdir = qx{cygpath -m "/tmp"};
1628    chomp($tmpdir);
1629    ToFile( "TMPDIR",     $tmpdir,            "e" );
1630    if ( !defined $ENV{"TMP"} || $ENV{"TMP"} eq "" ) {
1631       ToFile( "TMP", $tmpdir, "e" );
1632    } else {
1633       ToFile( "TMP", "$ENV{'TMP'}", "e" );
1634    }
1636 elsif ( $platform =~ m/mingw32/ )
1637 {  ToFile( "DISABLE_ACTIVEX",   "@DISABLE_ACTIVEX@","e" );
1638    ToFile( "DISABLE_ATL",       "@DISABLE_ATL@",    "e" );
1639    ToFile( "MINGW_CLIB_DIR",    "@MINGW_CLIB_DIR@", "e" );
1640    ToFile( "MINGW_SHARED_GCCLIB", "@MINGW_SHARED_GCCLIB@", "e" );
1641    ToFile( "MINGW_SHARED_GXXLIB", "@MINGW_SHARED_GXXLIB@", "e" );
1642    ToFile( "MINGW_SHARED_LIBSTDCPP", "@MINGW_SHARED_LIBSTDCPP@", "e" );
1643    ToFile( "MINGW_GCCDLL",      "@MINGW_GCCDLL@",   "e" );
1644    ToFile( "MINGW_GXXDLL",      "@MINGW_GXXDLL@",   "e" );
1648 if ("@WITH_VC_REDIST@" eq "TRUE") {
1649 ToFile( "WITH_VC_REDIST", "TRUE",  "e" );
1651 ToFile( "PERL",              $PERL,              "e" );
1652 ToFile( "RPM",               "@RPM@",            "e" );
1653 ToFile( "DPKG",              "@DPKG@",           "e" );
1654 ToFile( "PKGMK",             "@PKGMK@",          "e" );
1655 ToFile( "GNUMAKE",           "@GNUMAKE@",        "e" );
1656 ToFile( "GNUTAR",            "@GNUTAR@",         "e" );
1657 ToFile( "ANCIENT_BISON",     "@ANCIENT_BISON@",  "e" );
1658 ToFile( "UPD",               $UPD,               "e" );
1659 ToFile( "WORK_STAMP",        $WORK_STAMP,        "e" );
1660 ToFile( "SOLARVER",          $SOLARVER,          "e" );
1661 ToFile( "SOLARVERSION",      $SOLARVERSION,      "e" );
1662 ToFile( "WORKDIR",           $WORKDIR,           "e" );
1663 ToFile( "OUTDIR",            $OUTDIR,            "e" );
1664 ToFile( "SOLARENV",          $SOLARENV,          "e" );
1665 ToFile( "SOLARDEFIMG",       $SOLARDEFIMG,       "e" );
1666 ToFile( "SOLARENVINC",       $SOLARENVINC,       "e" );
1667 ToFile( "DMAKEROOT",         $DMAKEROOT,         "e" );
1668 if ( $JDK ne "gcj" ) {
1669    ToFile( "CLASSPATH",         $CLASSPATH,         "e" );
1670    ToFile( "XCLASSPATH",        $XCLASSPATH,        "e" );
1671    ToFile( "JAVACISKAFFE",     '@JAVACISKAFFE@',    "e" );
1673 else {
1674    ToFile( "JAVACISGCJ",       '@JAVACISGCJ@',      "e" );
1676 ToFile( "AWTLIB",           '@AWTLIB@',          "e" );
1677 if ( '@JDK@' ne '' )
1679    ToFile( "JDK",             "@JDK@",           "e" );
1680    ToFile( "JAVAFLAGS",             "@JAVAFLAGS@",           "e" );
1681    ToFile( "JAVA_SOURCE_VER", "@JAVA_SOURCE_VER@","e" );
1682    ToFile( "JAVA_TARGET_VER", "@JAVA_TARGET_VER@","e" );
1683    ToFile( "JAVAINTERPRETER", PathFormat("@JAVAINTERPRETER@"), "e" );
1684    ToFile( "JAVAIFLAGS",      "@JAVAIFLAGS@",    "e" );
1685    ToFile( "JAVACOMPILER",    PathFormat("@JAVACOMPILER@"), "e" );
1686    ToFile( "JAVADOC",         PathFormat("@JAVADOC@"), "e" );
1687    ToFile( "JVM_ONE_PATH_CHECK", "@JVM_ONE_PATH_CHECK@", "e" );
1689 ToFile( "SCPDEFS",           '@SCPDEFS@',        "e" );
1690 ToFile( "SOLAREXTRAINC",     $SOLAREXTRAINC,     "e" );
1691 ToFile( "SOLAREXTRALIB",     $SOLAREXTRALIB,     "e" );
1692 if ( '@CROSS_COMPILING@' eq 'YES' )
1694    # Obviously we shouldn't set PATH to contain host binaries
1695    ToFile( "PATH",           "@PATH_FOR_BUILD@", "e" );
1697 else
1699    ToFile( "PATH",           $PATH,              "e" );
1701 ToFile( "SOLARLIB",          $SOLARLIB,          "e" );
1702 ToFile( "JAVALIB",           $JAVALIB,           "e" );
1703 ToFile( "SOLARINC",          $SOLARINC,          "e" );
1704 ToFile( "COMP_ENV",          $COMP_ENV,          "e" );
1705 ToFile( "JAVAHOME",          $JAVAHOME,          "e" );
1706 ToFile( "CC",                $CC,                "e" );
1707 ToFile( "SYSBASE",           "$ENV{SYSBASE}",    "e" ) if defined $ENV{SYSBASE};
1708 ToFile( "CROSS_COMPILING",   "@CROSS_COMPILING@","e" );
1709 ToFile( "AR",                "@AR@",             "e" );
1710 ToFile( "DLLTOOL",           "@DLLTOOL@",        "e" );
1711 ToFile( "NM",                "@NM@",             "e" );
1712 ToFile( "OBJDUMP",           "@OBJDUMP@",        "e" );
1713 ToFile( "PKG_CONFIG",        "@PKG_CONFIG@",     "e" );
1714 ToFile( "RANLIB",            "@RANLIB@",         "e" );
1715 ToFile( "STRIP",             "@STRIP@",          "e" );
1716 ToFile( "WINDRES",           "@WINDRES@",        "e" );
1717 ToFile( "BUILD_PLATFORM",    "@build@",          "e" );
1718 ToFile( "HOST_PLATFORM",     "@host@",           "e" );
1719 if ( '@CROSS_COMPILING@' eq 'YES' )
1721    ToFile( "COM_FOR_BUILD",     "@COM_FOR_BUILD@",  "e" );
1722    ToFile( "GUI_FOR_BUILD",     "@GUI_FOR_BUILD@",  "e" );
1723    ToFile( "GUIBASE_FOR_BUILD", "@GUIBASE_FOR_BUILD@", "e" );
1724    ToFile( "OS_FOR_BUILD",      "@OS_FOR_BUILD@",   "e" );
1725    ToFile( "CPU_FOR_BUILD",     "@CPU_FOR_BUILD@",  "e" );
1726    ToFile( "CPUNAME_FOR_BUILD", "@CPUNAME_FOR_BUILD@", "e" );
1727    ToFile( "CC_FOR_BUILD",      "@CC_FOR_BUILD@",   "e" );
1728    ToFile( "CXX_FOR_BUILD",     "@CXX_FOR_BUILD@",  "e" );
1729    ToFile( "GXX_INCLUDE_PATH_FOR_BUILD", "@GXX_INCLUDE_PATH_FOR_BUILD@", "e" );
1730    ToFile( "INPATH_FOR_BUILD",  "@INPATH_FOR_BUILD@", "e" );
1731    ToFile( "OUTPATH_FOR_BUILD", "@OUTPATH_FOR_BUILD@", "e" );
1732    ToFile( "MACOSX_DEPLOYMENT_TARGET_FOR_BUILD", "@MACOSX_DEPLOYMENT_TARGET_FOR_BUILD@", "e" );
1733    ToFile( "SYSTEM_LIBXSLT_FOR_BUILD", "@SYSTEM_LIBXSLT_FOR_BUILD@", "e" );
1734    ToFile( "OUTDIR_FOR_BUILD",  "@OUTDIR_FOR_BUILD@", "e");
1735    ToFile( "SOLARINC_FOR_BUILD", "@SOLARINC_FOR_BUILD@", "e");
1736    ToFile( "SOLARLIB_FOR_BUILD", "@SOLARLIB_FOR_BUILD@", "e");
1737    ToFile( "WORKDIR_FOR_BUILD", "@WORKDIR_FOR_BUILD@", "e");
1739 else
1741    ToFile( "COM_FOR_BUILD",     $COM,            "e" );
1742    ToFile( "GUI_FOR_BUILD",     $GUI,            "e" );
1743    ToFile( "GUIBASE_FOR_BUILD", $GUIBASE,        "e" );
1744    ToFile( "OS_FOR_BUILD",      $OS,             "e" );
1745    ToFile( "CPU_FOR_BUILD",     $CPU,            "e" );
1746    ToFile( "CPUNAME_FOR_BUILD", $CPUNAME,        "e" );
1747    ToFile( "CC_FOR_BUILD",      $CC,             "e" );
1748    ToFile( "CXX_FOR_BUILD",     $CXX,            "e" );
1749    ToFile( "GXX_INCLUDE_PATH_FOR_BUILD", PathFormat("@GXX_INCLUDE_PATH@"), "e" );
1750    ToFile( "INPATH_FOR_BUILD",  $INPATH,         "e" );
1751    ToFile( "OUTPATH_FOR_BUILD", $OUTPATH,        "e" );
1752    ToFile( "SYSTEM_LIBXSLT_FOR_BUILD", "@SYSTEM_LIBXSLT@", "e" );
1753    ToFile( "OUTDIR_FOR_BUILD",  $OUTDIR,         "e" );
1754    ToFile( "PATH_FOR_BUILD",    $PATH,           "e" );
1755    ToFile( "SOLARINC_FOR_BUILD", $SOLARINC,      "e" );
1756    ToFile( "SOLARLIB_FOR_BUILD", $SOLARLIB,      "e" );
1757    ToFile( "WORKDIR_FOR_BUILD", $WORKDIR,        "e" );
1759 ToFile( "BUILD_NCPUS",          "@BUILD_NCPUS@", "e" );
1760 ToFile( "GMAKE_PARALLELISM",    "@GMAKE_PARALLELISM@", "e" );
1761 ToFile( "GMAKE_MODULE_PARALLELISM","@GMAKE_MODULE_PARALLELISM@", "e" );
1762 ToFile( "SIZEOF_SHORT",         "@SIZEOF_SHORT@", "e" );
1763 ToFile( "SIZEOF_INT",           "@SIZEOF_INT@",  "e" );
1764 ToFile( "SIZEOF_LONG",          "@SIZEOF_LONG@", "e" );
1765 ToFile( "SIZEOF_LONGLONG",      "@SIZEOF_LONGLONG@", "e" );
1766 ToFile( "SIZEOF_DOUBLE",        "@SIZEOF_DOUBLE@", "e" );
1767 ToFile( "SIZEOF_POINTER",       "@SIZEOF_POINTER@", "e" );
1768 ToFile( "ALIGNOF_SHORT",        "@ALIGNOF_SHORT@", "e" );
1769 ToFile( "ALIGNOF_INT",          "@ALIGNOF_INT@", "e" );
1770 ToFile( "ALIGNOF_LONG",         "@ALIGNOF_LONG@", "e" );
1771 ToFile( "ALIGNOF_DOUBLE",       "@ALIGNOF_DOUBLE@", "e" );
1772 ToFile( "WORDS_BIGENDIAN",      "@WORDS_BIGENDIAN@", "e" );
1773 ToFile( "HAVE_GCC_NO_LONG_DOUBLE", "@HAVE_GCC_NO_LONG_DOUBLE@", "e" );
1774 ToFile( "HAVE_GCC_AVX", "@HAVE_GCC_AVX@", "e" );
1775 ToFile( "HAVE_GCC_VISIBILITY_FEATURE",
1776                 "@HAVE_GCC_VISIBILITY_FEATURE@", "e" );
1777 ToFile( "HAVE_GCC_VISIBILITY_BROKEN",
1778         "@HAVE_GCC_VISIBILITY_BROKEN@", "e" );
1779 ToFile( "HAVE_LD_HASH_STYLE","@HAVE_LD_HASH_STYLE@","e" );
1780 ToFile( "WITH_LINKER_HASH_STYLE","@WITH_LINKER_HASH_STYLE@","e" );
1781 ToFile( "HAVE_LD_BSYMBOLIC_FUNCTIONS",
1782                 "@HAVE_LD_BSYMBOLIC_FUNCTIONS@","e" );
1783 ToFile( "HAVE_THREADSAFE_STATICS", "@HAVE_THREADSAFE_STATICS@", "e" );
1784 ToFile( "HAVE_CXX0X",        "@HAVE_CXX0X@",     "e" );
1785 ToFile( "CXX",               $CXX,               "e" );
1786 ToFile( "MINGWCXX",          "@MINGWCXX@",       "e" );
1787 ToFile( "MINGWSTRIP",        "@MINGWSTRIP@",     "e" );
1788 ToFile( "WITH_STLPORT",      "@WITH_STLPORT@", "e" );
1789 ToFile( "ALLOC",             "@ALLOC@",          "e" );
1790 ToFile( "ENABLE_LTO",        "@ENABLE_LTO@",        "e" );
1791 ToFile( "ENABLE_SYMBOLS",    "@ENABLE_SYMBOLS@",    "e" );
1792 ToFile( "DISABLE_LINKOO",    "@DISABLE_LINKOO@",    "e" );
1793 ToFile( "DISABLE_STRIP",     "@DISABLE_STRIP@",     "e" );
1794 ToFile( "LFS_CFLAGS",        "@LFS_CFLAGS@",     "e" );
1795 ToFile( "ENABLE_CRASHDUMP",  "@ENABLE_CRASHDUMP@",  "e" );
1796 ToFile( "ENABLE_RANDR",      "@ENABLE_RANDR@",      "e" );
1797 ToFile( "ENABLE_FONTCONFIG", "@ENABLE_FONTCONFIG@", "e" );
1798 ToFile( "FONTCONFIG_LIBS",   "@FONTCONFIG_LIBS@",   "e");
1799 ToFile( "FONTCONFIG_CFLAGS", "@FONTCONFIG_CFLAGS@", "e");
1800 ToFile( "ENABLE_DIRECTX",    "@ENABLE_DIRECTX@",    "e" );
1801 ToFile( "ENABLE_GRAPHITE",   "@ENABLE_GRAPHITE@",   "e");
1802 ToFile( "SYSTEM_GRAPHITE",   "@SYSTEM_GRAPHITE@",   "e");
1803 ToFile( "GRAPHITE_LIBS",     "@GRAPHITE_LIBS@",     "e");
1804 ToFile( "GRAPHITE_CFLAGS",   "@GRAPHITE_CFLAGS@",   "e");
1805 ToFile( "CL_X64",            "@CL_X64@",            "e");
1806 ToFile( "WITH_MYSPELL_DICTS","@WITH_MYSPELL_DICTS@","e");
1807 ToFile( "SYSTEM_DICTS",      "@SYSTEM_DICTS@",     "e");
1808 ToFile( "DICT_SYSTEM_DIR",   "@DICT_SYSTEM_DIR@",  "e");
1809 ToFile( "HYPH_SYSTEM_DIR",   "@HYPH_SYSTEM_DIR@",  "e");
1810 ToFile( "THES_SYSTEM_DIR",   "@THES_SYSTEM_DIR@",  "e");
1811 ToFile( "ENABLE_LOCKDOWN",   "@ENABLE_LOCKDOWN@",  "e" );
1812 ToFile( "ENABLE_XMLSEC",     "@ENABLE_XMLSEC@",    "e" );
1813 ToFile( "WITH_LDAP",         "@WITH_LDAP@",        "e" );
1814 ToFile( "WITH_OPENLDAP",     "@WITH_OPENLDAP@",    "e" );
1815 ToFile( "WITH_MOZILLA",      "@WITH_MOZILLA@",     "e" );
1816 ToFile( "SYSTEM_MOZILLA",    "@SYSTEM_MOZILLA@",   "e" );
1817 ToFile( "MOZ_FLAVOUR",       "@MOZ_FLAVOUR@",      "e" );
1818 ToFile( "NSS_LIBS",          "@NSS_LIBS@",         "e" );
1819 ToFile( "NSS_CFLAGS",        "@NSS_CFLAGS@",       "e" );
1820 ToFile( "MOZ_INC",           "@MOZ_INC@",          "e" );
1821 ToFile( "MOZ_LIB",           "@MOZ_LIB@",          "e" );
1822 ToFile( "MOZ_LIB_XPCOM",     "@MOZ_LIB_XPCOM@",    "e" );
1823 ToFile( "MOZ_LDAP_CFLAGS",   "@MOZ_LDAP_CFLAGS@",  "e" );
1824 ToFile( "OOOP_GALLERY_PACK", "@OOOP_GALLERY_PACK@","e" );
1825 ToFile( "OOOP_TEMPLATES_PACK", "@OOOP_TEMPLATES_PACK@","e" );
1826 ToFile( "OOOP_FONTS_PACK",   "@OOOP_FONTS_PACK@","e" );
1827 ToFile( "OOOP_SAMPLES_PACK", "@OOOP_SAMPLES_PACK@","e" );
1828 ToFile( "CT2N_EXTENSION_PACK", "@CT2N_EXTENSION_PACK@","e" );
1829 ToFile( "BARCODE_EXTENSION_PACK", "@BARCODE_EXTENSION_PACK@","e" );
1830 ToFile( "DIAGRAM_EXTENSION_PACK", "@DIAGRAM_EXTENSION_PACK@","e" );
1831 ToFile( "VALIDATOR_EXTENSION_PACK", "@VALIDATOR_EXTENSION_PACK@","e" );
1832 ToFile( "WATCH_WINDOW_EXTENSION_PACK", "@WATCH_WINDOW_EXTENSION_PACK@","e" );
1833 ToFile( "NUMBERTEXT_EXTENSION_PACK", "@NUMBERTEXT_EXTENSION_PACK@","e" );
1834 ToFile( "HUNART_EXTENSION_PACK", "@HUNART_EXTENSION_PACK@","e" );
1835 ToFile( "TYPO_EXTENSION_PACK", "@TYPO_EXTENSION_PACK@","e" );
1836 ToFile( "GOOGLE_DOCS_EXTENSION_PACK", "@GOOGLE_DOCS_EXTENSION_PACK@","e" );
1837 ToFile( "OOOBLOGGER_EXTENSION_PACK", "@OOOBLOGGER_EXTENSION_PACK@","e" );
1838 ToFile( "SUNTEMPLATES_LANG", "@SUNTEMPLATES_LANG@","e" );
1839 ToFile( "SUNTEMPLATES_DE_PACK", "@SUNTEMPLATES_DE_PACK@","e" );
1840 ToFile( "SUNTEMPLATES_EN_US_PACK", "@SUNTEMPLATES_EN_US_PACK@","e" );
1841 ToFile( "SUNTEMPLATES_ES_PACK", "@SUNTEMPLATES_ES_PACK@","e" );
1842 ToFile( "SUNTEMPLATES_FR_PACK", "@SUNTEMPLATES_FR_PACK@","e" );
1843 ToFile( "SUNTEMPLATES_HU_PACK", "@SUNTEMPLATES_HU_PACK@","e" );
1844 ToFile( "SUNTEMPLATES_IT_PACK", "@SUNTEMPLATES_IT_PACK@","e" );
1845 ToFile( "WITH_FONTS",        "@WITH_FONTS@",       "e" );
1846 ToFile( "WITH_AGFA_MONOTYPE_FONTS",  "@WITH_AGFA_MONOTYPE_FONTS@", "e" );
1847 ToFile( "WITHOUT_AFMS",      "@WITHOUT_AFMS@",     "e" );
1848 ToFile( "WITHOUT_PPDS",      "@WITHOUT_PPDS@",     "e" );
1849 ToFile( "WITH_BINFILTER",    "@WITH_BINFILTER@",   "e" );
1850 ToFile( "BUILD_TYPE",        "$BUILD_TYPE",       "e" );
1851 ToFile( "MINGW_EXTERNAL_DLLS","@MINGW_EXTERNAL_DLLS@","e");
1852 ToFile( "VERBOSE",           "@VERBOSE@",          "e" );
1853 ToFile( "ENABLE_ZENITY",           "@ENABLE_ZENITY@",          "e" );
1854 ToFile( "ENABLE_EVOAB2",     "@ENABLE_EVOAB2@",    "e" );
1855 ToFile( "ENABLE_UGLY",       "@ENABLE_UGLY@",      "e" );
1856 ToFile( "ENABLE_SILENT_MSI", "@ENABLE_SILENT_MSI@", "e" );
1857 ToFile( "ENABLE_RELEASE_BUILD", "@ENABLE_RELEASE_BUILD@", "e" );
1858 ToFile( "GOBJECT_CFLAGS",    "@GOBJECT_CFLAGS@",   "e" );
1859 ToFile( "GOBJECT_LIBS",      "@GOBJECT_LIBS@",     "e" );
1860 if ( '@ENABLE_RPATH@' eq "no" ) {
1861   ToFile( "LINKFLAGSRUNPATH",'',                   "e" );
1863 ToFile( "EPM",               "@EPM@",              "e" );
1864 ToFile( "EPM_FLAGS",         $EPM_FLAGS,           "e" );
1865 ToFile( "BUILD_EPM",         "@BUILD_EPM@",        "e" );
1866 ToFile( "GPERF",             "@GPERF@",            "e" );
1867 ToFile( "PKGFORMAT",         "@PKGFORMAT@",        "e" );
1868 ToFile( "SYSTEM_STDLIBS",    "@SYSTEM_STDLIBS@",   "e" );
1869 ToFile( "SYSTEM_ZLIB",       "@SYSTEM_ZLIB@",      "e" );
1870 ToFile( "SYSTEM_OPENSSL",    "@SYSTEM_OPENSSL@",   "e" );
1871 ToFile( "OPENSSL_CFLAGS",    "@OPENSSL_CFLAGS@",   "e" );
1872 ToFile( "OPENSSL_LIBS",      "@OPENSSL_LIBS@",     "e" );
1873 ToFile( "DISABLE_PYTHON",    "@DISABLE_PYTHON@",   "e" );
1874 ToFile( "SYSTEM_PYTHON",     "@SYSTEM_PYTHON@",    "e" );
1875 ToFile( "PYTHON",            "@PYTHON@",           "e" );
1876 ToFile( "PYTHON_CFLAGS",     "@PYTHON_CFLAGS@",    "e" );
1877 ToFile( "PYTHON_LIBS",       "@PYTHON_LIBS@",      "e" );
1878 ToFile( "SYSTEM_ICU",        "@SYSTEM_ICU@",       "e" );
1879 ToFile( "ICU_MAJOR",         "@ICU_MAJOR@",        "e" );
1880 ToFile( "ICU_MINOR",         "@ICU_MINOR@",        "e" );
1881 ToFile( "ICU_MICRO",         "@ICU_MICRO@",        "e" );
1882 ToFile( "ICU_RECLASSIFIED_CLOSE_PARENTHESIS", "@ICU_RECLASSIFIED_CLOSE_PARENTHESIS@", "e" );
1883 ToFile( "SYSTEM_GENBRK",     "@SYSTEM_GENBRK@",    "e" );
1884 ToFile( "SYSTEM_GENCCODE",   "@SYSTEM_GENCCODE@",  "e" );
1885 ToFile( "SYSTEM_GENCMN",     "@SYSTEM_GENCMN@",    "e" );
1886 ToFile( "SYSTEM_JPEG",       "@SYSTEM_JPEG@",      "e" );
1887 ToFile( "FREETYPE_CFLAGS",   "@FREETYPE_CFLAGS@",  "e" );
1888 ToFile( "FREETYPE_LIBS",     "@FREETYPE_LIBS@",    "e" );
1889 ToFile( "SYSTEM_POPPLER",    "@SYSTEM_POPPLER@",   "e" );
1890 ToFile( "POPPLER_CFLAGS",    "@POPPLER_CFLAGS@",   "e" );
1891 ToFile( "POPPLER_LIBS",      "@POPPLER_LIBS@",     "e" );
1892 ToFile( "GSTREAMER_CFLAGS",  "@GSTREAMER_CFLAGS@", "e" );
1893 ToFile( "GSTREAMER_LIBS",    "@GSTREAMER_LIBS@",   "e" );
1894 ToFile( "SYSTEM_CAIRO",      "@SYSTEM_CAIRO@",     "e" );
1895 ToFile( "CAIRO_CFLAGS",      "@CAIRO_CFLAGS@",     "e" );
1896 ToFile( "CAIRO_LIBS",        "@CAIRO_LIBS@",       "e" );
1897 ToFile( "XRANDR_CFLAGS",     "@XRANDR_CFLAGS@",    "e" );
1898 ToFile( "XRANDR_LIBS",       "@XRANDR_LIBS@",      "e" );
1899 ToFile( "XRANDR_DLOPEN",     "@XRANDR_DLOPEN@",    "e" );
1900 ToFile( "LIBPNG_CFLAGS",     "@LIBPNG_CFLAGS@",    "e" );
1901 ToFile( "LIBPNG_LIBS",       "@LIBPNG_LIBS@",      "e" );
1902 ToFile( "SYSTEM_LIBWPD",     "@SYSTEM_LIBWPD@",    "e" );
1903 ToFile( "WPD_CFLAGS",     "@WPD_CFLAGS@",    "e" );
1904 ToFile( "WPD_LIBS",       "@WPD_LIBS@",      "e" );
1905 ToFile( "SYSTEM_LIBWPS",     "@SYSTEM_LIBWPS@",    "e" );
1906 ToFile( "WPS_CFLAGS",     "@WPS_CFLAGS@",    "e" );
1907 ToFile( "WPS_LIBS",       "@WPS_LIBS@",      "e" );
1908 ToFile( "SYSTEM_LIBWPG",     "@SYSTEM_LIBWPG@",    "e" );
1909 ToFile( "WPG_CFLAGS",     "@WPG_CFLAGS@",    "e" );
1910 ToFile( "WPG_LIBS",       "@WPG_LIBS@",      "e" );
1911 ToFile( "SYSTEM_LIBVISIO",   "@SYSTEM_LIBVISIO@",  "e" );
1912 ToFile( "VISIO_CFLAGS",   "@VISIO_CFLAGS@",  "e" );
1913 ToFile( "VISIO_LIBS",     "@VISIO_LIBS@",    "e" );
1914 ToFile( "SYSTEM_LIBCMIS",    "@SYSTEM_LIBCMIS@",  "e" );
1915 ToFile( "LIBCMIS_CFLAGS",    "@LIBCMIS_CFLAGS@",  "e" );
1916 ToFile( "LIBCMIS_LIBS",      "@LIBCMIS_LIBS@",    "e" );
1917 ToFile( "SYSTEM_CPPUNIT",    "@SYSTEM_CPPUNIT@",   "e" );
1918 ToFile( "CPPUNIT_CFLAGS",    "@CPPUNIT_CFLAGS@",   "e" );
1919 ToFile( "CPPUNIT_LIBS",      "@CPPUNIT_LIBS@",     "e" );
1920 ToFile( "SYSTEM_LIBXML",     "@SYSTEM_LIBXML@",    "e" );
1921 ToFile( "USE_FT_EMBOLDEN",   "@USE_FT_EMBOLDEN@",  "e" );
1922 ToFile( "LIBXML_CFLAGS",     "@LIBXML_CFLAGS@",    "e" );
1923 ToFile( "LIBXML_LIBS",       "@LIBXML_LIBS@",      "e" );
1924 ToFile( "SYSTEM_EXPAT",      "@SYSTEM_EXPAT@",     "e" );
1925 ToFile( "WITH_EXTRA_GALLERY","@WITH_EXTRA_GALLERY@",      "e" );
1926 ToFile( "WITH_EXTRA_TEMPLATE","@WITH_EXTRA_TEMPLATE@",      "e" );
1927 ToFile( "WITH_EXTRA_SAMPLE", "@WITH_EXTRA_SAMPLE@",      "e" );
1928 ToFile( "WITH_EXTRA_FONT",   "@WITH_EXTRA_FONT@",      "e" );
1929 ToFile( "ENABLE_OXYGENOFFICE","@ENABLE_OXYGENOFFICE@","e" );
1930 ToFile( "OXYGENOFFICE_PACK","@OXYGENOFFICE_PACK@","e" );
1931 ToFile( "SYSTEM_DB",         "@SYSTEM_DB@",        "e" );
1932 ToFile( "SYSTEM_DB_CFLAGS",  "@SYSTEM_DB_CFLAGS@", "e" );
1933 ToFile( "DB_LIB",            "@DB_LIB@",           "e" );
1934 ToFile( "DB_CPPLIB",         "@DB_CPPLIB@",        "e" );
1935 ToFile( "ENABLE_MYSQLC",     "@ENABLE_MYSQLC@",    "e" );
1936 ToFile( "ENABLE_LOMENUBAR",  "@ENABLE_LOMENUBAR@", "e" );
1937 ToFile( "DBUSMENUGTK_CFLAGS",  "@DBUSMENUGTK_CFLAGS@", "e" );
1938 ToFile( "DBUSMENUGTK_LIBS",  "@DBUSMENUGTK_LIBS@", "e" );
1939 ToFile( "ENABLE_ONLINE_UPDATE","@ENABLE_ONLINE_UPDATE@", "e" );
1940 ToFile( "SYSTEM_MYSQL",      "@SYSTEM_MYSQL@",     "e" );
1941 ToFile( "SYSTEM_MYSQL_CPPCONN","@SYSTEM_MYSQL_CPPCONN@","e" );
1942 ToFile( "MYSQL_INC",         "@MYSQL_INC@",        "e" );
1943 ToFile( "MYSQL_LIB",         "@MYSQL_LIB@",        "e" );
1944 ToFile( "MYSQL_DEFINES",     "@MYSQL_DEFINES@",    "e" );
1945 ToFile( "LIBMYSQL_PATH",     "@LIBMYSQL_PATH@",    "e" );
1946 ToFile( "SYSTEM_HSQLDB",     "@SYSTEM_HSQLDB@",    "e" );
1947 ToFile( "HSQLDB_JAR",        "@HSQLDB_JAR@",       "e" );
1948 ToFile( "SYSTEM_LUCENE",     "@SYSTEM_LUCENE@",    "e" );
1949 ToFile( "LUCENE_CORE_JAR",   "@LUCENE_CORE_JAR@",  "e" );
1950 ToFile( "LUCENE_ANALYZERS_JAR",   "@LUCENE_ANALYZERS_JAR@",  "e" );
1951 ToFile( "SYSTEM_BSH",        "@SYSTEM_BSH@",       "e" );
1952 ToFile( "BSH_JAR",           "@BSH_JAR@",          "e" );
1953 ToFile( "SYSTEM_SAXON",      "@SYSTEM_SAXON@",     "e" );
1954 ToFile( "SAXON_JAR",         "@SAXON_JAR@",        "e" );
1955 ToFile( "SYSTEM_ODBC_HEADERS","@SYSTEM_ODBC_HEADERS@","e" );
1956 ToFile( "SYSTEM_LIBXSLT",    "@SYSTEM_LIBXSLT@",   "e" );
1957 ToFile( "LIBXSLT_CFLAGS",    "@LIBXSLT_CFLAGS@",   "e" );
1958 ToFile( "LIBXSLT_LIBS",      "@LIBXSLT_LIBS@",     "e" );
1959 ToFile( "XSLTPROC",          "@XSLTPROC@",         "e" );
1960 ToFile( "SYSTEM_SANE_HEADER","@SYSTEM_SANE_HEADER@","e" );
1961 ToFile( "SYSTEM_MESA_HEADERS","@SYSTEM_MESA_HEADERS@","e" );
1962 ToFile( "SYSTEM_CURL",       "@SYSTEM_CURL@",      "e" );
1963 ToFile( "CURL_CFLAGS",       "@CURL_CFLAGS@",      "e" );
1964 ToFile( "CURL_LIBS",         "@CURL_LIBS@",        "e" );
1965 ToFile( "SYSTEM_BOOST",      "@SYSTEM_BOOST@",     "e" );
1966 ToFile( "MDDS_CPPFLAGS",     "@MDDS_CPPFLAGS@",     "e" );
1967 ToFile( "SYSTEM_MDDS",       "@SYSTEM_MDDS@",      "e" );
1968 ToFile( "SYSTEM_VIGRA",      "@SYSTEM_VIGRA@",     "e" );
1969 ToFile( "SYSTEM_NEON",       "@SYSTEM_NEON@",      "e" );
1970 ToFile( "ENABLE_LIBRSVG",    "@ENABLE_LIBRSVG@",   "e" );
1971 ToFile( "SYSTEM_LIBRSVG",    "@SYSTEM_LIBRSVG@",   "e" );
1972 ToFile( "SYSTEM_GDKPIXBUF",  "@SYSTEM_GDKPIXBUF@",   "e" );
1973 ToFile( "SYSTEM_GLIB",       "@SYSTEM_GLIB@",   "e" );
1974 ToFile( "SYSTEM_GETTEXT",    "@SYSTEM_GETTEXT@",   "e" );
1975 ToFile( "SYSTEM_LIBCROCO",   "@SYSTEM_LIBCROCO@",   "e" );
1976 ToFile( "SYSTEM_PANGO",      "@SYSTEM_PANGO@",   "e" );
1977 ToFile( "SYSTEM_LIBGSF",     "@SYSTEM_LIBGSF@",   "e" );
1978 ToFile( "SYSTEM_LIBPNG",     "@SYSTEM_LIBPNG@",   "e" );
1979 ToFile( "SYSTEM_LIBJPEG",    "@SYSTEM_LIBJPEG@",   "e" );
1980 ToFile( "NEON_VERSION",      "@NEON_VERSION@",     "e" );
1981 ToFile( "NEON_LIBS",         "@NEON_LIBS@",        "e" );
1982 ToFile( "NEON_CFLAGS",       "@NEON_CFLAGS@",      "e" );
1983 ToFile( "DISABLE_NEON",      "@DISABLE_NEON@",     "e" );
1984 ToFile( "BUILD_DMAKE",       "@BUILD_DMAKE@",      "e" );
1985 ToFile( "BUILD_STAX",        "@BUILD_STAX@",       "e" );
1986 ToFile( "BUILD_UNOWINREG",   "@BUILD_UNOWINREG@",  "e" );
1987 ToFile( "USE_XINERAMA",      "@USE_XINERAMA@",     "e" );
1988 ToFile( "XINERAMA_LINK",     "@XINERAMA_LINK@",    "e" );
1989 ToFile( "SYSTEM_REDLAND",    "@SYSTEM_REDLAND@",   "e" );
1990 ToFile( "REDLAND_CFLAGS",    "@REDLAND_CFLAGS@",   "e" );
1991 ToFile( "REDLAND_LIBS",      "@REDLAND_LIBS@",     "e" );
1992 ToFile( "BUILD_POSTGRESQL_SDBC",   "@BUILD_POSTGRESQL_SDBC@", "e" );
1993 ToFile( "SYSTEM_POSTGRESQL", "@SYSTEM_POSTGRESQL@", "e" );
1994 ToFile( "POSTGRESQL_INC",    "@POSTGRESQL_INC@",   "e" );
1995 ToFile( "POSTGRESQL_LIB",    "@POSTGRESQL_LIB@",   "e" );
1996 ToFile( "SYSTEM_HUNSPELL",   "@SYSTEM_HUNSPELL@",  "e" );
1997 ToFile( "HUNSPELL_CFLAGS",   "@HUNSPELL_CFLAGS@",  "e" );
1998 ToFile( "HUNSPELL_LIBS",     "@HUNSPELL_LIBS@",    "e" );
1999 ToFile( "SYSTEM_LPSOLVE",    "@SYSTEM_LPSOLVE@",   "e" );
2000 ToFile( "HAVE_GETOPT",       "@HAVE_GETOPT@",      "e" );
2001 ToFile( "HAVE_READDIR_R",    "@HAVE_READDIR_R@",   "e" );
2002 ToFile( "SYSTEM_LIBC",       "@SYSTEM_LIBC@",      "e" );
2003 ToFile( "SYSTEM_HYPH",       "@SYSTEM_HYPH@",      "e" );
2004 ToFile( "HYPHEN_LIB",        "@HYPHEN_LIB@",       "e" );
2005 ToFile( "SYSTEM_MYTHES",     "@SYSTEM_MYTHES@",    "e" );
2006 ToFile( "MYTHES_CFLAGS",     "@MYTHES_CFLAGS@",    "e" );
2007 ToFile( "MYTHES_LIBS",       "@MYTHES_LIBS@",      "e" );
2008 ToFile( "SYSTEM_LIBEXTTEXTCAT", "@SYSTEM_LIBEXTTEXTCAT@", "e" );
2009 ToFile( "SYSTEM_LIBEXTTEXTCAT_DATA","@SYSTEM_LIBEXTTEXTCAT_DATA@","e" );
2010 ToFile( "LIBEXTTEXTCAT_CFLAGS", "@LIBEXTTEXTCAT_CFLAGS@", "e" );
2011 ToFile( "LIBEXTTEXTCAT_LIBS", "@LIBEXTTEXTCAT_LIBS@", "e" );
2012 ToFile( "XAU_LIBS",          "@XAU_LIBS@",         "e" );
2013 ToFile( "GXX_INCLUDE_PATH",  PathFormat("@GXX_INCLUDE_PATH@"), "e" );
2014 ToFile( "COMMON_BUILD_TOOLS",$COMMON_BUILD_TOOLS,  "e" );
2015 ToFile( "MERGELIBS",         "@MERGELIBS@",           "e" );
2017 if ($platform !~ m/cygwin/) {
2018    if ( !defined $ENV{"TMPDIR"} || $ENV{"TMPDIR"} eq "" ) {
2019       ToFile( "TMPDIR",      "/tmp",               "e" );
2020    } else {
2021       ToFile( "TMPDIR",      "$ENV{'TMPDIR'}",     "e" );
2022    }
2024 ToFile( "SOLARSRC",           $SOLARSRC,           "e" );
2025 ToFile( "SRCDIR",           $SOLARSRC,           "e" );
2027 if ( $platform =~ m/cygwin/ )
2029    ToFile( "ILIB",              $ILIB,              "e" );
2030    ToFile( "GREP",              $WIN_GREP,          "e" );
2031    ToFile( "FIND",              $WIN_FIND,          "e" );
2032    ToFile( "LS",                $WIN_LS,            "e" );
2033    ToFile( "GNUCOPY",           $WIN_GNUCOPY,       "e" );
2034    ToFile( "TOUCH",             $WIN_TOUCH,         "e" );
2037 ToFile( "DELIVER",       "deliver.pl",     "e" );
2038 ToFile( "MKOUT",         "mkout.pl",       "e" );
2039 ToFile( "ZIPDEP",        "zipdep.pl",      "e" );
2042 # Writing the aliases to file.
2043 ToFile( "Aliases.",          $empty,             "c" );
2044 ToFile( "Don't set aliases when bootstrapping", $empty, "c" );
2046 ToFile( "alias mkout",       $mkout,             "a" );
2047 ToFile( "alias deliver",     $deliver,           "a" );
2048 ToFile( "alias build",       $build,             "a" );
2049 ToFile( "alias zipdep",      $zipdep,            "a" );
2051 # on Solaris, MacOSX and FreeBSD, set GNUCOPY and GNUPATCH
2052 if ($platform =~ m/solaris|darwin|freebsd/)
2054   ToFile( "GNUPATCH",   "@GNUPATCH@",   "e");
2056 ToFile( "GNUCOPY",      "@GNUCP@",      "e");
2057 ToFile( "SAL_ENABLE_FILE_LOCKING",      "1",    "e");
2059 ToFile( "ENV_SCRIPT", "$outfile", "e" );
2061 # Writing unset variables you might not need to file.
2063 print OUT "export $exportvars$newline";
2064 print OUT "unset $unsetvars$newline";
2067 #---------------------------
2068 # VIII. Closing output file.
2069 #---------------------------
2071 close( OUT ) || print "Can't close $SRC_ROOT/$outfile: $!";
2073 #--------------------------------------------------------
2074 # XII. Message at the end.
2075 #--------------------------------------------------------
2078 print "$newline";
2079 print "*********************************************************".
2080       "*******************$newline*$newline";
2081 print "* LibreOffice configuration finished. $newline*$newline";
2083 if ( $Warning ne "" )
2084 {  print "$Warning*$newline";
2087 print "*********************************************************".
2088       "******************* $newline";
2090 print "To build, issue:\n$GNUMAKE\n\n";
2091 print "To install when the build is finished, issue:\n$GNUMAKE install\n\n";
2092 print "If you want to develop LibreOffice, you might prefer:\n$GNUMAKE dev-install\n\n";
2093 print "If you want to run the smoketest, issue:\n$GNUMAKE check\n\n";
2095 if ("@STALE_MAKE@" eq "TRUE" && $platform =~ m/cygwin/ ) {
2096 print << 'EOS'
2097 WARNING:
2098 Your make version is known to be horribly slow, and hard to debug
2099 problems with. To get a reasonably functional make please do:
2101 to install a pre-compiled binary make for cygwin
2103 mkdir -p /opt/lo/bin
2104 cd /opt/lo/bin
2105 wget http://dev-www.libreoffice.org/bin/cygwin/make
2106 chmod +x make
2108 to install from source:
2109 place yourself in a working directory of you choice.
2111 git clone git://anongit.freedesktop.org/libreoffice/contrib/dev-tools
2112 cd dev-tools/make-3.82-gbuild
2113 ./configure --prefix=/opt/lo
2114 make
2115 sudo make install
2117 Then re-run autogen.sh
2119 Note: autogen.sh will try to use /opt/lo/bin/make if the environment variable GNUMAKE is not already defined.
2120 Alternatively, you can install the 'new' make where ever you want and make sure that `which make` finds it.
2125 if ( $Warning ne "" ) {
2126         print "***** WARNINGS ISSUED *****\n";
2130 #-----------------
2131 # XII. Functions.
2132 #-----------------
2134 #-------------------------------------------------------------
2135 # Function name: CheckPathName
2136 # Description:   chops off the '/' character if it's the last
2137 #                character in a pathname. also adds the '/'
2138 #                character if it's not the first character
2139 #                in a path.
2140 # Arguments:     1. Path (string)
2141 # Return value:  Path (string)
2142 #-------------------------------------------------------------
2143 sub CheckPathName
2144 {  my $retrn = $_[ 0 ];
2145    if ($platform =~ m/cygwin/)
2146    {  # Check if the first character is not a '/'.
2147       if ( !( $_[ 0 ] =~ /^\// ) )
2148       {  $retrn = $ds.$_[ 0 ];
2149       }
2150    }
2151    # kill the last '/','\','\n' if they exists.
2152    $retrn =~ s![\s/\\]+$!!;
2153    # Done!
2154    return( $retrn );
2156 #-------------------------------------------------------------
2157 # Function name: CheckPathExist
2158 # Description:   Checks whether the directory that is given
2159 #                as an argument exists. If not abort.
2160 # Arguments:     1. Path (string)
2161 # Return value:  void
2162 #-------------------------------------------------------------
2163 sub CheckPathExist
2164 {  my $dir = $_[ 0 ];
2165    if ( !( -d $dir ) and $^O ne 'MSWin32' )
2166    {  print ( "The directory $_[ 0 ] does not exist. Please create first.\n" );
2167       exit 1;
2168    }
2169    else
2170    {  # Don't check under ActiveState Perl (Windows). The path is possibly
2171       # posix and it cannot handle it.
2172       # Hmm, but the above test also checks for existance, so presumably
2173       # the mention of ActiveState in the above comment is just a red
2174       # herring.
2175       return "true";
2176    }
2178 #------------------------------------------------------------
2179 # Function name: CreateFileHeader
2180 # Description:   Creates a header for the outfile.
2181 # Arguments:     1. File to write to
2182 #                2. UPD (string)
2183 #                3. Platform (string)
2184 #                4. name of shell for this file
2185 #                5. comment to use for this file
2186 # Return value:  void
2187 #------------------------------------------------------------
2188 sub CreateFileHeader
2189 {  my $timestamp = `date`;
2190    chomp( $timestamp );
2191    my $filehandle = $_[0];
2192    my $comment = $_[4];
2193    print { $filehandle } "$comment #################################################################";
2194    print { $filehandle } $newline;
2195    print { $filehandle } "$comment LibreOffice $_[ 1 ] build environment file for: $_[ 2 ]. $newline";
2196    print { $filehandle } "$comment Generated on: $timestamp $newline";
2197    print { $filehandle } "$comment Source this file to set up the build environment. $newline";
2198    print { $filehandle } "$comment 1. exec $_[3] $newline";
2199    print { $filehandle } "$comment 2. source $outfile $newline";
2200    print { $filehandle } "$comment #################################################################";
2201    print { $filehandle } $newline;
2203 #---------------------------------------------------------
2204 # Function name: ToFile
2205 # Description:   Writes the environment variable in the
2206 #                output file.
2207 # Arguments:     1. Name of environment variable (string)
2208 #                2. Value of environment variable (string)
2209 #                3. e - env. var
2210 #                   a - alias
2211 #                   c - comment
2212 #                   n - newline
2213 #                   z - raw, write as is to OUT
2214 # Return value:  void
2215 #---------------------------------------------------------
2216 sub ToFile {
2217    if ( $_[ 2 ] eq "e" ) {
2218       # Write an environment variable to file.
2219       if (defined $_[ 1 ] && $_[ 1 ] ne "" ) {
2220          my $envvar = $_[ 1 ];
2222          # Tcsh/bash needs backslashes quoted
2223          $envvar =~ s/\\/\\\\/g;
2225          printf("%-12s %-17s %-10s %s\n", "The variable", $_[ 0 ], "is set to:", $envvar) if ( '@VERBOSE@' eq 'TRUE' );
2226          print OUT "$_[ 0 ]=\"$envvar\"$newline";      # to sh file
2227          $exportvars .= " $_[ 0 ]";                        # add to export list for sh file
2229       } else {
2230          printf("%-12s %-17s %-10s %s\n", "The variable", $_[ 0 ], "is set to:", "unset") if ( '@VERBOSE@' eq 'TRUE' );
2231          $unsetvars .= " $_[ 0 ]";                             # for sh file
2232       }
2233    }
2234    elsif ( $_[ 2 ] eq "a" )
2235    {  # Write an alias to file.
2236       print "The $_[ 0 ] is set to: $_[ 1 ]\n" if ( '@VERBOSE@' eq 'TRUE' );    # to stdout
2237       print OUT "$_[ 0 ]=$_[ 1 ]$newline";      # to sh file
2238    }
2239    elsif ( $_[ 2 ] eq "c" )
2240    {  # Write a comment to file.
2241       if ( '@VERBOSE@' eq 'TRUE' )
2242       {
2243          print "$newline";
2244          print "$comment$newline";
2245          print "$comment $_[ 0 ]$newline";
2246          print "$comment$newline";
2247       }
2248       print OUT "$newline";
2249       print OUT "$comment$newline";
2250       print OUT "$comment $_[ 0 ]$newline";
2251       print OUT "$comment$newline";
2252    }
2253    elsif ( $_[ 2 ] eq "n" )
2254    {  #Write a newline to a file
2255       print OUT "$newline";
2256    }
2257    elsif ( $_[ 2 ] eq "z" )
2258    {
2259       #Write first argument as is, and nothing else
2260       print OUT "$_[ 0 ]$newline";
2261    }
2262    else
2263    {  print "Unknown type!$newline";
2264    }
2266 #----------------------------------------------------------
2267 # Function name: PathFormat
2268 # Description:   Reformat path to either POSIX or mixed mode style.
2269 # Arguments:     1. Variable (string)
2270 # Return value:  Reformatted String
2271 #----------------------------------------------------------
2272 sub PathFormat
2273 {  my ( $variable, $d1, $d2 );
2274    $variable = $_[ 0 ];
2276    if ( $platform =~ m/cygwin/ )
2277    {   $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables
2278        $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice!
2280        # Complain if PosixPath is used on a PATH-like string
2281        if ( $variable =~ m/;/ ) {
2282            die( "Do not use on PATH lists (i.e., 'c:\\foo;d:\\bar')");
2283        }
2285        # Replace path with space with short dos path
2286        if ( $variable =~ / / ) {
2287            chomp( $variable = qx{cygpath -d "$variable"} ) ;
2288        }
2290        # Replace absolute paths or DOS paths with ...
2291        if ( ( $variable =~ m/^\// ) or ( $variable =~ m/:/ ) ) {
2292            # mixed mode paths
2293            chomp( $variable = qx{realpath "$variable"} ) unless ($variable =~ m/:/);
2294            chomp( $variable = qx{cygpath -m "$variable"} );
2295        }
2296    }
2297    return $variable;
2299 #----------------------------------------------------------
2300 # Function name: CygFormat
2301 # Description:   Format variables to cygwin posix style path
2302 #                unless .
2303 # Arguments:     1. Variable (string)
2304 # Return value:  Reformatted String
2305 #----------------------------------------------------------
2306 sub CygFormat
2307 {  my ( $variable, $d1, $d2 );
2308    $variable = $_[ 0 ];
2309    # ToDo: Do the replacement only if Windows and var contains "\" and ":"
2310    if ( $platform =~ m/cygwin/ )
2311    {
2312        # Complain if PosixPath is used on a PATH-like string
2313        if ( $variable =~ m/;/ ) {
2314            die( "Do not use on PATH lists (i.e., 'c:\\foo;d:\\bar')");
2315        }
2317        # Replace DOS paths with posix paths
2318        if ( ( $variable =~ m/\\/ ) or ( $variable =~ m/:/ ) ) {
2319            chomp( $variable = qx{cygpath -u "$variable"} );
2320        }
2321    }
2322    return $variable;
2324 #----------------------------------------------------------
2325 # Function name: WinPath
2326 # Description:   Reformat a $sep seperated path using DOS paths.
2327 # Arguments:     1. Variable (string)
2328 #                2. Separaror (string)
2329 # Return value:  Reformatted String
2330 #----------------------------------------------------------
2331 sub WinPath
2333     my ( $variable, $d1, $sep, @split_var );
2335     if ( $platform =~ m/cygwin/ ) {
2336         $variable = $_[ 0 ];
2337         $sep = $_[ 1 ];
2338         $variable =~ s/^\s+//g ; #remove leading spaces
2339         $variable =~ s/\s+$//g ; #remove trailing spaces
2340         $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables
2341         $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice!
2343         @split_var = split(/$sep/,$variable);
2344         foreach $d1 ( @split_var ) {
2345             if ( $d1 =~ /(?:^\/[\w\.~ ]+)+/ ) {
2346                 if ( $d1 =~ / / ) {
2347                     # Use DOS 8.3 style to avoid quoting
2348                     chomp( $d1 = qx{cygpath -d "$d1"} );
2349                 } else {
2350                     # Use "normal" filenames
2351                     chomp( $d1 = qx{cygpath -w "$d1"} );
2352                 }
2353             }
2354         }
2355         $variable = join(';',@split_var);
2357         $variable =~ s/\//\\/g; # Remaining \ come from e.g.: ../foo/baa
2358     }
2360     return $variable;
2363 #--------------------------------------------------------
2364 # Function name: GetCorrectPath
2365 # Description:   Creates the build environment.
2366 # Arguments:     1.   existing / original path
2367 #                2... pairs of <path, executable>
2368 # Return value:  String - Correct Path
2369 #--------------------------------------------------------
2370 sub GetCorrectPath
2372         sub PathLookup
2373         {
2374             my $cmd = shift;
2375             while (@_) {
2376                 my $elem = shift;
2378                 -x "$elem/$cmd" && return $elem;
2379             }
2380             return '';
2381         }
2383         sub SaneGrep
2384         {
2385             # Perl grep is unbelievably strange.
2386             my $needle = shift;
2387             while (@_) {
2388                 my $haystack = shift;
2389                 if ($needle eq $haystack) {
2390                     return 1;
2391                 }
2392             }
2393             return 0;
2394         }
2396         sub CleanupPath
2397         {
2398             my @elements = @_;
2399             my @cleanName = ();
2401             while (@elements) {
2402                 my $elem = shift @elements;
2403                 if (!SaneGrep ($elem, @cleanName)) {
2404                         push @cleanName, $elem;
2405                 }
2406             }
2408             return @cleanName;
2409         }
2411         my $oldPath = shift;
2412         my @originalPairs = @_;
2413         my @pairs = @originalPairs;
2414         my @Path = split /$ps/, $oldPath;
2416         while (@pairs) {
2417             my $path = shift @pairs;
2418             my $cmd = shift @pairs;
2419             my $to_append = 1;
2420             my $elem;
2422             if (! -x "$path/$cmd") {
2423                 AddWarning ("Missing executable $path/$cmd\n");
2424             }
2426             for $elem (@Path) {
2427                 if ($elem eq $path) {
2428 #                   print "Hit duplicate path in path; break\n";
2429                     $to_append = 0;
2430                     last;
2431                 }
2432                 if (-f "$elem/$cmd") {
2433 #                   print "Element already in path ...\n";
2434                     unshift @Path, $path;
2435                     $to_append = 0;
2436                     last;
2437                 } else {
2438 #                   print "No file $elem/$cmd\n";
2439                 }
2440             }
2441             if ($to_append) {
2442                 push @Path, $path;
2443             }
2444         }
2446         @pairs = @originalPairs;
2447         while (@pairs) {
2448             my $path = shift @pairs;
2449             my $cmd = shift @pairs;
2450             my $realpath;
2452             $realpath = PathLookup ($cmd, @Path);
2453             if (!($realpath eq $path)) {
2454                 AddWarning ("Path conflict for executables " .
2455                             "$path/$cmd against $realpath");
2456             }
2457         }
2459         return join $ps, CleanupPath (@Path);
2462 #------------------------------------------------------------
2463 # Function name: AddWarning
2464 # Description:   Adds any kind of warning for the user.
2465 #                The warning will be shown at the end
2466 #                of this script.
2467 # Arguments:     1. Add the configure warnings or the set_soenv
2468 #                   warning (string).
2469 #                2. Warning (string).
2470 # Return value:  void
2471 #------------------------------------------------------------
2472 sub AddWarning
2473 {  if ( $_[ 0 ] eq "configure" )
2474    {  open( IN, $warnfile );
2475       while ( <IN> )
2476       {  $Warning = $Warning."* - ".$_;
2477       }
2478       close( IN );
2479       # Remove the temporary warning file.
2480       # unlink ( $warnfile );
2481    }
2482    elsif ( $_[ 0 ] eq "set_soenv" )
2483    {  my ( $arg1 );
2484       $arg1 = $_[ 1 ];
2485       chomp( $arg1 );                            # cut off new line
2486       $Warning = $Warning."* - set_soenv: warning: $arg1 $newline";  # add the warning
2487    }
2490 # vim:set shiftwidth=4 softtabstop=4 expandtab: #