Issue 43241 - [PATCH] Fix build problems with VC++
Summary: [PATCH] Fix build problems with VC++
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: dmake (show other issues)
Version: current
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: shay
QA Contact: issues@tools
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2005-02-21 11:36 UTC by shay
Modified: 2013-08-07 15:34 UTC (History)
3 users (show)

See Also:
Issue Type: PATCH
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Patch file, in case in-lined version doesn't apply. (8.92 KB, patch)
2005-02-21 11:37 UTC, shay
no flags Details | Diff
Don't rely on 4nt features (7.84 KB, patch)
2005-03-06 21:20 UTC, quetschke
no flags Details | Diff
Patch for dmake (9.78 KB, patch)
2005-04-07 23:28 UTC, quetschke
no flags Details | Diff
Documentation patch. (1.04 KB, patch)
2005-04-08 15:31 UTC, shay
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description shay 2005-02-21 11:36:20 UTC
I've found that the current CVS code doesn't build properly "out-of-the-box"
using MS VC++ 6 on Win XP.

I'm running the command "make win95-vpp40", as instructed in readme/read1st.txt,
but I find that the batch file that it calls (win95/microsft/vpp40/mk.bat) has
various syntax errors.  The patch below corrects these errors.  dmake.exe then
builds OK.

It should then be possible to rename dmake.exe to, say, dmake0.exe, remove the
objects/ sub-directory and just issue the command "dmake0.exe" (after setting
MAKESTARTUP, OS, etc appropriately) to have a new dmake.exe built using
dmake0.exe.  However, I find that there are also problems with that:

Firstly, the top-level makefile.mk needs to change / to \ in its copy command. 
Secondly, win95/microsft/config.mk should not include tempnam.c since I see it
was commented-out in the win95/microsft/vpp40/mk.bat.  Finally,
win95/microsft/config.mk is missing the definition of LDOBJS, and contains a
couple of errors in its construction of LDTMPOBJ and LDTMPLIB.  The patch below
also includes fixes for these issues.

diff -ruN dmake.orig/makefile.mk dmake/makefile.mk
--- dmake.orig/makefile.mk	2004-10-22 09:05:12.000000000 +0100
+++ dmake/makefile.mk	2005-02-21 11:16:46.000000000 +0000
@@ -83,7 +83,7 @@
 	duplicate :$(<:s,/,:,) $@
 .ELSE
     $(MKCONFIG) : template.mk
-	$(eq,$(SHELL),$(COMSPEC) +copy cp) $< $@
+	$(eq,$(SHELL),$(COMSPEC) +copy cp) $< $(eq,$(SHELL),$(COMSPEC) $(@:s,/,\,) $@)
 .ENDIF
 
 # how to make public.h
diff -ruN dmake.orig/win95/microsft/config.mk dmake/win95/microsft/config.mk
--- dmake.orig/win95/microsft/config.mk	2000-09-22 16:33:36.000000000 +0100
+++ dmake/win95/microsft/config.mk	2005-02-21 11:20:52.743000300 +0000
@@ -14,7 +14,7 @@
 # Definition of macros for library, and C startup code.
 
 # The following sources are required for MSC
-OSR_SRC += tempnam.c ruletab.c
+OSR_SRC += ruletab.c
 DOS_SRC += runargv.c rmprq.c
 
 .SETDIR=$(osrdir) : $(OSR_SRC)
@@ -27,13 +27,14 @@
 ASFLAGS   += -t -mx $(S_$(MODEL))
 
 # Microsoft C doesn't need tail but needs head
+LDOBJS         != $(CSTARTUP) $(OBJDIR)/{$(<:f)}
 LDTAIL         !=
 LDHEAD         != $(LDFLAGS)
 LDARGS	       != $(LDHEAD) -out:$(TARGET) @$(LDTMPOBJ) $(LDTAIL)
 LDTAIL	       != $(_libs)
 _libs          != $(!null,$(LDLIBS) ,@$(LDTMPLIB))
-LDTMPOBJ       != $(mktmp,,$(DIVFILE) $(LDOBJS:s,/,\\,:t"\n")\n)
-LDTMPLIB       != $(mktmp,,$(DIVFILE) $(LDLIBS:s,/,\\,:t"\n")\n)
+LDTMPOBJ       != $(mktmp,,$(DIVFILE) $(LDOBJS:s,/,\,:t"\n"))
+LDTMPLIB       != $(mktmp,,$(DIVFILE) $(LDLIBS:s,/,\,:t"\n"))
 
 # Debugging libraries and flags
 DB_LDFLAGS += /nologo /co /li /map
diff -ruN dmake.orig/win95/microsft/vpp40/mk.bat dmake/win95/microsft/vpp40/mk.bat
--- dmake.orig/win95/microsft/vpp40/mk.bat	2003-12-17 16:17:28.000000000 +0000
+++ dmake/win95/microsft/vpp40/mk.bat	2005-02-21 11:14:56.000000000 +0000
@@ -1,41 +1,38 @@
-if "%1" != "" goto link 
-del /FY objects
-del config.h
-del dmake.exe
+if exist objects rd /S /Q objects
+if exist config.h del config.h
+if exist dmake.exe del dmake.exe
 md objects
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\infer.obj infer.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\make.obj make.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\stat.obj stat.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\expand.obj expand.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\dmstring.obj dmstring.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\hash.obj hash.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\dag.obj dag.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\dmake.obj dmake.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\path.obj path.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\imacs.obj imacs.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\sysintf.obj sysintf.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\parse.obj parse.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\getinp.obj getinp.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\quit.obj quit.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\state.obj state.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\dmdump.obj dmdump.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\macparse.obj macparse.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\rulparse.obj rulparse.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\percent.obj percent.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\function.obj function.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\dchdir.obj win95\dchdir.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\switchar.obj win95\switchar.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\dstrlwr.obj msdos\dstrlwr.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\arlib.obj msdos\arlib.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\dirbrk.obj msdos\dirbrk.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\infer.obj infer.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\make.obj make.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\stat.obj stat.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\expand.obj expand.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\dmstring.obj dmstring.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\hash.obj hash.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\dag.obj dag.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\dmake.obj dmake.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\path.obj path.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\imacs.obj imacs.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\sysintf.obj sysintf.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\parse.obj parse.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\getinp.obj getinp.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\quit.obj quit.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\state.obj state.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\dmdump.obj dmdump.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\macparse.obj macparse.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\rulparse.obj rulparse.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\percent.obj percent.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\function.obj function.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\dchdir.obj win95\dchdir.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\switchar.obj win95\switchar.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\dstrlwr.obj msdos\dstrlwr.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\arlib.obj msdos\arlib.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\dirbrk.obj msdos\dirbrk.c
 rem Not needed for MSVC 6 and up. Lesser versions not supported
-rem cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo
-Od -GF -Ge -Foobjects\tempnam.obj tempnam.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\ruletab.obj win95\microsft\ruletab.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\runargv.obj msdos\runargv.c
-cl -c %c_flg -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od
-GF -Ge -Foobjects\rmprq.obj msdos\rmprq.c
+rem cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF
-Ge -Foobjects\tempnam.obj tempnam.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\ruletab.obj win95\microsft\ruletab.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\runargv.obj msdos\runargv.c
+cl -c -I. -Iwin95 -Iwin95\microsft -Iwin95\microsft\vpp40 /nologo -Od -GF -Ge
-Foobjects\rmprq.obj msdos\rmprq.c
 
 :link
-rem link /nologo /out:dmake.exe @fix95nt\win95\microsft\vpp40\obj.rsp
-if "%c_flg" == "" link /out:dmake.exe @.\win95\microsft\vpp40\obj.rsp
-if "%c_flg" != "" link /DEBUG:notmapped,full /DEBUGTYPE:cv /PDB:NONE
/out:dmake.exe @.\win95\microsft\vpp40\obj.rsp
+link /nologo /out:dmake.exe @.\win95\microsft\vpp40\obj.rsp
 copy win95\microsft\vpp40\template.mk startup\config.mk
End of Patch.
Comment 1 shay 2005-02-21 11:37:55 UTC
Created attachment 22865 [details]
Patch file, in case in-lined version doesn't apply.
Comment 2 hjs 2005-02-21 16:22:55 UTC
please have a look
Comment 3 quetschke 2005-03-06 21:20:36 UTC
Created attachment 23420 [details]
Don't rely on 4nt features
Comment 4 quetschke 2005-03-06 21:26:04 UTC
The previous patch removes only the 4nt syntax of features of the use of
dmake/win95/microsft/vpp40/mk.bat.

With it dmake builds like the read1st.txt promises.

vq->ause: What is the status of the QA for dmake43p01? Can I still apply patches
there? Or should I create a new CWS? 
Comment 5 quetschke 2005-03-06 23:13:02 UTC
You were not CCed.
> vq->ause: What is the status of the QA for dmake43p01? Can I still apply patches
> there? Or should I create a new CWS? 
Comment 6 shay 2005-03-07 09:54:36 UTC
I agree that your smaller patch, removing just the 4NT syntax, works fine, but
it also causes these messages to be output when doing a fresh build:

The system cannot find the file specified.
Could Not Find C:\Temp\dmake\config.h
Could Not Find C:\Temp\dmake\dmake.exe

because objects/, config.h and dmake.exe don't exist.  These messages can be
worrying to see because without knowing why they appear users might be concerned
that they represent some kind of error.  They are easily suppressed by the use
of "if exist", as in:

if exist objects rd /S /Q objects
if exist config.h del config.h
if exist dmake.exe del dmake.exe

The remainder of my original patch concerns allowing dmake.exe to rebuild
itself.  I realise that this is not part of the build process documented in
read1st.txt, but I think it is a cool feature.  Would you like me to create a
new issue with these proposed changes, or are you not interested in them at all?
Comment 7 quetschke 2005-04-07 23:28:03 UTC
Created attachment 24817 [details]
Patch for dmake
Comment 8 quetschke 2005-04-07 23:38:24 UTC
@shay:
I committed the previous patch to cws_src680_dmake43p01. As documented in
issue 46987 I found some problems with $mktmp .

> The remainder of my original patch concerns allowing dmake.exe to rebuild
> itself.  I realise that this is not part of the build process documented in
> read1st.txt, but I think it is a cool feature.  Would you like me to create a
> new issue with these proposed changes, or are you not interested in them at all?
I hope that the version I just committed works, can you verify that? 

Comment 9 shay 2005-04-08 09:26:13 UTC
Yes, this builds (and rebuilds, using itself) fine out-of-the-box for me.

There was one warning regarding a syntax error in a makefile, but it was not
introduced by this change.  I have reported the issue (with a patch to fix it)
separately as issue 47004.
Comment 10 shay 2005-04-08 09:30:50 UTC
Oh - I meant to say:  When does an entry for a committed change get added to the
"NEWS" file?

It would be helpful if that file was updated to note when a change has been
committed so that I can see at a glance which changes have been committed to
whatever I've just checked out from CVS.
Comment 11 quetschke 2005-04-08 14:15:44 UTC
> Oh - I meant to say:  When does an entry for a committed change get added to the
> "NEWS" file?

The issue is not resolved yet, we need to document the changes. Maybe in
read1st.txt as an extra entry below "Building Dmake " with a big warning?
Can you prepare a patch?

To see what happened in a cvs directory this might help:
$ oocvs log -rcws_src680_dmake43p01 -S -N -d '2005-01-01;2005-12-12' dmake
Comment 12 shay 2005-04-08 14:23:47 UTC
I'm not sure what documentation needs changing.  The existing instructions in
readme/read1st.txt say:

With Microsoft C++ compiler
---------------------------
For MS Visual C++ 6 and up start "make.bat win95-vpp40" in a command shell.

Previously, running that command didn't work properly.  The whole point of this
patch was to make it work, and AFAICT it now does.

What did you think needed changing?
Comment 13 quetschke 2005-04-08 14:54:36 UTC
> What did you think needed changing?

I thought it would be nice to document the possibility of "self-building" there.
Maybe in the MSVC section only, because it's tested nowhere else.
Comment 14 shay 2005-04-08 15:31:53 UTC
Created attachment 24846 [details]
Documentation patch.
Comment 15 shay 2005-04-08 15:33:31 UTC
OK, how about the patch above, then?

This documents the self-building feature for VC++, and also comments on how to
install dmake on Win32, which is a manual process that is not currently mentioned.
Comment 16 quetschke 2005-04-08 16:20:58 UTC
Committed and NEWS file updated.

Reassign for verification.
Comment 17 quetschke 2005-04-08 16:21:23 UTC
please verify
Comment 18 shay 2005-04-08 16:34:41 UTC
I confirm that dmake does now build (and rebuild, using itself) as documented
using VC++.
Comment 19 ace_dent 2008-05-16 03:31:41 UTC
This Issue is 'Verified' and not updated in 1yr+, so Closing.
A Closed Issue is a Happy Issue (TM).

Regards,
Andrew
 
Cleaning-up and Closing old Issues as part of:
~ The Grand Bug Squash, pre v3 ~