1999-11-27 11:22:33 -05:00
|
|
|
$!------------------------------------------------------------------------------
|
2000-03-21 06:13:06 -05:00
|
|
|
$! make "PNG: The Definitive Guide" demo programs (for X) under OpenVMS
|
1999-11-27 11:22:33 -05:00
|
|
|
$!
|
2000-03-21 06:13:06 -05:00
|
|
|
$! Script created by Martin Zinser for libpng; modified by Greg Roelofs
|
|
|
|
$! for standalone pngbook source distribution.
|
1999-11-27 11:22:33 -05:00
|
|
|
$!
|
|
|
|
$!
|
2000-03-21 06:13:06 -05:00
|
|
|
$! Set locations where zlib and libpng sources live.
|
|
|
|
$!
|
2000-11-10 13:26:19 -05:00
|
|
|
$ zpath = ""
|
|
|
|
$ pngpath = ""
|
2000-03-21 06:13:06 -05:00
|
|
|
$!
|
2000-11-10 13:26:19 -05:00
|
|
|
$ if f$search("[---.zlib]zlib.h").nes."" then zpath = "[---.zlib]"
|
|
|
|
$ if f$search("[--]png.h").nes."" then pngpath = "[--]"
|
|
|
|
$!
|
2001-06-23 09:03:17 -04:00
|
|
|
$ if f$search("[-.zlib]zlib.h").nes."" then zpath = "[-.zlib]"
|
|
|
|
$ if f$search("[-.libpng]png.h").nes."" then pngpath = "[-.libpng]"
|
|
|
|
$!
|
2000-11-10 13:26:19 -05:00
|
|
|
$ if zpath .eqs. ""
|
|
|
|
$ then
|
2001-06-23 09:03:17 -04:00
|
|
|
$ write sys$output "zlib include not found. Exiting..."
|
2000-11-10 13:26:19 -05:00
|
|
|
$ exit 2
|
|
|
|
$ endif
|
|
|
|
$!
|
|
|
|
$ if pngpath .eqs. ""
|
|
|
|
$ then
|
2001-06-23 09:03:17 -04:00
|
|
|
$ write sys$output "libpng include not found. Exiting..."
|
2000-11-10 13:26:19 -05:00
|
|
|
$ exit 2
|
|
|
|
$ endif
|
2000-03-21 06:13:06 -05:00
|
|
|
$!
|
|
|
|
$! Look for the compiler used.
|
|
|
|
$!
|
|
|
|
$ ccopt="/include=(''zpath',''pngpath')"
|
1999-11-27 11:22:33 -05:00
|
|
|
$ if f$getsyi("HW_MODEL").ge.1024
|
|
|
|
$ then
|
|
|
|
$ ccopt = "/prefix=all"+ccopt
|
|
|
|
$ comp = "__decc__=1"
|
|
|
|
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
|
|
|
|
$ else
|
|
|
|
$ if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
|
|
|
|
$ then
|
|
|
|
$ if f$trnlnm("SYS").eqs."" then define sys sys$library:
|
|
|
|
$ if f$search("SYS$SYSTEM:VAXC.EXE").eqs.""
|
|
|
|
$ then
|
|
|
|
$ comp = "__gcc__=1"
|
|
|
|
$ CC :== GCC
|
|
|
|
$ else
|
|
|
|
$ comp = "__vaxc__=1"
|
|
|
|
$ endif
|
|
|
|
$ else
|
|
|
|
$ if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
|
|
|
|
$ ccopt = "/decc/prefix=all"+ccopt
|
|
|
|
$ comp = "__decc__=1"
|
|
|
|
$ endif
|
|
|
|
$ endif
|
|
|
|
$ open/write lopt lib.opt
|
2000-03-21 06:13:06 -05:00
|
|
|
$ write lopt "''pngpath'libpng.olb/lib"
|
|
|
|
$ write lopt "''zpath'libz.olb/lib"
|
1999-11-27 11:22:33 -05:00
|
|
|
$ close lopt
|
|
|
|
$ open/write xopt x11.opt
|
|
|
|
$ write xopt "sys$library:decw$xlibshr.exe/share"
|
|
|
|
$ close xopt
|
2000-03-21 06:13:06 -05:00
|
|
|
$!
|
|
|
|
$! Build 'em.
|
|
|
|
$!
|
|
|
|
$ write sys$output "Compiling PNG book programs ..."
|
1999-11-27 11:22:33 -05:00
|
|
|
$ CALL MAKE readpng.OBJ "cc ''CCOPT' readpng" -
|
|
|
|
readpng.c readpng.h
|
|
|
|
$ CALL MAKE readpng2.OBJ "cc ''CCOPT' readpng2" -
|
|
|
|
readpng2.c readpng2.h
|
|
|
|
$ CALL MAKE writepng.OBJ "cc ''CCOPT' writepng" -
|
|
|
|
writepng.c writepng.h
|
|
|
|
$ write sys$output "Building rpng-x..."
|
|
|
|
$ CALL MAKE rpng-x.OBJ "cc ''CCOPT' rpng-x" -
|
|
|
|
rpng-x.c readpng.h
|
1999-12-10 10:43:02 -05:00
|
|
|
$ call make rpng-x.exe -
|
|
|
|
"LINK rpng-x,readpng,lib.opt/opt,x11.opt/opt" -
|
1999-11-27 11:22:33 -05:00
|
|
|
rpng-x.obj readpng.obj
|
|
|
|
$ write sys$output "Building rpng2-x..."
|
|
|
|
$ CALL MAKE rpng2-x.OBJ "cc ''CCOPT' rpng2-x" -
|
|
|
|
rpng2-x.c readpng2.h
|
1999-12-10 10:43:02 -05:00
|
|
|
$ call make rpng2-x.exe -
|
|
|
|
"LINK rpng2-x,readpng2,lib.opt/opt,x11.opt/opt" -
|
1999-11-27 11:22:33 -05:00
|
|
|
rpng2-x.obj readpng2.obj
|
|
|
|
$ write sys$output "Building wpng..."
|
|
|
|
$ CALL MAKE wpng.OBJ "cc ''CCOPT' wpng" -
|
|
|
|
wpng.c writepng.h
|
1999-12-10 10:43:02 -05:00
|
|
|
$ call make wpng.exe -
|
|
|
|
"LINK wpng,writepng,lib.opt/opt" -
|
1999-11-27 11:22:33 -05:00
|
|
|
wpng.obj writepng.obj
|
|
|
|
$ 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
|