Lines 1009-1045
if ($platform eq "$Winnt")
Link Here
|
1009 |
} |
1009 |
} |
1010 |
|
1010 |
|
1011 |
# The general environment path. |
1011 |
# The general environment path. |
1012 |
if ($platform eq "$Solaris") |
1012 |
if (($platform eq "$Linux") || ($platform eq "$NetBSD") || |
1013 |
{ $PATH = $cur_dir. |
1013 |
($platform eq "$Tru64") || ($platform eq "$Irix") || |
1014 |
$ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$BIN. |
1014 |
($platform eq "$Irix64") || ($platform eq "$FreeBSD") || |
1015 |
$ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN. |
1015 |
($platform eq "AIX") || ($platform eq "$Solaris")) |
1016 |
$ps.'$SOLARENV'.$BIN. |
|
|
1017 |
$ps.$USR_CCS.$BIN; |
1018 |
if ( $JAVA_HOME ne "" ) |
1019 |
{ |
1020 |
$PATH .= $ps.'$JAVA_HOME'.$BIN; |
1021 |
} |
1022 |
|
1023 |
$PATH .= GetCorrectPath($COMPATH, $PERL_PATH, $TCSH_PATH, $compiler); |
1024 |
|
1025 |
$PATH .= $ps.$oldPATH; |
1026 |
} |
1027 |
elsif (($platform eq "$Linux") || ($platform eq "$NetBSD") || |
1028 |
($platform eq "$Tru64") || ($platform eq "$Irix") || |
1029 |
($platform eq "$Irix64") || ($platform eq "$FreeBSD") || |
1030 |
($platform eq "AIX")) |
1031 |
{ $PATH = $cur_dir. |
1016 |
{ $PATH = $cur_dir. |
1032 |
$ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$BIN. |
1017 |
$ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$BIN. |
1033 |
$ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN. |
1018 |
$ps.'$SOLARENV'.$ds.'$OUTPATH'.$BIN. |
1034 |
$ps.'$SOLARENV'.$BIN; |
1019 |
$ps.'$SOLARENV'.$BIN; |
1035 |
if ( $JAVA_HOME ne "" ) |
1020 |
|
1036 |
{ |
1021 |
if ($platform eq "$Solaris") { |
1037 |
$PATH .= $ps.'$JAVA_HOME'.$BIN; |
1022 |
$PATH .= $ps.$USR_CCS.$BIN; |
1038 |
} |
1023 |
} |
1039 |
$PATH .= $ps.$oldPATH; |
|
|
1040 |
|
1024 |
|
1041 |
$PATH .= GetCorrectPath($COMPATH, $PERL_PATH, $TCSH_PATH, $compiler); |
1025 |
$PATH .= $ps.$oldPATH; |
1042 |
|
1026 |
|
|
|
1027 |
my @javaBits; |
1028 |
if ( $JAVA_HOME ne "" ) { |
1029 |
@javaBits = ( $ps.'$JAVA_HOME'.$BIN, 'javac' ); |
1030 |
} else { |
1031 |
@javaBits = (); |
1032 |
} |
1033 |
$PATH .= GetCorrectPath ($PATH, $COMPATH, $CC, |
1034 |
$PERL_PATH, 'perl', |
1035 |
$TCSH_PATH, 'tcsh', |
1036 |
@javaBits); |
1043 |
} |
1037 |
} |
1044 |
|
1038 |
|
1045 |
elsif ($platform eq "$Winnt") |
1039 |
elsif ($platform eq "$Winnt") |
Lines 2277-2329
sub CreateBuildEnv
Link Here
|
2277 |
mkdir( $src_root, 0777 ) || |
2275 |
mkdir( $src_root, 0777 ) || |
2278 |
print ( "Cannot create directory $src_root \n"); |
2276 |
print ( "Cannot create directory $src_root \n"); |
2279 |
} |
2277 |
} |
|
|
2278 |
|
2280 |
#-------------------------------------------------------- |
2279 |
#-------------------------------------------------------- |
2281 |
# Function name: GetCorrectPath |
2280 |
# Function name: GetCorrectPath |
2282 |
# Description: Creates the build environment. |
2281 |
# Description: Creates the build environment. |
2283 |
# Arguments: 1. $COMPATH: Compiler Path. |
2282 |
# Arguments: 1. existing / original path |
2284 |
# 2. $PERL_PATH: Perl executable Path. |
2283 |
# 2... pairs of <path, executable> |
2285 |
# 2. $TCSH_PATH: Tcsh executable Path. |
|
|
2286 |
# Return value: String - Correct Path |
2284 |
# Return value: String - Correct Path |
2287 |
#-------------------------------------------------------- |
2285 |
#-------------------------------------------------------- |
2288 |
sub GetCorrectPath |
2286 |
sub GetCorrectPath |
2289 |
{ my ( $compath, $perl_path, $tcsh_path, $compiler, $perl_compath, $compath_perl, $correct_path ); |
2287 |
{ |
2290 |
$compath = $_[ 0 ]; |
2288 |
sub PathLookup |
2291 |
$perl_path = $_[ 1 ]; |
2289 |
{ |
2292 |
$tcsh_path = $_[ 2 ]; |
2290 |
my $cmd = shift; |
2293 |
$compiler = $_[ 3 ]; |
2291 |
while (@_) { |
2294 |
if ($compath ne $perl_path) |
2292 |
my $elem = shift; |
2295 |
{ $perl_compath .= $compath.$ds."perl"; |
2293 |
|
2296 |
if ( !( -f $perl_compath ) ) |
2294 |
-x "$elem/$cmd" && return $elem; |
2297 |
{ $correct_path = $ps.$compath. |
2295 |
} |
2298 |
$ps.$perl_path; |
2296 |
return ''; |
2299 |
} |
2297 |
} |
2300 |
else |
2298 |
|
2301 |
{ $compath_perl .= $perl_path.$ds.$compiler; |
2299 |
sub CleanupPath |
2302 |
if ( !( -f $compath_perl ) ) |
2300 |
{ |
2303 |
{ $correct_path = $ps.$perl_path. |
2301 |
my $elem = shift; |
2304 |
$ps.$compath; |
2302 |
my @rest = @_; |
2305 |
} |
2303 |
my @result = ($elem); |
2306 |
else |
2304 |
|
2307 |
{ AddWarning( "set_soenv", "Compiler path and Perl Path conflict, fix and run ./configure again" ); |
2305 |
if (@rest) { |
2308 |
$correct_path = ""; |
2306 |
my @chew = CleanupPath(@rest); |
2309 |
} |
2307 |
|
2310 |
} |
2308 |
for $a (@chew) { |
2311 |
} |
2309 |
if (!($a eq $elem)) { |
2312 |
else |
2310 |
push @result, $a; |
2313 |
{ $correct_path = $ps.$compath; |
2311 |
} |
2314 |
} |
2312 |
} |
2315 |
if (($tcsh_path ne $compath) && ($tcsh_path ne $perl_path) && |
2313 |
return @result; |
2316 |
($tcsh_path ne $USR.$BIN) && ($tcsh_path ne $BIN)) |
2314 |
} else { |
2317 |
{ $correct_path .= $ps.$tcsh_path; |
2315 |
return $elem; |
2318 |
} |
2316 |
} |
2319 |
if (($compath ne $USR.$BIN) && ($perl_path ne $USR.$BIN) && ($tcsh_path ne $USR.$BIN)) |
2317 |
} |
2320 |
{ $correct_path .= $ps.$USR.$BIN; |
2318 |
|
2321 |
} |
2319 |
my $oldPath = shift; |
2322 |
if (($compath ne $BIN) && ($perl_path ne $BIN)) |
2320 |
my @originalPairs = @_; |
2323 |
{ $correct_path .= $ps.$BIN; |
2321 |
my @pairs = @originalPairs; |
2324 |
} |
2322 |
my @Path = split /$ds/, $oldPath; |
2325 |
return $correct_path; |
2323 |
|
|
|
2324 |
while (@pairs) { |
2325 |
my $path = shift @pairs; |
2326 |
my $cmd = shift @pairs; |
2327 |
my $to_append = 1; |
2328 |
my $elem; |
2329 |
|
2330 |
if (! -x "$path/$cmd") { |
2331 |
AddWarning ("Missing executable $path/$cmd\n"); |
2332 |
next; |
2333 |
} |
2334 |
|
2335 |
for $elem (@Path) { |
2336 |
if ($elem eq $path) { |
2337 |
# print "Hit duplicate path in path; break\n"; |
2338 |
$to_append = 0; |
2339 |
last; |
2340 |
} |
2341 |
if (-f "$elem/$cmd") { |
2342 |
# print "Element already in path ...\n"; |
2343 |
unshift @Path, $path; |
2344 |
$to_append = 0; |
2345 |
last; |
2346 |
} else { |
2347 |
# print "No file $elem/$cmd\n"; |
2348 |
} |
2349 |
} |
2350 |
if ($to_append) { |
2351 |
push @Path, $path; |
2352 |
} |
2353 |
} |
2354 |
|
2355 |
@pairs = @originalPairs; |
2356 |
while (@pairs) { |
2357 |
my $path = shift @pairs; |
2358 |
my $cmd = shift @pairs; |
2359 |
my $realpath; |
2360 |
|
2361 |
$realpath = PathLookup ($cmd, @Path); |
2362 |
if (!($realpath eq $path)) { |
2363 |
AddWarning ("Path conflict for executables " . |
2364 |
"$path/$cmd against $realpath"); |
2365 |
} |
2366 |
} |
2367 |
|
2368 |
return join $ds, CleanupPath (@Path); |
2326 |
} |
2369 |
} |
|
|
2370 |
|
2327 |
#------------------------------------------------------------ |
2371 |
#------------------------------------------------------------ |
2328 |
# Function name: AddWarning |
2372 |
# Function name: AddWarning |
2329 |
# Description: Adds any kind of warning for the user. |
2373 |
# Description: Adds any kind of warning for the user. |