[gs-devel] Re: [gs-cvs] rev 8392 - trunk/gs/src

SaGS sags5495 at hotmail.com
Tue Nov 20 22:16:19 PST 2007


Hi all,

Platform: Win95 OSR2, VS6 (not sure which service pack, I think 5).
Compiling from the IDE, I get:

    NMAKE : fatal error U1081: '"%MSVCDir%\bin\cl' : program not found

I suggest to pass these linker options by explicitely setting LINK= 
when needed, instead of relying on MSVCDir= being set and/or 
expanded. See attached diff for what I mean. I have just verified the 
patch works on VS6/Win95 and .NET2003/WinXP.

Note that doing something like:

    set LINK=/LIBPATH:"$(COMPBASE)\lib" test

it complains:

    LINK : fatal error LNK1181: cannot open input file "test.obj"

so it definitely picks up the options in the environment variable.

Hope it helps,
sags

----- Original Message ----- 
From: <ray at ghostscript.com>
To: <gs-cvs at ghostscript.com>
Sent: Tuesday, 20 November 2007 20:36
Subject: [gs-cvs] rev 8392 - trunk/gs/src
> ...
> Modified: trunk/gs/src/msvc32.mak
> ===================================================================
> --- trunk/gs/src/msvc32.mak 2007-11-20 11:42:22 UTC (rev 8391)
> +++ trunk/gs/src/msvc32.mak 2007-11-20 18:36:58 UTC (rev 8392)
> ...
> -COMPBASE=$(DEVSTUDIO)\VC98
> +COMPBASE=%MSVCDir%
> ...
-------------- next part --------------
Index: src/msvc32.mak
===================================================================
--- src/msvc32.mak	(revision 8392)
+++ src/msvc32.mak	(working copy)
@@ -405,7 +405,7 @@
 COMPBASE=
 SHAREDBASE=
 !else
-COMPBASE=%MSVCDir%
+COMPBASE=$(DEVSTUDIO)\VC98
 SHAREDBASE=$(DEVSTUDIO)\Common\MSDev98
 !endif
 !endif



Index: src/msvccmd.mak
===================================================================
--- src/msvccmd.mak	(revision 8392)
+++ src/msvccmd.mak	(working copy)
@@ -32,9 +32,9 @@
 # MSVC 5.x does recognize /QI0f.
 QI0f=/QI0f
 
-# Define separate CCAUX command-line switch that must be at END of line.
+# Define separate CCAUX command-line switch that is passed to the linker via "set LINK="
 
-CCAUX_TAIL= /link /LIBPATH:"$(COMPBASE)\lib"
+CCAUX_TAIL=/LIBPATH:"$(COMPBASE)\lib"
 
 !endif
 #endif #$(MSVC_VERSION) == 4



Index: src/msvctail.mak
===================================================================
--- src/msvctail.mak	(revision 8392)
+++ src/msvctail.mak	(working copy)
@@ -31,7 +31,9 @@
 	echo $(GENOPT) -DCHECK_INTERRUPTS -D_Windows -D__WIN32__ > $(GLGENDIR)\ccf32.tr
 
 $(ECHOGS_XE): $(GLSRC)echogs.c
-	$(CCAUX) $(GLSRC)echogs.c /Fo$(GLOBJ)echogs.obj /Fe$(ECHOGS_XE) $(CCAUX_TAIL)
+	set LINK=$(CCAUX_TAIL)
+	$(CCAUX) $(GLSRC)echogs.c /Fo$(GLOBJ)echogs.obj /Fe$(ECHOGS_XE)
+	set LINK=
 
 # Don't create genarch if it's not needed
 !ifdef GENARCH_XE
@@ -41,26 +43,36 @@
 	$(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)
+	set LINK=$(CCAUX_TAIL)
+	$(CCAUX) @$(GLGENDIR)\ccf32.tr /Fo$(GLOBJ)genarch.obj /Fe$(GENARCH_XE) $(GLSRC)genarch.c
+	set LINK=
 !endif
 !endif
 
 $(GENCONF_XE): $(GLSRC)genconf.c $(GENCONF_DEPS)
-	$(CCAUX) $(GLSRC)genconf.c /Fo$(GLOBJ)genconf.obj /Fe$(GENCONF_XE) $(CCAUX_TAIL)
+	set LINK=$(CCAUX_TAIL)
+	$(CCAUX) $(GLSRC)genconf.c /Fo$(GLOBJ)genconf.obj /Fe$(GENCONF_XE)
+	set LINK=
 
 $(GENDEV_XE): $(GLSRC)gendev.c $(GENDEV_DEPS)
-	$(CCAUX) $(GLSRC)gendev.c /Fo$(GLOBJ)gendev.obj /Fe$(GENDEV_XE) $(CCAUX_TAIL)
+	set LINK=$(CCAUX_TAIL)
+	$(CCAUX) $(GLSRC)gendev.c /Fo$(GLOBJ)gendev.obj /Fe$(GENDEV_XE)
+	set LINK=
 
 $(GENHT_XE): $(GLSRC)genht.c $(GENHT_DEPS)
 	$(CCAUX) $(GENHT_CFLAGS) $(GLSRC)genht.c /Fo$(GLOBJ)genht.obj /Fe$(GENHT_XE) $(CCAUX_TAIL)
 
 MKROMFS_OBJS=$(MKROMFS_ZLIB_OBJS) $(winplat_) $(GLOBJ)gpmisc.$(OBJ) $(GLOBJ)gp_getnv.$(OBJ)
 $(MKROMFS_XE): $(GLSRC)mkromfs.c $(MKROMFS_COMMON_DEPS) $(MKROMFS_OBJS)
-	$(CCAUX) -I$(GLOBJ) -I$(ZSRCDIR) @$(GLGENDIR)\ccf32.tr $(GLSRC)mkromfs.c /Fo$(GLOBJ)mkromfs.obj /Fe$(MKROMFS_XE) $(MKROMFS_OBJS) $(CCAUX_TAIL) /DEBUG
+	set LINK=$(CCAUX_TAIL) /DEBUG
+	$(CCAUX) -I$(GLOBJ) -I$(ZSRCDIR) @$(GLGENDIR)\ccf32.tr $(GLSRC)mkromfs.c /Fo$(GLOBJ)mkromfs.obj /Fe$(MKROMFS_XE) $(MKROMFS_OBJS)
+	set LINK=
 
 # PSSRC and PSOBJ aren't defined yet, so we spell out the definitions.
 $(GENINIT_XE): $(PSSRCDIR)$(D)geninit.c $(GENINIT_DEPS)
-	$(CCAUX) $(PSSRCDIR)$(D)geninit.c /Fo$(PSOBJDIR)$(D)geninit.obj /Fe$(GENINIT_XE) $(CCAUX_TAIL)
+	set LINK=$(CCAUX_TAIL)
+	$(CCAUX) $(PSSRCDIR)$(D)geninit.c /Fo$(PSOBJDIR)$(D)geninit.obj /Fe$(GENINIT_XE)
+	set LINK=
 
 # -------------------------------- Library -------------------------------- #
 


More information about the gs-devel mailing list