fukasawa e60969
$!------------------------------------------------------------------------------
fukasawa e60969
$! make Contrib programs of libpng under OpenVMS
fukasawa e60969
$!
fukasawa e60969
$!
fukasawa e60969
$! Look for the compiler used
fukasawa e60969
$!
fukasawa e60969
$ zlibsrc = "[---.zlib]"
fukasawa e60969
$ ccopt="/include=(''zlibsrc',[--])"
fukasawa e60969
$ if f$getsyi("HW_MODEL").ge.1024
fukasawa e60969
$ then
fukasawa e60969
$  ccopt = "/prefix=all"+ccopt
fukasawa e60969
$  comp  = "__decc__=1"
fukasawa e60969
$  if f$trnlnm("SYS").eqs."" then define sys sys$library:
fukasawa e60969
$ else
fukasawa e60969
$  if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
fukasawa e60969
$   then
fukasawa e60969
$    if f$trnlnm("SYS").eqs."" then define sys sys$library:
fukasawa e60969
$    if f$search("SYS$SYSTEM:VAXC.EXE").eqs.""
fukasawa e60969
$     then
fukasawa e60969
$      comp  = "__gcc__=1"
fukasawa e60969
$      CC :== GCC
fukasawa e60969
$     else
fukasawa e60969
$      comp = "__vaxc__=1"
fukasawa e60969
$     endif
fukasawa e60969
$   else
fukasawa e60969
$    if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
fukasawa e60969
$    ccopt = "/decc/prefix=all"+ccopt
fukasawa e60969
$    comp  = "__decc__=1"
fukasawa e60969
$  endif
fukasawa e60969
$ endif
fukasawa e60969
$ open/write lopt lib.opt
fukasawa e60969
$ write lopt "[--]libpng.olb/lib"
fukasawa e60969
$ write lopt "''zlibsrc'libz.olb/lib"
fukasawa e60969
$ close lopt
fukasawa e60969
$ open/write xopt x11.opt
fukasawa e60969
$ write xopt "sys$library:decw$xlibshr.exe/share"
fukasawa e60969
$ close xopt
fukasawa e60969
$ write sys$output "Compiling PNG contrib programs ..."
fukasawa e60969
$   write sys$output "Building pnm2png..."
fukasawa e60969
$   CALL MAKE pnm2png.OBJ "cc ''CCOPT' pnm2png" -
fukasawa e60969
	pnm2png.c
fukasawa e60969
$   call make pnm2png.exe -
fukasawa e60969
	"LINK pnm2png,lib.opt/opt" -
fukasawa e60969
	pnm2png.obj
fukasawa e60969
$   write sys$output "Building png2pnm..."
fukasawa e60969
$   CALL MAKE png2pnm.OBJ "cc ''CCOPT' png2pnm" -
fukasawa e60969
	png2pnm.c
fukasawa e60969
$   call make png2pnm.exe -
fukasawa e60969
	"LINK png2pnm,lib.opt/opt" -
fukasawa e60969
	png2pnm.obj
fukasawa e60969
$ exit
fukasawa e60969
$!
fukasawa e60969
$!
fukasawa e60969
$MAKE: SUBROUTINE   !SUBROUTINE TO CHECK DEPENDENCIES
fukasawa e60969
$ V = 'F$Verify(0)
fukasawa e60969
$! P1 = What we are trying to make
fukasawa e60969
$! P2 = Command to make it
fukasawa e60969
$! P3 - P8  What it depends on
fukasawa e60969
$
fukasawa e60969
$ If F$Search(P1) .Eqs. "" Then Goto Makeit
fukasawa e60969
$ Time = F$CvTime(F$File(P1,"RDT"))
fukasawa e60969
$arg=3
fukasawa e60969
$Loop:
fukasawa e60969
$       Argument = P'arg
fukasawa e60969
$       If Argument .Eqs. "" Then Goto Exit
fukasawa e60969
$       El=0
fukasawa e60969
$Loop2:
fukasawa e60969
$       File = F$Element(El," ",Argument)
fukasawa e60969
$       If File .Eqs. " " Then Goto Endl
fukasawa e60969
$       AFile = ""
fukasawa e60969
$Loop3:
fukasawa e60969
$       OFile = AFile
fukasawa e60969
$       AFile = F$Search(File)
fukasawa e60969
$       If AFile .Eqs. "" .Or. AFile .Eqs. OFile Then Goto NextEl
fukasawa e60969
$       If F$CvTime(F$File(AFile,"RDT")) .Ges. Time Then Goto Makeit
fukasawa e60969
$       Goto Loop3
fukasawa e60969
$NextEL:
fukasawa e60969
$       El = El + 1
fukasawa e60969
$       Goto Loop2
fukasawa e60969
$EndL:
fukasawa e60969
$ arg=arg+1
fukasawa e60969
$ If arg .Le. 8 Then Goto Loop
fukasawa e60969
$ Goto Exit
fukasawa e60969
$
fukasawa e60969
$Makeit:
fukasawa e60969
$ VV=F$VERIFY(0)
fukasawa e60969
$ write sys$output P2
fukasawa e60969
$ 'P2
fukasawa e60969
$ VV='F$Verify(VV)
fukasawa e60969
$Exit:
fukasawa e60969
$ If V Then Set Verify
fukasawa e60969
$ENDSUBROUTINE