1$ goto start
2
3This command file writes the command files make.com in this directory, make.com
4and sysconf.h in [.lib.t1lib], make.com in [.lib.type1], and make.com in
5[.xglyph].  Executing the make.com in this directory will use the other
6make.com files to compile the C files and put them in the T1 object library in
7this directory, and compile and link xglyph.
8
9Xglyph requires the xaw and xmu libraries; I used the libraries that came with
10ghostview.  This command file looks for a required header file in
11X11_ROOT:[XAW].  If it does not find it looks for an X11 directory tree
12parallel to this tree.  If it does not find it there, it creates the command
13file, but you have to edit it to tell it where the files and libraries are
14before you can execute it.  I linked ghostview using the static version of xmu
15and xaw, so I link to object libraries instead of sharable images.  I renamed
16the xaw3d directory to xaw in the x11 tree of ghostview so I did not have to
17change xglyph.c.  To run xglyph on V6.* of VMS, you need to define T1LIB_CONFIG
18to be the T1LIB.CONFIG file in the xglyph directory; it will also not show the
19timing information on V6.*.
20
21I have compiled the library and run xglyph on VMS V6.2, both VAX and Alpha; I
22used DECC V5.6.  I use IEEE floating on Alpha and G floating on VAX.
23
24John Hasstedt
25Physics Department
26State University of New York at Stony Brook
27John.Hasstedt@sunysb.edu
28
29Nov-1999
30
31- Extended the functionality to check for xaw/xmu also in the X11 path (which
32  is the most Unix compatible way to store them ;-).
33- Added tests for shareable version of the Xaw/Xmu libraries, using the
34  shareable images if the appropriate logicals are defined. If not  the object
35  libraries are used as before.
36- Added support for type1afm build
37- Adapted to t1lib 0.9.2
38
39Dec-1999
40
41- Added support for absolute pathnames for font files under OpenVMS
42
43Aug-2000
44
45- First cut of an incremental build
46
47Jul-2002
48
49- Create a shareable image on OpenVMS Alpha
50
51Feb-2003
52
53- Add missing initialization for xaw_root
54- Clarify description of Xglyph as >>test<< application
55- Improved method to build options file for shareable image
56  (Thanks to Hartmut Becker Hartmut.Becker@compaq.com)
57    
58Feb-2004
59
60- Add DECC$NO_ROOTED_SEARCH_LISTS definition to get Xglyph compile ok
61  on later versions of Compaq C
62
63Nov-2004
64- Save and restore user environment instead of just overwriting
65- Build example applications
66- Add options processing
67- Polish shareable image creation
68- Start work on version perserving case
69  
70Dec-2004
71- Moving defines into sysconf.h, avoiding quote madness
72
73Martin Zinser
74zinser@zinser.no-ip.info
75
76$start:
77$ ! If a user has a symbol cc or something else, don't use it.
78$ set symbol/scope=(nolocal,noglobal)
79$ say = "write sys$output"
80$ !
81$ say "Getting the version number"
82$ t1lib_identifier = "?.?"
83$ open/read in configure.
84$loop:
85$ read/end=done in rec
86$ if (f$element(0,"=",rec) .nes. "T1LIB_IDENTIFIER") then goto loop
87$ t1lib_identifier = f$element(1,"=",rec)
88$done:
89$ close in
90$ !
91$ say "Creating make.com"
92$ create make.com
93$ open/append out make.com
94$ copy sys$input: out
95$ deck
96$ true  = 1
97$ false = 0
98$ tmpnam = "temp_" + f$getjpi("","pid")
99$ tt = tmpnam + ".txt"
100$ tc = tmpnam + ".c"
101$ th = tmpnam + ".h"
102$ its_decc = false
103$ its_vaxc = false
104$ its_gnuc = false
105$ s_case   = False
106$!
107$! Setup variables holding "config" information
108$!
109$ ccopt   = ""
110$ lopts   = ""
111$!
112$! Which command parameters were given
113$!
114$ gosub check_opts
115$!
116$eod
117$ if (f$getsyi("ARCH_NAME") .eqs. "VAX")
118$ then
119$   float = "g_float"
120$ else
121$   float = "ieee_float"
122$ endif
123$ write out "$ cflags = ""/prefix=all/float=''float'"" + ccopt"
124$ copy sys$input: out
125$ deck
126$! 
127$! Marker for futher work with name=as_is compilation to work around
128$! fact that DECW shareable does not contain mixed case entry points
129$! TBD: Compile t1x11 and xglyph along the lines of [--]motif_name.h+'source'
130$!      Make sure to get the include path to the "jackets" right
131$!
132$ if s_case 
133$ then 
134$   create motif_name.h
135$   open/append outh motif_name.h
136$   copy sys$input: outh
137$   deck/dollar="$   eoh"
138#ifdef __cplusplus
139#define VMS_BEGIN_C_PLUS_PLUS extern "C" {
140#define VMS_END_C_PLUS_PLUS }
141#else
142#define VMS_BEGIN_C_PLUS_PLUS
143#define VMS_END_C_PLUS_PLUS
144#endif
145
146#include "motif_redefines.h"
147$   eoh
148$   close outh   
149$ endif
150$ set default [.lib.t1lib]
151$ @make.com
152$ write sys$output "Compiling in [.lib.type1]"
153$ set default [-.type1]
154$ @make.com
155$ set default [--]
156$ write sys$output "Creating t1.olb"
157$ library/create t1.olb [.lib.t1lib]*.obj,[.lib.type1]*.obj
158$ write sys$output "Creating xglyph.exe"
159$ set default [.xglyph]
160$ @make.com
161$ set default [-]
162$ write sys$output "Creating type1afm.exe"
163$ set default [.type1afm]
164$ @make.com
165$ set default [-]
166$ write sys$output "Creating example applications"
167$ set default [.examples]
168$ @make.com
169$ set default [-]
170$!
171$! Establish the Compiling Environment
172$!
173$ Cpu_Model = F$GetSYI("HW_MODEL")
174$ open/write optf t1.opt
175$T1_L:
176$ file = f$search("[.lib.t1lib]*.obj")
177$ if file .eqs. "" then goto TY_L
178$ write optf file
179$ goto t1_l
180$TY_L:
181$ file = f$search("[.lib.type1]*.obj")
182$ if file .eqs. "" then goto end_opt
183$ write optf file
184$ goto ty_l
185$END_OPT:
186$ close/nolog optf
187$!
188$! Alpha gets a shareable image
189$!
190$ If Cpu_Model .gt. 1024
191$ Then
192$   write sys$output "Creating t1shr.exe"
193$   call anal_obj_axp t1.opt _link.opt
194$   open/append optf t1.opt
195$   if s_case then write optf "case_sensitive=YES"
196$   write optf "sys$share:decw$xlibshr.exe/share"
197$   close optf
198$   LINK_/NODEB/SHARE=t1shr.exe t1.opt/opt,_link.opt/opt
199$ endif
200$!
201$ dele/noconf *.opt;*
202$ write sys$output "Done"
203$ exit
204$!
205$!------------------------------------------------------------------------------
206$!
207$! Analyze Object files for OpenVMS AXP to extract Procedure and Data 
208$! information to build a symbol vector for a shareable image
209$! All the "brains" of this logic was suggested by Hartmut Becker
210$! (Hartmut.Becker@compaq.com). All the bugs were introduced by me
211$! (zinser@zinser.no-ip.info), so if you do have problem reports please do not
212$! bother Hartmut/HP, but get in touch with me
213$!
214$! Version history
215$! 0.01 20040406 Skip over shareable images in option file
216$! 0.02 20041109 Fix option file for shareable images with case_sensitive=YES
217$!
218$ ANAL_OBJ_AXP: Subroutine   
219$ V = 'F$Verify(0)
220$ SAY := "WRITE_ SYS$OUTPUT"
221$ 
222$ IF F$SEARCH("''P1'") .EQS. ""
223$ THEN
224$    SAY "ANAL_OBJ_AXP-E-NOSUCHFILE:  Error, inputfile ''p1' not available"
225$    goto exit_aa
226$ ENDIF
227$ IF "''P2'" .EQS. ""
228$ THEN
229$    SAY "ANAL_OBJ_AXP:  Error, no output file provided"
230$    goto exit_aa
231$ ENDIF
232$
233$ open/read in 'p1
234$ create a.tmp
235$ open/append atmp a.tmp
236$ loop:
237$ read/end=end_loop in line
238$ if f$locate("/SHARE",f$edit(line,"upcase")) .lt. f$length(line)
239$ then
240$   write sys$output "ANAL_SKP_SHR-i-skipshare, ''line'"
241$   goto loop
242$ endif
243$ f= f$search(line)
244$ if f .eqs. ""
245$ then
246$	write sys$output "ANAL_OBJ_AXP-w-nosuchfile, ''line'"
247$	goto loop
248$ endif
249$ define/user sys$output nl:
250$ define/user sys$error nl:
251$ anal/obj/gsd 'f /out=x.tmp
252$ open/read xtmp x.tmp
253$ XLOOP:
254$ read/end=end_xloop xtmp xline
255$ xline = f$edit(xline,"compress")
256$ write atmp xline
257$ goto xloop
258$ END_XLOOP:
259$ close xtmp
260$ goto loop
261$ end_loop:
262$ close in
263$ close atmp
264$ if f$search("a.tmp") .eqs. "" -
265	then $ exit
266$ ! all global definitions
267$ search a.tmp "symbol:","EGSY$V_DEF 1","EGSY$V_NORM 1"/out=b.tmp
268$ ! all procedures
269$ search b.tmp "EGSY$V_NORM 1"/wind=(0,1) /out=c.tmp
270$ search c.tmp "symbol:"/out=d.tmp
271$ define/user sys$output nl:
272$ edito/edt/command=sys$input d.tmp
273sub/symbol: "/symbol_vector=(/whole
274sub/"/=PROCEDURE)/whole
275exit
276$ ! all data
277$ search b.tmp "EGSY$V_DEF 1"/wind=(0,1) /out=e.tmp
278$ search e.tmp "symbol:"/out=f.tmp
279$ define/user sys$output nl:
280$ edito/edt/command=sys$input f.tmp
281sub/symbol: "/symbol_vector=(/whole
282sub/"/=DATA)/whole
283exit
284$ sort/nodupl d.tmp,f.tmp 'p2'
285$ delete a.tmp;*,b.tmp;*,c.tmp;*,d.tmp;*,e.tmp;*,f.tmp;*
286$ if f$search("x.tmp") .nes. "" -
287	then $ delete x.tmp;*
288$!
289$ EXIT_AA:
290$ if V then set verify
291$ endsubroutine 
292$!------------------------------------------------------------------------------
293$!
294$! Check command line options and set symbols accordingly
295$!
296$ CHECK_OPTS:
297$ i = 1
298$ OPT_LOOP:
299$ if i .lt. 9
300$ then
301$   cparm = f$edit(p'i',"upcase")
302$   if cparm .eqs. "DEBUG"
303$   then
304$     ccopt = ccopt + "/noopt/deb"
305$     lopts = lopts + "/deb"
306$   endif
307$   if f$locate("CCOPT=",cparm) .lt. f$length(cparm)
308$   then
309$     start = f$locate("=",cparm) + 1
310$     len   = f$length(cparm) - start
311$     ccopt = ccopt + f$extract(start,len,cparm)
312$     if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) -
313        then s_case = true
314$   endif
315$   if cparm .eqs. "LINK" then linkonly = true
316$   if f$locate("LOPTS=",cparm) .lt. f$length(cparm) 
317$   then
318$     start = f$locate("=",cparm) + 1
319$     len   = f$length(cparm) - start
320$     lopts = lopts + f$extract(start,len,cparm)
321$   endif
322$   if f$locate("CC=",cparm) .lt. f$length(cparm) 
323$   then
324$     start  = f$locate("=",cparm) + 1
325$     len    = f$length(cparm) - start
326$     cc_com = f$extract(start,len,cparm)
327      if (cc_com .nes. "DECC") .and. - 
328         (cc_com .nes. "VAXC") .and. - 
329	 (cc_com .nes. "GNUC")
330$     then
331$       write sys$output "Unsupported compiler choice ''cc_com' ignored"
332$       write sys$output "Use DECC, VAXC, or GNUC instead"
333$     else 
334$     	if cc_com .eqs. "DECC" then its_decc = true   
335$     	if cc_com .eqs. "VAXC" then its_vaxc = true   
336$     	if cc_com .eqs. "GNUC" then its_gnuc = true   
337$     endif 
338$   endif
339$   i = i + 1
340$   goto opt_loop
341$ endif
342$ return
343$!------------------------------------------------------------------------------
344$ eod
345$ close out
346$ !
347$ say "Creating [.lib.t1lib]sysconf.h"
348$ cc sys$input:'ccopt'/float='float'/object=test.obj
349#include <stdlib.h>
350#include <stdio.h>
351main()
352{
353  FILE *f=fopen("[.lib.t1lib]sysconf.h", "w");
354  if (!f) exit(EXIT_FAILURE);
355  fprintf(f, "#define SIZEOF_CHAR %d\n", sizeof(char));
356  fprintf(f, "#define SIZEOF_SHORT %d\n", sizeof(short));
357  fprintf(f, "#define SIZEOF_INT %d\n", sizeof(int));
358  fprintf(f, "#define SIZEOF_LONG %d\n", sizeof(long));
359#ifdef __VAX
360  fprintf(f, "#define SIZEOF_LONG_LONG %d\n", sizeof(long));
361#else
362  fprintf(f, "#define SIZEOF_LONG_LONG %d\n", sizeof(long long));
363#endif
364  fprintf(f, "#define SIZEOF_FLOAT %d\n", sizeof(float));
365  fprintf(f, "#define SIZEOF_DOUBLE %d\n", sizeof(double));
366#ifdef __VAX
367  fprintf(f, "#define SIZEOF_LONG_DOUBLE %d\n", sizeof(double));
368#else
369  fprintf(f, "#define SIZEOF_LONG_DOUBLE %d\n", sizeof(long double));
370#endif
371  fprintf(f, "#define SIZEOF_VOID_P %d\n", sizeof(void *));
372  exit(EXIT_SUCCESS);
373}
374$ link test
375$ run test
376$ open/append sysconf [.lib.t1lib]sysconf.h
377$ write sysconf ""
378$ write sysconf "#define T1_AA_TYPE16          short"
379$ write sysconf "#define T1_AA_TYPE32          int"
380$ write sysconf "#define T1_INT16              short"
381$ write sysconf "#define T1_INT32              int"
382$ write sysconf ""
383$ write sysconf "#define T1LIB_IDENT           ", t1lib_identifier 
384$ write sysconf ""
385$ write sysconf "#define GLOBAL_CONFIG_DIR     ""T1_FONT_DIR"""
386$ close sysconf
387$ delete test.obj;*,test.exe;*
388$ !
389$ say "Creating [.lib.t1lib]make.com"
390$ copy sys$input: [.lib.t1lib]make.com
391$ deck
392$ call make parseafm.obj "cc ''cflags' parseafm" - 
393            parseafm.c
394$ call make t1aaset.obj "cc ''cflags' t1aaset" - 
395            t1aaset.c
396$ call make t1afmtool.obj "cc ''cflags' t1afmtool" - 
397            t1afmtool.c
398$ call make t1base.obj "cc ''cflags' t1base" - 
399            t1base.c 
400$ call make t1delete.obj "cc ''cflags' t1delete" - 
401            t1delete.c
402$ call make t1enc.obj "cc ''cflags' t1enc" - 
403            t1enc.c
404$ call make t1env.obj "cc ''cflags' t1env" - 
405            t1env.c
406$ call make t1finfo.obj "cc ''cflags' t1finfo" - 
407            t1finfo.c
408$ call make t1load.obj "cc ''cflags' t1load" - 
409            t1load.c
410$ call make t1outline.obj "cc ''cflags' t1outline" - 
411            t1outline.c
412$ call make t1set.obj "cc ''cflags' t1set" - 
413            t1set.c
414$ call make t1subset.obj "cc ''cflags' t1subset" - 
415            t1subset.c
416$ call make t1trans.obj "cc ''cflags' t1trans" - 
417            t1trans.c
418$ call make t1x11.obj "cc ''cflags' t1x11" - 
419            t1x11.c
420$ exit
421$!
422$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
423$ V = 'F$Verify(0)
424$! P1 = What we are trying to make
425$! P2 = Command to make it
426$! P3 - P8  What it depends on
427$
428$ If F$Search(P1) .Eqs. "" Then Goto Makeit
429$ Time = F$CvTime(F$File(P1,"RDT"))
430$arg=3
431$Loop:
432$       Argument = P'arg
433$       If Argument .Eqs. "" Then Goto Exit
434$       El=0
435$Loop2:
436$       File = F$Element(El," ",Argument)
437$       If File .Eqs. " " Then Goto Endl
438$       AFile = ""
439$Loop3:
440$       OFile = AFile
441$       AFile = F$Search(File)
442$       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
443$       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
444$       Goto Loop3
445$NextEL:
446$       El = El + 1
447$       Goto Loop2
448$EndL:
449$ arg=arg+1
450$ If arg .Le. 8 Then Goto Loop
451$ Goto Exit
452$
453$Makeit:
454$ VV=F$VERIFY(0)
455$ write sys$output P2
456$ 'P2
457$ VV='F$Verify(VV)
458$Exit:
459$ If V Then Set Verify
460$ENDSUBROUTINE
461$eod
462$ !
463$ say "Creating [.lib.type1]make.com"
464$ create [.lib.type1]make.com
465$ deck
466$!
467$! Just some general variables
468$! 
469$ true   = 1
470$ false  = 0
471$ tmpnam = "temp_" + f$getjpi("","pid")
472$ tc     = tmpnam + ".c"
473$!
474$ gosub check_function
475$!
476$ call make arith.obj "cc ''cflags' arith" - 
477            arith.c
478$ call make curves.obj "cc ''cflags' curves" - 
479            curves.c
480$ call make fontfcn.obj "cc ''cflags' fontfcn" - 
481            fontfcn.c
482$ call make hints.obj "cc ''cflags' hints" - 
483            hints.c
484$ call make lines.obj "cc ''cflags' lines" - 
485            lines.c
486$ call make objects.obj "cc ''cflags' objects" - 
487            objects.c
488$ call make paths.obj "cc ''cflags' paths" - 
489            paths.c
490$ call make regions.obj "cc ''cflags' regions" - 
491            regions.c
492$ call make scanfont.obj "cc ''cflags' scanfont" - 
493            scanfont.c
494$ call make spaces.obj "cc ''cflags' spaces" - 
495            spaces.c
496$ call make t1io.obj "cc ''cflags' t1io" - 
497            t1io.c
498$ call make t1snap.obj "cc ''cflags' t1snap" - 
499            t1snap.c
500$ call make t1stub.obj "cc ''cflags' t1stub" - 
501            t1stub.c
502$ call make token.obj "cc ''cflags' token" - 
503            token.c
504$ call make type1.obj "cc ''cflags' type1" - 
505            type1.c
506$ call make util.obj "cc ''cflags' util" - 
507            util.c
508$ exit
509$!
510$!------------------------------------------------------------------------------
511$!
512$! Check if a specific function needs to be implemented
513$!
514$CHECK_FUNCTION:
515$!
516$! bstring --> memset ...
517$!
518$ func = "bstring"
519$ hfile = ""
520$ open/write tmpc 'tc
521$ write tmpc "#include <string.h>"
522$ write tmpc "#include <stdlib.h>"
523$ write tmpc "int main(){"
524$ write tmpc "  memset(NULL,1,1);"
525$ write tmpc "}"
526$ close tmpc
527$ gosub cc_prop_check
528$!
529$ return
530$!
531$!------------------------------------------------------------------------------
532$!
533$! Check for properties of C/C++ compiler
534$!
535$CC_PROP_CHECK:
536$ cc_prop = false
537$ set message/nofac/noident/nosever/notext
538$ on error then continue
539$ cc 'all_cflags' 'tmpnam'
540$ if $status then cc_prop = true
541$ set message/fac/ident/sever/text
542$ delete/nolog 'tmpnam'.*;*
543$ if cc_prop 
544$ then
545$   if (func .nes. "") 
546$   then
547$     write sys$output "Function ''func' implemented in C RTL"
548$   else
549$     write sys$output "h-file ''hfile' part of C RTL"
550$   endif
551$ else 
552$   if (func .nes. "")
553$   then  
554$     CALL MAKE 'func'.OBJ  "CC ''cflags' ''func'.C" 'func'.C
555$   endif
556$   if (hfile .nes. "") then copy 'hfile'.h_in 'hfile'.h
557$ endif
558$ return
559$!
560$!------------------------------------------------------------------------------
561$!
562$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
563$ V = 'F$Verify(0)
564$! P1 = What we are trying to make
565$! P2 = Command to make it
566$! P3 - P8  What it depends on
567$
568$ If F$Search(P1) .Eqs. "" Then Goto Makeit
569$ Time = F$CvTime(F$File(P1,"RDT"))
570$arg=3
571$Loop:
572$       Argument = P'arg
573$       If Argument .Eqs. "" Then Goto Exit
574$       El=0
575$Loop2:
576$       File = F$Element(El," ",Argument)
577$       If File .Eqs. " " Then Goto Endl
578$       AFile = ""
579$Loop3:
580$       OFile = AFile
581$       AFile = F$Search(File)
582$       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
583$       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
584$       Goto Loop3
585$NextEL:
586$       El = El + 1
587$       Goto Loop2
588$EndL:
589$ arg=arg+1
590$ If arg .Le. 8 Then Goto Loop
591$ Goto Exit
592$
593$Makeit:
594$ VV=F$VERIFY(0)
595$ write sys$output P2
596$ 'P2
597$ VV='F$Verify(VV)
598$Exit:
599$ If V Then Set Verify
600$ENDSUBROUTINE
601$eod
602$ !
603$ say "Creating [.xglyph]make.com"
604$ xaw_root = ""
605$ check_xaw = "X11_ROOT,X11"
606$ check_rel = f$parse("[-.x11]") - "].;"
607$ if (check_rel .nes. "") 
608$ then 
609$   define rel_loc "''check_rel'.]"
610$   check_xaw = check_xaw + ",rel_loc"
611$ endif
612$ i = 0
613$SEARCH_XAW:
614$ dir = f$element(i,",",check_xaw)
615$ if (dir.nes.",")
616$ then
617$   if ( f$search("''dir':[xaw]label.h") .nes. "" ) then xaw_root = dir
618$   i = i + 1
619$   goto search_xaw
620$ endif
621$ create [.xglyph]make.com
622$ open/append out [.xglyph]make.com
623$ if (xaw_root .eqs. "")
624$ then
625$   say "I could not locate the xaw and xmu files. In case you want" 
626$   say "to build the Xglyph test application you need to edit"
627$   say "[.xglyph]make.com to add appropriate paths."
628$   write out "$ type/nopage sys$input"
629$   write out "In case you want to build the Xglyph test application you"
630$   write out "need to edit this file to delete the exit command and define"
631$   write out "the dir symbol for the location of the xmu and xaw libraries."
632$   write out "$ exit"
633$   write out "$ xaw_root = ""<disk>:[dir.X11"""
634$ else
635$   write out "$ xaw_root = ""''xaw_root'"""
636$ endif
637$ copy sys$input: out
638$ deck
639$ if (f$getsyi("ARCH_NAME") .eqs. "VAX")
640$ then
641$   olb_dir = "exe"
642$ else
643$   olb_dir = "exe_alpha"
644$ endif
645$ save_x11_dir = f$trnlnm("x11_directory")
646$ save_xmu_dir = f$trnlnm("xmu_directory")
647$ save_xaw_dir = f$trnlnm("xaw_directory")
648$ save_olb_dir = f$trnlnm("olb_directory")
649$ save_dnrsl   = f$trnlnm("decc$no_rooted_search_lists")
650$ if (xaw_root.nes."X11") then define x11 'xaw_root',decw$include:
651$ define x11_directory decw$include:
652$ define xmu_directory 'xaw_root':[xmu]
653$ define xaw_directory 'xaw_root':[xaw]
654$ define olb_directory 'xaw_root':['olb_dir']
655$ define DECC$NO_ROOTED_SEARCH_LISTS 1
656$ open/write  optf xglyph.opt
657$ write optf "xglyph.obj"
658$ write optf "[-]t1.olb/library"
659$ write optf "sys$share:decc$shr.exe/share"
660$ write optf "sys$share:decw$xextlibshr/share"
661$ write optf "sys$share:decw$xlibshr/share"
662$ write optf "sys$share:decw$xtlibshrr5/share"
663$ if (f$trnlnm("xaw3dlibshr").nes."")
664$ then
665$   write optf "xaw3dlibshr/share"
666$ else
667$   write optf "olb_directory:xaw3dlib/library"
668$ endif
669$ if (f$trnlnm("xmulibshr").nes."")
670$ then
671$   write optf "xmulibshr/share"
672$ else
673$   write optf "olb_directory:xmulib/library"
674$ endif
675$ close optf
676$ call make xglyph.obj "cc ''cflags' xglyph.c" -
677            xglyph.c
678$ call make xglyph.obj "link xglyph.opt/option" -
679            xglyph.obj [-]t1.olb
680$ if (save_x11_dir .nes. "")
681$ then
682$   define x11_directory 'save_x11_dir'
683$ else
684$   deassign x11_directory
685$ endif
686$ if (save_xmu_dir .nes. "")
687$ then
688$   define xmu_directory 'save_xmu_dir'
689$ else
690$   deassign xmu_directory
691$ endif
692$ if (save_xaw_dir .nes. "")
693$ then
694$   define xaw_directory 'save_xaw_dir'
695$ else
696$   deassign xaw_directory
697$ endif
698$ if (save_olb_dir .nes. "")
699$ then
700$   define olb_directory 'save_olb_dir'
701$ else
702$   deassign olb_directory
703$ endif
704$ if (save_dnrsl .nes. "")
705$ then
706$   define DECC$NO_ROOTED_SEARCH_LISTS 'save_dnrsl'
707$ else
708$   deassign DECC$NO_ROOTED_SEARCH_LISTS
709$ endif
710$ exit
711$!
712$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
713$ V = 'F$Verify(0)
714$! P1 = What we are trying to make
715$! P2 = Command to make it
716$! P3 - P8  What it depends on
717$
718$ If F$Search(P1) .Eqs. "" Then Goto Makeit
719$ Time = F$CvTime(F$File(P1,"RDT"))
720$arg=3
721$Loop:
722$       Argument = P'arg
723$       If Argument .Eqs. "" Then Goto Exit
724$       El=0
725$Loop2:
726$       File = F$Element(El," ",Argument)
727$       If File .Eqs. " " Then Goto Endl
728$       AFile = ""
729$Loop3:
730$       OFile = AFile
731$       AFile = F$Search(File)
732$       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
733$       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
734$       Goto Loop3
735$NextEL:
736$       El = El + 1
737$       Goto Loop2
738$EndL:
739$ arg=arg+1
740$ If arg .Le. 8 Then Goto Loop
741$ Goto Exit
742$
743$Makeit:
744$ VV=F$VERIFY(0)
745$ write sys$output P2
746$ 'P2
747$ VV='F$Verify(VV)
748$Exit:
749$ If V Then Set Verify
750$ENDSUBROUTINE
751$eod
752$ close out
753$ say "Creating [.type1afm]make.com"
754$ create [.type1afm]make.com
755$ open/append out [.type1afm]make.com
756$ copy sys$input: out
757$ deck
758$ call make type1afm.obj "cc ''cflags' type1afm.c" -
759            type1afm.c
760$ call make type1afm.exe "link type1afm,[-]t1/library" -
761            type1afm.obj [-]t1.olb
762$ exit
763$!
764$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
765$ V = 'F$Verify(0)
766$! P1 = What we are trying to make
767$! P2 = Command to make it
768$! P3 - P8  What it depends on
769$
770$ If F$Search(P1) .Eqs. "" Then Goto Makeit
771$ Time = F$CvTime(F$File(P1,"RDT"))
772$arg=3
773$Loop:
774$       Argument = P'arg
775$       If Argument .Eqs. "" Then Goto Exit
776$       El=0
777$Loop2:
778$       File = F$Element(El," ",Argument)
779$       If File .Eqs. " " Then Goto Endl
780$       AFile = ""
781$Loop3:
782$       OFile = AFile
783$       AFile = F$Search(File)
784$       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
785$       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
786$       Goto Loop3
787$NextEL:
788$       El = El + 1
789$       Goto Loop2
790$EndL:
791$ arg=arg+1
792$ If arg .Le. 8 Then Goto Loop
793$ Goto Exit
794$
795$Makeit:
796$ VV=F$VERIFY(0)
797$ write sys$output P2
798$ 'P2
799$ VV='F$Verify(VV)
800$Exit:
801$ If V Then Set Verify
802$ENDSUBROUTINE
803$eod
804$ close out
805$ say "Creating [.examples]make.com"
806$ create [.examples]make.com
807$ open/append out [.examples]make.com
808$ copy sys$input: out
809$ deck
810$ call make subset.obj "cc ''cflags' subset.c" -
811            subset.c
812$ call make subset.exe "link subset,[-]t1/library" -
813            subset.obj [-]t1.olb
814$ call make t1example1.obj "cc ''cflags' /include=[-.lib.t1lib] t1example1.c" -
815            t1example1.c
816$ call make t1example1.exe "link t1example1,[-]t1/library" -
817            t1example1.obj [-]t1.olb
818$ exit
819$!
820$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
821$ V = 'F$Verify(0)
822$! P1 = What we are trying to make
823$! P2 = Command to make it
824$! P3 - P8  What it depends on
825$
826$ If F$Search(P1) .Eqs. "" Then Goto Makeit
827$ Time = F$CvTime(F$File(P1,"RDT"))
828$arg=3
829$Loop:
830$       Argument = P'arg
831$       If Argument .Eqs. "" Then Goto Exit
832$       El=0
833$Loop2:
834$       File = F$Element(El," ",Argument)
835$       If File .Eqs. " " Then Goto Endl
836$       AFile = ""
837$Loop3:
838$       OFile = AFile
839$       AFile = F$Search(File)
840$       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
841$       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
842$       Goto Loop3
843$NextEL:
844$       El = El + 1
845$       Goto Loop2
846$EndL:
847$ arg=arg+1
848$ If arg .Le. 8 Then Goto Loop
849$ Goto Exit
850$
851$Makeit:
852$ VV=F$VERIFY(0)
853$ write sys$output P2
854$ 'P2
855$ VV='F$Verify(VV)
856$Exit:
857$ If V Then Set Verify
858$ENDSUBROUTINE
859$eod
860$ close out
861$ say "Creating [.examples]t1libvms.config"
862$ create [.examples]t1libconf.fdl
863$ open/append out [.examples]t1libconf.fdl
864$ copy sys$input: out
865$ deck
866IDENT "T1lib config file"
867
868FILE
869        ORGANIZATION            sequential
870
871RECORD
872        BLOCK_SPAN              yes
873        CARRIAGE_CONTROL        carriage_return
874        FORMAT                  stream_lf
875
876$eod
877$ close out
878$ create/fdl=[.examples]t1libconf.fdl [.examples]t1libvms.config
879$ open/append out [.examples]t1libvms.config
880$ copy sys$input: out
881$ deck
882This is a configuration file for t1lib
883
884FONTDATABASE=FontDataBase
885ENCODING=[-.fonts.enc];sys$disk:[]
886AFM=[-.fonts.afm];sys$disk:[]
887TYPE1=[-.fonts.type1];sys$disk:[]
888$eod
889$ close out
890$ exit
891