• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1$! make libpng under VMS
2$!
3$!
4$! Check for MMK/MMS
5$!
6$! This procedure accepts one parameter (contrib), which causes it to build
7$! the programs from the contrib directory instead of libpng.
8$!
9$ p1 = f$edit(p1,"UPCASE")
10$ if p1 .eqs. "CONTRIB"
11$ then
12$   set def [.contrib.gregbook]
13$   @makevms
14$   set def [-.pngminus]
15$   @makevms
16$   set def [--]
17$   exit
18$ endif
19$ Make = ""
20$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS"
21$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK"
22$!
23$! Look for the compiler used
24$!
25$ zlibsrc = "[-.zlib]"
26$ ccopt="/include=''zlibsrc'"
27$ if f$getsyi("HW_MODEL").ge.1024
28$ then
29$  ccopt = "/prefix=all"+ccopt
30$  comp  = "__decc__=1"
31$  if f$trnlnm("SYS").eqs."" then define sys sys$library:
32$ else
33$  if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
34$   then
35$    if f$trnlnm("SYS").eqs."" then define sys sys$library:
36$    if f$search("SYS$SYSTEM:VAXC.EXE").eqs.""
37$     then
38$      comp  = "__gcc__=1"
39$      CC :== GCC
40$     else
41$      comp = "__vaxc__=1"
42$     endif
43$   else
44$    if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
45$    ccopt = "/decc/prefix=all"+ccopt
46$    comp  = "__decc__=1"
47$  endif
48$ endif
49$!
50$! Build the thing plain or with mms/mmk
51$!
52$ write sys$output "Compiling Libpng sources ..."
53$ if make.eqs.""
54$  then
55$   dele pngtest.obj;*
56$   CALL MAKE png.OBJ "cc ''CCOPT' png" -
57	png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
58$   CALL MAKE pngset.OBJ "cc ''CCOPT' pngset" -
59	pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
60$   CALL MAKE pngget.OBJ "cc ''CCOPT' pngget" -
61	pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
62$   CALL MAKE pngread.OBJ "cc ''CCOPT' pngread" -
63	pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
64$   CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" -
65	pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
66$   CALL MAKE pngrtran.OBJ "cc ''CCOPT' pngrtran" -
67	pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
68$   CALL MAKE pngrutil.OBJ "cc ''CCOPT' pngrutil" -
69	pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
70$   CALL MAKE pngerror.OBJ "cc ''CCOPT' pngerror" -
71	pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
72$   CALL MAKE pngmem.OBJ "cc ''CCOPT' pngmem" -
73	pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
74$   CALL MAKE pngrio.OBJ "cc ''CCOPT' pngrio" -
75	pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
76$   CALL MAKE pngwio.OBJ "cc ''CCOPT' pngwio" -
77	pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
78$   CALL MAKE pngtrans.OBJ "cc ''CCOPT' pngtrans" -
79	pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
80$   CALL MAKE pngwrite.OBJ "cc ''CCOPT' pngwrite" -
81	pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
82$   CALL MAKE pngwtran.OBJ "cc ''CCOPT' pngwtran" -
83	pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
84$   CALL MAKE pngwutil.OBJ "cc ''CCOPT' pngwutil" -
85	pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
86$   write sys$output "Building Libpng ..."
87$   CALL MAKE libpng.OLB "lib/crea libpng.olb *.obj" *.OBJ
88$   write sys$output "Building pngtest..."
89$   CALL MAKE pngtest.OBJ "cc ''CCOPT' pngtest" -
90	pngtest.c png.h pngconf.h pnglibconf.h
91$   call make pngtest.exe -
92	"LINK pngtest,libpng.olb/lib,''zlibsrc'libz.olb/lib" -
93	pngtest.obj libpng.olb
94$   write sys$output "Testing Libpng..."
95$   run pngtest
96$  else
97$   if f$search("DESCRIP.MMS") .eqs. "" then copy/nolog [.SCRIPTS]DESCRIP.MMS []
98$   'make'/macro=('comp',zlibsrc='zlibsrc')
99$  endif
100$ write sys$output "Libpng build completed"
101$ exit
102$!
103$!
104$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
105$ V = 'F$Verify(0)
106$! P1 = What we are trying to make
107$! P2 = Command to make it
108$! P3 - P8  What it depends on
109$
110$ If F$Search(P1) .Eqs. "" Then Goto Makeit
111$ Time = F$CvTime(F$File(P1,"RDT"))
112$arg=3
113$Loop:
114$       Argument = P'arg
115$       If Argument .Eqs. "" Then Goto Exit
116$       El=0
117$Loop2:
118$       File = F$Element(El," ",Argument)
119$       If File .Eqs. " " Then Goto Endl
120$       AFile = ""
121$Loop3:
122$       OFile = AFile
123$       AFile = F$Search(File)
124$       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
125$       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
126$       Goto Loop3
127$NextEL:
128$       El = El + 1
129$       Goto Loop2
130$EndL:
131$ arg=arg+1
132$ If arg .Le. 8 Then Goto Loop
133$ Goto Exit
134$
135$Makeit:
136$ VV=F$VERIFY(0)
137$ write sys$output P2
138$ 'P2
139$ VV='F$Verify(VV)
140$Exit:
141$ If V Then Set Verify
142$ENDSUBROUTINE
143