summaryrefslogtreecommitdiff
path: root/lib-src/make-docfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib-src/make-docfile.c')
-rw-r--r--lib-src/make-docfile.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 27f64145c85..d8395ac9a9c 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -348,10 +348,42 @@ scan_c_file (filename, mode)
register int defvarperbufferflag;
register int defvarflag;
int minargs, maxargs;
- int extension = filename[strlen (filename) - 1];
+ char *extpos;
+ char extension;
+
+#ifdef VMS /* It could be that make-docfile is invoked with comma-separated
+ args (that include the comma for crying out loud!), so we
+ munge object file names a bit to accomodate. Insert rant on
+ DCL lossage here. NOTE: This cruft should be strictly
+ confined to the ttn-vms-21-2-stash branch; build methodology
+ for other branches should be improved so that this is not
+ required. --ttn */
+
+ /* Ignore trailing comma. */
+ if (',' == filename[strlen (filename) - 1])
+ filename[strlen (filename) - 1] = '\0';
+
+ /* Ignore trailing "bj" so that ".obj" is considered as ".o" below. To
+ avoid this kludge we would have to convince MMS (make(1)-like tool
+ under VMS) to support VPATH so that a user-specified .c.o rule would
+ work correctly. But MMS is proprietary software so any such convincing
+ involves uncountable layers of bureacracy and suit-swimming, just to
+ talk to programmers who may or may not DTRT in the end. Blech. */
+ if ('b' == filename[strlen (filename) - 2] &&
+ 'j' == filename[strlen (filename) - 1])
+ filename[strlen (filename) - 2] = '\0';
+
+ /* Ignore leading comma. */
+ if (',' == filename[0])
+ filename++;
+
+#endif /* VMS */
+
+ extpos = filename + strlen (filename) - 1;
+ extension = *extpos;
if (extension == 'o')
- filename[strlen (filename) - 1] = 'c';
+ *extpos = 'c';
infile = fopen (filename, mode);
@@ -363,7 +395,7 @@ scan_c_file (filename, mode)
}
/* Reset extension to be able to detect duplicate files. */
- filename[strlen (filename) - 1] = extension;
+ *extpos = extension;
c = '\n';
while (!feof (infile))