File: configure.com

package info (click to toggle)
t1lib0 0.7.1-5
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,740 kB
  • ctags: 2,569
  • sloc: ansic: 20,709; sh: 2,298; makefile: 878; python: 532
file content (196 lines) | stat: -rwxr-xr-x 6,190 bytes parent folder | download
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
$ goto start

This command file writes the command files make.com in this directory, make.com
and sysconf.h in [.lib.t1lib], make.com in [.lib.type1], and make.com in
[.xglyph].  Executing the make.com in this directory will use the other
make.com files to compile the C files and put them in the T1 object library in
this directory, and compile and link xglyph.

Xglyph requires the xaw and xmu libraries; I used the libraries that came with
ghostview.  This command file looks for a required header file in
X11_ROOT:[XAW].  If it does not find it looks for an X11 directory tree
parallel to this tree.  If it does not find it there, it creates the command
file, but you have to edit it to tell it where the files and libraries are
before you can execute it.  I linked ghostview using the static version of xmu
and xaw, so I link to object libraries instead of sharable images.  I renamed
the xaw3d directory to xaw in the x11 tree of ghostview so I did not have to
change xglyph.c.  To run xglyph on V6.* of VMS, you need to define T1LIB_CONFIG
to be the T1LIB.CONFIG file in the xglyph directory; it will also not show the
timing information on V6.*.

I have compiled the library and run xglyph on VMS V6.2, both VAX and Alpha; I
used DECC V5.6.  I use IEEE floating on Alpha and G floating on VAX.

John Hasstedt
Physics Department
State University of New York at Stony Brook
John.Hasstedt@sunysb.edu

$start:
$ say = "write sys$output"
$ !
$ say "Getting the version number"
$ t1lib_identifier = "?.?"
$ open/read in configure.
$loop:
$ read/end=done in rec
$ if (f$element(0,"=",rec) .nes. "T1LIB_IDENTIFIER") then goto loop
$ t1lib_identifier = f$element(1,"=",rec)
$done:
$ close in
$ !
$ say "Creating make.com"
$ create make.com
$ open/append out make.com
$ if (f$getsyi("ARCH_NAME") .eqs. "VAX")
$ then
$   float = "g_float"
$ else
$   float = "ieee_float"
$ endif
$ defs =        "T1LIB_IDENT=""""""""""" + t1lib_identifier + """""""""""" + ","
$ defs = defs + "GLOBAL_CONFIG_DIR=""""""""""""T1_FONT_DIR""""""""""""" + ","
$ defs = defs + "T1_AA_TYPE16=""""short"""",T1_AA_TYPE32=""""int"""""
$ write out "$ cflags = ""/prefix=all/float=''float'"""
$ write out "$ cflags = cflags + ""/define=(", defs, ")"""
$ write out "$ write sys$output ""Compiling in [.lib.t1lib]"""
$ write out "$ set default [.lib.t1lib]"
$ write out "$ @make.com"
$ write out "$ write sys$output ""Compiling in [.lib.type1]"""
$ write out "$ set default [-.type1]"
$ write out "$ @make.com"
$ write out "$ set default [--]"
$ write out "$ write sys$output ""Creating t1.olb"""
$ write out "$ library/create t1.olb [.lib.t1lib]*.obj,[.lib.type1]*.obj"
$ write out "$ write sys$output ""Creating xglyph.exe"""
$ write out "$ set default [.xglyph]"
$ write out "$ @make.com"
$ write out "$ set default [-]"
$ write out "$ write sys$output ""Done"""
$ write out "$ exit"
$ close out
$ !
$ say "Creating [.lib.t1lib]sysconf.h"
$ cc sys$input:/float='float'/object=test.obj
#include <stdlib.h>
#include <stdio.h>
main()
{
  FILE *f=fopen("[.lib.t1lib]sysconf.h", "w");
  if (!f) exit(EXIT_FAILURE);
  fprintf(f, "#define SIZEOF_CHAR %d\n", sizeof(char));
  fprintf(f, "#define SIZEOF_SHORT %d\n", sizeof(short));
  fprintf(f, "#define SIZEOF_INT %d\n", sizeof(int));
  fprintf(f, "#define SIZEOF_LONG %d\n", sizeof(long));
#ifdef __VAX
  fprintf(f, "#define SIZEOF_LONG_LONG %d\n", sizeof(long));
#else
  fprintf(f, "#define SIZEOF_LONG_LONG %d\n", sizeof(long long));
#endif
  fprintf(f, "#define SIZEOF_FLOAT %d\n", sizeof(float));
  fprintf(f, "#define SIZEOF_DOUBLE %d\n", sizeof(double));
#ifdef __VAX
  fprintf(f, "#define SIZEOF_LONG_DOUBLE %d\n", sizeof(double));
#else
  fprintf(f, "#define SIZEOF_LONG_DOUBLE %d\n", sizeof(long double));
#endif
  fprintf(f, "#define SIZEOF_VOID_P %d\n", sizeof(void *));
  exit(EXIT_SUCCESS);
}
$ link test
$ run test
$ delete test.obj;*,test.exe;*
$ !
$ say "Creating [.lib.t1lib]make.com"
$ copy sys$input: [.lib.t1lib]make.com
$ deck
$ v = f$verify (1)
$ cc'cflags' parseafm.c
$ cc'cflags' t1aaset.c
$ cc'cflags' t1afmtool.c
$ cc'cflags' t1base.c 
$ cc'cflags' t1delete.c
$ cc'cflags' t1enc.c
$ cc'cflags' t1env.c
$ cc'cflags' t1finfo.c
$ cc'cflags' t1load.c
$ cc'cflags' t1set.c
$ cc'cflags' t1trans.c
$ cc'cflags' t1x11.c
$ v = 'f$verify(v)'
$ exit
$eod
$ !
$ say "Creating [.lib.type1]make.com"
$ create [.lib.type1]make.com
$ deck
$ v = f$verify (1)
$ cc'cflags' arith.c
$ cc'cflags' bstring.c
$ cc'cflags' curves.c
$ cc'cflags' fontfcn.c
$ cc'cflags' hints.c
$ cc'cflags' lines.c
$ cc'cflags' objects.c
$ cc'cflags' paths.c
$ cc'cflags' regions.c
$ cc'cflags' scanfont.c
$ cc'cflags' spaces.c
$ cc'cflags' t1io.c
$ cc'cflags' t1snap.c
$ cc'cflags' t1stub.c
$ cc'cflags' token.c
$ cc'cflags' type1.c
$ cc'cflags' util.c
$ v = 'f$verify (v)'
$eod
$ !
$ say "Creating [.xglyph]make.com"
$ dir = f$trnlnm ("X11_ROOT") - ".]"
$ if (dir .eqs. "" .or. f$search("''dir'.xaw]label.h") .eqs. "")
$ then
$  dir = f$parse("[-.x11]") - "].;"
$ endif
$ create [.xglyph]make.com
$ open/append out [.xglyph]make.com
$ if (dir .eqs. "")
$ then
$   say "I could not locate the xaw and xmu files.  You must edit"
$   say "[.xglyph]make.com before you can build xglyph."
$   write out "$ type/nopage sys$input"
$   write out "You must edit this file to delete the exit command and define"
$   write out "the dir symbol for the location of the xmu and xaw libraries."
$   write out "$ exit"
$   write out "$ dir = ""<disk>:[dir.X11"""
$ else
$   write out "$ dir = ""''dir'"""
$ endif
$ copy sys$input: out
$ deck
$ if (f$getsyi("ARCH_NAME") .eqs. "VAX")
$ then
$   float = "g_float"
$   olb_dir = "exe"
$ else
$   float = "ieee_float"
$   olb_dir = "exe_alpha"
$ endif
$ define x11 'dir'.],decw$include:
$ define x11_directory decw$include:
$ define xmu_directory 'dir'.xmu]
$ define xaw_directory 'dir'.xaw]
$ define olb_directory 'dir'.'olb_dir']
$ v = f$verify (1)
$ cc xglyph/prefix=all/float='float'
$ link xglyph,[-]t1/library,sys$input/option
sys$share:decc$shr.exe/share
sys$share:decw$xextlibshr/share
sys$share:decw$xlibshr/share
sys$share:decw$xtlibshrr5/share
olb_directory:xaw3dlib/library
olb_directory:xmulib/library
$ v = 'f$verify (v)'
$eod
$ close out
$ exit