Lines 503-509
Link Here
|
503 |
} |
503 |
} |
504 |
elsif ( $platform eq "$Winnt" ) |
504 |
elsif ( $platform eq "$Winnt" ) |
505 |
{ |
505 |
{ |
506 |
$COMPATH = $ARGV[ 0 ]; |
506 |
$COMPATH = PosixFormat($ARGV[ 0 ]); |
507 |
$CPUNAME = "INTEL"; |
507 |
$CPUNAME = "INTEL"; |
508 |
$CPU = "I"; |
508 |
$CPU = "I"; |
509 |
$GUI = "WNT"; |
509 |
$GUI = "WNT"; |
Lines 627-638
Link Here
|
627 |
} |
627 |
} |
628 |
else |
628 |
else |
629 |
{ # JAVA_HOME as argument from autoconf. |
629 |
{ # JAVA_HOME as argument from autoconf. |
630 |
$JAVA_HOME = $ARGV[ 3 ]; |
630 |
$JAVA_HOME = PosixFormat($ARGV[ 3 ]) ; |
631 |
} |
631 |
} |
632 |
# Restore white spaces in Windows pathnames. |
632 |
# Restore white spaces in Windows pathnames. |
633 |
if ( $platform eq "$Winnt") |
633 |
if ( $platform eq "$Winnt") |
634 |
{ $JAVA_HOME =~ s/#/ /g; |
634 |
{ $JAVA_HOME =~ s/#/ /g; |
635 |
} |
635 |
$JAVA_HOME =~ s/[\s\/]+$//; # remove trailing \n or \/ if there is any. |
|
|
636 |
} |
636 |
# 3. Tcsh path. |
637 |
# 3. Tcsh path. |
637 |
# Check whether autoconf found the Tcsh path. |
638 |
# Check whether autoconf found the Tcsh path. |
638 |
if ( $ARGV[ 4 ] eq $no_tcsh and $USE_SHELL eq "tcsh" ) |
639 |
if ( $ARGV[ 4 ] eq $no_tcsh and $USE_SHELL eq "tcsh" ) |
Lines 672-678
Link Here
|
672 |
CheckPathExist( $ASM_PATH ); |
673 |
CheckPathExist( $ASM_PATH ); |
673 |
} |
674 |
} |
674 |
else |
675 |
else |
675 |
{ $ASM_PATH = $ARGV[ 15 ]; |
676 |
{ $ASM_PATH = PosixFormat($ARGV[ 15 ]); |
676 |
} |
677 |
} |
677 |
} |
678 |
} |
678 |
# unzip.exe path for Windows users. |
679 |
# unzip.exe path for Windows users. |
Lines 683-689
Link Here
|
683 |
CheckPathExist( $UNZIP_PATH ); |
684 |
CheckPathExist( $UNZIP_PATH ); |
684 |
} |
685 |
} |
685 |
else |
686 |
else |
686 |
{ $UNZIP_PATH = $ARGV[ 16 ]; |
687 |
{ $UNZIP_PATH = PosixFormat($ARGV[ 16 ]); |
687 |
} |
688 |
} |
688 |
|
689 |
|
689 |
} |
690 |
} |
Lines 753-759
Link Here
|
753 |
} |
754 |
} |
754 |
else |
755 |
else |
755 |
{ # GCC_INCLUDE as argument from autoconf. |
756 |
{ # GCC_INCLUDE as argument from autoconf. |
756 |
$GCC_INCLUDE = $ARGV[ 1 ]; |
757 |
$GCC_INCLUDE = PosixFormat($ARGV[ 1 ]); |
757 |
} |
758 |
} |
758 |
# 6. G++ include directory. |
759 |
# 6. G++ include directory. |
759 |
# Check whether autoconf found the g++ 2.95.2 include directory. |
760 |
# Check whether autoconf found the g++ 2.95.2 include directory. |
Lines 769-775
Link Here
|
769 |
} |
770 |
} |
770 |
else |
771 |
else |
771 |
{ # GXX_INCLUDE as argument from autoconf. |
772 |
{ # GXX_INCLUDE as argument from autoconf. |
772 |
$GXX_INCLUDE = $ARGV[ 2 ]; |
773 |
$GXX_INCLUDE = PosixFormat($ARGV[ 2 ]); |
773 |
} |
774 |
} |
774 |
} |
775 |
} |
775 |
} |
776 |
} |
Lines 821-828
Link Here
|
821 |
} |
822 |
} |
822 |
# Import SystemDrive enviroment variable |
823 |
# Import SystemDrive enviroment variable |
823 |
use Env qw(SYSTEMDRIVE); |
824 |
use Env qw(SYSTEMDRIVE); |
|
|
825 |
# Change $SYSTEMDRIVE to lower case. |
826 |
$SYSTEMDRIVE = lc $SYSTEMDRIVE; |
824 |
use Env qw(SYSTEMROOT); |
827 |
use Env qw(SYSTEMROOT); |
825 |
$CYGWIN = $ARGV[ 11 ]; # Windows bash path |
828 |
$CYGWIN = PosixFormat($ARGV[ 11 ]); # Windows bash path |
826 |
$CYGWIN =~ s/#/ /g; # Replace white spaces |
829 |
$CYGWIN =~ s/#/ /g; # Replace white spaces |
827 |
$WIN_GREP = '$CYGWIN'.$ds."grep.exe"; |
830 |
$WIN_GREP = '$CYGWIN'.$ds."grep.exe"; |
828 |
$WIN_FIND = '$CYGWIN'.$ds."find.exe"; |
831 |
$WIN_FIND = '$CYGWIN'.$ds."find.exe"; |
Lines 836-844
Link Here
|
836 |
$JAVA_BIN = $JAVA_HOME.$BIN; |
839 |
$JAVA_BIN = $JAVA_HOME.$BIN; |
837 |
$JAVA_INCLUDE = $JAVA_HOME.$ds."include"; |
840 |
$JAVA_INCLUDE = $JAVA_HOME.$ds."include"; |
838 |
} |
841 |
} |
839 |
$PERL_PATH = $ARGV[ 5 ]; # Perl Path |
842 |
$PERL_PATH = PosixFormat($ARGV[ 5 ]); # Perl Path |
840 |
$XLIB = $ARGV[ 6 ]; # X11 libraries |
843 |
$XLIB = PosixFormat($ARGV[ 6 ]); # X11 libraries |
841 |
$XINC = $ARGV[ 7 ]; # X11 includes |
844 |
$XINC = PosixFormat($ARGV[ 7 ]); # X11 includes |
842 |
|
845 |
|
843 |
|
846 |
|
844 |
# Macosx only variables. |
847 |
# Macosx only variables. |
Lines 868-874
Link Here
|
868 |
{ $SOLARENV = $SRC_ROOT.$SOLENV; |
871 |
{ $SOLARENV = $SRC_ROOT.$SOLENV; |
869 |
} |
872 |
} |
870 |
else |
873 |
else |
871 |
{ $SOLARENV = $ARGV[ 8 ]; |
874 |
{ $SOLARENV = PosixFormat($ARGV[ 8 ]); |
872 |
# Restore white spaces in Windows pathnames |
875 |
# Restore white spaces in Windows pathnames |
873 |
if ( $platform eq "$Winnt") |
876 |
if ( $platform eq "$Winnt") |
874 |
{ $SOLARENV =~ s/#/ /g; |
877 |
{ $SOLARENV =~ s/#/ /g; |
Lines 879-885
Link Here
|
879 |
{ $SOLARVER = $SRC_ROOT.$SOLVER; |
882 |
{ $SOLARVER = $SRC_ROOT.$SOLVER; |
880 |
} |
883 |
} |
881 |
else |
884 |
else |
882 |
{ $SOLARVER = $ARGV[ 9 ]; |
885 |
{ $SOLARVER = PosixFormat($ARGV[ 9 ]); |
883 |
# Restore white spaces in Windows pathnames |
886 |
# Restore white spaces in Windows pathnames |
884 |
if ( $platform eq "Winnt") |
887 |
if ( $platform eq "Winnt") |
885 |
{ $SOLARVER =~ s/#/ /g; |
888 |
{ $SOLARVER =~ s/#/ /g; |
Lines 1061-1066
Link Here
|
1061 |
|
1064 |
|
1062 |
# Restore white spaces in Windows pathnames. |
1065 |
# Restore white spaces in Windows pathnames. |
1063 |
$PERL_PATH =~ s/#/ /g; |
1066 |
$PERL_PATH =~ s/#/ /g; |
|
|
1067 |
$PERL_PATH =~ s/[\/\s]+$//; # Remove trailing / and spaces |
1064 |
$PERL = $PERL_PATH.$ds."perl.exe"; |
1068 |
$PERL = $PERL_PATH.$ds."perl.exe"; |
1065 |
|
1069 |
|
1066 |
$WIN_HOME = " "; |
1070 |
$WIN_HOME = " "; |
Lines 1113-1129
Link Here
|
1113 |
{ |
1117 |
{ |
1114 |
my ( $noldPATH ); |
1118 |
my ( $noldPATH ); |
1115 |
$noldPATH = $oldPATH; |
1119 |
$noldPATH = $oldPATH; |
1116 |
|
1120 |
|
1117 |
# convert path to posix if using native perl |
1121 |
# convert path to posix if using native NT perl |
1118 |
if ( ! $perl_os =~ /cygwin/ and $USE_SHELL eq "4nt" ) |
1122 |
$noldPATH = PosixFormat($noldPATH); |
1119 |
{ |
1123 |
|
1120 |
$noldPATH =~ s#(\w):#/cygdrive/$1#g; |
|
|
1121 |
$noldPATH =~ s/\\/\//g; |
1122 |
$noldPATH =~ s/;/:/g; |
1123 |
} |
1124 |
|
1125 |
$COMPATH_ROOT = $COMPATH; |
1124 |
$COMPATH_ROOT = $COMPATH; |
1126 |
$COMPATH_ROOT =~ s/\/vc98$//; |
1125 |
$COMPATH_ROOT =~ s/\/vc98$//i; |
1127 |
|
1126 |
|
1128 |
$PATH = $cur_dir. |
1127 |
$PATH = $cur_dir. |
1129 |
$ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$BIN. |
1128 |
$ps.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$BIN. |
Lines 1759-1770
Link Here
|
1759 |
if ( !( $_[ 0 ] =~ /^\// ) ) |
1758 |
if ( !( $_[ 0 ] =~ /^\// ) ) |
1760 |
{ $retrn = $ds.$_[ 0 ]; |
1759 |
{ $retrn = $ds.$_[ 0 ]; |
1761 |
} |
1760 |
} |
1762 |
} |
|
|
1763 |
# Check if the last character is a '/'. |
1764 |
if ( $retrn =~ /\/$/ ) |
1765 |
{ chop( $retrn ); |
1766 |
} |
1761 |
} |
1767 |
# Replacing multiple occurences of /. |
1762 |
# kill the last '/','\','\n' if they exists. |
|
|
1763 |
$retrn =~ s![\s/\\]+$!!; |
1768 |
# Done! |
1764 |
# Done! |
1769 |
return( $retrn ); |
1765 |
return( $retrn ); |
1770 |
} |
1766 |
} |
Lines 1794-1801
Link Here
|
1794 |
} |
1790 |
} |
1795 |
return "false"; |
1791 |
return "false"; |
1796 |
} |
1792 |
} |
1797 |
else |
1793 |
else |
1798 |
{ return "true"; |
1794 |
{ # Don't check under "$Winnt". The path is possibly posix and you could use a native NT perl! |
|
|
1795 |
return "true"; |
1799 |
} |
1796 |
} |
1800 |
} |
1797 |
} |
1801 |
#------------------------------------------------------------ |
1798 |
#------------------------------------------------------------ |
Lines 1910-1915
Link Here
|
1910 |
} |
1907 |
} |
1911 |
} |
1908 |
} |
1912 |
#---------------------------------------------------------- |
1909 |
#---------------------------------------------------------- |
|
|
1910 |
# Function name: PosixFormat |
1911 |
# Description: Format variables to Posix Style Format. Should only be used |
1912 |
# with DOS-style path variables |
1913 |
# Arguments: 1. Variable (string) |
1914 |
# Return value: Reformatted String |
1915 |
#---------------------------------------------------------- |
1916 |
sub PosixFormat |
1917 |
{ my ( $variable ); |
1918 |
$variable = $_[ 0 ]; |
1919 |
# ToDo: Do the replacement only if "Winnt" and var contains "\" and ":" |
1920 |
if ( $platform eq "$Winnt" ) |
1921 |
{ $variable =~ s/(\$\w+)/$1/eeg ; # expand the variables |
1922 |
$variable =~ s/(\$\w+)/$1/eeg ; # expand the variables twice! |
1923 |
if ( ( $variable =~ /\\/ ) and ( $variable =~ /:/ ) ) |
1924 |
{ $variable =~ s{([c-z]):}{/cygdrive/$1}gi; |
1925 |
# Map drives to /cgydrive/drive |
1926 |
# We do this also for old cygwins, back |
1927 |
# replacement in winformat. |
1928 |
} |
1929 |
$variable =~ s!\\!/!g; |
1930 |
$variable =~ s/;/:/g; |
1931 |
} |
1932 |
return $variable; |
1933 |
} |
1934 |
#---------------------------------------------------------- |
1913 |
# Function name: WinFormat |
1935 |
# Function name: WinFormat |
1914 |
# Description: Format variables to Windows Format. |
1936 |
# Description: Format variables to Windows Format. |
1915 |
# Arguments: 1. Variable (string) |
1937 |
# Arguments: 1. Variable (string) |
Lines 1920-1942
Link Here
|
1920 |
$variable = $_[ 0 ]; |
1942 |
$variable = $_[ 0 ]; |
1921 |
$variable =~ s/^"//; |
1943 |
$variable =~ s/^"//; |
1922 |
$variable =~ s/"$//; |
1944 |
$variable =~ s/"$//; |
|
|
1945 |
# Here should be NO "\"! If yes, PosixFormat() was forgotten before ! |
1946 |
if ( $variable =~ /\\/ ) |
1947 |
{ |
1948 |
die("Error! Variable contains \"\\\" : $variable PosixFormat() missing?"); |
1949 |
} |
1950 |
$variable =~ s/(\$\w+)/$1/eeg ; # expand the variables |
1951 |
$variable =~ s/(\$\w+)/$1/eeg ; # expand the variables twice! |
1952 |
$variable =~ s/\$\{PATH\}/%PATH/g ; # explicit replace ${PATH} |
1953 |
$variable =~ s/:+/:/g ; # remove multiple ; |
1954 |
|
1923 |
if ( $cygwinver eq "b" ) |
1955 |
if ( $cygwinver eq "b" ) |
1924 |
{ $variable =~ s/\//\\/g; |
1956 |
{ |
1925 |
$variable =~ s/\$/%/g; |
1957 |
$variable =~ s/(\$\w+)/$1/eeg ; # expand the variables |
1926 |
$variable =~ s/:/;/g; |
1958 |
$variable =~ s/(\$\w+)/$1/eeg ; # expand the variables twice! |
1927 |
$variable =~ s/^\\\\(\w)\\/$1:\\/g; |
1959 |
$variable =~ s/\$\{PATH\}/%PATH/g ; # explicit replace ${PATH} |
1928 |
$variable =~ s/^\\/$SYSTEMDRIVE\\/; |
1960 |
$variable =~ s/:/;/g; # Change path-separator |
1929 |
$variable =~ s/;\\/;$SYSTEMDRIVE\\/g; |
1961 |
$variable =~ s{//([c-z])/}{$1:\\}gi; # drives from cgywin-b20 (just in case ...) |
|
|
1962 |
$variable =~ s{/cygdrive/([c-z])/}{$1:\\}gi; # more drives for cgywin-b20 |
1963 |
$variable =~ s!([;]|\A|-[iIlL])/!$1$SYSTEMDRIVE/!g; # get back the hidden drives |
1964 |
$variable =~ s!/!\\!g; # Rest is windows stuff |
1930 |
} |
1965 |
} |
1931 |
else |
1966 |
else # New cygwin |
1932 |
{ |
1967 |
{ |
1933 |
$variable =~ s/(\$\w+)/$1/eeg ; # expand the variables |
|
|
1934 |
$variable =~ s/(\$\w+)/$1/eeg ; # expand the variables twice! |
1935 |
$variable =~ s/\$\{PATH\}/%PATH/g ; # explicit replace ${PATH} |
1936 |
$variable =~ s/\\/\//g; |
1937 |
$variable =~ s/:/;/g; |
1968 |
$variable =~ s/:/;/g; |
1938 |
$variable =~ s/([;]|\A|-[iIlL])(\w);/$1$2:/g; # get back the drives |
1969 |
# $variable =~ s/([;]|\A|-[iIlL])(\w);/$1$2:/g; # get back the drives |
1939 |
# Search for posix path ;entry; and replace with cygpath -w entry |
1970 |
$variable =~ s{/cygdrive/([c-z])/}{$1:\\}gi; # more drives cgywin style |
|
|
1971 |
# Search for posix path entry and replace with cygpath -w entry |
1940 |
if ( $variable =~ /^\s+-\w/ ) |
1972 |
if ( $variable =~ /^\s+-\w/ ) |
1941 |
{ |
1973 |
{ |
1942 |
# Include paths |
1974 |
# Include paths |
Lines 1966-1977
Link Here
|
1966 |
} |
1998 |
} |
1967 |
} |
1999 |
} |
1968 |
$variable = join(';',@split_var); |
2000 |
$variable = join(';',@split_var); |
1969 |
|
|
|
1970 |
} |
2001 |
} |
1971 |
|
|
|
1972 |
$variable =~ s/\//\\/g; # Remaining \ come from e.g.: ../foo/baa |
2002 |
$variable =~ s/\//\\/g; # Remaining \ come from e.g.: ../foo/baa |
1973 |
} |
2003 |
} |
1974 |
return $variable; |
2004 |
return $variable; |
1975 |
} |
2005 |
} |
1976 |
#---------------------------------------------------------- |
2006 |
#---------------------------------------------------------- |
1977 |
# Function name: CheckBuildEnv |
2007 |
# Function name: CheckBuildEnv |