Index: set_soenv.1 =================================================================== RCS file: /cvs/tools/config_office/set_soenv.1,v retrieving revision 1.70 diff -c -r1.70 set_soenv.1 *** set_soenv.1 13 Jun 2002 14:56:32 -0000 1.70 --- set_soenv.1 25 Jun 2002 10:07:31 -0000 *************** *** 503,509 **** } elsif ( $platform eq "$Winnt" ) { ! $COMPATH = $ARGV[ 0 ]; $CPUNAME = "INTEL"; $CPU = "I"; $GUI = "WNT"; --- 503,509 ---- } elsif ( $platform eq "$Winnt" ) { ! $COMPATH = PosixFormat($ARGV[ 0 ]); $CPUNAME = "INTEL"; $CPU = "I"; $GUI = "WNT"; *************** *** 627,638 **** } else { # JAVA_HOME as argument from autoconf. ! $JAVA_HOME = $ARGV[ 3 ]; } # Restore white spaces in Windows pathnames. if ( $platform eq "$Winnt") { $JAVA_HOME =~ s/#/ /g; ! } # 3. Tcsh path. # Check whether autoconf found the Tcsh path. if ( $ARGV[ 4 ] eq $no_tcsh and $USE_SHELL eq "tcsh" ) --- 627,639 ---- } else { # JAVA_HOME as argument from autoconf. ! $JAVA_HOME = PosixFormat($ARGV[ 3 ]) ; } # Restore white spaces in Windows pathnames. if ( $platform eq "$Winnt") { $JAVA_HOME =~ s/#/ /g; ! $JAVA_HOME =~ s/[\s\/]+$//; # remove trailing \n or \/ if there is any. ! } # 3. Tcsh path. # Check whether autoconf found the Tcsh path. if ( $ARGV[ 4 ] eq $no_tcsh and $USE_SHELL eq "tcsh" ) *************** *** 672,678 **** CheckPathExist( $ASM_PATH ); } else ! { $ASM_PATH = $ARGV[ 15 ]; } } # unzip.exe path for Windows users. --- 673,679 ---- CheckPathExist( $ASM_PATH ); } else ! { $ASM_PATH = PosixFormat($ARGV[ 15 ]); } } # unzip.exe path for Windows users. *************** *** 683,689 **** CheckPathExist( $UNZIP_PATH ); } else ! { $UNZIP_PATH = $ARGV[ 16 ]; } } --- 684,690 ---- CheckPathExist( $UNZIP_PATH ); } else ! { $UNZIP_PATH = PosixFormat($ARGV[ 16 ]); } } *************** *** 753,759 **** } else { # GCC_INCLUDE as argument from autoconf. ! $GCC_INCLUDE = $ARGV[ 1 ]; } # 6. G++ include directory. # Check whether autoconf found the g++ 2.95.2 include directory. --- 754,760 ---- } else { # GCC_INCLUDE as argument from autoconf. ! $GCC_INCLUDE = PosixFormat($ARGV[ 1 ]); } # 6. G++ include directory. # Check whether autoconf found the g++ 2.95.2 include directory. *************** *** 769,775 **** } else { # GXX_INCLUDE as argument from autoconf. ! $GXX_INCLUDE = $ARGV[ 2 ]; } } } --- 770,776 ---- } else { # GXX_INCLUDE as argument from autoconf. ! $GXX_INCLUDE = PosixFormat($ARGV[ 2 ]); } } } *************** *** 821,828 **** } # Import SystemDrive enviroment variable use Env qw(SYSTEMDRIVE); use Env qw(SYSTEMROOT); ! $CYGWIN = $ARGV[ 11 ]; # Windows bash path $CYGWIN =~ s/#/ /g; # Replace white spaces $WIN_GREP = '$CYGWIN'.$ds."grep.exe"; $WIN_FIND = '$CYGWIN'.$ds."find.exe"; --- 822,831 ---- } # Import SystemDrive enviroment variable use Env qw(SYSTEMDRIVE); + # Change $SYSTEMDRIVE to lower case. + $SYSTEMDRIVE = lc $SYSTEMDRIVE; use Env qw(SYSTEMROOT); ! $CYGWIN = PosixFormat($ARGV[ 11 ]); # Windows bash path $CYGWIN =~ s/#/ /g; # Replace white spaces $WIN_GREP = '$CYGWIN'.$ds."grep.exe"; $WIN_FIND = '$CYGWIN'.$ds."find.exe"; *************** *** 836,844 **** $JAVA_BIN = $JAVA_HOME.$BIN; $JAVA_INCLUDE = $JAVA_HOME.$ds."include"; } ! $PERL_PATH = $ARGV[ 5 ]; # Perl Path ! $XLIB = $ARGV[ 6 ]; # X11 libraries ! $XINC = $ARGV[ 7 ]; # X11 includes # Macosx only variables. --- 839,847 ---- $JAVA_BIN = $JAVA_HOME.$BIN; $JAVA_INCLUDE = $JAVA_HOME.$ds."include"; } ! $PERL_PATH = PosixFormat($ARGV[ 5 ]); # Perl Path ! $XLIB = PosixFormat($ARGV[ 6 ]); # X11 libraries ! $XINC = PosixFormat($ARGV[ 7 ]); # X11 includes # Macosx only variables. *************** *** 868,874 **** { $SOLARENV = $SRC_ROOT.$SOLENV; } else ! { $SOLARENV = $ARGV[ 8 ]; # Restore white spaces in Windows pathnames if ( $platform eq "$Winnt") { $SOLARENV =~ s/#/ /g; --- 871,877 ---- { $SOLARENV = $SRC_ROOT.$SOLENV; } else ! { $SOLARENV = PosixFormat($ARGV[ 8 ]); # Restore white spaces in Windows pathnames if ( $platform eq "$Winnt") { $SOLARENV =~ s/#/ /g; *************** *** 879,885 **** { $SOLARVER = $SRC_ROOT.$SOLVER; } else ! { $SOLARVER = $ARGV[ 9 ]; # Restore white spaces in Windows pathnames if ( $platform eq "Winnt") { $SOLARVER =~ s/#/ /g; --- 882,888 ---- { $SOLARVER = $SRC_ROOT.$SOLVER; } else ! { $SOLARVER = PosixFormat($ARGV[ 9 ]); # Restore white spaces in Windows pathnames if ( $platform eq "Winnt") { $SOLARVER =~ s/#/ /g; *************** *** 1061,1066 **** --- 1064,1070 ---- # Restore white spaces in Windows pathnames. $PERL_PATH =~ s/#/ /g; + $PERL_PATH =~ s/[\/\s]+$//; # Remove trailing / and spaces $PERL = $PERL_PATH.$ds."perl.exe"; $WIN_HOME = " "; *************** *** 1113,1129 **** { my ( $noldPATH ); $noldPATH = $oldPATH; ! ! # convert path to posix if using native perl ! if ( ! $perl_os =~ /cygwin/ and $USE_SHELL eq "4nt" ) ! { ! $noldPATH =~ s#(\w):#/cygdrive/$1#g; ! $noldPATH =~ s/\\/\//g; ! $noldPATH =~ s/;/:/g; ! } ! $COMPATH_ROOT = $COMPATH; ! $COMPATH_ROOT =~ s/\/vc98$//; $PATH = $cur_dir. $ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$BIN. --- 1117,1128 ---- { my ( $noldPATH ); $noldPATH = $oldPATH; ! ! # convert path to posix if using native NT perl ! $noldPATH = PosixFormat($noldPATH); ! $COMPATH_ROOT = $COMPATH; ! $COMPATH_ROOT =~ s/\/vc98$//i; $PATH = $cur_dir. $ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$BIN. *************** *** 1147,1152 **** --- 1146,1157 ---- { $PATH .= $ps.'$COMPATH'.$BIN; } + # for MS-Visual Studio 6.0 to find mspdb60.dll (need by CL.EXE C/C++ Compiler) + # and rcdll.dll (need by RC.EXE -- 32 bit Resource Compiler) location. + if ( $noldPATH !~ /[^\/]*\b$COMPATH_ROOT\/Common\/MSDev98\/Bin\b[^\/]*/ ) + { + $PATH .= $ps.$COMPATH_ROOT.'/Common/MSDev98/Bin'; + } # Check if $PERL_PATH is already set in PATH if ( ! ( $noldPATH =~ /(?:[:]|\A)(?:$PERL_PATH)(?:[:]|\Z|$ds)/ ) ) *************** *** 1567,1579 **** if (( $platform eq "$Winnt" ) and ( $USE_SHELL eq "4nt" )) { my ($tempstring); $tempstring="perl ".WinFormat(${SOLARENV}.${BIN}.${ds}."deliver.pl"); - if ( $perl_os =~ /cygwin/ ) { $tempstring =~ s#\\#\\\\#g; } ToFile( "set DELIVER=$tempstring", $empty, "x" ); $tempstring="perl ".WinFormat(${SOLARENV}.${BIN}.${ds}."mkout.pl"); - if ( $perl_os =~ /cygwin/ ) { $tempstring =~ s#\\#\\\\#g; } ToFile( "set MKOUT=$tempstring", $empty, "x" ); $tempstring="perl ".WinFormat(${SOLARENV}.${BIN}.${ds}."zipdep.pl"); - if ( $perl_os =~ /cygwin/ ) { $tempstring =~ s#\\#\\\\#g; } ToFile( "set ZIPDEP=$tempstring", $empty, "x" ); } else { ToFile( "DELIVER", "deliver.pl", "e" ); --- 1572,1581 ---- *************** *** 1760,1770 **** { $retrn = $ds.$_[ 0 ]; } } ! # Check if the last character is a '/'. ! if ( $retrn =~ /\/$/ ) ! { chop( $retrn ); ! } ! # Replacing multiple occurences of /. # Done! return( $retrn ); } --- 1762,1769 ---- { $retrn = $ds.$_[ 0 ]; } } ! # kill the last '/','\','\n' if they exists. ! $retrn =~ s![\s/\\]+$!!; # Done! return( $retrn ); } *************** *** 1794,1801 **** } return "false"; } ! else ! { return "true"; } } #------------------------------------------------------------ --- 1793,1801 ---- } return "false"; } ! else ! { # Don't check under "$Winnt". The path is possibly posix and you could use a native NT perl! ! return "true"; } } #------------------------------------------------------------ *************** *** 1910,1915 **** --- 1910,1940 ---- } } #---------------------------------------------------------- + # Function name: PosixFormat + # Description: Format variables to Posix Style Format. Should only be used + # with DOS-style path variables + # Arguments: 1. Variable (string) + # Return value: Reformatted String + #---------------------------------------------------------- + sub PosixFormat + { my ( $variable ); + $variable = $_[ 0 ]; + # ToDo: Do the replacement only if "Winnt" and var contains "\" and ":" + if ( $platform eq "$Winnt" ) + { $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables + $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables twice! + if ( ( $variable =~ /\\/ ) and ( $variable =~ /:/ ) ) + { $variable =~ s{([c-z]):}{/cygdrive/$1}gi; + # Map drives to /cgydrive/drive + # We do this also for old cygwins, back + # replacement in winformat. + } + $variable =~ s!\\!/!g; + $variable =~ s/;/:/g; + } + return $variable; + } + #---------------------------------------------------------- # Function name: WinFormat # Description: Format variables to Windows Format. # Arguments: 1. Variable (string) *************** *** 1920,1942 **** $variable = $_[ 0 ]; $variable =~ s/^"//; $variable =~ s/"$//; if ( $cygwinver eq "b" ) ! { $variable =~ s/\//\\/g; ! $variable =~ s/\$/%/g; ! $variable =~ s/:/;/g; ! $variable =~ s/^\\\\(\w)\\/$1:\\/g; ! $variable =~ s/^\\/$SYSTEMDRIVE\\/; ! $variable =~ s/;\\/;$SYSTEMDRIVE\\/g; } ! else { - $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables - $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables twice! - $variable =~ s/\$\{PATH\}/%PATH/g ; # explicit replace ${PATH} - $variable =~ s/\\/\//g; $variable =~ s/:/;/g; ! $variable =~ s/([;]|\A|-[iIlL])(\w);/$1$2:/g; # get back the drives ! # Search for posix path ;entry; and replace with cygpath -w entry if ( $variable =~ /^\s+-\w/ ) { # Include paths --- 1945,1977 ---- $variable = $_[ 0 ]; $variable =~ s/^"//; $variable =~ s/"$//; + # Here should be NO "\"! If yes, PosixFormat() was forgotten before ! + if ( $variable =~ /\\/ ) + { + die("Error! Variable contains \"\\\" : $variable PosixFormat() missing?"); + } + $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables + $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables twice! + $variable =~ s/\$\{PATH\}/%PATH/g ; # explicit replace ${PATH} + $variable =~ s/:+/:/g ; # remove multiple ; + if ( $cygwinver eq "b" ) ! { ! $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables ! $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables twice! ! $variable =~ s/\$\{PATH\}/%PATH/g ; # explicit replace ${PATH} ! $variable =~ s/:/;/g; # Change path-separator ! $variable =~ s{//([c-z])/}{$1:\\}gi; # drives from cgywin-b20 (just in case ...) ! $variable =~ s{/cygdrive/([c-z])/}{$1:\\}gi; # more drives for cgywin-b20 ! $variable =~ s!([;]|\A|-[iIlL])/!$1$SYSTEMDRIVE/!g; # get back the hidden drives ! $variable =~ s!/!\\!g; # Rest is windows stuff } ! else # New cygwin { $variable =~ s/:/;/g; ! # $variable =~ s/([;]|\A|-[iIlL])(\w);/$1$2:/g; # get back the drives ! $variable =~ s{/cygdrive/([c-z])/}{$1:\\}gi; # more drives cgywin style ! # Search for posix path entry and replace with cygpath -w entry if ( $variable =~ /^\s+-\w/ ) { # Include paths *************** *** 1966,1977 **** } } $variable = join(';',@split_var); - } - $variable =~ s/\//\\/g; # Remaining \ come from e.g.: ../foo/baa } ! return $variable; } #---------------------------------------------------------- # Function name: CheckBuildEnv --- 2001,2010 ---- } } $variable = join(';',@split_var); } $variable =~ s/\//\\/g; # Remaining \ come from e.g.: ../foo/baa } ! return $variable; } #---------------------------------------------------------- # Function name: CheckBuildEnv