On 02/25/2014 01:36 AM, John E. Malmberg wrote: > ... >> Then the VMS command procedure and the makefile.vms have to change and >> copy from config-h-vms. instead of config.h-vms. Not really nice but >> managable. Then there is an entry for config.h-vms in .gitignore, which >> would need to change as well. Am I missing something else? > > VMS does not always like files with no extensions. Probably would not > be an issue here.
Probably not (and VMS file names by definition always have a file extension). > Because computers work for us, not us for computers. So if the script > can figure out a step to be done, there is no reason for to have it as > an extra manual step. We should have one command file that completely > build GNU make, not several steps. >From the released tarball: yes; from the snapshot: no. It is still my opinion that building from the snapshot is not the default. >> handles config.h-vms.template (why is there a prefix >> with sys$disk:[]?) and the NFS/ODS-2 variant of that: >> CONFIG.H-VMS$5NTEMPLATE. > > The prefix of sys$disk:[] is used in many existing places. One of the > things that it helps is bulding with the default on a search list. > ... Maybe it is too late, here. I don't see the difference in accessing the file with sys$disk:[]config.h-vms or config.h-vms. >>> I had to modify the pipe command to fit the command line length >>> restrictions of VAX/VMS 7.3. EDT is not one of the utilities that has a >>> problem reading from NFS files. With the sys$disk:[]-prefix, the command token for the pipe command gets bigger. The token is the restriction, the command line itself can be longer. Using the result of the f$search for the templates makes this command even longer, as the full VMS file spec is returned. And then the pipe can break depending on the current environment: how deep in a directory tree the file is found, that is, where the default directory is. Therefore I suggested to f$parse the name, after the file is found. >> Now there is a f$$search in makefile.vms. I don't think it is a problem >> when the files aren't there, the "-" can handle this. What is the reason >> to check with extra DCL commands whether the files are present, the >> "ignored" make error? (And then there is no need for the '-" any more.) >> What kind of problem should this solve? > > It gets rid of the error messages written to SYS$OUTPUT. The '-' can be > removed. I did not do it on this latest patch. These are usual error messages when the files are not present and the ignore prefix takes care of that. Anybody using make is probably aware of that. > Yes, as I have found many issues in other projects where serious real > errors and warnings were ignored because there were so many other > warnings and errors that were apparently harmless. I don't think this applies here. But for whatever it is good, I changed makefile.com to place the objects in the same directory as the source, the place where the makefile.vms expects them. > And a clean target needs to deal with aborted build, so should not > generate error messages when the target directory is already clean. In my opinion, with an aborted build, most people will expect to see such messages from make. Again, appended is what I suggest to change, to make a version for VAX/VMS, including the helper to prepare a build from the snapshot - with the template patterns - plus the above mentioned change for objects in the makefile.com.
diff --git a/config.h-vms.template b/config.h-vms.template index 3b4bd3b..2126483 100644 --- a/config.h-vms.template +++ b/config.h-vms.template @@ -18,6 +18,12 @@ this program. If not, see <http://www.gnu.org/licenses/>. */ /* config.h. Generated automatically by configure. */ /* config.h.in. Generated automatically from configure.ac by autoheader. */ +/* Pull in types.h here to get __CRTL_VER defined for old versions of the + compiler which don't define it. */ +#ifdef __DECC +# include <types.h> +#endif + /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ @@ -373,14 +379,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..6a49336 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 @@ -128,10 +130,15 @@ $!----------------------------------------------------------------------------- $! $ compileit : subroutine $ ploc = f$locate("]",p1) -$ filnam = p1 -$ if ploc .lt. f$length(p1) then filnam=f$extract(ploc+1,100,p1) -$ write optf "''filnam'" -$ cc'ccopt'/include=([],[.glob]) - +$ if ploc .lt. f$length(p1) +$ then +$ objdir=f$extract(0,ploc+1,p1) +$ write optf p1 +$ else +$ objdir := [] +$ write optf objdir+p1 +$ endif +$ cc'ccopt'/include=([],[.glob]) /obj='objdir' - /define=("allocated_variable_expand_for_file=alloc_var_expand_for_file","unlink=remove","HAVE_CONFIG_H","VMS") - 'p1' $ exit 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..e44c019 --- /dev/null +++ b/prepare_vms.com @@ -0,0 +1,56 @@ +$! +$! prepare_vms.com - Build config.h-vms from master on VMS. +$! +$! This is used for building off the master instead of a release tarball. +$! +$! +$! +$! First try ODS-5 or Pathworks V6 ... names. +$! +$ config_template = f$search("config*h-vms.template") +$ if config_template .eqs. "" +$ then +$! +$! Try NFS, VMStar, or Pathworks V5 ODS-2 encoded names. +$! +$ config_template = f$search("config.h-vms*template") +$ if config_template .eqs. "" +$ then +$ write sys$output "Could not find a VMS template for config.h!" +$ exit 44 +$ endif +$ endif +$ config_template = f$parse(config_template,,,"name")+f$parse(config_template,,,"type") +$! +$! +$! Pull the package and version from configure.ac +$! +$ open/read ac_file configure.ac +$ac_read_loop: +$ read ac_file/end=ac_read_loop_end line_in +$ key = f$extract(0, 7, line_in) +$ if key .nes. "AC_INIT" then goto ac_read_loop +$ package = f$element (1,"[",line_in) +$ package = f$element (0,"]",package) +$ version = f$element (2,"[",line_in) +$ version = f$element (0,"]",version) +$ac_read_loop_end: +$ close ac_file +$! +$ if (package .eqs. "") .or. (version .eqs. "") +$ then +$ write sys$output "Unable to determine package and/or version!" +$ exit 44 +$ endif +$! +$! +$! Note, the length of the pipe command is close to the maximum length allowed +$! for a VAX/VMS 7.3 pipe command: DCL-W-TKNOVF +$! +$ outfile := "config.h-vms" +$ 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='outfile'/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