summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipsk/vms/vms_gcc.txt
blob: 5159ce6ddb1aadfd8f24d37d8f1ec5db447962c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
                                DVIPS & GNU C

Changes that had to be made in order to compile the DVIPS program with the GNU
CC (GCC) compiler on Vax/VMS. 

(1) DVIPS.C
(a) Problem with 'include' files. The person who did the original port to VMS
used the :
#include filename
notation rather than the more traditional
#include "filename.h"
notation.  With the VAX C compiler this means that the chosen header file is
extracted from the SYS$SHARE:VAXCDEF.TLB text library. Well, the GCC compiler
doesn't understand this notation. Now, I could've simply changed it so that if
the code was being compiled on a VMS machine then use the 
#include "filename.h"
notation regardless of the compiler. But some sites may not have extracted the
header files from the text library when the VAX C compiler was installed.
This problem also affects the VMSCLI.C file on the [.VMS] directory.

(b) The TFMPATH, PKPATH, etc.., definitions cannot be defined in the MAKEFILE
because the GCC.EXE program complains with the following error message...
% gcc-cpp command too long.  Unable to compile.

After removing some of the path definitions to shorten the command (just too
see roughly how big the buffer was) I eventually tricked the GCC.EXE program
into getting as far as executing the GNU_CC:[000000]GCC.COM command file but
it then complained, giving the following message...
%DCL-W-TKNOVF, command element is too long - shorten
So, I gave up and took the easy way out, i.e. put these PATH definitions back
in to a new GCC-specific PATHS.H, called VMS_GCC_PATHS.H

(2) DOSPECIAL.C
The "tolower" macro, defined in GNU_CC:[INCLUDE]CTYPE.H, is too simple. It
doesn't check to see if the character is in the range 'A' to 'Z' therefore
we may as well use the "Tolower" function supplied in the DOSPECIAL.C file.

(3) The MAKEFILE has been updated to handle the GCC compiler. It must be edited
by the user to select either the VAX11C or the GCC compiler. Search for the
strings VAXC or GNUC and comment out the appropriate lines.

(4) VMS.H
The "getchar" macro is undefined if it already exists. This is just to stop the
warning message from the GCC compiler informing us that it is being redefined.
GNUC defines it in GNU_CC:[INCLUDE]STDIO.H

(5) VAXVMS.C
Defined all the functions at the top of the file to keep the GCC compiler
quiet, since it reported the following problems...

vaxvms.c;1: In function vms_ftell:
vaxvms.c;1:223: warning: `vms_ftell' was previously implicitly declared to return `int'
vaxvms.c;1: In function vms_ungetc:
vaxvms.c;1:296: warning: `vms_ungetc' was previously implicitly declared to return `int'
vaxvms.c;1: In function vms_getenv:

Next, if using the GNU CC compiler then #include <stdlib.h> so that the
compiler knows all about the `strchr' and `getenv' functions, hence avoiding
the following warnings...

vaxvms.c;1:331: warning: assignment of pointer from integer lacks a cast
vaxvms.c;1:333: warning: assignment of pointer from integer lacks a cast
vaxvms.c;1:336: warning: assignment of pointer from integer lacks a cast
vaxvms.c;1:340: warning: assignment of pointer from integer lacks a cast

-------------------------------------------------------------------------------
These changes were tested with GCC 1.42 which is the  current official release
of VMS GCC, available from any of the many GNU archive sites. These changes
were also tested with GCC 2.3.3 which is avaliable from MANGO.RSMAS.MIAMI.EDU
(pub/VMS-gcc). The problem to be aware of is that GNUC doesn't have a
CLIMSGDEF.H header file (needed for DVIPS.C). One way out it to create one by
hand from the output from ...
$ LIBRARY/MACRO/EXTRACT=$CLIMSGDEF/OUTPUT=SYS$OUTPUT SYS$LIBRARY:STARLET.MLB
The other solution is to use the more complete package of C header files
provided by Pat Rankin, also available at MANGO.RSMAS.MIAMI.EDU