aboutsummaryrefslogtreecommitdiff
path: root/graphics/ralcgm/ralcgm-linux.patch
blob: 4121c62a0bbbee82dd25b397294b5a8b1373f8aa (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
diff -Nur ralcgm-3.50.orig/CGMconfig ralcgm-3.50/CGMconfig
--- ralcgm-3.50.orig/CGMconfig	Tue Apr 19 11:42:17 1994
+++ ralcgm-3.50/CGMconfig	Mon Mar 19 23:10:54 2001
@@ -111,13 +111,13 @@
    echo; exit
 fi
 
-systems='sun3|sun4|cray|craypcc|iris|iris4d|indigo|rs6000|hpux|ultrix|decosf|topaz'
+systems='sun3|sun4|cray|craypcc|iris|iris4d|indigo|rs6000|hpux|ultrix|decosf|topaz|linux'
 
 #
 # Set the echo options - check the system.
 #
 case $1 in
-sun3|sun4|iris|ultrix|dec|rs6000)
+sun3|sun4|iris|ultrix|dec|rs6000|linux)
 #  Berkely echo format
                 el="-n"
                 er=""
@@ -269,6 +269,14 @@
       cflags="-c -O -m68881"
       lflags="-lE -lmalloc -lm"
       ;;
+linux)
+      system=linux
+      cflags="-c ${OPT}"
+      lflags="-lm"
+      xw="yes"
+      xlib="-lX11"
+      ar="ar crs"
+      ;;
 esac
 
 #
@@ -672,31 +680,31 @@
 echo Your desired system will now be configured.
 echo
 
-oututils="$(ATTUTILS)"
+oututils='$(ATTUTILS)'
 
 if test "$gdpflag" = "yes"
 then
-   oututils=$oututils" $(GDPUTILS)"
+   oututils=$oututils' $(GDPUTILS)'
 fi
 
 if test "$filflag" = "yes"
 then
-   oututils=$oututils" $(FILUTILS)"
+   oututils=$oututils' $(FILUTILS)'
 fi
 
 if test "$colrflag" = "yes"
 then
-   oututils=$oututils" $(COLRUTILS)"
+   oututils=$oututils' $(COLRUTILS)'
 fi
 
 if test "$cellflag" = "yes"
 then
-   oututils=$oututils" $(CELLUTILS)"
+   oututils=$oututils' $(CELLUTILS)'
 fi
 
 if test "$ptsflag" = "yes"
 then
-   oututils=$oututils" $(PTSUTILS)"
+   oututils=$oututils' $(PTSUTILS)'
 fi
 
 sed "/^MODULE =/s!=.*\$!= $module!
diff -Nur ralcgm-3.50.orig/CGMinstall ralcgm-3.50/CGMinstall
--- ralcgm-3.50.orig/CGMinstall	Tue Apr 19 11:42:17 1994
+++ ralcgm-3.50/CGMinstall	Mon Mar 19 23:10:54 2001
@@ -111,13 +111,13 @@
    echo; exit
 fi
 
-systems='sun3|sun4|cray|craypcc|iris|iris4d|indigo|rs6000|hpux|ultrix|decosf|topaz'
+systems='sun3|sun4|cray|craypcc|iris|iris4d|indigo|rs6000|hpux|ultrix|decosf|topaz|linux'
 
 #
 # Set the echo options - check the system.
 #
 case $1 in
-sun3|sun4|iris|ultrix|dec|rs6000)
+sun3|sun4|iris|ultrix|dec|rs6000|linux)
 #  Berkely echo format
                 el="-n"
                 er=""
@@ -269,6 +269,14 @@
       cflags="-c -O -m68881"
       lflags="-lE -lmalloc -lm"
       ;;
+linux)
+      system=linux
+      cflags="-c ${OPT}"
+      lflags="-lm"
+      xw="yes"
+      xlib="-lX11"
+      ar="ar crs"
+      ;;
 esac
 
 #
@@ -672,31 +680,31 @@
 echo Your desired system will now be configured.
 echo
 
-oututils="$(ATTUTILS)"
+oututils='$(ATTUTILS)'
 
 if test "$gdpflag" = "yes"
 then
-   oututils=$oututils" $(GDPUTILS)"
+   oututils=$oututils' $(GDPUTILS)'
 fi
 
 if test "$filflag" = "yes"
 then
-   oututils=$oututils" $(FILUTILS)"
+   oututils=$oututils' $(FILUTILS)'
 fi
 
 if test "$colrflag" = "yes"
 then
-   oututils=$oututils" $(COLRUTILS)"
+   oututils=$oututils' $(COLRUTILS)'
 fi
 
 if test "$cellflag" = "yes"
 then
-   oututils=$oututils" $(CELLUTILS)"
+   oututils=$oututils' $(CELLUTILS)'
 fi
 
 if test "$ptsflag" = "yes"
 then
-   oututils=$oututils" $(PTSUTILS)"
+   oututils=$oututils' $(PTSUTILS)'
 fi
 
 sed "/^MODULE =/s!=.*\$!= $module!
diff -Nur ralcgm-3.50.orig/include/cgmmach.h ralcgm-3.50/include/cgmmach.h
--- ralcgm-3.50.orig/include/cgmmach.h	Mon Jun 12 15:18:12 1995
+++ ralcgm-3.50/include/cgmmach.h	Mon Mar 19 23:10:54 2001
@@ -87,6 +87,9 @@
 #ifndef Double
 #define Double  double
 #endif
+#ifndef Posint64
+#define Posint64 unsigned long
+#endif
 
 /* Define macros for some maths routines which may cause problems */
 
diff -Nur ralcgm-3.50.orig/include/mc_linux.h ralcgm-3.50/include/mc_linux.h
--- ralcgm-3.50.orig/include/mc_linux.h	Thu Jan  1 01:00:00 1970
+++ ralcgm-3.50/include/mc_linux.h	Mon Mar 19 23:10:54 2001
@@ -0,0 +1,33 @@
+/*  RAL-CGM Interpreter header file
+ *
+ *  Linux specific setting for CGM interpreter
+ */
+
+/*  Define Machine  */
+
+#define LINUX
+
+/*  Define Graphics system(s)  */
+
+#define POSTSCRIPT
+#define BEZIER
+#define HERSHEY
+#define XW
+
+#define DATADIR ""
+
+#define NAMELGTH  32
+#define EXTLGTH    8
+
+#define Posint64 unsigned long long
+#define MALLOCH
+#include <stdlib.h>
+
+#ifdef CGMOXW_C      /* X-Window specific settings  */
+
+#include <X11/cursorfont.h>
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/Xatom.h>
+
+#endif
diff -Nur ralcgm-3.50.orig/src/cgmobin.c ralcgm-3.50/src/cgmobin.c
--- ralcgm-3.50.orig/src/cgmobin.c	Fri Jun 16 15:10:19 1995
+++ ralcgm-3.50/src/cgmobin.c	Mon Mar 19 23:11:52 2001
@@ -1593,7 +1593,8 @@
 Enum real_type, real_or_vdc;
 #endif
 {
-   Posint whole, exponent, fract, neg;
+   Posint whole, exponent, neg;
+   Posint64 fract;
    Prec prec;
    Double f;
 
@@ -1610,7 +1611,7 @@
       prec = (real_or_vdc == VDC ? curbin.vdc_whole
                                  : curbin.real_whole);
       whole = (Posint)( neg ? -((floor(x))) : x );
-      fract = (Posint)( ( neg ? x + (Double)whole : x - (Double)whole )
+      fract = (Posint64)( ( neg ? x + (Double)whole : x - (Double)whole )
                             * ( 1L<<prec-2 ) * 4.0 );
 
 #ifdef DEBUG
@@ -1669,7 +1670,7 @@
                exponent--;
             }
          }
-         fract = (Long) ( (f - 1.0) * (Double)(1L<<(prec == 12 ? 52 : 23)) );
+         fract = (Posint64) ( (f - 1.0) * (Double)(1L<<(prec == 12 ? 52 : 23)) );
       }
 
 #ifdef DEBUG
diff -Nur ralcgm-3.50.orig/src/cgmrand.c ralcgm-3.50/src/cgmrand.c
--- ralcgm-3.50.orig/src/cgmrand.c	Tue Jun 13 17:32:50 1995
+++ ralcgm-3.50/src/cgmrand.c	Mon Mar 19 23:10:54 2001
@@ -349,7 +349,11 @@
 /* Correct any overrun */
    if(cgmoverrun)
    {
+#ifdef LINUX
+      disk_addr.__pos -= cgmoverrun;
+#else
       disk_addr -= cgmoverrun;
+#endif
       cgmoverrun = 0;
    }