View | Details | Raw Unified | Return to issue 11861
Collapse All | Expand All

(-)config_office/set_soenv.in (-54 / +74 lines)
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 1351-1364 Link Here
1351
   die "Cannot open $outfile_sh: $!\n";
1350
   die "Cannot open $outfile_sh: $!\n";
1352
}
1351
}
1353
1352
1353
if(defined($outfile_bat))
1354
{  # Create bat environment file
1355
   open( OUT_BAT, ">$outfile_bat" ) ||
1356
   die "Cannot open $outfile_bat: $!\n";
1357
}
1358
1354
#
1359
#
1355
#------------------------------------------
1360
#------------------------------------------
1356
# VII. Writing the data to the output file.
1361
# VII. Writing the data to the output file.
1357
#------------------------------------------
1362
#------------------------------------------
1358
#
1363
#
1359
# Write file header.
1364
# Write file header.
1360
CreateFileHeader( *OUT, $UPD, $platform, "(t)csh" );
1365
CreateFileHeader( *OUT, $UPD, $platform, "(t)csh", "#" );
1361
CreateFileHeader( *OUT_SH, $UPD, $platform, "sh/bash/ksh" ) if defined($outfile_sh);
1366
CreateFileHeader( *OUT_SH, $UPD, $platform, "sh/bash/ksh", "#" ) if defined($outfile_sh);
1367
CreateFileHeader( *OUT_BAT, $UPD, $platform, "4nt", "rem" ) if defined($outfile_bat);
1362
#
1368
#
1363
# Writing the platform independent constant values to file.
1369
# Writing the platform independent constant values to file.
1364
# (c = comment, e = environment variable, a = alias )
1370
# (c = comment, e = environment variable, a = alias )
Lines 1769-1774 Link Here
1769
{  print OUT_SH "export $exportvars $newline";
1775
{  print OUT_SH "export $exportvars $newline";
1770
   print OUT_SH "unset $unsetvarssh $newline";
1776
   print OUT_SH "unset $unsetvarssh $newline";
1771
}
1777
}
1778
if(defined($outfile_bat))
1779
{  print OUT_BAT $unsetvarsbat;
1780
}
1772
1781
1773
#
1782
#
1774
#---------------------------
1783
#---------------------------
Lines 1779-1784 Link Here
1779
if( defined($outfile_sh))
1788
if( defined($outfile_sh))
1780
{  close( OUT_SH ) || print "Can't close $outfile_sh: $!";
1789
{  close( OUT_SH ) || print "Can't close $outfile_sh: $!";
1781
}
1790
}
1791
if( defined($outfile_bat))
1792
{  close( OUT_BAT ) || print "Can't close $outfile_bat: $!";
1793
}
1782
#
1794
#
1783
#------------------------------
1795
#------------------------------
1784
# IX. Sourcing the output file.
1796
# IX. Sourcing the output file.
Lines 1828-1833 Link Here
1828
    {  `mv -f $outfile_sh $tmp`;
1840
    {  `mv -f $outfile_sh $tmp`;
1829
    }
1841
    }
1830
}
1842
}
1843
if(defined($outfile_bat))
1844
{
1845
    $tmp = $SRC_ROOT.$ds.$outfile_bat;
1846
    if (rename( $outfile_bat, $tmp ) ne 1)
1847
    {  `mv -f $outfile_bat $tmp`;
1848
    }
1849
}
1850
1831
#
1851
#
1832
#--------------------------------------------------------
1852
#--------------------------------------------------------
1833
# XII. Message at the end.
1853
# XII. Message at the end.
Lines 1865-1873 Link Here
1865
$bootfile = "bootstrap";
1885
$bootfile = "bootstrap";
1866
open( OUT, ">$bootfile" ) ||
1886
open( OUT, ">$bootfile" ) ||
1867
die "Cannot open $bootfile: $!\n";
1887
die "Cannot open $bootfile: $!\n";
1868
if (( $platform ne "$Winnt" ) or ( $USE_SHELL ne "4nt" ))
1888
if ( $USE_SHELL eq "4nt" )
1869
{  print OUT "#!$SHELL\n";
1889
{  $SHELL="tcsh";
1870
}
1890
}
1891
print OUT "#!$SHELL\n";
1871
close( OUT ) || print "Can't close $bootfile: $!";
1892
close( OUT ) || print "Can't close $bootfile: $!";
1872
open( OUT, ">>$bootfile" ) ||
1893
open( OUT, ">>$bootfile" ) ||
1873
   die "Cannot open $bootfile: $!\n";
1894
   die "Cannot open $bootfile: $!\n";
Lines 1969-1980 Link Here
1969
#                2. UPD (string)
1990
#                2. UPD (string)
1970
#                3. Platform (string)
1991
#                3. Platform (string)
1971
#                4. name of shell for this file
1992
#                4. name of shell for this file
1993
#                5. comment to use for this file
1972
# Return value:  void
1994
# Return value:  void
1973
#------------------------------------------------------------
1995
#------------------------------------------------------------
1974
sub CreateFileHeader 
1996
sub CreateFileHeader 
1975
{  my $timestamp = `date`;
1997
{  my $timestamp = `date`;
1976
   chomp( $timestamp );
1998
   chomp( $timestamp );
1977
   my $filehandle = $_[0];
1999
   my $filehandle = $_[0];
2000
   my $comment = $_[4];
1978
   print { $filehandle } "$comment #################################################################"; 
2001
   print { $filehandle } "$comment #################################################################"; 
1979
   print { $filehandle } $newline;
2002
   print { $filehandle } $newline;
1980
   print { $filehandle } "$comment OpenOffice.org $_[ 1 ] build environment file for: $_[ 2 ]. $newline"; 
2003
   print { $filehandle } "$comment OpenOffice.org $_[ 1 ] build environment file for: $_[ 2 ]. $newline"; 
Lines 1999-2040 Link Here
1999
   {  # Write an environment variable to file.
2022
   {  # Write an environment variable to file.
2000
      if (defined $_[ 1 ])
2023
      if (defined $_[ 1 ])
2001
      {  printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", $_[ 1 ]) ; # to stdout
2024
      {  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" ))
2025
         print OUT "$setenv $_[ 0 ] \"$_[ 1 ]\"$newline";          # to tcsh file
2003
         {   
2026
         if(defined($outfile_sh))
2004
             print OUT "$setenv $_[ 0 ] \"$_[ 1 ]\"$newline";          # to tcsh file
2027
         {  print OUT_SH "$_[ 0 ]=\"$_[ 1 ]\"$newline";            # to sh file
2005
             if(defined($outfile_sh))
2028
            $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
         }
2029
         }
2010
         else
2030
         if(defined($outfile_bat))
2011
         {   $win_format_var = WinFormat( $_[ 1 ] );  #Filter for Windows
2031
         {   $win_format_var = WinFormat( $_[ 1 ] );  #Filter for Windows
2012
             print OUT "IF DEFINED $_[ 0 ] $unset $_[ 0 ] $newline";
2032
             print OUT_BAT "IF DEFINED $_[ 0 ] $unset $_[ 0 ] $newline";
2013
             print OUT "$set $_[ 0 ]=$win_format_var $newline";
2033
             print OUT_BAT "$set $_[ 0 ]=$win_format_var $newline";
2014
         }
2034
         }
2015
      }
2035
      }
2016
      else
2036
      else
2017
      {  printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", "unset") ; # to stdout
2037
      {  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" ))
2038
         $unsetvars .= "$unsetenv $_[ 0 ] >& /dev/null$newline";            # for tcsh file
2019
         {  
2039
         $unsetvarssh .= " $_[ 0 ]";                                        # for sh file
2020
            $unsetvars .= "$unsetenv $_[ 0 ] >& /dev/null$newline";            # for tcsh file
2040
         if(defined($outfile_bat))
2021
            $unsetvarssh .= " $_[ 0 ]";                                        # for sh file
2041
         {  $unsetvarsbat .= "$unset $_[ 0 ] >& NUL$newline";
2022
         }
2023
         else
2024
         {  $unsetvars .= "$unset $_[ 0 ] >& NUL$newline";
2025
         }
2042
         }
2026
      }
2043
      }
2027
   }
2044
   }
2028
   elsif ( $_[ 2 ] eq "a" ) 
2045
   elsif ( $_[ 2 ] eq "a" ) 
2029
   {  # Write an alias to file.
2046
   {  # Write an alias to file.
2030
      print "The $_[ 0 ] is set to: $_[ 1 ]\n";     # to stdout
2047
      print "The $_[ 0 ] is set to: $_[ 1 ]\n";     # to stdout
2031
      if (( $platform ne "$Winnt" ) or ( $USE_SHELL ne "4nt" ))
2048
      print OUT "$_[ 0 ] $_[ 1 ] $newline" if !defined($outfile_bat);  # to tcsh file (only if no 4nt build)
2032
      {  
2049
      print OUT_SH "$_[ 0 ]=$_[ 1 ] $newline" if defined($outfile_sh); # to sh file
2033
         print OUT "$_[ 0 ] $_[ 1 ] $newline";                            # to tcsh file
2050
      if(defined($outfile_bat))
2034
         print OUT_SH "$_[ 0 ]=$_[ 1 ] $newline" if defined($outfile_sh); # to sh file
2051
      {  print OUT_BAT "$_[ 0 ]=$_[ 1 ] $newline";
2035
      }
2036
      else
2037
      {  print OUT "$_[ 0 ]=$_[ 1 ] $newline";
2038
      }
2052
      }
2039
   }
2053
   }
2040
   elsif ( $_[ 2 ] eq "c" ) 
2054
   elsif ( $_[ 2 ] eq "c" ) 
Lines 2055-2086 Link Here
2055
          print OUT_SH "$comment $_[ 0 ] $newline"; 
2069
          print OUT_SH "$comment $_[ 0 ] $newline"; 
2056
          print OUT_SH "$comment $newline";     
2070
          print OUT_SH "$comment $newline";     
2057
      }
2071
      }
2072
      if(defined($outfile_bat))
2073
      {
2074
          print OUT_BAT "$newline";
2075
          print OUT_BAT "$comment4nt $newline";
2076
          print OUT_BAT "$comment4nt $_[ 0 ] $newline"; 
2077
          print OUT_BAT "$comment4nt $newline";     
2078
      }
2058
   }
2079
   }
2059
   elsif ( $_[ 2 ] eq "n" ) 
2080
   elsif ( $_[ 2 ] eq "n" ) 
2060
   {  #Write a newline to a file
2081
   {  #Write a newline to a file
2061
      print OUT "$newline";
2082
      print OUT "$newline";
2062
      print OUT_SH "$newline" if defined($outfile_sh);
2083
      print OUT_SH "$newline" if defined($outfile_sh);
2084
      print OUT_BAT "$newline" if defined($outfile_bat);
2063
   }
2085
   }
2064
   elsif ( $_[ 2 ] eq "x" )
2086
   elsif ( $_[ 2 ] eq "x" )
2065
   {
2087
   {
2066
      #Write first argument as is, and nothing else
2088
      #Write first argument as is, and nothing else
2067
      print OUT "$_[ 0 ] $newline";
2089
      #Only useful for 4nt
2090
      print OUT_BAT "$_[ 0 ] $newline" if defined($outfile_bat);
2068
   }
2091
   }
2069
   elsif ( $_[ 2 ] eq "j" )
2092
   elsif ( $_[ 2 ] eq "j" )
2070
   {
2093
   {
2071
      if ((defined $_[ 1 ]) and ( $platform eq "$Winnt" )) 
2094
      if ((defined $_[ 1 ]) and ( $platform eq "$Winnt" )) 
2072
      {  printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", $_[ 1 ]) ; # to stdout
2095
      {  printf("%-12s %-17s %-10s %-39s\n", "The variable", $_[ 0 ], "is set to:", $_[ 1 ]) ; # to stdout
2073
         if ( $USE_SHELL ne "4nt" )
2096
         $win_format_var = WinFormat( $_[ 1 ] );  #Filter for Windows
2074
         {
2097
         $win_format_var =~ s/\\/\\\\/g;
2075
             $win_format_var = WinFormat( $_[ 1 ] );  #Filter for Windows
2098
         print OUT "$setenv $_[ 0 ] \"$win_format_var\" $newline";
2076
             $win_format_var =~ s/\\/\\\\/g;
2099
         if (defined($outfile_bat))
2077
             print OUT "$setenv $_[ 0 ] \"$win_format_var\" $newline";
2078
         }
2079
         else
2080
         {
2100
         {
2081
             $win_format_var = WinFormat( $_[ 1 ] );  #Filter for Windows
2101
             $win_format_var = WinFormat( $_[ 1 ] );  #Filter for Windows
2082
             print OUT "IF DEFINED $_[ 0 ] $unset $_[ 0 ] $newline";
2102
             print OUT_BAT "IF DEFINED $_[ 0 ] $unset $_[ 0 ] $newline";
2083
             print OUT "$set $_[ 0 ]=$win_format_var $newline";
2103
             print OUT_BAT "$set $_[ 0 ]=$win_format_var $newline";
2084
         }
2104
         }
2085
      }
2105
      }
2086
      else
2106
      else

Return to issue 11861