merge the formfield patch from ooo-build
[ooovba.git] / solenv / bin / modules / installer / environment.pm
bloba7bc4dc0343ee62ec3a86c905f05bea91d128ae3
1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 #
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: environment.pm,v $
11 # $Revision: 1.14 $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
32 package installer::environment;
34 use installer::exiter;
35 use installer::globals;
37 ######################################################
38 # Create path variables from environment variables
39 ######################################################
41 sub create_pathvariables
43 my ($environment) = @_;
45 my %variables = ();
47 # The following variables are needed in the path file list
48 # solarpath, solarenvpath, solarcommonpath, os, osdef, pmiscpath
50 my $solarpath = $environment->{'SOLARVERSION'} . $installer::globals::separator . $installer::globals::compiler . $installer::globals::productextension;
51 $variables{'solarpath'} = $solarpath;
53 my $solarcommonpath = $environment->{'SOLARVERSION'} . $installer::globals::separator . "common" . $installer::globals::productextension;
54 # my $solarcommonpath = $environment->{'SOLARVERSION'} . $installer::globals::separator . $environment->{'COMMON_OUTDIR'} . $installer::globals::productextension;
55 $variables{'solarcommonpath'} = $solarcommonpath;
57 my $osdef = lc($environment->{'GUI'});
58 $variables{'osdef'} = $osdef;
60 $variables{'os'} = $installer::globals::compiler;
62 my $solarenvpath = "";
64 if ( $ENV{'SO_PACK'} ) { $solarenvpath = $ENV{'SO_PACK'}; }
65 # overriding with STAR_INSTPATH, if set
66 if ( $ENV{'STAR_INSTPATH'} ) { $solarenvpath = $ENV{'STAR_INSTPATH'}; }
68 $variables{'solarenvpath'} = $solarenvpath;
70 my $localpath = $environment->{'LOCAL_OUT'};
71 $variables{'localpath'} = $localpath;
73 my $localcommonpath = $environment->{'LOCAL_COMMON_OUT'};
74 $variables{'localcommonpath'} = $localcommonpath;
76 my $platformname = $environment->{'OUTPATH'};
77 $variables{'platformname'} = $platformname;
79 return \%variables;
82 ##################################################
83 # Setting some fundamental global variables.
84 # All these variables can be overwritten
85 # by parameters.
86 ##################################################
88 sub set_global_environment_variables
90 my ( $environment ) = @_;
92 $installer::globals::build = $environment->{'WORK_STAMP'};
93 # $installer::globals::minor = $environment->{'UPDMINOR'};
94 $installer::globals::compiler = $environment->{'OUTPATH'};
96 if ( $ENV{'UPDMINOR'} ) { $installer::globals::minor = $ENV{'UPDMINOR'}; }
97 if ( $ENV{'LAST_MINOR'} ) { $installer::globals::lastminor = $ENV{'LAST_MINOR'}; }
99 if ( $ENV{'PROEXT'} ) { $installer::globals::pro = 1; }
100 if ( $ENV{'SOLAR_JAVA'} ) { $installer::globals::solarjava = 1; }
101 if ( $ENV{'JDKLIB'} ) { $installer::globals::jdklib = $ENV{'JDKLIB'}; }
102 if ( $ENV{'JREPATH'} ) { $installer::globals::jrepath = $ENV{'JREPATH'}; }
104 if ( $ENV{'VERBOSE'} && ( (lc $ENV{'VERBOSE'}) eq "false" ) ) { $installer::globals::quiet = 1; }
105 if ( $ENV{'PREPARE_WINPATCH'} ) { $installer::globals::prepare_winpatch = 1; }
106 if ( $ENV{'PREVIOUS_IDT_DIR'} ) { $installer::globals::previous_idt_dir = $ENV{'PREVIOUS_IDT_DIR'}; }
107 if ( $ENV{'LOCALINSTALLDIR'} ) { $installer::globals::localinstalldir = $ENV{'LOCALINSTALLDIR'}; }
108 if ( $ENV{'LOCALUNPACKDIR'} ) { $installer::globals::localunpackdir = $ENV{'LOCALUNPACKDIR'}; }
109 if ( $ENV{'MAX_LANG_LENGTH'} ) { $installer::globals::max_lang_length = $ENV{'MAX_LANG_LENGTH'}; }
111 if ( $ENV{'SOLAR_JAVA'} ) { $installer::globals::solarjavaset = 1; }
112 if ( $ENV{'RPM'} ) { $installer::globals::rpm = $ENV{'RPM'}; }
113 if ( $ENV{'DONTCOMPRESS'} ) { $installer::globals::solarisdontcompress = 1; }