Lines 42-51
Link Here
|
42 |
# IIa. Declaring variables for the system commands, etc. |
42 |
# IIa. Declaring variables for the system commands, etc. |
43 |
#-------------------------------------------------------- |
43 |
#-------------------------------------------------------- |
44 |
# |
44 |
# |
45 |
my ( $outfile, $outfile_sh, $bootfile, $newline, $comment, $compiler, $unsetenv, $setenv, $unset, $set, $ds, $ps, $cur_dir, |
45 |
my ( $outfile, $outfile_sh, $outfile_bat, $bootfile, $newline, $comment, $comment4nt, $compiler, $unsetenv, $setenv, $unset, $set, $ds, $ps, $cur_dir, |
46 |
$par_dir, $I, $L, $D, $buildenv, $answer, $tmp, $Solaris, $Linux, $FreeBSD, $NetBSD, $Tru64, $Irix, $Irix64, $Winnt, $Macosx, $MINGWIN32, $USE_SHELL, |
46 |
$par_dir, $I, $L, $D, $buildenv, $answer, $tmp, $Solaris, $Linux, $FreeBSD, $NetBSD, $Tru64, $Irix, $Irix64, $Winnt, $Macosx, $MINGWIN32, $USE_SHELL, |
47 |
$WScomp, $GNUcomp, $platform, $cygwinver, $machine_type, $empty, $no_jdk, $no_ant, $no_stl, $no_tcsh, $no_cl, $no_gcc, $no_gcc_home, $no_gcc_include, |
47 |
$WScomp, $GNUcomp, $platform, $cygwinver, $machine_type, $empty, $no_jdk, $no_ant, $no_stl, $no_tcsh, $no_cl, $no_gcc, $no_gcc_home, $no_gcc_include, |
48 |
$no_gxx_include, $warnfile, $Warning, $result, $unsetvars, $unsetvarssh, $exportvars, $win_format_var, $perl_os); |
48 |
$no_gxx_include, $warnfile, $Warning, $result, $unsetvars, $unsetvarssh, $unsetvarsbat, $exportvars, $win_format_var, $perl_os); |
49 |
# |
49 |
# |
50 |
#------------------------------------------------- |
50 |
#------------------------------------------------- |
51 |
# IIb. Declaring environment values (constants). |
51 |
# IIb. Declaring environment values (constants). |
Lines 524-530
Link Here
|
524 |
$MULTITHREAD_OBJ = "TRUE"; |
524 |
$MULTITHREAD_OBJ = "TRUE"; |
525 |
if ( $MINGWIN32 eq "yes" ) |
525 |
if ( $MINGWIN32 eq "yes" ) |
526 |
{ print "Setting Windows NT cygwin mingwin32 specific values... "; |
526 |
{ print "Setting Windows NT cygwin mingwin32 specific values... "; |
527 |
$outfile = "winenv"; |
527 |
$outfile = "winmingw.set"; |
528 |
$COM = "GCC"; |
528 |
$COM = "GCC"; |
529 |
# Change path to lower case. |
529 |
# Change path to lower case. |
530 |
$COMPATH = lc $COMPATH; |
530 |
$COMPATH = lc $COMPATH; |
Lines 554-560
Link Here
|
554 |
} |
554 |
} |
555 |
else |
555 |
else |
556 |
{ print "Setting Windows NT specific values... "; |
556 |
{ print "Setting Windows NT specific values... "; |
557 |
$outfile = "winenv.bat"; |
557 |
$outfile = "winenv.set"; |
558 |
$COM = "MSC"; |
558 |
$COM = "MSC"; |
559 |
# Change path to lower case. |
559 |
# Change path to lower case. |
560 |
$COMPATH = lc $COMPATH; |
560 |
$COMPATH = lc $COMPATH; |
Lines 588-605
Link Here
|
588 |
$PROSWITCH = "-DPRODUCT"; |
588 |
$PROSWITCH = "-DPRODUCT"; |
589 |
# GUIBASE is set below; may be "aqua" or "unx". |
589 |
# GUIBASE is set below; may be "aqua" or "unx". |
590 |
} |
590 |
} |
591 |
if ($platform eq $Winnt) |
591 |
$comment4nt = "rem"; # Windows 4nt script comment character |
592 |
{ |
592 |
$comment = "#"; # UNIX script comment character |
593 |
if ( $USE_SHELL eq "4nt" ) { # USE_SHELL equal 4nt means: use 4NT |
|
|
594 |
$comment = "rem"; # Windows script comment character |
595 |
} |
596 |
else { |
597 |
$comment = "#"; |
598 |
} |
599 |
} |
600 |
else |
601 |
{ $comment = "#"; # UNIX script comment character |
602 |
} |
603 |
print "done\n"; |
593 |
print "done\n"; |
604 |
|
594 |
|
605 |
# |
595 |
# |
Lines 763-768
Link Here
|
763 |
{ undef $outfile_sh; |
753 |
{ undef $outfile_sh; |
764 |
} |
754 |
} |
765 |
|
755 |
|
|
|
756 |
# Generate output file for 4nt? |
757 |
if ($USE_SHELL eq "4nt") |
758 |
{ $outfile_bat = $outfile; |
759 |
$outfile_bat =~ s/set$/bat/i; |
760 |
} |
761 |
else |
762 |
{ undef $outfile_bat; |
763 |
} |
764 |
|
766 |
if ($STLPORT4 ne $no_stl) { |
765 |
if ($STLPORT4 ne $no_stl) { |
767 |
$ps_STLPORT_LIB = $ps.'$STLPORT4'.$LIB; |
766 |
$ps_STLPORT_LIB = $ps.'$STLPORT4'.$LIB; |
768 |
$L_STLPORT_LIB = $L.'$STLPORT4'.$LIB; |
767 |
$L_STLPORT_LIB = $L.'$STLPORT4'.$LIB; |
Lines 1320-1339
Link Here
|
1320 |
# |
1319 |
# |
1321 |
print "Setting the aliases... "; |
1320 |
print "Setting the aliases... "; |
1322 |
# 1. alias for a full product make. |
1321 |
# 1. alias for a full product make. |
1323 |
if (( $platform eq "$Winnt" ) and ( $USE_SHELL eq "4nt" )) |
1322 |
# ToFile will take care for the right 4nt format |
1324 |
{ $dmake = '`*dmake`'; |
|
|
1325 |
$mkout = '`perl %SOLARENV\bin\mkout.pl`'; |
1326 |
$deliver = '`perl %SOLARENV\bin\deliver.pl`'; |
1327 |
$build = '`perl %SOLARENV\bin\build.pl`'; |
1328 |
$zipdep = '`perl %SOLARENV\bin\zipdep.pl`'; |
1329 |
} |
1330 |
else |
1331 |
{ |
1332 |
$mkout = '"perl $SOLARENV/bin/mkout.pl"'; |
1323 |
$mkout = '"perl $SOLARENV/bin/mkout.pl"'; |
1333 |
$deliver = '"perl $SOLARENV/bin/deliver.pl"'; |
1324 |
$deliver = '"perl $SOLARENV/bin/deliver.pl"'; |
1334 |
$build = '"perl $SOLARENV/bin/build.pl"'; |
1325 |
$build = '"perl $SOLARENV/bin/build.pl"'; |
1335 |
$zipdep = '"perl $SOLARENV/bin/zipdep.pl"'; |
1326 |
$zipdep = '"perl $SOLARENV/bin/zipdep.pl"'; |
1336 |
} |
|
|
1337 |
# 3. alias for a full product make |
1327 |
# 3. alias for a full product make |
1338 |
$nmake = '"dmake"'; |
1328 |
$nmake = '"dmake"'; |
1339 |
print "done\n"; |
1329 |
print "done\n"; |
Lines 1351-1364
Link Here
|
1351 |
die "Cannot open $outfile_sh: $!\n"; |
1341 |
die "Cannot open $outfile_sh: $!\n"; |
1352 |
} |
1342 |
} |
1353 |
|
1343 |
|
|
|
1344 |
if(defined($outfile_bat)) |
1345 |
{ # Create bat environment file |
1346 |
open( OUT_BAT, ">$outfile_bat" ) || |
1347 |
die "Cannot open $outfile_bat: $!\n"; |
1348 |
} |
1349 |
|
1354 |
# |
1350 |
# |
1355 |
#------------------------------------------ |
1351 |
#------------------------------------------ |
1356 |
# VII. Writing the data to the output file. |
1352 |
# VII. Writing the data to the output file. |
1357 |
#------------------------------------------ |
1353 |
#------------------------------------------ |
1358 |
# |
1354 |
# |
1359 |
# Write file header. |
1355 |
# Write file header. |
1360 |
CreateFileHeader( *OUT, $UPD, $platform, "(t)csh" ); |
1356 |
CreateFileHeader( *OUT, $UPD, $platform, "(t)csh", "#" ); |
1361 |
CreateFileHeader( *OUT_SH, $UPD, $platform, "sh/bash/ksh" ) if defined($outfile_sh); |
1357 |
CreateFileHeader( *OUT_SH, $UPD, $platform, "sh/bash/ksh", "#" ) if defined($outfile_sh); |
|
|
1358 |
CreateFileHeader( *OUT_BAT, $UPD, $platform, "4nt", "rem" ) if defined($outfile_bat); |
1362 |
# |
1359 |
# |
1363 |
# Writing the platform independent constant values to file. |
1360 |
# Writing the platform independent constant values to file. |
1364 |
# (c = comment, e = environment variable, a = alias ) |
1361 |
# (c = comment, e = environment variable, a = alias ) |
Lines 1742-1750
Link Here
|
1742 |
# Writing the aliases to file. |
1739 |
# Writing the aliases to file. |
1743 |
# (c = comment, e = environment variable, a = alias ) |
1740 |
# (c = comment, e = environment variable, a = alias ) |
1744 |
ToFile( "Aliases.", $empty, "c" ); |
1741 |
ToFile( "Aliases.", $empty, "c" ); |
1745 |
if (( $platform eq "$Winnt" ) and ( $USE_SHELL eq "4nt" )) |
|
|
1746 |
{ ToFile( "alias dmake", $dmake, "a" ); |
1747 |
} |
1748 |
ToFile( "alias mkout", $mkout, "a" ); |
1742 |
ToFile( "alias mkout", $mkout, "a" ); |
1749 |
ToFile( "alias deliver", $deliver, "a" ); |
1743 |
ToFile( "alias deliver", $deliver, "a" ); |
1750 |
ToFile( "alias build", $build, "a" ); |
1744 |
ToFile( "alias build", $build, "a" ); |
Lines 1769-1774
Link Here
|
1769 |
{ print OUT_SH "export $exportvars $newline"; |
1763 |
{ print OUT_SH "export $exportvars $newline"; |
1770 |
print OUT_SH "unset $unsetvarssh $newline"; |
1764 |
print OUT_SH "unset $unsetvarssh $newline"; |
1771 |
} |
1765 |
} |
|
|
1766 |
if(defined($outfile_bat)) |
1767 |
{ print OUT_BAT $unsetvarsbat; |
1768 |
} |
1772 |
|
1769 |
|
1773 |
# |
1770 |
# |
1774 |
#--------------------------- |
1771 |
#--------------------------- |
Lines 1779-1784
Link Here
|
1779 |
if( defined($outfile_sh)) |
1776 |
if( defined($outfile_sh)) |
1780 |
{ close( OUT_SH ) || print "Can't close $outfile_sh: $!"; |
1777 |
{ close( OUT_SH ) || print "Can't close $outfile_sh: $!"; |
1781 |
} |
1778 |
} |
|
|
1779 |
if( defined($outfile_bat)) |
1780 |
{ close( OUT_BAT ) || print "Can't close $outfile_bat: $!"; |
1781 |
} |
1782 |
# |
1782 |
# |
1783 |
#------------------------------ |
1783 |
#------------------------------ |
1784 |
# IX. Sourcing the output file. |
1784 |
# IX. Sourcing the output file. |
Lines 1828-1833
Link Here
|
1828 |
{ `mv -f $outfile_sh $tmp`; |
1828 |
{ `mv -f $outfile_sh $tmp`; |
1829 |
} |
1829 |
} |
1830 |
} |
1830 |
} |
|
|
1831 |
if(defined($outfile_bat)) |
1832 |
{ |
1833 |
$tmp = $SRC_ROOT.$ds.$outfile_bat; |
1834 |
if (rename( $outfile_bat, $tmp ) ne 1) |
1835 |
{ `mv -f $outfile_bat $tmp`; |
1836 |
} |
1837 |
} |
1838 |
|
1831 |
# |
1839 |
# |
1832 |
#-------------------------------------------------------- |
1840 |
#-------------------------------------------------------- |
1833 |
# XII. Message at the end. |
1841 |
# XII. Message at the end. |
Lines 1865-1873
Link Here
|
1865 |
$bootfile = "bootstrap"; |
1873 |
$bootfile = "bootstrap"; |
1866 |
open( OUT, ">$bootfile" ) || |
1874 |
open( OUT, ">$bootfile" ) || |
1867 |
die "Cannot open $bootfile: $!\n"; |
1875 |
die "Cannot open $bootfile: $!\n"; |
1868 |
if (( $platform ne "$Winnt" ) or ( $USE_SHELL ne "4nt" )) |
1876 |
if ( $USE_SHELL eq "4nt" ) |
1869 |
{ print OUT "#!$SHELL\n"; |
1877 |
{ $SHELL="tcsh"; |
1870 |
} |
1878 |
} |
|
|
1879 |
print OUT "#!$SHELL\n"; |
1871 |
close( OUT ) || print "Can't close $bootfile: $!"; |
1880 |
close( OUT ) || print "Can't close $bootfile: $!"; |
1872 |
open( OUT, ">>$bootfile" ) || |
1881 |
open( OUT, ">>$bootfile" ) || |
1873 |
die "Cannot open $bootfile: $!\n"; |
1882 |
die "Cannot open $bootfile: $!\n"; |
Lines 1969-1980
Link Here
|
1969 |
# 2. UPD (string) |
1978 |
# 2. UPD (string) |
1970 |
# 3. Platform (string) |
1979 |
# 3. Platform (string) |
1971 |
# 4. name of shell for this file |
1980 |
# 4. name of shell for this file |
|
|
1981 |
# 5. comment to use for this file |
1972 |
# Return value: void |
1982 |
# Return value: void |
1973 |
#------------------------------------------------------------ |
1983 |
#------------------------------------------------------------ |
1974 |
sub CreateFileHeader |
1984 |
sub CreateFileHeader |
1975 |
{ my $timestamp = `date`; |
1985 |
{ my $timestamp = `date`; |
1976 |
chomp( $timestamp ); |
1986 |
chomp( $timestamp ); |
1977 |
my $filehandle = $_[0]; |
1987 |
my $filehandle = $_[0]; |
|
|
1988 |
my $comment = $_[4]; |
1978 |
print { $filehandle } "$comment #################################################################"; |
1989 |
print { $filehandle } "$comment #################################################################"; |
1979 |
print { $filehandle } $newline; |
1990 |
print { $filehandle } $newline; |
1980 |
print { $filehandle } "$comment OpenOffice.org $_[ 1 ] build environment file for: $_[ 2 ]. $newline"; |
1991 |
print { $filehandle } "$comment OpenOffice.org $_[ 1 ] build environment file for: $_[ 2 ]. $newline"; |
Lines 1999-2040
Link Here
|
1999 |
{ # Write an environment variable to file. |
2010 |
{ # Write an environment variable to file. |
2000 |
if (defined $_[ 1 ]) |
2011 |
if (defined $_[ 1 ]) |
2001 |
{ printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", $_[ 1 ]) ; # to stdout |
2012 |
{ printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", $_[ 1 ]) ; # to stdout |
2002 |
if (( $platform ne "$Winnt" ) or ( $USE_SHELL ne "4nt" )) |
2013 |
print OUT "$setenv $_[ 0 ] \"$_[ 1 ]\"$newline"; # to tcsh file |
2003 |
{ |
2014 |
if(defined($outfile_sh)) |
2004 |
print OUT "$setenv $_[ 0 ] \"$_[ 1 ]\"$newline"; # to tcsh file |
2015 |
{ print OUT_SH "$_[ 0 ]=\"$_[ 1 ]\"$newline"; # to sh file |
2005 |
if(defined($outfile_sh)) |
2016 |
$exportvars .= " $_[ 0 ]"; # add to export list for sh file |
2006 |
{ print OUT_SH "$_[ 0 ]=\"$_[ 1 ]\"$newline"; # to sh file |
|
|
2007 |
$exportvars .= " $_[ 0 ]"; # add to export list for sh file |
2008 |
} |
2009 |
} |
2017 |
} |
2010 |
else |
2018 |
if(defined($outfile_bat)) |
2011 |
{ $win_format_var = WinFormat( $_[ 1 ] ); #Filter for Windows |
2019 |
{ $win_format_var = WinFormat( $_[ 1 ] ); #Filter for Windows |
2012 |
print OUT "IF DEFINED $_[ 0 ] $unset $_[ 0 ] $newline"; |
2020 |
print OUT_BAT "IF DEFINED $_[ 0 ] $unset $_[ 0 ] $newline"; |
2013 |
print OUT "$set $_[ 0 ]=$win_format_var $newline"; |
2021 |
print OUT_BAT "$set $_[ 0 ]=$win_format_var $newline"; |
2014 |
} |
2022 |
} |
2015 |
} |
2023 |
} |
2016 |
else |
2024 |
else |
2017 |
{ printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", "unset") ; # to stdout |
2025 |
{ printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", "unset") ; # to stdout |
2018 |
if (( $platform ne "$Winnt" ) or ( $USE_SHELL ne "4nt" )) |
2026 |
$unsetvars .= "$unsetenv $_[ 0 ] >& /dev/null$newline"; # for tcsh file |
2019 |
{ |
2027 |
$unsetvarssh .= " $_[ 0 ]"; # for sh file |
2020 |
$unsetvars .= "$unsetenv $_[ 0 ] >& /dev/null$newline"; # for tcsh file |
2028 |
if(defined($outfile_bat)) |
2021 |
$unsetvarssh .= " $_[ 0 ]"; # for sh file |
2029 |
{ $unsetvarsbat .= "$unset $_[ 0 ] >& NUL$newline"; |
2022 |
} |
|
|
2023 |
else |
2024 |
{ $unsetvars .= "$unset $_[ 0 ] >& NUL$newline"; |
2025 |
} |
2030 |
} |
2026 |
} |
2031 |
} |
2027 |
} |
2032 |
} |
2028 |
elsif ( $_[ 2 ] eq "a" ) |
2033 |
elsif ( $_[ 2 ] eq "a" ) |
2029 |
{ # Write an alias to file. |
2034 |
{ # Write an alias to file. |
2030 |
print "The $_[ 0 ] is set to: $_[ 1 ]\n"; # to stdout |
2035 |
print "The $_[ 0 ] is set to: $_[ 1 ]\n"; # to stdout |
2031 |
if (( $platform ne "$Winnt" ) or ( $USE_SHELL ne "4nt" )) |
2036 |
print OUT "$_[ 0 ] $_[ 1 ] $newline"; # to tcsh file |
2032 |
{ |
2037 |
print OUT_SH "$_[ 0 ]=$_[ 1 ] $newline" if defined($outfile_sh); # to sh file |
2033 |
print OUT "$_[ 0 ] $_[ 1 ] $newline"; # to tcsh file |
2038 |
if(defined($outfile_bat)) # create the correct 4nt alias format |
2034 |
print OUT_SH "$_[ 0 ]=$_[ 1 ] $newline" if defined($outfile_sh); # to sh file |
2039 |
{ my $aliastmp = $_[ 1 ]; |
2035 |
} |
2040 |
$aliastmp =~ s/\$/\%/g; |
2036 |
else |
2041 |
$aliastmp =~ s!/!\\!g; |
2037 |
{ print OUT "$_[ 0 ]=$_[ 1 ] $newline"; |
2042 |
$aliastmp =~ s!"!!g; |
|
|
2043 |
print OUT_BAT "$_[ 0 ]=".'`'.$aliastmp.'`'.$newline; |
2038 |
} |
2044 |
} |
2039 |
} |
2045 |
} |
2040 |
elsif ( $_[ 2 ] eq "c" ) |
2046 |
elsif ( $_[ 2 ] eq "c" ) |
Lines 2055-2086
Link Here
|
2055 |
print OUT_SH "$comment $_[ 0 ] $newline"; |
2061 |
print OUT_SH "$comment $_[ 0 ] $newline"; |
2056 |
print OUT_SH "$comment $newline"; |
2062 |
print OUT_SH "$comment $newline"; |
2057 |
} |
2063 |
} |
|
|
2064 |
if(defined($outfile_bat)) |
2065 |
{ |
2066 |
print OUT_BAT "$newline"; |
2067 |
print OUT_BAT "$comment4nt $newline"; |
2068 |
print OUT_BAT "$comment4nt $_[ 0 ] $newline"; |
2069 |
print OUT_BAT "$comment4nt $newline"; |
2070 |
} |
2058 |
} |
2071 |
} |
2059 |
elsif ( $_[ 2 ] eq "n" ) |
2072 |
elsif ( $_[ 2 ] eq "n" ) |
2060 |
{ #Write a newline to a file |
2073 |
{ #Write a newline to a file |
2061 |
print OUT "$newline"; |
2074 |
print OUT "$newline"; |
2062 |
print OUT_SH "$newline" if defined($outfile_sh); |
2075 |
print OUT_SH "$newline" if defined($outfile_sh); |
|
|
2076 |
print OUT_BAT "$newline" if defined($outfile_bat); |
2063 |
} |
2077 |
} |
2064 |
elsif ( $_[ 2 ] eq "x" ) |
2078 |
elsif ( $_[ 2 ] eq "x" ) |
2065 |
{ |
2079 |
{ |
2066 |
#Write first argument as is, and nothing else |
2080 |
#Write first argument as is, and nothing else |
2067 |
print OUT "$_[ 0 ] $newline"; |
2081 |
#Only useful for 4nt |
|
|
2082 |
print OUT_BAT "$_[ 0 ] $newline" if defined($outfile_bat); |
2068 |
} |
2083 |
} |
2069 |
elsif ( $_[ 2 ] eq "j" ) |
2084 |
elsif ( $_[ 2 ] eq "j" ) |
2070 |
{ |
2085 |
{ |
2071 |
if ((defined $_[ 1 ]) and ( $platform eq "$Winnt" )) |
2086 |
if ((defined $_[ 1 ]) and ( $platform eq "$Winnt" )) |
2072 |
{ printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", $_[ 1 ]) ; # to stdout |
2087 |
{ printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", $_[ 1 ]) ; # to stdout |
2073 |
if ( $USE_SHELL ne "4nt" ) |
2088 |
$win_format_var = WinFormat( $_[ 1 ] ); #Filter for Windows |
2074 |
{ |
2089 |
$win_format_var =~ s/\\/\\\\/g; |
2075 |
$win_format_var = WinFormat( $_[ 1 ] ); #Filter for Windows |
2090 |
print OUT "$setenv $_[ 0 ] \"$win_format_var\" $newline"; |
2076 |
$win_format_var =~ s/\\/\\\\/g; |
2091 |
if (defined($outfile_bat)) |
2077 |
print OUT "$setenv $_[ 0 ] \"$win_format_var\" $newline"; |
|
|
2078 |
} |
2079 |
else |
2080 |
{ |
2092 |
{ |
2081 |
$win_format_var = WinFormat( $_[ 1 ] ); #Filter for Windows |
2093 |
$win_format_var = WinFormat( $_[ 1 ] ); #Filter for Windows |
2082 |
print OUT "IF DEFINED $_[ 0 ] $unset $_[ 0 ] $newline"; |
2094 |
print OUT_BAT "IF DEFINED $_[ 0 ] $unset $_[ 0 ] $newline"; |
2083 |
print OUT "$set $_[ 0 ]=$win_format_var $newline"; |
2095 |
print OUT_BAT "$set $_[ 0 ]=$win_format_var $newline"; |
2084 |
} |
2096 |
} |
2085 |
} |
2097 |
} |
2086 |
else |
2098 |
else |