# # This Plan 9 mkfile is for ``easy'' building. # It worked for Ghostscript 8.53. # # This mkfile consists of two parts: the first part builds the gs executable, # the second unpacks the gs distribution and sets configuration parameters. # # Place this mkfile in the root directory of the gs distribution (the gsX.XX dir) # Edit the drivers list below, and mk fake-make to let gs configure # itself. Fake-make doesn't actually build very much. # # Then you can run mk normally. # # Be sure to have the jpeg, libpng, and zlib subdirectories before starting. # These have been included in recent gs tar files so we do not maintain # our own anymore. # # Each time you change the drivers list you must rerun mk fake-make # before building. # # If you want to try out a new GS distribution, you should be able # to mk try-X.XX, test it out, and then do mk install-X.XX, where X.XX # is the version number (e.g. 5.70). If outside BL, you may have to edit the # scripts to remove some local dependencies (e.g. calling outside and the # cpu call to thresher, alpha to make mips.h, alpha.h). # # Recent versions of src/gxshade1.c cause the compiler to run out # of registers. Brucee is looking into this. In the meantime, use this # replacement: # # private inline void # make_other_poles(patch_curve_t curve[4]) # { # int i, j; # # for (i = 0; i < 4; i++) { # j = (i + 1) % 4; # curve[i].control[0].x = (curve[i].vertex.p.x * 2 + curve[j].vertex.p.x); # curve[i].control[0].x /= 3; # curve[i].control[0].y = (curve[i].vertex.p.y * 2 + curve[j].vertex.p.y); # curve[i].control[0].y /= 3; # curve[i].control[1].x = (curve[i].vertex.p.x + curve[j].vertex.p.x * 2); # curve[i].control[1].y /= 3; # curve[i].control[1].y = (curve[i].vertex.p.y + curve[j].vertex.p.y * 2); # curve[i].control[1].y /= 3; # curve[i].straight = true; # } # } # # (the original includes the /3 in the big expressions). # # src/gxshade6.c also needs editing to remove use of the # vlong , operator on some architectures. # # you may need to change this line in gs/src/gshtscr.c: # // sample = (int) (value * max_ht_sample) + max_ht_sample; # to # sample = (vlong)(value * max_ht_sample) + max_ht_sample; [2] /dev/null | sort} # The first driver is the default. DRIVERS=\ plan9\ bj10e\ bjc600\ bjc800\ cdj1600\ cdj670\ cdj850\ cdj890\ dfaxlow\ epsonc\ epswrite\ inferno\ jpeg\ jpeggray\ laserjet\ ljet2p\ ljet3\ ljet3d\ ljet4\ pbm\ pbmraw\ pdfwrite\ pgm\ pgmraw\ plan9bm\ pnm\ pnmraw\ ppm\ ppmraw\ pswrite\ stcolor\ tiffg32d\ tiffg3\ tiffg4\ HFILES=$objtype.h\ arch.h\ # enforce some startup conditions x=`{mkdir obj >[2]/dev/null; mv jpeg/jmorecfg.h jpeg/jmorecfg.h.save >[2] /dev/null} $target chmod +x $target src/plan9.mak: src/unixansi.mak /sys/src/cmd/gs/contrib9.mak src/contrib.mak devlist='$(DD)'^$DRIVERS^'.dev' devlist=$"devlist sed 's#^GS_LIB_DEFAULT=.*#GS_LIB_DEFAULT=/sys/lib/ghostscript:/sys/lib/ghostscript/font:/sys/lib/postscript/font# s#^XCFLAGS=.*#XCFLAGS=-D_BSD_EXTENSION -DPlan9# s#^CFLAGS_STANDARD=.*#CFLAGS_STANDARD=# s#^include \$\(.*\)/(.*)#include src/\1# s#unix-aux.mak#plan9-aux.mak# s#gsdatadir *=.*#gsdatadir=/sys/src/cmd/gs# s#DEVICE_DEVS=.*#DEVICE_DEVS='$devlist'# s#(DEVICE_DEVS[0-9]+)=.*#\1=#' $prereq >$target src/plan9-aux.mak: src/unix-aux.mak sed 's#^INCLUDE=.*#INCLUDE=/sys/include/ape#' $prereq >$target try-%:V: gs%/$O.out bind gs$stem/$O.out /bin/gs bind -b gs$stem/lib /sys/lib/ghostscript echo 'give it a whirl' gs([0-9]+\.[0-9]+)/$O.out:R: gs\1/src @{ cd gs$stem1 # for(i in jpeg zlib libpng) # bind -c ../$i $i if(! test -f src/ld.tr) mk fake-make cp ../arch.h . rm -f obj/*.c mk $O.out # for(i in jpeg zlib libpng) # unmount $i || status='' } gs%/src: ghostscript-%.tar.gz rm -rf gs$stem gunzip < ghostscript-$stem.tar.gz | tar x mv ghostscript-$stem gs$stem chmod g+w gs$stem/* gs$stem/*/* # local drivers cp src/gdevifno.c src/gdevplan9.c src/gdevcd8.c gs$stem/src # local conventions ed gs$stem/lib/gs_init.ps gs$stem/mkfile cp default.*.h gs$stem @{cd gs$stem; mk startover} ghostscript-%.tar.gz: #outside #hget -o $target http://download.sourceforge.net/ghostscript/$target hget -o $target ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs^`{echo $stem | sed 's/\.//'}^/$target #ftpfs -a $user^'@' ftp.cs.wisc.edu #cp /n/ftp/ghost/aladdin/*/ghostscript-$stem.tar.gz . startover:V: rm -rf obj/* rm -f src/ld.tr rm -f src/plan9.mak src/plan9-aux.mak install-%:V: unmount /bin/gs || status='' unmount /sys/lib/ghostscript || status='' mk installsrc-$stem # cpu -h thresher -c 'mk mips.h' || status='' # cpu -h alpha -c 'mk alpha.h' || status='' mk all mk installall for(i in lib/*.ps) if(! cmp $i /sys/lib/ghostscript/^`{basename $i} >/dev/null) cp $i /sys/lib/ghostscript cp /sys/lib/ghostscript/pdf_sec-ps.bak /sys/lib/ghostscript/pdf_sec.ps installsrc-%:V: gs%/$O.out pwd=`{pwd} # don't accidentally do this from gsX.XX if(! ~ $pwd */gs) echo 'i don''t think you meant to do that' && exit oops tocopy=(doc examples icclib lib man obj src zlib jpeg libpng) if(! cmp src/version.mak gs$stem/src/version.mak) { rm -rf $tocopy @{cd gs$stem; tar c $tocopy} | tar xT mk clean } status='' clean-%:V: for (i in gs$stem/*) unmount $i >[2]/dev/null || status='' rm -rf gs$stem ghostscript-$stem.tar.gz