fukasawa e60969
$! make libpng under VMS
fukasawa e60969
$!
fukasawa e60969
$!
fukasawa e60969
$! Check for MMK/MMS
fukasawa e60969
$!
fukasawa e60969
$! This procedure accepts one parameter (contrib), which causes it to build
fukasawa e60969
$! the programs from the contrib directory instead of libpng.
fukasawa e60969
$!
fukasawa e60969
$ p1 = f$edit(p1,"UPCASE")
fukasawa e60969
$ if p1 .eqs. "CONTRIB"
fukasawa e60969
$ then
fukasawa e60969
$   set def [.contrib.gregbook]
fukasawa e60969
$   @makevms
fukasawa e60969
$   set def [-.pngminus]
fukasawa e60969
$   @makevms
fukasawa e60969
$   set def [--]
fukasawa e60969
$   exit
fukasawa e60969
$ endif
fukasawa e60969
$ Make = ""
fukasawa e60969
$ If F$Search ("Sys$System:MMS.EXE") .nes. "" Then Make = "MMS"
fukasawa e60969
$ If F$Type (MMK) .eqs. "STRING" Then Make = "MMK"
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
$!
fukasawa e60969
$! Build the thing plain or with mms/mmk
fukasawa e60969
$!
fukasawa e60969
$ write sys$output "Compiling Libpng sources ..."
fukasawa e60969
$ if make.eqs.""
fukasawa e60969
$  then
fukasawa e60969
$   dele pngtest.obj;*
fukasawa e60969
$   CALL MAKE png.OBJ "cc ''CCOPT' png" -
fukasawa e60969
	png.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngset.OBJ "cc ''CCOPT' pngset" -
fukasawa e60969
	pngset.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngget.OBJ "cc ''CCOPT' pngget" -
fukasawa e60969
	pngget.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngread.OBJ "cc ''CCOPT' pngread" -
fukasawa e60969
	pngread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngpread.OBJ "cc ''CCOPT' pngpread" -
fukasawa e60969
	pngpread.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngrtran.OBJ "cc ''CCOPT' pngrtran" -
fukasawa e60969
	pngrtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngrutil.OBJ "cc ''CCOPT' pngrutil" -
fukasawa e60969
	pngrutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngerror.OBJ "cc ''CCOPT' pngerror" -
fukasawa e60969
	pngerror.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngmem.OBJ "cc ''CCOPT' pngmem" -
fukasawa e60969
	pngmem.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngrio.OBJ "cc ''CCOPT' pngrio" -
fukasawa e60969
	pngrio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngwio.OBJ "cc ''CCOPT' pngwio" -
fukasawa e60969
	pngwio.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngtrans.OBJ "cc ''CCOPT' pngtrans" -
fukasawa e60969
	pngtrans.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngwrite.OBJ "cc ''CCOPT' pngwrite" -
fukasawa e60969
	pngwrite.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngwtran.OBJ "cc ''CCOPT' pngwtran" -
fukasawa e60969
	pngwtran.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   CALL MAKE pngwutil.OBJ "cc ''CCOPT' pngwutil" -
fukasawa e60969
	pngwutil.c png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
fukasawa e60969
$   write sys$output "Building Libpng ..."
fukasawa e60969
$   CALL MAKE libpng.OLB "lib/crea libpng.olb *.obj" *.OBJ
fukasawa e60969
$   write sys$output "Building pngtest..."
fukasawa e60969
$   CALL MAKE pngtest.OBJ "cc ''CCOPT' pngtest" -
fukasawa e60969
	pngtest.c png.h pngconf.h pnglibconf.h
fukasawa e60969
$   call make pngtest.exe -
fukasawa e60969
	"LINK pngtest,libpng.olb/lib,''zlibsrc'libz.olb/lib" -
fukasawa e60969
	pngtest.obj libpng.olb
fukasawa e60969
$   write sys$output "Testing Libpng..."
fukasawa e60969
$   run pngtest
fukasawa e60969
$  else
fukasawa e60969
$   if f$search("DESCRIP.MMS") .eqs. "" then copy/nolog [.SCRIPTS]DESCRIP.MMS []
fukasawa e60969
$   'make'/macro=('comp',zlibsrc='zlibsrc')
fukasawa e60969
$  endif
fukasawa e60969
$ write sys$output "Libpng build completed"
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