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 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890
|
$ 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
Nov-1999
- Extended the functionality to check for xaw/xmu also in the X11 path (which
is the most Unix compatible way to store them ;-).
- Added tests for shareable version of the Xaw/Xmu libraries, using the
shareable images if the appropriate logicals are defined. If not the object
libraries are used as before.
- Added support for type1afm build
- Adapted to t1lib 0.9.2
Dec-1999
- Added support for absolute pathnames for font files under OpenVMS
Aug-2000
- First cut of an incremental build
Jul-2002
- Create a shareable image on OpenVMS Alpha
Feb-2003
- Add missing initialization for xaw_root
- Clarify description of Xglyph as >>test<< application
- Improved method to build options file for shareable image
(Thanks to Hartmut Becker Hartmut.Becker@compaq.com)
Feb-2004
- Add DECC$NO_ROOTED_SEARCH_LISTS definition to get Xglyph compile ok
on later versions of Compaq C
Nov-2004
- Save and restore user environment instead of just overwriting
- Build example applications
- Add options processing
- Polish shareable image creation
- Start work on version perserving case
Dec-2004
- Moving defines into sysconf.h, avoiding quote madness
Martin Zinser
zinser@zinser.no-ip.info
$start:
$ ! If a user has a symbol cc or something else, don't use it.
$ set symbol/scope=(nolocal,noglobal)
$ 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
$ copy sys$input: out
$ deck
$ true = 1
$ false = 0
$ tmpnam = "temp_" + f$getjpi("","pid")
$ tt = tmpnam + ".txt"
$ tc = tmpnam + ".c"
$ th = tmpnam + ".h"
$ its_decc = false
$ its_vaxc = false
$ its_gnuc = false
$ s_case = False
$!
$! Setup variables holding "config" information
$!
$ ccopt = ""
$ lopts = ""
$!
$! Which command parameters were given
$!
$ gosub check_opts
$!
$eod
$ if (f$getsyi("ARCH_NAME") .eqs. "VAX")
$ then
$ float = "g_float"
$ else
$ float = "ieee_float"
$ endif
$ write out "$ cflags = ""/prefix=all/float=''float'"" + ccopt"
$ copy sys$input: out
$ deck
$!
$! Marker for futher work with name=as_is compilation to work around
$! fact that DECW shareable does not contain mixed case entry points
$! TBD: Compile t1x11 and xglyph along the lines of [--]motif_name.h+'source'
$! Make sure to get the include path to the "jackets" right
$!
$ if s_case
$ then
$ create motif_name.h
$ open/append outh motif_name.h
$ copy sys$input: outh
$ deck/dollar="$ eoh"
#ifdef __cplusplus
#define VMS_BEGIN_C_PLUS_PLUS extern "C" {
#define VMS_END_C_PLUS_PLUS }
#else
#define VMS_BEGIN_C_PLUS_PLUS
#define VMS_END_C_PLUS_PLUS
#endif
#include "motif_redefines.h"
$ eoh
$ close outh
$ endif
$ set default [.lib.t1lib]
$ @make.com
$ write sys$output "Compiling in [.lib.type1]"
$ set default [-.type1]
$ @make.com
$ set default [--]
$ write sys$output "Creating t1.olb"
$ library/create t1.olb [.lib.t1lib]*.obj,[.lib.type1]*.obj
$ write sys$output "Creating xglyph.exe"
$ set default [.xglyph]
$ @make.com
$ set default [-]
$ write sys$output "Creating type1afm.exe"
$ set default [.type1afm]
$ @make.com
$ set default [-]
$ write sys$output "Creating example applications"
$ set default [.examples]
$ @make.com
$ set default [-]
$!
$! Establish the Compiling Environment
$!
$ Cpu_Model = F$GetSYI("HW_MODEL")
$ open/write optf t1.opt
$T1_L:
$ file = f$search("[.lib.t1lib]*.obj")
$ if file .eqs. "" then goto TY_L
$ write optf file
$ goto t1_l
$TY_L:
$ file = f$search("[.lib.type1]*.obj")
$ if file .eqs. "" then goto end_opt
$ write optf file
$ goto ty_l
$END_OPT:
$ close/nolog optf
$!
$! Alpha gets a shareable image
$!
$ If Cpu_Model .gt. 1024
$ Then
$ write sys$output "Creating t1shr.exe"
$ call anal_obj_axp t1.opt _link.opt
$ open/append optf t1.opt
$ if s_case then write optf "case_sensitive=YES"
$ write optf "sys$share:decw$xlibshr.exe/share"
$ close optf
$ LINK_/NODEB/SHARE=t1shr.exe t1.opt/opt,_link.opt/opt
$ endif
$!
$ dele/noconf *.opt;*
$ write sys$output "Done"
$ exit
$!
$!------------------------------------------------------------------------------
$!
$! Analyze Object files for OpenVMS AXP to extract Procedure and Data
$! information to build a symbol vector for a shareable image
$! All the "brains" of this logic was suggested by Hartmut Becker
$! (Hartmut.Becker@compaq.com). All the bugs were introduced by me
$! (zinser@zinser.no-ip.info), so if you do have problem reports please do not
$! bother Hartmut/HP, but get in touch with me
$!
$! Version history
$! 0.01 20040406 Skip over shareable images in option file
$! 0.02 20041109 Fix option file for shareable images with case_sensitive=YES
$!
$ ANAL_OBJ_AXP: Subroutine
$ V = 'F$Verify(0)
$ SAY := "WRITE_ SYS$OUTPUT"
$
$ IF F$SEARCH("''P1'") .EQS. ""
$ THEN
$ SAY "ANAL_OBJ_AXP-E-NOSUCHFILE: Error, inputfile ''p1' not available"
$ goto exit_aa
$ ENDIF
$ IF "''P2'" .EQS. ""
$ THEN
$ SAY "ANAL_OBJ_AXP: Error, no output file provided"
$ goto exit_aa
$ ENDIF
$
$ open/read in 'p1
$ create a.tmp
$ open/append atmp a.tmp
$ loop:
$ read/end=end_loop in line
$ if f$locate("/SHARE",f$edit(line,"upcase")) .lt. f$length(line)
$ then
$ write sys$output "ANAL_SKP_SHR-i-skipshare, ''line'"
$ goto loop
$ endif
$ f= f$search(line)
$ if f .eqs. ""
$ then
$ write sys$output "ANAL_OBJ_AXP-w-nosuchfile, ''line'"
$ goto loop
$ endif
$ define/user sys$output nl:
$ define/user sys$error nl:
$ anal/obj/gsd 'f /out=x.tmp
$ open/read xtmp x.tmp
$ XLOOP:
$ read/end=end_xloop xtmp xline
$ xline = f$edit(xline,"compress")
$ write atmp xline
$ goto xloop
$ END_XLOOP:
$ close xtmp
$ goto loop
$ end_loop:
$ close in
$ close atmp
$ if f$search("a.tmp") .eqs. "" -
then $ exit
$ ! all global definitions
$ search a.tmp "symbol:","EGSY$V_DEF 1","EGSY$V_NORM 1"/out=b.tmp
$ ! all procedures
$ search b.tmp "EGSY$V_NORM 1"/wind=(0,1) /out=c.tmp
$ search c.tmp "symbol:"/out=d.tmp
$ define/user sys$output nl:
$ edito/edt/command=sys$input d.tmp
sub/symbol: "/symbol_vector=(/whole
sub/"/=PROCEDURE)/whole
exit
$ ! all data
$ search b.tmp "EGSY$V_DEF 1"/wind=(0,1) /out=e.tmp
$ search e.tmp "symbol:"/out=f.tmp
$ define/user sys$output nl:
$ edito/edt/command=sys$input f.tmp
sub/symbol: "/symbol_vector=(/whole
sub/"/=DATA)/whole
exit
$ sort/nodupl d.tmp,f.tmp 'p2'
$ delete a.tmp;*,b.tmp;*,c.tmp;*,d.tmp;*,e.tmp;*,f.tmp;*
$ if f$search("x.tmp") .nes. "" -
then $ delete x.tmp;*
$!
$ EXIT_AA:
$ if V then set verify
$ endsubroutine
$!------------------------------------------------------------------------------
$!
$! Check command line options and set symbols accordingly
$!
$ CHECK_OPTS:
$ i = 1
$ OPT_LOOP:
$ if i .lt. 9
$ then
$ cparm = f$edit(p'i',"upcase")
$ if cparm .eqs. "DEBUG"
$ then
$ ccopt = ccopt + "/noopt/deb"
$ lopts = lopts + "/deb"
$ endif
$ if f$locate("CCOPT=",cparm) .lt. f$length(cparm)
$ then
$ start = f$locate("=",cparm) + 1
$ len = f$length(cparm) - start
$ ccopt = ccopt + f$extract(start,len,cparm)
$ if f$locate("AS_IS",f$edit(ccopt,"UPCASE")) .lt. f$length(ccopt) -
then s_case = true
$ endif
$ if cparm .eqs. "LINK" then linkonly = true
$ if f$locate("LOPTS=",cparm) .lt. f$length(cparm)
$ then
$ start = f$locate("=",cparm) + 1
$ len = f$length(cparm) - start
$ lopts = lopts + f$extract(start,len,cparm)
$ endif
$ if f$locate("CC=",cparm) .lt. f$length(cparm)
$ then
$ start = f$locate("=",cparm) + 1
$ len = f$length(cparm) - start
$ cc_com = f$extract(start,len,cparm)
if (cc_com .nes. "DECC") .and. -
(cc_com .nes. "VAXC") .and. -
(cc_com .nes. "GNUC")
$ then
$ write sys$output "Unsupported compiler choice ''cc_com' ignored"
$ write sys$output "Use DECC, VAXC, or GNUC instead"
$ else
$ if cc_com .eqs. "DECC" then its_decc = true
$ if cc_com .eqs. "VAXC" then its_vaxc = true
$ if cc_com .eqs. "GNUC" then its_gnuc = true
$ endif
$ endif
$ i = i + 1
$ goto opt_loop
$ endif
$ return
$!------------------------------------------------------------------------------
$ eod
$ close out
$ !
$ say "Creating [.lib.t1lib]sysconf.h"
$ cc sys$input:'ccopt'/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
$ open/append sysconf [.lib.t1lib]sysconf.h
$ write sysconf ""
$ write sysconf "#define T1_AA_TYPE16 short"
$ write sysconf "#define T1_AA_TYPE32 int"
$ write sysconf "#define T1_INT16 short"
$ write sysconf "#define T1_INT32 int"
$ write sysconf ""
$ write sysconf "#define T1LIB_IDENT ", t1lib_identifier
$ write sysconf ""
$ write sysconf "#define GLOBAL_CONFIG_DIR ""T1_FONT_DIR"""
$ close sysconf
$ delete test.obj;*,test.exe;*
$ !
$ say "Creating [.lib.t1lib]make.com"
$ copy sys$input: [.lib.t1lib]make.com
$ deck
$ call make parseafm.obj "cc ''cflags' parseafm" -
parseafm.c
$ call make t1aaset.obj "cc ''cflags' t1aaset" -
t1aaset.c
$ call make t1afmtool.obj "cc ''cflags' t1afmtool" -
t1afmtool.c
$ call make t1base.obj "cc ''cflags' t1base" -
t1base.c
$ call make t1delete.obj "cc ''cflags' t1delete" -
t1delete.c
$ call make t1enc.obj "cc ''cflags' t1enc" -
t1enc.c
$ call make t1env.obj "cc ''cflags' t1env" -
t1env.c
$ call make t1finfo.obj "cc ''cflags' t1finfo" -
t1finfo.c
$ call make t1load.obj "cc ''cflags' t1load" -
t1load.c
$ call make t1outline.obj "cc ''cflags' t1outline" -
t1outline.c
$ call make t1set.obj "cc ''cflags' t1set" -
t1set.c
$ call make t1subset.obj "cc ''cflags' t1subset" -
t1subset.c
$ call make t1trans.obj "cc ''cflags' t1trans" -
t1trans.c
$ call make t1x11.obj "cc ''cflags' t1x11" -
t1x11.c
$ exit
$!
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
$ V = 'F$Verify(0)
$! P1 = What we are trying to make
$! P2 = Command to make it
$! P3 - P8 What it depends on
$
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
$ Time = F$CvTime(F$File(P1,"RDT"))
$arg=3
$Loop:
$ Argument = P'arg
$ If Argument .Eqs. "" Then Goto Exit
$ El=0
$Loop2:
$ File = F$Element(El," ",Argument)
$ If File .Eqs. " " Then Goto Endl
$ AFile = ""
$Loop3:
$ OFile = AFile
$ AFile = F$Search(File)
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
$ Goto Loop3
$NextEL:
$ El = El + 1
$ Goto Loop2
$EndL:
$ arg=arg+1
$ If arg .Le. 8 Then Goto Loop
$ Goto Exit
$
$Makeit:
$ VV=F$VERIFY(0)
$ write sys$output P2
$ 'P2
$ VV='F$Verify(VV)
$Exit:
$ If V Then Set Verify
$ENDSUBROUTINE
$eod
$ !
$ say "Creating [.lib.type1]make.com"
$ create [.lib.type1]make.com
$ deck
$!
$! Just some general variables
$!
$ true = 1
$ false = 0
$ tmpnam = "temp_" + f$getjpi("","pid")
$ tc = tmpnam + ".c"
$!
$ gosub check_function
$!
$ call make arith.obj "cc ''cflags' arith" -
arith.c
$ call make curves.obj "cc ''cflags' curves" -
curves.c
$ call make fontfcn.obj "cc ''cflags' fontfcn" -
fontfcn.c
$ call make hints.obj "cc ''cflags' hints" -
hints.c
$ call make lines.obj "cc ''cflags' lines" -
lines.c
$ call make objects.obj "cc ''cflags' objects" -
objects.c
$ call make paths.obj "cc ''cflags' paths" -
paths.c
$ call make regions.obj "cc ''cflags' regions" -
regions.c
$ call make scanfont.obj "cc ''cflags' scanfont" -
scanfont.c
$ call make spaces.obj "cc ''cflags' spaces" -
spaces.c
$ call make t1io.obj "cc ''cflags' t1io" -
t1io.c
$ call make t1snap.obj "cc ''cflags' t1snap" -
t1snap.c
$ call make t1stub.obj "cc ''cflags' t1stub" -
t1stub.c
$ call make token.obj "cc ''cflags' token" -
token.c
$ call make type1.obj "cc ''cflags' type1" -
type1.c
$ call make util.obj "cc ''cflags' util" -
util.c
$ exit
$!
$!------------------------------------------------------------------------------
$!
$! Check if a specific function needs to be implemented
$!
$CHECK_FUNCTION:
$!
$! bstring --> memset ...
$!
$ func = "bstring"
$ hfile = ""
$ open/write tmpc 'tc
$ write tmpc "#include <string.h>"
$ write tmpc "#include <stdlib.h>"
$ write tmpc "int main(){"
$ write tmpc " memset(NULL,1,1);"
$ write tmpc "}"
$ close tmpc
$ gosub cc_prop_check
$!
$ return
$!
$!------------------------------------------------------------------------------
$!
$! Check for properties of C/C++ compiler
$!
$CC_PROP_CHECK:
$ cc_prop = false
$ set message/nofac/noident/nosever/notext
$ on error then continue
$ cc 'all_cflags' 'tmpnam'
$ if $status then cc_prop = true
$ set message/fac/ident/sever/text
$ delete/nolog 'tmpnam'.*;*
$ if cc_prop
$ then
$ if (func .nes. "")
$ then
$ write sys$output "Function ''func' implemented in C RTL"
$ else
$ write sys$output "h-file ''hfile' part of C RTL"
$ endif
$ else
$ if (func .nes. "")
$ then
$ CALL MAKE 'func'.OBJ "CC ''cflags' ''func'.C" 'func'.C
$ endif
$ if (hfile .nes. "") then copy 'hfile'.h_in 'hfile'.h
$ endif
$ return
$!
$!------------------------------------------------------------------------------
$!
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
$ V = 'F$Verify(0)
$! P1 = What we are trying to make
$! P2 = Command to make it
$! P3 - P8 What it depends on
$
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
$ Time = F$CvTime(F$File(P1,"RDT"))
$arg=3
$Loop:
$ Argument = P'arg
$ If Argument .Eqs. "" Then Goto Exit
$ El=0
$Loop2:
$ File = F$Element(El," ",Argument)
$ If File .Eqs. " " Then Goto Endl
$ AFile = ""
$Loop3:
$ OFile = AFile
$ AFile = F$Search(File)
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
$ Goto Loop3
$NextEL:
$ El = El + 1
$ Goto Loop2
$EndL:
$ arg=arg+1
$ If arg .Le. 8 Then Goto Loop
$ Goto Exit
$
$Makeit:
$ VV=F$VERIFY(0)
$ write sys$output P2
$ 'P2
$ VV='F$Verify(VV)
$Exit:
$ If V Then Set Verify
$ENDSUBROUTINE
$eod
$ !
$ say "Creating [.xglyph]make.com"
$ xaw_root = ""
$ check_xaw = "X11_ROOT,X11"
$ check_rel = f$parse("[-.x11]") - "].;"
$ if (check_rel .nes. "")
$ then
$ define rel_loc "''check_rel'.]"
$ check_xaw = check_xaw + ",rel_loc"
$ endif
$ i = 0
$SEARCH_XAW:
$ dir = f$element(i,",",check_xaw)
$ if (dir.nes.",")
$ then
$ if ( f$search("''dir':[xaw]label.h") .nes. "" ) then xaw_root = dir
$ i = i + 1
$ goto search_xaw
$ endif
$ create [.xglyph]make.com
$ open/append out [.xglyph]make.com
$ if (xaw_root .eqs. "")
$ then
$ say "I could not locate the xaw and xmu files. In case you want"
$ say "to build the Xglyph test application you need to edit"
$ say "[.xglyph]make.com to add appropriate paths."
$ write out "$ type/nopage sys$input"
$ write out "In case you want to build the Xglyph test application you"
$ write out "need to 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 "$ xaw_root = ""<disk>:[dir.X11"""
$ else
$ write out "$ xaw_root = ""''xaw_root'"""
$ endif
$ copy sys$input: out
$ deck
$ if (f$getsyi("ARCH_NAME") .eqs. "VAX")
$ then
$ olb_dir = "exe"
$ else
$ olb_dir = "exe_alpha"
$ endif
$ save_x11_dir = f$trnlnm("x11_directory")
$ save_xmu_dir = f$trnlnm("xmu_directory")
$ save_xaw_dir = f$trnlnm("xaw_directory")
$ save_olb_dir = f$trnlnm("olb_directory")
$ save_dnrsl = f$trnlnm("decc$no_rooted_search_lists")
$ if (xaw_root.nes."X11") then define x11 'xaw_root',decw$include:
$ define x11_directory decw$include:
$ define xmu_directory 'xaw_root':[xmu]
$ define xaw_directory 'xaw_root':[xaw]
$ define olb_directory 'xaw_root':['olb_dir']
$ define DECC$NO_ROOTED_SEARCH_LISTS 1
$ open/write optf xglyph.opt
$ write optf "xglyph.obj"
$ write optf "[-]t1.olb/library"
$ write optf "sys$share:decc$shr.exe/share"
$ write optf "sys$share:decw$xextlibshr/share"
$ write optf "sys$share:decw$xlibshr/share"
$ write optf "sys$share:decw$xtlibshrr5/share"
$ if (f$trnlnm("xaw3dlibshr").nes."")
$ then
$ write optf "xaw3dlibshr/share"
$ else
$ write optf "olb_directory:xaw3dlib/library"
$ endif
$ if (f$trnlnm("xmulibshr").nes."")
$ then
$ write optf "xmulibshr/share"
$ else
$ write optf "olb_directory:xmulib/library"
$ endif
$ close optf
$ call make xglyph.obj "cc ''cflags' xglyph.c" -
xglyph.c
$ call make xglyph.obj "link xglyph.opt/option" -
xglyph.obj [-]t1.olb
$ if (save_x11_dir .nes. "")
$ then
$ define x11_directory 'save_x11_dir'
$ else
$ deassign x11_directory
$ endif
$ if (save_xmu_dir .nes. "")
$ then
$ define xmu_directory 'save_xmu_dir'
$ else
$ deassign xmu_directory
$ endif
$ if (save_xaw_dir .nes. "")
$ then
$ define xaw_directory 'save_xaw_dir'
$ else
$ deassign xaw_directory
$ endif
$ if (save_olb_dir .nes. "")
$ then
$ define olb_directory 'save_olb_dir'
$ else
$ deassign olb_directory
$ endif
$ if (save_dnrsl .nes. "")
$ then
$ define DECC$NO_ROOTED_SEARCH_LISTS 'save_dnrsl'
$ else
$ deassign DECC$NO_ROOTED_SEARCH_LISTS
$ endif
$ exit
$!
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
$ V = 'F$Verify(0)
$! P1 = What we are trying to make
$! P2 = Command to make it
$! P3 - P8 What it depends on
$
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
$ Time = F$CvTime(F$File(P1,"RDT"))
$arg=3
$Loop:
$ Argument = P'arg
$ If Argument .Eqs. "" Then Goto Exit
$ El=0
$Loop2:
$ File = F$Element(El," ",Argument)
$ If File .Eqs. " " Then Goto Endl
$ AFile = ""
$Loop3:
$ OFile = AFile
$ AFile = F$Search(File)
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
$ Goto Loop3
$NextEL:
$ El = El + 1
$ Goto Loop2
$EndL:
$ arg=arg+1
$ If arg .Le. 8 Then Goto Loop
$ Goto Exit
$
$Makeit:
$ VV=F$VERIFY(0)
$ write sys$output P2
$ 'P2
$ VV='F$Verify(VV)
$Exit:
$ If V Then Set Verify
$ENDSUBROUTINE
$eod
$ close out
$ say "Creating [.type1afm]make.com"
$ create [.type1afm]make.com
$ open/append out [.type1afm]make.com
$ copy sys$input: out
$ deck
$ call make type1afm.obj "cc ''cflags' type1afm.c" -
type1afm.c
$ call make type1afm.exe "link type1afm,[-]t1/library" -
type1afm.obj [-]t1.olb
$ exit
$!
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
$ V = 'F$Verify(0)
$! P1 = What we are trying to make
$! P2 = Command to make it
$! P3 - P8 What it depends on
$
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
$ Time = F$CvTime(F$File(P1,"RDT"))
$arg=3
$Loop:
$ Argument = P'arg
$ If Argument .Eqs. "" Then Goto Exit
$ El=0
$Loop2:
$ File = F$Element(El," ",Argument)
$ If File .Eqs. " " Then Goto Endl
$ AFile = ""
$Loop3:
$ OFile = AFile
$ AFile = F$Search(File)
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
$ Goto Loop3
$NextEL:
$ El = El + 1
$ Goto Loop2
$EndL:
$ arg=arg+1
$ If arg .Le. 8 Then Goto Loop
$ Goto Exit
$
$Makeit:
$ VV=F$VERIFY(0)
$ write sys$output P2
$ 'P2
$ VV='F$Verify(VV)
$Exit:
$ If V Then Set Verify
$ENDSUBROUTINE
$eod
$ close out
$ say "Creating [.examples]make.com"
$ create [.examples]make.com
$ open/append out [.examples]make.com
$ copy sys$input: out
$ deck
$ call make subset.obj "cc ''cflags' subset.c" -
subset.c
$ call make subset.exe "link subset,[-]t1/library" -
subset.obj [-]t1.olb
$ call make t1example1.obj "cc ''cflags' /include=[-.lib.t1lib] t1example1.c" -
t1example1.c
$ call make t1example1.exe "link t1example1,[-]t1/library" -
t1example1.obj [-]t1.olb
$ exit
$!
$MAKE: SUBROUTINE !SUBROUTINE TO CHECK DEPENDENCIES
$ V = 'F$Verify(0)
$! P1 = What we are trying to make
$! P2 = Command to make it
$! P3 - P8 What it depends on
$
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
$ Time = F$CvTime(F$File(P1,"RDT"))
$arg=3
$Loop:
$ Argument = P'arg
$ If Argument .Eqs. "" Then Goto Exit
$ El=0
$Loop2:
$ File = F$Element(El," ",Argument)
$ If File .Eqs. " " Then Goto Endl
$ AFile = ""
$Loop3:
$ OFile = AFile
$ AFile = F$Search(File)
$ If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
$ If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
$ Goto Loop3
$NextEL:
$ El = El + 1
$ Goto Loop2
$EndL:
$ arg=arg+1
$ If arg .Le. 8 Then Goto Loop
$ Goto Exit
$
$Makeit:
$ VV=F$VERIFY(0)
$ write sys$output P2
$ 'P2
$ VV='F$Verify(VV)
$Exit:
$ If V Then Set Verify
$ENDSUBROUTINE
$eod
$ close out
$ say "Creating [.examples]t1libvms.config"
$ create [.examples]t1libconf.fdl
$ open/append out [.examples]t1libconf.fdl
$ copy sys$input: out
$ deck
IDENT "T1lib config file"
FILE
ORGANIZATION sequential
RECORD
BLOCK_SPAN yes
CARRIAGE_CONTROL carriage_return
FORMAT stream_lf
$eod
$ close out
$ create/fdl=[.examples]t1libconf.fdl [.examples]t1libvms.config
$ open/append out [.examples]t1libvms.config
$ copy sys$input: out
$ deck
This is a configuration file for t1lib
FONTDATABASE=FontDataBase
ENCODING=[-.fonts.enc];sys$disk:[]
AFM=[-.fonts.afm];sys$disk:[]
TYPE1=[-.fonts.type1];sys$disk:[]
$eod
$ close out
$ exit
|