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