Looks good to me, just a few suggestions with appended diff output. I
admit, so far, I only tested my suggestions on VMS/Alpha V8.3

Regards,
Hartmut

1. building from a git-cloned repository

config_h_from_vms_template.com is a rather long name, no problem.
However, there seems to be something similar for w32: "Windows32 SCM
build preparation of ...". That file is named prepare_w32.bat. So I
suggest to rename config_h_from_vms_template.com to prepare_vms.com. OK,
the lowercase vms/w32 is not consistent with other file names which have
VMS/W32, if that is important ...

I would rather use configure.ac to determine the package and the version.

Whether it is useful to check for NFS/ODS-2 encoded filenames, I don't
know. But then, when a git clone is copied to an ODS-2 disk, somehow,
how would one handle filenames with multiple dots, anyway. I suggest to
simply require an ODS-5 disk for git cloned repositories and leave it to
the user of old VMS systems to handle problems on other disks. The user
can change the symbol config_template, anyway. Maybe a comment should
explain this, or maybe a P1 can be added so that a user can supply an
ODS-2 name. To me it seems removing these special filenames makes things
simpler. And, to make generating the config.h-vms more obvious I would
use some "replace" commands. Again, I use a "new" feature: pipe, here to
avoid creating a temporary file.

Whether invoking this command procedure should go into makefile.com is
another question. I think it isn't necessary. The prepare_w32.bat isn't
run from any other .bat-file, as far as I can see.

And, for the released version of GNU make this command procedure will
not run anyway.


2. Compiling and linking guile

Yes, after the release of 4.0 there was a change which added a call to
guile_gmake_setup to main.c. I sent a patch to handle that for VMS, in
last November. Obviously it didn't make it into the repository.

But I don't see that you need gmk-default.h without having HAVE_GUILE
defined.

To me it seems enough to change makefile.com and makefile.vms as in the
appended diff/patch and then there is no need for gmk_default_h.com.


3. Changes in config.h-vms.template

Isn't it more obvious to do what decc$types.h does?
#ifndef __CRTL_VER
# define __CRTL_VER __VMS_VER
#endif

On 02/20/2014 07:34 AM, John E. Malmberg wrote:
> [bcc Hartmut Becker per request of Paul Smith]
> 
> The attach patch allows VMS to build from a clone of the master branch
> of the GNU make repository.
> 
> The config.h-vms.template was using macros that were not predefined by
> the compiler.  The macros that were in use are only defined after a VMS
> header file is included, so were preventing the GNU Make 4.0 from
> building on VMS older than 7.3-2.
> 
> The config_h_from_vms_template.com converts the config.h-vms.template to
> a config.h-vms file  It is reading the version string from NEWS. as that
> is the only place that I found it.  If there is a better place to read
> the version, I can adjust the file.
> 
> The gmk_default_h.com is used to generate the gmk-default.h file, that
> the makefile.vms is expecting.  It appears that the guile module is
> currently not using that header file when built on VMS.
> 
> The makefile.com and makefile.vms were adjusted to build from master as
> well as a release.
> 
> I tried to get the GNU make 4.0 tarball to build on VAX/VMS 7.3.  It
> failed because of the header macro bug in the config.h-vms file, and the
> then requirement of vsnprintf().  After bringing over the vsnprintf()
> from the gawk project.  This got gnu make building with almost no output
> on VAX/VMS 7.3
> 
> The lack of output was caused by a buffer allocation bug in output.c.
> That buffer allocation bug does not exist in the output.c in master and
> master does not need the vsnprintf() routine.
> 
> This patch was tested against master on VAX/VMS 7.3 and IA64/VMS 8.4.
> 
> I am now looking at what it will take to get the perl scripts for
> testing to run on VMS.
> 
> Regards,
> -John
> 
> 
> _______________________________________________
> Bug-make mailing list
> Bug-make@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-make
> 

diff --git a/config.h-vms.template b/config.h-vms.template
index 3b4bd3b..aff7297 100644
--- a/config.h-vms.template
+++ b/config.h-vms.template
@@ -110,8 +110,11 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* #undef HAVE_STRCOLL */
 
 /* Define to 1 if you have the strncasecmp' function. */
+#ifndef __CRTL_VER
+# define __CRTL_VER __VMS_VER
+#endif
 #if __CRTL_VER >= 70000000
-#define HAVE_STRNCASECMP 1
+# define HAVE_STRNCASECMP 1
 #endif
 
 /* Define to 1 if your struct stat has st_rdev.  */
@@ -373,14 +376,8 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 /* #undef _DIRENT_HAVE_D_NAMLEN */
 
 /* On older systems without 7.0 backport of CRTL the first one is defined */
-#ifdef __CRTL_VER
-# if __CRTL_VER < 70000000
-#  define HAVE_VMSDIR_H 1
-# endif
-#else
-# if __VMS_VER < 70000000
-#  define HAVE_VMSDIR_H 1
-# endif
+#if __CRTL_VER < 70000000
+# define HAVE_VMSDIR_H 1
 #endif
 
 #if defined(HAVE_VMSDIR_H) && defined(HAVE_DIRENT_H)
diff --git a/makefile.com b/makefile.com
index 6359c47..40adf29 100644
--- a/makefile.com
+++ b/makefile.com
@@ -1,8 +1,7 @@
 $!
 $! Makefile.com - builds GNU Make for VMS
 $!
-$! P1 is non-empty if you want to link with the VAXCRTL library instead
-$!    of the shareable executable
+$! P1 = LIST will provide compiler listings.
 $! P2 = DEBUG will build an image with debug information
 $! P3 = WALL will enable all warning messages (some are suppressed since
 $!      one macro intentionally causes an error condition)
@@ -50,6 +49,12 @@ $      endif
 $   endif
 $ endif
 $!
+$!
+$ if (p1 .eqs. "LIST")
+$ then
+$   ccopt = ccopt + "/list/show=(expan,inclu)"
+$ endif
+$!
 $! Should we build a debug image
 $!
 $ if (p2.eqs."DEBUG")
@@ -67,8 +72,9 @@ $ then
 $   gosub check_cc_qual
 $ endif
 $ filelist = "alloca ar arscan commands default dir expand file function " + -
-             "hash implicit job load main misc read remake remote-stub rule " + -
-	     "output signame variable version vmsfunctions vmsify vpath " + -
+             "guile hash implicit job load main misc read remake " + -
+             "remote-stub rule output signame variable version " + -
+             "vmsfunctions vmsify vpath " + -
 	     "[.glob]glob [.glob]fnmatch getopt1 getopt strcache"
 $ copy config.h-vms config.h
 $ n=0
@@ -77,18 +83,14 @@ $ loop:
 $ cfile = f$elem(n," ",filelist)
 $ if cfile .eqs. " " then goto linkit
 $ write sys$output "Compiling ''cfile'..."
-$ call compileit 'cfile' 'p1'
+$ call compileit 'cfile'
 $ n = n + 1
 $ goto loop
 $ linkit:
 $ close optf
-$ if p1 .nes. "" then goto link_using_library
 $ link/exe=make make.opt/opt'lopt
 $ goto cleanup
 $
-$ link_using_library:
-$ link/exe=make make.opt/opt,sys$library:vaxcrtl/lib'lopt
-$
 $ cleanup:
 $ if f$trnlnm("SYS").nes."" then $ deassign sys
 $ if f$trnlnm("OPTF").nes."" then $ close optf
diff --git a/makefile.vms b/makefile.vms
index e5950b7..113ae54 100644
--- a/makefile.vms
+++ b/makefile.vms
@@ -88,13 +88,13 @@ mandir = []
 # Number to put on the man page filename.
 manext = 1
 
-#guile = ,guile.obj
+guile = ,guile.obj
 
 objs = commands.obj,job.obj,output.obj,dir.obj,file.obj,misc.obj,hash.obj,\
        load.obj,main.obj,read.obj,remake.obj,rule.obj,implicit.obj,\
        default.obj,variable.obj,expand.obj,function.obj,strcache.obj,\
-       vpath.obj,version.obj\
-       $(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)$(guile)
+       vpath.obj,version.obj$(guile)\
+       $(ARCHIVES)$(ALLOCA)$(extras)$(getopt)$(glob)
 
 srcs = commands.c job.c output.c dir.c file.c misc.c guile.c hash.c \
 	load.c main.c read.c remake.c rule.c implicit.c \
@@ -131,7 +131,7 @@ file.obj: file.c makeint.h commands.h dep.h filedef.h variable.h job.h debug.h
 function.obj: function.c makeint.h variable.h dep.h commands.h filedef.h debug.h job.h
 getopt.obj: getopt.c getopt.h config.h gettext.h
 getopt1.obj: getopt1.c getopt.h config.h
-guile.obj: guile.c makeint.h debug.h dep.h gmk-default.h
+guile.obj: guile.c makeint.h debug.h dep.h
 hash.obj: hash.c makeint.h hash.h
 implicit.obj: implicit.c makeint.h rule.h dep.h filedef.h debug.h variable.h job.h commands.h
 job.obj: job.c vmsjobs.c makeint.h commands.h job.h filedef.h variable.h debug.h
diff --git a/prepare_vms.com b/prepare_vms.com
new file mode 100644
index 0000000..ef94b4c
--- /dev/null
+++ b/prepare_vms.com
@@ -0,0 +1,34 @@
+$!
+$! prepare_vms.com - Build config.h from master on VMS.
+$!
+$! This is used for building off the master instead of a release tarball.
+$!
+$!
+$! 
+$ config_template = "sys$disk:[]config.h-vms.template"
+$ close/nolog infile
+$ package=""
+$ version=""
+$ open/read infile configure.ac
+$ r_loop:
+$ read/end=r_exit/error=r_exit infile line
+$ if f$extract(0,7,line) .nes. "AC_INIT" -
+	then $ goto r_loop
+$ package = f$element (1,"[",line)
+$ package = f$element (0,"]",package)
+$ version = f$element (2,"[",line)
+$ version = f$element (0,"]",version)
+$ r_exit:
+$ close infile
+$ if (package .eqs. "") .or. (version .eqs. "")
+$ then
+$     write sys$output "unable to determine package and/or version"
+$     exit 44
+$ endif
+$ pipe (write sys$output "sub/%PACKAGE%/''package'/WHOLE/NOTYPE" ; -
+        write sys$output "sub/%VERSION%/''version'/WHOLE/NOTYPE" ; -
+        write sys$output "exit") | -
+       (define/user sys$output nla0: ; -
+        edit/edt 'config_template/out=sys$disk:[]config.h-vms/command=sys$pipe)
+$ 
+$ write sys$output package, ", version ", version, " prepared for VMS" 
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to