changeset 5929:f5dfcf2323bc cygwin

vs2015_3.patch applied, and some vs64 fixes
author Henry Thompson <ht@markup.co.uk>
date Tue, 08 Dec 2015 09:05:19 +0000
parents 2f34b59f451a
children a0d9bfe304de
files notes.txt nt/xemacs.mak src/intl-auto-encap-win32.c src/lisp-disunion.h src/lisp.h src/s/windowsnt.h src/sysproc.h
diffstat 7 files changed, 77 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/notes.txt	Fri Jul 24 14:48:46 2015 +0100
+++ b/notes.txt	Tue Dec 08 09:05:19 2015 +0000
@@ -308,3 +308,22 @@
  src/specifier.c
  src/toolbar-msw.c
  src/win32.c
+---
+default branch, abandoned cygwin64 as system-type
+Trying to compile with vs2015:
+
+  > patch -p 1 < ../xemacs-21.5-upstream/vs2015_3.patch
+  patching file nt/xemacs.mak
+  Hunk #4 FAILED at 796.
+  1 out of 19 hunks FAILED -- saving rejects to file nt/xemacs.mak.rej
+  patching file src/intl-auto-encap-win32.c
+  Hunk #1 FAILED at 36.
+  Hunk #2 succeeded at 3147 with fuzz 2 (offset -199 lines).
+  Hunk #3 succeeded at 3156 with fuzz 2 (offset -199 lines).
+  1 out of 3 hunks FAILED -- saving rejects to file src/intl-auto-encap-win32.c.rej
+  patching file src/s/windowsnt.h
+  patching file src/sysproc.h
+OK, did first (.mak) by hand, other was there, in a different place,
+already.
+Compilation produces _lots_ of warnings about type/size conversions,
+slowly figuring out fixes, possible not all correct :-(
--- a/nt/xemacs.mak	Fri Jul 24 14:48:46 2015 +0100
+++ b/nt/xemacs.mak	Tue Dec 08 09:05:19 2015 +0000
@@ -486,6 +486,8 @@
 EMACS_CONFIGURATION=alpha-pc-win32
 !else if "$(PROCESSOR_ARCHITECTURE)" == "PPC"
 EMACS_CONFIGURATION=ppc-pc-win32
+!else if "$(PROCESSOR_ARCHITECTURE)" == "AMD64"
+EMACS_CONFIGURATION=i686-pc-win64
 !else
 ! error Unknown processor architecture type $(PROCESSOR_ARCHITECTURE)
 !endif
@@ -543,6 +545,7 @@
 OPT_DEFINES=$(OPT_DEFINES) -DHAVE_XPM -DFOR_MSW
 OPT_INCLUDES=$(OPT_INCLUDES) -I"$(XPM_DIR)" -I"$(XPM_DIR)\lib"
 OPT_LIBS=$(OPT_LIBS) "$(XPM_DIR)\lib\Xpm.lib"
+OPT_PATH=$(OPT_PATH)$(XPM_DIR)\lib;
 !endif
 !if $(HAVE_GIF)
 OPT_DEFINES=$(OPT_DEFINES) -DHAVE_GIF
@@ -595,8 +598,10 @@
 OPT_INCLUDES=$(OPT_INCLUDES) -I"$(DATABASE_DIR)\build_win32"
 !if $(BUILD_DATABASE_SHARED)
 OPT_LIBS=$(OPT_LIBS) "$(DATABASE_DIR)\build_win32\Release\libdb43.lib"
+OPT_PATH=$(OPT_PATH)$(DATABASE_DIR)\build_win32\Release;
 !else
 OPT_LIBS=$(OPT_LIBS) "$(DATABASE_DIR)\build_win32\Release_static\libdb43s.lib"
+OPT_PATH=$(OPT_PATH)$(DATABASE_DIR)\build_win32\Release_static;
 !endif
 OPT_OBJS=$(OPT_OBJS) $(OUTDIR)\database.obj
 !endif
@@ -738,10 +743,10 @@
 !if $(USE_CRTDLL)
 !  if $(DEBUG_XEMACS) && "$(OK_TO_USE_MSVCRTD)" == "1"
 C_LIBFLAG=-MDd
-LIBC_LIB=msvcrtd.lib
+LIBC_LIB=msvcrtd.lib ucrtd.lib vcruntimed.lib
 !  else
 C_LIBFLAG=-MD
-LIBC_LIB=msvcrt.lib
+LIBC_LIB=msvcrt.lib ucrt.lib vcruntime.lib
 !  endif
 !else
 C_LIBFLAG=-ML
@@ -793,7 +798,7 @@
 INCLUDES=-I$(NT)\inc -I$(SRC) $(OPT_INCLUDES)
 
 DEFINES=$(OPT_DEFINES) \
-	-DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs -DNTDDI_VERSION=NTDDI_WIN2K -D_WIN32_WINNT=_WIN32_WINNT_WIN2K \
+	-DWIN32_LEAN_AND_MEAN -DWIN32_NATIVE -Demacs -DNTDDI_VERSION=NTDDI_WIN2K -D_WIN32_WINNT=_WIN32_WINNT_WIN2K -D_CRT_NO_POSIX_ERROR_CODES \
 	-DHAVE_CONFIG_H $(PROGRAM_DEFINES) $(PATH_DEFINES)
 
 CFLAGS_NO_OPT=-nologo -W3 -DSTRICT $(DEBUG_FLAGS_COMPILE)
@@ -1103,7 +1108,7 @@
 # If we're using Visual Studio 2005 or greater,
 # embed the manifest into the executable.
 !if $(MSC_VER) >= 1400
-	mt -manifest $@.manifest -outputresource:$@;1
+	@if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
 !endif
 
 # Individual dependencies
@@ -1113,7 +1118,7 @@
 # If we're using Visual Studio 2005 or greater,
 # embed the manifest into the executable.
 !if $(MSC_VER) >= 1400
-	mt -manifest $@.manifest -outputresource:$@;1
+	@if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
 !endif
 
 $(BLDLIB_SRC)/movemail.exe : $(LIB_SRC)/movemail.c $(LIB_SRC)/pop.c $(ETAGS_DEPS)
@@ -1124,7 +1129,7 @@
 # If we're using Visual Studio 2005 or greater,
 # embed the manifest into the executable.
 !if $(MSC_VER) >= 1400
-	mt -manifest $@.manifest -outputresource:$@;1
+	@if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
 !endif
 
 LIB_SRC_TOOLS = \
@@ -1324,7 +1329,7 @@
  mpr.lib uuid.lib imm32.lib $(INTEL_LIBS) $(LIBC_LIB)
 TEMACS_COMMON_LFLAGS=-nologo $(LIBRARIES) $(DEBUG_FLAGS_LINK) \
  -base:0x1000000 -stack:0x800000 $(TEMACS_ENTRYPOINT) -subsystem:windows \
- -heap:0x00100000 -nodefaultlib $(PROFILE_FLAGS) setargv.obj
+ -heap:0x00100000 -nodefaultlib -dynamicbase:no $(PROFILE_FLAGS) setargv.obj
 TEMACS_LFLAGS=$(TEMACS_COMMON_LFLAGS) \
  -pdb:$(BLDSRC)\temacs.pdb -map:$(BLDSRC)\temacs.map
 XEMACS_LFLAGS=$(TEMACS_COMMON_LFLAGS) \
@@ -1334,8 +1339,10 @@
 
 RAW_EXE=$(BLDSRC)\temacs.exe
 DUMP_TARGET = $(BLDSRC)\xemacs.exe
-DO_TEMACS = "$(BLDLIB_SRC)\i" "$(RAW_EXE)"
-DO_XEMACS = "$(BLDLIB_SRC)\i" "$(DUMP_TARGET)"
+#DO_TEMACS = "$(BLDLIB_SRC)\i" "$(RAW_EXE)" removed by HST, i.exe crashes
+DO_TEMACS = "$(RAW_EXE)"
+#DO_XEMACS = "$(BLDLIB_SRC)\i" "$(DUMP_TARGET)" ditto
+DO_XEMACS = "$(DUMP_TARGET)"
 
 BATCH = -no-packages -batch
 BATCH_PACKAGES = -vanilla -batch
@@ -1397,6 +1404,7 @@
 ## (3) Update the .elc's needed for dumping
 
 update-elc: $(RAW_EXE)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(TEMACS_BATCH) -l $(LISP)\update-elc.el
 
 ## This file is touched by update-elc.el when redumping is necessary.
@@ -1417,11 +1425,15 @@
 # calculates dependencies; see comments in src/Makefile.in.in.
 $(DOC): $(BLDLIB_SRC)\make-docfile.exe $(BLDSRC)\NEEDTODUMP $(TEMACS_DOC_SOURCES)
 !if $(QUICK_BUILD)
-	if not exist $(DOC) $(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(SRCROOT)\site-packages @<<
+	if not exist $(DOC) (
+	set PATH=$(OPT_PATH)$(PATH)
+	$(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(SRCROOT)\site-packages @<<
 $(**)
 <<
 	-touch $(DOC)
+	)
 !else
+	set PATH=$(OPT_PATH)$(PATH)
 	$(TEMACS_BATCH) -l $(LISP)\make-docfile.el -- -o $(DOC) -i $(SRCROOT)\site-packages @<<
 $(**)
 <<
@@ -1437,6 +1449,7 @@
 # requirements have changed.
 
 $(DUMP_TARGET): $(DOC) $(RAW_EXE) $(BLDSRC)\NEEDTODUMP
+	set PATH=$(OPT_PATH)$(PATH)
 	$(TEMACS_BATCH) -l $(LISP)\loadup.el dump
 !if $(USE_PORTABLE_DUMPER)
 	cd $(BLDSRC)
@@ -1450,7 +1463,7 @@
 # If we're using Visual Studio 2005 or greater,
 # embed the manifest into the executable.
 !if $(MSC_VER) >= 1400
-	mt -manifest $@.manifest -outputresource:$@;1
+	@if exist $@.manifest mt -manifest $@.manifest -outputresource:$@;1
 !endif
 
 !endif
@@ -1458,6 +1471,7 @@
 ## (6) Update the remaining .elc's, post-dumping
 
 update-elc-2: $(DUMP_TARGET)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(XEMACS_BATCH) -no-autoloads -l update-elc-2.el -f batch-update-elc-2 $(LISP)
 
 ## (7) Other random stuff
@@ -1465,6 +1479,7 @@
 $(LISP)/finder-inf.el: update-elc-2
 !if !$(QUICK_BUILD)
 	@echo Building finder database ...
+	set PATH=$(OPT_PATH)$(PATH)
 	$(XEMACS_BATCH)	-eval "(setq finder-compile-keywords-quiet t)" \
 		-l finder -f finder-compile-keywords
 	@echo Building finder database ...(done)
@@ -1473,6 +1488,7 @@
 load-shadows: update-elc-2
 !if !$(QUICK_BUILD)
 	@echo Testing for Lisp shadows ...
+	set PATH=$(OPT_PATH)$(PATH)
 	@$(XEMACS_BATCH) -f list-load-path-shadows
 !endif
 
@@ -1501,6 +1517,7 @@
 
 {$(MANDIR)}.texi{$(INFODIR)}.info:
 	cd $(MANDIR)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) $(**F)
 
 XEMACS_SRCS = \
@@ -1633,18 +1650,22 @@
 
 $(INFODIR)\xemacs.info: $(XEMACS_SRCS)
 	cd $(MANDIR)\xemacs
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) xemacs.texi
 
 $(INFODIR)\lispref.info: $(LISPREF_SRCS)
 	cd $(MANDIR)\lispref
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) lispref.texi
 
 $(INFODIR)\internals.info: $(INTERNALS_SRCS)
 	cd $(MANDIR)\internals
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) internals.texi
 
 $(INFODIR)\new-users-guide.info: $(NEW_USERS_GUIDE_SRCS)
 	cd $(MANDIR)\new-users-guide
+	set PATH=$(OPT_PATH)$(PATH)
 	$(MAKEINFO) new-users-guide.texi
 
 info:	makeinfo-test $(INFO_FILES)
@@ -1660,14 +1681,17 @@
 
 check:
 	cd $(BLDSRC)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(DO_XEMACS) $(batch_test_emacs)
 
 check-temacs:
 	cd $(BLDSRC)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(TEMACS_BATCH) $(run_temacs_args) $(batch_test_emacs)
 
 check-features: all
 	cd $(BLDSRC)
+	set PATH=$(OPT_PATH)$(PATH)
 	$(XEMACS_BATCH) -l check-features.el
 
 
@@ -1832,6 +1856,7 @@
 @echo off
 @"$(MAKEINFO)" --version
 @if not errorlevel 1 goto test_done
+@set PATH=$(OPT_PATH)$(PATH)
 @$(XEMACS_BATCH_PACKAGES) -eval "(condition-case nil (require (quote texinfo)) (t (kill-emacs 1)))"
 @if not errorlevel 1 goto suggest_makeinfo
 @echo XEmacs 'info' cannot be built!
--- a/src/intl-auto-encap-win32.c	Fri Jul 24 14:48:46 2015 +0100
+++ b/src/intl-auto-encap-win32.c	Tue Dec 08 09:05:19 2015 +0000
@@ -3147,6 +3147,7 @@
 
 #if defined (HAVE_MS_WINDOWS)
 
+/*HST did this
 DWORD
 qxeGetKerningPairs (HDC hdc, DWORD nPairs, LPKERNINGPAIR lpKernPair)
 {
@@ -3155,6 +3156,7 @@
   else
     return GetKerningPairsA (hdc, nPairs, lpKernPair);
 }
+*/
 
 #endif /* defined (HAVE_MS_WINDOWS) */
 
--- a/src/lisp-disunion.h	Fri Jul 24 14:48:46 2015 +0100
+++ b/src/lisp-disunion.h	Tue Dec 08 09:05:19 2015 +0000
@@ -77,7 +77,7 @@
 typedef EMACS_INT Lisp_Object;
 
 #define Lisp_Type_Fixnum_Bit (Lisp_Type_Fixnum_Even & Lisp_Type_Fixnum_Odd)
-#define VALMASK (((1UL << VALBITS) - 1UL) << GCTYPEBITS)
+#define VALMASK ((((uintptr_t)1UL << VALBITS) - 1UL) << GCTYPEBITS)
 #define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) & ~VALMASK))
 #define XPNTRVAL(x) (x) /* This depends on Lisp_Type_Record == 0 */
 #define XCHARVAL(x) ((x) >> GCBITS)
--- a/src/lisp.h	Fri Jul 24 14:48:46 2015 +0100
+++ b/src/lisp.h	Tue Dec 08 09:05:19 2015 +0000
@@ -425,6 +425,11 @@
 #include <inttypes.h>
 #elif defined (HAVE_INTPTR_T_IN_SYS_TYPES_H)
 /* included elsewhere */
+#elif defined _WIN64
+    typedef unsigned __int64 size_t;
+    typedef __int64          ptrdiff_t;
+    typedef __int64          intptr_t;
+    typedef unsigned __int64 uintptr_t;
 #elif SIZEOF_VOID_P == SIZEOF_INT
 typedef int intptr_t;
 typedef unsigned int uintptr_t;
--- a/src/s/windowsnt.h	Fri Jul 24 14:48:46 2015 +0100
+++ b/src/s/windowsnt.h	Tue Dec 08 09:05:19 2015 +0000
@@ -63,6 +63,8 @@
 
 #define HAVE_TIMEVAL
 #define HAVE_TZNAME
+/* need this, where should it go? HST */
+#define tzname _tzname
 #define HAVE_H_ERRNO
 
 #define HAVE_CLOSEDIR
@@ -99,8 +101,15 @@
 #define SIZEOF_SHORT 2
 #define SIZEOF_INT 4
 #define SIZEOF_LONG 4
+#ifdef _WIN64
+#define SIZEOF_LONG_LONG 8
+#define SIZEOF_VOID_P 8
+#define SIZEOF_DOUBLE 8
+#define SIZEOF_OFF_T 8
+#else
 #define SIZEOF_LONG_LONG 0
 #define SIZEOF_VOID_P 4
+#endif
 
 typedef int mode_t;
 typedef int pid_t;
@@ -176,9 +185,11 @@
 #pragma warning ( disable : 4646 )
 #endif 
 
-/* MSVC version >= 2.x without /Za supports __inline */
+/* MSVC version >= 2.x without /Za supports __inline
+   HST cut this -- VS2015 complains
 #if (_MSC_VER < 900) || defined (__STDC__)
 # define inline
 #else
 # define inline __inline
 #endif
+ */
--- a/src/sysproc.h	Fri Jul 24 14:48:46 2015 +0100
+++ b/src/sysproc.h	Tue Dec 08 09:05:19 2015 +0000
@@ -35,8 +35,8 @@
    This is not true with visual c though. The trick below works with
    VC4.2b, 5.0 and 6.0. It assumes that VC is installed in a kind of
    standard way, so include path ends with /include.
-*/
-#include <../include/process.h>
+   HST changed this to ucrt */
+#include <../ucrt/process.h>
 #endif
 
 #ifdef HAVE_SOCKETS	/* TCP connection support, if kernel can do it */