Friday 22 March 2019

Secure Web Browser Source


The Secure Web Browser source is available in two versions for Alpha: v1.7.13 and v1.1.12.

Confusingly v1.1.12 is actually the newer of the two as it refers to v1.1.12 of SeaMonkey which was the 'successor' to Mozilla, which is what the v1.7.13 version is.  There's also a Firefox version 2.0.18 but it is only for I64.

Additional files to build and kit the SWB are also required.

I unpacked the buildfiles into DKA0:[BUILDTOOLS], the source files into DKA0:[V1112], and the kitting tools into DKA0:[KITTINGTOOLS].

The actual build process does not occur in the DKA0:[V1112] folder, a separate folder is needed: DKA0:[v1112opt]

There used to be a page on the HP website that was dedicated to explaining, albeit with some missing and/or obsolete details (I don't think it'd been updated since v1.7.13), how to compile the source on OpenVMS.  It's since been lost in the HPE purge...
Fortunately I saved a copy, and it here repeated here verbatim for posterity and reference:

The following instructions are intended to serve as a guide for building Secure Web Browser (based on SeaMonkey) on OpenVMS. The instructions assume that the reader is a knowledgeable, experienced OpenVMS developer. This provide information on the tools and processes that OpenVMS Engineering team uses to build Secure Web Browser (SWB), but they are not step-by-step directions.

With all the prerequisite hardware and software configured correctly, follow these steps to build SWB on OpenVMS: 

  • Download SWB sources
  • Download build tools
  • Download kitting tools

Note: The build takes significant amount of time. For example, on a 667Mhz DS20E AlphaStation, building a non-debug version of Mozilla takes about 12 hours.

The following downloads are required to obtain the source code and associated build tools:

Alpha

» Download SWB V1.1-12 Sources

» Download the below build tools and utilities:

» GTK for OpenVMS
» OpenVMS Porting Library
» LibIDL for OpenVMS
» GNV for OpenVMS
» Perl for OpenVMS
» Alpha Build tools
» Alpha Kitting tools

Alpha:

System Software


The following system software is required: 

  • OpenVMS Alpha V7.3-2 or later
  • HP C V6.5-002
  • HP C++ V6.5-031 or later
  • DECC$SHR ECO with DECC$PIPE_BUFFER_QUOTA support
  • Alpha Macro64 V1.2
  • GNV V1.5-4 or later
  • Perl V5.8 or later
  • GTK+ 1.2-10 run time (this PCSI kit is available as part of the SWB 1.7-13 download)
  • OPL 1.0-0A6 run time (this PCSI kit is available as part of the SWB 1.7-13 download)
  • LibIDL build it from source 

Account Quotas

The build account should have the following quotas as a minimum:

Maxjobs:     0  Fillm:    300  Bytlm:    100000
Maxacctjobs: 0  Shrfillm:   0  Pbytlm:        0
Maxdetach:   0  BIOlm:    500  JTquota:    4096
Prclm:      20  DIOlm:    500  WSdef:      4000
Prio:        4  ASTlm:    500  WSquo:     16000
Queprio:     0  TQElm:    200  WSextent: 150000
CPU:    (none)  Enqlm:   3000  Pgflquo:  700000


Disk Space

In addition to the disk space requirements for the prerequisite software, the following is also required: 

  • 500,000 blocks for the source code area
  • 1,200,000 blocks for a non-debug build area and/or 8,500,000 blocks for a debug area
The Secure Web Browser (SWB) for OpenVMS Alpha and OpenVMS Integrity servers are built from Mozilla sources. Some of the files are modified to run SWB on OpenVMS and a few files were modified/replaced to provide the branding. The build procedure for SWB is identical to Mozilla.

Alpha:

SWB V1.1-12 (based on SeaMonkey V1.1.12) is used as an example throughout this section.

The directory structure will change based on user's environment. So, adjust system specific logicals and symbol variables to match with your system.
  • Download build tools and copy them on to OpenVMS Alpha system
    • $RUN swb_axp_buildtools.sfx_axpexe to generate a .bck file
    • Run the BACKUP command to restore the .bck file
  • Copy .bashrc file to your sys$login directory
  • Download SWB V1.1-12 source code and do the following;
    • $RUN swb_axp_v1112source.sfx_axpexe to generate a .bck file
    • Run the BACKUP command to restore the .bck file
  • Run swb_axp_setup.com to set the build environment

For example, SWB and GNV logicals will get defined like this:

SWB logicals

(LNM$PROCESS_TABLE)

"MOZ_OBJROOT" = "_DKA200:[v1112opt.]"
"MOZ_SRCROOT" = "_DKA200:[v1112.mozilla.]"
"MOZ_SRCTOP" = "_DKA200:[v1112]"


GNV logicals

(LNM$PROCESS_TABLE) 

GNV_CC_INCLUDE_LENGTH_MAX" = "400"
GNV_CC_WARN_INFO" = "1"
GNV_CXX_SET_COMMAND" = "DEFINE/USER
DECC$FILENAME_UNIX_ONLY FALSE"
GNV_EXTRA" = "_DKA200:[gnv_extra]"
GNV_LINK_AUTO_SYMVEC_NODUPS" = "1"
GNV_LINK_LIB_TYPES" = "so exe a"
GNV_LINK_MISSING_LIB_ERROR" = "1"


Setting up Configure

Bash>

cd /moz_srcroot
mv configure configure.old
sed \
-e 's/"confdefs.h"/"confdefs.h"\
#ifdef GENERIC_PTHREAD_REDEFINES\
#include "motif_redefines.h"\
#endif/' \
-e 's/^int *$//' \
-e 's/i*n*t* *main *()/\
#ifdef __cplusplus\
extern "C" { void __posix_exit(int); }\
#else\
void __posix_exit(int);\
#endif\
int maine();\
int main() {\
__posix_exit(maine());\
}\
int maine()/' \
-e \
'/^(set)/{
N
/^.*$/c\
# On some platforms the copious set output fills the pipe and we hang.\
(set) > /tmp/set$$.tmp 2>&1\
cat /tmp/set$$.tmp |\
case `(ac_space=" "; cat /tmp/set$$.tmp | grep ac_space) 2>&1` in
}' \
configure.old > configure


Another fix to configure is needed for Mozilla 1.7:

old
" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
fi; done

new
" $ac_file_inputs > /tmp/cs.tmp
sed -f conftest.subs /tmp/cs.tmp > $ac_file
rm /tmp/cs.tmp
fi; done


Running Configure (non debug) 

$ create /dir [.vms_cxx]
$ library /object /create [.vms_cxx]CXX$LINK.OLB
$ set file /ent=[.vms_cxx]CXXINK.OLB [.vms_cxx]CXX$LINK.OLB ! make bug
$!
$! VMS build optimization
$ create /dir moz_objroot:[dist.bin]
$ create /dir moz_objroot:[dist.lib]
$ copy /log work:[work.cxx]libvmscxx.so moz_objroot:[dist.bin]libvmscxx.so
$ copy /log work:[work.cxx]libvmscxx.so moz_objroot:[dist.lib]libvmscxx.so

. /work/work/moz.sh # define moz_srcroot and moz_objroot
. /work/work/moz.sh # define moz_srcroot and moz_objroot
cd $moz_objroot
/moz_srcroot/configure \
--enable-application=suite \
--with-pthreads --disable-gtktest --disable-glibtest \
--disable-profilesharing \
--enable-md --disable-tests \
--without-zlib --enable-extensions=default,irc \
--with-glib --with-glib-prefix=/_dka0/gtk/1_2_10/glib/ \
--with-gtk --with-gtk-prefix=/_dka0/gtk/1_2_10/gtk/ \
--with-libIDL-prefix=/_dka200/libIDL-0.6.5 \
--enable-crypto --disable-freetype2 --enable-nspr-autoconf \
--disable-debug --enable-optimize



Tidy up after configure:
rm .MAP

Finally, start the build:
mkdir logs
/gnu/bin/make -j2 > logs/build 2>&1 # or use /work/work/build.sh


Scan log file for errors:

bash$ /work/work/scanlog build.
Total C Modules: 628
C++ Modules: 1953
C/C++ Info: 144
C/C++ Warn: 547
C/C++ Error: 0
C/C++ fatal: 0
Share Images: 90
Archive Warns: 0
Archive Errs: 0
Symbol Trunc: 0
Symbol Dupl: 0
gmake errs: 0
DCL errs: 0
Link errs: 0
link undefsym: 0


After the Build

Download kitting tools and copy them on to OpenVMS Alpha system
  • $RUN swb_axp_Kittingtools.sfx_axpexe to generate a .bck file
  • Run the BACKUP command to restore the .bck file
The "kit" contains all files in the dist/bin tree. Copy these files to a user defined directory and then create the kit.

$! Create saveset from build area
$ define xxx build1:[v1112opt.dist.] /trans=conc
$ back /log /nocrc /group=0 xxx:[bin...]*.*;0 sys$manager:V1112opt.sav/sav
$! Restore saveset into run/kit area
$ set default work:[work]
$ back /log sys$manager: V1112opt.sav/sav [...]*.*
$ rename bin.dir V1112opt.dir
$ set def work:[work.V1112opt]
$ @[-]swb_axp_tidy
$ delete [...]*.dir;* /log ! until no more deletes
$ @mozilla ! Just launch, select any menu item and exit
$! Create the Mozilla PCSI kit
$ set def work:[work]
$ @swb_axp_pcsi
$! make sure GTK and OPL kits are in place and match software statements
$ @swb_axp_make_kit


Incremental Building

Once SWB is built and running, you can make changes as necessary.

Important: Change the source code in the source tree (/v1112/mozilla/...) and build in the object tree (/v1112opt/...). Do not attempt to build in the source tree.

It is faster to build where changes have been made (assuming that the changes are not global in nature). You can use gmake build from the top of the object tree, but this will take few hours just to build one or two files that were changed.

Depending upon the build type, follow these steps for an incremental build:

Shared Build:
  • gmake in the object directory which corresponds to the source directory where changes were made.
  • If a shared image (.so) was not created, find the directory where the shared image is built and gmake there as well (usually there is a build directory one or two levels higher in the tree).
  • Copy the newly built shared image (.so) file out into the SWB run tree.
Static Build:
  • gmake in the object directory which corresponds to the source directory where changes were made.
  • If a library file (.a) was not created, find the directory where the library file is built and gmake in there as well (usually there is a build directory one or two levels higher in the tree). Note that the library file must be named something like foo.a. If only foo_s.a is built, you must still find the directory where foo.a gets built.
  • gmake in xpfe/bootstrap. This will rebuild the mozilla-bin image which you then copy out into your SWB run tree.

No comments:

Post a Comment