[gs-cvs] gs/src
Russell Lang
ghostgum at ghostscript.com
Fri Mar 4 13:58:57 PST 2005
Update of /cvs/ghostscript/gs/src
In directory casper2:/tmp/cvs-serv10462/src
Modified Files:
dwsetup.cpp dwsetup.rc dwuninst.cpp gp_mswin.c gp_mswin.h
gsdll32.def msvc32.mak msvccmd.mak msvctail.mak winint.mak
Log Message:
Compile Ghostscript for 64-bit Windows with AMD64 processor.
Change the default install directory to "c:\program files\gs".
DETAILS:
Microsoft Visual Studio .NET 2003 with Windows Server 2003 DDK,
or Microsoft Visual Studio 8 (.NET 2005 beta) are required
to compile for 64-bits.
Dialog boxes return type INT_PTR not BOOL.
Install to the "Program Files" directory as default,
instead of c:\gs. This allows 32-bit and 64-bit
versions to be installed in separate locations.
For 32-bit GS on 32-bit Windows, "c:\Program Files\gs"
For 32-bit GS on 64-bit Windows, "c:\Program Files (x86)\gs"
For 64-bit GS on 64-bit Windows, "c:\Program Files\gs"
The " (x86)" is added by Windows when a 32-bit program asks
for the "Program Files" folder on 64-bit Windows.
Other languages will translate "Program Files".
The programs still have "32" in their names: gswin32c.exe,
gswin32.exe and gsdll32.dll. They are distinguished from
the 32-bit versions by their install location.
This avoids changes to many batch files.
The registry entries written by the installer do not
conflict between 32 and 64-bit.
For 32 on 32, or 64 on 64, the location is
HKLM\Software\AFPL Ghostscript\N.NN
For 32 on 64, Windows adds "WoW6432Node\" to make it
HKLM\Software\Wow6432Node\AFPL Ghostscript\N.NN
If the "Program Files" folder has a " (x86)" suffix,
this is used as a suffix on the Start Menu items. This
allows 32-bit and 64-bit GS to be installed without
conflict. The start menu item for 32-bit GS on 64-bit
Windows is "Ghostscript N.NN (x86)".
Building 64-bit GS on 32-bit Windows can be done
by the usual method - either execute genconf.exe on
a 64-bit platform or hand edit arch.h.
A separate patch will fix the display device DisplayHandle
parameter which is currently truncated to 32-bits.
There is a warning from the linker about exports being
defined multiple ways. This is not a problem with the
32-bit compile. This is due to the C code
specifying export and the module definition file
also specifying the export. Removing the function
names from the module definition file would make the
warning message go away, but may affect 32-bit compiles.
Index: dwsetup.cpp
===================================================================
RCS file: /cvs/ghostscript/gs/src/dwsetup.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- dwsetup.cpp 24 Nov 2004 08:12:18 -0000 1.10
+++ dwsetup.cpp 4 Mar 2005 21:58:55 -0000 1.11
@@ -80,6 +80,21 @@
#include "dwsetup.h"
#include "dwinst.h"
+extern "C" {
+typedef HRESULT (WINAPI *PFN_SHGetFolderPath)(
+ HWND hwndOwner,
+ int nFolder,
+ HANDLE hToken,
+ DWORD dwFlags,
+ LPSTR pszPath);
+
+typedef BOOL (WINAPI *PFN_SHGetSpecialFolderPath)(
+ HWND hwndOwner,
+ LPTSTR lpszPath,
+ int nFolder,
+ BOOL fCreate);
+}
+
//#define DEBUG
#define UNINSTALLPROG "uninstgs.exe"
@@ -129,9 +144,14 @@
BOOL g_bError = FALSE; // TRUE = Install was not successful
BOOL is_winnt = FALSE; // Disable "All Users" if not NT.
+#ifdef _WIN64
+#define DLGRETURN INT_PTR
+#else
+#define DLGRETURN BOOL
+#endif
// Prototypes
-BOOL CALLBACK MainDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
+DLGRETURN CALLBACK MainDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
void gs_addmess_count(const char *str, int count);
void gs_addmess(const char *str);
void gs_addmess_update(void);
@@ -142,6 +162,7 @@
BOOL make_filelist(int argc, char *argv[]);
int get_font_path(char *path, unsigned int pathlen);
BOOL write_cidfmap(const char *gspath, const char *cidpath);
+BOOL GetProgramFiles(LPTSTR path);
//////////////////////////////////////////////////////////////////////
@@ -190,7 +211,7 @@
int twend;
// Modeless Dialog Box
-BOOL CALLBACK
+DLGRETURN CALLBACK
TextWinDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
@@ -338,7 +359,7 @@
char szFolderName[MAXSTR];
char szDirName[MAXSTR];
-BOOL CALLBACK
+DLGRETURN CALLBACK
DirDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
WORD notify_message;
@@ -489,8 +510,12 @@
}
// Interactive setup
+ if (!GetProgramFiles(g_szTargetDir))
+ strcpy(g_szTargetDir, "C:\\Program Files");
+ strcat(g_szTargetDir, "\\");
LoadString(g_hInstance, IDS_TARGET_DIR,
- g_szTargetDir, sizeof(g_szTargetDir));
+ g_szTargetDir+strlen(g_szTargetDir),
+ sizeof(g_szTargetDir)-strlen(g_szTargetDir));
// main dialog box
g_hMain = CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_MAIN), (HWND)NULL, MainDlgProc, (LPARAM)NULL);
@@ -520,7 +545,7 @@
// Main Modeless Dialog Box
-BOOL CALLBACK
+DLGRETURN CALLBACK
MainDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
@@ -700,6 +725,8 @@
char szArguments[MAXSTR];
char szDescription[MAXSTR];
char szDotVersion[MAXSTR];
+ char szPlatformSuffix[MAXSTR];
+ const char *pSuffix = "";
if (g_bQuit)
return FALSE;
@@ -778,6 +805,22 @@
// Add Start Menu items
gs_addmess("Adding Start Menu items\n");
+
+ memset(szPlatformSuffix, 0, sizeof(szPlatformSuffix));
+ if (GetProgramFiles(szPlatformSuffix)) {
+ /* If ProgramFiles has a suffix like " (x86)" then use
+ * it for Start menu entries to distinguish between
+ * 32-bit and 64-bit programs.
+ */
+ for (pSuffix = szPlatformSuffix; *pSuffix; pSuffix++)
+ if ((pSuffix[0] == ' ') && (pSuffix[1] == '('))
+ break;
+ }
+ else {
+ pSuffix = "";
+ }
+
+
if (!cinst.StartMenuBegin()) {
gs_addmess("Failed to begin Start Menu update\n");
return FALSE;
@@ -789,7 +832,7 @@
strcpy(szArguments, "\042-I");
strcat(szArguments, szLIB);
strcat(szArguments, "\042");
- sprintf(szDescription, "Ghostscript %s", szDotVersion);
+ sprintf(szDescription, "Ghostscript %s%s", szDotVersion, pSuffix);
if (!cinst.StartMenuAdd(szDescription, szProgram, szArguments)) {
gs_addmess("Failed to add Start Menu item\n");
return FALSE;
@@ -798,7 +841,8 @@
strcat(szProgram, "\\");
strcat(szProgram, cinst.GetMainDir());
strcat(szProgram, "\\doc\\Readme.htm");
- sprintf(szDescription, "Ghostscript Readme %s", szDotVersion);
+ sprintf(szDescription, "Ghostscript Readme %s%s",
+ szDotVersion, pSuffix);
if (!cinst.StartMenuAdd(szDescription, szProgram, NULL)) {
gs_addmess("Failed to add Start Menu item\n");
return FALSE;
@@ -1189,3 +1233,77 @@
}
//////////////////////////////////////////////////////////////////////
+
+#ifndef CSIDL_PROGRAM_FILES
+#define CSIDL_PROGRAM_FILES 0x0026
+#endif
+#ifndef CSIDL_FLAG_CREATE
+#define CSIDL_FLAG_CREATE 0x8000
+#endif
+#ifndef SHGFP_TYPE_CURRENT
+#define SHGFP_TYPE_CURRENT 0
+#endif
+
+BOOL
+GetProgramFiles(LPTSTR path)
+{
+ PFN_SHGetSpecialFolderPath PSHGetSpecialFolderPath = NULL;
+ PFN_SHGetFolderPath PSHGetFolderPath = NULL;
+ HMODULE hModuleShell32 = NULL;
+ HMODULE hModuleShfolder = NULL;
+ BOOL fOk = FALSE;
+ hModuleShfolder = LoadLibrary("shfolder.dll");
+ hModuleShell32 = LoadLibrary("shell32.dll");
+
+ if (hModuleShfolder) {
+ PSHGetFolderPath = (PFN_SHGetFolderPath)
+ GetProcAddress(hModuleShfolder, "SHGetFolderPathA");
+ if (PSHGetFolderPath) {
+ fOk = (PSHGetFolderPath(HWND_DESKTOP,
+ CSIDL_PROGRAM_FILES | CSIDL_FLAG_CREATE,
+ NULL, SHGFP_TYPE_CURRENT, path) == S_OK);
+ }
+ }
+
+ if (!fOk && hModuleShell32) {
+ PSHGetFolderPath = (PFN_SHGetFolderPath)
+ GetProcAddress(hModuleShell32, "SHGetFolderPathA");
+ if (PSHGetFolderPath) {
+ fOk = (PSHGetFolderPath(HWND_DESKTOP,
+ CSIDL_PROGRAM_FILES | CSIDL_FLAG_CREATE,
+ NULL, SHGFP_TYPE_CURRENT, path) == S_OK);
+ }
+ }
+
+ if (!fOk && hModuleShell32) {
+ PSHGetSpecialFolderPath = (PFN_SHGetSpecialFolderPath)
+ GetProcAddress(hModuleShell32, "SHGetSpecialFolderPathA");
+ if (PSHGetSpecialFolderPath) {
+ fOk = PSHGetSpecialFolderPath(HWND_DESKTOP, path,
+ CSIDL_PROGRAM_FILES, TRUE);
+ }
+ }
+
+ if (!fOk) {
+ /* If all else fails (probably Win95), try the registry */
+ LONG rc;
+ HKEY hkey;
+ DWORD cbData;
+ DWORD keytype;
+ rc = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ "SOFTWARE\\Microsoft\\Windows\\CurrentVersion", 0, KEY_READ, &hkey);
+ if (rc == ERROR_SUCCESS) {
+ cbData = MAX_PATH;
+ keytype = REG_SZ;
+ if (rc == ERROR_SUCCESS)
+ rc = RegQueryValueEx(hkey, "ProgramFilesDir", 0, &keytype,
+ (LPBYTE)path, &cbData);
+ RegCloseKey(hkey);
+ }
+ fOk = (rc == ERROR_SUCCESS);
+ }
+ return fOk;
+}
+
+
+//////////////////////////////////////////////////////////////////////
Index: dwsetup.rc
===================================================================
RCS file: /cvs/ghostscript/gs/src/dwsetup.rc,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- dwsetup.rc 18 Nov 2004 06:48:41 -0000 1.12
+++ dwsetup.rc 4 Mar 2005 21:58:55 -0000 1.13
@@ -140,7 +140,7 @@
STRINGTABLE DISCARDABLE
BEGIN
IDS_APPNAME "AFPL Ghostscript Setup"
- IDS_TARGET_DIR "C:\\gs"
+ IDS_TARGET_DIR "gs"
IDS_TARGET_GROUP "Ghostscript"
END
Index: dwuninst.cpp
===================================================================
RCS file: /cvs/ghostscript/gs/src/dwuninst.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- dwuninst.cpp 18 Nov 2004 06:48:41 -0000 1.5
+++ dwuninst.cpp 4 Mar 2005 21:58:55 -0000 1.6
@@ -38,6 +38,13 @@
#define MAXSTR 256
#define UNINSTALLKEY TEXT("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall")
+#ifdef _WIN64
+#define DLGRETURN INT_PTR
+#else
+#define DLGRETURN BOOL
+#endif
+
+
HWND hDlgModeless;
HWND hText1;
HWND hText2;
@@ -673,7 +680,7 @@
#ifdef __BORLANDC__
#pragma argsused
#endif
-BOOL CALLBACK _export
+DLGRETURN CALLBACK _export
RemoveDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
Index: gp_mswin.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gp_mswin.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- gp_mswin.c 5 Aug 2004 17:02:36 -0000 1.24
+++ gp_mswin.c 4 Mar 2005 21:58:55 -0000 1.25
@@ -149,7 +149,7 @@
/* Dialog box to select printer port */
-BOOL CALLBACK
+DLGRETURN CALLBACK
SpoolDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
LPSTR entry;
Index: gp_mswin.h
===================================================================
RCS file: /cvs/ghostscript/gs/src/gp_mswin.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gp_mswin.h 21 Feb 2002 22:24:52 -0000 1.6
+++ gp_mswin.h 4 Mar 2005 21:58:55 -0000 1.7
@@ -50,6 +50,12 @@
extern BOOL is_win32s;
extern int is_spool(const char *queue);
+#ifdef _WIN64
+#define DLGRETURN INT_PTR
+#else
+#define DLGRETURN BOOL
+#endif
+
#endif /* !defined(RC_INVOKED) */
#endif /* gp_mswin_INCLUDED */
Index: gsdll32.def
===================================================================
RCS file: /cvs/ghostscript/gs/src/gsdll32.def,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gsdll32.def 20 Feb 2004 06:46:30 -0000 1.5
+++ gsdll32.def 4 Mar 2005 21:58:55 -0000 1.6
@@ -28,4 +28,4 @@
gsapi_set_stdio
gsapi_set_poll
gsapi_set_display_callback
- gsapi_set_visual_tracer
+ gsapi_set_visual_tracer
Index: msvc32.mak
===================================================================
RCS file: /cvs/ghostscript/gs/src/msvc32.mak,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- msvc32.mak 20 Dec 2004 22:17:39 -0000 1.69
+++ msvc32.mak 4 Mar 2005 21:58:55 -0000 1.70
@@ -152,6 +152,12 @@
NOPRIVATE=0
!endif
+# We can compile for a 32-bit or 64-bit target
+# WIN32 and WIN64 are mutually exclusive. WIN32 is the default.
+!if !defined(WIN32) && !defined(Win64)
+WIN32=0
+!endif
+
# Define the name of the executable file.
!ifndef GS
@@ -378,20 +384,37 @@
SHAREDBASE=
!else
COMPBASE=$(DEVSTUDIO)\Vc7
-SHAREDBASE=$(DEVSTUDIO)\Vc7\
+SHAREDBASE=$(DEVSTUDIO)\Vc7
+!ifdef WIN64
+# Windows Server 2003 DDK is needed for the 64-bit compiler
+# but it won't install on Windows XP 64-bit.
+DDKBASE=c:\winddk\3790
+COMPDIR64=$(DDKBASE)\bin\win64\x86\amd64
+LINKLIBPATH=/LIBPATH:"$(DDKBASE)\lib\wnet\amd64"
+INCDIR64A=$(DDKBASE)\inc\wnet
+INCDIR64B=$(DDKBASE)\inc\crt
+!endif
!endif
!endif
!if $(MSVC_VERSION) == 8
! ifndef DEVSTUDIO
+!ifdef WIN64
+DEVSTUDIO=C:\Program Files (x86)\Microsoft Visual Studio 8
+!else
DEVSTUDIO=C:\Program Files\Microsoft Visual Studio 8
+!endif
! endif
!if "$(DEVSTUDIO)"==""
COMPBASE=
SHAREDBASE=
!else
COMPBASE=$(DEVSTUDIO)\VC
-SHAREDBASE=$(DEVSTUDIO)\VC\
+SHAREDBASE=$(DEVSTUDIO)\VC
+!ifdef WIN64
+COMPDIR64=$(COMPBASE)\bin\x86_amd64
+LINKLIBPATH=/LIBPATH:"$(COMPBASE)\lib\amd64" /LIBPATH:"$(COMPBASE)\PlatformSDK\Lib\AMD64"
+!endif
!endif
!endif
@@ -405,17 +428,25 @@
!if "$(COMPBASE)"==""
COMPDIR=
!else
+!ifdef WIN64
+COMPDIR=$(COMPDIR64)
+!else
COMPDIR=$(COMPBASE)\bin
!endif
!endif
+!endif
!ifndef LINKDIR
!if "$(COMPBASE)"==""
LINKDIR=
!else
+!ifdef WIN64
+LINKDIR=$(COMPDIR64)
+!else
LINKDIR=$(COMPBASE)\bin
!endif
!endif
+!endif
!ifndef RCDIR
!if "$(SHAREDBASE)"==""
@@ -452,8 +483,12 @@
COMPCPP=$(COMP)
!endif
!ifndef COMPAUX
+!ifdef WIN64
+COMPAUX="$(COMPBASE)\bin\cl"
+!else
COMPAUX=$(COMP)
!endif
+!endif
!ifndef RCOMP
!if "$(RCDIR)"==""
@@ -491,6 +526,10 @@
!endif
!endif
+!ifndef LINKLIBPATH
+LINKLIBPATH=
+!endif
+
# Define the processor architecture. (i386, ppc, alpha)
!ifndef CPU_FAMILY
@@ -663,20 +702,20 @@
$(GS_XE): $(GSDLL_DLL) $(DWOBJ) $(GSCONSOLE_XE) $(SETUP_XE) $(UNINSTALL_XE)
echo /SUBSYSTEM:WINDOWS > $(PSGEN)gswin32.rsp
echo /DEF:$(PSSRCDIR)\dwmain32.def /OUT:$(GS_XE) >> $(PSGEN)gswin32.rsp
- $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(DWOBJ) @$(LIBCTR) $(GS_OBJ).res
+ $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(DWOBJ) $(LINKLIBPATH) @$(LIBCTR) $(GS_OBJ).res
del $(PSGEN)gswin32.rsp
# The console mode small EXE loader
$(GSCONSOLE_XE): $(OBJC) $(GS_OBJ).res $(PSSRCDIR)\dw32c.def
echo /SUBSYSTEM:CONSOLE > $(PSGEN)gswin32.rsp
echo /DEF:$(PSSRCDIR)\dw32c.def /OUT:$(GSCONSOLE_XE) >> $(PSGEN)gswin32.rsp
- $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(OBJC) @$(LIBCTR) $(GS_OBJ).res
+ $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(OBJC) $(LINKLIBPATH) @$(LIBCTR) $(GS_OBJ).res
del $(PSGEN)gswin32.rsp
# The big DLL
$(GSDLL_DLL): $(GS_ALL) $(DEVS_ALL) $(GSDLL_OBJS) $(GSDLL_OBJ).res $(PSGEN)lib32.rsp
echo /DLL /DEF:$(PSSRCDIR)\gsdll32.def /OUT:$(GSDLL_DLL) > $(PSGEN)gswin32.rsp
- $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(GSDLL_OBJS) @$(ld_tr) $(INTASM) @$(PSGEN)lib32.rsp @$(LIBCTR) $(GSDLL_OBJ).res
+ $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(GSDLL_OBJS) @$(ld_tr) $(INTASM) @$(PSGEN)lib32.rsp $(LINKLIBPATH) @$(LIBCTR) $(GSDLL_OBJ).res
del $(PSGEN)gswin32.rsp
!else
@@ -689,7 +728,7 @@
echo $(GLOBJ)dwtext.obj >> $(PSGEN)gswin32.tr
echo $(GLOBJ)dwreg.obj >> $(PSGEN)gswin32.tr
echo /DEF:$(PSSRCDIR)\dwmain32.def /OUT:$(GS_XE) > $(PSGEN)gswin32.rsp
- $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(GLOBJ)gsdll @$(PSGEN)gswin32.tr @$(LIBCTR) $(INTASM) @$(PSGEN)lib32.rsp $(GSDLL_OBJ).res $(DWTRACE)
+ $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(GLOBJ)gsdll @$(PSGEN)gswin32.tr $(LINKLIBPATH) @$(LIBCTR) $(INTASM) @$(PSGEN)lib32.rsp $(GSDLL_OBJ).res $(DWTRACE)
del $(PSGEN)gswin32.tr
del $(PSGEN)gswin32.rsp
@@ -702,7 +741,7 @@
echo $(PSOBJ)dwreg.obj >> $(PSGEN)gswin32c.tr
echo /SUBSYSTEM:CONSOLE > $(PSGEN)gswin32.rsp
echo /DEF:$(PSSRCDIR)\dw32c.def /OUT:$(GSCONSOLE_XE) >> $(PSGEN)gswin32.rsp
- $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(GLOBJ)gsdll @$(PSGEN)gswin32c.tr @$(LIBCTR) $(INTASM) @$(PSGEN)lib32.rsp $(GS_OBJ).res $(DWTRACE)
+ $(LINK) $(LCT) @$(PSGEN)gswin32.rsp $(GLOBJ)gsdll @$(PSGEN)gswin32c.tr $(LINKLIBPATH) @$(LIBCTR) $(INTASM) @$(PSGEN)lib32.rsp $(GS_OBJ).res $(DWTRACE)
del $(PSGEN)gswin32.rsp
del $(PSGEN)gswin32c.tr
!endif
@@ -717,7 +756,7 @@
copy $(LIBCTR) $(PSGEN)dwsetup.tr
echo ole32.lib >> $(PSGEN)dwsetup.tr
echo uuid.lib >> $(PSGEN)dwsetup.tr
- $(LINK) $(LCT) @$(PSGEN)dwsetup.rsp @$(PSGEN)dwsetup.tr $(PSOBJ)dwsetup.res
+ $(LINK) $(LCT) @$(PSGEN)dwsetup.rsp $(LINKLIBPATH) @$(PSGEN)dwsetup.tr $(PSOBJ)dwsetup.res
del $(PSGEN)dwsetup.rsp
del $(PSGEN)dwsetup.tr
@@ -727,7 +766,7 @@
copy $(LIBCTR) $(PSGEN)dwuninst.tr
echo ole32.lib >> $(PSGEN)dwuninst.tr
echo uuid.lib >> $(PSGEN)dwuninst.tr
- $(LINK) $(LCT) @$(PSGEN)dwuninst.rsp @$(PSGEN)dwuninst.tr $(PSOBJ)dwuninst.res
+ $(LINK) $(LCT) @$(PSGEN)dwuninst.rsp $(LINKLIBPATH) @$(PSGEN)dwuninst.tr $(PSOBJ)dwuninst.res
del $(PSGEN)dwuninst.rsp
del $(PSGEN)dwuninst.tr
Index: msvccmd.mak
===================================================================
RCS file: /cvs/ghostscript/gs/src/msvccmd.mak,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- msvccmd.mak 20 Dec 2004 22:17:39 -0000 1.24
+++ msvccmd.mak 4 Mar 2005 21:58:55 -0000 1.25
@@ -77,15 +77,18 @@
# Define the compilation flags.
# MSVC 8 (2005) warns about deprecated unsafe common functions like strcpy.
-!if $(MSVC_VERSION) == 8
+# MSVC 8 does not support debug compile and continue /Gi /ZI.
+!if ($(MSVC_VERSION) == 8) || defined(WIN64)
VC8WARN=/wd4996 /wd4224
+CDCC=
!else
VC8WARN=
+CDCC=/Gi /ZI
!endif
!if "$(CPU_FAMILY)"=="i386"
-!if $(MSVC_VERSION) >= 8
+!if ($(MSVC_VERSION) >= 8) || defined(WIN64)
# MSVC 8 (2005) attempts to produce code good for all processors.
# and doesn't used /G5 or /GB.
# MSVC 8 (2005) avoids buggy 0F instructions.
@@ -152,7 +155,7 @@
!if $(TDEBUG)!=0
# /Fd designates the directory for the .pdb file.
# Note that it must be followed by a space.
-CT=/ZI /Od /Fd$(GLOBJDIR) $(NULL) /Gi $(CPCH)
+CT=/Od /Fd$(GLOBJDIR) $(NULL) $(CDCC) $(CPCH)
LCT=/DEBUG /INCREMENTAL:YES
COMPILE_FULL_OPTIMIZED= # no optimization when debugging
COMPILE_WITH_FRAMES= # no optimization when debugging
@@ -190,6 +193,13 @@
!endif
!endif
+!if ($(MSVC_VERSION) == 7) && defined(WIN64)
+# Need to specify DDK include directories before .NET 2003 directories.
+MSINCFLAGS=-I"$(INCDIR64A)" -I"$(INCDIR64B)"
+!else
+MSINCFLAGS=
+!endif
+
# Specify output object name
CCOBJNAME=-Fo
@@ -202,7 +212,7 @@
# but it's too much work right now.
GENOPT=$(CP) $(CD) $(CT) $(CS) $(WARNOPT) $(VC8WARN) /nologo $(CMT)
-CCFLAGS=$(PLATOPT) $(FPFLAGS) $(CPFLAGS) $(CFLAGS) $(XCFLAGS)
+CCFLAGS=$(PLATOPT) $(FPFLAGS) $(CPFLAGS) $(CFLAGS) $(XCFLAGS) $(MSINCFLAGS)
CC=$(COMP) /c $(CCFLAGS) @$(GLGENDIR)\ccf32.tr
CPP=$(COMPCPP) /c $(CCFLAGS) @$(GLGENDIR)\ccf32.tr
!if $(MAKEDLL)
Index: msvctail.mak
===================================================================
RCS file: /cvs/ghostscript/gs/src/msvctail.mak,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- msvctail.mak 24 Oct 2003 06:14:59 -0000 1.10
+++ msvctail.mak 4 Mar 2005 21:58:55 -0000 1.11
@@ -38,9 +38,15 @@
# Don't create genarch if it's not needed
!ifdef GENARCH_XE
+!ifdef WIN64
+$(GENARCH_XE): $(GLSRC)genarch.c $(GENARCH_DEPS) $(GLGENDIR)\ccf32.tr
+ $(CC) @$(GLGENDIR)\ccf32.tr /Fo$(GLOBJ)genarch.obj $(GLSRC)genarch.c
+ $(LINK) $(LCT) $(LINKLIBPATH) $(GLOBJ)genarch.obj /OUT:$(GENARCH_XE)
+!else
$(GENARCH_XE): $(GLSRC)genarch.c $(GENARCH_DEPS) $(GLGENDIR)\ccf32.tr
$(CCAUX) @$(GLGENDIR)\ccf32.tr /Fo$(GLOBJ)genarch.obj /Fe$(GENARCH_XE) $(GLSRC)genarch.c $(CCAUX_TAIL)
!endif
+!endif
$(GENCONF_XE): $(GLSRC)genconf.c $(GENCONF_DEPS)
$(CCAUX) $(GLSRC)genconf.c /Fo$(GLOBJ)genconf.obj /Fe$(GENCONF_XE) $(CCAUX_TAIL)
Index: winint.mak
===================================================================
RCS file: /cvs/ghostscript/gs/src/winint.mak,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- winint.mak 20 Dec 2004 22:17:39 -0000 1.24
+++ winint.mak 4 Mar 2005 21:58:55 -0000 1.25
@@ -37,8 +37,12 @@
# Define the location of the WinZip self-extracting-archive-maker.
!ifndef WINZIPSE_XE
+!ifdef WIN64
+WINZIPSE_XE="C:\Program Files (x86)\WinZip Self-Extractor\WZIPSE32.EXE"
+!else
WINZIPSE_XE="C:\Program Files\WinZip Self-Extractor\WZIPSE32.EXE"
!endif
+!endif
# Define the name and location of the zip archive maker.
!ifndef ZIP_XE
@@ -234,6 +238,11 @@
# Make the zip archive.
FILELIST_TXT=filelist.txt
FONTLIST_TXT=fontlist.txt
+!ifdef WIN64
+ZIPTARGET=gs$(GS_VERSION)w64
+!else
+ZIPTARGET=gs$(GS_VERSION)w32
+!endif
zip: $(SETUP_XE) $(UNINSTALL_XE)
cd ..
copy gs$(GS_DOT_VERSION)\$(SETUP_XE) .
@@ -249,22 +258,22 @@
echo $(ZIPPROGFILE9) >> $(ZIPTEMPFILE)
$(SETUP_XE_NAME) -title "AFPL Ghostscript $(GS_DOT_VERSION)" -dir "gs$(GS_DOT_VERSION)" -list "$(FILELIST_TXT)" @$(ZIPTEMPFILE)
$(SETUP_XE_NAME) -title "AFPL Ghostscript Fonts" -dir "fonts" -list "$(FONTLIST_TXT)" $(ZIPFONTFILES)
- -del gs$(GS_VERSION)w32.zip
- $(ZIP_XE) -9 gs$(GS_VERSION)w32.zip $(SETUP_XE_NAME) $(UNINSTALL_XE_NAME) $(FILELIST_TXT) $(FONTLIST_TXT)
- $(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPFONTDIR)
- $(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPPROGFILE1)
- $(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPPROGFILE2)
- $(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPPROGFILE3)
- $(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPPROGFILE4)
+ -del $(ZIPTARGET).zip
+ $(ZIP_XE) -9 $(ZIPTARGET).zip $(SETUP_XE_NAME) $(UNINSTALL_XE_NAME) $(FILELIST_TXT) $(FONTLIST_TXT)
+ $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPFONTDIR)
+ $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE1)
+ $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE2)
+ $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE3)
+ $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE4)
rem
rem Don't flag error if Win32s spooler file is missing.
rem This occurs when using MSVC++.
rem
- -$(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPPROGFILE5)
- $(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPPROGFILE6)
- $(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPPROGFILE7)
- $(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPPROGFILE8)
- $(ZIP_XE) -9 -r gs$(GS_VERSION)w32.zip $(ZIPPROGFILE9)
+ -$(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE5)
+ $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE6)
+ $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE7)
+ $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE8)
+ $(ZIP_XE) -9 -r $(ZIPTARGET).zip $(ZIPPROGFILE9)
-del $(ZIPTEMPFILE)
-del $(SETUP_XE_NAME)
-del $(UNINSTALL_XE_NAME)
@@ -291,7 +300,7 @@
$(ECHOGS_XE) -a $(PSOBJ)about.txt See gs$(GS_DOT_VERSION)\doc\Commprod.htm regarding commercial distribution.
$(ECHOGS_XE) -w $(PSOBJ)dialog.txt This installs AFPL Ghostscript $(GS_DOT_VERSION).
$(ECHOGS_XE) -a $(PSOBJ)dialog.txt AFPL Ghostscript displays, prints and converts PostScript and PDF files.
- $(WINZIPSE_XE) ..\gs$(GS_VERSION)w32 @$(PSOBJ)setupgs.rsp
+ $(WINZIPSE_XE) ..\$(ZIPTARGET) @$(PSOBJ)setupgs.rsp
# Don't delete temporary files, because make continues
# before these files are used.
# -del $(ZIP_RSP)
More information about the gs-cvs
mailing list