[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 2 commits - odk/settings oowintool set_soenv.in solenv/gbuild solenv/inc solenv/win64

Damjan Jovanovic damjan at apache.org
Mon Mar 12 19:10:00 UTC 2018


 odk/settings/settings.mk          |    8 
 oowintool                         |   44 +++--
 set_soenv.in                      |   59 +++++--
 solenv/gbuild/platform/windows.mk |   26 +++
 solenv/inc/wnt.mk                 |    4 
 solenv/win64/readme.txt           |    2 
 solenv/win64/win64.patch          |  305 --------------------------------------
 7 files changed, 110 insertions(+), 338 deletions(-)

New commits:
commit e908c6878c5c612996efa953d71bff0a7eeb1bbd
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Mon Mar 12 17:34:16 2018 +0000

    The Win64 patch has been merged now, no need to keep
    
    a copy in main/solenv/win64.
    
    Patch by: me

diff --git a/solenv/win64/readme.txt b/solenv/win64/readme.txt
deleted file mode 100644
index 2dac1a5bf364..000000000000
--- a/solenv/win64/readme.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-Please refer to https://wiki.openoffice.org/wiki/Win64_port
-for instructions.
diff --git a/solenv/win64/win64.patch b/solenv/win64/win64.patch
deleted file mode 100644
index dad8f61b5de5..000000000000
--- a/solenv/win64/win64.patch
+++ /dev/null
@@ -1,305 +0,0 @@
-Index: configure.ac
-===================================================================
---- configure.ac	(revision 1826001)
-+++ configure.ac	(working copy)
-@@ -2116,18 +2116,27 @@
- 		PATH="$MSPDB_PATH:$PATH"
- 
- 		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
-+		case "$build_cpu" in
-+		  i?86)
-+		    cl_subdirectory="bin"
-+		    ;;
-+		  x86_64)
-+		    cl_subdirectory="bin/amd64"
-+		    ;;
-+		  *)
-+		    AC_MSG_ERROR([Unknown/unsupported CPU.])
-+		    ;;
-+		esac
-+   		if test -x "$with_cl_home/$cl_subdirectory/cl.exe"; then
-+   			CC="$with_cl_home/$cl_subdirectory/cl.exe"
-+			COMPATH="$with_cl_home"
- 			# This gives us a posix path with 8.3 filename restrictions
- 			CC=`cygpath -d "$CC"`
- 			CC=`cygpath -u "$CC"`
-+			COMPATH=`cygpath -d "$COMPATH"`
-+			COMPATH=`cygpath -u "$COMPATH"`
- 			# Remove /cl.exe from CC case insensitive
- 			AC_MSG_RESULT([found ($CC)])
--			COMPATH=`echo $CC | $SED 's@\/[[Bb]][[Ii]][[Nn]]\/[[cC]][[lL]]\.[[eE]][[xX]][[eE]]@@'`
- 			export INCLUDE=`cygpath -d "$COMPATH/Include"`
- 			dnl  Check which Microsoft C/C++ compiler is found
- 			AC_MSG_CHECKING([the Version of Microsoft C/C++ Compiler])
-@@ -2150,7 +2159,7 @@
- 				AC_MSG_ERROR([Compiler too old. Use Microsoft C/C++ .NET 2008.])
- 			fi
- 		else
--			AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe.])
-+			AC_MSG_ERROR([Microsoft C/C++ Compiler not found. Use --with-cl-home.])
- 		fi
- 	else
- 		AC_MSG_CHECKING([the Mingwin32 C++ Compiler])
-Index: set_soenv.in
-===================================================================
---- set_soenv.in	(revision 1826001)
-+++ set_soenv.in	(working copy)
-@@ -687,8 +687,6 @@
-       $USE_DIRECTX5   = "";
-       $FRAME_HOME     = PathFormat('@FRAME_HOME@');
-       $USE_NEW_SDK    = "TRUE";
--      $CPUNAME        = "INTEL";
--      $CPU            = "I";
-       $GUI            = "WNT";
-       $GUIBASE        = "WIN";
-       $GVER           = "NT351";
-@@ -706,20 +704,19 @@
-       $COMPATH        = PathFormat('@COMPATH@/bin');
-       $COMPATH        =~ s/\/bin$//i;
-       $COM            = "GCC";
-+      $CPU            = "I";
-+      $CPUNAME        = "INTEL";
-       $CVER           = "C341";
-       $OUTPATH        = "wntgcci";
--      $INPATH         = $OUTPATH.$PROEXT;
-       $ATL_INCLUDE = '$SOLARVER'.$ds.'$INPATH'.$ds."inc".$ds."external".$ds."mingw".$ds."include".$ds."atl". " ".'$PSDK_HOME'.$ds."include".$ds."atl";
-   }
-   else # The MSVC section starts here
--  {   $outfile        = "winenv.set";
-+  {
-       $COMPATH        = PathFormat('@COMPATH@');
-       $CXX_X64_BINARY = PathFormat('@COMPATH@/bin/amd64/cl.exe');
-       $LINK_X64_BINARY = PathFormat('@COMPATH@/bin/amd64/link.exe');
-       $LIBMGR_X64_BINARY = PathFormat('@COMPATH@/bin/amd64/lib.exe');
-       $COM            = "MSC";
--      $OUTPATH        = "wntmsci at COMEX@";
--      $INPATH         = $OUTPATH.$PROEXT;
-       $COMEX          = '@COMEX@';
-       if ( "@COMEX@" eq "10" ) { # .NET 2003 needs M1310
-           $CVER        = "M1310";
-@@ -732,11 +729,27 @@
- 	      die "Unsupported value for COMEX variable.\n";
- 	  }
-       }
--      print "Setting W32 build with bash shell specific values... ";
-       # No special treatment for CC and CXX anymore.
-       $FLIPCMD        = "slfl.pl";
-       $PATH_SEPERATOR = ';';
-+      if ($platform =~ m/^i[3456]86/) {
-+	  print "Setting Windows x86 build with bash shell specific values... ";
-+	  $outfile    = "winenv.set";
-+	  $CPU        = "I";
-+	  $CPUNAME    = "INTEL";
-+	  $OUTPATH    = "wntmsci at COMEX@";
-+      } elsif ($platform =~ m/^x86_64/) {
-+	  print "Setting Windows x86_64 build with bash shell specific values... ";
-+	  $outfile    = "winAMD64Env.set";
-+	  $CPU        = "X";
-+	  $CPUNAME    = "X86_64";
-+	  $OUTPATH    = "wntmscx at COMEX@";
-+      } else {
-+	  print "Unsupported Windows architecture: $platform \n";
-+	  exit 1;
-+      }
-   }
-+  $INPATH = $OUTPATH.$PROEXT;
- }
- elsif ( $platform =~ m/os2/ ) 
- { 
-@@ -1075,10 +1088,19 @@
-    # Mingw is different
-    if ( $COM eq "MSC" )
-    {  $ILIB       .=    $wps.$SOLARVER.$ds.$INPATH.$LIB.
--                        $wps.$JAVA_HOME.$LIB.
--                        $wps.$PSDK_HOME.$LIB.
-+                        $wps.$JAVA_HOME.$LIB;
-+      if ( $CPU eq "I" ) {
-+         $ILIB    .=    $wps.$PSDK_HOME.$LIB.
-                         $wps.$FRAME_HOME.$LIB.
-                         $wps.$COMPATH.$LIB;
-+      } elsif ( $CPU eq "X" ) {
-+         $ILIB    .=    $wps.$PSDK_HOME.$LIB.$ds."x64".
-+                        $wps.$FRAME_HOME.$LIB.
-+                        $wps.$COMPATH.$LIB.$ds."amd64";
-+      } else {
-+         print "Unsupported Windows CPU: $CPU\n";
-+         exit 1;
-+      }
-       if ( '@ENABLE_DIRECTX@' ne "" ) {
-           # We may have DirectX but not DirectDraw
-           if ( '@ENABLE_DIRECT_DRAW@' ne "") {
-@@ -1167,12 +1189,19 @@
- 	  }
-    }
- 
--   # Add path to compiler
--   $tmppath = CygFormat($COMPATH).$BIN;
--   $tmppath =~ s/^\/\//\//;
--   $PATH .= $ps.$tmppath;
-+   if ( $COM eq "MSC" ) {
-+	   # Add path to compiler
-+	   if ( $CPU eq "I" ) {
-+		   $tmppath = CygFormat($COMPATH).$BIN;
-+	   } elsif ( $CPU eq "X" ) {
-+		   $tmppath = CygFormat($COMPATH).$BIN.$ds."amd64";
-+	   } else {
-+		   print "Unsupported Windows CPU: $CPU\n";
-+		   exit 1;
-+	   }
-+	   $tmppath =~ s/^\/\//\//;
-+	   $PATH .= $ps.$tmppath;
- 
--   if ( $COM eq "MSC" ) {
-        $tmppath = CygFormat($MSPDB_PATH);
- 	   # for .NET to find mspdb71.dll (needed by CL.EXE C/C++ Compiler)
- 	   if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
-@@ -1196,6 +1225,11 @@
- 		   }
- 	   }
-    } else { # Mingw is different
-+	   # Add path to compiler
-+	   $tmppath = CygFormat($COMPATH).$BIN;
-+	   $tmppath =~ s/^\/\//\//;
-+	   $PATH .= $ps.$tmppath;
-+
- 	   # Native installer needs some files if the Windows Installer SDK
-                $tmppath = CygFormat($PSDK_HOME);
- 	   if ( $PATH !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) {
-Index: solenv/gbuild/platform/windows.mk
-===================================================================
---- solenv/gbuild/platform/windows.mk	(revision 1826001)
-+++ solenv/gbuild/platform/windows.mk	(working copy)
-@@ -59,11 +59,15 @@
- 	-D_MT \
- 	-D_DLL \
- 	-DBOOST_MEM_FN_ENABLE_CDECL \
--	-DCPPU_ENV=msci \
- 	-DFULL_DESK \
- 	-DM1500 \
- 
--gb_CPUDEFS := -DINTEL -D_X86_=1
-+ifeq ($(CPUNAME),INTEL)
-+gb_CPUDEFS := -DINTEL -D_X86_=1 -DCPPU_ENV=msci
-+endif
-+ifeq ($(CPUNAME),X86_64)
-+gb_CPUDEFS := -DX86_64 -D_AMD64_=1 -DCPPU_ENV=mscx
-+endif
- 
- gb_RCDEFS := \
-      -DWINVER=0x0400 \
-@@ -187,12 +191,21 @@
- 
- gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS)
- 
-+ifeq ($(CPUNAME),INTEL)
- gb_LinkTarget_LDFLAGS := \
- 	-MACHINE:IX86 \
- 	-NODEFAULTLIB \
- 	$(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
--	
- 
-+endif
-+ifeq ($(CPUNAME),X86_64)
-+gb_LinkTarget_LDFLAGS := \
-+	-MACHINE:X64 \
-+	-NODEFAULTLIB \
-+	$(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
-+
-+endif
-+
- gb_DEBUG_CFLAGS := -Zi
- 
- ifeq ($(gb_DEBUGGING),TRUE)
-@@ -437,7 +450,12 @@
- # Library class
- 
- gb_Library_DEFS := -D_DLL_
-+ifeq ($(CPUNAME),INTEL)
- gb_Library_TARGETTYPEFLAGS := -DLL -OPT:NOREF -SAFESEH -NXCOMPAT -DYNAMICBASE
-+endif
-+ifeq ($(CPUNAME),X86_64)
-+gb_Library_TARGETTYPEFLAGS := -DLL -OPT:NOREF -NXCOMPAT -DYNAMICBASE
-+endif
- gb_Library_get_rpath :=
- 
- gb_Library_SYSPRE := i
-@@ -608,7 +626,12 @@
- # Executable class
- 
- gb_Executable_EXT := .exe
-+ifeq ($(CPUNAME),INTEL)
- gb_Executable_TARGETTYPEFLAGS := -RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG -SAFESEH -NXCOMPAT -DYNAMICBASE
-+endif
-+ifeq ($(CPUNAME),X86_64)
-+gb_Executable_TARGETTYPEFLAGS := -RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG -NXCOMPAT -DYNAMICBASE
-+endif
- gb_Executable_get_rpath :=
- gb_Executable_TARGETGUI := 
- 
-Index: solenv/inc/wnt.mk
-===================================================================
---- solenv/inc/wnt.mk	(revision 1826001)
-+++ solenv/inc/wnt.mk	(working copy)
-@@ -39,6 +39,10 @@
- .INCLUDE : wntgcci.mk
- .ENDIF
- 
-+.IF "$(OS)$(COM)$(CPU)" == "WNTMSCX"
-+.INCLUDE : wntmscx.mk
-+.ENDIF
-+
- # --- changes for W32-tcsh - should move into settings.mk ---
- JAVAC=javac
- JAVA=java
-Index: solenv/inc/tg_compv.mk
-===================================================================
---- solenv/inc/tg_compv.mk	(revision 1826001)
-+++ solenv/inc/tg_compv.mk	(working copy)
-@@ -72,9 +72,13 @@
- .IF "$(COM)"=="MSC"
- .IF "$(CCNUMVER)">="001200000000"
- COMID=MSC
-+.IF "$(CPUNAME)"=="INTEL"
- COMNAME=msci
-+.ELIF "$(CPUNAME)"=="X86_64"
-+COMNAME=mscx
- .ENDIF
- .ENDIF
-+.ENDIF
- 
- .IF "$(COM)"=="GCC"
- 
-Index: odk/settings/settings.mk
-===================================================================
---- odk/settings/settings.mk	(revision 1826001)
-+++ odk/settings/settings.mk	(working copy)
-@@ -57,6 +57,8 @@
- ifeq "$(PLATFORM)" "windows"
- # Settings for Windows using Microsoft compiler/linker
- 
-+PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1 | sed -e 's/^i.86$$/i386/')
-+
- OS=WIN
- PS=\\
- ICL=$$
-@@ -119,8 +121,14 @@
- # define for used compiler necessary for UNO
- # -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
- 
-+ifeq "$(PROCTYPE)" "i386"
- CC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
- CC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
-+endif
-+ifeq "$(PROCTYPE)" "x86_64"
-+CC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=mscx
-+CC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=mscx
-+endif
- CC_OUTPUT_SWITCH=-Fo
- 
- LIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL /DEBUGTYPE:cv
commit 573f290bc7ac675d5479c07103d6693ef69dd877
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Mon Mar 12 17:32:09 2018 +0000

    Implement initial unfinished support for building 64 bit AOO on 64 bit Windows.
    
    For now, require --enable-win64 to be passed to ./configure and without it build 32 bit
    binaries like before.
    
    Detect the MSVC compiler only through oowintool (ie. registry keys) and the command line option,
    not by searching the path, as we need to know the exact path to determine whether the compiler
    outputs 32 or 64 bit binaries.
    
    Pass --aoo32-on-win64 to oowintool when doing the AOO32 on Win64 build, so oowintool
    known to look at the 32 bit registry for Java, as we need a JDK of matching bitness.
    We may need this option for other oowintool tasks.
    
    Introduce the "mscx" COMNAME for 64 bit AOO.
    
    Add the remaining gbuild and dmake changes necessary to use the 64 bit MSVC compiler.
    
    Patch by: me

diff --git a/odk/settings/settings.mk b/odk/settings/settings.mk
index 0976ec27b988..f22d2d1eedb2 100644
--- a/odk/settings/settings.mk
+++ b/odk/settings/settings.mk
@@ -57,6 +57,8 @@ JAVABIN=bin
 ifeq "$(PLATFORM)" "windows"
 # Settings for Windows using Microsoft compiler/linker
 
+PROCTYPE := $(shell $(PRJ)/config.guess | cut -d"-" -f1 | sed -e 's/^i.86$$/i386/')
+
 OS=WIN
 PS=\\
 ICL=$$
@@ -119,8 +121,14 @@ SDK_JAVA_INCLUDES = -I"$(OO_SDK_JAVA_HOME)/include" -I"$(OO_SDK_JAVA_HOME)/inclu
 # define for used compiler necessary for UNO
 # -DCPPU_ENV=msci -- windows msvc 4.x - 7.x
 
+ifeq "$(PROCTYPE)" "i386"
 CC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
 CC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=msci
+endif
+ifeq "$(PROCTYPE)" "x86_64"
+CC_DEFINES_JNI=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=mscx
+CC_DEFINES=-DWIN32 -DWNT -D_DLL -DCPPU_ENV=mscx
+endif
 CC_OUTPUT_SWITCH=-Fo
 
 LIBRARY_LINK_FLAGS=/NODEFAULTLIB /DLL /DEBUGTYPE:cv
diff --git a/oowintool b/oowintool
index 9d98e24720d7..72c5eada1459 100755
--- a/oowintool
+++ b/oowintool
@@ -23,6 +23,8 @@
 use File::Copy;
 
 my $output_format = 'u';
+my $aoo32OnWin64 = 0;
+
 
 sub reg_get_value($)
 {
@@ -282,23 +284,30 @@ sub print_dotnetsdk_dir()
 
 sub print_jdk_dir()
 {
-    my $dir =
-	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.8/JavaHome") ||
-	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.7/JavaHome") ||
-	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.6/JavaHome") ||
-	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.5/JavaHome") ||
-	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.4/JavaHome") ||
-	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.3/JavaHome");
-    if (defined $dir) {
-        print cygpath($dir, 'w', $output_format); 
-    } else {
-        # Java 1.9 had to be different:
-        my $currentVersion = reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/CurrentVersion");
-        defined $currentVersion || exit 1;
-        my $newDir = reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/JDK/" . $currentVersion . "/JavaHome");
-        defined $newDir || exit 1;
-        print cygpath($newDir, 'w', $output_format);
+    my $softwareKey;
+    if ($aoo32OnWin64) {
+        $softwareKey = "HKEY_LOCAL_MACHINE/SOFTWARE/Wow6432Node/";
+    }  else {
+        $softwareKey = "HKEY_LOCAL_MACHINE/SOFTWARE/";
     }
+    # Java 1.9 had to be different:
+    my $currentVersion = reg_get_value ($softwareKey . "JavaSoft/JDK/CurrentVersion");
+    if (defined $currentVersion) {
+        my $newDir = reg_get_value ($softwareKey . "JavaSoft/JDK/" . $currentVersion . "/JavaHome");
+        if (defined $newDir) {
+            print cygpath($newDir, 'w', $output_format);
+            return;
+        }
+    }
+    my $dir =
+	  reg_get_value ($softwareKey . "JavaSoft/Java\ Development\ Kit/1.8/JavaHome") ||
+	  reg_get_value ($softwareKey . "JavaSoft/Java\ Development\ Kit/1.7/JavaHome") ||
+	  reg_get_value ($softwareKey . "JavaSoft/Java\ Development\ Kit/1.6/JavaHome") ||
+	  reg_get_value ($softwareKey . "JavaSoft/Java\ Development\ Kit/1.5/JavaHome") ||
+	  reg_get_value ($softwareKey . "JavaSoft/Java\ Development\ Kit/1.4/JavaHome") ||
+	  reg_get_value ($softwareKey . "JavaSoft/Java\ Development\ Kit/1.3/JavaHome");
+    defined $dir || exit 1;
+    print cygpath($dir, 'w', $output_format);
 }
 
 sub print_nsis_dir()
@@ -372,7 +381,8 @@ while (@ARGV) {
 while (@commands) {
     $opt = shift @commands;
 
-    if (0) {
+    if ($opt eq '--aoo32-on-win64') {
+	$aoo32OnWin64 = 1;
     } elsif ($opt eq '--msvc-ver') {
 	print_msvc_ver();
     } elsif ($opt eq '--msvc-copy-dlls') {
diff --git a/set_soenv.in b/set_soenv.in
index 1ee2026213ed..7343f2061455 100644
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -680,8 +680,6 @@ elsif ( $platform =~ m/cygwin/ )
       $USE_DIRECTX5   = "";
       $FRAME_HOME     = PathFormat('@FRAME_HOME@');
       $USE_NEW_SDK    = "TRUE";
-      $CPUNAME        = "INTEL";
-      $CPU            = "I";
       $GUI            = "WNT";
       $GUIBASE        = "WIN";
       $GVER           = "NT351";
@@ -698,19 +696,18 @@ elsif ( $platform =~ m/cygwin/ )
       $outfile        = "winmingw.set"; 
       $COMPATH        = PathFormat('@COMPATH@/bin');
       $COMPATH        =~ s/\/bin$//i;
+      $CPUNAME        = "INTEL";
+      $CPU            = "I";
       $CVER           = "C341";
       $OUTPATH        = "wntgcci";
-      $INPATH         = $OUTPATH.$PROEXT;
       $ATL_INCLUDE = '$SOLARVER'.$ds.'$INPATH'.$ds."inc".$ds."external".$ds."mingw".$ds."include".$ds."atl". " ".'$PSDK_HOME'.$ds."include".$ds."atl";
   }
   else # The MSVC section starts here
-  {   $outfile        = "winenv.set";
+  {
       $COMPATH        = PathFormat('@COMPATH@');
       $CXX_X64_BINARY = PathFormat('@COMPATH@/bin/amd64/cl.exe');
       $LINK_X64_BINARY = PathFormat('@COMPATH@/bin/amd64/link.exe');
       $LIBMGR_X64_BINARY = PathFormat('@COMPATH@/bin/amd64/lib.exe');
-      $OUTPATH        = "wntmsci at COMEX@";
-      $INPATH         = $OUTPATH.$PROEXT;
       $COMEX          = '@COMEX@';
       if ( "@COMEX@" eq "10" ) { # .NET 2003 needs M1310
           $CVER        = "M1310";
@@ -723,11 +720,27 @@ elsif ( $platform =~ m/cygwin/ )
 	      die "Unsupported value for COMEX variable.\n";
 	  }
       }
-      print "Setting W32 build with bash shell specific values... ";
       # No special treatment for CC and CXX anymore.
       $FLIPCMD        = "slfl.pl";
       $PATH_SEPERATOR = ';';
+      if ( $platform =~ m/^i[3456]86/ || ( ( $platform =~ m/^x86_64/ ) && ( "@BUILD_WIN64@" ne "TRUE" ) ) ) {
+          print "Setting Windows x86 build with bash shell specific values... ";
+          $outfile    = "winenv.set";
+          $CPU        = "I";
+          $CPUNAME    = "INTEL";
+          $OUTPATH    = "wntmsci at COMEX@";
+      } elsif ( $platform =~ m/^x86_64/ ) {
+          print "Setting Windows x86_64 build with bash shell specific values... ";
+          $outfile    = "winAMD64Env.set";
+          $CPU        = "X";
+          $CPUNAME    = "X86_64";
+          $OUTPATH    = "wntmscx at COMEX@";
+      } else {
+          print "Unsupported Windows architecture: $platform \n";
+          exit 1;
+      }
   }
+  $INPATH = $OUTPATH.$PROEXT;
 }
 elsif ( $platform =~ m/os2/ ) 
 { 
@@ -1061,10 +1074,19 @@ if ($platform =~ m/cygwin|os2/)
    # Mingw is different
    if ( "@COM@" eq "MSC" )
    {  $ILIB       .=    $wps.$SOLARVER.$ds.$INPATH.$LIB.
-                        $wps.$JAVA_HOME.$LIB.
-                        $wps.$PSDK_HOME.$LIB.
+                        $wps.$JAVA_HOME.$LIB;
+      if ( ( $CPUNAME eq "INTEL" ) || ( ( $CPUNAME eq "X86_64" ) && ( "@BUILD_WIN64@" ne "TRUE" ) ) ) {
+          $ILIB   .=    $wps.$PSDK_HOME.$LIB.
                         $wps.$FRAME_HOME.$LIB.
                         $wps.$COMPATH.$LIB;
+      } elsif ( $CPUNAME eq "X86_64" ) {
+          $ILIB   .=    $wps.$PSDK_HOME.$LIB.$ds."x64".
+                        $wps.$FRAME_HOME.$LIB.
+                        $wps.$COMPATH.$LIB.$ds."amd64";
+      } else {
+          print "Unsupported Windows CPU: $CPUNAME\n";
+          exit 1;
+      }
       if ( '@ENABLE_DIRECTX@' ne "" ) {
           # We may have DirectX but not DirectDraw
           if ( '@ENABLE_DIRECT_DRAW@' ne "") {
@@ -1154,11 +1176,18 @@ elsif ($platform =~ m/cygwin/)
    }
 
    # Add path to compiler
-   $tmppath = CygFormat($COMPATH).$BIN;
-   $tmppath =~ s/^\/\//\//;
-   $PATH .= $ps.$tmppath;
-
    if ( "@COM@" eq "MSC" ) {
+       if ( ( $CPUNAME eq "INTEL" ) || ( ( $CPUNAME eq "X86_64") && ( "@BUILD_WIN64@" ne "TRUE" ) ) ) {
+           $tmppath = CygFormat($COMPATH).$BIN;
+       } elsif ( $CPUNAME eq "X86_64" ) {
+           $tmppath = CygFormat($COMPATH).$BIN.$ds."amd64";
+       } else {
+           print "Unsupported Windows CPU: $CPU\n";
+           exit 1;
+       }
+       $tmppath =~ s/^\/\//\//;
+       $PATH .= $ps.$tmppath;
+
        $tmppath = CygFormat($MSPDB_PATH);
 	   # for .NET to find mspdb71.dll (needed by CL.EXE C/C++ Compiler)
 	   if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
@@ -1182,6 +1211,10 @@ elsif ($platform =~ m/cygwin/)
 		   }
 	   }
    } else { # Mingw is different
+       $tmppath = CygFormat($COMPATH).$BIN;
+       $tmppath =~ s/^\/\//\//;
+       $PATH .= $ps.$tmppath;
+
 	   # Native installer needs some files if the Windows Installer SDK
                $tmppath = CygFormat($PSDK_HOME);
 	   if ( $PATH !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) {
diff --git a/solenv/gbuild/platform/windows.mk b/solenv/gbuild/platform/windows.mk
index 771a7a73ce20..7e793775c38b 100644
--- a/solenv/gbuild/platform/windows.mk
+++ b/solenv/gbuild/platform/windows.mk
@@ -63,7 +63,12 @@ gb_COMPILERDEFS := \
 	-DFULL_DESK \
 	-DM1500 \
 
+ifeq ($(CPUNAME),INTEL)
 gb_CPUDEFS := -DINTEL -D_X86_=1
+endif
+ifeq ($(CPUNAME),X86_64)
+gb_CPUDEFS := -DX86_64 -D_AMD64_=1
+endif
 
 gb_RCDEFS := \
      -DWINVER=0x0400 \
@@ -187,11 +192,20 @@ gb_LinkTarget_NOEXCEPTIONFLAGS := \
 
 gb_NoexPrecompiledHeader_NOEXCEPTIONFLAGS := $(gb_LinkTarget_NOEXCEPTIONFLAGS)
 
+ifeq ($(CPUNAME),INTEL)
 gb_LinkTarget_LDFLAGS := \
 	-MACHINE:IX86 \
 	-NODEFAULTLIB \
 	$(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
-	
+
+endif
+ifeq ($(CPUNAME),X86_64)
+gb_LinkTarget_LDFLAGS := \
+	-MACHINE:X64 \
+	-NODEFAULTLIB \
+	$(patsubst %,-LIBPATH:%,$(filter-out .,$(subst ;, ,$(subst \,/,$(ILIB))))) \
+
+endif
 
 gb_DEBUG_CFLAGS := -Zi
 
@@ -437,7 +451,12 @@ endef
 # Library class
 
 gb_Library_DEFS := -D_DLL_
+ifeq ($(CPUNAME),INTEL)
 gb_Library_TARGETTYPEFLAGS := -DLL -OPT:NOREF -SAFESEH -NXCOMPAT -DYNAMICBASE
+endif
+ifeq ($(CPUNAME),X86_64)
+gb_Library_TARGETTYPEFLAGS := -DLL -OPT:NOREF -NXCOMPAT -DYNAMICBASE
+endif
 gb_Library_get_rpath :=
 
 gb_Library_SYSPRE := i
@@ -608,7 +627,12 @@ endef
 # Executable class
 
 gb_Executable_EXT := .exe
+ifeq ($(CPUNAME),INTEL)
 gb_Executable_TARGETTYPEFLAGS := -RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG -SAFESEH -NXCOMPAT -DYNAMICBASE
+endif
+ifeq ($(CPUNAME),X86_64)
+gb_Executable_TARGETTYPEFLAGS := -RELEASE -BASE:0x1b000000 -OPT:NOREF -INCREMENTAL:NO -DEBUG -NXCOMPAT -DYNAMICBASE
+endif
 gb_Executable_get_rpath :=
 gb_Executable_TARGETGUI := 
 
diff --git a/solenv/inc/wnt.mk b/solenv/inc/wnt.mk
index 0b6bacaca67f..f5e0d6ba7144 100644
--- a/solenv/inc/wnt.mk
+++ b/solenv/inc/wnt.mk
@@ -39,6 +39,10 @@
 .INCLUDE : wntgcci.mk
 .ENDIF
 
+.IF "$(OS)$(COM)$(CPU)" == "WNTMSCX"
+.INCLUDE : wntmscx.mk
+.ENDIF
+
 # --- changes for W32-tcsh - should move into settings.mk ---
 JAVAC=javac
 JAVA=java


More information about the Libreoffice-commits mailing list