Wednesday, 27 March 2019

Compiling GNV programs

Before I started on updating the GNV utilities to newer versions, I needed to demonstrate that I could compile the existing ones from source.  Having installed the source when installing the apps (by choosing not to select default installation options), I was left with two directories in the GNV root folder, common_src which contains the untouched original GNU source, and vms_src which contains vms specific files.  I also created a gnv$gnu:[build] directory in which the recompiled software would be built.

The main GNV utilities are well documented by JEM and include pretty much everything you need to know to recompile them.  I followed the supplied instructions and successfully recompiled the utilities without any major hitches.  I created a following script setup.com in the gnv$gnu:[build] directory to expedite the setting up of logicals for each compilation:

read/prompt="directory: " sys$command file
DEFINE/TRANS=CONC VMS_ROOT DKA0:[SYS0.SYSCOMMON.GNV.VMS_SRC.'file'.]
DEFINE/TRANS=CONC SRC_ROOT DKA0:[SYS0.SYSCOMMON.GNV.COMMON_SRC.'file'.]
DEFINE/TRANS=CONC LCL_ROOT DKA0:[SYS0.SYSCOMMON.GNV.BUILD.'file'.]
DEFINE REF_ROOT VMS_ROOT:,SRC_ROOT:
DEFINE PRJ_ROOT LCL_ROOT:, REF_ROOT:
set def PRJ_ROOT:[000000]
DEFINE GNV_PCSI_PRODUCER "JEM"
DEFINE GNV_PCSI_PRODUCER_FULL_NAME "JEM"
DEFINE STAGE_ROOT/TRANS=CONC DKA0:[SYS0.SYSCOMMON.GNV.BUILD.]
DEFINE NEW_GNU GNV$GNU:

This script prompts for the name of the utility that is to be recompiled, sets the logicals, and then set the default directory to the prj_root.  I normally then follow this with a set def prj_root:[xxx] command, where xxx is the name of the folder shown from the directory listings (for the GNV utilities it's usually just the name of the utility, but for the other libraries like libpng it is a combination of the name and the version number).  I've not changed the producer name yet because keeping the JEM ensures that any other programs that have a dependency on these utilities will still work.

The first time this is done, it is also necessary to recreate empty copies of any directories in the common_src and vms_src directories, in the build directory:

$ copy SRC_ROOT:[000000...]*.dir;* LCL_ROOT:[000000...]*.dir;* 
$ copy VMS_ROOT:[000000...]*.dir;* LCL_ROOT:[000000...]*.dir;*

I also created a directory gnv$gnu:[build.kit] that will store all the new PCSI install files.

Compiling the utilities should then just be a case of running the right .COM file - the names seem to be slightly different for each utility, e.g. build_bash.com, pcsi_product_sed.com

It's a good idea to run the included "clean" scripts e.g. clean_bash.com first to clear out any residual files, compiler failures were often traced back to this.

Most of the build scripts have debugging enabled, I disabled this by deleting the /debu qualifier from the descrip.mms makefile.

Installation of the re-compiled executables requires deleting the original executable - the installer seems to refuse to install over any existing executables.  Some of the utilities include a script to do this e.g. remove_bash.com



No comments:

Post a Comment