VMS Port of XMosaic

Julian Bunn. CN Division, CERN. 41 22 767 5029, beep 5551 ([email protected])
Wed, 10 Feb 1993 16:54:51 +0100


TimBL asked me to pass on details of the VMS port. Although it seemed
rather tricky at the time, the actual changes for VMS are simple. Instead
of sending you the diff -c results, they can be summarised as:

1) In gui.c, #ifdef VMS to avoid including unistd.h
2) In main.c, #ifdef VMS then do not signal SIGUSR1 (ugly fix)
3) In Xresources.h I had to change all 17 point fonts to 18 point,
as the DECwindows MOTIF seems to lack them. I also changed
the anchor colour to Red instead of hex 9f, since some people's
X defaults specified a blue background, so making the anchors
invisible!
4) STRDUP was missing from VMS, and from the Ultrix system I used.
So I included a version as a separate file.

Finally, I wrote a little VMS command file that does the compile and
link for VMS systems running Multinet. This is included below, as is
STRDUP.

VMS_MAKE.COM
-------------------------------------------------------------------------
$!========================================================================
$!
$! Name : VMS_MAKE
$!
$! Purpose : Make the VMS version of XMosaic
$!
$! Arguments : None
$!
$! Created 10-FEB-1993 Julian J. Bunn
$!
$!========================================================================
$ ON ERROR THEN $ GOTO EXIT
$ ON CONTROL_Y THEN $ GOTO EXIT
$ copy sys$input sys$output

Procedure for making XMosaic. This procedure expects to find the
/src files in the current directory, the /libhtmlw sources in a
subdirectory [.libhtmlw] and the /libwww sources in a subdirectory
[.libwww]. This version produces an executable for Multinet TCP/IP.
UCX and Wollongong versions can be created by changing the CC compile
flag appropriately (UCX or WIN_TCP respectively).

$ if f$search("libhtmlw.dir") .eqs. ""
$ then
$ write sys$output "You need directory [.libhtmlw]"
$ exit
$ endif
$ if f$search("libwww.dir") .eqs. ""
$ then
$ write sys$output "You need directory [.libwww]"
$ exit
$ endif
$ library/create libhtmlw.olb
$ write sys$output "Compiling source in LIBHTMLW"
$ set def [.libhtmlw]
$ delete *.obj.*
$loop1:
$ file = f$search("*.c")
$ if file .eqs. "" then goto end_loop1
$ write sys$output "File : ''file'"
$ cc /nowarn 'file
$ if $severity
$ then
$ library/ins [-]libhtmlw *.obj
$ delete *.obj.*
$ endif
$ goto loop1
$end_loop1:
$ library/create [-]libwww.olb
$ set def [-.libwww]
$ write sys$output "Compiling source in LIBWWW"
$ delete *.obj.*
$loop2:
$ file = f$search("*.c")
$ if file .eqs. "" then goto end_loop2
$ write sys$output "File : ''file'"
$ cc /nowarn/define=(multinet=1) 'file
$ if $severity
$ then
$ library/ins [-]libwww *.obj
$ delete *.obj.*
$ endif
$ goto loop2
$end_loop2:
$ write sys$output "Compiling source in []"
$ set def [-]
$ delete *.obj.*
$loop3:
$ file = f$search("*.c")
$ if file .eqs. "" then goto end_loop3
$ write sys$output "File : ''file'"
$ cc /nowarn 'file
$ goto loop3
$end_loop3:
$ write sys$output "Linking all files. Expect warnings."
$! Note that this is without DTM
$ ass/user sys$input sys$command
$ link/exe=xmosaic main,gui,mo-www,mo-dtm,xmx,xmx2,strdup,-
libwww/lib,libhtmlw/lib,sys$input/opt
multinet_socket_library/share
sys$share:decw$xmlibshr/share
sys$share:decw$xmulibshr/share
$
$ write sys$output "Finished."
$ directory/size=all/prot xmosaic.exe
$EXIT:
$ EXIT

-----------------------------------------------------------------------
STRDUP.C
-----------------------------------------------------------------------
/* strdup.c -- return a newly allocated copy of a string
Copyright (C) 1990 Free Software Foundation, Inc.

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */

#ifdef STDC_HEADERS
#include <string.h>
#include <stdlib.h>
#else
char *malloc ();
char *strcpy ();
#endif

/* Return a newly allocated copy of STR,
or 0 if out of memory. */

char *
strdup (str)
char *str;
{
char *newstr;

newstr = (char *) malloc (strlen (str) + 1);
if (newstr)
strcpy (newstr, str);
return newstr;
}

-------------------------------------------------------------------------

Hope this information is of use.
Julian