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 27 Apr 2003 09:12:10 -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 @@ -489,19 +502,44 @@ CC=`cygpath -d "$CC"` CC=`cygpath -u "$CC"` fi - # Remove /bin/cl.exe from CC case insensitive - COMPATH=`echo $CC | $SED 's@/[[bB]][[iI]][[nN]/[cC]][[lL]\.[eE]][[xX]][[eE]]@@'` + # Remove /cl.exe from CC case insensitive + COMPATH=`echo $CC | $SED 's@/[[cC]][[lL]\.[eE]][[xX]][[eE]]@@'` # Please set INCLUDE in your environement if you use the old cygwin b20 if test "$CygwinVer" = "1"; then - export INCLUDE=`cygpath -d "$COMPATH/Include"` + 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 @@ -979,7 +1017,9 @@ dnl ========================================= dnl Check for the Microsoft Platform SDK. dnl ========================================= -if test \( "$_os" = "WINNT" \) -a \( "$WITH_MINGWIN" != "yes" \); then +dnl FIXME: I don't know yet if PSDK works with MinGW, keep it until I know better, +dnl and add "-a \( "$WITH_MINGWIN" != "yes" \)" then +if test \( "$_os" = "WINNT" \) ; then AC_MSG_CHECKING([PSDK files]) if test -z "$with_psdk_home"; then # This line will work with cygwin 1.3.? and newer, for older versions @@ -1034,7 +1074,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 +1273,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 27 Apr 2003 09:12:11 -0000 @@ -12,9 +12,6 @@ # set_soenv generates a file that contains all necessary # environment variables for the build proces of OpenOffice # on Linux, NetBSD, Solaris, Windows NT and Mac OS X/Darwin. -# This script prompts the installer to enter: -# 1. (if necessary) The directory where the jdk is located (JAVA_HOME). -# 2. (if necessary) The directory where the Microsoft C/C++ compiler is located (COMPATH). # # Program steps. # @@ -43,7 +40,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); # @@ -86,7 +83,7 @@ $STAR_REGISTRY, $STAR_RESOURCEPATH, $DMAKEROOT, $CLASSPATH, $XCLASSPATH, $COMPATH, $COMPATH_ROOT, $LD_LIBRARY_PATH, $PATH, $SOLARDEF, $SOLAREXTRAINC, $SOLAREXTRALIB, $SOLARINCLUDES, $SOLARLIB, $SOLARINC, $LOCALINI, $MAC_LIB, $PATHEXTRA, $FRAMEWORKSHOME, $COMEX, $MULTITHREAD_OBJ, $PERL, - $COMP_ENV, $IENV, $ILIB, $WIN_INCLUDE, $JAVAHOME, $WIN_LIB, $WIN_HOME, $PSDK_HOME, $USE_NEW_SDK, $NO_HIDS, + $COMP_ENV, $IENV, $ILIB, $WIN_INCLUDE, $JAVAHOME, $WIN_LIB, $PSDK_HOME, $USE_NEW_SDK, $NO_HIDS, $TEMP, $COMMON_BUILD_TOOLS, $WIN_GREP, $WIN_FIND, $WIN_LS, $WIN_GNUCOPY, $WIN_TOUCH, $STLPORT4, $USE_GCC3, $ENABLE_DEBUG ); # @@ -130,7 +127,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 +515,45 @@ $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; + $CVER = "C300"; $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; + # COMPATH for MSC is differently used + $COMPATH =~ s/\/bin$//i; $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" ) @@ -915,8 +908,11 @@ { $SOLARINCLUDES = $I.$SOLARVER.$INC. $I.$SOLARENV.$ds.$INPATH.$INC. $I.$SOLARENV.$INC. - $I."'".$PSDK_HOME.$INCLUDE."'". - $I.'$COMPATH'.$ds."include"; + $I."'".$PSDK_HOME.$INCLUDE."'"; + # Mingw is different + if ( $COM eq "MSC" ) + { $SOLARINCLUDES .= $I.'$COMPATH'.$ds."include"; + } } elsif ($platform eq "$Macosx") { $SOLARINCLUDES = $I.'$SOLARVER'.$ds.'$UPD'.$ds.'$INPATH'.$INC. @@ -935,17 +931,21 @@ $ps.$SOLARVER.$ds.$UPD.$ds.$INPATH.$INC. $ps.$SOLARENV.$ds.$OUTPATH.$INC. $ps.$SOLARENV.$INC. - $ps.'$PSDK_HOME'.$INCLUDE. - $ps.'$COMPATH'.$INCLUDE; - + $ps.'$PSDK_HOME'.$INCLUDE; + # Mingw is different + if ( $COM eq "MSC" ) + { $IENV .= $ps.'$COMPATH'.$INCLUDE; + } $WIN_LIB = $cur_dir.$ps_STLPORT_LIB.$ps. $ps.$SOLARVER.$ds.$UPD.$LIB. $ps.$SOLARVER.$ds.$UPD.$ds.$INPATH.$LIB. $ps.$SOLARENV.$ds.$OUTPATH.$LIB. $ps.$JAVA_HOME.$LIB. - $ps.'$PSDK_HOME'.$LIB. - $ps.'$COMPATH'.$LIB; - + $ps.'$PSDK_HOME'.$LIB; + # Mingw is different + if ( $COM eq "MSC" ) + { $WIN_LIB .= $ps.'$COMPATH'.$LIB; + } if ( $JAVA_HOME ne "" ) { $IENV .= $ps.'$JAVA_HOME'.$INCLUDE; @@ -958,7 +958,6 @@ $ILIB = '.'.$ps_STLPORT_LIB.$ps.$WIN_LIB; - $WIN_HOME = " "; } # The general environment path. @@ -1008,9 +1007,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 +1019,35 @@ # 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 ! + # Cygwin or 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)/ ) ) - { - $PATH .= $ps.'$COMPATH'.$BIN; + { # Mingw is different + if ( $COM eq "MSC" ) { + $PATH .= $ps.'$COMPATH'.$BIN; + } else { + $PATH .= $ps.'$COMPATH'; + } } +if ( $COM eq "MSC" && $COMEX eq "7" ) +{ # No solution for .NET yet! # 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'; + { # In non-standard installations this directory might not exist. + $PATH .= $ps.$COMPATH_ROOT.'/Common/MSDev98/Bin' if -d $COMPATH_ROOT.'/Common/MSDev98/Bin'; } +} # Check if $PERL_PATH is already set in PATH if ( ! ( $noldPATH =~ /(?:[:]|\A)(?:$PERL_PATH)(?:[:]|\Z|$ds)/ ) ) @@ -1049,7 +1058,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") @@ -1222,8 +1231,11 @@ { $SOLARINC .= $STLPORT_stlport. $I.'$JAVA_HOME'.$ds."include".$ds."win32". $I.'$JAVA_HOME'.$ds."include". - $I."'".$PSDK_HOME.$INCLUDE."'". - $I.'$COMPATH'.$ds."include"; + $I."'".$PSDK_HOME.$INCLUDE."'"; + # Mingw is different + if ( $COM eq "MSC" ) + { $SOLARINC .= $I.'$COMPATH'.$ds."include"; + } } elsif ($platform eq "$Macosx") { $SOLARINC .= $STLPORT_stlport. @@ -1650,7 +1662,7 @@ if ( $perl_os =~ /cygwin/ ) { $tempstring =~ s#\\#\\\\#g; } ToFile( "set ZIPDEP=$tempstring", $empty, "x" ); - ToFile( "HOME", $WIN_HOME, "e" ); + ToFile( "HOME", " ", "e" ); } else { ToFile( "DELIVER", "deliver.pl", "e" ); ToFile( "MKOUT", "mkout.pl", "e" );