Index: config_office/configure.in =================================================================== RCS file: /cvs/tools/config_office/configure.in,v retrieving revision 1.49.2.3.2.6 diff -u -r1.49.2.3.2.6 configure.in --- config_office/configure.in 16 Apr 2003 12:12:10 -0000 1.49.2.3.2.6 +++ config_office/configure.in 24 Apr 2003 11:49:45 -0000 @@ -256,11 +256,20 @@ dnl =================================================================== dnl Sanity check! Native windows programs cannot use cygwin symlinks! dnl =================================================================== - if test -L $AWK -o -L `which tar` -o -L `which gunzip` ; then - AC_MSG_ERROR([$AWK, tar or gunzip is a cygwin symlink! + if test -L $AWK -o -L `which tar` -o -L `which gunzip` ; then + AC_MSG_ERROR([$AWK, tar or gunzip is a cygwin symlink! Native windows programs cannot use cygwin symlinks. Remove the symbolic link, and copy the program to the name of the link.]) - fi + fi + dnl =================================================================== + dnl If $CC is set to a MinGW compiler, e.g. "gcc -mno-cygwin" enable + dnl $WITH_MINGWIN + dnl =================================================================== + if test -n "$CC";then + if test `$CC -dumpmachine | $AWK -F- '{ print $3 }'` = "mingw32"; then + WITH_MINGWIN = "yes" + fi + fi else CygwinVer="b" fi @@ -272,6 +281,10 @@ dnl =================================================================== if test "$WITH_MINGWIN" = "yes"; then with_use_shell="tcsh" + if test -z "$CC"; then + CC="gcc -mno-cygwin" + CXX="g++ -mno-cygwin" + fi fi else if test "$_os" = "WINNT"; then @@ -472,16 +485,16 @@ fi dnl =================================================================== -dnl Check if there is a Microsoft C/C++ compiler. +dnl Check which Microsoft C/C++ or MinGW compiler is used for WINNT dnl =================================================================== if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" != "yes"; then - AC_MSG_CHECKING([the Microsoft C/C++ Compiler]) - if test -x "$with_cl_home/bin/cl.exe"; then - CC="$with_cl_home/bin/cl.exe" - else - AC_PATH_PROG(CC, cl.exe) - fi + AC_MSG_CHECKING([the Microsoft C/C++ Compiler]) + if test -x "$with_cl_home/bin/cl.exe"; then + CC="$with_cl_home/bin/cl.exe" + else + AC_PATH_PROG(CC, cl.exe) + fi if test -e "$CC"; then # Don't use filenames with spaces AND the old cygwin b20 if test "$CygwinVer" = "1"; then @@ -495,13 +508,38 @@ if test "$CygwinVer" = "1"; then export INCLUDE=`cygpath -d "$COMPATH/Include"` fi - AC_MSG_RESULT([found.]) - else - AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.]) - fi - else - AC_MSG_CHECKING([the Mingwin32 C++ Compiler]) - fi + AC_MSG_RESULT([found.]) + dnl Check which Microsoft C/C++ compiler is found + AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler]) + CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft.*..\\...\\...../ { + x = match( \\\$0, /..\\...\\...../ ) + CCversion = substr( \\\$0, RSTART, RLENGTH) + tokencount = split (CCversion,vertoken,\".\") + for ( i = 1 ; i <= tokencount ; i++ ) { + printf (\"%04d\",vertoken[[i]] ) + } + }"` + AC_MSG_RESULT([found Compiler version $CCNUMVER.]) + if test $CCNUMVER -ge "001300000000"; then + COMEX=8 + else + if test $CCNUMVER -ge "001200000000"; then + COMEX=7 + else + AC_MSG_ERROR([Compiler too old.]) + fi + fi + else + AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.]) + fi + else + AC_MSG_CHECKING([the Mingwin32 C++ Compiler]) + if test `$CC -dumpmachine | $AWK -F- '{ print $3 }'` = "mingw32"; then + AC_MSG_RESULT([found.]) + else + AC_MSG_ERROR([Mingwin32 C++ Compiler not found.]) + fi + fi fi dnl =================================================================== @@ -531,14 +569,14 @@ fi fi -if test "$_os" = "WINNT"; then +if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then if test -e "$CC"; then CXX="$CC" fi fi dnl Autoconf 2.53 can do this test for cl.exe, 2.13 can't! -if test "$_os" != "WINNT"; then +if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then AC_PROG_CXX fi @@ -771,17 +809,17 @@ AC_MSG_CHECKING([for STLport4 headers]) if test -d "$with_stlport4_home"; then STLPORT4=$with_stlport4_home - if test "$_os" != "WINNT"; then + if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then AC_TRY_CPP($STLPORT4/stlport/hash_map, AC_MSG_RESULT([checked.]), AC_MSG_ERROR([STLport4 headers not found.])) else - dnl AC_TRY_CPP doesn't work on Windows because C++ preprocessor is not found by autoconf. + dnl AC_TRY_CPP doesn't work for MSVC because C++ preprocessor is not found by autoconf. if test -f "$STLPORT4/stlport/hash_map"; then AC_MSG_RESULT([checked.]) else AC_MSG_ERROR([STLport4 headers not found.]) fi fi - if test "$_os" != "WINNT"; then + if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then AC_MSG_CHECKING([for STLport4 libraries]) if test "$_os" = "SunOS"; then if test -f "$STLPORT4/lib/libstlport_sunpro.so"; then @@ -1034,7 +1072,7 @@ dnl *************************************** dnl testing ml.exe assembler path dnl *************************************** -if test "$_os" = "WINNT"; then +if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then if test ! -x "$with_asm_home/ml.exe"; then AC_PATH_PROG(ML_EXE, ml.exe) if test -z "$ML_EXE"; then @@ -1233,6 +1271,7 @@ UPD="$upd" AC_SUBST(UPD) AC_SUBST(CYGWIN) +AC_SUBST(COMEX) AC_SUBST(STLPORT4) WITH_LANG="$with_lang" AC_SUBST(WITH_LANG) Index: config_office/set_soenv.in =================================================================== RCS file: /cvs/tools/config_office/set_soenv.in,v retrieving revision 1.4.2.3.2.3 diff -u -r1.4.2.3.2.3 set_soenv.in --- config_office/set_soenv.in 2 Apr 2003 13:01:07 -0000 1.4.2.3.2.3 +++ config_office/set_soenv.in 24 Apr 2003 11:49:48 -0000 @@ -43,7 +43,7 @@ #-------------------------------------------------------- # my ( $outfile, $outfile_sh, $outfile_bat, $bootfile, $newline, $comment, $comment4nt, $compiler, $unsetenv, $setenv, $unset, $set, $ds, $ps, $cur_dir, - $par_dir, $I, $L, $D, $buildenv, $answer, $tmp, $Solaris, $Linux, $FreeBSD, $NetBSD, $Tru64, $Irix, $Irix64, $Winnt, $Macosx, $MINGWIN32, $USE_SHELL, + $par_dir, $I, $L, $D, $buildenv, $answer, $tmp, $Solaris, $Linux, $FreeBSD, $NetBSD, $Tru64, $Irix, $Irix64, $Winnt, $Macosx, $MINGW, $USE_SHELL, $WScomp, $GNUcomp, $platform, $cygwinver, $machine_type, $empty, $no_ant, $no_stl, $no_gcc_home, $no_gcc_include, $no_gxx_include, $warnfile, $Warning, $result, $unsetvars, $unsetvarssh, $unsetvarsbat, $exportvars, $win_format_var, $perl_os); # @@ -130,7 +130,7 @@ $warnfile = "warn"; # logfile configure warnings. $Warning = ""; # container for warning messages $STLPORT4 = '@STLPORT4@'; # Location of STLport4 -$MINGWIN32 = '@WITH_MINGWIN@'; # use MINGWIN32 +$MINGW = '@WITH_MINGWIN@'; # use MinGW for Windows build $USE_SHELL = '@USE_SHELL@'; # preferred shell $USE_GCC3 = '@USE_GCC3@'; # use gcc3 (only for unxlngi4 and unxfbsd5i at the moment) $CC = '@CC@'; # C compiler @@ -518,49 +518,42 @@ $emergency = "FALSE"; $use_shl_versions = "TRUE"; $MULTITHREAD_OBJ = "TRUE"; - if ( $MINGWIN32 eq "yes" ) - { print "Setting Windows NT cygwin mingwin32 specific values... "; + if ( $MINGW eq "yes" ) + { # At the moment this implies the use of tcsh + print "Setting Windows NT cygwin MinGW specific values... "; + $WRAPCMD = "guw.pl"; $outfile = "winmingw.set"; $COM = "GCC"; - # Change path to lower case. - $COMPATH = lc $COMPATH; $DLLSUFFIX = "gi"; $OUTPATH = "wntgcci"; $INPATH = $OUTPATH.$PROEXT; $GVERDIR = $INPATH; $PATH_SEPERATOR = ':'; } - elsif ( $USE_SHELL ne "4nt" ) - { print "Setting Windows NT cygwin without 4NT specific values... "; - $outfile = "winenv.set"; + else # The MSVC section starts here + { $outfile = "winenv.set"; $COM = "MSC"; - $WRAPCMD = "guw.pl"; - $CC = $WRAPCMD." ".$CC; - $CXX = $WRAPCMD." ".$CXX; - # Change path to lower case. - # not realy usefull for *sh -# $COMPATH = lc $COMPATH; $CVER = "MI200"; $DLLSUFFIX = "mi"; - $OUTPATH = "wntmsci7"; + $OUTPATH = "wntmsci@COMEX@"; $INPATH = $OUTPATH.$PROEXT; $GVERDIR = $INPATH; + $COMEX = '@COMEX@'; + + if ( $USE_SHELL ne "4nt" ) + { print "Setting Windows NT cygwin without 4NT specific values... "; + $WRAPCMD = "guw.pl"; + $CC = $WRAPCMD." ".$CC; + $CXX = $WRAPCMD." ".$CXX; $PATH_SEPERATOR = ':'; - $COMEX = 7; } - else - { print "Setting Windows NT specific values... "; - $outfile = "winenv.set"; - $COM = "MSC"; + else # $USE_SHELL ne "4nt" + { print "Setting Windows NT with 4NT specific values... "; # Change path to lower case. $COMPATH = lc $COMPATH; - $CVER = "MI200"; - $DLLSUFFIX = "mi"; - $OUTPATH = "wntmsci7"; - $INPATH = $OUTPATH.$PROEXT; - $GVERDIR = $INPATH; $PATH_SEPERATOR = ';'; - $COMEX = 7; + } + } } elsif ( $platform eq "$Macosx" ) @@ -916,6 +909,7 @@ $I.$SOLARENV.$ds.$INPATH.$INC. $I.$SOLARENV.$INC. $I."'".$PSDK_HOME.$INCLUDE."'". +# FIXME: Mingw is different $I.'$COMPATH'.$ds."include"; } elsif ($platform eq "$Macosx") @@ -936,6 +930,7 @@ $ps.$SOLARENV.$ds.$OUTPATH.$INC. $ps.$SOLARENV.$INC. $ps.'$PSDK_HOME'.$INCLUDE. +# FIXME: Mingw is different $ps.'$COMPATH'.$INCLUDE; $WIN_LIB = $cur_dir.$ps_STLPORT_LIB.$ps. @@ -944,6 +939,7 @@ $ps.$SOLARENV.$ds.$OUTPATH.$LIB. $ps.$JAVA_HOME.$LIB. $ps.'$PSDK_HOME'.$LIB. +# FIXME: Mingw is different $ps.'$COMPATH'.$LIB; if ( $JAVA_HOME ne "" ) @@ -1008,9 +1004,6 @@ # 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. $ps.'$SOLARENV'.$ds."bin". @@ -1023,22 +1016,32 @@ # 1.3.x - hotspot, client missing # 1.4.x - client, hotspot missing - $PATH .= $ps.$JAVA_HOME.$BIN. - $ps.$JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot". - $ps.$JAVA_HOME.$ds."jre".$ds."bin".$ds."client"; + $PATH .= $ps.$JAVA_HOME.$BIN; + if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot" ) { + $PATH .= $ps.$JAVA_HOME.$ds."jre".$ds."bin".$ds."hotspot"; + } + if ( -d $JAVA_HOME.$ds."jre".$ds."bin".$ds."client" ) { + $PATH .= $ps.$JAVA_HOME.$ds."jre".$ds."bin".$ds."client"; + } } # MSVC++ Environement sets the PATH variable, dont add $COMPATH to $PATH ! # anyway, add if path to compiler isn't already set in PATH if ( ! ( $noldPATH =~ /(?:[:]|\A)(?:$COMPATH)(?:[:]|\Z|$ds)/ ) ) { +# FIXME: Mingw doesn't need $BIN $PATH .= $ps.'$COMPATH'.$BIN; } +if ( $COM eq "MSC" ) +{ # 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. + $COMPATH_ROOT = $COMPATH; + $COMPATH_ROOT =~ s/\/vc98$//i; 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)/ ) ) @@ -1049,7 +1052,7 @@ if ( ( "$USE_SHELL" eq "tcsh" ) && ( ! $noldPATH =~ /(?:[:]|\A)(?:$TCSH_PATH)(?:[:]|\Z)/ ) ) { $PATH .= $ps.$TCSH_PATH; } - if ($ASM_PATH ne "ASM_IN_PATH") + if ( ($COM eq "MSC") && ($ASM_PATH ne "ASM_IN_PATH") ) { $PATH .= $ps.'${ASM_PATH}'; } if ($UNZIP_PATH ne "UNZIP_IN_PATH") @@ -1223,6 +1226,7 @@ $I.'$JAVA_HOME'.$ds."include".$ds."win32". $I.'$JAVA_HOME'.$ds."include". $I."'".$PSDK_HOME.$INCLUDE."'". +# FIXME: Mingw is different $I.'$COMPATH'.$ds."include"; } elsif ($platform eq "$Macosx")