#505 OpenVMS support for 5.5

release
open
Michael Smith
5
2015-01-22
2006-01-03
zinser
No

Hello,

I have been building Nedit 5.5 on OpenVMS successfully,
but found a few minor
issues. Fixits for them are described below and it
would be nice if you would
consider them for inclusion in the next version of
Nedit. Most are minor
code cleanup items, that are not really VMS specific,
but do come up here since
the compiler is pretty strict nowadays.All these
changes have been
crosstested successfully on a Linux (2.6.13, GCC 4.0.2)
system.

There are actually three changes that are VMS specific.
The first and most
obvious is a new build system for VMS. The old one does
not support the
Microline and Xlt libraries and has been scattered over
several files in the
util and source directories. This is all now
consolidated into
makefiles/make_vms.com , which does support the new
libraries and
incremental builds. The files util/comutil.com ,
source/comnedit.com , and
source/lnknedit.com are obsolete with the new build
system and can be removed
from the code base.
One change to source/menu.c is a minor tweak to an
already existing ifdef VMS.
The neditDBBadFilenameChars list does contain the ^
character, which is a
valid part of a VMS filename (at least on somewhat
recent systems).
The last one is kind of strange. In window.c one of the
various
XmToggleButtonSetState calls in RefreshMenuToggleState
causes the application
to crash at runtime. Since examining the structure in
question did not reveal
an obvious problem my current assumption is that this
is a bug of Motif on VMS.
Simply skipping this particular line with an ifndef VMS
does avoid the problem.
All of these changes do not affect builds on any other
platform.

Greetings, Marting

cc/prefix=all/define=(USE_ACCESS) FILE.C

if ((0 == getuid())
..............^
%CC-I-IMPLICITFUNC, In this statement, the identifier
"getuid" is implicitly dec
lared as a function.
at line number 897 in file
US$ROOT:[ZINSER.TEMP.NEDIT.SOURCE]file.c;1

-->getuid defined in unistd.h . Re-arrange include
directives so prototype is
defined on VMS too.

cc/prefix=all/define=(USE_ACCESS)/include=[-.xlt] SERVER.C

EditNewFile(findWindowOnDesktop(tabbed,
currentDesktop), NULL,
............................................^
%CC-W-UNINIT1, The scalar variable "tabbed" is fetched
but not initialized. And
there may be other such fetches of this variable that
have not been reported in
this compilation.
at line number 357 in file
US$ROOT:[ZINSER.TEMP.NEDIT.SOURCE]server.c;1

--> Make sure tabbed is initialized to 0 in declaration
of the variable.

%LINK-W-NUDFSYMS, 3 undefined symbols:
%LINK-I-UDFSYM, XMLFOLDERSETACTIVETAB
%LINK-I-UDFSYM, XMLFOLDERWIDGETCLASS
%LINK-I-UDFSYM, XRWSBUBBLEBUTTONWIDGETCLASS

---> Current build system does not take into account
libraries added to
Nedit 5.5. Reworked build system completely to
just use on
make_vms.com located in /makefiles to be in line
with the other
supported platforms.

cc/prefix=all FOLDER.C

if (f->core.width <= 0)
......^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "f->core.width" i
s being compared with a relational operator to a
constant whose value is not gre
ater than zero. This might not be what you intended.
at line number 464 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Folder.c;1

if (f->core.height <= 0)
......^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "f->core.height"
is being compared with a relational operator to a
constant whose value is not gr
eater than zero. This might not be what you intended.
at line number 466 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Folder.c;1

if (f->folder.minTabWidth <= 0)
......^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "f->folder.minTab
Width" is being compared with a relational operator to
a constant whose value is
not greater than zero. This might not be what you
intended.
at line number 503 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Folder.c;1

if (minWidth <= 0)
..........^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "minWidth" is bei
ng compared with a relational operator to a constant
whose value is not greater
than zero. This might not be what you intended.
at line number 1108 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Folder.c;1

if (minHeight <= 0)
..........^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "minHeight" is be
ing compared with a relational operator to a constant
whose value is not greater
than zero. This might not be what you intended.
at line number 1110 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Folder.c;1

if (minWidth <= 0)
..........^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "minWidth" is bei
ng compared with a relational operator to a constant
whose value is not greater
than zero. This might not be what you intended.
at line number 1445 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Folder.c;1

if (minHeight <= 0)
..........^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "minHeight" is be
ing compared with a relational operator to a constant
whose value is not greater
than zero. This might not be what you intended.
at line number 1447 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Folder.c;1

--> Add appropriate casts to make sure the comparison
makes sense.

cc/prefix=all GRID.C

if (g->core.width <= 0)
............^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "g->core.width" i
s being compared with a relational operator to a
constant whose value is not gre
ater than zero. This might not be what you intended.
at line number 1468 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Grid.c;1

if (g->core.height <= 0)
............^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "g->core.height"
is being compared with a relational operator to a
constant whose value is not gr
eater than zero. This might not be what you intended.
at line number 1470 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Grid.c;1

--> Add appropriate casts to make sure the comparison
makes sense.

cc/prefix=all TREE.C

if (t->core.width <= 0)
............^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "t->core.width" i
s being compared with a relational operator to a
constant whose value is not gre
ater than zero. This might not be what you intended.
at line number 237 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Tree.c;1

if (t->core.height <= 0)
............^
%CC-I-QUESTCOMPARE, In this statement, the unsigned
expression "t->core.height"
is being compared with a relational operator to a
constant whose value is not gr
eater than zero. This might not be what you intended.
at line number 239 in file
US$ROOT:[ZINSER.TEMP.NEDIT.MICROLINE.XML]Tree.c;1

--> Add appropriate casts to make sure the comparison
makes sense.

*** source/file.c.orig 2005-10-30 15:22:12.000000000 +0000
--- source/file.c 2005-10-30 15:36:56.000000000 +0000
***************
*** 53,58 ****
--- 53,59 ----
#include <limits.h>
#include <string.h>
#include <stdlib.h>
+ #include <unistd.h>
#ifdef VMS
#include "../util/VMSparam.h"
#include <types.h>
***************
*** 64,70 ****
#ifndef __MVS__
#include <sys/param.h>
#endif
- #include <unistd.h>
#include <fcntl.h>
#endif /*VMS*/

--- 65,70 ----
*** source/server.c.orig 2005-10-30 15:22:59.000000000
+0000
--- source/server.c 2005-10-30 15:37:04.000000000 +0000
***************
*** 340,346 ****
char *fullname, filename[MAXPATHLEN],
pathname[MAXPATHLEN];
char *doCommand, *geometry, *langMode, *inPtr;
int editFlags, stringLen = strlen(string);
! int lineNum, createFlag, readFlag, iconicFlag,
lastIconic = 0, tabbed;
int fileLen, doLen, lmLen, geomLen, charsRead,
itemsRead;
WindowInfo *window, *lastFile = NULL;
long currentDesktop =
QueryCurrentDesktop(TheDisplay,
--- 340,346 ----
char *fullname, filename[MAXPATHLEN],
pathname[MAXPATHLEN];
char *doCommand, *geometry, *langMode, *inPtr;
int editFlags, stringLen = strlen(string);
! int lineNum, createFlag, readFlag, iconicFlag,
lastIconic = 0, tabbed =0;
int fileLen, doLen, lmLen, geomLen, charsRead,
itemsRead;
WindowInfo *window, *lastFile = NULL;
long currentDesktop =
QueryCurrentDesktop(TheDisplay,
*** Microline/XmL/Folder.c.orig 2005-10-30
15:24:48.000000000 +0000
--- Microline/XmL/Folder.c 2005-10-30
15:27:25.000000000 +0000
***************
*** 461,469 ****
dpy = XtDisplay((Widget)f);
request = (XmLFolderWidget)req;

! if (f->core.width <= 0)
f->core.width = 100;
! if (f->core.height <= 0)
f->core.height = 100;

f->folder.gc = 0;
--- 461,469 ----
dpy = XtDisplay((Widget)f);
request = (XmLFolderWidget)req;

! if ((int)(f->core.width) <= 0)
f->core.width = 100;
! if ((int)(f->core.height) <= 0)
f->core.height = 100;

f->folder.gc = 0;
***************
*** 500,506 ****
}
f->folder.serverDrawsArcsLarge =
ServerDrawsArcsLarge(dpy,
f->folder.debugLevel);
! if (f->folder.minTabWidth <= 0)
{
/* a quick hack to determine the minimum tab
width - enough
to show at least one character of the tab string */
--- 500,506 ----
}
f->folder.serverDrawsArcsLarge =
ServerDrawsArcsLarge(dpy,
f->folder.debugLevel);
! if ((int)(f->folder.minTabWidth) <= 0)
{
/* a quick hack to determine the minimum tab
width - enough
to show at least one character of the tab string */
***************
*** 1105,1113 ****
/* Resize folder if needed */
if (resizeIfNeeded && f->folder.resizePolicy !=
XmRESIZE_NONE)
{
! if (minWidth <= 0)
minWidth = 1;
! if (minHeight <= 0)
minHeight = 1;
result = XtMakeResizeRequest((Widget)f,
minWidth, minHeight,
&width, &height);
--- 1105,1113 ----
/* Resize folder if needed */
if (resizeIfNeeded && f->folder.resizePolicy !=
XmRESIZE_NONE)
{
! if ((int)minWidth <= 0)
minWidth = 1;
! if ((int)minHeight <= 0)
minHeight = 1;
result = XtMakeResizeRequest((Widget)f,
minWidth, minHeight,
&width, &height);
***************
*** 1442,1450 ****
/* Resize folder if needed */
if (resizeIfNeeded && f->folder.resizePolicy !=
XmRESIZE_NONE)
{
! if (minWidth <= 0)
minWidth = 1;
! if (minHeight <= 0)
minHeight = 1;
result = XtMakeResizeRequest((Widget)f,
minWidth, minHeight,
&width, &height);
--- 1442,1450 ----
/* Resize folder if needed */
if (resizeIfNeeded && f->folder.resizePolicy !=
XmRESIZE_NONE)
{
! if ((int)minWidth <= 0)
minWidth = 1;
! if ((int)minHeight <= 0)
minHeight = 1;
result = XtMakeResizeRequest((Widget)f,
minWidth, minHeight,
&width, &height);
*** Microline/XmL/Grid.c.orig 2005-10-30
15:25:13.000000000 +0000
--- Microline/XmL/Grid.c 2005-10-30 15:27:29.000000000
+0000
***************
*** 1465,1473 ****
g->grid.rowArray = XmLArrayNew(1, 1);
g->grid.colArray = XmLArrayNew(1, 1);

! if (g->core.width <= 0)
g->core.width = 100;
! if (g->core.height <= 0)
g->core.height = 100;

CopyFontList(g);
--- 1465,1473 ----
g->grid.rowArray = XmLArrayNew(1, 1);
g->grid.colArray = XmLArrayNew(1, 1);

! if ((int)(g->core.width) <= 0)
g->core.width = 100;
! if ((int)(g->core.height) <= 0)
g->core.height = 100;

CopyFontList(g);
*** Microline/XmL/Tree.c.orig 2005-10-30
15:25:31.000000000 +0000
--- Microline/XmL/Tree.c 2005-10-30 15:27:34.000000000
+0000
***************
*** 234,242 ****
XmLTreeWidget t;

t = (XmLTreeWidget)newW;
! if (t->core.width <= 0)
t->core.width = 100;
! if (t->core.height <= 0)
t->core.height = 100;
t->tree.defaultPixmapsCreated = 0;
t->tree.linesData = 0;
--- 234,242 ----
XmLTreeWidget t;

t = (XmLTreeWidget)newW;
! if ((int)(t->core.width) <= 0)
t->core.width = 100;
! if ((int)(t->core.height) <= 0)
t->core.height = 100;
t->tree.defaultPixmapsCreated = 0;
t->tree.linesData = 0;
*** source/menu.c.orig 2005-10-30 15:33:46.000000000 +0000
--- source/menu.c 2005-10-30 15:36:59.000000000 +0000
***************
*** 4766,4772 ****
}

#ifdef VMS
! static char neditDBBadFilenameChars[] =
"\n\t*?(){}!@#%^&' ";
#else
static char neditDBBadFilenameChars[] = "\n";
#endif
--- 4766,4772 ----
}

#ifdef VMS
! static char neditDBBadFilenameChars[] =
"\n\t*?(){}!@#%&' ";
#else
static char neditDBBadFilenameChars[] = "\n";
#endif
*** source/window.c.orig 2005-11-06 12:12:33.000000000
+0000
--- source/window.c 2005-12-20 07:57:43.000000000 +0000
***************
*** 3633,3639 ****
--- 3633,3641 ----
XmToggleButtonSetState(window->highlightItem,
window->highlightSyntax, False);
XtSetSensitive(window->highlightItem,
window->languageMode != PLAIN_LANGUAGE_MODE);

XmToggleButtonSetState(window->backlightCharsItem,
window->backlightChars, False);
+ #ifndef VMS
XmToggleButtonSetState(window->saveLastItem,
window->saveOldVersion, False);
+ #endif
XmToggleButtonSetState(window->autoSaveItem,
window->autoSave, False);
XmToggleButtonSetState(window->overtypeModeItem,
window->overstrike, False);

XmToggleButtonSetState(window->matchSyntaxBasedItem,
window->matchSyntaxBased, False);

$! make Nedit under OpenVMS
$!
$!
$! In case of problems with the install you might
contact me at
$! zinser@zinser.no-ip.info(preferred) or
$! zinser@sysdev.deutsche-boerse.com (work)
$!
$! Make procedure history for Nedit
$!
$!------------------------------------------------------------------------------
$! Version history
$! 0.01 20040229 First version to receive a number
$! 0.02 20041109 Init s_case for case sensitive
shareable images
$! 0.03 20041229 Some more config info (tconfig,
conf_check_string)
$! 0.04 20050105 Add check for MMS/MMK, does not hurt
even for pure DCL build
$!
$ ON ERROR THEN GOTO err_exit
$ true = 1
$ false = 0
$ tmpnam = "temp_" + f$getjpi("","pid")
$ tt = tmpnam + ".txt"
$ tc = tmpnam + ".c"
$ th = tmpnam + ".h"
$ define tconfig 'th'
$ its_decc = false
$ its_vaxc = false
$ its_gnuc = false
$ s_case = False
$!
$! Setup variables holding "config" information
$!
$ Make = ""
$ ccopt = ""
$ lopts = ""
$ dnsrl = ""
$ aconf_in_file = "config.hin"
$ conf_check_string = ""
$ name = "Nedit"
$!
$ whoami =
f$parse(f$enviornment("Procedure"),,,,"NO_CONCEAL")
$ mydef = F$parse(whoami,,,"DEVICE")
$ mydir = f$parse(whoami,,,"DIRECTORY") - "]["
$ myproc = f$parse(whoami,,,"Name") +
f$parse(whoami,,,"type")
$ xmldir = mydef + mydir - ".MAKEFILES]" +
".MICROLINE.XML]"
$ startdir = mydef + mydir - ".MAKEFILES]" +"]"
$!
$! Check for MMK/MMS
$!
$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make
= "MMS"
$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK"
$!
$ gosub check_opts
$!
$ gosub check_compiler
$!
$ if (its_decc) then ccopt = ccopt + "/prefix=all"
$ if f$type(make) .eqs. "STRING"
$ then
$ gosub crea_mms
$ set def [.util]
$ 'make'
$ set def [-.microline.xml]
$ 'make'
$ set def [--.xlt]
$ 'make'
$ set def [-.source]
$ 'make'
$ set def [-]
$ else
$ DEFINE SYS DECC$LIBRARY_INCLUDE
$ DEFINE XM DECW$INCLUDE
$ DEFINE X11 DECW$INCLUDE
$ DEFINE XML 'xmldir'
$ VERIFY = 'F$VERIFY (1)'
$ set def [.util]
$ compile := cc'ccopt'
$ COMPILE CLEARCASE.C
$ COMPILE DIALOGF.C
$ COMPILE FILEUTILS.C
$ COMPILE GETFILES.C
$ COMPILE MISC.C
$ COMPILE PREFFILE.C
$ COMPILE PRINTUTILS.C
$ COMPILE FONTSEL.C
$ COMPILE MANAGEDLIST.C
$ COMPILE UTILS.C
$ LIBR/CREATE/OBJ LIBUTIL CLEARCASE, DIALOGF,
FILEUTILS, GETFILES, MISC, -
PRINTUTILS, PREFFILE, FONTSEL, MANAGEDLIST, UTILS
$ COMPILE VMSUTILS.C
$ LIBR/CREATE/OBJ VMSUTILS VMSUTILS
$ verify = f$verify(verify)
$ set def [-.microline.xml]
$ VERIFY = 'F$VERIFY (1)'
$ COMPILE Folder.c
$ COMPILE Grid.c
$ COMPILE GridUtil.c
$ COMPILE Progress.c
$ COMPILE Tree.c
$ COMPILE XmL.c
$ LIBR/CREATE/OBJ libXmL Folder, Grid, GridUtil,
Progress, Tree, XmL.obj
$ verify = f$verify(verify)
$ set def [--.xlt]
$ compile := cc'ccopt'/include=[]
$ VERIFY = 'F$VERIFY (1)'
$ COMPILE BubbleButton.c
$ COMPILE SlideC.c
$ LIBR/CREATE/OBJ libXlt BubbleButton, SlideC
$ verify = f$verify(verify)
$ set def [-.source]
$ COMPILE :=
CC'ccopt'/DEFINE=(USE_ACCESS)/include=[-.xlt]
$ VERIFY = 'F$VERIFY (1)'
$ COMPILE SELECTION.C
$ COMPILE SERVER_COMMON.C
$ COMPILE FILE.C
$ COMPILE HELP.C
$ COMPILE MENU.C
$ COMPILE NEDIT.C
$ COMPILE PREFERENCES.C
$ COMPILE REGULAREXP.C
$ COMPILE SEARCH.C
$ COMPILE SHIFT.C
$ COMPILE TAGS.C
$ COMPILE UNDO.C
$ COMPILE WINDOW.C
$ COMPILE USERCMDS.C
$ COMPILE MACRO.C
$ COMPILE TEXT.C
$ COMPILE TEXTSEL.C
$ COMPILE TEXTDISP.C
$ COMPILE TEXTBUF.C
$ COMPILE TEXTDRAG.C
$ COMPILE SERVER.C
$ COMPILE HIGHLIGHT.C
$ COMPILE HIGHLIGHTDATA.C
$ COMPILE INTERPRET.C
$ COMPILE SMARTINDENT.C
$ COMPILE REGEXCONVERT.C
$ COMPILE RBTREE.C
$ COMPILE WINDOWTITLE.C
$ COMPILE LINKDATE.C
$ COMPILE CALLTIPS.C
$ COMPILE RANGESET.C
$ !
$ if f$search("PARSE.C") .nes. "" then DELETE PARSE.C;*
$ COPY PARSE_NOYACC.C PARSE.C
$ COMPILE PARSE.C
$ !
$ COMPILE NC.C
$ OBJS := nedit, file, menu, window, selection,
search, undo, shift, -
help, preferences, tags, userCmds, regularExp,
macro, text, -
textSel, textDisp, textBuf, textDrag, server,
highlight, -
highlightData, interpret, parse, smartIndent,
regexconvert, -
rbTree, windowtitle, linkdate, server_common,
calltips, rangeset

$ LINK 'lopts' 'OBJS', NEDIT_OPTIONS_FILE/OPT, -
[-.microline.xml]libxml/lib,
[-.xlt]libXlt/lib, -
[-.util]vmsUtils/lib, libUtil/lib
$ LINK 'lopts' nc, server_common.obj,
NEDIT_OPTIONS_FILE/OPT, -
[-.util]vmsUtils/lib, libUtil/lib
$ verify = f$verify(verify)
$ set def 'startdir'
$ endif
$ if f$type(dnrsl) .eqs. "STRING" then -
define decc$no_rooted_search_lists 'dnrsl'
$ exit
$CC_ERR:
$ write sys$output "C compiler required to build ''name'"
$ goto err_exit
$ERR_EXIT:
$ if f$type(dnrsl) .eqs. "STRING" then -
define decc$no_rooted_search_lists 'dnrsl'
$ write sys$output "Error building ''name'. Exiting..."
$ exit 2
$!------------------------------------------------------------------------------
$!
$! If MMS/MMK are available dump out the descrip.mms if
required
$!
$CREA_MMS:
$ write sys$output "Creating [.util]descrip.mms..."
$ create [.util]descrip.mms
$ open/append out [.util]descrip.mms
$ write out "CFLAGS=", ccopt
$ copy sys$input: out
$ deck
CC=cc
AR=lib
.FIRST
DEFINE SYS DECC$LIBRARY_INCLUDE
DEFINE XM DECW$INCLUDE
DEFINE X11 DECW$INCLUDE

OBJS = clearcase.obj, DialogF.obj, getfiles.obj,
printUtils.obj, misc.obj,\ fileUtils.obj, prefFile.obj, fontsel.obj,
managedlist.obj, utils.obj

all : libNUtil.olb VMSUTILS.olb
sh def

libNUtil.olb : $(OBJS)
$(AR) /CREATE/OBJ libNUtil.olb $(OBJS)

VMSUTILS.olb : VMSUTILS.obj
$(AR) /CREATE/OBJ VMSUTILS VMSUTILS
$ eod
$ close out
$ write sys$output "Creating
[.microline.xml]descrip.mms..."
$ create [.microline.xml]descrip.mms
$ open/append out [.microline.xml]descrip.mms
$ write out "CFLAGS=", ccopt
$ copy sys$input: out
$ deck
CC=cc
AR=lib
.FIRST
DEFINE SYS DECC$LIBRARY_INCLUDE
DEFINE XM DECW$INCLUDE
DEFINE X11 DECW$INCLUDE
$ eod
$ write out " DEFINE XML ", xmldir
$ copy sys$input: out
$ deck

OBJS = Folder.obj, Grid.obj, GridUtil.obj,
Progress.obj, Tree.obj, XmL.obj

all : libXmL.olb
sh def

libXmL.olb : $(OBJS)
$(AR) /CREATE/OBJ libXmL.olb $(OBJS)
$ eod
$ close out
$ write sys$output "Creating [.xlt]descrip.mms..."
$ create [.xlt]descrip.mms
$ open/append out [.xlt]descrip.mms
$ write out "CFLAGS=", ccopt, "/include=[]"
$ copy sys$input: out
$ deck
CC=cc
AR=lib

.FIRST
DEFINE SYS DECC$LIBRARY_INCLUDE
DEFINE XM DECW$INCLUDE
DEFINE X11 DECW$INCLUDE

OBJS = BubbleButton.obj, SlideC.obj

all : libXlt.olb
sh def

libXlt.olb : $(OBJS)
$(AR) /CREATE/OBJ libXlt.olb $(OBJS)
$ eod
$ close out
$ write sys$output "Creating [.source]descrip.mms..."
$ create [.source]descrip.mms
$ open/append out [.source]descrip.mms
$ write out "CFLAGS=", ccopt,
"/define=(USE_ACCESS)/include=[-.xlt]"
$ write out "LFLAGS=", lopts
$ copy sys$input: out
$ deck
#
# Makefile for VMS/MMS
#

CC=cc

.FIRST
DEFINE SYS DECC$LIBRARY_INCLUDE
DEFINE XM DECW$INCLUDE
DEFINE X11 DECW$INCLUDE
$ eod
$ write out " DEFINE XML ", xmldir
$ copy sys$input: out
$ deck
copy parse_noyacc.c parse.c

SRCS = nedit.c selection.c file.c help.c menu.c
preferences.c regularExp.c\ search.c shift.c tags.c undo.c window.c
userCmds.c macro.c text.c\ textSel.c textDisp.c textBuf.c textDrag.c
server.c highlight.c\ highlightData.c interpret.c smartIndent.c
parse.c nc.c regexconvert.c\ rbtree.c linkdate.c windowTitle.c
server_common.c calltips.c\ rangeset.c

OBJS = selection.obj, file.obj, help.obj, menu.obj,
preferences.obj, \ regularExp.obj, search.obj, shift.obj,
tags.obj, undo.obj, window.obj,\ userCmds.obj, macro.obj, text.obj, textSel.obj,
textDisp.obj,\ textBuf.obj, textDrag.obj, server.obj,
highlight.obj,\ highlightData.obj, interpret.obj,
smartIndent.obj, parse.obj,\ regexconvert.obj, rbtree.obj, linkdate.obj,
windowTitle.obj, \ server_common.obj, calltips.obj, rangeset.obj

NEOBJS = nedit.obj

NCOBJS = nc.obj

all : nedit.exe nc.exe
@ write sys$output "Nedit build completed"

nedit.exe : $(NEOBJS) $(OBJS)
link/exe=nedit.exe $(NEOBJS),$(OBJS),
NEDIT_OPTIONS_FILE/OPT, -
[-.microline.xml]libxml/lib, [-.xlt]libXlt/lib, -
[-.util]vmsUtils/lib, libNUtil.olb/lib

nc.exe : $(NCOBJS)
LINK $(NCOBJS), server_common.obj,
NEDIT_OPTIONS_FILE/OPT, -
[-.util]vmsUtils/lib,libNUtil.olb/lib
$ eod
$ close out
$ return
$!------------------------------------------------------------------------------
$!
$! Check command line options and set symbols accordingly
$!
$!------------------------------------------------------------------------------
$! Version history
$! 0.01 20041206 First version to receive a number
$ CHECK_OPTS:
$ i = 1
$ OPT_LOOP:
$ if i .lt. 9
$ then
$ cparm = f$edit(p'i',"upcase")
$!
$! Check if parameter actually contains something
$!
$ if f$edit(cparm,"trim") .nes. ""
$ then
$ if cparm .eqs. "DEBUG"
$ then
$ ccopt = ccopt + "/noopt/deb"
$ lopts = lopts + "/deb"
$ endif
$ if f$locate("CCOPT=",cparm) .lt. f$length(cparm)
$ then
$ start = f$locate("=",cparm) + 1
$ len = f$length(cparm) - start
$ ccopt = ccopt + f$extract(start,len,cparm)
$ if f$locate("AS_IS",f$edit(ccopt,"UPCASE"))
.lt. f$length(ccopt) -
then s_case = true
$ endif
$ if cparm .eqs. "LINK" then linkonly = true
$ if f$locate("LOPTS=",cparm) .lt. f$length(cparm)
$ then
$ start = f$locate("=",cparm) + 1
$ len = f$length(cparm) - start
$ lopts = lopts + f$extract(start,len,cparm)
$ endif
$ if f$locate("CC=",cparm) .lt. f$length(cparm)
$ then
$ start = f$locate("=",cparm) + 1
$ len = f$length(cparm) - start
$ cc_com = f$extract(start,len,cparm)
if (cc_com .nes. "DECC") .and. -
(cc_com .nes. "VAXC") .and. -
(cc_com .nes. "GNUC")
$ then
$ write sys$output "Unsupported compiler choice
''cc_com' ignored"
$ write sys$output "Use DECC, VAXC, or GNUC
instead"
$ else
$ if cc_com .eqs. "DECC" then its_decc = true
$ if cc_com .eqs. "VAXC" then its_vaxc = true
$ if cc_com .eqs. "GNUC" then its_gnuc = true
$ endif
$ endif
$ if f$locate("MAKE=",cparm) .lt. f$length(cparm)
$ then
$ start = f$locate("=",cparm) + 1
$ len = f$length(cparm) - start
$ mmks = f$extract(start,len,cparm)
$ if (mmks .eqs. "MMK") .or. (mmks .eqs. "MMS")
$ then
$ make = mmks
$ else
$ write sys$output "Unsupported make choice
''mmks' ignored"
$ write sys$output "Use MMK or MMS instead"
$ endif
$ endif
$ endif
$ i = i + 1
$ goto opt_loop
$ endif
$ return
$!------------------------------------------------------------------------------
$!
$! Look for the compiler used
$!
$! Version history
$! 0.01 20040223 First version to receive a number
$! 0.02 20040229 Save/set value of
decc$no_rooted_search_lists
$CHECK_COMPILER:
$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
$ then
$ its_decc =
(f$search("SYS$SYSTEM:DECC$COMPILER.EXE") .nes. "")
$ its_vaxc = .not. its_decc .and.
(F$Search("SYS$System:VAXC.Exe") .nes. "")
$ its_gnuc = .not. (its_decc .or. its_vaxc) .and.
(f$trnlnm("gnu_cc") .nes. "")
$ endif
$!
$! Exit if no compiler available
$!
$ if (.not. (its_decc .or. its_vaxc .or. its_gnuc))
$ then goto CC_ERR
$ else
$ if its_decc
$ then
$ write sys$output "CC compiler check ... Compaq C"
$ if f$trnlnm("decc$no_rooted_search_lists") .nes. ""
$ then
$ dnrsl = f$trnlnm("decc$no_rooted_search_lists")
$ endif
$ define decc$no_rooted_search_lists 1
$ else
$ if its_vaxc then write sys$output "CC compiler
check ... VAX C"
$ if its_gnuc then write sys$output "CC compiler
check ... GNU C"
$ if f$trnlnm(topt) then write topt
"sys$share:vaxcrtl.exe/share"
$ if f$trnlnm(optf) then write optf
"sys$share:vaxcrtl.exe/share"
$ endif
$ endif
$ return
$!------------------------------------------------------------------------------

Discussion

  • Thorsten Haude
    Thorsten Haude
    2006-01-03

    Logged In: YES
    user_id=119143

    I think Michael Smith did some work on this, so please have
    a look at the current CVS version. Here is the log message:

    CVSROOT: /cvsroot/nedit
    Module name: nedit
    Repository: nedit/util/
    Changes by: edg@sc8-pr-cvs1.sourceforge.net.(none)
    05/05/27 09:49:05

    Modified files:
    ./: README
    nedit/Microline/XmL/: Folder.h Grid.h Progress.h
    Tree.h XmL.c
    nedit/Xlt/: BubbleButton.c BubbleButtonP.h SlideC.c
    SlideCP.h
    nedit/source/: file.c menu.c shell.c window.c
    Added files:
    nedit/makefiles/: buildvms.com
    Removed files:
    nedit/source/: comnedit.com lnknedit.com
    nedit/util/: comutil.com

    Log message:
    VMS porting fixes contributed by Michael Smith.

    Please have a look and let us know what he missed and what
    else could be improved.

    It's certainly good to have more than one person look out
    for the VMS stuff. We had none when 5.5 was prepared, and
    you know the result. So keep it up, and thanks!

     
  • zinser
    zinser
    2006-01-04

    Logged In: YES
    user_id=1417849

    Hello Thorsten,

    thanks, this is really good news. I am currently checking
    the CVS. Some of the C issues have been addressed and are
    moot, for some I will create a new patch against the current
    CVS version. The build procedure is in some respects better
    than mine and in some others mine is better than Michaels. I
    will create a new one which contains the best of both and
    submit that. I should have everything ready by the end of
    the week.

    Greetings, Martin

     
  • zinser
    zinser
    2006-01-09

    Logged In: YES
    user_id=1417849

    Hello Thorsten,

    I will try to upload two files. One contains the diffs against
    the current CVS versions.

    Changes:

    source/file.c has a

    #ifdef VMS
    #include <unistd.h>
    ...
    #else
    #incluce <unistd.h>
    ...
    #endif

    This can be simplified ;-)

    Microline/XmL/Folder.c, Grid.c and Tree.c have a couple
    of instances where an unsigned int is check to contain a
    value <= 0. Use explicit cast to (int) for this to make
    sense.

    source/menu.c lists ^ as a forbidden character in VMS
    filenames, which it is not.

    The other one is a reworked copy of makefiles/buildvms.com
    This does integrate all the good stuff from Michaels
    procedure with the strenghts of mine.

    How do I best stay in touch to find out when you are
    starting the betas for the next version, so I can make sure
    everting is ok for the next release?

    Greetings, Martin

     
  • zinser
    zinser
    2006-01-09

    Diff with VMS changes against current CVS

     
    Attachments
  • zinser
    zinser
    2006-01-09

    Updated VMS build procedure for VMS

     
    Attachments
  • Thorsten Haude
    Thorsten Haude
    2006-01-14

    Logged In: YES
    user_id=119143

    The unistd.h thing is straightforward, no VMS about it.

    About the other changes: I would rather cast 0 to Dimension.
    That way the nature of the comparison is better explained.
    What do you think?

     
  • Thorsten Haude
    Thorsten Haude
    2006-01-14

    Logged In: YES
    user_id=119143

    I just committed the unistd part.

     
  • zinser
    zinser
    2006-01-16

    Logged In: YES
    user_id=1417849

    Hello Thorsten,

    thanks for checking in the unistd.h fix, one down :-)
    As for the comparisons <= 0 the problem is not the type of
    the 0, but the operator being used (<=), The Dimension is an
    unsigned type, so comparing it to a value <(=) 0, does
    strictly speaking make no sense. There are two possibilites,
    either we are sure the values do not go below 0, then the
    comparison could be changed to a == and no cast is needed.
    If some rougue calls could fill the variable with e.g. -1
    then the cast to a signed type is needed and it can not be
    Dimension. What are your thoughts on this?

    Greetings, Martin

    P.S. The patch to source/menu.c is inside an #ifdef VMS and
    should be applicable without affecting any other platform.

     
  • Thorsten Haude
    Thorsten Haude
    2006-01-16

    Logged In: YES
    user_id=119143

    You're right of course, I thought too much about it. In
    fact, there is no reason why the left-values could ever be <
    0, all of them are Dimension (unsigned short, according to
    6B). So let's not think about it but just remove the warning.

     
  • zinser
    zinser
    2006-01-17

    Logged In: YES
    user_id=1417849

    Hello Thorsten,

    ok, I will write a new patch with this approach. I should
    manage to do this during my commute tomorrow morning, so
    with any luck I should have it tomorrow evening.

    Greetings, Martin

     
  • Michael Smith
    Michael Smith
    2006-01-17

    Logged In: YES
    user_id=634686

    I have my VMS system running again. I can see that the
    sources from CVS are not compiling again. This shouldn't be
    too hard to fix.

    I have downloaded the two files contributed by "zinser":

    buildvms.com
    nedit55_vms.diff

    At first look the compilation script looks very good. I will
    know more when I run it. I am a bit unsure about how to
    apply the patch (I am doing this on my linux system, not
    attempting to patch on vms). Can anybody suggest appropriate
    switches to use when feeding this file into patch? It starts
    with:

    *** source/file.c.orig 2006-01-04 08:19:18.000000000 +0000
    --- source/file.c 2006-01-04 08:19:34.000000000 +0000
    ***************
    *** 53,71 ****

    ...so I need to tell patch not to actually look for
    source/file.c.orig

     
  • zinser
    zinser
    2006-01-19

    Logged In: YES
    user_id=1417849

    Hello Thorsten, hello Michael,

    sorry for the delay, lets say things in the office are
    "interesting" right now. I will upload a new version of the
    patch with better naming convention.

    Michael, when you put the new patch in the main directory of
    NEdit a

    patch -p0 <patch-file

    should apply it.

    Note: Patch has been written against the CVS version of the
    files.

    Where can I get a tarball of the current development version
    or do I have to pull all the files individually from CVS?

    Greetings, Martin

     
  • zinser
    zinser
    2006-01-19

    Revised diff against current CVS

     
    Attachments
  • Michael Smith
    Michael Smith
    2006-01-21

    Logged In: YES
    user_id=634686

    Hi Martin, I appreciate the effort you are putting in to
    this, but I am still having problems:

    [smithm@server nedit]$ patch -p0 < ../nedit55_2.diff
    patching file Microline/XmL/Folder.c
    Hunk #2 FAILED at 500.
    Hunk #3 FAILED at 1105.
    Hunk #4 FAILED at 1442.
    3 out of 4 hunks FAILED -- saving rejects to file
    Microline/XmL/Folder.c.rej patching file Microline/XmL/Grid.c
    Hunk #1 FAILED at 1465.
    1 out of 1 hunk FAILED -- saving rejects to file
    Microline/XmL/Grid.c.rej patching file Microline/XmL/Tree.c
    Hunk #1 FAILED at 234.
    1 out of 1 hunk FAILED -- saving rejects to file
    Microline/XmL/Tree.c.rej patching file source/menu.c

    Could you possibly send me the modified files directly? I
    don't think the list software will forward attachments. My
    email address is smithm at netapps dot com dot au

    Thanks.

     
  • Thorsten Haude
    Thorsten Haude
    2006-01-21

    Logged In: YES
    user_id=119143

    After a first look I don't know why they fail, but it
    should be possible to create a patch and use that.

    Also, I like the casting better than switching from <= to
    ==.

     
  • zinser
    zinser
    2006-01-22

    Logged In: YES
    user_id=1417849

    Hello Thorsten,

    I am currently directly in contact with Michael to get the
    changed files to him and test out buildvms.com (changed once
    more to include the util/motif.c added after the 5.5 release
    and squishing a bug ;-). Attached below is version 3 of the
    patch, which switches again to casting instead of changing the
    operator.

    All the best,

    Martin

    P.S. Once we are through with this and get a version that
    just builds cleanly on VMS I will go over the code and see
    if we can get rid of some of the #ifdef VMS branches in
    there ;-)

     
  • zinser
    zinser
    2006-01-22

     
    Attachments
  • Thorsten Haude
    Thorsten Haude
    2006-08-18

    Logged In: YES
    user_id=119143

    I just checked in another batch. Is there anything left?

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-17

    Logged In: YES
    user_id=119143

    What's the status of this? Could anyone with access to VMS
    have a look?

     
  • Thorsten Haude
    Thorsten Haude
    2006-09-18

    • assigned_to: nobody --> michaelsmith
     
  • Michael Smith
    Michael Smith
    2006-09-25

    Differences against cvs required to get nedit working under OpenVMS

     
    Attachments
  • Thorsten Haude
    Thorsten Haude
    2006-09-25

    Logged In: YES
    user_id=119143

    About the patch and your mail
    (http://www.nedit.org/pipermail/develop/2006-September/012390.html):
    Shouldn't VMS be posix? According to my manpage, stat() is
    posix, only st_blocks and st_blksiz are expected to be less
    portable.

    A quick query with Marjory finds this:
    http://search.cpan.org/src/PVHP/vms-stat-0_03/stat.xs
    (Part of http://search.cpan.org/~pvhp/vms-stat-0_03/\) Is
    this of any help?

    (Also, I prefer diffs created with --unified=5, but this is
    just a personal preference.)