From 6c05d1dcf8927d644e123e2e350ac2ad589392dd Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 17 Jun 2016 23:28:04 +0000 Subject: Rename all files containing a : in their filename. While there, run make makepatch on affected ports, and rename patches accordingly. Sponsored by: Absolight --- print/ghostscript7-x11/files/patch-src-Makefile.in | 166 ------ .../ghostscript7-x11/files/patch-src-configure.ac | 199 ------- print/ghostscript7-x11/files/patch-src-devs.mak | 65 -- print/ghostscript7-x11/files/patch-src-gconf.c | 43 -- print/ghostscript7-x11/files/patch-src-gdevijs.c | 659 --------------------- print/ghostscript7-x11/files/patch-src-gdevl256.c | 15 - print/ghostscript7-x11/files/patch-src-gdevpng.c | 187 ------ print/ghostscript7-x11/files/patch-src-gdevvglb.c | 15 - print/ghostscript7-x11/files/patch-src-gdevxalt.c | 31 - print/ghostscript7-x11/files/patch-src-gnudevs.mak | 67 --- print/ghostscript7-x11/files/patch-src-gp_unix.c | 83 --- print/ghostscript7-x11/files/patch-src-gs.mak | 19 - print/ghostscript7-x11/files/patch-src-gsalloc.c | 11 - print/ghostscript7-x11/files/patch-src-gsmalloc.c | 11 - print/ghostscript7-x11/files/patch-src-gxclrast.c | 15 - print/ghostscript7-x11/files/patch-src-gxfixed.h | 46 -- print/ghostscript7-x11/files/patch-src-ibnum.c | 49 -- print/ghostscript7-x11/files/patch-src-ibnum.h | 11 - print/ghostscript7-x11/files/patch-src-icclib.mak | 11 - print/ghostscript7-x11/files/patch-src-idebug.c | 11 - print/ghostscript7-x11/files/patch-src-idparam.c | 21 - print/ghostscript7-x11/files/patch-src-ijs.mak | 20 - print/ghostscript7-x11/files/patch-src-int.mak | 24 - print/ghostscript7-x11/files/patch-src-iparam.c | 33 -- print/ghostscript7-x11/files/patch-src-iref.h | 11 - print/ghostscript7-x11/files/patch-src-iscan.c | 11 - print/ghostscript7-x11/files/patch-src-iscanbin.c | 83 --- print/ghostscript7-x11/files/patch-src-iscannum.c | 203 ------- print/ghostscript7-x11/files/patch-src-iutil.c | 11 - print/ghostscript7-x11/files/patch-src-lib.mak | 46 -- .../ghostscript7-x11/files/patch-src-unixinst.mak | 122 ---- print/ghostscript7-x11/files/patch-src-zarith.c | 48 -- print/ghostscript7-x11/files/patch-src-zcontrol.c | 20 - print/ghostscript7-x11/files/patch-src-zdict.c | 29 - print/ghostscript7-x11/files/patch-src-zdps.c | 25 - print/ghostscript7-x11/files/patch-src-zfunc4.c | 13 - print/ghostscript7-x11/files/patch-src-zgeneric.c | 20 - print/ghostscript7-x11/files/patch-src-ziodev.c | 11 - print/ghostscript7-x11/files/patch-src-zmath.c | 18 - print/ghostscript7-x11/files/patch-src-zstack.c | 11 - print/ghostscript7-x11/files/patch-src-ztype.c | 34 -- print/ghostscript7-x11/files/patch-src:gdevlbp8.c | 70 --- print/ghostscript7-x11/files/patch-src:gdevpdff.c | 59 -- print/ghostscript7-x11/files/patch-src:gdevpdff.h | 37 -- print/ghostscript7-x11/files/patch-src:gdevpdfs.c | 41 -- print/ghostscript7-x11/files/patch-src:gdevpdfw.c | 60 -- print/ghostscript7-x11/files/patch-src:genarch.c | 34 -- print/ghostscript7-x11/files/patch-src:gxobj.h | 17 - .../ghostscript7-x11/files/patch-src:unix-dll.mak | 87 --- print/ghostscript7-x11/files/patch-src:zmedia2.c | 25 - print/ghostscript7-x11/files/patch-src_Makefile.in | 166 ++++++ .../ghostscript7-x11/files/patch-src_configure.ac | 199 +++++++ print/ghostscript7-x11/files/patch-src_devs.mak | 65 ++ print/ghostscript7-x11/files/patch-src_gconf.c | 43 ++ print/ghostscript7-x11/files/patch-src_gdevhl12.c | 6 +- print/ghostscript7-x11/files/patch-src_gdevijs.c | 659 +++++++++++++++++++++ print/ghostscript7-x11/files/patch-src_gdevl256.c | 15 + print/ghostscript7-x11/files/patch-src_gdevlbp8.c | 69 +++ print/ghostscript7-x11/files/patch-src_gdevpdff.c | 58 ++ print/ghostscript7-x11/files/patch-src_gdevpdff.h | 36 ++ print/ghostscript7-x11/files/patch-src_gdevpdfs.c | 41 ++ print/ghostscript7-x11/files/patch-src_gdevpdfw.c | 59 ++ print/ghostscript7-x11/files/patch-src_gdevpng.c | 187 ++++++ print/ghostscript7-x11/files/patch-src_gdevvglb.c | 15 + print/ghostscript7-x11/files/patch-src_gdevxalt.c | 31 + print/ghostscript7-x11/files/patch-src_genarch.c | 34 ++ print/ghostscript7-x11/files/patch-src_gnudevs.mak | 67 +++ print/ghostscript7-x11/files/patch-src_gp__unix.c | 83 +++ print/ghostscript7-x11/files/patch-src_gs.mak | 19 + print/ghostscript7-x11/files/patch-src_gsalloc.c | 11 + print/ghostscript7-x11/files/patch-src_gsmalloc.c | 11 + print/ghostscript7-x11/files/patch-src_gxclrast.c | 15 + print/ghostscript7-x11/files/patch-src_gxfixed.h | 46 ++ print/ghostscript7-x11/files/patch-src_gxobj.h | 17 + print/ghostscript7-x11/files/patch-src_ibnum.c | 49 ++ print/ghostscript7-x11/files/patch-src_ibnum.h | 11 + print/ghostscript7-x11/files/patch-src_icclib.mak | 11 + print/ghostscript7-x11/files/patch-src_idebug.c | 11 + print/ghostscript7-x11/files/patch-src_idparam.c | 21 + print/ghostscript7-x11/files/patch-src_ijs.mak | 20 + print/ghostscript7-x11/files/patch-src_int.mak | 24 + print/ghostscript7-x11/files/patch-src_iparam.c | 33 ++ print/ghostscript7-x11/files/patch-src_iref.h | 11 + print/ghostscript7-x11/files/patch-src_iscan.c | 11 + print/ghostscript7-x11/files/patch-src_iscanbin.c | 83 +++ print/ghostscript7-x11/files/patch-src_iscannum.c | 203 +++++++ print/ghostscript7-x11/files/patch-src_iutil.c | 11 + print/ghostscript7-x11/files/patch-src_lib.mak | 46 ++ .../ghostscript7-x11/files/patch-src_unix-dll.mak | 87 +++ .../ghostscript7-x11/files/patch-src_unixinst.mak | 122 ++++ print/ghostscript7-x11/files/patch-src_zarith.c | 48 ++ print/ghostscript7-x11/files/patch-src_zcontrol.c | 20 + print/ghostscript7-x11/files/patch-src_zdict.c | 29 + print/ghostscript7-x11/files/patch-src_zdps.c | 25 + print/ghostscript7-x11/files/patch-src_zfunc4.c | 13 + print/ghostscript7-x11/files/patch-src_zgeneric.c | 20 + print/ghostscript7-x11/files/patch-src_ziodev.c | 11 + print/ghostscript7-x11/files/patch-src_zmath.c | 18 + print/ghostscript7-x11/files/patch-src_zmedia2.c | 25 + print/ghostscript7-x11/files/patch-src_zstack.c | 11 + print/ghostscript7-x11/files/patch-src_ztype.c | 34 ++ 101 files changed, 2957 insertions(+), 2961 deletions(-) delete mode 100644 print/ghostscript7-x11/files/patch-src-Makefile.in delete mode 100644 print/ghostscript7-x11/files/patch-src-configure.ac delete mode 100644 print/ghostscript7-x11/files/patch-src-devs.mak delete mode 100644 print/ghostscript7-x11/files/patch-src-gconf.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gdevijs.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gdevl256.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gdevpng.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gdevvglb.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gdevxalt.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gnudevs.mak delete mode 100644 print/ghostscript7-x11/files/patch-src-gp_unix.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gs.mak delete mode 100644 print/ghostscript7-x11/files/patch-src-gsalloc.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gsmalloc.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gxclrast.c delete mode 100644 print/ghostscript7-x11/files/patch-src-gxfixed.h delete mode 100644 print/ghostscript7-x11/files/patch-src-ibnum.c delete mode 100644 print/ghostscript7-x11/files/patch-src-ibnum.h delete mode 100644 print/ghostscript7-x11/files/patch-src-icclib.mak delete mode 100644 print/ghostscript7-x11/files/patch-src-idebug.c delete mode 100644 print/ghostscript7-x11/files/patch-src-idparam.c delete mode 100644 print/ghostscript7-x11/files/patch-src-ijs.mak delete mode 100644 print/ghostscript7-x11/files/patch-src-int.mak delete mode 100644 print/ghostscript7-x11/files/patch-src-iparam.c delete mode 100644 print/ghostscript7-x11/files/patch-src-iref.h delete mode 100644 print/ghostscript7-x11/files/patch-src-iscan.c delete mode 100644 print/ghostscript7-x11/files/patch-src-iscanbin.c delete mode 100644 print/ghostscript7-x11/files/patch-src-iscannum.c delete mode 100644 print/ghostscript7-x11/files/patch-src-iutil.c delete mode 100644 print/ghostscript7-x11/files/patch-src-lib.mak delete mode 100644 print/ghostscript7-x11/files/patch-src-unixinst.mak delete mode 100644 print/ghostscript7-x11/files/patch-src-zarith.c delete mode 100644 print/ghostscript7-x11/files/patch-src-zcontrol.c delete mode 100644 print/ghostscript7-x11/files/patch-src-zdict.c delete mode 100644 print/ghostscript7-x11/files/patch-src-zdps.c delete mode 100644 print/ghostscript7-x11/files/patch-src-zfunc4.c delete mode 100644 print/ghostscript7-x11/files/patch-src-zgeneric.c delete mode 100644 print/ghostscript7-x11/files/patch-src-ziodev.c delete mode 100644 print/ghostscript7-x11/files/patch-src-zmath.c delete mode 100644 print/ghostscript7-x11/files/patch-src-zstack.c delete mode 100644 print/ghostscript7-x11/files/patch-src-ztype.c delete mode 100644 print/ghostscript7-x11/files/patch-src:gdevlbp8.c delete mode 100644 print/ghostscript7-x11/files/patch-src:gdevpdff.c delete mode 100644 print/ghostscript7-x11/files/patch-src:gdevpdff.h delete mode 100644 print/ghostscript7-x11/files/patch-src:gdevpdfs.c delete mode 100644 print/ghostscript7-x11/files/patch-src:gdevpdfw.c delete mode 100644 print/ghostscript7-x11/files/patch-src:genarch.c delete mode 100644 print/ghostscript7-x11/files/patch-src:gxobj.h delete mode 100644 print/ghostscript7-x11/files/patch-src:unix-dll.mak delete mode 100644 print/ghostscript7-x11/files/patch-src:zmedia2.c create mode 100644 print/ghostscript7-x11/files/patch-src_Makefile.in create mode 100644 print/ghostscript7-x11/files/patch-src_configure.ac create mode 100644 print/ghostscript7-x11/files/patch-src_devs.mak create mode 100644 print/ghostscript7-x11/files/patch-src_gconf.c create mode 100644 print/ghostscript7-x11/files/patch-src_gdevijs.c create mode 100644 print/ghostscript7-x11/files/patch-src_gdevl256.c create mode 100644 print/ghostscript7-x11/files/patch-src_gdevlbp8.c create mode 100644 print/ghostscript7-x11/files/patch-src_gdevpdff.c create mode 100644 print/ghostscript7-x11/files/patch-src_gdevpdff.h create mode 100644 print/ghostscript7-x11/files/patch-src_gdevpdfs.c create mode 100644 print/ghostscript7-x11/files/patch-src_gdevpdfw.c create mode 100644 print/ghostscript7-x11/files/patch-src_gdevpng.c create mode 100644 print/ghostscript7-x11/files/patch-src_gdevvglb.c create mode 100644 print/ghostscript7-x11/files/patch-src_gdevxalt.c create mode 100644 print/ghostscript7-x11/files/patch-src_genarch.c create mode 100644 print/ghostscript7-x11/files/patch-src_gnudevs.mak create mode 100644 print/ghostscript7-x11/files/patch-src_gp__unix.c create mode 100644 print/ghostscript7-x11/files/patch-src_gs.mak create mode 100644 print/ghostscript7-x11/files/patch-src_gsalloc.c create mode 100644 print/ghostscript7-x11/files/patch-src_gsmalloc.c create mode 100644 print/ghostscript7-x11/files/patch-src_gxclrast.c create mode 100644 print/ghostscript7-x11/files/patch-src_gxfixed.h create mode 100644 print/ghostscript7-x11/files/patch-src_gxobj.h create mode 100644 print/ghostscript7-x11/files/patch-src_ibnum.c create mode 100644 print/ghostscript7-x11/files/patch-src_ibnum.h create mode 100644 print/ghostscript7-x11/files/patch-src_icclib.mak create mode 100644 print/ghostscript7-x11/files/patch-src_idebug.c create mode 100644 print/ghostscript7-x11/files/patch-src_idparam.c create mode 100644 print/ghostscript7-x11/files/patch-src_ijs.mak create mode 100644 print/ghostscript7-x11/files/patch-src_int.mak create mode 100644 print/ghostscript7-x11/files/patch-src_iparam.c create mode 100644 print/ghostscript7-x11/files/patch-src_iref.h create mode 100644 print/ghostscript7-x11/files/patch-src_iscan.c create mode 100644 print/ghostscript7-x11/files/patch-src_iscanbin.c create mode 100644 print/ghostscript7-x11/files/patch-src_iscannum.c create mode 100644 print/ghostscript7-x11/files/patch-src_iutil.c create mode 100644 print/ghostscript7-x11/files/patch-src_lib.mak create mode 100644 print/ghostscript7-x11/files/patch-src_unix-dll.mak create mode 100644 print/ghostscript7-x11/files/patch-src_unixinst.mak create mode 100644 print/ghostscript7-x11/files/patch-src_zarith.c create mode 100644 print/ghostscript7-x11/files/patch-src_zcontrol.c create mode 100644 print/ghostscript7-x11/files/patch-src_zdict.c create mode 100644 print/ghostscript7-x11/files/patch-src_zdps.c create mode 100644 print/ghostscript7-x11/files/patch-src_zfunc4.c create mode 100644 print/ghostscript7-x11/files/patch-src_zgeneric.c create mode 100644 print/ghostscript7-x11/files/patch-src_ziodev.c create mode 100644 print/ghostscript7-x11/files/patch-src_zmath.c create mode 100644 print/ghostscript7-x11/files/patch-src_zmedia2.c create mode 100644 print/ghostscript7-x11/files/patch-src_zstack.c create mode 100644 print/ghostscript7-x11/files/patch-src_ztype.c (limited to 'print/ghostscript7-x11') diff --git a/print/ghostscript7-x11/files/patch-src-Makefile.in b/print/ghostscript7-x11/files/patch-src-Makefile.in deleted file mode 100644 index c615c95a9e2a..000000000000 --- a/print/ghostscript7-x11/files/patch-src-Makefile.in +++ /dev/null @@ -1,166 +0,0 @@ ---- src/Makefile.in.orig 2003-04-30 03:33:31.000000000 +0900 -+++ src/Makefile.in 2015-08-22 02:16:40.606012000 +0900 -@@ -50,8 +50,10 @@ - # initialization files (gs_*.ps) and the fonts. - - INSTALL = $(GLSRCDIR)/instcopy -c --INSTALL_PROGRAM = $(INSTALL) -m 755 --INSTALL_DATA = $(INSTALL) -m 644 -+INSTALL_PROGRAM = ${BSD_INSTALL_PROGRAM} -+INSTALL_SCRIPT = ${BSD_INSTALL_SCRIPT} -+INSTALL_DATA = ${BSD_INSTALL_DATA} -+INSTALL_SHARED = @INSTALL_SHARED@ - - prefix = @prefix@ - exec_prefix = @exec_prefix@ -@@ -63,6 +65,8 @@ - datadir = @datadir@ - gsdir = $(datadir)/ghostscript - gsdatadir = $(gsdir)/$(GS_DOT_VERSION) -+gssharedir = @libdir@/ghostscript/$(GS_DOT_VERSION) -+gsincludedir = @includedir@/ghostscript/ - - docdir=$(gsdatadir)/doc - exdir=$(gsdatadir)/examples -@@ -142,7 +146,7 @@ - # some older JPEG streams that violate the standard. If the JPEG - # library built from local sources, the patch will be applied. - --SHARE_JPEG=@SHARE_LIBJPEG@ -+SHARE_JPEG=1 - JPEG_NAME=jpeg - - # Define the directory where the PNG library sources are stored, -@@ -150,14 +154,14 @@ - # You may need to change this if the libpng version changes. - # See libpng.mak for more information. - --SHARE_LIBPNG=@SHARE_LIBPNG@ -+SHARE_LIBPNG=1 - PSRCDIR=@LIBPNGDIR@ - LIBPNG_NAME=png - - # Define the directory where the zlib sources are stored. - # See zlib.mak for more information. - --SHARE_ZLIB=@SHARE_ZLIB@ -+SHARE_ZLIB=1 - ZSRCDIR=@ZLIBDIR@ - #ZLIB_NAME=gz - ZLIB_NAME=z -@@ -197,15 +201,15 @@ - CCLD=$(CC) - - # Define the general cc flags, warnings and such. --GCFLAGS=@GCFLAGS@ -+GCFLAGS=@CPPFLAGS@ @GCFLAGS@ @CFLAGS@ - - # Define the added flags for standard, debugging, profiling - # and shared object builds. - --CFLAGS_STANDARD=@OPT_CFLAGS@ -+CFLAGS_STANDARD?=@OPT_CFLAGS@ - CFLAGS_DEBUG=-g -O - CFLAGS_PROFILE=-pg @OPT_CFLAGS@ --CFLAGS_SO=-fPIC -+CFLAGS_SO=@DYNAMIC_CFLAGS@ - - # Define the other compilation flags. Add at most one of the following: - # -DBSD4_2 for 4.2bsd systems. -@@ -218,7 +222,7 @@ - # We don't include -ansi, because this gets in the way of the platform- - # specific stuff that typically needs; nevertheless, we expect - # gcc to accept ANSI-style function prototypes and function definitions. --XCFLAGS= -+XCFLAGS=@DYNAMIC_FLAGS@ - - # defines from autoconf; note that we don't use these at present. - ACDEFS=@DEFS@ -@@ -232,9 +236,9 @@ - # -R /usr/local/xxx/lib:/usr/local/lib - # giving the full path names of the shared library directories. - # XLDFLAGS can be set from the command line. --XLDFLAGS= - --LDFLAGS=$(XLDFLAGS) -+LDFLAGS=@LDFLAGS@ -+XLDFLAGS=$(LDFLAGS) - - # Define any extra libraries to link into the executable. - # ISC Unix 2.2 wants -linet. -@@ -243,7 +247,7 @@ - # Solaris may need -lnsl -lsocket -lposix4. - # (Libraries required by individual drivers are handled automatically.) - --EXTRALIBS= -+EXTRALIBS=@LIBS@ @DYNAMIC_LIBS@ - - # Define the standard libraries to search at the end of linking. - # Most platforms require -lpthread for the POSIX threads library; -@@ -252,10 +256,7 @@ - # All reasonable platforms require -lm, but Rhapsody and perhaps one or - # two others fold libm into libc and don't require any additional library. - --#STDLIBS=-lpthread -lm -- --# Since the default build is for nosync, don't include pthread lib --STDLIBS=-lm -+STDLIBS=@PTHREAD_LIBS@ -lm - - # Define the include switch(es) for the X11 header files. - # This can be null if handled in some other way (e.g., the files are -@@ -279,9 +280,10 @@ - # should be slotted into XLIBS below and X_PRE_LIBS which should go - # before -lX11. We do not handle these and should, but they are empty - # on most modern platforms. --XLIBDIRS=@X_LIBS@ -+XLIBDIRS=@X_LDFLAGS@ - XLIBDIR= --XLIBS=Xt Xext X11 -+#XLIBS=Xt Xext X11 -+XLIBS=@X_LIBS@ - - # Define whether this platform has floating point hardware: - # FPU_TYPE=2 means floating point is faster than fixed point. -@@ -301,15 +303,19 @@ - # primitives for this platform. - - # If POSIX sync primitives are used, also change the STDLIBS to include --# the pthread library. -+# the pthread library. Otherwise use SYNC=nosync - #SYNC=posync -- --# Default is No sync primitives since some platforms don't have it (HP-UX) --SYNC=nosync -+#SYNC=nosync -+SYNC=@SYNC@ - - # programs we use - RM=rm -f - -+# ------ Dynamic loader options ------- # -+SOC_CFLAGS = @SOC_CFLAGS@ -+SOC_LIBS = @SOC_LIBS@ -+SOC_LOADER = @SOC_LOADER@ -+ - # ------ Devices and features ------ # - - # Choose the language feature(s) to include. See gs.mak for details. -@@ -385,6 +391,9 @@ - DEVICE_DEVS19= - DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev - -+# Shared library target to build. -+GS_SHARED_OBJS=@DYNAMIC_DEVS@ -+ - # ---------------------------- End of options --------------------------- # - - # Define the name of the partial makefile that specifies options -- -@@ -407,6 +416,7 @@ - # These are the specific warnings we have to turn off to compile those - # specific few files that need this. We may turn off others in the future. - CC_NO_WARN=$(CC_) -+CC_SHARED=$(CC_) @DYNAMIC_LDFLAGS@ - - # ---------------- End of platform-specific section ---------------- # - diff --git a/print/ghostscript7-x11/files/patch-src-configure.ac b/print/ghostscript7-x11/files/patch-src-configure.ac deleted file mode 100644 index f95ae6826b22..000000000000 --- a/print/ghostscript7-x11/files/patch-src-configure.ac +++ /dev/null @@ -1,199 +0,0 @@ ---- src/configure.ac.orig 2003-04-16 22:59:56.000000000 +0900 -+++ src/configure.ac 2015-08-22 02:25:42.002266000 +0900 -@@ -8,6 +8,46 @@ - AC_PREREQ(2.52) - AC_CONFIG_SRCDIR(src/gs.c) - -+CFLAGS="${CFLAGS:=}" -+CPPFLAGS="${CPPFLAGS:=}" -+CXXFLAGS="${CXXFLAGS:=}" -+LDFLAGS="${LDFLAGS:=}" -+ -+dnl -------------------------------------------------- -+dnl Local utilities -+dnl -------------------------------------------------- -+ -+dnl GS_SPLIT_LIBS( LIBS, LINKLINE ) -+dnl Split a unix-style link line into a list of -+dnl bare library names. For example, the line -+dnl '-L/usr/X11R6/lib -lX11 -lXt' splits into -+dnl LIB='X11 Xt' -+dnl -+AC_DEFUN([GS_SPLIT_LIBS], [ -+# the makefile wants a list of just the library names -+for gs_item in $2; do -+ gs_stripped_item=`echo "$gs_item" | sed -e 's/^-l//'` -+ if test "x$gs_stripped_item" != "x$gs_item"; then -+ $1="$[$1] $gs_stripped_item" -+ fi -+done -+]) -+ -+dnl GS_SPLIT_LIBPATHS( LIBPATHS, LINKLINE ) -+dnl Split a unix-style link line into a list of -+dnl bare search path entries. For example, -+dnl '-L/usr/X11R6/lib -lX11 -L/opt/lib -lXt' -+dnl splits to LIBPATHS='/usr/X11R6/lib /opt/lib' -+dnl -+AC_DEFUN([GS_SPLIT_LIBPATHS], [ -+for gs_item in $2; do -+ gs_stripped_item=`echo "$gs_item" | sed -e 's/-L//'` -+ if test "x$gs_stripped_item" != "x$gs_item"; then -+ $1="$[$1] $gs_stripped_item" -+ fi -+done -+]) -+ - dnl -------------------------------------------------- - dnl Check for programs - dnl -------------------------------------------------- -@@ -94,33 +134,15 @@ - dnl -------------------------------------------------- - - AC_CHECK_LIB(m, cos) --dnl AC_CHECK_LIB(pthread, pthread_create) -+SYNC="nosync" -+PTHREAD_LIBS="" -+AC_CHECK_LIB(pthread, pthread_create, [ -+ SYNC=posync; -+ PTHREAD_LIBS="-lpthread" -+]) -+AC_SUBST(SYNC) -+AC_SUBST(PTHREAD_LIBS) - --AC_MSG_CHECKING([for local jpeg library source]) --dnl At present, we give the local source priority over the shared --dnl build, so that the D_MAX_BLOCKS_IN_MCU patch will be applied. --dnl A more sophisticated approach would be to test the shared lib --dnl to see whether it has already been patched. --LIBJPEGDIR=src --if test -d jpeg; then -- AC_MSG_RESULT([jpeg]) -- SHARE_LIBJPEG=0 -- LIBJPEGDIR=jpeg --elif test -d jpeg-6b; then -- AC_MSG_RESULT([jpeg-6b]) -- SHARE_LIBJPEG=0 -- LIBJPEGDIR=jpeg-6b --else -- AC_MSG_RESULT([no]) -- AC_CHECK_LIB(jpeg, jpeg_set_defaults, [SHARE_LIBJPEG=1], [ -- AC_MSG_ERROR([I wasn't able to find a copy -- of the jpeg library. This is required for compiling -- ghostscript. Please download a copy of the source, e.g. -- from http://www.ijg.org/, unpack it at the top level of -- the gs source tree, and rename the directory to 'jpeg'. -- ]) -- ]) --fi - AC_SUBST(SHARE_LIBJPEG) - AC_SUBST(LIBJPEGDIR) - -@@ -211,15 +233,68 @@ - AC_SUBST(STPLIB) - AC_SUBST(STPDEVS) - -+SOC_CFLAGS="" -+SOC_LIBS="" -+SOC_LOADER="dxmainc.c" -+ -+AC_SUBST(SOC_CFLAGS) -+AC_SUBST(SOC_LIBS) -+AC_SUBST(SOC_LOADER) -+ - dnl optional X11 for display devices - AC_PATH_XTRA --if test x"$no_x" = x"yes"; then -- AC_MSG_NOTICE([disabling X11 output devices]) -- X11DEVS='' --else -- X11DEVS='$(DD)x11.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev' -+ -+X_LDFLAGS="" -+X_CFLAGS="" -+X_DEVS="" -+X_LIBS="" -+ -+if test x$with_x != xno; then -+ if test "$x_libraries" = "/usr/lib"; then -+ echo "Ignoring X library directory \"$x_libraries\" requested by configure." -+ x_libraries="NONE" -+ fi -+ if test ! "$x_libraries" = "NONE" -a ! "$x_libraries" = ""; then -+ X_LDFLAGS="-L$x_libraries" -+ if test "$uname" = "SunOS"; then -+ X_LDFLAGS="$X_LDFLAGS -R$x_libraries" -+ fi -+ fi -+ -+ if test "$x_includes" = "/usr/include"; then -+ echo "Ignoring X include directory \"$x_includes\" requested by configure." -+ x_includes="NONE" -+ fi -+ if test ! "$x_includes" = "NONE" -a ! "$x_includes" = ""; then -+ X_CFLAGS="-I$x_includes" -+ fi -+ -+ SAVELIBS="$LIBS" -+ SAVELDFLAGS="$LDFLAGS" -+ LDFLAGS="$LDFLAGS $X_LDFLAGS" -+ -+ AC_CHECK_LIB(X11,XOpenDisplay) -+ AC_CHECK_LIB(Xext,XdbeQueryExtension) -+ AC_CHECK_LIB(Xt,XtAppCreateShell) -+ -+ LDFLAGS="$SAVELDFLAGS" -+ LIBS="$SAVELIBS" -+ -+ if test "$ac_cv_lib_Xt_XtAppCreateShell" = yes; then -+ X11DEVS="\$(DD)x11.dev \$(DD)x11alpha.dev \$(DD)x11cmyk.dev \$(DD)x11mono.dev \$(DD)x11_.dev \$(DD)x11alt_.dev \$(DD)x11cmyk2.dev \$(DD)x11cmyk4.dev \$(DD)x11cmyk8.dev \$(DD)x11rg16x.dev \$(DD)x11rg32x.dev \$(DD)x11gray2.dev \$(DD)x11gray4.dev" -+ X_DEVS=$X11DEVS -+ # the makefile wants a list of just the library names in X_LIBS -+ GS_SPLIT_LIBS([X_LIBS], -+ [-lXt $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS]) -+ fi - fi -+ -+AC_SUBST(X_LDFLAGS) -+AC_SUBST(X_CFLAGS) -+AC_SUBST(X_LIBS) -+AC_SUBST(X_DEVS) - AC_SUBST(X11DEVS) -+AC_SUBST(XLIBS) - - dnl executible name - AC_ARG_WITH(gs, AC_HELP_STRING([--with-gs=NAME], -@@ -236,6 +311,33 @@ - fi]) - AC_SUBST(COMPILE_INITS) - -+dnl Dynamic device support. -+DYNAMIC_CFLAGS="" -+DYNAMIC_DEVS="" -+DYNAMIC_FLAGS="" -+DYNAMIC_LDFLAGS="" -+DYNAMIC_LIBS="" -+INSTALL_SHARED="" -+ -+AC_ARG_ENABLE([dynamic], AC_HELP_STRING([--enable-dynamic], -+ [Enable dynamically loaded drivers]), -+[ -+ INSTALL_SHARED="install-shared" -+ DYNAMIC_CFLAGS="-fPIC" -+ DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so" -+ DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\"" -+ DYNAMIC_LDFLAGS="-fPIC -shared" -+ DYNAMIC_LIBS="" -+ X_DEVS="" -+]) -+ -+AC_SUBST(DYNAMIC_CFLAGS) -+AC_SUBST(DYNAMIC_DEVS) -+AC_SUBST(DYNAMIC_FLAGS) -+AC_SUBST(DYNAMIC_LDFLAGS) -+AC_SUBST(DYNAMIC_LIBS) -+AC_SUBST(INSTALL_SHARED) -+ - dnl -------------------------------------------------- - dnl Check for library functions - dnl -------------------------------------------------- diff --git a/print/ghostscript7-x11/files/patch-src-devs.mak b/print/ghostscript7-x11/files/patch-src-devs.mak deleted file mode 100644 index 707b393b70dd..000000000000 --- a/print/ghostscript7-x11/files/patch-src-devs.mak +++ /dev/null @@ -1,65 +0,0 @@ ---- src/devs.mak.orig 2015-08-21 21:59:44.117097000 +0900 -+++ src/devs.mak 2015-08-21 22:02:19.960434000 +0900 -@@ -405,7 +405,7 @@ - $(ADDMOD) $(DD)lvga256 -lib vga vgagl - - $(GLOBJ)gdevl256.$(OBJ) : $(GLSRC)gdevl256.c $(GDEV) $(memory__h) -- $(GLCC) $(GLO_)gdevl256.$(OBJ) $(C_) $(GLSRC)gdevl256.c -+ $(GLCCSHARED) $(GLO_)gdevl256.$(OBJ) $(C_) $(GLSRC)gdevl256.c - - vgalib_=$(GLOBJ)gdevvglb.$(OBJ) $(GLOBJ)gdevpccm.$(OBJ) - $(DD)vgalib.dev : $(DEVS_MAK) $(vgalib_) -@@ -413,7 +413,7 @@ - $(ADDMOD) $(DD)vgalib -lib vga - - $(GLOBJ)gdevvglb.$(OBJ) : $(GLSRC)gdevvglb.c $(GDEV) $(gdevpccm_h) $(gsparam_h) -- $(GLCC) $(GLO_)gdevvglb.$(OBJ) $(C_) $(GLSRC)gdevvglb.c -+ $(GLCCSHARED) $(GLO_)gdevvglb.$(OBJ) $(C_) $(GLSRC)gdevvglb.c - - ### -------------------------- The X11 device -------------------------- ### - -@@ -443,24 +443,24 @@ - $(GLOBJ)gdevx.$(OBJ) : $(GLSRC)gdevx.c $(GDEVX) $(math__h) $(memory__h)\ - $(gscoord_h) $(gsdevice_h) $(gsiparm2_h) $(gsmatrix_h) $(gsparam_h)\ - $(gxdevmem_h) $(gxgetbit_h) $(gxiparam_h) $(gxpath_h) -- $(GLCC) $(XINCLUDE) $(GLO_)gdevx.$(OBJ) $(C_) $(GLSRC)gdevx.c -+ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevx.$(OBJ) $(C_) $(GLSRC)gdevx.c - - $(GLOBJ)gdevxcmp.$(OBJ) : $(GLSRC)gdevxcmp.c $(GDEVX) $(math__h) -- $(GLCC) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c -+ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c - - $(GLOBJ)gdevxini.$(OBJ) : $(GLSRC)gdevxini.c $(GDEVX) $(memory__h)\ - $(gserrors_h) $(gsparamx_h) $(gxdevmem_h) $(gdevbbox_h) -- $(GLCC) $(XINCLUDE) $(GLO_)gdevxini.$(OBJ) $(C_) $(GLSRC)gdevxini.c -+ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxini.$(OBJ) $(C_) $(GLSRC)gdevxini.c - - # We have to compile gdevxres without warnings, because there is a - # const/non-const cast required by the X headers that we can't work around. - $(GLOBJ)gdevxres.$(OBJ) : $(GLSRC)gdevxres.c $(std_h) $(x__h)\ - $(gsmemory_h) $(gstypes_h) $(gxdevice_h) $(gdevx_h) -- $(CC_NO_WARN) $(GLCCFLAGS) $(XINCLUDE) $(GLO_)gdevxres.$(OBJ) $(C_) $(GLSRC)gdevxres.c -+ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxres.$(OBJ) $(C_) $(GLSRC)gdevxres.c - - $(GLOBJ)gdevxxf.$(OBJ) : $(GLSRC)gdevxxf.c $(GDEVX) $(math__h) $(memory__h)\ - $(gsstruct_h) $(gsutil_h) $(gxxfont_h) -- $(GLCC) $(XINCLUDE) $(GLO_)gdevxxf.$(OBJ) $(C_) $(GLSRC)gdevxxf.c -+ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxxf.$(OBJ) $(C_) $(GLSRC)gdevxxf.c - - # Alternate X11-based devices to help debug other drivers. - # x11alpha pretends to have 4 bits of alpha channel. -@@ -510,7 +510,13 @@ - - $(GLOBJ)gdevxalt.$(OBJ) : $(GLSRC)gdevxalt.c $(GDEVX) $(math__h) $(memory__h)\ - $(gsdevice_h) $(gsparam_h) $(gsstruct_h) -- $(GLCC) $(XINCLUDE) $(GLO_)gdevxalt.$(OBJ) $(C_) $(GLSRC)gdevxalt.c -+ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxalt.$(OBJ) $(C_) $(GLSRC)gdevxalt.c -+ -+### Shared library object supporting X11. -+### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT -+ -+$(GLOBJ)X11.so : $(x11alt_) $(x11_) -+ $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)X11.so $(x11alt_) $(x11_) -L${LOCALBASE}/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS) - - ###### --------------- Memory-buffered printer devices --------------- ###### - diff --git a/print/ghostscript7-x11/files/patch-src-gconf.c b/print/ghostscript7-x11/files/patch-src-gconf.c deleted file mode 100644 index 4afa18c6e024..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gconf.c +++ /dev/null @@ -1,43 +0,0 @@ ---- src/gconf.c.orig 2003-01-17 09:49:00.000000000 +0900 -+++ src/gconf.c 2015-08-22 01:52:10.741824000 +0900 -@@ -81,7 +81,8 @@ - /* Set up the device table. */ - #define device_(dev) (const gx_device *)&dev, - #define device2_(dev) &dev, --private const gx_device *const gx_device_list[] = { -+static const gx_device *gx_device_list[1024] = { -+ /* as shared library are adding drivers here, so removed constness */ - #include "gconf.h" - 0 - }; -@@ -149,9 +150,29 @@ - gs_lib_device_list(const gx_device * const **plist, - gs_memory_struct_type_t ** pst) - { -+ int i; -+ - if (plist != 0) - *plist = gx_device_list; - if (pst != 0) - *pst = NULL; -- return countof(gx_device_list) - 1; -+ -+ for (i = 0; i < countof(gx_device_list) - 1; ++i) -+ if (!gx_device_list[i]) -+ break; -+ return i; - } -+ -+#ifdef GS_DEVS_SHARED -+void -+gs_lib_register_device(const gx_device *dev) -+{ -+ int i; -+ -+ for (i = 0; i < countof(gx_device_list) - 1; ++i) -+ if (!gx_device_list[i]) { -+ gx_device_list[i] = dev; -+ return; -+ } -+} -+#endif diff --git a/print/ghostscript7-x11/files/patch-src-gdevijs.c b/print/ghostscript7-x11/files/patch-src-gdevijs.c deleted file mode 100644 index fed73ce2599f..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gdevijs.c +++ /dev/null @@ -1,659 +0,0 @@ ---- src/gdevijs.c.orig Fri Jan 17 09:49:00 2003 -+++ src/gdevijs.c Thu May 26 01:00:57 2005 -@@ -29,15 +29,29 @@ - * which is a security risk, since any program can be run. - * You should use -dSAFER which sets .LockSafetyParams to true - * before opening this device. -+ * -+ * 11/26/03 David Suffield -+ * (c) 2003-2004 Copyright Hewlett-Packard Development Company, LP -+ * -+ * 1. Removed hpijs 1.0-1.0.2 workarounds, use hpijs 1.0.3 or higher. -+ * 2. Added krgb support. -+ * -+ * 02/21/05 David Suffield -+ * 1. Fixed segfault issue with 1-bit color space. -+ * 2. Fixed z-order issue with colored text on black rectangle. -+ * - */ - - #include "unistd_.h" /* for dup() */ - #include -+#include - #include "gdevprn.h" - #include "gp.h" - #include "ijs.h" - #include "ijs_client.h" - -+//#define KRGB_DEBUG -+ - /* This should go into gdevprn.h, or, better yet, gdevprn should - acquire an API for changing resolution. */ - int gdev_prn_maybe_realloc_memory(gx_device_printer *pdev, -@@ -53,6 +67,14 @@ - private dev_proc_get_params(gsijs_get_params); - private dev_proc_put_params(gsijs_put_params); - -+/* Following definitions are for krgb support. */ -+private dev_proc_create_buf_device(gsijs_create_buf_device); -+private dev_proc_fill_rectangle(gsijs_fill_rectangle); -+private dev_proc_copy_mono(gsijs_copy_mono); -+private dev_proc_fill_mask(gsijs_fill_mask); -+private dev_proc_fill_path(gsijs_fill_path); -+private dev_proc_stroke_path(gsijs_stroke_path); -+ - private const gx_device_procs gsijs_procs = - prn_color_params_procs(gsijs_open, gsijs_output_page, gsijs_close, - gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb, -@@ -85,6 +107,14 @@ - - IjsClientCtx *ctx; - int ijs_version; -+ -+ /* Additional parameters for krgb support. */ -+ int krgb_mode; /* 0=false, 1=true */ -+ int k_path; /* k plane path, 0=false, 1=true */ -+ int k_width; /* k plane width in pixels */ -+ int k_band_size; /* k plane buffer size in bytes, byte aligned */ -+ unsigned char *k_band; /* k plane buffer */ -+ gx_device_procs prn_procs; /* banding playback procedures */ - }; - - #define DEFAULT_DPI 74 /* See gsijs_set_resolution() below. */ -@@ -112,7 +142,12 @@ - FALSE, /* Tumble_set */ - - NULL, /* IjsClient *ctx */ -- 0 /* ijs_version */ -+ 0, /* ijs_version */ -+ 0, /* krgb_mode */ -+ 0, /* k_path */ -+ 0, /* k_width */ -+ 0, /* k_band_size */ -+ NULL /* k_band buffer */ - }; - - -@@ -128,12 +163,254 @@ - - /**************************************************************************/ - --/* ------ Private definitions ------ */ -+/* ---------------- Low-level graphic procedures ---------------- */ -+ -+static unsigned char xmask[] = -+{ -+ 0x80, /* x=0 */ -+ 0x40, /* 1 */ -+ 0x20, /* 2 */ -+ 0x10, /* 3 */ -+ 0x08, /* 4 */ -+ 0x04, /* 5 */ -+ 0x02, /* 6 */ -+ 0x01 /* 7 */ -+}; -+ -+private int gsijs_fill_rectangle(gx_device * dev, int x, int y, int w, int h, -+ gx_color_index color) -+{ -+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; -+ -+ if (ijsdev->krgb_mode && ijsdev->k_path && y >= 0 && x >= 0) -+ { -+ int raster = (ijsdev->k_width+7) >> 3; -+ register unsigned char *dest=ijsdev->k_band+(raster*y)+(x >> 3); -+ int dest_start_bit = x & 7; -+ int i,j,w1; -+ -+ if (h <= 0 || w <= 0) -+ return 0; -+ -+ if ((x+w) > ijsdev->k_width) -+ w1 = ijsdev->k_width - x; -+ else -+ w1 = w; -+ -+ /* Note x,y orgin 0,0 is stored first byte 0 left to right. */ -+ -+ if (color==0x0) -+ { -+ /* Color is black, store in k plane band instead of regular band. */ -+ for (j=0; j>3] |= xmask[(dest_start_bit+i)&7]; -+ dest+=raster; -+ } -+ return 0; -+ } -+ else -+ { -+ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */ -+ for (j=0; j>3] &= ~xmask[(dest_start_bit+i)&7]; -+ dest+=raster; -+ } -+ } -+ } -+ -+ return (*ijsdev->prn_procs.fill_rectangle)(dev, x, y, w, h, color); -+} -+ -+private int gsijs_copy_mono(gx_device * dev, const byte * data, -+ int dx, int draster, gx_bitmap_id id, -+ int x, int y, int w, int height, gx_color_index zero, gx_color_index one) -+{ -+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; -+ -+ // if (ijsdev->krgb_mode && ijsdev->k_path && one==0x0) -+ if (ijsdev->krgb_mode && ijsdev->k_path) -+ { -+ /* Store in k plane band instead of regular band. */ -+ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */ -+ register unsigned char *dest=ijsdev->k_band+(raster*y)+(x >> 3); -+ register const unsigned char *scan=data+(dx >> 3); -+ int dest_start_bit = x & 7; -+ int scan_start_bit = dx & 7; -+ int i, h=height; -+ -+ if (h <= 0 || w <= 0) -+ return 0; -+ -+ if (one==0x0) -+ { -+ /* Color is black, store in k plane band instead of regular band. */ -+ while (h-- > 0) -+ { -+ for (i=0; i>3] & xmask[(scan_start_bit+i)&7]) -+ dest[(dest_start_bit+i)>>3] |= xmask[(dest_start_bit+i)&7]; -+ } -+ scan+=draster; -+ dest+=raster; -+ } -+ return 0; -+ } -+ else -+ { -+ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */ -+ while (h-- > 0) -+ { -+ for (i=0; i>3] & xmask[(scan_start_bit+i)&7]) -+ dest[(dest_start_bit+i)>>3] &= ~xmask[(dest_start_bit+i)&7]; -+ } -+ scan+=draster; -+ dest+=raster; -+ } -+ } -+ } -+ -+ return (*ijsdev->prn_procs.copy_mono)(dev, data, dx, draster, id, x, y, w, height, zero, one); -+} -+ -+/* ---------------- High-level graphic procedures ---------------- */ -+ -+private int gsijs_fill_mask(gx_device * dev, -+ const byte * data, int dx, int raster, gx_bitmap_id id, -+ int x, int y, int w, int h, -+ const gx_drawing_color * pdcolor, int depth, -+ gs_logical_operation_t lop, const gx_clip_path * pcpath) -+{ -+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; -+ int code; -+ -+ ijsdev->k_path = 1; -+ -+ code = (*ijsdev->prn_procs.fill_mask)(dev, data, dx, raster, id, x, y, w, h, pdcolor, depth, lop, pcpath); -+ -+ ijsdev->k_path = 0; -+ -+ return code; -+} -+ -+private int gsijs_fill_path(gx_device * dev, const gs_imager_state * pis, -+ gx_path * ppath, const gx_fill_params * params, -+ const gx_drawing_color * pdcolor, -+ const gx_clip_path * pcpath) -+{ -+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; -+ int code; -+ -+ ijsdev->k_path = 1; -+ -+ code = (*ijsdev->prn_procs.fill_path)(dev, pis, ppath, params, pdcolor, pcpath); -+ -+ ijsdev->k_path = 0; -+ -+ return 0; -+} -+ -+private int gsijs_stroke_path(gx_device * dev, const gs_imager_state * pis, -+ gx_path * ppath, const gx_stroke_params * params, -+ const gx_drawing_color * pdcolor, -+ const gx_clip_path * pcpath) -+{ -+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; -+ int code; -+ -+ ijsdev->k_path = 1; - --/* Versions 1.0 through 1.0.2 of hpijs report IJS version 0.29, and -- require some workarounds. When more up-to-date hpijs versions -- become ubiquitous, all these workarounds should be removed. */ --#define HPIJS_1_0_VERSION 29 -+ code = (*ijsdev->prn_procs.stroke_path)(dev, pis, ppath, params, pdcolor, pcpath); -+ -+ ijsdev->k_path = 0; -+ -+ return code; -+} -+ -+/* ---------------- krgb banding playback procedures ---------------- */ -+ -+private int gsijs_get_bits(gx_device_printer * pdev, int y, byte * str, byte ** actual_data) -+{ -+ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev; -+ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev; -+ int band_height = cdev->page_info.band_params.BandHeight; -+ int band_number = y/band_height; -+ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */ -+ int y1=raster*(y-(band_height*band_number)); -+ -+ if (y1 == 0) -+ { -+ /* First raster for band, clear k_band. Banding playback occurs on first raster. */ -+ memset(ijsdev->k_band, 0, ijsdev->k_band_size); -+ } -+ -+ return gdev_prn_get_bits(pdev, y, str, actual_data); /* get raster from regular band */ -+} -+ -+private int gsijs_k_get_bits(gx_device_printer * pdev, int y, byte ** actual_data) -+{ -+ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev; -+ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev; -+ int band_height = cdev->page_info.band_params.BandHeight; -+ int band_number = y/band_height; -+ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */ -+ int y1=raster*(y-(band_height*band_number)); -+ -+ *actual_data = ijsdev->k_band+y1; -+ -+ return 0; -+} -+ -+private int gsijs_create_buf_device(gx_device **pbdev, gx_device *target, -+ const gx_render_plane_t *render_plane, gs_memory_t *mem, bool for_band) -+{ -+ gx_device_ijs *ijsdev = (gx_device_ijs *)target; -+ int n_chan = ijsdev->color_info.num_components; -+ int code = gx_default_create_buf_device(pbdev, target, render_plane, mem, for_band); -+ if (code < 0 || n_chan != 3) -+ return code; -+ -+ /* Save buffer (vector) procedures so that we can hook them during banding playback. */ -+ ijsdev->prn_procs = (*pbdev)->procs; -+ -+ /* Replace buffer procedures with krgb procedures. */ -+ set_dev_proc(*pbdev, fill_rectangle, gsijs_fill_rectangle); -+ set_dev_proc(*pbdev, copy_mono, gsijs_copy_mono); -+ set_dev_proc(*pbdev, fill_mask, gsijs_fill_mask); -+ set_dev_proc(*pbdev, fill_path, gsijs_fill_path); -+ set_dev_proc(*pbdev, stroke_path, gsijs_stroke_path); -+ -+ return code; -+} -+ -+/* See if IJS server supports krgb. Return value: 0=false, 1=true. */ -+private int -+gsijs_set_krgb_mode(gx_device_ijs *ijsdev) -+{ -+ char buf[256]; -+ int n_chan = ijsdev->color_info.num_components; -+ int code; -+ -+ if (n_chan != 3) -+ return 0; /* no krgb support, not RGB colorspace */ -+ -+ buf[0] = 0; -+ code = ijs_client_enum_param(ijsdev->ctx, 0, "ColorSpace", buf, sizeof(buf)-1); -+ if (code >= 0) -+ buf[code] = 0; -+ if (strstr(buf, "KRGB") == NULL) -+ return 0; /* no krgb support */ -+ -+ return 1; /* krgb is supported */ -+} -+ -+/* ------ Private definitions ------ */ - - private int - gsijs_parse_wxh (const char *val, int size, double *pw, double *ph) -@@ -171,34 +448,6 @@ - } - - /** -- * gsijs_set_generic_params_hpijs: Set generic IJS parameters. -- * -- * This version is specialized for hpijs 1.0 through 1.0.2, and -- * accommodates a number of quirks. -- **/ --private int --gsijs_set_generic_params_hpijs(gx_device_ijs *ijsdev) --{ -- char buf[256]; -- int code = 0; -- -- /* IjsParams, Duplex, and Tumble get set at this point because -- they may affect margins. */ -- if (ijsdev->IjsParams) { -- code = gsijs_client_set_param(ijsdev, "IjsParams", ijsdev->IjsParams); -- } -- -- if (code == 0 && ijsdev->Duplex_set) { -- int duplex_val; -- -- duplex_val = ijsdev->Duplex ? (ijsdev->IjsTumble ? 1 : 2) : 0; -- sprintf (buf, "%d", duplex_val); -- code = gsijs_client_set_param(ijsdev, "Duplex", buf); -- } -- return code; --} -- --/** - * gsijs_set_generic_params: Set generic IJS parameters. - **/ - private int -@@ -209,9 +458,6 @@ - int i, j; - char *value; - -- if (ijsdev->ijs_version == HPIJS_1_0_VERSION) -- return gsijs_set_generic_params_hpijs(ijsdev); -- - /* Split IjsParams into separate parameters and send to ijs server */ - value = NULL; - for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) { -@@ -252,68 +498,6 @@ - } - - /** -- * gsijs_set_margin_params_hpijs: Do margin negotiation with IJS server. -- * -- * This version is specialized for hpijs 1.0 through 1.0.2, and -- * accommodates a number of quirks. -- **/ --private int --gsijs_set_margin_params_hpijs(gx_device_ijs *ijsdev) --{ -- char buf[256]; -- int code = 0; -- -- if (code == 0) { -- sprintf(buf, "%d", ijsdev->width); -- code = gsijs_client_set_param(ijsdev, "Width", buf); -- } -- if (code == 0) { -- sprintf(buf, "%d", ijsdev->height); -- code = gsijs_client_set_param(ijsdev, "Height", buf); -- } -- -- if (code == 0) { -- double printable_width, printable_height; -- double printable_left, printable_top; -- float m[4]; -- -- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableArea", -- buf, sizeof(buf)); -- if (code == IJS_EUNKPARAM) -- /* IJS server doesn't support margin negotiations. -- That's ok. */ -- return 0; -- else if (code >= 0) { -- code = gsijs_parse_wxh(buf, code, -- &printable_width, &printable_height); -- } -- -- if (code == 0) { -- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableTopLeft", -- buf, sizeof(buf)); -- if (code == IJS_EUNKPARAM) -- return 0; -- else if (code >= 0) { -- code = gsijs_parse_wxh(buf, code, -- &printable_left, &printable_top); -- } -- } -- -- if (code == 0) { -- m[0] = printable_left; -- m[1] = ijsdev->MediaSize[1] * (1.0 / 72) - -- printable_top - printable_height; -- m[2] = ijsdev->MediaSize[0] * (1.0 / 72) - -- printable_left - printable_width; -- m[3] = printable_top; -- gx_device_set_margins((gx_device *)ijsdev, m, true); -- } -- } -- -- return code; --} -- --/** - * gsijs_set_margin_params: Do margin negotiation with IJS server. - **/ - private int -@@ -324,9 +508,6 @@ - int i, j; - char *value; - -- if (ijsdev->ijs_version == HPIJS_1_0_VERSION) -- return gsijs_set_margin_params_hpijs(ijsdev); -- - /* Split IjsParams into separate parameters and send to ijs server */ - value = NULL; - for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) { -@@ -493,12 +674,18 @@ - char buf[256]; - bool use_outputfd; - int fd = -1; -+ long max_bitmap = ijsdev->space_params.MaxBitmap; - - if (strlen(ijsdev->IjsServer) == 0) { - eprintf("ijs server not specified\n"); - return gs_note_error(gs_error_ioerror); - } - -+ ijsdev->space_params.MaxBitmap = 0; /* force banding */ -+ -+ /* Set create_buf_device in printer device, so that we can hook the banding playback procedures. */ -+ ijsdev->printer_procs.buf_procs.create_buf_device = gsijs_create_buf_device; -+ - /* Decide whether to use OutputFile or OutputFD. Note: how to - determine this is a tricky question, so we just allow the - user to set it. -@@ -513,6 +700,8 @@ - if (code < 0) - return code; - -+ ijsdev->space_params.MaxBitmap = max_bitmap; -+ - if (use_outputfd) { - /* Note: dup() may not be portable to all interesting IJS - platforms. In that case, this branch should be #ifdef'ed out. -@@ -572,6 +761,9 @@ - if (code >= 0) - code = gsijs_set_margin_params(ijsdev); - -+ if (code >= 0) -+ ijsdev->krgb_mode = gsijs_set_krgb_mode(ijsdev); -+ - return code; - }; - -@@ -631,21 +823,6 @@ - return min(width, end); - } - --private int ijs_all_white(unsigned char *data, int size) --{ -- int clean = 1; -- int i; -- for (i = 0; i < size; i++) -- { -- if (data[i] != 0xFF) -- { -- clean = 0; -- break; -- } -- } -- return clean; --} -- - /* Print a page. Don't use normal printer gdev_prn_output_page - * because it opens the output file. - */ -@@ -656,8 +833,9 @@ - gx_device_printer *pdev = (gx_device_printer *)dev; - int raster = gdev_prn_raster(pdev); - int ijs_width, ijs_height; -- int row_bytes; -+ int row_bytes, k_row_bytes=0; - int n_chan = pdev->color_info.num_components; -+ int krgb_mode = ijsdev->krgb_mode; - unsigned char *data; - char buf[256]; - double xres = pdev->HWResolution[0]; -@@ -673,13 +851,23 @@ - - /* Determine bitmap width and height */ - ijs_height = gdev_prn_print_scan_lines(dev); -- if (ijsdev->ijs_version == HPIJS_1_0_VERSION) { -- ijs_width = pdev->width; -- } else { - ijs_width = gsijs_raster_width(dev); -- } -+ - row_bytes = (ijs_width * pdev->color_info.depth + 7) >> 3; - -+ if (krgb_mode) -+ { -+ gx_device_clist_common *cdev = (gx_device_clist_common *)dev; -+ int band_height = cdev->page_info.band_params.BandHeight; -+ k_row_bytes = (ijs_width + 7) >> 3; -+ -+ /* Create banding buffer for k plane. */ -+ ijsdev->k_width = ijs_width; -+ ijsdev->k_band_size = band_height * k_row_bytes; -+ if ((ijsdev->k_band = gs_malloc(ijsdev->k_band_size, 1, "gsijs_output_page")) == (unsigned char *)NULL) -+ return gs_note_error(gs_error_VMerror); -+ } -+ - /* Required page parameters */ - sprintf(buf, "%d", n_chan); - gsijs_client_set_param(ijsdev, "NumChan", buf); -@@ -688,44 +876,71 @@ - - /* This needs to become more sophisticated for DeviceN. */ - strcpy(buf, (n_chan == 4) ? "DeviceCMYK" : -- ((n_chan == 3) ? "DeviceRGB" : "DeviceGray")); -+ ((n_chan == 3) ? (krgb_mode ? "KRGB" : "DeviceRGB") : "DeviceGray")); - gsijs_client_set_param(ijsdev, "ColorSpace", buf); - -- /* If hpijs 1.0, don't set width and height here, because it -- expects them to be the paper size. */ -- if (ijsdev->ijs_version != HPIJS_1_0_VERSION) { -- sprintf(buf, "%d", ijs_width); -- gsijs_client_set_param(ijsdev, "Width", buf); -- sprintf(buf, "%d", ijs_height); -- gsijs_client_set_param(ijsdev, "Height", buf); -- } -+ sprintf(buf, "%d", ijs_width); -+ gsijs_client_set_param(ijsdev, "Width", buf); -+ sprintf(buf, "%d", ijs_height); -+ gsijs_client_set_param(ijsdev, "Height", buf); - - sprintf(buf, "%gx%g", xres, yres); - gsijs_client_set_param(ijsdev, "Dpi", buf); - -+#ifdef KRGB_DEBUG -+ int kfd, rgbfd; -+ char sz[128]; -+ kfd = open("/tmp/k.pbm", O_CREAT | O_TRUNC | O_RDWR, 0644); -+ rgbfd = open("/tmp/rgb.ppm", O_CREAT | O_TRUNC | O_RDWR, 0644); -+ snprintf(sz, sizeof(sz), "P4\n#gdevijs test\n%d\n%d\n", ijs_width, ijs_height); -+ write(kfd, sz, strlen(sz)); -+ snprintf(sz, sizeof(sz), "P6\n#gdevijs test\n%d\n%d\n255\n", ijs_width, ijs_height); -+ write(rgbfd, sz, strlen(sz)); -+#endif -+ - for (i=0; ictx, IJS_CMD_BEGIN_PAGE); - status = ijs_client_send_cmd_wait(ijsdev->ctx); - - for (y = 0; y < ijs_height; y++) { -- code = gdev_prn_get_bits(pdev, y, data, &actual_data); -- if (code < 0) -- break; -+ if (krgb_mode) -+ code = gsijs_get_bits(pdev, y, data, &actual_data); -+ else -+ code = gdev_prn_get_bits(pdev, y, data, &actual_data); -+ if (code < 0) -+ break; -+#ifdef KRGB_DEBUG -+ write(rgbfd, actual_data, row_bytes); -+#endif -+ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, row_bytes); -+ if (status) -+ break; - -- if (ijsdev->ijs_version == HPIJS_1_0_VERSION && -- ijs_all_white(actual_data, row_bytes)) -- status = ijs_client_send_data_wait(ijsdev->ctx, 0, NULL, 0); -- else -- status = ijs_client_send_data_wait(ijsdev->ctx, 0, -- (char *)actual_data, row_bytes); -- if (status) -- break; -+ if (krgb_mode) { -+ code = gsijs_k_get_bits(pdev, y, &actual_data); -+ if (code < 0) -+ break; -+#ifdef KRGB_DEBUG -+ write(kfd, actual_data, k_row_bytes); -+#endif -+ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, k_row_bytes); -+ if (status) -+ break; -+ } - } - ijs_client_begin_cmd(ijsdev->ctx, IJS_CMD_END_PAGE); - status = ijs_client_send_cmd_wait(ijsdev->ctx); - } - -+#ifdef KRGB_DEBUG -+ close(kfd); -+ close(rgbfd); -+#endif -+ -+ if(krgb_mode) -+ gs_free(ijsdev->k_band, ijsdev->k_band_size, 1, "gsijs_output_page"); -+ - gs_free_object(pdev->memory, data, "gsijs_output_page"); - - endcode = (pdev->buffer_space && !pdev->is_async_renderer ? -@@ -1029,7 +1244,6 @@ - dprintf2("ijs: Can't set parameter %s=%s\n", key, value); - return code; - } -- - - private int - gsijs_set_color_format(gx_device_ijs *ijsdev) diff --git a/print/ghostscript7-x11/files/patch-src-gdevl256.c b/print/ghostscript7-x11/files/patch-src-gdevl256.c deleted file mode 100644 index e11d19f8c2d6..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gdevl256.c +++ /dev/null @@ -1,15 +0,0 @@ ---- src/gdevl256.c.orig 2015-08-22 01:40:41.895138000 +0900 -+++ src/gdevl256.c 2015-08-22 01:40:56.016022000 +0900 -@@ -307,3 +307,12 @@ - gl_line(x0, y0, x1, y1, color); - return 0; - } -+ -+#ifdef GS_DEVS_SHARED -+extern void gs_lib_register_device(const gx_device *dev); -+void -+gs_shared_init(void) -+{ -+ gs_lib_register_device(&gs_lvga256_device); -+} -+#endif diff --git a/print/ghostscript7-x11/files/patch-src-gdevpng.c b/print/ghostscript7-x11/files/patch-src-gdevpng.c deleted file mode 100644 index 0bb66e2f046d..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gdevpng.c +++ /dev/null @@ -1,187 +0,0 @@ ---- src/gdevpng.c.orig 2003-05-15 19:05:29.000000000 +0900 -+++ src/gdevpng.c 2015-02-19 01:59:24.000000000 +0900 -@@ -41,12 +41,6 @@ - #include "gdevpccm.h" - #include "gscdefs.h" - --#define PNG_INTERNAL --/* -- * libpng versions 1.0.3 and later allow disabling access to the stdxxx -- * files while retaining support for FILE * I/O. -- */ --#define PNG_NO_CONSOLE_IO - /* - * Earlier libpng versions require disabling FILE * I/O altogether. - * This produces a compiler warning about no prototype for png_init_io. -@@ -258,7 +252,7 @@ - goto done; - } - /* set error handling */ -- if (setjmp(png_ptr->jmpbuf)) { -+ if (setjmp(png_jmpbuf(png_ptr))) { - /* If we get here, we had a problem reading the file */ - code = gs_note_error(gs_error_VMerror); - goto done; -@@ -268,19 +262,12 @@ - png_init_io(png_ptr, file); - - /* set the file information here */ -- info_ptr->width = pdev->width; -- info_ptr->height = pdev->height; -- /* resolution is in pixels per meter vs. dpi */ -- info_ptr->x_pixels_per_unit = -- (png_uint_32) (pdev->HWResolution[0] * (100.0 / 2.54)); -- info_ptr->y_pixels_per_unit = -- (png_uint_32) (pdev->HWResolution[1] * (100.0 / 2.54)); -- info_ptr->phys_unit_type = PNG_RESOLUTION_METER; -- info_ptr->valid |= PNG_INFO_pHYs; - switch (depth) { - case 32: -- info_ptr->bit_depth = 8; -- info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; -+ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, -+ 8, PNG_COLOR_TYPE_RGB_ALPHA, -+ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, -+ PNG_FILTER_TYPE_DEFAULT); - png_set_invert_alpha(png_ptr); - { gx_device_pngalpha *ppdev = (gx_device_pngalpha *)pdev; - png_color_16 background; -@@ -292,51 +279,68 @@ - png_set_bKGD(png_ptr, info_ptr, &background); - } - break; -+ case 48: -+ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, -+ 16, PNG_COLOR_TYPE_RGB, -+ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, -+ PNG_FILTER_TYPE_DEFAULT); -+#if defined(ARCH_IS_BIG_ENDIAN) && (!ARCH_IS_BIG_ENDIAN) -+ png_set_swap(png_ptr); -+#endif -+ break; - case 24: -- info_ptr->bit_depth = 8; -- info_ptr->color_type = PNG_COLOR_TYPE_RGB; -+ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, -+ 8, PNG_COLOR_TYPE_RGB, -+ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, -+ PNG_FILTER_TYPE_DEFAULT); - break; - case 8: -- info_ptr->bit_depth = 8; -- if (gx_device_has_color(pdev)) -- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; -- else -- info_ptr->color_type = PNG_COLOR_TYPE_GRAY; -+ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, -+ 8, gx_device_has_color(pdev) ? -+ PNG_COLOR_TYPE_PALETTE : PNG_COLOR_TYPE_GRAY, -+ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, -+ PNG_FILTER_TYPE_DEFAULT); - break; - case 4: -- info_ptr->bit_depth = 4; -- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; -+ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, -+ 4, PNG_COLOR_TYPE_PALETTE, -+ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, -+ PNG_FILTER_TYPE_DEFAULT); - break; - case 1: -- info_ptr->bit_depth = 1; -- info_ptr->color_type = PNG_COLOR_TYPE_GRAY; -+ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, -+ 1, PNG_COLOR_TYPE_PALETTE, -+ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, -+ PNG_FILTER_TYPE_DEFAULT); - /* invert monocrome pixels */ - png_set_invert_mono(png_ptr); - break; - } - -+ /* resolution is in pixels per meter vs. dpi */ -+ png_set_pHYs(png_ptr, info_ptr, -+ (png_uint_32) (pdev->HWResolution[0] * (100.0 / 2.54)), -+ (png_uint_32) (pdev->HWResolution[1] * (100.0 / 2.54)), -+ PNG_RESOLUTION_METER); -+ - /* set the palette if there is one */ -- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { -+ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) { - int i; - int num_colors = 1 << depth; - gx_color_value rgb[3]; -+ png_color palette[256]; -+ -+ if (num_colors > 256) -+ num_colors = 256; - -- info_ptr->palette = -- (void *)gs_alloc_bytes(mem, 256 * sizeof(png_color), -- "png palette"); -- if (info_ptr->palette == 0) { -- code = gs_note_error(gs_error_VMerror); -- goto done; -- } -- info_ptr->num_palette = num_colors; -- info_ptr->valid |= PNG_INFO_PLTE; - for (i = 0; i < num_colors; i++) { - (*dev_proc(pdev, map_color_rgb)) ((gx_device *) pdev, - (gx_color_index) i, rgb); -- info_ptr->palette[i].red = gx_color_value_to_byte(rgb[0]); -- info_ptr->palette[i].green = gx_color_value_to_byte(rgb[1]); -- info_ptr->palette[i].blue = gx_color_value_to_byte(rgb[2]); -+ palette[i].red = gx_color_value_to_byte(rgb[0]); -+ palette[i].green = gx_color_value_to_byte(rgb[1]); -+ palette[i].blue = gx_color_value_to_byte(rgb[2]); - } -+ png_set_PLTE(png_ptr, info_ptr, palette, num_colors); - } - /* add comment */ - strncpy(software_key, "Software", sizeof(software_key)); -@@ -346,15 +350,16 @@ - text_png.key = software_key; - text_png.text = software_text; - text_png.text_length = strlen(software_text); -- info_ptr->text = &text_png; -- info_ptr->num_text = 1; -+ png_set_text(png_ptr, info_ptr, &text_png, 1); - - /* write the file information */ - png_write_info(png_ptr, info_ptr); - - /* don't write the comments twice */ -+#if 0 - info_ptr->num_text = 0; - info_ptr->text = NULL; -+#endif - - /* Write the contents of the image. */ - for (y = 0; y < height; y++) { -@@ -365,8 +370,10 @@ - /* write the rest of the file */ - png_write_end(png_ptr, info_ptr); - -+#if 0 - /* if you alloced the palette, free it here */ - gs_free_object(mem, info_ptr->palette, "png palette"); -+#endif - - done: - /* free the structures */ -@@ -376,6 +383,7 @@ - return code; - } - -+#if 0 - /* - * Patch around a static reference to a never-used procedure. - * This could be avoided if we were willing to edit pngconf.h to -@@ -393,6 +401,7 @@ - { - } - #endif -+#endif - - private int - pngalpha_open(gx_device * pdev) diff --git a/print/ghostscript7-x11/files/patch-src-gdevvglb.c b/print/ghostscript7-x11/files/patch-src-gdevvglb.c deleted file mode 100644 index bdacbfbbfca0..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gdevvglb.c +++ /dev/null @@ -1,15 +0,0 @@ ---- src/gdevvglb.c.orig 2015-08-22 01:41:20.966252000 +0900 -+++ src/gdevvglb.c 2015-08-22 01:41:35.725091000 +0900 -@@ -373,3 +373,12 @@ - } - return 0; - } -+ -+#ifdef GS_DEVS_SHARED -+extern void gs_lib_register_device(const gx_device *dev); -+void -+gs_shared_init(void) -+{ -+ gs_lib_register_device(&gs_vgalib_device); -+} -+#endif diff --git a/print/ghostscript7-x11/files/patch-src-gdevxalt.c b/print/ghostscript7-x11/files/patch-src-gdevxalt.c deleted file mode 100644 index 4d9a88b43fb4..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gdevxalt.c +++ /dev/null @@ -1,31 +0,0 @@ ---- src/gdevxalt.c.orig 2015-08-22 01:42:12.291619000 +0900 -+++ src/gdevxalt.c 2015-08-22 01:42:53.871222000 +0900 -@@ -30,6 +30,7 @@ - #include "gdevx.h" - - extern const gx_device_X gs_x11_device; -+extern const gx_device_X gs_x11alpha_device; - - /* - * Define a forwarding device with a cache for the first 16 colors, -@@ -957,3 +958,20 @@ - rgb[2] = ((color >> 11) & 0x3ff) * gx_max_color_value / 0x3ff; - return -1; - } -+ -+#ifdef GS_DEVS_SHARED -+extern void gs_lib_register_device(const gx_device *dev); -+void -+gs_shared_init(void) -+{ -+ gs_lib_register_device(&gs_x11_device); -+ gs_lib_register_device(&gs_x11alpha_device); -+ gs_lib_register_device(&gs_x11cmyk_device); -+ gs_lib_register_device(&gs_x11cmyk2_device); -+ gs_lib_register_device(&gs_x11cmyk4_device); -+ gs_lib_register_device(&gs_x11cmyk8_device); -+ gs_lib_register_device(&gs_x11gray2_device); -+ gs_lib_register_device(&gs_x11gray4_device); -+ gs_lib_register_device(&gs_x11mono_device); -+} -+#endif diff --git a/print/ghostscript7-x11/files/patch-src-gnudevs.mak b/print/ghostscript7-x11/files/patch-src-gnudevs.mak deleted file mode 100644 index d6e15432bf52..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gnudevs.mak +++ /dev/null @@ -1,67 +0,0 @@ ---- src/gnudevs.mak.orig 2003-02-10 03:12:48.000000000 +0900 -+++ src/gnudevs.mak 2015-08-22 00:20:45.754922000 +0900 -@@ -66,64 +66,6 @@ - $(DD)sxlcrt.dev : $(sxlcrt_) $(DD)page.dev - $(SETPDEV) $(DD)sxlcrt $(sxlcrt_) - -- --### -------------------- Gimp-Print (stp) driver -------------------### -- --# To include this driver add '$(DD)stp.dev' to your DEVICE_DEVS --# line and define 'STPLIB=gimpprint' in your top-level makefile. --# See http://gimp-print.sourceforge.net/ for more information. -- --stp_=$(GLOBJ)gdevstp.$(OBJ) -- --$(DD)stp.dev : $(stp_) $(DD)page.dev -- $(SETPDEV) $(DD)stp $(stp_) -- $(ADDMOD) $(DD)stp -lib $(STPLIB) -- --$(GLOBJ)gdevstp.$(OBJ) : $(GLSRC)gdevstp.c \ -- $(gdevprn_h) $(gdevpccm_h) $(gsparam_h) -- $(GLCC) $(GLO_)gdevstp.$(OBJ) $(C_) $(GLSRC)gdevstp.c -- -- --### -------------- cdj850 - HP 850c Driver under development ------------- ### -- --cdeskjet8_=$(GLOBJ)gdevcd8.$(OBJ) $(HPPCL) -- --# Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de) --# Printer: HP 670 --$(DD)cdj670.dev : $(cdeskjet8_) $(DD)page.dev -- $(SETPDEV2) $(DD)cdj670 $(cdeskjet8_) -- --# Author: Uli Wortmann (uliw@erdw.ethz.ch) --# Printer: HP 850 --$(DD)cdj850.dev : $(cdeskjet8_) $(DD)page.dev -- $(SETPDEV2) $(DD)cdj850 $(cdeskjet8_) -- --# Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de) --# Printer: HP 890 --$(DD)cdj890.dev : $(cdeskjet8_) $(DD)page.dev -- $(SETPDEV2) $(DD)cdj890 $(cdeskjet8_) -- --# Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de) --# Printer: HP 1600 --$(DD)cdj1600.dev : $(cdeskjet8_) $(DD)page.dev -- $(SETPDEV2) $(DD)cdj1600 $(cdeskjet8_) -- --$(GLOBJ)gdevcd8.$(OBJ) : $(GLSRC)gdevcd8.c $(PDEVH) $(math__h)\ -- $(gsparam_h) $(gxlum_h) $(gdevpcl_h) -- $(GLCC) $(GLO_)gdevcd8.$(OBJ) $(C_) $(GLSRC)gdevcd8.c -- --### -------------- cdj880 - HP 880c Driver under development ------------- ### --### Since this driver is in the development phase it is not distributed ### --### with Ghostscript, but is available from ### --### http://www.proaxis.com/~mgelhaus/linux/software/hp880c/hp880c.html ### -- --### NOTE: Depends on the presence of the cdj850 section above. ### -- --# Author: Matthew Gelhaus (mgelhaus@proaxis.com) --# Printer: HP 880c --$(DD)cdj880.dev : $(cdeskjet8_) $(DD)page.dev -- $(SETPDEV2) $(DD)cdj880 $(cdeskjet8_) -- - ### ------------- cdj970 - HP 970Cxi Driver under development ------------- ### - - cdeskjet9_=$(GLOBJ)gdevdj9.$(OBJ) $(HPPCL) diff --git a/print/ghostscript7-x11/files/patch-src-gp_unix.c b/print/ghostscript7-x11/files/patch-src-gp_unix.c deleted file mode 100644 index 85f56e3cc021..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gp_unix.c +++ /dev/null @@ -1,83 +0,0 @@ ---- src/gp_unix.c.orig 2003-01-17 09:49:02.000000000 +0900 -+++ src/gp_unix.c 2015-08-22 01:54:32.507486000 +0900 -@@ -41,11 +41,60 @@ - - #endif - -+#ifdef GS_DEVS_SHARED -+#ifndef GS_DEVS_SHARED_DIR -+# define GS_DEVS_SHARED_DIR "/usr/lib/ghostscript/7.07" -+#endif -+ -+/* -+ * use shared library for drivers, always load them when starting, this -+ * avoid too many modifications, and since it is supported only under linux -+ * and applied as a patch (preferable). -+ */ -+#include -+#include -+#include -+#include -+#include -+ -+void -+gp_init(void) -+{ -+ DIR* dir = NULL; -+ struct dirent* dirent; -+ char buff[PATH_MAX]; -+ char* pbuff; -+ void* handle; -+ void (*gs_shared_init)(void); -+ -+ dir = opendir(GS_DEVS_SHARED_DIR); -+ if (dir == 0) return; -+ -+ lprintf("DEBUG 2\n"); -+ -+ while ((dirent = readdir(dir)) != 0) { -+ snprintf(buff, sizeof(buff), "%s/%s", GS_DEVS_SHARED_DIR, dirent->d_name); -+ pbuff = buff + strlen(buff) - 3; -+ if (strcmp(pbuff, ".so") != 0) -+ continue; -+ handle = dlopen(buff, RTLD_NOW); -+ if (handle == NULL) -+ continue; -+ gs_shared_init = dlsym(handle, "gs_shared_init"); -+ if (gs_shared_init != NULL) -+ (*gs_shared_init)(); -+ } -+ lprintf("DEBUG 3\n"); -+ -+ closedir(dir); -+} -+#else - /* Do platform-dependent initialization. */ - void - gp_init(void) - { - } -+#endif - - /* Do platform-dependent cleanup. */ - void -@@ -57,6 +106,7 @@ - void - gp_do_exit(int exit_status) - { -+ exit(exit_status); - } - - /* ------ Miscellaneous ------ */ -@@ -67,7 +117,11 @@ - const char * - gp_strerror(int errnum) - { -+#ifdef HAVE_STRERROR -+ return strerror(errnum); -+#else - return NULL; -+#endif - } - - /* ------ Date and time ------ */ diff --git a/print/ghostscript7-x11/files/patch-src-gs.mak b/print/ghostscript7-x11/files/patch-src-gs.mak deleted file mode 100644 index a9ee54700595..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gs.mak +++ /dev/null @@ -1,19 +0,0 @@ ---- src/gs.mak.orig 2015-08-21 22:03:26.487964000 +0900 -+++ src/gs.mak 2015-08-21 22:04:09.624656000 +0900 -@@ -235,7 +235,7 @@ - gconfig_h=$(GLGENDIR)$(D)gconfxx.h - gconfigf_h=$(GLGENDIR)$(D)gconfxc.h - --all default : $(GS_XE) -+all default : $(GS_XE) $(GS_SHARED_OBJS) - $(NO_OP) - - # the distclean and maintainer-clean targets (if any) -@@ -248,6 +248,7 @@ - clean : mostlyclean - $(RM_) $(GSGEN)arch.h - $(RM_) $(GS_XE) -+ $(RM_) $(GS_SHARED_OBJS) - - #****** FOLLOWING IS WRONG, NEEDS TO BE PER-SUBSYSTEM ****** - mostlyclean : config-clean diff --git a/print/ghostscript7-x11/files/patch-src-gsalloc.c b/print/ghostscript7-x11/files/patch-src-gsalloc.c deleted file mode 100644 index 7c29a14eeada..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gsalloc.c +++ /dev/null @@ -1,11 +0,0 @@ ---- src/gsalloc.c.orig 2013-04-30 11:14:17.000000000 +0900 -+++ src/gsalloc.c 2013-04-30 11:14:34.000000000 +0900 -@@ -195,7 +195,7 @@ - iimem->large_size = ((chunk_size / 4) & -obj_align_mod) + 1; - iimem->is_controlled = false; - iimem->gc_status.vm_threshold = chunk_size * 3L; -- iimem->gc_status.max_vm = max_long; -+ iimem->gc_status.max_vm = 0x7fffffff; - iimem->gc_status.psignal = NULL; - iimem->gc_status.signal_value = 0; - iimem->gc_status.enabled = false; diff --git a/print/ghostscript7-x11/files/patch-src-gsmalloc.c b/print/ghostscript7-x11/files/patch-src-gsmalloc.c deleted file mode 100644 index 9b4d97da3844..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gsmalloc.c +++ /dev/null @@ -1,11 +0,0 @@ ---- src/gsmalloc.c.orig 2015-07-24 09:55:54.032137000 +0900 -+++ src/gsmalloc.c 2015-07-24 09:57:15.070246000 +0900 -@@ -170,7 +170,7 @@ - } else { - uint added = size + sizeof(gs_malloc_block_t); - -- if (mmem->limit - added < mmem->used) -+ if (added <= size || mmem->limit - added < mmem->used) - set_msg("exceeded limit"); - else if ((ptr = (byte *) malloc(added)) == 0) - set_msg("failed"); diff --git a/print/ghostscript7-x11/files/patch-src-gxclrast.c b/print/ghostscript7-x11/files/patch-src-gxclrast.c deleted file mode 100644 index 59d5053ad305..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gxclrast.c +++ /dev/null @@ -1,15 +0,0 @@ ---- src/gxclrast.c.orig 2013-04-30 09:13:13.000000000 +0900 -+++ src/gxclrast.c 2013-04-30 09:13:41.000000000 +0900 -@@ -87,10 +87,10 @@ - private long - cmd_get_w(const byte * p, const byte ** rp) - { -- long val = *p++ & 0x7f; -+ int val = *p++ & 0x7f; - int shift = 7; - -- for (; val += (long)(*p & 0x7f) << shift, *p++ > 0x7f; shift += 7); -+ for (; val += (int)(*p & 0x7f) << shift, *p++ > 0x7f; shift += 7); - *rp = p; - return val; - } diff --git a/print/ghostscript7-x11/files/patch-src-gxfixed.h b/print/ghostscript7-x11/files/patch-src-gxfixed.h deleted file mode 100644 index 0988ca612c9b..000000000000 --- a/print/ghostscript7-x11/files/patch-src-gxfixed.h +++ /dev/null @@ -1,46 +0,0 @@ ---- src/gxfixed.h.orig 2013-04-30 11:29:39.000000000 +0900 -+++ src/gxfixed.h 2013-04-30 11:31:03.000000000 +0900 -@@ -27,12 +27,22 @@ - * quantities: integers lose accuracy in crucial places, - * and floating point arithmetic is slow. - */ --typedef long fixed; --typedef ulong ufixed; /* only used in a very few places */ --#define ARCH_SIZEOF_FIXED ARCH_SIZEOF_LONG -+#if ARCH_SIZEOF_INT == 4 -+typedef int fixed; -+typedef uint ufixed; /* only used in a very few places */ -+# define ARCH_SIZEOF_FIXED ARCH_SIZEOF_INT -+# define max_fixed max_int -+# define min_fixed min_int -+#else -+# if ARCH_SIZEOF_LONG == 4 -+ typedef long fixed; -+ typedef ulong ufixed; /* only used in a very few places */ -+# define ARCH_SIZEOF_FIXED ARCH_SIZEOF_LONG -+# define max_fixed max_long -+# define min_fixed min_long -+# endif -+#endif - --#define max_fixed max_long --#define min_fixed min_long - #define fixed_0 0L - #define fixed_epsilon 1L - /* -@@ -120,13 +130,8 @@ - #define fixed_truncated(x) ((x) < 0 ? fixed_ceiling(x) : fixed_floor(x)) - - /* Define the largest and smallest integer values that fit in a fixed. */ --#if arch_sizeof_int == arch_sizeof_long --# define max_int_in_fixed fixed2int(max_fixed) --# define min_int_in_fixed fixed2int(min_fixed) --#else --# define max_int_in_fixed max_int --# define min_int_in_fixed min_int --#endif -+#define max_int_in_fixed fixed2int(max_fixed) -+#define min_int_in_fixed fixed2int(min_fixed) - - #ifdef USE_FPU - # define USE_FPU_FIXED (USE_FPU < 0 && arch_floats_are_IEEE && arch_sizeof_long == 4) diff --git a/print/ghostscript7-x11/files/patch-src-ibnum.c b/print/ghostscript7-x11/files/patch-src-ibnum.c deleted file mode 100644 index 2df0a7d138c7..000000000000 --- a/print/ghostscript7-x11/files/patch-src-ibnum.c +++ /dev/null @@ -1,49 +0,0 @@ ---- src/ibnum.c.orig 2003-01-17 09:49:04.000000000 +0900 -+++ src/ibnum.c 2013-04-30 11:18:27.000000000 +0900 -@@ -124,11 +124,11 @@ - case num_int32: - case num_int32 + 16: - if ((format & 31) == 0) { -- np->value.intval = sdecodelong(str, format); -+ np->value.intval = sdecodeint32(str, format); - return t_integer; - } else { - np->value.realval = -- (double)sdecodelong(str, format) * -+ (double)sdecodeint32(str, format) * - binary_scale[format & 31]; - return t_real; - } -@@ -171,18 +171,14 @@ - } - - /* Decode a (32-bit, signed) long. */ --long --sdecodelong(const byte * p, int format) -+int -+sdecodeint32(const byte * p, int format) - { - int a = p[0], b = p[1], c = p[2], d = p[3]; -- long v = (num_is_lsb(format) ? -- ((long)d << 24) + ((long)c << 16) + (b << 8) + a : -- ((long)a << 24) + ((long)b << 16) + (c << 8) + d); -+ int v = (num_is_lsb(format) ? -+ ((int)d << 24) + ((int)c << 16) + (b << 8) + a : -+ ((int)a << 24) + ((int)b << 16) + (c << 8) + d); - --#if arch_sizeof_long > 4 -- /* Propagate bit 31 as the sign. */ -- v = (v ^ 0x80000000L) - 0x80000000L; --#endif - return v; - } - -@@ -190,7 +186,7 @@ - float - sdecodefloat(const byte * p, int format) - { -- bits32 lnum = (bits32) sdecodelong(p, format); -+ bits32 lnum = (bits32) sdecodeint32(p, format); - float fnum; - - #if !arch_floats_are_IEEE diff --git a/print/ghostscript7-x11/files/patch-src-ibnum.h b/print/ghostscript7-x11/files/patch-src-ibnum.h deleted file mode 100644 index ffec70cac2ae..000000000000 --- a/print/ghostscript7-x11/files/patch-src-ibnum.h +++ /dev/null @@ -1,11 +0,0 @@ ---- src/ibnum.h.orig 2013-04-30 10:50:12.000000000 +0900 -+++ src/ibnum.h 2013-04-30 10:50:29.000000000 +0900 -@@ -60,7 +60,7 @@ - int sdecode_number(P3(const byte *, int, ref *)); - int sdecodeshort(P2(const byte *, int)); - uint sdecodeushort(P2(const byte *, int)); --long sdecodelong(P2(const byte *, int)); -+int sdecodeint32(P2(const byte *, int)); - float sdecodefloat(P2(const byte *, int)); - - #endif /* ibnum_INCLUDED */ diff --git a/print/ghostscript7-x11/files/patch-src-icclib.mak b/print/ghostscript7-x11/files/patch-src-icclib.mak deleted file mode 100644 index a60ef670dfa2..000000000000 --- a/print/ghostscript7-x11/files/patch-src-icclib.mak +++ /dev/null @@ -1,11 +0,0 @@ ---- src/icclib.mak.orig 2013-04-30 02:10:16.000000000 +0900 -+++ src/icclib.mak 2013-04-30 02:10:26.000000000 +0900 -@@ -73,7 +73,7 @@ - - icc_h=$(ICCSRC)$(D)icc.h $(ICCSRC)$(D)icc$(ICCPROFVER).h - --$(ICCOBJ)icc.$(OBJ) : $(ICCSRC)icc.c $(ICCDEP) $(icc_h) -+$(ICCOBJ)icc.$(OBJ) : ${ECHOGS_XE} $(ICCSRC)icc.c $(ICCDEP) $(icc_h) - # echo $(ICC_CCFLAGS) - $(EXP)$(ECHOGS_XE) $(ICC_CCFLAGS) - $(ICC_CC) $(ICCO_)icc.$(OBJ) $(C_) $(ICCSRC)icc.c diff --git a/print/ghostscript7-x11/files/patch-src-idebug.c b/print/ghostscript7-x11/files/patch-src-idebug.c deleted file mode 100644 index 142926b4474b..000000000000 --- a/print/ghostscript7-x11/files/patch-src-idebug.c +++ /dev/null @@ -1,11 +0,0 @@ ---- src/idebug.c.orig 2013-04-30 11:06:57.000000000 +0900 -+++ src/idebug.c 2013-04-30 11:07:09.000000000 +0900 -@@ -90,7 +90,7 @@ - case t_fontID: - goto strct; - case t_integer: -- dprintf1("int %ld", pref->value.intval); -+ dprintf1("int %d", pref->value.intval); - break; - case t_mark: - dprintf("mark"); diff --git a/print/ghostscript7-x11/files/patch-src-idparam.c b/print/ghostscript7-x11/files/patch-src-idparam.c deleted file mode 100644 index 636d7c16b510..000000000000 --- a/print/ghostscript7-x11/files/patch-src-idparam.c +++ /dev/null @@ -1,21 +0,0 @@ ---- src/idparam.c.orig 2013-04-30 10:54:55.000000000 +0900 -+++ src/idparam.c 2013-04-30 10:55:23.000000000 +0900 -@@ -61,8 +61,7 @@ - int maxval, int defaultval, int *pvalue) - { - ref *pdval; -- int code; -- long ival; -+ int code, ival; - - if (pdict == 0 || dict_find_string(pdict, kstr, &pdval) <= 0) { - ival = defaultval; -@@ -349,7 +348,7 @@ - } else { - if (!r_has_type(puniqueid, t_integer) || - puniqueid->value.intval < 0 || -- puniqueid->value.intval > 0xffffffL -+ puniqueid->value.intval > 0xffffff - ) - return_error(e_rangecheck); - /* Apparently fonts created by Fontographer often have */ diff --git a/print/ghostscript7-x11/files/patch-src-ijs.mak b/print/ghostscript7-x11/files/patch-src-ijs.mak deleted file mode 100644 index be8ee7807ac5..000000000000 --- a/print/ghostscript7-x11/files/patch-src-ijs.mak +++ /dev/null @@ -1,20 +0,0 @@ ---- src/ijs.mak.orig 2003-01-17 09:49:04.000000000 +0900 -+++ src/ijs.mak 2013-04-30 02:24:08.000000000 +0900 -@@ -66,7 +66,7 @@ - ijs_client_h=$(IJSSRC)$(D)ijs_client.h - ijs_server_h=$(IJSSRC)$(D)ijs_server.h - --$(IJSOBJ)ijs.$(OBJ) : $(IJSSRC)ijs.c $(IJSDEP) $(ijs_h) -+$(IJSOBJ)ijs.$(OBJ) : ${ECHOGS_XE} $(IJSSRC)ijs.c $(IJSDEP) $(ijs_h) - # echo $(IJS_CCFLAGS) - $(EXP)$(ECHOGS_XE) $(IJS_CCFLAGS) - $(IJS_CC) $(IJSO_)ijs.$(OBJ) $(C_) $(IJSSRC)ijs.c -@@ -79,7 +79,7 @@ - $(IJSDEP) $(ijs_h) $(ijs_server_h) - $(IJS_CC) $(IJSO_)ijs_server.$(OBJ) $(C_) $(IJSSRC)ijs_server.c - --$(IJSOBJ)ijs_exec_unix.$(OBJ) : $(IJSSRC)ijs_exec_unix.c \ -+$(IJSOBJ)ijs_exec_unix.$(OBJ) : $(arch_h) $(IJSSRC)ijs_exec_unix.c \ - $(IJSDEP) $(ijs_h) $(ijs_client_h) - $(IJS_CC) $(IJSO_)ijs_exec_unix.$(OBJ) $(C_) $(IJSSRC)ijs_exec_unix.c - diff --git a/print/ghostscript7-x11/files/patch-src-int.mak b/print/ghostscript7-x11/files/patch-src-int.mak deleted file mode 100644 index 9e4c5a2c7663..000000000000 --- a/print/ghostscript7-x11/files/patch-src-int.mak +++ /dev/null @@ -1,24 +0,0 @@ ---- src/int.mak.orig 2013-04-30 02:55:45.000000000 +0900 -+++ src/int.mak 2013-04-30 02:56:06.000000000 +0900 -@@ -953,10 +953,10 @@ - - # We select either iccinit0 or iccinit1 depending on COMPILE_INITS. - --$(PSOBJ)iccinit0.$(OBJ) : $(PSSRC)iccinit0.c $(stdpre_h) -+$(PSOBJ)iccinit0.$(OBJ) : $(arch_h) $(PSSRC)iccinit0.c $(stdpre_h) - $(PSCC) $(PSO_)iccinit0.$(OBJ) $(C_) $(PSSRC)iccinit0.c - --$(PSOBJ)iccinit1.$(OBJ) : $(PSOBJ)gs_init.$(OBJ) -+$(PSOBJ)iccinit1.$(OBJ) : $(arch_h) $(PSOBJ)gs_init.$(OBJ) - $(CP_) $(PSOBJ)gs_init.$(OBJ) $(PSOBJ)iccinit1.$(OBJ) - - # All the gs_*.ps files should be prerequisites of gs_init.c, -@@ -964,7 +964,7 @@ - $(PSGEN)gs_init.c : $(PSLIB)$(GS_INIT) $(GENINIT_XE) $(gconfig_h) - $(EXP)$(GENINIT_XE) -I $(PSLIB) $(GS_INIT) $(gconfig_h) -c $(PSGEN)gs_init.c - --$(PSOBJ)gs_init.$(OBJ) : $(PSGEN)gs_init.c $(stdpre_h) -+$(PSOBJ)gs_init.$(OBJ) : $(arch_h) $(PSGEN)gs_init.c $(stdpre_h) - $(PSCC) $(PSO_)gs_init.$(OBJ) $(C_) $(PSGEN)gs_init.c - - # ---------------- Stochastic halftone ---------------- # diff --git a/print/ghostscript7-x11/files/patch-src-iparam.c b/print/ghostscript7-x11/files/patch-src-iparam.c deleted file mode 100644 index b0bb91a4d3ef..000000000000 --- a/print/ghostscript7-x11/files/patch-src-iparam.c +++ /dev/null @@ -1,33 +0,0 @@ ---- src/iparam.c.orig 2013-04-30 11:12:36.000000000 +0900 -+++ src/iparam.c 2013-04-30 11:13:07.000000000 +0900 -@@ -67,7 +67,7 @@ - int len; - byte *buf; - -- sprintf(istr, "%ld", pref->value.intval); -+ sprintf(istr, "%d", pref->value.intval); - len = strlen(istr); - /* GC will take care of freeing this: */ - buf = gs_alloc_string(plist->memory, len, "ref_to_key"); -@@ -394,7 +394,7 @@ - { - int code; - stack_param_list *const splist = (stack_param_list *) plist; -- long index = penum->intval; -+ int index = penum->intval; - ref *stack_element; - - do { -@@ -563,12 +563,6 @@ - code = gs_note_error(e_typecheck); - break; - } --#if arch_sizeof_int < arch_sizeof_long -- if (elt.value.intval != (int)elt.value.intval) { -- code = gs_note_error(e_rangecheck); -- break; -- } --#endif - piv[i] = (int)elt.value.intval; - } - if (code < 0) { diff --git a/print/ghostscript7-x11/files/patch-src-iref.h b/print/ghostscript7-x11/files/patch-src-iref.h deleted file mode 100644 index 33313d38047b..000000000000 --- a/print/ghostscript7-x11/files/patch-src-iref.h +++ /dev/null @@ -1,11 +0,0 @@ ---- src/iref.h.orig 2013-04-30 11:13:29.000000000 +0900 -+++ src/iref.h 2013-04-30 11:13:41.000000000 +0900 -@@ -441,7 +441,7 @@ - #define r_set_ptr(rp,ptr) ((rp)->value.pstruct = (obj_header_t *)(ptr)) - - union v { /* name the union to keep gdb happy */ -- long intval; -+ int intval; - ushort boolval; - float realval; - ulong saveid; diff --git a/print/ghostscript7-x11/files/patch-src-iscan.c b/print/ghostscript7-x11/files/patch-src-iscan.c deleted file mode 100644 index cd8b03f6ab56..000000000000 --- a/print/ghostscript7-x11/files/patch-src-iscan.c +++ /dev/null @@ -1,11 +0,0 @@ ---- src/iscan.c.orig 2013-04-30 10:47:49.000000000 +0900 -+++ src/iscan.c 2013-04-30 10:48:19.000000000 +0900 -@@ -635,7 +635,7 @@ - uint size = ref_stack_count_inline(&o_stack) - pstack; - ref arr; - -- if_debug4('S', "[S}]d=%d, s=%d->%ld, c=%d\n", -+ if_debug4('S', "[S}]d=%d, s=%d->%d, c=%d\n", - pdepth, pstack, - (pstack == pdepth ? 0 : - ref_stack_index(&o_stack, size)->value.intval), diff --git a/print/ghostscript7-x11/files/patch-src-iscanbin.c b/print/ghostscript7-x11/files/patch-src-iscanbin.c deleted file mode 100644 index 1f39c88b7209..000000000000 --- a/print/ghostscript7-x11/files/patch-src-iscanbin.c +++ /dev/null @@ -1,83 +0,0 @@ ---- src/iscanbin.c.orig 2013-04-30 10:51:53.000000000 +0900 -+++ src/iscanbin.c 2013-04-30 10:53:42.000000000 +0900 -@@ -173,7 +173,7 @@ - pbs->num_format = num_format; - if (top_size == 0) { - /* Extended header (2-byte array size, 4-byte length) */ -- ulong lsize; -+ uint lsize; - - if (rcnt < 7) { - s_end_inline(s, p - 1, rlimit); -@@ -183,7 +183,7 @@ - if (p[1] != 0) /* reserved, must be 0 */ - return_error(e_syntaxerror); - top_size = sdecodeushort(p + 2, num_format); -- lsize = sdecodelong(p + 4, num_format); -+ lsize = sdecodeint32(p + 4, num_format); - if ((size = lsize) != lsize) - return_error(e_limitcheck); - hsize = 8; -@@ -445,8 +445,7 @@ - for (; index < max_array_index; p += SIZEOF_BIN_SEQ_OBJ, index++) { - ref *op = abase + index; - uint osize; -- long value; -- uint atype, attrs; -+ int value, atype, attrs; - - s_end_inline(s, p, rlimit); /* in case of error */ - if (rlimit - p < SIZEOF_BIN_SEQ_OBJ) { -@@ -464,14 +463,14 @@ - make_null(op); - break; - case BS_TYPE_INTEGER: -- make_int(op, sdecodelong(p + 5, num_format)); -+ make_int(op, sdecodeint32(p + 5, num_format)); - break; - case BS_TYPE_REAL:{ - float vreal; - - osize = sdecodeushort(p + 3, num_format); - if (osize != 0) { /* fixed-point number */ -- value = sdecodelong(p + 5, num_format); -+ value = sdecodeint32(p + 5, num_format); - vreal = (float)ldexp((double)value, -osize); - } else { - vreal = sdecodefloat(p + 5, num_format); -@@ -480,7 +479,7 @@ - break; - } - case BS_TYPE_BOOLEAN: -- make_bool(op, sdecodelong(p + 5, num_format) != 0); -+ make_bool(op, sdecodeint32(p + 5, num_format) != 0); - break; - case BS_TYPE_STRING: - osize = sdecodeushort(p + 3, num_format); -@@ -492,7 +491,7 @@ - make_empty_string(op, attrs); - break; - } -- value = sdecodelong(p + 5, num_format); -+ value = sdecodeint32(p + 5, num_format); - if (value < max_array_index * SIZEOF_BIN_SEQ_OBJ || - value + osize > size - ) -@@ -524,7 +523,7 @@ - /* falls through */ - case BS_TYPE_NAME: - osize = sdecodeushort(p + 3, num_format); -- value = sdecodelong(p + 5, num_format); -+ value = sdecodeint32(p + 5, num_format); - switch (osize) { - case 0: - code = array_get(user_names_p, value, op); -@@ -546,7 +545,7 @@ - osize = sdecodeushort(p + 3, num_format); - atype = t_array; - arr: -- value = sdecodelong(p + 5, num_format); -+ value = sdecodeint32(p + 5, num_format); - if (value + osize > min_string_index || - value & (SIZEOF_BIN_SEQ_OBJ - 1) - ) diff --git a/print/ghostscript7-x11/files/patch-src-iscannum.c b/print/ghostscript7-x11/files/patch-src-iscannum.c deleted file mode 100644 index 4a69664074a6..000000000000 --- a/print/ghostscript7-x11/files/patch-src-iscannum.c +++ /dev/null @@ -1,203 +0,0 @@ ---- src/iscannum.c.orig 2003-01-17 09:49:04.000000000 +0900 -+++ src/iscannum.c 2013-04-30 11:17:14.000000000 +0900 -@@ -57,7 +57,6 @@ - }; - - int ival; -- long lval; - double dval; - int exp10; - int code = 0; -@@ -104,8 +103,26 @@ - GET_NEXT(c, sp, goto iret); - if (!IS_DIGIT(d, c)) - break; -- if (WOULD_OVERFLOW(ival, d, max_int)) -- goto i2l; -+ if (WOULD_OVERFLOW((unsigned)ival, d, max_int)) { -+ /* goto i2l; */ -+ if (ival == max_int / 10 && d == (max_int % 10) + 1 && sign < 0) { -+ GET_NEXT(c, sp, c= EOFC); -+ dval = -(double)min_int; -+ if (c == 'e' || c == 'E') { -+ exp10 = 0; -+ goto fs; -+ } else if (c == '.') { -+ GET_NEXT(c, sp, c = EOFC); -+ exp10 = 0; -+ goto fd; -+ } else if (!IS_DIGIT(d, c)) { -+ ival = min_int; -+ break; -+ } -+ } else -+ dval = ival; -+ goto l2d; -+ } - } - ind: /* We saw a non-digit while accumulating an integer in ival. */ - switch (c) { -@@ -116,6 +133,8 @@ - *psp = sp; - code = 1; - break; -+ case EOFC: -+ break; - case 'e': - case 'E': - if (sign < 0) -@@ -125,8 +144,8 @@ - goto fe; - case '#': - { -- const uint radix = (uint)ival; -- ulong uval = 0, lmax; -+ const int radix = ival; -+ uint uval = 0, imax; - - if (sign || radix < min_radix || radix > max_radix) - return_error(e_syntaxerror); -@@ -136,19 +155,19 @@ - - switch (radix) { - case 2: -- shift = 1, lmax = max_ulong >> 1; -+ shift = 1, imax = max_uint >> 1; - break; - case 4: -- shift = 2, lmax = max_ulong >> 2; -+ shift = 2, imax = max_uint >> 2; - break; - case 8: -- shift = 3, lmax = max_ulong >> 3; -+ shift = 3, imax = max_uint >> 3; - break; - case 16: -- shift = 4, lmax = max_ulong >> 4; -+ shift = 4, imax = max_uint >> 4; - break; - case 32: -- shift = 5, lmax = max_ulong >> 5; -+ shift = 5, imax = max_uint >> 5; - break; - default: /* can't happen */ - return_error(e_rangecheck); -@@ -161,13 +180,13 @@ - code = 1; - break; - } -- if (uval > lmax) -+ if (uval > imax) - return_error(e_limitcheck); - } - } else { -- int lrem = max_ulong % radix; -+ int irem = max_uint % radix; - -- lmax = max_ulong / radix; -+ imax = max_uint / radix; - for (;; uval = uval * radix + d) { - GET_NEXT(c, sp, break); - d = decoder[c]; -@@ -176,8 +195,8 @@ - code = 1; - break; - } -- if (uval >= lmax && -- (uval > lmax || d > lrem) -+ if (uval >= imax && -+ (uval > imax || d > irem) - ) - return_error(e_limitcheck); - } -@@ -190,55 +209,6 @@ - make_int(pref, (sign < 0 ? -ival : ival)); - return code; - -- /* Accumulate a long in lval. */ --i2l: -- for (lval = ival;;) { -- if (WOULD_OVERFLOW(lval, d, max_long)) { -- /* Make a special check for entering the smallest */ -- /* (most negative) integer. */ -- if (lval == max_long / 10 && -- d == (int)(max_long % 10) + 1 && sign < 0 -- ) { -- GET_NEXT(c, sp, c = EOFC); -- dval = -(double)min_long; -- if (c == 'e' || c == 'E' || c == '.') { -- exp10 = 0; -- goto fs; -- } else if (!IS_DIGIT(d, c)) { -- lval = min_long; -- break; -- } -- } else -- dval = lval; -- goto l2d; -- } -- lval = lval * 10 + d; -- GET_NEXT(c, sp, goto lret); -- if (!IS_DIGIT(d, c)) -- break; -- } -- switch (c) { -- case '.': -- GET_NEXT(c, sp, c = EOFC); -- exp10 = 0; -- goto l2r; -- case EOFC: -- break; -- default: -- *psp = sp; -- code = 1; -- break; -- case 'e': -- case 'E': -- exp10 = 0; -- goto le; -- case '#': -- return_error(e_syntaxerror); -- } --lret: -- make_int(pref, (sign < 0 ? -lval : lval)); -- return code; -- - /* Accumulate a double in dval. */ - l2d: - exp10 = 0; -@@ -274,8 +244,8 @@ - exp10 = 0; - while (IS_DIGIT(d, c)) { - if (WOULD_OVERFLOW(ival, d, max_int)) { -- lval = ival; -- goto l2r; -+ dval = ival; -+ goto fd; - } - ival = ival * 10 + d; - exp10--; -@@ -293,23 +263,6 @@ - dval = ival; - goto fe; - -- /* We saw a '.' while accumulating a long in lval. */ --l2r: -- while (IS_DIGIT(d, c)) { -- if (WOULD_OVERFLOW(lval, d, max_long)) { -- dval = lval; -- goto fd; -- } -- lval = lval * 10 + d; -- exp10--; -- GET_NEXT(c, sp, c = EOFC); -- } --le: -- if (sign < 0) -- lval = -lval; -- dval = lval; -- goto fe; -- - /* Now we are accumulating a double in dval. */ - fd: - while (IS_DIGIT(d, c)) { diff --git a/print/ghostscript7-x11/files/patch-src-iutil.c b/print/ghostscript7-x11/files/patch-src-iutil.c deleted file mode 100644 index c77cb19ddd84..000000000000 --- a/print/ghostscript7-x11/files/patch-src-iutil.c +++ /dev/null @@ -1,11 +0,0 @@ ---- src/iutil.c.orig 2013-04-30 10:51:05.000000000 +0900 -+++ src/iutil.c 2013-04-30 10:51:20.000000000 +0900 -@@ -428,7 +428,7 @@ - data = (const byte *)(op->value.boolval ? "true" : "false"); - break; - case t_integer: -- sprintf(buf, "%ld", op->value.intval); -+ sprintf(buf, "%d", op->value.intval); - break; - case t_string: - check_read(*op); diff --git a/print/ghostscript7-x11/files/patch-src-lib.mak b/print/ghostscript7-x11/files/patch-src-lib.mak deleted file mode 100644 index 6208eb8034a3..000000000000 --- a/print/ghostscript7-x11/files/patch-src-lib.mak +++ /dev/null @@ -1,46 +0,0 @@ ---- src/lib.mak.orig 2003-01-17 09:49:05.000000000 +0900 -+++ src/lib.mak 2015-08-22 02:23:05.682462000 +0900 -@@ -35,6 +35,7 @@ - GLJCC=$(CC_) $(I_)$(GLI_) $(II)$(JI_)$(_I) $(JCF_) $(GLF_) - GLZCC=$(CC_) $(I_)$(GLI_) $(II)$(ZI_)$(_I) $(ZCF_) $(GLF_) - GLCCLEAF=$(CC_LEAF) $(I_)$(GLI_)$(_I) $(GLF_) -+GLCCSHARED=$(CC_SHARED) $(GLCCFLAGS) - # All top-level makefiles define GLD. - #GLD=$(GLGEN) - -@@ -187,22 +188,22 @@ - $(GLD)gsnogc.dev : $(LIB_MAK) $(ECHOGS_XE) $(gsnogc_) - $(SETMOD) $(GLD)gsnogc $(gsnogc_) - --$(GLOBJ)gsnogc.$(OBJ) : $(GLSRC)gsnogc.c $(GX)\ -+$(GLOBJ)gsnogc.$(OBJ) : $(arch_h) $(GLSRC)gsnogc.c $(GX)\ - $(gsmdebug_h) $(gsnogc_h) $(gsstruct_h) $(gxalloc_h) - $(GLCC) $(GLO_)gsnogc.$(OBJ) $(C_) $(GLSRC)gsnogc.c - - ### Bitmap processing - --$(GLOBJ)gsbitcom.$(OBJ) : $(GLSRC)gsbitcom.c $(AK) $(std_h)\ -+$(GLOBJ)gsbitcom.$(OBJ) : $(arch_h) $(GLSRC)gsbitcom.c $(AK) $(std_h)\ - $(gdebug_h) $(gsbitops_h) $(gstypes_h) - $(GLCC) $(GLO_)gsbitcom.$(OBJ) $(C_) $(GLSRC)gsbitcom.c - --$(GLOBJ)gsbitops.$(OBJ) : $(GLSRC)gsbitops.c $(AK) $(memory__h) $(stdio__h)\ -+$(GLOBJ)gsbitops.$(OBJ) : $(arch_h) $(GLSRC)gsbitops.c $(AK) $(memory__h) $(stdio__h)\ - $(gdebug_h) $(gsbittab_h) $(gserror_h) $(gserrors_h) $(gstypes_h)\ - $(gxbitops_h) - $(GLCC) $(GLO_)gsbitops.$(OBJ) $(C_) $(GLSRC)gsbitops.c - --$(GLOBJ)gsbittab.$(OBJ) : $(GLSRC)gsbittab.c $(AK) $(stdpre_h) $(gsbittab_h) -+$(GLOBJ)gsbittab.$(OBJ) : $(arch_h) $(GLSRC)gsbittab.c $(AK) $(stdpre_h) $(gsbittab_h) - $(GLCC) $(GLO_)gsbittab.$(OBJ) $(C_) $(GLSRC)gsbittab.c - - # gsflip is not part of the standard configuration: it's rather large, -@@ -765,7 +766,7 @@ - $(GLOBJ)gsparamx.$(OBJ) : $(GLSRC)gsparamx.c $(string__h)\ - $(gserror_h) $(gserrors_h) $(gsmemory_h) $(gsparam_h) $(gsparamx_h)\ - $(gstypes_h) -- $(GLCC) $(GLO_)gsparamx.$(OBJ) $(C_) $(GLSRC)gsparamx.c -+ $(GLCCSHARED) $(GLO_)gsparamx.$(OBJ) $(C_) $(GLSRC)gsparamx.c - - # Future replacement for gsparams.c - $(GLOBJ)gsparam2.$(OBJ) : $(GLSRC)gsparam2.c $(GXERR) $(memory__h)\ diff --git a/print/ghostscript7-x11/files/patch-src-unixinst.mak b/print/ghostscript7-x11/files/patch-src-unixinst.mak deleted file mode 100644 index 1a8041d74861..000000000000 --- a/print/ghostscript7-x11/files/patch-src-unixinst.mak +++ /dev/null @@ -1,122 +0,0 @@ ---- src/unixinst.mak.orig 2003-01-17 09:49:05.000000000 +0900 -+++ src/unixinst.mak 2015-08-22 00:31:09.540215000 +0900 -@@ -30,24 +30,24 @@ - # rules, just in case bindir or scriptdir is a subdirectory of any of these. - - install-exec: $(GS_XE) -- -mkdir -p $(datadir) -- -mkdir -p $(gsdir) -- -mkdir -p $(gsdatadir) -- -mkdir -p $(bindir) -- $(INSTALL_PROGRAM) $(GS_XE) $(bindir)/$(GS) -+ -mkdir -p $(DESTDIR)$(datadir) -+ -mkdir -p $(DESTDIR)$(gsdir) -+ -mkdir -p $(DESTDIR)$(gsdatadir) -+ -mkdir -p $(DESTDIR)$(bindir) -+ $(INSTALL_PROGRAM) $(GS_XE) $(DESTDIR)$(bindir)/$(GS) - - install-scripts: $(PSLIBDIR)/gsnd -- -mkdir -p $(datadir) -- -mkdir -p $(gsdir) -- -mkdir -p $(gsdatadir) -- -mkdir -p $(scriptdir) -+ -mkdir -p $(DESTDIR)$(datadir) -+ -mkdir -p $(DESTDIR)$(gsdir) -+ -mkdir -p $(DESTDIR)$(gsdatadir) -+ -mkdir -p $(DESTDIR)$(scriptdir) - $(SH) -c 'for f in \ - gsbj gsdj gsdj500 gslj gslp gsnd \ - bdftops dvipdf eps2eps font2c \ - pdf2dsc pdf2ps pdfopt pf2afm pfbtopfa printafm \ - ps2ascii ps2epsi ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr ps2ps wftopfa \ - fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh ;\ -- do if ( test -f $(PSLIBDIR)/$$f ); then $(INSTALL_PROGRAM) $(PSLIBDIR)/$$f $(scriptdir); fi;\ -+ do if ( test -f $(PSLIBDIR)/$$f ); then $(INSTALL_SCRIPT) $(PSLIBDIR)/$$f $(DESTDIR)$(scriptdir); fi;\ - done' - - PSDOCDIR=$(PSLIBDIR)/../doc -@@ -60,10 +60,10 @@ - # one file from each subdirectory just as a sanity check. - - install-libdata: -- -mkdir -p $(datadir) -- -mkdir -p $(gsdir) -- -mkdir -p $(gsdatadir) -- -mkdir -p $(gsdatadir)/lib -+ -mkdir -p $(DESTDIR)$(datadir) -+ -mkdir -p $(DESTDIR)$(gsdir) -+ -mkdir -p $(DESTDIR)$(gsdatadir) -+ -mkdir -p $(DESTDIR)$(gsdatadir)/lib - $(SH) -c 'for f in \ - Fontmap Fontmap.GS \ - CIDFnmap CIDFnmap.Ore CIDFnmap.ARP CIDFnmap.Bae CIDFnmap.Koc \ -@@ -83,13 +83,13 @@ - viewpcx.ps viewpbm.ps viewps2a.ps \ - winmaps.ps wftopfa.ps wrfont.ps zeroline.ps \ - pdf2dsc.ps pdfopt.ps ;\ -- do if ( test -f $(PSLIBDIR)/$$f ); then $(INSTALL_DATA) $(PSLIBDIR)/$$f $(gsdatadir)/lib; fi;\ -+ do if ( test -f $(PSLIBDIR)/$$f ); then $(INSTALL_DATA) $(PSLIBDIR)/$$f $(DESTDIR)$(gsdatadir)/lib; fi;\ - done' - $(SH) -c 'for f in $(PSLIBDIR)/gs_*.ps $(PSLIBDIR)/pdf*.ps;\ -- do $(INSTALL_DATA) $$f $(gsdatadir)/lib ;\ -+ do $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)/lib ;\ - done' - $(SH) -c 'for f in $(PSLIBDIR)/*.ppd $(PSLIBDIR)/*.rpd $(PSLIBDIR)/*.upp $(PSLIBDIR)/*.xbm $(PSLIBDIR)/*.xpm;\ -- do $(INSTALL_DATA) $$f $(gsdatadir)/lib ;\ -+ do $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)/lib ;\ - done' - - # install html documentation -@@ -106,20 +106,20 @@ - Psfiles.htm Public.htm Readme.htm Release.htm \ - Source.htm Tester.htm Unix-lpr.htm Use.htm Xfonts.htm - install-doc: $(PSDOCDIR)/News.htm -- -mkdir -p $(docdir) -+ -mkdir -p $(DESTDIR)$(docdir) - $(SH) -c 'for f in $(DOC_PAGES) ;\ -- do if ( test -f $(PSDOCDIR)/$$f ); then $(INSTALL_DATA) $(PSDOCDIR)/$$f $(docdir); fi;\ -+ do if ( test -f $(PSDOCDIR)/$$f ); then $(INSTALL_DATA) $(PSDOCDIR)/$$f $(DESTDIR)$(docdir); fi;\ - done' - - # install the man pages for each locale --MAN_LCDIRS=. de -+MAN_LCDIRS=. - MAN1_LINKS_PS2PS=eps2eps - MAN1_LINKS_PS2PDF=ps2pdf12 ps2pdf13 - MAN1_LINKS_GSLP=gsbj gsdj gsdj500 gslj - install-man: $(PSMANDIR)/gs.1 -- $(SH) -c 'test -d $(mandir) || mkdir -p $(mandir)' -+ $(SH) -c 'test -d $(DESTDIR)$(mandir) || mkdir -p $(DESTDIR)$(mandir)' - $(SH) -c 'for d in $(MAN_LCDIRS) ;\ -- do man1dir=$(mandir)/$$d/man$(man1ext) ;\ -+ do man1dir=$(DESTDIR)$(mandir)/$$d/man$(man1ext) ;\ - ( test -d $$man1dir || mkdir -p $$man1dir ) ;\ - for f in $(PSMANDIR)/$$d/*.1 ;\ - do $(INSTALL_DATA) $$f $$man1dir ;\ -@@ -146,17 +146,22 @@ - - # install the example files - install-examples: -- -mkdir -p $(exdir) -+ -mkdir -p $(DESTDIR)$(exdir) - for f in \ - alphabet.ps colorcir.ps doretree.ps escher.ps golfer.ps \ - grayalph.ps snowflak.ps tiger.ps vasarely.ps waterfal.ps \ - ridt91.eps ;\ -- do $(INSTALL_DATA) $(PSEXDIR)/$$f $(exdir) ;\ -+ do $(INSTALL_DATA) $(PSEXDIR)/$$f $(DESTDIR)$(exdir) ;\ - done -- -mkdir -p $(exdir)/cjk -+ -mkdir -p $(DESTDIR)$(exdir)/cjk - for f in \ - all_ac1.ps all_ag1.ps all_aj1.ps all_aj2.ps all_ak1.ps \ - gscjk_ac.ps gscjk_ag.ps gscjk_aj.ps gscjk_ak.ps \ - iso2022.ps;\ -- do $(INSTALL_DATA) $(PSEXDIR)/cjk/$$f $(exdir)/cjk ;\ -+ do $(INSTALL_DATA) $(PSEXDIR)/cjk/$$f $(DESTDIR)$(exdir)/cjk ;\ - done -+ -+install-shared: $(GS_SHARED_OBJS) -+ -mkdir -p $(DESTDIR)$(gssharedir) -+ $(SH) -c 'for obj in $(GS_SHARED_OBJS); do \ -+ $(INSTALL_PROGRAM) $$obj $(DESTDIR)$(gssharedir)/; done' diff --git a/print/ghostscript7-x11/files/patch-src-zarith.c b/print/ghostscript7-x11/files/patch-src-zarith.c deleted file mode 100644 index 582f61e8f144..000000000000 --- a/print/ghostscript7-x11/files/patch-src-zarith.c +++ /dev/null @@ -1,48 +0,0 @@ ---- src/zarith.c.orig 2013-04-30 11:07:41.000000000 +0900 -+++ src/zarith.c 2013-04-30 11:08:43.000000000 +0900 -@@ -32,9 +32,9 @@ - */ - - /* Define max and min values for what will fit in value.intval. */ --#define MIN_INTVAL min_long --#define MAX_INTVAL max_long --#define MAX_HALF_INTVAL ((1L << (size_of(long) * 4 - 1)) - 1) -+#define MIN_INTVAL 0x80000000 -+#define MAX_INTVAL 0x7fffffff -+#define MAX_HALF_INTVAL 0x7fff - - /* add */ - /* We make this into a separate procedure because */ -@@ -64,7 +64,7 @@ - op[-1].value.realval += (double)op->value.intval; - break; - case t_integer: { -- long int2 = op->value.intval; -+ int int2 = op->value.intval; - - if (((op[-1].value.intval += int2) ^ int2) < 0 && - ((op[-1].value.intval - int2) ^ int2) >= 0 -@@ -158,10 +158,10 @@ - op[-1].value.realval *= (double)op->value.intval; - break; - case t_integer: { -- long int1 = op[-1].value.intval; -- long int2 = op->value.intval; -- long abs1 = (int1 >= 0 ? int1 : -int1); -- long abs2 = (int2 >= 0 ? int2 : -int2); -+ int int1 = op[-1].value.intval; -+ int int2 = op->value.intval; -+ uint abs1 = (uint)(int1 >= 0 ? int1 : -int1); -+ uint abs2 = (uint)(int2 >= 0 ? int2 : -int2); - float fprod; - - if ((abs1 > MAX_HALF_INTVAL || abs2 > MAX_HALF_INTVAL) && -@@ -212,7 +212,7 @@ - op[-1].value.realval -= (double)op->value.intval; - break; - case t_integer: { -- long int1 = op[-1].value.intval; -+ int int1 = op[-1].value.intval; - - if ((int1 ^ (op[-1].value.intval = int1 - op->value.intval)) < 0 && - (int1 ^ op->value.intval) < 0 diff --git a/print/ghostscript7-x11/files/patch-src-zcontrol.c b/print/ghostscript7-x11/files/patch-src-zcontrol.c deleted file mode 100644 index d00a600c19ec..000000000000 --- a/print/ghostscript7-x11/files/patch-src-zcontrol.c +++ /dev/null @@ -1,20 +0,0 @@ ---- src/zcontrol.c.orig 2013-04-30 11:09:59.000000000 +0900 -+++ src/zcontrol.c 2013-04-30 11:11:03.000000000 +0900 -@@ -356,7 +356,7 @@ - { - os_ptr op = osp; - register es_ptr ep = esp; -- long var = ep[-3].value.intval; -+ int var = ep[-3].value.intval; - - if (var > ep[-1].value.intval) { - esp -= 5; /* pop everything */ -@@ -375,7 +375,7 @@ - { - os_ptr op = osp; - register es_ptr ep = esp; -- long var = ep[-3].value.intval; -+ int var = ep[-3].value.intval; - - if (var < ep[-1].value.intval) { - esp -= 5; /* pop everything */ diff --git a/print/ghostscript7-x11/files/patch-src-zdict.c b/print/ghostscript7-x11/files/patch-src-zdict.c deleted file mode 100644 index 050ecc841717..000000000000 --- a/print/ghostscript7-x11/files/patch-src-zdict.c +++ /dev/null @@ -1,29 +0,0 @@ ---- src/zdict.c.orig 2013-04-30 11:04:05.000000000 +0900 -+++ src/zdict.c 2013-04-30 11:04:34.000000000 +0900 -@@ -35,12 +35,9 @@ - os_ptr op = osp; - - check_type(*op, t_integer); --#if arch_sizeof_int < arch_sizeof_long -- check_int_leu(*op, max_uint); --#else - if (op->value.intval < 0) - return_error(e_rangecheck); --#endif -+ - return dict_create((uint) op->value.intval, op); - } - -@@ -458,12 +455,8 @@ - check_type(*op1, t_dictionary); - check_dict_write(*op1); - check_type(*op, t_integer); --#if arch_sizeof_int < arch_sizeof_long -- check_int_leu(*op, max_uint); --#else - if (op->value.intval < 0) - return_error(e_rangecheck); --#endif - new_size = (uint) op->value.intval; - if (dict_length(op - 1) > new_size) - return_error(e_dictfull); diff --git a/print/ghostscript7-x11/files/patch-src-zdps.c b/print/ghostscript7-x11/files/patch-src-zdps.c deleted file mode 100644 index 414a296cd4ea..000000000000 --- a/print/ghostscript7-x11/files/patch-src-zdps.c +++ /dev/null @@ -1,25 +0,0 @@ ---- src/zdps.c.orig 2013-04-30 11:05:10.000000000 +0900 -+++ src/zdps.c 2013-04-30 11:05:50.000000000 +0900 -@@ -46,19 +46,18 @@ - { - os_ptr op = osp; - int code; -- long x, y; -+ int x, y; - - check_type(op[-2], t_integer); - check_type(op[-1], t_integer); - check_type(*op, t_integer); - x = op[-1].value.intval; - y = op->value.intval; -- if (x != (int)x || y != (int)y || -- op[-2].value.intval < -1 || -+ if (op[-2].value.intval < -1 || - op[-2].value.intval >= gs_color_select_count - ) - return_error(e_rangecheck); -- code = gs_setscreenphase(igs, (int)x, (int)y, -+ code = gs_setscreenphase(igs, x, y, - (gs_color_select_t) op[-2].value.intval); - if (code >= 0) - pop(3); diff --git a/print/ghostscript7-x11/files/patch-src-zfunc4.c b/print/ghostscript7-x11/files/patch-src-zfunc4.c deleted file mode 100644 index 0d8610978652..000000000000 --- a/print/ghostscript7-x11/files/patch-src-zfunc4.c +++ /dev/null @@ -1,13 +0,0 @@ ---- src/zfunc4.c.orig 2013-04-30 10:45:00.000000000 +0900 -+++ src/zfunc4.c 2013-04-30 10:45:23.000000000 +0900 -@@ -150,10 +150,6 @@ - case t_integer: { - int i = elt.value.intval; - --#if ARCH_SIZEOF_INT < ARCH_SIZEOF_LONG -- if (i != elt.value.intval) /* check for truncation */ -- return_error(e_rangecheck); --#endif - if (i == (byte)i) { - *p = PtCr_byte; - p[1] = (byte)i; diff --git a/print/ghostscript7-x11/files/patch-src-zgeneric.c b/print/ghostscript7-x11/files/patch-src-zgeneric.c deleted file mode 100644 index d99189a5e16a..000000000000 --- a/print/ghostscript7-x11/files/patch-src-zgeneric.c +++ /dev/null @@ -1,20 +0,0 @@ ---- src/zgeneric.c.orig 2013-04-30 10:55:48.000000000 +0900 -+++ src/zgeneric.c 2013-04-30 10:56:40.000000000 +0900 -@@ -76,7 +76,7 @@ - int count, i; - int code; - -- if ((ulong) op->value.intval > op - osbot) { -+ if ((uint)op->value.intval > (uint)(op - osbot)) { - /* There might be enough elements in other blocks. */ - check_int_ltu(*op, ref_stack_count(&o_stack)); - count = op->value.intval; -@@ -471,7 +471,7 @@ - { - os_ptr op = osp; - es_ptr obj = esp - 2; -- int index = (int)esp->value.intval; -+ int index = esp->value.intval; - - push(2); /* make room for key and value */ - if ((index = dict_next(obj, index, op - 1)) >= 0) { /* continue */ diff --git a/print/ghostscript7-x11/files/patch-src-ziodev.c b/print/ghostscript7-x11/files/patch-src-ziodev.c deleted file mode 100644 index 2cd6f0add7a9..000000000000 --- a/print/ghostscript7-x11/files/patch-src-ziodev.c +++ /dev/null @@ -1,11 +0,0 @@ ---- src/ziodev.c.orig 2013-04-30 11:06:19.000000000 +0900 -+++ src/ziodev.c 2013-04-30 11:06:30.000000000 +0900 -@@ -79,8 +79,6 @@ - const byte *dname; - - check_type(*op, t_integer); -- if (op->value.intval != (int)op->value.intval) -- return_error(e_rangecheck); - iodev = gs_getiodevice((int)(op->value.intval)); - if (iodev == 0) /* index out of range */ - return_error(e_rangecheck); diff --git a/print/ghostscript7-x11/files/patch-src-zmath.c b/print/ghostscript7-x11/files/patch-src-zmath.c deleted file mode 100644 index 94576da80fdf..000000000000 --- a/print/ghostscript7-x11/files/patch-src-zmath.c +++ /dev/null @@ -1,18 +0,0 @@ ---- src/zmath.c.orig 2013-04-30 10:43:55.000000000 +0900 -+++ src/zmath.c 2013-04-30 10:44:23.000000000 +0900 -@@ -229,14 +229,10 @@ - zsrand(i_ctx_t *i_ctx_p) - { - os_ptr op = osp; -- long state; -+ int state; - - check_type(*op, t_integer); - state = op->value.intval; --#if arch_sizeof_long > 4 -- /* Trim the state back to 32 bits. */ -- state = (int)state; --#endif - /* - * The following somewhat bizarre adjustments are according to - * public information from Adobe describing their implementation. diff --git a/print/ghostscript7-x11/files/patch-src-zstack.c b/print/ghostscript7-x11/files/patch-src-zstack.c deleted file mode 100644 index f1359936e410..000000000000 --- a/print/ghostscript7-x11/files/patch-src-zstack.c +++ /dev/null @@ -1,11 +0,0 @@ ---- src/zstack.c.orig 2013-04-30 10:54:14.000000000 +0900 -+++ src/zstack.c 2013-04-30 10:54:26.000000000 +0900 -@@ -70,7 +70,7 @@ - register os_ptr opn; - - check_type(*op, t_integer); -- if ((ulong)op->value.intval >= op - osbot) { -+ if ((uint)op->value.intval >= op - osbot) { - /* Might be in an older stack block. */ - ref *elt; - diff --git a/print/ghostscript7-x11/files/patch-src-ztype.c b/print/ghostscript7-x11/files/patch-src-ztype.c deleted file mode 100644 index 98be203c6abe..000000000000 --- a/print/ghostscript7-x11/files/patch-src-ztype.c +++ /dev/null @@ -1,34 +0,0 @@ ---- src/ztype.c.orig 2013-04-30 10:46:12.000000000 +0900 -+++ src/ztype.c 2013-04-30 10:46:55.000000000 +0900 -@@ -53,10 +53,10 @@ - * constant expressions, so we can't use min_long and max_long. - * What a nuisance! - */ --#define ALT_MIN_LONG (-1L << (arch_sizeof_long * 8 - 1)) --#define ALT_MAX_LONG (~(ALT_MIN_LONG)) --private const double min_int_real = (ALT_MIN_LONG * 1.0 - 1); --private const double max_int_real = (ALT_MAX_LONG * 1.0 + 1); -+#define ALT_MIN_INT (-1 << 31) -+#define ALT_MAX_INT (~(ALT_MIN_INT)) -+static const double min_int_real = (ALT_MIN_INT * 1.0 - 1); -+static const double max_int_real = (ALT_MAX_INT * 1.0 + 1); - - #define REAL_CAN_BE_INT(v)\ - ((v) > min_int_real && (v) < max_int_real) -@@ -356,14 +356,14 @@ - return_op_typecheck(op - 2); - } - } else { -- ulong ival; -+ uint ival; - byte digits[sizeof(ulong) * 8]; - byte *endp = &digits[countof(digits)]; - byte *dp = endp; - - switch (r_type(op - 2)) { - case t_integer: -- ival = (ulong) op[-2].value.intval; -+ ival = (uint) op[-2].value.intval; - break; - case t_real: - { diff --git a/print/ghostscript7-x11/files/patch-src:gdevlbp8.c b/print/ghostscript7-x11/files/patch-src:gdevlbp8.c deleted file mode 100644 index 052492c58f6a..000000000000 --- a/print/ghostscript7-x11/files/patch-src:gdevlbp8.c +++ /dev/null @@ -1,70 +0,0 @@ ---- src/gdevlbp8.c.orig Wed Aug 1 09:48:23 2001 -+++ src/gdevlbp8.c Thu Mar 14 20:56:05 2002 -@@ -22,6 +22,8 @@ - - /* - Modifications: -+ 3.10.00 Johnny Lam -+ Removed LIPS III code, as it's obsoleted by gdevlips driver. - 2.2.97 Lauri Paatero - Changed CSI command into ESC [. DCS commands may still need to be changed - (to ESC P). -@@ -49,7 +51,6 @@ - - /* The device descriptors */ - private dev_proc_print_page(lbp8_print_page); --private dev_proc_print_page(lips3_print_page); - - const gx_device_printer far_data gs_lbp8_device = - prn_device(prn_std_procs, "lbp8", -@@ -58,14 +59,6 @@ - 0.16, 0.2, 0.32, 0.21, /* margins: left, bottom, right, top */ - 1, lbp8_print_page); - --const gx_device_printer far_data gs_lips3_device = -- prn_device(prn_std_procs, "lips3", -- 82, /* width_10ths, 8.3" */ -- 117, /* height_10ths, 11.7" */ -- X_DPI, Y_DPI, -- 0.16, 0.27, 0.23, 0.27, /* margins */ -- 1, lips3_print_page); -- - /* ------ Internal routines ------ */ - - #define ESC 0x1b -@@ -84,23 +77,6 @@ - - static const char *lbp8_end = NULL; - --static const char lips3_init[] = { -- ESC, '<', /* soft reset */ -- DCS, '0', 'J', ST, /* JOB END */ -- DCS, '3', '1', ';', '3', '0', '0', ';', '2', 'J', ST, /* 300dpi, LIPS3 JOB START */ -- ESC, '<', /* soft reset */ -- DCS, '2', 'y', 'P', 'r', 'i', 'n', 't', 'i', 'n', 'g', '(', 'g', 's', ')', ST, /* Printing (gs) display */ -- ESC, '[', '?', '1', 'l', /* auto cr-lf disable */ -- ESC, '[', '?', '2', 'h', /* auto ff disable */ -- ESC, '[', '1', '1', 'h', /* set mode */ -- ESC, '[', '7', ' ', 'I', /* select unit size (300dpi)*/ -- ESC, '[', 'f' /* move to home position */ --}; -- --static const char lips3_end[] = { -- DCS, '0', 'J', ST /* JOB END */ --}; -- - /* Send the page to the printer. */ - private int - can_print_page(gx_device_printer *pdev, FILE *prn_stream, -@@ -203,11 +179,4 @@ - lbp8_print_page(gx_device_printer *pdev, FILE *prn_stream) - { return can_print_page(pdev, prn_stream, lbp8_init, sizeof(lbp8_init), - lbp8_end, sizeof(lbp8_end)); --} -- --/* Print a LIPS III page. */ --private int --lips3_print_page(gx_device_printer *pdev, FILE *prn_stream) --{ return can_print_page(pdev, prn_stream, lips3_init, sizeof(lips3_init), -- lips3_end, sizeof(lips3_end)); - } diff --git a/print/ghostscript7-x11/files/patch-src:gdevpdff.c b/print/ghostscript7-x11/files/patch-src:gdevpdff.c deleted file mode 100644 index 8a292bd4cdec..000000000000 --- a/print/ghostscript7-x11/files/patch-src:gdevpdff.c +++ /dev/null @@ -1,59 +0,0 @@ ---- src/gdevpdff.c.org 2003-01-17 09:49:02.000000000 +0900 -+++ src/gdevpdff.c 2003-09-21 05:08:36.000000000 +0900 -@@ -276,6 +276,11 @@ - const byte *chars = font->font_name.chars; - uint size = font->font_name.size; - -+ /* CIDFonts has null string in font_name, key_name is used */ -+ if (0 == size) { -+ chars = font->key_name.chars; -+ size = font->key_name.size; -+ } - /* - * The behavior of Acrobat Distiller changed between 3.0 (PDF 1.2), - * which will never embed the base 14 fonts, and 4.0 (PDF 1.3), which -@@ -720,19 +725,22 @@ - same &= ~FONT_SAME_METRICS; - break; - case FONT_EMBED_NO: -- /* -- * Per the PDF 1.3 documentation, there are only 3 BaseEncoding -- * values allowed for non-embedded fonts. Pick one here. -- */ -- BaseEncoding = -- ((const gs_font_base *)base_font)->nearest_encoding_index; -- switch (BaseEncoding) { -- default: -- BaseEncoding = ENCODING_INDEX_WINANSI; -- case ENCODING_INDEX_WINANSI: -- case ENCODING_INDEX_MACROMAN: -- case ENCODING_INDEX_MACEXPERT: -- break; -+ if (!(font->FontType == ft_CID_encrypted || -+ font->FontType == ft_CID_TrueType)) { -+ /* -+ * Per the PDF 1.3 documentation, there are only 3 BaseEncoding -+ * values allowed for non-embedded fonts. Pick one here. -+ */ -+ BaseEncoding = -+ ((const gs_font_base *)base_font)->nearest_encoding_index; -+ switch (BaseEncoding) { -+ default: -+ BaseEncoding = ENCODING_INDEX_WINANSI; -+ case ENCODING_INDEX_WINANSI: -+ case ENCODING_INDEX_MACROMAN: -+ case ENCODING_INDEX_MACEXPERT: -+ break; -+ } - } - code = pdf_compute_font_descriptor(pdev, &fdesc, font, NULL); - if (code < 0) -@@ -888,6 +896,7 @@ - memcpy(ppf->widths_known, ftemp_widths_known, - sizeof(ftemp_widths_known)); - } -+ ppf->embed = embed; - code = pdf_register_font(pdev, font, ppf); - - *pppf = ppf; - diff --git a/print/ghostscript7-x11/files/patch-src:gdevpdff.h b/print/ghostscript7-x11/files/patch-src:gdevpdff.h deleted file mode 100644 index f64a4e02f6b8..000000000000 --- a/print/ghostscript7-x11/files/patch-src:gdevpdff.h +++ /dev/null @@ -1,37 +0,0 @@ ---- src/gdevpdff.h.org 2003-01-17 09:49:02.000000000 +0900 -+++ src/gdevpdff.h 2003-09-18 23:42:38.000000000 +0900 -@@ -117,6 +117,12 @@ - FONT_SUBSET_NO - } pdf_font_do_subset_t; - -+typedef enum { -+ FONT_EMBED_STANDARD, /* 14 standard fonts */ -+ FONT_EMBED_NO, -+ FONT_EMBED_YES -+} pdf_font_embed_t; -+ - struct pdf_font_descriptor_s { - pdf_resource_common(pdf_font_descriptor_t); - pdf_font_name_t FontName; -@@ -198,6 +204,7 @@ - gs_font *font; /* non-0 iff font will notify us; */ - /* should be a weak pointer */ - int index; /* in pdf_standard_fonts, -1 if not base 14 */ -+ pdf_font_embed_t embed; /* status of pdf_font_embed_status() */ - gs_matrix orig_matrix; /* FontMatrix of unscaled font for embedding */ - bool is_MM_instance; /* for Type 1/2 fonts, true iff the font */ - /* is a Multiple Master instance */ -@@ -320,12 +327,6 @@ - - /* ---------------- Exported by gdevpdff.c ---------------- */ - --typedef enum { -- FONT_EMBED_STANDARD, /* 14 standard fonts */ -- FONT_EMBED_NO, -- FONT_EMBED_YES --} pdf_font_embed_t; -- - typedef struct pdf_standard_font_s { - const char *fname; - gs_encoding_index_t base_encoding; - diff --git a/print/ghostscript7-x11/files/patch-src:gdevpdfs.c b/print/ghostscript7-x11/files/patch-src:gdevpdfs.c deleted file mode 100644 index 0378f15c88ab..000000000000 --- a/print/ghostscript7-x11/files/patch-src:gdevpdfs.c +++ /dev/null @@ -1,41 +0,0 @@ ---- src/gdevpdfs.c.org 2003-09-20 00:11:16.000000000 +0900 -+++ src/gdevpdfs.c 2003-09-25 17:44:10.000000000 +0900 -@@ -481,15 +481,21 @@ - - if (cid < pfd->chars_count) { - int index = cid >> 3, mask = 0x80 >> (cid & 7); -+ int gid; -+ -+ if (!(pfd->chars_used.data[index] & mask) || -+ !(psubf->widths_known[index] & mask)) { - -- if (!(pfd->chars_used.data[index] & mask)) { -- pfd->chars_used.data[index] |= mask; - if (psubf->CIDToGIDMap) { - gs_font_cid2 *const subfont2 = - (gs_font_cid2 *)subfont; -- int gid = -- subfont2->cidata.CIDMap_proc(subfont2, glyph); - -+ gid = subfont2->cidata.CIDMap_proc(subfont2, glyph); -+ } -+ } -+ if (!(pfd->chars_used.data[index] & mask)) { -+ pfd->chars_used.data[index] |= mask; -+ if (psubf->CIDToGIDMap) { - if (gid >= 0) { - psubf->CIDToGIDMap[cid] = gid; - mark_glyphs_used(subfont, gid + gs_min_cid_glyph, -@@ -500,7 +506,11 @@ - if (!(psubf->widths_known[index] & mask)) { - int width; - -- code = pdf_glyph_width(psubf, glyph, subfont, &width); -+ if (psubf->CIDToGIDMap) -+ code = pdf_glyph_width(psubf, gid + gs_min_cid_glyph, -+ subfont, &width); -+ else -+ code = pdf_glyph_width(psubf, glyph, subfont, &width); - if (code == 0) { - psubf->Widths[cid] = width; - psubf->widths_known[index] |= mask; diff --git a/print/ghostscript7-x11/files/patch-src:gdevpdfw.c b/print/ghostscript7-x11/files/patch-src:gdevpdfw.c deleted file mode 100644 index a08b87d42724..000000000000 --- a/print/ghostscript7-x11/files/patch-src:gdevpdfw.c +++ /dev/null @@ -1,60 +0,0 @@ ---- src/gdevpdfw.c.org 2003-01-17 09:49:02.000000000 +0900 -+++ src/gdevpdfw.c 2003-09-25 17:50:54.000000000 +0900 -@@ -348,18 +348,19 @@ - /* Use the most common width as DW. */ - - { -- ushort counts[1001]; -+ ushort counts[1500*2]; /* histogram of (-1500..1500) */ - int dw_count = 0, i; - - memset(counts, 0, sizeof(counts)); - while (!psf_enumerate_glyphs_next(&genum, &glyph)) { -- int width = ppf->Widths[glyph - gs_min_cid_glyph]; -+ int cid = glyph - gs_min_cid_glyph; -+ int width = ppf->Widths[cid]; - -- counts[min(width, countof(counts) - 1)]++; -+ counts[max(0,min(width+countof(counts)/2,countof(counts)-1))]++; - } -- for (i = 0; i < countof(counts); ++i) -+ for (i = 0; i < countof(counts); i++) - if (counts[i] > dw_count) -- dw = i, dw_count = counts[i]; -+ dw = i - countof(counts)/2, dw_count = counts[i]; - if (dw != 0) - pprintd1(s, "/DW %d\n", dw); - } -@@ -496,14 +497,16 @@ - if (pdf_has_subset_prefix(chars, size)) - chars += SUBSET_PREFIX_SIZE, size -= SUBSET_PREFIX_SIZE; - pdf_put_name(pdev, chars, size); -- if (pef->sub_font_type == ft_CID_encrypted && -+ if ((pef->sub_font_type == ft_CID_encrypted || -+ pef->sub_font_type == ft_CID_TrueType) && - pef->cmapname[0] == '/' - ) { - stream_putc(s, '-'); - pdf_put_name_chars(pdev, (const byte*) (pef->cmapname + 1), - strlen(pef->cmapname + 1)); - } -- pprints1(s, "/Encoding %s", pef->cmapname); -+ pprints1(s, (pef->cmapname[0] == '/') ? "/Encoding%s" : "/Encoding %s", -+ pef->cmapname); - pprintld1(s, "/DescendantFonts[%ld 0 R]", - pdf_resource_id((const pdf_resource_t *)pef->DescendantFont)); - write_Widths = 0; -@@ -563,8 +566,10 @@ - break; - case -1: - pdf_write_CIDFont_widths(pdev, pef); -- if (pef->FontType == ft_CID_TrueType) -- pdf_write_CIDToGIDMap(pdev, pef, &cidmap_id); -+ if (pef->FontType == ft_CID_TrueType) { -+ if (pef->embed != FONT_EMBED_NO) -+ pdf_write_CIDToGIDMap(pdev, pef, &cidmap_id); -+ } - break; - } - if (pef->Differences) { - diff --git a/print/ghostscript7-x11/files/patch-src:genarch.c b/print/ghostscript7-x11/files/patch-src:genarch.c deleted file mode 100644 index a015e69e758a..000000000000 --- a/print/ghostscript7-x11/files/patch-src:genarch.c +++ /dev/null @@ -1,34 +0,0 @@ ---- src/genarch.c.orig Tue Jun 5 15:38:57 2001 -+++ src/genarch.c Wed Jun 20 04:17:42 2001 -@@ -41,6 +41,7 @@ - fprintf(f, "\n\t /* ---------------- %s ---------------- */\n\n", str); - } - -+#ifndef __FreeBSD__ - private clock_t - time_clear(char *buf, int bsize, int nreps) - { -@@ -51,6 +52,7 @@ - memset(buf, 0, bsize); - return clock() - t; - } -+#endif /* __FreeBSD__ */ - - private void - define(FILE *f, const char *str) -@@ -181,6 +183,7 @@ - fprintf(f, "((unsigned long)~0L + (unsigned long)0)\n"); - #undef PRINT_MAX - -+#ifndef __FreeBSD__ - section(f, "Cache sizes"); - - /* -@@ -241,6 +244,7 @@ - } - define_int(f, "ARCH_CACHE2_SIZE", bsize >> 1); - } -+#endif /* __FreeBSD__ */ - - section(f, "Miscellaneous"); - diff --git a/print/ghostscript7-x11/files/patch-src:gxobj.h b/print/ghostscript7-x11/files/patch-src:gxobj.h deleted file mode 100644 index f0df8565100c..000000000000 --- a/print/ghostscript7-x11/files/patch-src:gxobj.h +++ /dev/null @@ -1,17 +0,0 @@ ---- src/gxobj.h.orig Fri Feb 22 19:45:59 2002 -+++ src/gxobj.h Thu Dec 19 00:16:57 2002 -@@ -99,10 +99,14 @@ - * The final | is because back pointer values are divided by obj_back_scale, - * so objects must be aligned at least 0 mod obj_back_scale. - */ -+#if !defined(__ia64__) && !defined(__amd64__) - #define obj_align_mod\ - (((arch_align_long_mod - 1) | (arch_align_ptr_mod - 1) |\ - (arch_align_double_mod - 1) | (align_bitmap_mod - 1) |\ - (obj_back_scale - 1)) + 1) -+#else -+#define obj_align_mod 16 -+#endif - /* The only possible values for obj_align_mod are 4, 8, or 16.... */ - #if obj_align_mod == 4 - # define log2_obj_align_mod 2 diff --git a/print/ghostscript7-x11/files/patch-src:unix-dll.mak b/print/ghostscript7-x11/files/patch-src:unix-dll.mak deleted file mode 100644 index f6032f9f08ac..000000000000 --- a/print/ghostscript7-x11/files/patch-src:unix-dll.mak +++ /dev/null @@ -1,87 +0,0 @@ ---- src/unix-dll.mak.orig 2003-01-17 09:49:05.000000000 +0900 -+++ src/unix-dll.mak 2015-08-22 01:13:03.452736000 +0900 -@@ -47,12 +47,17 @@ - GSSOX=$(BINDIR)/$(SOBINRELDIR)/$(GSSOX_XENAME) - - # shared library --GS_SONAME=lib$(GS).so -+GS_SONAME_BASE=lib$(GS) -+ -+GS_SOEXT=so -+GS_SONAME=$(GS_SONAME_BASE).$(GS_SOEXT) - GS_SONAME_MAJOR=$(GS_SONAME).$(GS_VERSION_MAJOR) --GS_SONAME_MAJOR_MINOR= $(GS_SONAME).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR) -+GS_SONAME_MAJOR_MINOR=$(GS_SONAME).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR) -+LDFLAGS_SO=-shared -Wl,-soname=$(GS_SONAME_MAJOR) -+ - GS_SO=$(BINDIR)/$(GS_SONAME) --GS_SO_MAJOR=$(GS_SO).$(GS_VERSION_MAJOR) --GS_SO_MAJOR_MINOR=$(GS_SO_MAJOR).$(GS_VERSION_MINOR) -+GS_SO_MAJOR=$(BINDIR)/$(GS_SONAME_MAJOR) -+GS_SO_MAJOR_MINOR=$(BINDIR)/$(GS_SONAME_MAJOR_MINOR) - - # Shared object is built by redefining GS_XE in a recursive make. - -@@ -68,15 +73,16 @@ - - # Build the small Ghostscript loaders, with Gtk+ and without - --$(GSSOX_XE): $(GS_SO) $(GLSRC)dxmain.c -- $(GLCC) -g `gtk-config --cflags` -o $(GSSOX_XE) $(GLSRC)dxmain.c -L$(BINDIR) -l$(GS) `gtk-config --libs` -+$(GSSOX_XE): $(GS_SO) $(GLSRC)$(SOC_LOADER) -+ $(GLCC) -g -o $(GSSOX_XE) $(GLSRC)dxmainc.c -L$(BINDIR) -l$(GS) - --$(GSSOC_XE): $(GS_SO) $(GLSRC)dxmainc.c -- $(GLCC) -g -o $(GSSOC_XE) $(GLSRC)dxmainc.c -L$(BINDIR) -l$(GS) -+$(GSSOC_XE): $(GS_SO) $(GLSRC)$(SOC_LOADER) -+ $(GLCC) -g $(SOC_CFLAGS) -o $(GSSOC_XE) $(GLSRC)$(SOC_LOADER) \ -+ -L$(BINDIR) -l$(GS) $(SOC_LIBS) - - # ------------------------- Recursive make targets ------------------------- # - --SODEFS=LDFLAGS='$(LDFLAGS) $(CFLAGS_SO) -shared -Wl,-soname,$(GS_SONAME_MAJOR)'\ -+SODEFS=LDFLAGS='$(LDFLAGS) $(LDFLAGS_SO)'\ - GS_XE=$(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR)\ - STDIO_IMPLEMENTATION=c\ - DISPLAY_DEV=$(DD)$(SOOBJRELDIR)/display.dev\ -@@ -98,21 +104,26 @@ - $(MAKE) $(SODEFS) GENOPT='-DDEBUG' CFLAGS='$(CFLAGS_DEBUG) $(CFLAGS_SO) $(GCFLAGS) $(XCFLAGS)' $(GSSOC) $(GSSOX) - - install-so: so -- -mkdir -p $(prefix) -- -mkdir -p $(datadir) -- -mkdir -p $(gsdir) -- -mkdir -p $(gsdatadir) -- -mkdir -p $(bindir) -- -mkdir -p $(libdir) -- $(INSTALL_PROGRAM) $(GSSOC) $(bindir)/$(GSSOC_XENAME) -- $(INSTALL_PROGRAM) $(GSSOX) $(bindir)/$(GSSOX_XENAME) -- $(INSTALL_PROGRAM) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME_MAJOR_MINOR) -- $(RM_) $(libdir)/$(GS_SONAME) -- ln -s $(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME) -- $(RM_) $(libdir)/$(GS_SONAME_MAJOR) -- ln -s $(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME_MAJOR) -+ -mkdir -p $(DESTDIR)$(prefix) -+ -mkdir -p $(DESTDIR)$(datadir) -+ -mkdir -p $(DESTDIR)$(gsdir) -+ -mkdir -p $(DESTDIR)$(gsdatadir) -+ -mkdir -p $(DESTDIR)$(bindir) -+ -mkdir -p $(DESTDIR)$(libdir) -+ -mkdir -p $(DESTDIR)$(gsincludedir) -+ $(INSTALL_PROGRAM) $(GSSOC) $(DESTDIR)$(bindir)/$(GSSOC_XENAME) -+ $(INSTALL_PROGRAM) $(GSSOX) $(DESTDIR)$(bindir)/$(GSSOX_XENAME) -+ $(INSTALL_PROGRAM) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GS_SONAME_MAJOR_MINOR) -+ $(RM_) $(DESTDIR)$(libdir)/$(GS_SONAME) -+ ln -s $(GS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GS_SONAME) -+ $(RM_) $(DESTDIR)$(libdir)/$(GS_SONAME_MAJOR) -+ ln -s $(GS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GS_SONAME_MAJOR) -+ $(INSTALL_DATA) $(GLSRC)iapi.h $(DESTDIR)$(gsincludedir)iapi.h -+ $(INSTALL_DATA) $(GLSRC)errors.h $(DESTDIR)$(gsincludedir)ierrors.h -+ $(INSTALL_DATA) $(GLSRC)gdevdsp.h $(DESTDIR)$(gsincludedir)gdevdsp.h - --soinstall: install-so install-scripts install-data -+ -+soinstall: install-so install-scripts install-data $(INSTALL_SHARED) $(INSTALL_CONTRIB) - - # Make the build directories - SODIRS: STDDIRS diff --git a/print/ghostscript7-x11/files/patch-src:zmedia2.c b/print/ghostscript7-x11/files/patch-src:zmedia2.c deleted file mode 100644 index 9033a4388085..000000000000 --- a/print/ghostscript7-x11/files/patch-src:zmedia2.c +++ /dev/null @@ -1,25 +0,0 @@ ---- src/zmedia2.c.orig Fri Apr 27 02:57:41 2001 -+++ src/zmedia2.c Fri Nov 2 04:08:16 2001 -@@ -429,11 +429,17 @@ - - rx = ry, ry = temp; - } -- /* Adjust the medium size if flexible. */ -- if (medium->p.x < MIN_MEDIA_SIZE && mx > rx) -- mx = rx; -- if (medium->p.y < MIN_MEDIA_SIZE && my > ry) -- my = ry; -+ /* If 'medium' is flexible, adjust 'mx' and 'my' towards 'rx' and 'ry', -+ respectively. Note that 'mx' and 'my' have just acquired the largest -+ permissible value, medium->q. */ -+ if (medium->p.x < mx) /* non-empty width range */ -+ if (rx < medium->p.x) mx = medium->p.x; /* minimum */ -+ else if (mx > rx) mx = rx; /* fits */ -+ /* else use medium->q.x, i.e., the maximum */ -+ if (medium->p.y < my) /* non-empty height range */ -+ if (ry < medium->p.y) my = medium->p.y; /* minimum */ -+ else if (my > ry) my = ry; /* fits */ -+ /* else use medium->q.y, i.e., the maximum */ - - /* Translate to align the centers. */ - gs_make_translation(mx / 2, my / 2, pmat); diff --git a/print/ghostscript7-x11/files/patch-src_Makefile.in b/print/ghostscript7-x11/files/patch-src_Makefile.in new file mode 100644 index 000000000000..75486c028035 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_Makefile.in @@ -0,0 +1,166 @@ +--- src/Makefile.in.orig 2003-04-29 18:33:31 UTC ++++ src/Makefile.in +@@ -50,8 +50,10 @@ PSD=$(PSGENDIR)/ + # initialization files (gs_*.ps) and the fonts. + + INSTALL = $(GLSRCDIR)/instcopy -c +-INSTALL_PROGRAM = $(INSTALL) -m 755 +-INSTALL_DATA = $(INSTALL) -m 644 ++INSTALL_PROGRAM = ${BSD_INSTALL_PROGRAM} ++INSTALL_SCRIPT = ${BSD_INSTALL_SCRIPT} ++INSTALL_DATA = ${BSD_INSTALL_DATA} ++INSTALL_SHARED = @INSTALL_SHARED@ + + prefix = @prefix@ + exec_prefix = @exec_prefix@ +@@ -63,6 +65,8 @@ man1ext = 1 + datadir = @datadir@ + gsdir = $(datadir)/ghostscript + gsdatadir = $(gsdir)/$(GS_DOT_VERSION) ++gssharedir = @libdir@/ghostscript/$(GS_DOT_VERSION) ++gsincludedir = @includedir@/ghostscript/ + + docdir=$(gsdatadir)/doc + exdir=$(gsdatadir)/examples +@@ -142,7 +146,7 @@ JVERSION=6 + # some older JPEG streams that violate the standard. If the JPEG + # library built from local sources, the patch will be applied. + +-SHARE_JPEG=@SHARE_LIBJPEG@ ++SHARE_JPEG=1 + JPEG_NAME=jpeg + + # Define the directory where the PNG library sources are stored, +@@ -150,14 +154,14 @@ JPEG_NAME=jpeg + # You may need to change this if the libpng version changes. + # See libpng.mak for more information. + +-SHARE_LIBPNG=@SHARE_LIBPNG@ ++SHARE_LIBPNG=1 + PSRCDIR=@LIBPNGDIR@ + LIBPNG_NAME=png + + # Define the directory where the zlib sources are stored. + # See zlib.mak for more information. + +-SHARE_ZLIB=@SHARE_ZLIB@ ++SHARE_ZLIB=1 + ZSRCDIR=@ZLIBDIR@ + #ZLIB_NAME=gz + ZLIB_NAME=z +@@ -197,15 +201,15 @@ CC=@CC@ + CCLD=$(CC) + + # Define the general cc flags, warnings and such. +-GCFLAGS=@GCFLAGS@ ++GCFLAGS=@CPPFLAGS@ @GCFLAGS@ @CFLAGS@ + + # Define the added flags for standard, debugging, profiling + # and shared object builds. + +-CFLAGS_STANDARD=@OPT_CFLAGS@ ++CFLAGS_STANDARD?=@OPT_CFLAGS@ + CFLAGS_DEBUG=-g -O + CFLAGS_PROFILE=-pg @OPT_CFLAGS@ +-CFLAGS_SO=-fPIC ++CFLAGS_SO=@DYNAMIC_CFLAGS@ + + # Define the other compilation flags. Add at most one of the following: + # -DBSD4_2 for 4.2bsd systems. +@@ -218,7 +222,7 @@ CFLAGS_SO=-fPIC + # We don't include -ansi, because this gets in the way of the platform- + # specific stuff that typically needs; nevertheless, we expect + # gcc to accept ANSI-style function prototypes and function definitions. +-XCFLAGS= ++XCFLAGS=@DYNAMIC_FLAGS@ + + # defines from autoconf; note that we don't use these at present. + ACDEFS=@DEFS@ +@@ -232,9 +236,9 @@ CFLAGS=$(CFLAGS_STANDARD) $(GCFLAGS) $(X + # -R /usr/local/xxx/lib:/usr/local/lib + # giving the full path names of the shared library directories. + # XLDFLAGS can be set from the command line. +-XLDFLAGS= + +-LDFLAGS=$(XLDFLAGS) ++LDFLAGS=@LDFLAGS@ ++XLDFLAGS=$(LDFLAGS) + + # Define any extra libraries to link into the executable. + # ISC Unix 2.2 wants -linet. +@@ -243,7 +247,7 @@ LDFLAGS=$(XLDFLAGS) + # Solaris may need -lnsl -lsocket -lposix4. + # (Libraries required by individual drivers are handled automatically.) + +-EXTRALIBS= ++EXTRALIBS=@LIBS@ @DYNAMIC_LIBS@ + + # Define the standard libraries to search at the end of linking. + # Most platforms require -lpthread for the POSIX threads library; +@@ -252,10 +256,7 @@ EXTRALIBS= + # All reasonable platforms require -lm, but Rhapsody and perhaps one or + # two others fold libm into libc and don't require any additional library. + +-#STDLIBS=-lpthread -lm +- +-# Since the default build is for nosync, don't include pthread lib +-STDLIBS=-lm ++STDLIBS=@PTHREAD_LIBS@ -lm + + # Define the include switch(es) for the X11 header files. + # This can be null if handled in some other way (e.g., the files are +@@ -279,9 +280,10 @@ XINCLUDE=@X_CFLAGS@ + # should be slotted into XLIBS below and X_PRE_LIBS which should go + # before -lX11. We do not handle these and should, but they are empty + # on most modern platforms. +-XLIBDIRS=@X_LIBS@ ++XLIBDIRS=@X_LDFLAGS@ + XLIBDIR= +-XLIBS=Xt Xext X11 ++#XLIBS=Xt Xext X11 ++XLIBS=@X_LIBS@ + + # Define whether this platform has floating point hardware: + # FPU_TYPE=2 means floating point is faster than fixed point. +@@ -301,15 +303,19 @@ USE_ASM=0 + # primitives for this platform. + + # If POSIX sync primitives are used, also change the STDLIBS to include +-# the pthread library. ++# the pthread library. Otherwise use SYNC=nosync + #SYNC=posync +- +-# Default is No sync primitives since some platforms don't have it (HP-UX) +-SYNC=nosync ++#SYNC=nosync ++SYNC=@SYNC@ + + # programs we use + RM=rm -f + ++# ------ Dynamic loader options ------- # ++SOC_CFLAGS = @SOC_CFLAGS@ ++SOC_LIBS = @SOC_LIBS@ ++SOC_LOADER = @SOC_LOADER@ ++ + # ------ Devices and features ------ # + + # Choose the language feature(s) to include. See gs.mak for details. +@@ -385,6 +391,9 @@ DEVICE_DEVS18= + DEVICE_DEVS19= + DEVICE_DEVS20=$(DD)cljet5.dev $(DD)cljet5c.dev + ++# Shared library target to build. ++GS_SHARED_OBJS=@DYNAMIC_DEVS@ ++ + # ---------------------------- End of options --------------------------- # + + # Define the name of the partial makefile that specifies options -- +@@ -407,6 +416,7 @@ CC_LEAF_PG=$(CC_) + # These are the specific warnings we have to turn off to compile those + # specific few files that need this. We may turn off others in the future. + CC_NO_WARN=$(CC_) ++CC_SHARED=$(CC_) @DYNAMIC_LDFLAGS@ + + # ---------------- End of platform-specific section ---------------- # + diff --git a/print/ghostscript7-x11/files/patch-src_configure.ac b/print/ghostscript7-x11/files/patch-src_configure.ac new file mode 100644 index 000000000000..625d20219c70 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_configure.ac @@ -0,0 +1,199 @@ +--- src/configure.ac.orig 2003-04-16 13:59:56 UTC ++++ src/configure.ac +@@ -8,6 +8,46 @@ AC_INIT + AC_PREREQ(2.52) + AC_CONFIG_SRCDIR(src/gs.c) + ++CFLAGS="${CFLAGS:=}" ++CPPFLAGS="${CPPFLAGS:=}" ++CXXFLAGS="${CXXFLAGS:=}" ++LDFLAGS="${LDFLAGS:=}" ++ ++dnl -------------------------------------------------- ++dnl Local utilities ++dnl -------------------------------------------------- ++ ++dnl GS_SPLIT_LIBS( LIBS, LINKLINE ) ++dnl Split a unix-style link line into a list of ++dnl bare library names. For example, the line ++dnl '-L/usr/X11R6/lib -lX11 -lXt' splits into ++dnl LIB='X11 Xt' ++dnl ++AC_DEFUN([GS_SPLIT_LIBS], [ ++# the makefile wants a list of just the library names ++for gs_item in $2; do ++ gs_stripped_item=`echo "$gs_item" | sed -e 's/^-l//'` ++ if test "x$gs_stripped_item" != "x$gs_item"; then ++ $1="$[$1] $gs_stripped_item" ++ fi ++done ++]) ++ ++dnl GS_SPLIT_LIBPATHS( LIBPATHS, LINKLINE ) ++dnl Split a unix-style link line into a list of ++dnl bare search path entries. For example, ++dnl '-L/usr/X11R6/lib -lX11 -L/opt/lib -lXt' ++dnl splits to LIBPATHS='/usr/X11R6/lib /opt/lib' ++dnl ++AC_DEFUN([GS_SPLIT_LIBPATHS], [ ++for gs_item in $2; do ++ gs_stripped_item=`echo "$gs_item" | sed -e 's/-L//'` ++ if test "x$gs_stripped_item" != "x$gs_item"; then ++ $1="$[$1] $gs_stripped_item" ++ fi ++done ++]) ++ + dnl -------------------------------------------------- + dnl Check for programs + dnl -------------------------------------------------- +@@ -94,33 +134,15 @@ dnl Check for libraries + dnl -------------------------------------------------- + + AC_CHECK_LIB(m, cos) +-dnl AC_CHECK_LIB(pthread, pthread_create) ++SYNC="nosync" ++PTHREAD_LIBS="" ++AC_CHECK_LIB(pthread, pthread_create, [ ++ SYNC=posync; ++ PTHREAD_LIBS="-lpthread" ++]) ++AC_SUBST(SYNC) ++AC_SUBST(PTHREAD_LIBS) + +-AC_MSG_CHECKING([for local jpeg library source]) +-dnl At present, we give the local source priority over the shared +-dnl build, so that the D_MAX_BLOCKS_IN_MCU patch will be applied. +-dnl A more sophisticated approach would be to test the shared lib +-dnl to see whether it has already been patched. +-LIBJPEGDIR=src +-if test -d jpeg; then +- AC_MSG_RESULT([jpeg]) +- SHARE_LIBJPEG=0 +- LIBJPEGDIR=jpeg +-elif test -d jpeg-6b; then +- AC_MSG_RESULT([jpeg-6b]) +- SHARE_LIBJPEG=0 +- LIBJPEGDIR=jpeg-6b +-else +- AC_MSG_RESULT([no]) +- AC_CHECK_LIB(jpeg, jpeg_set_defaults, [SHARE_LIBJPEG=1], [ +- AC_MSG_ERROR([I wasn't able to find a copy +- of the jpeg library. This is required for compiling +- ghostscript. Please download a copy of the source, e.g. +- from http://www.ijg.org/, unpack it at the top level of +- the gs source tree, and rename the directory to 'jpeg'. +- ]) +- ]) +-fi + AC_SUBST(SHARE_LIBJPEG) + AC_SUBST(LIBJPEGDIR) + +@@ -211,15 +233,68 @@ fi + AC_SUBST(STPLIB) + AC_SUBST(STPDEVS) + ++SOC_CFLAGS="" ++SOC_LIBS="" ++SOC_LOADER="dxmainc.c" ++ ++AC_SUBST(SOC_CFLAGS) ++AC_SUBST(SOC_LIBS) ++AC_SUBST(SOC_LOADER) ++ + dnl optional X11 for display devices + AC_PATH_XTRA +-if test x"$no_x" = x"yes"; then +- AC_MSG_NOTICE([disabling X11 output devices]) +- X11DEVS='' +-else +- X11DEVS='$(DD)x11.dev $(DD)x11alpha.dev $(DD)x11cmyk.dev $(DD)x11gray2.dev $(DD)x11gray4.dev $(DD)x11mono.dev' ++ ++X_LDFLAGS="" ++X_CFLAGS="" ++X_DEVS="" ++X_LIBS="" ++ ++if test x$with_x != xno; then ++ if test "$x_libraries" = "/usr/lib"; then ++ echo "Ignoring X library directory \"$x_libraries\" requested by configure." ++ x_libraries="NONE" ++ fi ++ if test ! "$x_libraries" = "NONE" -a ! "$x_libraries" = ""; then ++ X_LDFLAGS="-L$x_libraries" ++ if test "$uname" = "SunOS"; then ++ X_LDFLAGS="$X_LDFLAGS -R$x_libraries" ++ fi ++ fi ++ ++ if test "$x_includes" = "/usr/include"; then ++ echo "Ignoring X include directory \"$x_includes\" requested by configure." ++ x_includes="NONE" ++ fi ++ if test ! "$x_includes" = "NONE" -a ! "$x_includes" = ""; then ++ X_CFLAGS="-I$x_includes" ++ fi ++ ++ SAVELIBS="$LIBS" ++ SAVELDFLAGS="$LDFLAGS" ++ LDFLAGS="$LDFLAGS $X_LDFLAGS" ++ ++ AC_CHECK_LIB(X11,XOpenDisplay) ++ AC_CHECK_LIB(Xext,XdbeQueryExtension) ++ AC_CHECK_LIB(Xt,XtAppCreateShell) ++ ++ LDFLAGS="$SAVELDFLAGS" ++ LIBS="$SAVELIBS" ++ ++ if test "$ac_cv_lib_Xt_XtAppCreateShell" = yes; then ++ X11DEVS="\$(DD)x11.dev \$(DD)x11alpha.dev \$(DD)x11cmyk.dev \$(DD)x11mono.dev \$(DD)x11_.dev \$(DD)x11alt_.dev \$(DD)x11cmyk2.dev \$(DD)x11cmyk4.dev \$(DD)x11cmyk8.dev \$(DD)x11rg16x.dev \$(DD)x11rg32x.dev \$(DD)x11gray2.dev \$(DD)x11gray4.dev" ++ X_DEVS=$X11DEVS ++ # the makefile wants a list of just the library names in X_LIBS ++ GS_SPLIT_LIBS([X_LIBS], ++ [-lXt $X_PRE_LIBS -lXext -lX11 $X_EXTRA_LIBS]) ++ fi + fi ++ ++AC_SUBST(X_LDFLAGS) ++AC_SUBST(X_CFLAGS) ++AC_SUBST(X_LIBS) ++AC_SUBST(X_DEVS) + AC_SUBST(X11DEVS) ++AC_SUBST(XLIBS) + + dnl executible name + AC_ARG_WITH(gs, AC_HELP_STRING([--with-gs=NAME], +@@ -236,6 +311,33 @@ AC_ARG_ENABLE(compile-inits, AC_HELP_STR + fi]) + AC_SUBST(COMPILE_INITS) + ++dnl Dynamic device support. ++DYNAMIC_CFLAGS="" ++DYNAMIC_DEVS="" ++DYNAMIC_FLAGS="" ++DYNAMIC_LDFLAGS="" ++DYNAMIC_LIBS="" ++INSTALL_SHARED="" ++ ++AC_ARG_ENABLE([dynamic], AC_HELP_STRING([--enable-dynamic], ++ [Enable dynamically loaded drivers]), ++[ ++ INSTALL_SHARED="install-shared" ++ DYNAMIC_CFLAGS="-fPIC" ++ DYNAMIC_DEVS="\$(GLOBJDIR)/X11.so" ++ DYNAMIC_FLAGS="-DGS_DEVS_SHARED -DGS_DEVS_SHARED_DIR=\\\"\$(gssharedir)\\\"" ++ DYNAMIC_LDFLAGS="-fPIC -shared" ++ DYNAMIC_LIBS="" ++ X_DEVS="" ++]) ++ ++AC_SUBST(DYNAMIC_CFLAGS) ++AC_SUBST(DYNAMIC_DEVS) ++AC_SUBST(DYNAMIC_FLAGS) ++AC_SUBST(DYNAMIC_LDFLAGS) ++AC_SUBST(DYNAMIC_LIBS) ++AC_SUBST(INSTALL_SHARED) ++ + dnl -------------------------------------------------- + dnl Check for library functions + dnl -------------------------------------------------- diff --git a/print/ghostscript7-x11/files/patch-src_devs.mak b/print/ghostscript7-x11/files/patch-src_devs.mak new file mode 100644 index 000000000000..4b6aa33bbf6b --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_devs.mak @@ -0,0 +1,65 @@ +--- src/devs.mak.orig 2003-03-11 11:59:10 UTC ++++ src/devs.mak +@@ -405,7 +405,7 @@ $(DD)lvga256.dev : $(DEVS_MAK) $(lvga256 + $(ADDMOD) $(DD)lvga256 -lib vga vgagl + + $(GLOBJ)gdevl256.$(OBJ) : $(GLSRC)gdevl256.c $(GDEV) $(memory__h) +- $(GLCC) $(GLO_)gdevl256.$(OBJ) $(C_) $(GLSRC)gdevl256.c ++ $(GLCCSHARED) $(GLO_)gdevl256.$(OBJ) $(C_) $(GLSRC)gdevl256.c + + vgalib_=$(GLOBJ)gdevvglb.$(OBJ) $(GLOBJ)gdevpccm.$(OBJ) + $(DD)vgalib.dev : $(DEVS_MAK) $(vgalib_) +@@ -413,7 +413,7 @@ $(DD)vgalib.dev : $(DEVS_MAK) $(vgalib_) + $(ADDMOD) $(DD)vgalib -lib vga + + $(GLOBJ)gdevvglb.$(OBJ) : $(GLSRC)gdevvglb.c $(GDEV) $(gdevpccm_h) $(gsparam_h) +- $(GLCC) $(GLO_)gdevvglb.$(OBJ) $(C_) $(GLSRC)gdevvglb.c ++ $(GLCCSHARED) $(GLO_)gdevvglb.$(OBJ) $(C_) $(GLSRC)gdevvglb.c + + ### -------------------------- The X11 device -------------------------- ### + +@@ -443,24 +443,24 @@ GDEVX=$(GDEV) $(x__h) $(gdevx_h) $(TOP_M + $(GLOBJ)gdevx.$(OBJ) : $(GLSRC)gdevx.c $(GDEVX) $(math__h) $(memory__h)\ + $(gscoord_h) $(gsdevice_h) $(gsiparm2_h) $(gsmatrix_h) $(gsparam_h)\ + $(gxdevmem_h) $(gxgetbit_h) $(gxiparam_h) $(gxpath_h) +- $(GLCC) $(XINCLUDE) $(GLO_)gdevx.$(OBJ) $(C_) $(GLSRC)gdevx.c ++ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevx.$(OBJ) $(C_) $(GLSRC)gdevx.c + + $(GLOBJ)gdevxcmp.$(OBJ) : $(GLSRC)gdevxcmp.c $(GDEVX) $(math__h) +- $(GLCC) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c ++ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxcmp.$(OBJ) $(C_) $(GLSRC)gdevxcmp.c + + $(GLOBJ)gdevxini.$(OBJ) : $(GLSRC)gdevxini.c $(GDEVX) $(memory__h)\ + $(gserrors_h) $(gsparamx_h) $(gxdevmem_h) $(gdevbbox_h) +- $(GLCC) $(XINCLUDE) $(GLO_)gdevxini.$(OBJ) $(C_) $(GLSRC)gdevxini.c ++ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxini.$(OBJ) $(C_) $(GLSRC)gdevxini.c + + # We have to compile gdevxres without warnings, because there is a + # const/non-const cast required by the X headers that we can't work around. + $(GLOBJ)gdevxres.$(OBJ) : $(GLSRC)gdevxres.c $(std_h) $(x__h)\ + $(gsmemory_h) $(gstypes_h) $(gxdevice_h) $(gdevx_h) +- $(CC_NO_WARN) $(GLCCFLAGS) $(XINCLUDE) $(GLO_)gdevxres.$(OBJ) $(C_) $(GLSRC)gdevxres.c ++ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxres.$(OBJ) $(C_) $(GLSRC)gdevxres.c + + $(GLOBJ)gdevxxf.$(OBJ) : $(GLSRC)gdevxxf.c $(GDEVX) $(math__h) $(memory__h)\ + $(gsstruct_h) $(gsutil_h) $(gxxfont_h) +- $(GLCC) $(XINCLUDE) $(GLO_)gdevxxf.$(OBJ) $(C_) $(GLSRC)gdevxxf.c ++ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxxf.$(OBJ) $(C_) $(GLSRC)gdevxxf.c + + # Alternate X11-based devices to help debug other drivers. + # x11alpha pretends to have 4 bits of alpha channel. +@@ -510,7 +510,13 @@ $(DD)x11rg32x.dev : $(DEVS_MAK) $(DD)x11 + + $(GLOBJ)gdevxalt.$(OBJ) : $(GLSRC)gdevxalt.c $(GDEVX) $(math__h) $(memory__h)\ + $(gsdevice_h) $(gsparam_h) $(gsstruct_h) +- $(GLCC) $(XINCLUDE) $(GLO_)gdevxalt.$(OBJ) $(C_) $(GLSRC)gdevxalt.c ++ $(GLCCSHARED) $(XINCLUDE) $(GLO_)gdevxalt.$(OBJ) $(C_) $(GLSRC)gdevxalt.c ++ ++### Shared library object supporting X11. ++### NON PORTABLE, ONLY UNIX WITH GCC SUPPORT ++ ++$(GLOBJ)X11.so : $(x11alt_) $(x11_) ++ $(CCLD) $(LDFLAGS) -shared -o $(GLOBJ)X11.so $(x11alt_) $(x11_) -L${LOCALBASE}/lib -lXt -lSM -lICE -lXext -lX11 $(XLIBDIRS) + + ###### --------------- Memory-buffered printer devices --------------- ###### + diff --git a/print/ghostscript7-x11/files/patch-src_gconf.c b/print/ghostscript7-x11/files/patch-src_gconf.c new file mode 100644 index 000000000000..4939f12942ab --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gconf.c @@ -0,0 +1,43 @@ +--- src/gconf.c.orig 2003-01-17 00:49:00 UTC ++++ src/gconf.c +@@ -81,7 +81,8 @@ + /* Set up the device table. */ + #define device_(dev) (const gx_device *)&dev, + #define device2_(dev) &dev, +-private const gx_device *const gx_device_list[] = { ++static const gx_device *gx_device_list[1024] = { ++ /* as shared library are adding drivers here, so removed constness */ + #include "gconf.h" + 0 + }; +@@ -149,9 +150,29 @@ int + gs_lib_device_list(const gx_device * const **plist, + gs_memory_struct_type_t ** pst) + { ++ int i; ++ + if (plist != 0) + *plist = gx_device_list; + if (pst != 0) + *pst = NULL; +- return countof(gx_device_list) - 1; ++ ++ for (i = 0; i < countof(gx_device_list) - 1; ++i) ++ if (!gx_device_list[i]) ++ break; ++ return i; + } ++ ++#ifdef GS_DEVS_SHARED ++void ++gs_lib_register_device(const gx_device *dev) ++{ ++ int i; ++ ++ for (i = 0; i < countof(gx_device_list) - 1; ++i) ++ if (!gx_device_list[i]) { ++ gx_device_list[i] = dev; ++ return; ++ } ++} ++#endif diff --git a/print/ghostscript7-x11/files/patch-src_gdevhl12.c b/print/ghostscript7-x11/files/patch-src_gdevhl12.c index 2976befa7cbe..c6fde2f981cf 100644 --- a/print/ghostscript7-x11/files/patch-src_gdevhl12.c +++ b/print/ghostscript7-x11/files/patch-src_gdevhl12.c @@ -1,6 +1,6 @@ ---- src/gdevhl12.c.orig Sun Aug 1 13:39:19 2004 -+++ src/gdevhl12.c Sun Aug 1 13:40:07 2004 -@@ -640,7 +640,7 @@ +--- src/gdevhl12.c.orig 2002-09-22 23:15:05 UTC ++++ src/gdevhl12.c +@@ -640,7 +640,7 @@ hl1250_print_page_copies(gx_device_print case TRAY_MANUAL: tray_pcl = "\033&l2H"; break; diff --git a/print/ghostscript7-x11/files/patch-src_gdevijs.c b/print/ghostscript7-x11/files/patch-src_gdevijs.c new file mode 100644 index 000000000000..1affce3e86d8 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevijs.c @@ -0,0 +1,659 @@ +--- src/gdevijs.c.orig 2003-01-17 00:49:00 UTC ++++ src/gdevijs.c +@@ -29,15 +29,29 @@ + * which is a security risk, since any program can be run. + * You should use -dSAFER which sets .LockSafetyParams to true + * before opening this device. ++ * ++ * 11/26/03 David Suffield ++ * (c) 2003-2004 Copyright Hewlett-Packard Development Company, LP ++ * ++ * 1. Removed hpijs 1.0-1.0.2 workarounds, use hpijs 1.0.3 or higher. ++ * 2. Added krgb support. ++ * ++ * 02/21/05 David Suffield ++ * 1. Fixed segfault issue with 1-bit color space. ++ * 2. Fixed z-order issue with colored text on black rectangle. ++ * + */ + + #include "unistd_.h" /* for dup() */ + #include ++#include + #include "gdevprn.h" + #include "gp.h" + #include "ijs.h" + #include "ijs_client.h" + ++//#define KRGB_DEBUG ++ + /* This should go into gdevprn.h, or, better yet, gdevprn should + acquire an API for changing resolution. */ + int gdev_prn_maybe_realloc_memory(gx_device_printer *pdev, +@@ -53,6 +67,14 @@ private dev_proc_output_page(gsijs_outpu + private dev_proc_get_params(gsijs_get_params); + private dev_proc_put_params(gsijs_put_params); + ++/* Following definitions are for krgb support. */ ++private dev_proc_create_buf_device(gsijs_create_buf_device); ++private dev_proc_fill_rectangle(gsijs_fill_rectangle); ++private dev_proc_copy_mono(gsijs_copy_mono); ++private dev_proc_fill_mask(gsijs_fill_mask); ++private dev_proc_fill_path(gsijs_fill_path); ++private dev_proc_stroke_path(gsijs_stroke_path); ++ + private const gx_device_procs gsijs_procs = + prn_color_params_procs(gsijs_open, gsijs_output_page, gsijs_close, + gx_default_rgb_map_rgb_color, gx_default_rgb_map_color_rgb, +@@ -85,6 +107,14 @@ struct gx_device_ijs_s { + + IjsClientCtx *ctx; + int ijs_version; ++ ++ /* Additional parameters for krgb support. */ ++ int krgb_mode; /* 0=false, 1=true */ ++ int k_path; /* k plane path, 0=false, 1=true */ ++ int k_width; /* k plane width in pixels */ ++ int k_band_size; /* k plane buffer size in bytes, byte aligned */ ++ unsigned char *k_band; /* k plane buffer */ ++ gx_device_procs prn_procs; /* banding playback procedures */ + }; + + #define DEFAULT_DPI 74 /* See gsijs_set_resolution() below. */ +@@ -112,7 +142,12 @@ gx_device_ijs gs_ijs_device = + FALSE, /* Tumble_set */ + + NULL, /* IjsClient *ctx */ +- 0 /* ijs_version */ ++ 0, /* ijs_version */ ++ 0, /* krgb_mode */ ++ 0, /* k_path */ ++ 0, /* k_width */ ++ 0, /* k_band_size */ ++ NULL /* k_band buffer */ + }; + + +@@ -128,12 +163,254 @@ private int gsijs_read_string(gs_param_l + + /**************************************************************************/ + +-/* ------ Private definitions ------ */ ++/* ---------------- Low-level graphic procedures ---------------- */ + +-/* Versions 1.0 through 1.0.2 of hpijs report IJS version 0.29, and +- require some workarounds. When more up-to-date hpijs versions +- become ubiquitous, all these workarounds should be removed. */ +-#define HPIJS_1_0_VERSION 29 ++static unsigned char xmask[] = ++{ ++ 0x80, /* x=0 */ ++ 0x40, /* 1 */ ++ 0x20, /* 2 */ ++ 0x10, /* 3 */ ++ 0x08, /* 4 */ ++ 0x04, /* 5 */ ++ 0x02, /* 6 */ ++ 0x01 /* 7 */ ++}; ++ ++private int gsijs_fill_rectangle(gx_device * dev, int x, int y, int w, int h, ++ gx_color_index color) ++{ ++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; ++ ++ if (ijsdev->krgb_mode && ijsdev->k_path && y >= 0 && x >= 0) ++ { ++ int raster = (ijsdev->k_width+7) >> 3; ++ register unsigned char *dest=ijsdev->k_band+(raster*y)+(x >> 3); ++ int dest_start_bit = x & 7; ++ int i,j,w1; ++ ++ if (h <= 0 || w <= 0) ++ return 0; ++ ++ if ((x+w) > ijsdev->k_width) ++ w1 = ijsdev->k_width - x; ++ else ++ w1 = w; ++ ++ /* Note x,y orgin 0,0 is stored first byte 0 left to right. */ ++ ++ if (color==0x0) ++ { ++ /* Color is black, store in k plane band instead of regular band. */ ++ for (j=0; j>3] |= xmask[(dest_start_bit+i)&7]; ++ dest+=raster; ++ } ++ return 0; ++ } ++ else ++ { ++ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */ ++ for (j=0; j>3] &= ~xmask[(dest_start_bit+i)&7]; ++ dest+=raster; ++ } ++ } ++ } ++ ++ return (*ijsdev->prn_procs.fill_rectangle)(dev, x, y, w, h, color); ++} ++ ++private int gsijs_copy_mono(gx_device * dev, const byte * data, ++ int dx, int draster, gx_bitmap_id id, ++ int x, int y, int w, int height, gx_color_index zero, gx_color_index one) ++{ ++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; ++ ++ // if (ijsdev->krgb_mode && ijsdev->k_path && one==0x0) ++ if (ijsdev->krgb_mode && ijsdev->k_path) ++ { ++ /* Store in k plane band instead of regular band. */ ++ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */ ++ register unsigned char *dest=ijsdev->k_band+(raster*y)+(x >> 3); ++ register const unsigned char *scan=data+(dx >> 3); ++ int dest_start_bit = x & 7; ++ int scan_start_bit = dx & 7; ++ int i, h=height; ++ ++ if (h <= 0 || w <= 0) ++ return 0; ++ ++ if (one==0x0) ++ { ++ /* Color is black, store in k plane band instead of regular band. */ ++ while (h-- > 0) ++ { ++ for (i=0; i>3] & xmask[(scan_start_bit+i)&7]) ++ dest[(dest_start_bit+i)>>3] |= xmask[(dest_start_bit+i)&7]; ++ } ++ scan+=draster; ++ dest+=raster; ++ } ++ return 0; ++ } ++ else ++ { ++ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */ ++ while (h-- > 0) ++ { ++ for (i=0; i>3] & xmask[(scan_start_bit+i)&7]) ++ dest[(dest_start_bit+i)>>3] &= ~xmask[(dest_start_bit+i)&7]; ++ } ++ scan+=draster; ++ dest+=raster; ++ } ++ } ++ } ++ ++ return (*ijsdev->prn_procs.copy_mono)(dev, data, dx, draster, id, x, y, w, height, zero, one); ++} ++ ++/* ---------------- High-level graphic procedures ---------------- */ ++ ++private int gsijs_fill_mask(gx_device * dev, ++ const byte * data, int dx, int raster, gx_bitmap_id id, ++ int x, int y, int w, int h, ++ const gx_drawing_color * pdcolor, int depth, ++ gs_logical_operation_t lop, const gx_clip_path * pcpath) ++{ ++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; ++ int code; ++ ++ ijsdev->k_path = 1; ++ ++ code = (*ijsdev->prn_procs.fill_mask)(dev, data, dx, raster, id, x, y, w, h, pdcolor, depth, lop, pcpath); ++ ++ ijsdev->k_path = 0; ++ ++ return code; ++} ++ ++private int gsijs_fill_path(gx_device * dev, const gs_imager_state * pis, ++ gx_path * ppath, const gx_fill_params * params, ++ const gx_drawing_color * pdcolor, ++ const gx_clip_path * pcpath) ++{ ++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; ++ int code; ++ ++ ijsdev->k_path = 1; ++ ++ code = (*ijsdev->prn_procs.fill_path)(dev, pis, ppath, params, pdcolor, pcpath); ++ ++ ijsdev->k_path = 0; ++ ++ return 0; ++} ++ ++private int gsijs_stroke_path(gx_device * dev, const gs_imager_state * pis, ++ gx_path * ppath, const gx_stroke_params * params, ++ const gx_drawing_color * pdcolor, ++ const gx_clip_path * pcpath) ++{ ++ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target; ++ int code; ++ ++ ijsdev->k_path = 1; ++ ++ code = (*ijsdev->prn_procs.stroke_path)(dev, pis, ppath, params, pdcolor, pcpath); ++ ++ ijsdev->k_path = 0; ++ ++ return code; ++} ++ ++/* ---------------- krgb banding playback procedures ---------------- */ ++ ++private int gsijs_get_bits(gx_device_printer * pdev, int y, byte * str, byte ** actual_data) ++{ ++ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev; ++ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev; ++ int band_height = cdev->page_info.band_params.BandHeight; ++ int band_number = y/band_height; ++ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */ ++ int y1=raster*(y-(band_height*band_number)); ++ ++ if (y1 == 0) ++ { ++ /* First raster for band, clear k_band. Banding playback occurs on first raster. */ ++ memset(ijsdev->k_band, 0, ijsdev->k_band_size); ++ } ++ ++ return gdev_prn_get_bits(pdev, y, str, actual_data); /* get raster from regular band */ ++} ++ ++private int gsijs_k_get_bits(gx_device_printer * pdev, int y, byte ** actual_data) ++{ ++ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev; ++ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev; ++ int band_height = cdev->page_info.band_params.BandHeight; ++ int band_number = y/band_height; ++ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */ ++ int y1=raster*(y-(band_height*band_number)); ++ ++ *actual_data = ijsdev->k_band+y1; ++ ++ return 0; ++} ++ ++private int gsijs_create_buf_device(gx_device **pbdev, gx_device *target, ++ const gx_render_plane_t *render_plane, gs_memory_t *mem, bool for_band) ++{ ++ gx_device_ijs *ijsdev = (gx_device_ijs *)target; ++ int n_chan = ijsdev->color_info.num_components; ++ int code = gx_default_create_buf_device(pbdev, target, render_plane, mem, for_band); ++ if (code < 0 || n_chan != 3) ++ return code; ++ ++ /* Save buffer (vector) procedures so that we can hook them during banding playback. */ ++ ijsdev->prn_procs = (*pbdev)->procs; ++ ++ /* Replace buffer procedures with krgb procedures. */ ++ set_dev_proc(*pbdev, fill_rectangle, gsijs_fill_rectangle); ++ set_dev_proc(*pbdev, copy_mono, gsijs_copy_mono); ++ set_dev_proc(*pbdev, fill_mask, gsijs_fill_mask); ++ set_dev_proc(*pbdev, fill_path, gsijs_fill_path); ++ set_dev_proc(*pbdev, stroke_path, gsijs_stroke_path); ++ ++ return code; ++} ++ ++/* See if IJS server supports krgb. Return value: 0=false, 1=true. */ ++private int ++gsijs_set_krgb_mode(gx_device_ijs *ijsdev) ++{ ++ char buf[256]; ++ int n_chan = ijsdev->color_info.num_components; ++ int code; ++ ++ if (n_chan != 3) ++ return 0; /* no krgb support, not RGB colorspace */ ++ ++ buf[0] = 0; ++ code = ijs_client_enum_param(ijsdev->ctx, 0, "ColorSpace", buf, sizeof(buf)-1); ++ if (code >= 0) ++ buf[code] = 0; ++ if (strstr(buf, "KRGB") == NULL) ++ return 0; /* no krgb support */ ++ ++ return 1; /* krgb is supported */ ++} ++ ++/* ------ Private definitions ------ */ + + private int + gsijs_parse_wxh (const char *val, int size, double *pw, double *ph) +@@ -171,34 +448,6 @@ gsijs_parse_wxh (const char *val, int si + } + + /** +- * gsijs_set_generic_params_hpijs: Set generic IJS parameters. +- * +- * This version is specialized for hpijs 1.0 through 1.0.2, and +- * accommodates a number of quirks. +- **/ +-private int +-gsijs_set_generic_params_hpijs(gx_device_ijs *ijsdev) +-{ +- char buf[256]; +- int code = 0; +- +- /* IjsParams, Duplex, and Tumble get set at this point because +- they may affect margins. */ +- if (ijsdev->IjsParams) { +- code = gsijs_client_set_param(ijsdev, "IjsParams", ijsdev->IjsParams); +- } +- +- if (code == 0 && ijsdev->Duplex_set) { +- int duplex_val; +- +- duplex_val = ijsdev->Duplex ? (ijsdev->IjsTumble ? 1 : 2) : 0; +- sprintf (buf, "%d", duplex_val); +- code = gsijs_client_set_param(ijsdev, "Duplex", buf); +- } +- return code; +-} +- +-/** + * gsijs_set_generic_params: Set generic IJS parameters. + **/ + private int +@@ -209,9 +458,6 @@ gsijs_set_generic_params(gx_device_ijs * + int i, j; + char *value; + +- if (ijsdev->ijs_version == HPIJS_1_0_VERSION) +- return gsijs_set_generic_params_hpijs(ijsdev); +- + /* Split IjsParams into separate parameters and send to ijs server */ + value = NULL; + for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) { +@@ -252,68 +498,6 @@ gsijs_set_generic_params(gx_device_ijs * + } + + /** +- * gsijs_set_margin_params_hpijs: Do margin negotiation with IJS server. +- * +- * This version is specialized for hpijs 1.0 through 1.0.2, and +- * accommodates a number of quirks. +- **/ +-private int +-gsijs_set_margin_params_hpijs(gx_device_ijs *ijsdev) +-{ +- char buf[256]; +- int code = 0; +- +- if (code == 0) { +- sprintf(buf, "%d", ijsdev->width); +- code = gsijs_client_set_param(ijsdev, "Width", buf); +- } +- if (code == 0) { +- sprintf(buf, "%d", ijsdev->height); +- code = gsijs_client_set_param(ijsdev, "Height", buf); +- } +- +- if (code == 0) { +- double printable_width, printable_height; +- double printable_left, printable_top; +- float m[4]; +- +- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableArea", +- buf, sizeof(buf)); +- if (code == IJS_EUNKPARAM) +- /* IJS server doesn't support margin negotiations. +- That's ok. */ +- return 0; +- else if (code >= 0) { +- code = gsijs_parse_wxh(buf, code, +- &printable_width, &printable_height); +- } +- +- if (code == 0) { +- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableTopLeft", +- buf, sizeof(buf)); +- if (code == IJS_EUNKPARAM) +- return 0; +- else if (code >= 0) { +- code = gsijs_parse_wxh(buf, code, +- &printable_left, &printable_top); +- } +- } +- +- if (code == 0) { +- m[0] = printable_left; +- m[1] = ijsdev->MediaSize[1] * (1.0 / 72) - +- printable_top - printable_height; +- m[2] = ijsdev->MediaSize[0] * (1.0 / 72) - +- printable_left - printable_width; +- m[3] = printable_top; +- gx_device_set_margins((gx_device *)ijsdev, m, true); +- } +- } +- +- return code; +-} +- +-/** + * gsijs_set_margin_params: Do margin negotiation with IJS server. + **/ + private int +@@ -324,9 +508,6 @@ gsijs_set_margin_params(gx_device_ijs *i + int i, j; + char *value; + +- if (ijsdev->ijs_version == HPIJS_1_0_VERSION) +- return gsijs_set_margin_params_hpijs(ijsdev); +- + /* Split IjsParams into separate parameters and send to ijs server */ + value = NULL; + for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) { +@@ -493,12 +674,18 @@ gsijs_open(gx_device *dev) + char buf[256]; + bool use_outputfd; + int fd = -1; ++ long max_bitmap = ijsdev->space_params.MaxBitmap; + + if (strlen(ijsdev->IjsServer) == 0) { + eprintf("ijs server not specified\n"); + return gs_note_error(gs_error_ioerror); + } + ++ ijsdev->space_params.MaxBitmap = 0; /* force banding */ ++ ++ /* Set create_buf_device in printer device, so that we can hook the banding playback procedures. */ ++ ijsdev->printer_procs.buf_procs.create_buf_device = gsijs_create_buf_device; ++ + /* Decide whether to use OutputFile or OutputFD. Note: how to + determine this is a tricky question, so we just allow the + user to set it. +@@ -513,6 +700,8 @@ gsijs_open(gx_device *dev) + if (code < 0) + return code; + ++ ijsdev->space_params.MaxBitmap = max_bitmap; ++ + if (use_outputfd) { + /* Note: dup() may not be portable to all interesting IJS + platforms. In that case, this branch should be #ifdef'ed out. +@@ -572,6 +761,9 @@ gsijs_open(gx_device *dev) + if (code >= 0) + code = gsijs_set_margin_params(ijsdev); + ++ if (code >= 0) ++ ijsdev->krgb_mode = gsijs_set_krgb_mode(ijsdev); ++ + return code; + }; + +@@ -631,21 +823,6 @@ gsijs_raster_width(gx_device *pdev) + return min(width, end); + } + +-private int ijs_all_white(unsigned char *data, int size) +-{ +- int clean = 1; +- int i; +- for (i = 0; i < size; i++) +- { +- if (data[i] != 0xFF) +- { +- clean = 0; +- break; +- } +- } +- return clean; +-} +- + /* Print a page. Don't use normal printer gdev_prn_output_page + * because it opens the output file. + */ +@@ -656,8 +833,9 @@ gsijs_output_page(gx_device *dev, int nu + gx_device_printer *pdev = (gx_device_printer *)dev; + int raster = gdev_prn_raster(pdev); + int ijs_width, ijs_height; +- int row_bytes; ++ int row_bytes, k_row_bytes=0; + int n_chan = pdev->color_info.num_components; ++ int krgb_mode = ijsdev->krgb_mode; + unsigned char *data; + char buf[256]; + double xres = pdev->HWResolution[0]; +@@ -673,13 +851,23 @@ gsijs_output_page(gx_device *dev, int nu + + /* Determine bitmap width and height */ + ijs_height = gdev_prn_print_scan_lines(dev); +- if (ijsdev->ijs_version == HPIJS_1_0_VERSION) { +- ijs_width = pdev->width; +- } else { + ijs_width = gsijs_raster_width(dev); +- } ++ + row_bytes = (ijs_width * pdev->color_info.depth + 7) >> 3; + ++ if (krgb_mode) ++ { ++ gx_device_clist_common *cdev = (gx_device_clist_common *)dev; ++ int band_height = cdev->page_info.band_params.BandHeight; ++ k_row_bytes = (ijs_width + 7) >> 3; ++ ++ /* Create banding buffer for k plane. */ ++ ijsdev->k_width = ijs_width; ++ ijsdev->k_band_size = band_height * k_row_bytes; ++ if ((ijsdev->k_band = gs_malloc(ijsdev->k_band_size, 1, "gsijs_output_page")) == (unsigned char *)NULL) ++ return gs_note_error(gs_error_VMerror); ++ } ++ + /* Required page parameters */ + sprintf(buf, "%d", n_chan); + gsijs_client_set_param(ijsdev, "NumChan", buf); +@@ -688,44 +876,71 @@ gsijs_output_page(gx_device *dev, int nu + + /* This needs to become more sophisticated for DeviceN. */ + strcpy(buf, (n_chan == 4) ? "DeviceCMYK" : +- ((n_chan == 3) ? "DeviceRGB" : "DeviceGray")); ++ ((n_chan == 3) ? (krgb_mode ? "KRGB" : "DeviceRGB") : "DeviceGray")); + gsijs_client_set_param(ijsdev, "ColorSpace", buf); + +- /* If hpijs 1.0, don't set width and height here, because it +- expects them to be the paper size. */ +- if (ijsdev->ijs_version != HPIJS_1_0_VERSION) { +- sprintf(buf, "%d", ijs_width); +- gsijs_client_set_param(ijsdev, "Width", buf); +- sprintf(buf, "%d", ijs_height); +- gsijs_client_set_param(ijsdev, "Height", buf); +- } ++ sprintf(buf, "%d", ijs_width); ++ gsijs_client_set_param(ijsdev, "Width", buf); ++ sprintf(buf, "%d", ijs_height); ++ gsijs_client_set_param(ijsdev, "Height", buf); + + sprintf(buf, "%gx%g", xres, yres); + gsijs_client_set_param(ijsdev, "Dpi", buf); + ++#ifdef KRGB_DEBUG ++ int kfd, rgbfd; ++ char sz[128]; ++ kfd = open("/tmp/k.pbm", O_CREAT | O_TRUNC | O_RDWR, 0644); ++ rgbfd = open("/tmp/rgb.ppm", O_CREAT | O_TRUNC | O_RDWR, 0644); ++ snprintf(sz, sizeof(sz), "P4\n#gdevijs test\n%d\n%d\n", ijs_width, ijs_height); ++ write(kfd, sz, strlen(sz)); ++ snprintf(sz, sizeof(sz), "P6\n#gdevijs test\n%d\n%d\n255\n", ijs_width, ijs_height); ++ write(rgbfd, sz, strlen(sz)); ++#endif ++ + for (i=0; ictx, IJS_CMD_BEGIN_PAGE); + status = ijs_client_send_cmd_wait(ijsdev->ctx); + + for (y = 0; y < ijs_height; y++) { +- code = gdev_prn_get_bits(pdev, y, data, &actual_data); +- if (code < 0) +- break; ++ if (krgb_mode) ++ code = gsijs_get_bits(pdev, y, data, &actual_data); ++ else ++ code = gdev_prn_get_bits(pdev, y, data, &actual_data); ++ if (code < 0) ++ break; ++#ifdef KRGB_DEBUG ++ write(rgbfd, actual_data, row_bytes); ++#endif ++ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, row_bytes); ++ if (status) ++ break; + +- if (ijsdev->ijs_version == HPIJS_1_0_VERSION && +- ijs_all_white(actual_data, row_bytes)) +- status = ijs_client_send_data_wait(ijsdev->ctx, 0, NULL, 0); +- else +- status = ijs_client_send_data_wait(ijsdev->ctx, 0, +- (char *)actual_data, row_bytes); +- if (status) +- break; ++ if (krgb_mode) { ++ code = gsijs_k_get_bits(pdev, y, &actual_data); ++ if (code < 0) ++ break; ++#ifdef KRGB_DEBUG ++ write(kfd, actual_data, k_row_bytes); ++#endif ++ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, k_row_bytes); ++ if (status) ++ break; ++ } + } + ijs_client_begin_cmd(ijsdev->ctx, IJS_CMD_END_PAGE); + status = ijs_client_send_cmd_wait(ijsdev->ctx); + } + ++#ifdef KRGB_DEBUG ++ close(kfd); ++ close(rgbfd); ++#endif ++ ++ if(krgb_mode) ++ gs_free(ijsdev->k_band, ijsdev->k_band_size, 1, "gsijs_output_page"); ++ + gs_free_object(pdev->memory, data, "gsijs_output_page"); + + endcode = (pdev->buffer_space && !pdev->is_async_renderer ? +@@ -1029,7 +1244,6 @@ gsijs_client_set_param(gx_device_ijs *ij + dprintf2("ijs: Can't set parameter %s=%s\n", key, value); + return code; + } +- + + private int + gsijs_set_color_format(gx_device_ijs *ijsdev) diff --git a/print/ghostscript7-x11/files/patch-src_gdevl256.c b/print/ghostscript7-x11/files/patch-src_gdevl256.c new file mode 100644 index 000000000000..c5cbb24a93bd --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevl256.c @@ -0,0 +1,15 @@ +--- src/gdevl256.c.orig 2003-01-17 00:49:00 UTC ++++ src/gdevl256.c +@@ -307,3 +307,12 @@ lvga256_draw_line(gx_device * dev, int x + gl_line(x0, y0, x1, y1, color); + return 0; + } ++ ++#ifdef GS_DEVS_SHARED ++extern void gs_lib_register_device(const gx_device *dev); ++void ++gs_shared_init(void) ++{ ++ gs_lib_register_device(&gs_lvga256_device); ++} ++#endif diff --git a/print/ghostscript7-x11/files/patch-src_gdevlbp8.c b/print/ghostscript7-x11/files/patch-src_gdevlbp8.c new file mode 100644 index 000000000000..190ba3a0ad10 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevlbp8.c @@ -0,0 +1,69 @@ +--- src/gdevlbp8.c.orig 2003-01-17 00:49:00 UTC ++++ src/gdevlbp8.c +@@ -22,6 +22,8 @@ + + /* + Modifications: ++ 3.10.00 Johnny Lam ++ Removed LIPS III code, as it's obsoleted by gdevlips driver. + 2.2.97 Lauri Paatero + Changed CSI command into ESC [. DCS commands may still need to be changed + (to ESC P). +@@ -49,7 +51,6 @@ problems + + /* The device descriptors */ + private dev_proc_print_page(lbp8_print_page); +-private dev_proc_print_page(lips3_print_page); + + const gx_device_printer far_data gs_lbp8_device = + prn_device(prn_std_procs, "lbp8", +@@ -58,14 +59,6 @@ const gx_device_printer far_data gs_lbp8 + 0.16, 0.2, 0.32, 0.21, /* margins: left, bottom, right, top */ + 1, lbp8_print_page); + +-const gx_device_printer far_data gs_lips3_device = +- prn_device(prn_std_procs, "lips3", +- 82, /* width_10ths, 8.3" */ +- 117, /* height_10ths, 11.7" */ +- X_DPI, Y_DPI, +- 0.16, 0.27, 0.23, 0.27, /* margins */ +- 1, lips3_print_page); +- + /* ------ Internal routines ------ */ + + #define ESC 0x1b +@@ -84,23 +77,6 @@ static const char lbp8_init[] = { + + static const char *lbp8_end = NULL; + +-static const char lips3_init[] = { +- ESC, '<', /* soft reset */ +- DCS, '0', 'J', ST, /* JOB END */ +- DCS, '3', '1', ';', '3', '0', '0', ';', '2', 'J', ST, /* 300dpi, LIPS3 JOB START */ +- ESC, '<', /* soft reset */ +- DCS, '2', 'y', 'P', 'r', 'i', 'n', 't', 'i', 'n', 'g', '(', 'g', 's', ')', ST, /* Printing (gs) display */ +- ESC, '[', '?', '1', 'l', /* auto cr-lf disable */ +- ESC, '[', '?', '2', 'h', /* auto ff disable */ +- ESC, '[', '1', '1', 'h', /* set mode */ +- ESC, '[', '7', ' ', 'I', /* select unit size (300dpi)*/ +- ESC, '[', 'f' /* move to home position */ +-}; +- +-static const char lips3_end[] = { +- DCS, '0', 'J', ST /* JOB END */ +-}; +- + /* Send the page to the printer. */ + private int + can_print_page(gx_device_printer *pdev, FILE *prn_stream, +@@ -204,10 +180,3 @@ lbp8_print_page(gx_device_printer *pdev, + { return can_print_page(pdev, prn_stream, lbp8_init, sizeof(lbp8_init), + lbp8_end, sizeof(lbp8_end)); + } +- +-/* Print a LIPS III page. */ +-private int +-lips3_print_page(gx_device_printer *pdev, FILE *prn_stream) +-{ return can_print_page(pdev, prn_stream, lips3_init, sizeof(lips3_init), +- lips3_end, sizeof(lips3_end)); +-} diff --git a/print/ghostscript7-x11/files/patch-src_gdevpdff.c b/print/ghostscript7-x11/files/patch-src_gdevpdff.c new file mode 100644 index 000000000000..9f4c0569e929 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevpdff.c @@ -0,0 +1,58 @@ +--- src/gdevpdff.c.orig 2003-01-17 00:49:01 UTC ++++ src/gdevpdff.c +@@ -276,6 +276,11 @@ pdf_font_embed_status(gx_device_pdf *pde + const byte *chars = font->font_name.chars; + uint size = font->font_name.size; + ++ /* CIDFonts has null string in font_name, key_name is used */ ++ if (0 == size) { ++ chars = font->key_name.chars; ++ size = font->key_name.size; ++ } + /* + * The behavior of Acrobat Distiller changed between 3.0 (PDF 1.2), + * which will never embed the base 14 fonts, and 4.0 (PDF 1.3), which +@@ -720,19 +725,22 @@ pdf_create_pdf_font(gx_device_pdf *pdev, + same &= ~FONT_SAME_METRICS; + break; + case FONT_EMBED_NO: +- /* +- * Per the PDF 1.3 documentation, there are only 3 BaseEncoding +- * values allowed for non-embedded fonts. Pick one here. +- */ +- BaseEncoding = +- ((const gs_font_base *)base_font)->nearest_encoding_index; +- switch (BaseEncoding) { +- default: +- BaseEncoding = ENCODING_INDEX_WINANSI; +- case ENCODING_INDEX_WINANSI: +- case ENCODING_INDEX_MACROMAN: +- case ENCODING_INDEX_MACEXPERT: +- break; ++ if (!(font->FontType == ft_CID_encrypted || ++ font->FontType == ft_CID_TrueType)) { ++ /* ++ * Per the PDF 1.3 documentation, there are only 3 BaseEncoding ++ * values allowed for non-embedded fonts. Pick one here. ++ */ ++ BaseEncoding = ++ ((const gs_font_base *)base_font)->nearest_encoding_index; ++ switch (BaseEncoding) { ++ default: ++ BaseEncoding = ENCODING_INDEX_WINANSI; ++ case ENCODING_INDEX_WINANSI: ++ case ENCODING_INDEX_MACROMAN: ++ case ENCODING_INDEX_MACEXPERT: ++ break; ++ } + } + code = pdf_compute_font_descriptor(pdev, &fdesc, font, NULL); + if (code < 0) +@@ -888,6 +896,7 @@ pdf_create_pdf_font(gx_device_pdf *pdev, + memcpy(ppf->widths_known, ftemp_widths_known, + sizeof(ftemp_widths_known)); + } ++ ppf->embed = embed; + code = pdf_register_font(pdev, font, ppf); + + *pppf = ppf; diff --git a/print/ghostscript7-x11/files/patch-src_gdevpdff.h b/print/ghostscript7-x11/files/patch-src_gdevpdff.h new file mode 100644 index 000000000000..fe2a13e9e6bd --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevpdff.h @@ -0,0 +1,36 @@ +--- src/gdevpdff.h.orig 2003-01-17 00:49:01 UTC ++++ src/gdevpdff.h +@@ -117,6 +117,12 @@ typedef enum { + FONT_SUBSET_NO + } pdf_font_do_subset_t; + ++typedef enum { ++ FONT_EMBED_STANDARD, /* 14 standard fonts */ ++ FONT_EMBED_NO, ++ FONT_EMBED_YES ++} pdf_font_embed_t; ++ + struct pdf_font_descriptor_s { + pdf_resource_common(pdf_font_descriptor_t); + pdf_font_name_t FontName; +@@ -198,6 +204,7 @@ struct pdf_font_s { + gs_font *font; /* non-0 iff font will notify us; */ + /* should be a weak pointer */ + int index; /* in pdf_standard_fonts, -1 if not base 14 */ ++ pdf_font_embed_t embed; /* status of pdf_font_embed_status() */ + gs_matrix orig_matrix; /* FontMatrix of unscaled font for embedding */ + bool is_MM_instance; /* for Type 1/2 fonts, true iff the font */ + /* is a Multiple Master instance */ +@@ -320,12 +327,6 @@ int pdf_do_char_image(P3(gx_device_pdf * + + /* ---------------- Exported by gdevpdff.c ---------------- */ + +-typedef enum { +- FONT_EMBED_STANDARD, /* 14 standard fonts */ +- FONT_EMBED_NO, +- FONT_EMBED_YES +-} pdf_font_embed_t; +- + typedef struct pdf_standard_font_s { + const char *fname; + gs_encoding_index_t base_encoding; diff --git a/print/ghostscript7-x11/files/patch-src_gdevpdfs.c b/print/ghostscript7-x11/files/patch-src_gdevpdfs.c new file mode 100644 index 000000000000..9eaa4cc4368b --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevpdfs.c @@ -0,0 +1,41 @@ +--- src/gdevpdfs.c.orig 2003-01-17 00:49:01 UTC ++++ src/gdevpdfs.c +@@ -481,15 +481,21 @@ scan_cmap_text(gs_text_enum_t *pte, gs_f + + if (cid < pfd->chars_count) { + int index = cid >> 3, mask = 0x80 >> (cid & 7); ++ int gid; ++ ++ if (!(pfd->chars_used.data[index] & mask) || ++ !(psubf->widths_known[index] & mask)) { + +- if (!(pfd->chars_used.data[index] & mask)) { +- pfd->chars_used.data[index] |= mask; + if (psubf->CIDToGIDMap) { + gs_font_cid2 *const subfont2 = + (gs_font_cid2 *)subfont; +- int gid = +- subfont2->cidata.CIDMap_proc(subfont2, glyph); + ++ gid = subfont2->cidata.CIDMap_proc(subfont2, glyph); ++ } ++ } ++ if (!(pfd->chars_used.data[index] & mask)) { ++ pfd->chars_used.data[index] |= mask; ++ if (psubf->CIDToGIDMap) { + if (gid >= 0) { + psubf->CIDToGIDMap[cid] = gid; + mark_glyphs_used(subfont, gid + gs_min_cid_glyph, +@@ -500,7 +506,11 @@ scan_cmap_text(gs_text_enum_t *pte, gs_f + if (!(psubf->widths_known[index] & mask)) { + int width; + +- code = pdf_glyph_width(psubf, glyph, subfont, &width); ++ if (psubf->CIDToGIDMap) ++ code = pdf_glyph_width(psubf, gid + gs_min_cid_glyph, ++ subfont, &width); ++ else ++ code = pdf_glyph_width(psubf, glyph, subfont, &width); + if (code == 0) { + psubf->Widths[cid] = width; + psubf->widths_known[index] |= mask; diff --git a/print/ghostscript7-x11/files/patch-src_gdevpdfw.c b/print/ghostscript7-x11/files/patch-src_gdevpdfw.c new file mode 100644 index 000000000000..9250f98bad59 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevpdfw.c @@ -0,0 +1,59 @@ +--- src/gdevpdfw.c.orig 2003-01-17 00:49:01 UTC ++++ src/gdevpdfw.c +@@ -348,18 +348,19 @@ pdf_write_CIDFont_widths(gx_device_pdf * + /* Use the most common width as DW. */ + + { +- ushort counts[1001]; ++ ushort counts[1500*2]; /* histogram of (-1500..1500) */ + int dw_count = 0, i; + + memset(counts, 0, sizeof(counts)); + while (!psf_enumerate_glyphs_next(&genum, &glyph)) { +- int width = ppf->Widths[glyph - gs_min_cid_glyph]; ++ int cid = glyph - gs_min_cid_glyph; ++ int width = ppf->Widths[cid]; + +- counts[min(width, countof(counts) - 1)]++; ++ counts[max(0,min(width+countof(counts)/2,countof(counts)-1))]++; + } +- for (i = 0; i < countof(counts); ++i) ++ for (i = 0; i < countof(counts); i++) + if (counts[i] > dw_count) +- dw = i, dw_count = counts[i]; ++ dw = i - countof(counts)/2, dw_count = counts[i]; + if (dw != 0) + pprintd1(s, "/DW %d\n", dw); + } +@@ -496,14 +497,16 @@ pdf_write_font_resource(gx_device_pdf *p + if (pdf_has_subset_prefix(chars, size)) + chars += SUBSET_PREFIX_SIZE, size -= SUBSET_PREFIX_SIZE; + pdf_put_name(pdev, chars, size); +- if (pef->sub_font_type == ft_CID_encrypted && ++ if ((pef->sub_font_type == ft_CID_encrypted || ++ pef->sub_font_type == ft_CID_TrueType) && + pef->cmapname[0] == '/' + ) { + stream_putc(s, '-'); + pdf_put_name_chars(pdev, (const byte*) (pef->cmapname + 1), + strlen(pef->cmapname + 1)); + } +- pprints1(s, "/Encoding %s", pef->cmapname); ++ pprints1(s, (pef->cmapname[0] == '/') ? "/Encoding%s" : "/Encoding %s", ++ pef->cmapname); + pprintld1(s, "/DescendantFonts[%ld 0 R]", + pdf_resource_id((const pdf_resource_t *)pef->DescendantFont)); + write_Widths = 0; +@@ -563,8 +566,10 @@ pdf_write_font_resource(gx_device_pdf *p + break; + case -1: + pdf_write_CIDFont_widths(pdev, pef); +- if (pef->FontType == ft_CID_TrueType) +- pdf_write_CIDToGIDMap(pdev, pef, &cidmap_id); ++ if (pef->FontType == ft_CID_TrueType) { ++ if (pef->embed != FONT_EMBED_NO) ++ pdf_write_CIDToGIDMap(pdev, pef, &cidmap_id); ++ } + break; + } + if (pef->Differences) { diff --git a/print/ghostscript7-x11/files/patch-src_gdevpng.c b/print/ghostscript7-x11/files/patch-src_gdevpng.c new file mode 100644 index 000000000000..21e900385c2f --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevpng.c @@ -0,0 +1,187 @@ +--- src/gdevpng.c.orig 2003-05-15 10:05:29 UTC ++++ src/gdevpng.c +@@ -41,12 +41,6 @@ + #include "gdevpccm.h" + #include "gscdefs.h" + +-#define PNG_INTERNAL +-/* +- * libpng versions 1.0.3 and later allow disabling access to the stdxxx +- * files while retaining support for FILE * I/O. +- */ +-#define PNG_NO_CONSOLE_IO + /* + * Earlier libpng versions require disabling FILE * I/O altogether. + * This produces a compiler warning about no prototype for png_init_io. +@@ -258,7 +252,7 @@ png_print_page(gx_device_printer * pdev, + goto done; + } + /* set error handling */ +- if (setjmp(png_ptr->jmpbuf)) { ++ if (setjmp(png_jmpbuf(png_ptr))) { + /* If we get here, we had a problem reading the file */ + code = gs_note_error(gs_error_VMerror); + goto done; +@@ -268,19 +262,12 @@ png_print_page(gx_device_printer * pdev, + png_init_io(png_ptr, file); + + /* set the file information here */ +- info_ptr->width = pdev->width; +- info_ptr->height = pdev->height; +- /* resolution is in pixels per meter vs. dpi */ +- info_ptr->x_pixels_per_unit = +- (png_uint_32) (pdev->HWResolution[0] * (100.0 / 2.54)); +- info_ptr->y_pixels_per_unit = +- (png_uint_32) (pdev->HWResolution[1] * (100.0 / 2.54)); +- info_ptr->phys_unit_type = PNG_RESOLUTION_METER; +- info_ptr->valid |= PNG_INFO_pHYs; + switch (depth) { + case 32: +- info_ptr->bit_depth = 8; +- info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 8, PNG_COLOR_TYPE_RGB_ALPHA, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + png_set_invert_alpha(png_ptr); + { gx_device_pngalpha *ppdev = (gx_device_pngalpha *)pdev; + png_color_16 background; +@@ -292,51 +279,68 @@ png_print_page(gx_device_printer * pdev, + png_set_bKGD(png_ptr, info_ptr, &background); + } + break; ++ case 48: ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 16, PNG_COLOR_TYPE_RGB, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); ++#if defined(ARCH_IS_BIG_ENDIAN) && (!ARCH_IS_BIG_ENDIAN) ++ png_set_swap(png_ptr); ++#endif ++ break; + case 24: +- info_ptr->bit_depth = 8; +- info_ptr->color_type = PNG_COLOR_TYPE_RGB; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 8, PNG_COLOR_TYPE_RGB, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + break; + case 8: +- info_ptr->bit_depth = 8; +- if (gx_device_has_color(pdev)) +- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; +- else +- info_ptr->color_type = PNG_COLOR_TYPE_GRAY; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 8, gx_device_has_color(pdev) ? ++ PNG_COLOR_TYPE_PALETTE : PNG_COLOR_TYPE_GRAY, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + break; + case 4: +- info_ptr->bit_depth = 4; +- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 4, PNG_COLOR_TYPE_PALETTE, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + break; + case 1: +- info_ptr->bit_depth = 1; +- info_ptr->color_type = PNG_COLOR_TYPE_GRAY; ++ png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height, ++ 1, PNG_COLOR_TYPE_PALETTE, ++ PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, ++ PNG_FILTER_TYPE_DEFAULT); + /* invert monocrome pixels */ + png_set_invert_mono(png_ptr); + break; + } + ++ /* resolution is in pixels per meter vs. dpi */ ++ png_set_pHYs(png_ptr, info_ptr, ++ (png_uint_32) (pdev->HWResolution[0] * (100.0 / 2.54)), ++ (png_uint_32) (pdev->HWResolution[1] * (100.0 / 2.54)), ++ PNG_RESOLUTION_METER); ++ + /* set the palette if there is one */ +- if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { ++ if (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) { + int i; + int num_colors = 1 << depth; + gx_color_value rgb[3]; ++ png_color palette[256]; ++ ++ if (num_colors > 256) ++ num_colors = 256; + +- info_ptr->palette = +- (void *)gs_alloc_bytes(mem, 256 * sizeof(png_color), +- "png palette"); +- if (info_ptr->palette == 0) { +- code = gs_note_error(gs_error_VMerror); +- goto done; +- } +- info_ptr->num_palette = num_colors; +- info_ptr->valid |= PNG_INFO_PLTE; + for (i = 0; i < num_colors; i++) { + (*dev_proc(pdev, map_color_rgb)) ((gx_device *) pdev, + (gx_color_index) i, rgb); +- info_ptr->palette[i].red = gx_color_value_to_byte(rgb[0]); +- info_ptr->palette[i].green = gx_color_value_to_byte(rgb[1]); +- info_ptr->palette[i].blue = gx_color_value_to_byte(rgb[2]); ++ palette[i].red = gx_color_value_to_byte(rgb[0]); ++ palette[i].green = gx_color_value_to_byte(rgb[1]); ++ palette[i].blue = gx_color_value_to_byte(rgb[2]); + } ++ png_set_PLTE(png_ptr, info_ptr, palette, num_colors); + } + /* add comment */ + strncpy(software_key, "Software", sizeof(software_key)); +@@ -346,15 +350,16 @@ png_print_page(gx_device_printer * pdev, + text_png.key = software_key; + text_png.text = software_text; + text_png.text_length = strlen(software_text); +- info_ptr->text = &text_png; +- info_ptr->num_text = 1; ++ png_set_text(png_ptr, info_ptr, &text_png, 1); + + /* write the file information */ + png_write_info(png_ptr, info_ptr); + + /* don't write the comments twice */ ++#if 0 + info_ptr->num_text = 0; + info_ptr->text = NULL; ++#endif + + /* Write the contents of the image. */ + for (y = 0; y < height; y++) { +@@ -365,8 +370,10 @@ png_print_page(gx_device_printer * pdev, + /* write the rest of the file */ + png_write_end(png_ptr, info_ptr); + ++#if 0 + /* if you alloced the palette, free it here */ + gs_free_object(mem, info_ptr->palette, "png palette"); ++#endif + + done: + /* free the structures */ +@@ -376,6 +383,7 @@ png_print_page(gx_device_printer * pdev, + return code; + } + ++#if 0 + /* + * Patch around a static reference to a never-used procedure. + * This could be avoided if we were willing to edit pngconf.h to +@@ -393,6 +401,7 @@ png_push_fill_buffer(png_structp png_ptr + { + } + #endif ++#endif + + private int + pngalpha_open(gx_device * pdev) diff --git a/print/ghostscript7-x11/files/patch-src_gdevvglb.c b/print/ghostscript7-x11/files/patch-src_gdevvglb.c new file mode 100644 index 000000000000..51d1a7f39c79 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevvglb.c @@ -0,0 +1,15 @@ +--- src/gdevvglb.c.orig 2003-01-17 00:49:02 UTC ++++ src/gdevvglb.c +@@ -373,3 +373,12 @@ vgalib_put_params(gx_device * dev, gs_pa + } + return 0; + } ++ ++#ifdef GS_DEVS_SHARED ++extern void gs_lib_register_device(const gx_device *dev); ++void ++gs_shared_init(void) ++{ ++ gs_lib_register_device(&gs_vgalib_device); ++} ++#endif diff --git a/print/ghostscript7-x11/files/patch-src_gdevxalt.c b/print/ghostscript7-x11/files/patch-src_gdevxalt.c new file mode 100644 index 000000000000..023fad7e2e89 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gdevxalt.c @@ -0,0 +1,31 @@ +--- src/gdevxalt.c.orig 2003-01-17 00:49:02 UTC ++++ src/gdevxalt.c +@@ -30,6 +30,7 @@ + #include "gdevx.h" + + extern const gx_device_X gs_x11_device; ++extern const gx_device_X gs_x11alpha_device; + + /* + * Define a forwarding device with a cache for the first 16 colors, +@@ -957,3 +958,20 @@ x_rg32x_alt_map_color(gx_device * dev, g + rgb[2] = ((color >> 11) & 0x3ff) * gx_max_color_value / 0x3ff; + return -1; + } ++ ++#ifdef GS_DEVS_SHARED ++extern void gs_lib_register_device(const gx_device *dev); ++void ++gs_shared_init(void) ++{ ++ gs_lib_register_device(&gs_x11_device); ++ gs_lib_register_device(&gs_x11alpha_device); ++ gs_lib_register_device(&gs_x11cmyk_device); ++ gs_lib_register_device(&gs_x11cmyk2_device); ++ gs_lib_register_device(&gs_x11cmyk4_device); ++ gs_lib_register_device(&gs_x11cmyk8_device); ++ gs_lib_register_device(&gs_x11gray2_device); ++ gs_lib_register_device(&gs_x11gray4_device); ++ gs_lib_register_device(&gs_x11mono_device); ++} ++#endif diff --git a/print/ghostscript7-x11/files/patch-src_genarch.c b/print/ghostscript7-x11/files/patch-src_genarch.c new file mode 100644 index 000000000000..e7a7d84acc52 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_genarch.c @@ -0,0 +1,34 @@ +--- src/genarch.c.orig 2003-01-17 00:49:02 UTC ++++ src/genarch.c +@@ -40,6 +40,7 @@ section(FILE * f, const char *str) + fprintf(f, "\n\t /* ---------------- %s ---------------- */\n\n", str); + } + ++#ifndef __FreeBSD__ + private clock_t + time_clear(char *buf, int bsize, int nreps) + { +@@ -50,6 +51,7 @@ time_clear(char *buf, int bsize, int nre + memset(buf, 0, bsize); + return clock() - t; + } ++#endif /* __FreeBSD__ */ + + private void + define(FILE *f, const char *str) +@@ -180,6 +182,7 @@ main(int argc, char *argv[]) + fprintf(f, "((unsigned long)~0L + (unsigned long)0)\n"); + #undef PRINT_MAX + ++#ifndef __FreeBSD__ + section(f, "Cache sizes"); + + /* +@@ -240,6 +243,7 @@ main(int argc, char *argv[]) + } + define_int(f, "ARCH_CACHE2_SIZE", bsize >> 1); + } ++#endif /* __FreeBSD__ */ + + section(f, "Miscellaneous"); + diff --git a/print/ghostscript7-x11/files/patch-src_gnudevs.mak b/print/ghostscript7-x11/files/patch-src_gnudevs.mak new file mode 100644 index 000000000000..3b9eddcaf4b8 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gnudevs.mak @@ -0,0 +1,67 @@ +--- src/gnudevs.mak.orig 2003-02-09 18:12:48 UTC ++++ src/gnudevs.mak +@@ -66,64 +66,6 @@ sxlcrt_=$(GLOBJ)gdevln03.$(OBJ) + $(DD)sxlcrt.dev : $(sxlcrt_) $(DD)page.dev + $(SETPDEV) $(DD)sxlcrt $(sxlcrt_) + +- +-### -------------------- Gimp-Print (stp) driver -------------------### +- +-# To include this driver add '$(DD)stp.dev' to your DEVICE_DEVS +-# line and define 'STPLIB=gimpprint' in your top-level makefile. +-# See http://gimp-print.sourceforge.net/ for more information. +- +-stp_=$(GLOBJ)gdevstp.$(OBJ) +- +-$(DD)stp.dev : $(stp_) $(DD)page.dev +- $(SETPDEV) $(DD)stp $(stp_) +- $(ADDMOD) $(DD)stp -lib $(STPLIB) +- +-$(GLOBJ)gdevstp.$(OBJ) : $(GLSRC)gdevstp.c \ +- $(gdevprn_h) $(gdevpccm_h) $(gsparam_h) +- $(GLCC) $(GLO_)gdevstp.$(OBJ) $(C_) $(GLSRC)gdevstp.c +- +- +-### -------------- cdj850 - HP 850c Driver under development ------------- ### +- +-cdeskjet8_=$(GLOBJ)gdevcd8.$(OBJ) $(HPPCL) +- +-# Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de) +-# Printer: HP 670 +-$(DD)cdj670.dev : $(cdeskjet8_) $(DD)page.dev +- $(SETPDEV2) $(DD)cdj670 $(cdeskjet8_) +- +-# Author: Uli Wortmann (uliw@erdw.ethz.ch) +-# Printer: HP 850 +-$(DD)cdj850.dev : $(cdeskjet8_) $(DD)page.dev +- $(SETPDEV2) $(DD)cdj850 $(cdeskjet8_) +- +-# Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de) +-# Printer: HP 890 +-$(DD)cdj890.dev : $(cdeskjet8_) $(DD)page.dev +- $(SETPDEV2) $(DD)cdj890 $(cdeskjet8_) +- +-# Author: Uli Wortmann (uliw@erdw.ethz.ch), Martin Gerbershagen (ger@ulm.temic.de) +-# Printer: HP 1600 +-$(DD)cdj1600.dev : $(cdeskjet8_) $(DD)page.dev +- $(SETPDEV2) $(DD)cdj1600 $(cdeskjet8_) +- +-$(GLOBJ)gdevcd8.$(OBJ) : $(GLSRC)gdevcd8.c $(PDEVH) $(math__h)\ +- $(gsparam_h) $(gxlum_h) $(gdevpcl_h) +- $(GLCC) $(GLO_)gdevcd8.$(OBJ) $(C_) $(GLSRC)gdevcd8.c +- +-### -------------- cdj880 - HP 880c Driver under development ------------- ### +-### Since this driver is in the development phase it is not distributed ### +-### with Ghostscript, but is available from ### +-### http://www.proaxis.com/~mgelhaus/linux/software/hp880c/hp880c.html ### +- +-### NOTE: Depends on the presence of the cdj850 section above. ### +- +-# Author: Matthew Gelhaus (mgelhaus@proaxis.com) +-# Printer: HP 880c +-$(DD)cdj880.dev : $(cdeskjet8_) $(DD)page.dev +- $(SETPDEV2) $(DD)cdj880 $(cdeskjet8_) +- + ### ------------- cdj970 - HP 970Cxi Driver under development ------------- ### + + cdeskjet9_=$(GLOBJ)gdevdj9.$(OBJ) $(HPPCL) diff --git a/print/ghostscript7-x11/files/patch-src_gp__unix.c b/print/ghostscript7-x11/files/patch-src_gp__unix.c new file mode 100644 index 000000000000..b346bdcce4d2 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gp__unix.c @@ -0,0 +1,83 @@ +--- src/gp_unix.c.orig 2003-01-17 00:49:02 UTC ++++ src/gp_unix.c +@@ -41,11 +41,60 @@ extern char *getenv(P1(const char *)); + + #endif + ++#ifdef GS_DEVS_SHARED ++#ifndef GS_DEVS_SHARED_DIR ++# define GS_DEVS_SHARED_DIR "/usr/lib/ghostscript/7.07" ++#endif ++ ++/* ++ * use shared library for drivers, always load them when starting, this ++ * avoid too many modifications, and since it is supported only under linux ++ * and applied as a patch (preferable). ++ */ ++#include ++#include ++#include ++#include ++#include ++ ++void ++gp_init(void) ++{ ++ DIR* dir = NULL; ++ struct dirent* dirent; ++ char buff[PATH_MAX]; ++ char* pbuff; ++ void* handle; ++ void (*gs_shared_init)(void); ++ ++ dir = opendir(GS_DEVS_SHARED_DIR); ++ if (dir == 0) return; ++ ++ lprintf("DEBUG 2\n"); ++ ++ while ((dirent = readdir(dir)) != 0) { ++ snprintf(buff, sizeof(buff), "%s/%s", GS_DEVS_SHARED_DIR, dirent->d_name); ++ pbuff = buff + strlen(buff) - 3; ++ if (strcmp(pbuff, ".so") != 0) ++ continue; ++ handle = dlopen(buff, RTLD_NOW); ++ if (handle == NULL) ++ continue; ++ gs_shared_init = dlsym(handle, "gs_shared_init"); ++ if (gs_shared_init != NULL) ++ (*gs_shared_init)(); ++ } ++ lprintf("DEBUG 3\n"); ++ ++ closedir(dir); ++} ++#else + /* Do platform-dependent initialization. */ + void + gp_init(void) + { + } ++#endif + + /* Do platform-dependent cleanup. */ + void +@@ -57,6 +106,7 @@ gp_exit(int exit_status, int code) + void + gp_do_exit(int exit_status) + { ++ exit(exit_status); + } + + /* ------ Miscellaneous ------ */ +@@ -67,7 +117,11 @@ gp_do_exit(int exit_status) + const char * + gp_strerror(int errnum) + { ++#ifdef HAVE_STRERROR ++ return strerror(errnum); ++#else + return NULL; ++#endif + } + + /* ------ Date and time ------ */ diff --git a/print/ghostscript7-x11/files/patch-src_gs.mak b/print/ghostscript7-x11/files/patch-src_gs.mak new file mode 100644 index 000000000000..3f5654dd8710 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gs.mak @@ -0,0 +1,19 @@ +--- src/gs.mak.orig 2003-01-28 12:02:09 UTC ++++ src/gs.mak +@@ -235,7 +235,7 @@ GENINIT_XE=$(AUXGEN)geninit$(XEAUX) + gconfig_h=$(GLGENDIR)$(D)gconfxx.h + gconfigf_h=$(GLGENDIR)$(D)gconfxc.h + +-all default : $(GS_XE) ++all default : $(GS_XE) $(GS_SHARED_OBJS) + $(NO_OP) + + # the distclean and maintainer-clean targets (if any) +@@ -248,6 +248,7 @@ realclean : clean + clean : mostlyclean + $(RM_) $(GSGEN)arch.h + $(RM_) $(GS_XE) ++ $(RM_) $(GS_SHARED_OBJS) + + #****** FOLLOWING IS WRONG, NEEDS TO BE PER-SUBSYSTEM ****** + mostlyclean : config-clean diff --git a/print/ghostscript7-x11/files/patch-src_gsalloc.c b/print/ghostscript7-x11/files/patch-src_gsalloc.c new file mode 100644 index 000000000000..3741352e2409 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gsalloc.c @@ -0,0 +1,11 @@ +--- src/gsalloc.c.orig 2003-01-17 00:49:02 UTC ++++ src/gsalloc.c +@@ -195,7 +195,7 @@ ialloc_alloc_state(gs_raw_memory_t * par + iimem->large_size = ((chunk_size / 4) & -obj_align_mod) + 1; + iimem->is_controlled = false; + iimem->gc_status.vm_threshold = chunk_size * 3L; +- iimem->gc_status.max_vm = max_long; ++ iimem->gc_status.max_vm = 0x7fffffff; + iimem->gc_status.psignal = NULL; + iimem->gc_status.signal_value = 0; + iimem->gc_status.enabled = false; diff --git a/print/ghostscript7-x11/files/patch-src_gsmalloc.c b/print/ghostscript7-x11/files/patch-src_gsmalloc.c new file mode 100644 index 000000000000..687d68768d0d --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gsmalloc.c @@ -0,0 +1,11 @@ +--- src/gsmalloc.c.orig 2003-01-17 00:49:03 UTC ++++ src/gsmalloc.c +@@ -170,7 +170,7 @@ gs_heap_alloc_bytes(gs_memory_t * mem, u + } else { + uint added = size + sizeof(gs_malloc_block_t); + +- if (mmem->limit - added < mmem->used) ++ if (added <= size || mmem->limit - added < mmem->used) + set_msg("exceeded limit"); + else if ((ptr = (byte *) malloc(added)) == 0) + set_msg("failed"); diff --git a/print/ghostscript7-x11/files/patch-src_gxclrast.c b/print/ghostscript7-x11/files/patch-src_gxclrast.c new file mode 100644 index 000000000000..8acf4ca384e5 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gxclrast.c @@ -0,0 +1,15 @@ +--- src/gxclrast.c.orig 2003-01-17 00:49:03 UTC ++++ src/gxclrast.c +@@ -87,10 +87,10 @@ cmd_print_bits(const byte * data, int wi + private long + cmd_get_w(const byte * p, const byte ** rp) + { +- long val = *p++ & 0x7f; ++ int val = *p++ & 0x7f; + int shift = 7; + +- for (; val += (long)(*p & 0x7f) << shift, *p++ > 0x7f; shift += 7); ++ for (; val += (int)(*p & 0x7f) << shift, *p++ > 0x7f; shift += 7); + *rp = p; + return val; + } diff --git a/print/ghostscript7-x11/files/patch-src_gxfixed.h b/print/ghostscript7-x11/files/patch-src_gxfixed.h new file mode 100644 index 000000000000..991ab095762e --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gxfixed.h @@ -0,0 +1,46 @@ +--- src/gxfixed.h.orig 2003-01-17 00:49:03 UTC ++++ src/gxfixed.h +@@ -27,12 +27,22 @@ + * quantities: integers lose accuracy in crucial places, + * and floating point arithmetic is slow. + */ +-typedef long fixed; +-typedef ulong ufixed; /* only used in a very few places */ +-#define ARCH_SIZEOF_FIXED ARCH_SIZEOF_LONG ++#if ARCH_SIZEOF_INT == 4 ++typedef int fixed; ++typedef uint ufixed; /* only used in a very few places */ ++# define ARCH_SIZEOF_FIXED ARCH_SIZEOF_INT ++# define max_fixed max_int ++# define min_fixed min_int ++#else ++# if ARCH_SIZEOF_LONG == 4 ++ typedef long fixed; ++ typedef ulong ufixed; /* only used in a very few places */ ++# define ARCH_SIZEOF_FIXED ARCH_SIZEOF_LONG ++# define max_fixed max_long ++# define min_fixed min_long ++# endif ++#endif + +-#define max_fixed max_long +-#define min_fixed min_long + #define fixed_0 0L + #define fixed_epsilon 1L + /* +@@ -120,13 +130,8 @@ typedef ulong ufixed; /* only used in a + #define fixed_truncated(x) ((x) < 0 ? fixed_ceiling(x) : fixed_floor(x)) + + /* Define the largest and smallest integer values that fit in a fixed. */ +-#if arch_sizeof_int == arch_sizeof_long +-# define max_int_in_fixed fixed2int(max_fixed) +-# define min_int_in_fixed fixed2int(min_fixed) +-#else +-# define max_int_in_fixed max_int +-# define min_int_in_fixed min_int +-#endif ++#define max_int_in_fixed fixed2int(max_fixed) ++#define min_int_in_fixed fixed2int(min_fixed) + + #ifdef USE_FPU + # define USE_FPU_FIXED (USE_FPU < 0 && arch_floats_are_IEEE && arch_sizeof_long == 4) diff --git a/print/ghostscript7-x11/files/patch-src_gxobj.h b/print/ghostscript7-x11/files/patch-src_gxobj.h new file mode 100644 index 000000000000..c2ff485ac101 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_gxobj.h @@ -0,0 +1,17 @@ +--- src/gxobj.h.orig 2003-01-17 00:49:04 UTC ++++ src/gxobj.h +@@ -101,10 +101,14 @@ typedef struct obj_header_data_s { + * The final | is because back pointer values are divided by obj_back_scale, + * so objects must be aligned at least 0 mod obj_back_scale. + */ ++#if !defined(__ia64__) && !defined(__amd64__) + #define obj_align_mod\ + (((arch_align_long_mod - 1) | (arch_align_ptr_mod - 1) |\ + (arch_align_double_mod - 1) | (align_bitmap_mod - 1) |\ + (obj_back_scale - 1)) + 1) ++#else ++#define obj_align_mod 16 ++#endif + /* The only possible values for obj_align_mod are 4, 8, or 16.... */ + #if obj_align_mod == 4 + # define log2_obj_align_mod 2 diff --git a/print/ghostscript7-x11/files/patch-src_ibnum.c b/print/ghostscript7-x11/files/patch-src_ibnum.c new file mode 100644 index 000000000000..a847a45a6174 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_ibnum.c @@ -0,0 +1,49 @@ +--- src/ibnum.c.orig 2003-01-17 00:49:04 UTC ++++ src/ibnum.c +@@ -124,11 +124,11 @@ sdecode_number(const byte * str, int for + case num_int32: + case num_int32 + 16: + if ((format & 31) == 0) { +- np->value.intval = sdecodelong(str, format); ++ np->value.intval = sdecodeint32(str, format); + return t_integer; + } else { + np->value.realval = +- (double)sdecodelong(str, format) * ++ (double)sdecodeint32(str, format) * + binary_scale[format & 31]; + return t_real; + } +@@ -171,18 +171,14 @@ sdecodeshort(const byte * p, int format) + } + + /* Decode a (32-bit, signed) long. */ +-long +-sdecodelong(const byte * p, int format) ++int ++sdecodeint32(const byte * p, int format) + { + int a = p[0], b = p[1], c = p[2], d = p[3]; +- long v = (num_is_lsb(format) ? +- ((long)d << 24) + ((long)c << 16) + (b << 8) + a : +- ((long)a << 24) + ((long)b << 16) + (c << 8) + d); ++ int v = (num_is_lsb(format) ? ++ ((int)d << 24) + ((int)c << 16) + (b << 8) + a : ++ ((int)a << 24) + ((int)b << 16) + (c << 8) + d); + +-#if arch_sizeof_long > 4 +- /* Propagate bit 31 as the sign. */ +- v = (v ^ 0x80000000L) - 0x80000000L; +-#endif + return v; + } + +@@ -190,7 +186,7 @@ sdecodelong(const byte * p, int format) + float + sdecodefloat(const byte * p, int format) + { +- bits32 lnum = (bits32) sdecodelong(p, format); ++ bits32 lnum = (bits32) sdecodeint32(p, format); + float fnum; + + #if !arch_floats_are_IEEE diff --git a/print/ghostscript7-x11/files/patch-src_ibnum.h b/print/ghostscript7-x11/files/patch-src_ibnum.h new file mode 100644 index 000000000000..4f4aaa6496c0 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_ibnum.h @@ -0,0 +1,11 @@ +--- src/ibnum.h.orig 2003-01-17 00:49:04 UTC ++++ src/ibnum.h +@@ -60,7 +60,7 @@ int num_array_get(P4(const ref *, int, u + int sdecode_number(P3(const byte *, int, ref *)); + int sdecodeshort(P2(const byte *, int)); + uint sdecodeushort(P2(const byte *, int)); +-long sdecodelong(P2(const byte *, int)); ++int sdecodeint32(P2(const byte *, int)); + float sdecodefloat(P2(const byte *, int)); + + #endif /* ibnum_INCLUDED */ diff --git a/print/ghostscript7-x11/files/patch-src_icclib.mak b/print/ghostscript7-x11/files/patch-src_icclib.mak new file mode 100644 index 000000000000..799053e840ce --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_icclib.mak @@ -0,0 +1,11 @@ +--- src/icclib.mak.orig 2003-01-17 00:49:04 UTC ++++ src/icclib.mak +@@ -73,7 +73,7 @@ $(ICCGEN)icclib.dev : $(ICCLIB_MAK) $(EC + + icc_h=$(ICCSRC)$(D)icc.h $(ICCSRC)$(D)icc$(ICCPROFVER).h + +-$(ICCOBJ)icc.$(OBJ) : $(ICCSRC)icc.c $(ICCDEP) $(icc_h) ++$(ICCOBJ)icc.$(OBJ) : ${ECHOGS_XE} $(ICCSRC)icc.c $(ICCDEP) $(icc_h) + # echo $(ICC_CCFLAGS) + $(EXP)$(ECHOGS_XE) $(ICC_CCFLAGS) + $(ICC_CC) $(ICCO_)icc.$(OBJ) $(C_) $(ICCSRC)icc.c diff --git a/print/ghostscript7-x11/files/patch-src_idebug.c b/print/ghostscript7-x11/files/patch-src_idebug.c new file mode 100644 index 000000000000..fd571d6f3ffe --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_idebug.c @@ -0,0 +1,11 @@ +--- src/idebug.c.orig 2003-01-17 00:49:04 UTC ++++ src/idebug.c +@@ -90,7 +90,7 @@ debug_print_full_ref(const ref * pref) + case t_fontID: + goto strct; + case t_integer: +- dprintf1("int %ld", pref->value.intval); ++ dprintf1("int %d", pref->value.intval); + break; + case t_mark: + dprintf("mark"); diff --git a/print/ghostscript7-x11/files/patch-src_idparam.c b/print/ghostscript7-x11/files/patch-src_idparam.c new file mode 100644 index 000000000000..21035471f01e --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_idparam.c @@ -0,0 +1,21 @@ +--- src/idparam.c.orig 2003-01-17 00:49:04 UTC ++++ src/idparam.c +@@ -61,8 +61,7 @@ dict_int_null_param(const ref * pdict, c + int maxval, int defaultval, int *pvalue) + { + ref *pdval; +- int code; +- long ival; ++ int code, ival; + + if (pdict == 0 || dict_find_string(pdict, kstr, &pdval) <= 0) { + ival = defaultval; +@@ -349,7 +348,7 @@ dict_uid_param(const ref * pdict, gs_uid + } else { + if (!r_has_type(puniqueid, t_integer) || + puniqueid->value.intval < 0 || +- puniqueid->value.intval > 0xffffffL ++ puniqueid->value.intval > 0xffffff + ) + return_error(e_rangecheck); + /* Apparently fonts created by Fontographer often have */ diff --git a/print/ghostscript7-x11/files/patch-src_ijs.mak b/print/ghostscript7-x11/files/patch-src_ijs.mak new file mode 100644 index 000000000000..0f85a8ca35fe --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_ijs.mak @@ -0,0 +1,20 @@ +--- src/ijs.mak.orig 2003-01-17 00:49:04 UTC ++++ src/ijs.mak +@@ -66,7 +66,7 @@ ijs_h=$(IJSSRC)ijs.h + ijs_client_h=$(IJSSRC)$(D)ijs_client.h + ijs_server_h=$(IJSSRC)$(D)ijs_server.h + +-$(IJSOBJ)ijs.$(OBJ) : $(IJSSRC)ijs.c $(IJSDEP) $(ijs_h) ++$(IJSOBJ)ijs.$(OBJ) : ${ECHOGS_XE} $(IJSSRC)ijs.c $(IJSDEP) $(ijs_h) + # echo $(IJS_CCFLAGS) + $(EXP)$(ECHOGS_XE) $(IJS_CCFLAGS) + $(IJS_CC) $(IJSO_)ijs.$(OBJ) $(C_) $(IJSSRC)ijs.c +@@ -79,7 +79,7 @@ $(IJSOBJ)ijs_server.$(OBJ) : $(IJSSRC)ij + $(IJSDEP) $(ijs_h) $(ijs_server_h) + $(IJS_CC) $(IJSO_)ijs_server.$(OBJ) $(C_) $(IJSSRC)ijs_server.c + +-$(IJSOBJ)ijs_exec_unix.$(OBJ) : $(IJSSRC)ijs_exec_unix.c \ ++$(IJSOBJ)ijs_exec_unix.$(OBJ) : $(arch_h) $(IJSSRC)ijs_exec_unix.c \ + $(IJSDEP) $(ijs_h) $(ijs_client_h) + $(IJS_CC) $(IJSO_)ijs_exec_unix.$(OBJ) $(C_) $(IJSSRC)ijs_exec_unix.c + diff --git a/print/ghostscript7-x11/files/patch-src_int.mak b/print/ghostscript7-x11/files/patch-src_int.mak new file mode 100644 index 000000000000..01b748aeba23 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_int.mak @@ -0,0 +1,24 @@ +--- src/int.mak.orig 2003-01-17 00:49:04 UTC ++++ src/int.mak +@@ -953,10 +953,10 @@ $(PSOBJ)iccfont.$(OBJ) : $(PSSRC)iccfont + + # We select either iccinit0 or iccinit1 depending on COMPILE_INITS. + +-$(PSOBJ)iccinit0.$(OBJ) : $(PSSRC)iccinit0.c $(stdpre_h) ++$(PSOBJ)iccinit0.$(OBJ) : $(arch_h) $(PSSRC)iccinit0.c $(stdpre_h) + $(PSCC) $(PSO_)iccinit0.$(OBJ) $(C_) $(PSSRC)iccinit0.c + +-$(PSOBJ)iccinit1.$(OBJ) : $(PSOBJ)gs_init.$(OBJ) ++$(PSOBJ)iccinit1.$(OBJ) : $(arch_h) $(PSOBJ)gs_init.$(OBJ) + $(CP_) $(PSOBJ)gs_init.$(OBJ) $(PSOBJ)iccinit1.$(OBJ) + + # All the gs_*.ps files should be prerequisites of gs_init.c, +@@ -964,7 +964,7 @@ $(PSOBJ)iccinit1.$(OBJ) : $(PSOBJ)gs_ini + $(PSGEN)gs_init.c : $(PSLIB)$(GS_INIT) $(GENINIT_XE) $(gconfig_h) + $(EXP)$(GENINIT_XE) -I $(PSLIB) $(GS_INIT) $(gconfig_h) -c $(PSGEN)gs_init.c + +-$(PSOBJ)gs_init.$(OBJ) : $(PSGEN)gs_init.c $(stdpre_h) ++$(PSOBJ)gs_init.$(OBJ) : $(arch_h) $(PSGEN)gs_init.c $(stdpre_h) + $(PSCC) $(PSO_)gs_init.$(OBJ) $(C_) $(PSGEN)gs_init.c + + # ---------------- Stochastic halftone ---------------- # diff --git a/print/ghostscript7-x11/files/patch-src_iparam.c b/print/ghostscript7-x11/files/patch-src_iparam.c new file mode 100644 index 000000000000..7407e2e98968 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_iparam.c @@ -0,0 +1,33 @@ +--- src/iparam.c.orig 2003-01-17 00:49:04 UTC ++++ src/iparam.c +@@ -67,7 +67,7 @@ ref_to_key(const ref * pref, gs_param_ke + int len; + byte *buf; + +- sprintf(istr, "%ld", pref->value.intval); ++ sprintf(istr, "%d", pref->value.intval); + len = strlen(istr); + /* GC will take care of freeing this: */ + buf = gs_alloc_string(plist->memory, len, "ref_to_key"); +@@ -394,7 +394,7 @@ stack_param_enumerate(iparam_list * plis + { + int code; + stack_param_list *const splist = (stack_param_list *) plist; +- long index = penum->intval; ++ int index = penum->intval; + ref *stack_element; + + do { +@@ -563,12 +563,6 @@ ref_param_read_int_array(gs_param_list * + code = gs_note_error(e_typecheck); + break; + } +-#if arch_sizeof_int < arch_sizeof_long +- if (elt.value.intval != (int)elt.value.intval) { +- code = gs_note_error(e_rangecheck); +- break; +- } +-#endif + piv[i] = (int)elt.value.intval; + } + if (code < 0) { diff --git a/print/ghostscript7-x11/files/patch-src_iref.h b/print/ghostscript7-x11/files/patch-src_iref.h new file mode 100644 index 000000000000..a2d9d77e775d --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_iref.h @@ -0,0 +1,11 @@ +--- src/iref.h.orig 2003-01-17 00:49:04 UTC ++++ src/iref.h +@@ -441,7 +441,7 @@ struct ref_s { + #define r_set_ptr(rp,ptr) ((rp)->value.pstruct = (obj_header_t *)(ptr)) + + union v { /* name the union to keep gdb happy */ +- long intval; ++ int intval; + ushort boolval; + float realval; + ulong saveid; diff --git a/print/ghostscript7-x11/files/patch-src_iscan.c b/print/ghostscript7-x11/files/patch-src_iscan.c new file mode 100644 index 000000000000..696ab0d60de8 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_iscan.c @@ -0,0 +1,11 @@ +--- src/iscan.c.orig 2003-01-17 00:49:04 UTC ++++ src/iscan.c +@@ -635,7 +635,7 @@ scan_token(i_ctx_t *i_ctx_p, stream * s, + uint size = ref_stack_count_inline(&o_stack) - pstack; + ref arr; + +- if_debug4('S', "[S}]d=%d, s=%d->%ld, c=%d\n", ++ if_debug4('S', "[S}]d=%d, s=%d->%d, c=%d\n", + pdepth, pstack, + (pstack == pdepth ? 0 : + ref_stack_index(&o_stack, size)->value.intval), diff --git a/print/ghostscript7-x11/files/patch-src_iscanbin.c b/print/ghostscript7-x11/files/patch-src_iscanbin.c new file mode 100644 index 000000000000..f256e453c5b4 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_iscanbin.c @@ -0,0 +1,83 @@ +--- src/iscanbin.c.orig 2003-01-17 00:49:04 UTC ++++ src/iscanbin.c +@@ -173,7 +173,7 @@ scan_binary_token(i_ctx_t *i_ctx_p, stre + pbs->num_format = num_format; + if (top_size == 0) { + /* Extended header (2-byte array size, 4-byte length) */ +- ulong lsize; ++ uint lsize; + + if (rcnt < 7) { + s_end_inline(s, p - 1, rlimit); +@@ -183,7 +183,7 @@ scan_binary_token(i_ctx_t *i_ctx_p, stre + if (p[1] != 0) /* reserved, must be 0 */ + return_error(e_syntaxerror); + top_size = sdecodeushort(p + 2, num_format); +- lsize = sdecodelong(p + 4, num_format); ++ lsize = sdecodeint32(p + 4, num_format); + if ((size = lsize) != lsize) + return_error(e_limitcheck); + hsize = 8; +@@ -445,8 +445,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, regi + for (; index < max_array_index; p += SIZEOF_BIN_SEQ_OBJ, index++) { + ref *op = abase + index; + uint osize; +- long value; +- uint atype, attrs; ++ int value, atype, attrs; + + s_end_inline(s, p, rlimit); /* in case of error */ + if (rlimit - p < SIZEOF_BIN_SEQ_OBJ) { +@@ -464,14 +463,14 @@ scan_bos_continue(i_ctx_t *i_ctx_p, regi + make_null(op); + break; + case BS_TYPE_INTEGER: +- make_int(op, sdecodelong(p + 5, num_format)); ++ make_int(op, sdecodeint32(p + 5, num_format)); + break; + case BS_TYPE_REAL:{ + float vreal; + + osize = sdecodeushort(p + 3, num_format); + if (osize != 0) { /* fixed-point number */ +- value = sdecodelong(p + 5, num_format); ++ value = sdecodeint32(p + 5, num_format); + vreal = (float)ldexp((double)value, -osize); + } else { + vreal = sdecodefloat(p + 5, num_format); +@@ -480,7 +479,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, regi + break; + } + case BS_TYPE_BOOLEAN: +- make_bool(op, sdecodelong(p + 5, num_format) != 0); ++ make_bool(op, sdecodeint32(p + 5, num_format) != 0); + break; + case BS_TYPE_STRING: + osize = sdecodeushort(p + 3, num_format); +@@ -492,7 +491,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, regi + make_empty_string(op, attrs); + break; + } +- value = sdecodelong(p + 5, num_format); ++ value = sdecodeint32(p + 5, num_format); + if (value < max_array_index * SIZEOF_BIN_SEQ_OBJ || + value + osize > size + ) +@@ -524,7 +523,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, regi + /* falls through */ + case BS_TYPE_NAME: + osize = sdecodeushort(p + 3, num_format); +- value = sdecodelong(p + 5, num_format); ++ value = sdecodeint32(p + 5, num_format); + switch (osize) { + case 0: + code = array_get(user_names_p, value, op); +@@ -546,7 +545,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, regi + osize = sdecodeushort(p + 3, num_format); + atype = t_array; + arr: +- value = sdecodelong(p + 5, num_format); ++ value = sdecodeint32(p + 5, num_format); + if (value + osize > min_string_index || + value & (SIZEOF_BIN_SEQ_OBJ - 1) + ) diff --git a/print/ghostscript7-x11/files/patch-src_iscannum.c b/print/ghostscript7-x11/files/patch-src_iscannum.c new file mode 100644 index 000000000000..592dbbece941 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_iscannum.c @@ -0,0 +1,203 @@ +--- src/iscannum.c.orig 2003-01-17 00:49:04 UTC ++++ src/iscannum.c +@@ -57,7 +57,6 @@ scan_number(const byte * str, const byte + }; + + int ival; +- long lval; + double dval; + int exp10; + int code = 0; +@@ -104,8 +103,26 @@ scan_number(const byte * str, const byte + GET_NEXT(c, sp, goto iret); + if (!IS_DIGIT(d, c)) + break; +- if (WOULD_OVERFLOW(ival, d, max_int)) +- goto i2l; ++ if (WOULD_OVERFLOW((unsigned)ival, d, max_int)) { ++ /* goto i2l; */ ++ if (ival == max_int / 10 && d == (max_int % 10) + 1 && sign < 0) { ++ GET_NEXT(c, sp, c= EOFC); ++ dval = -(double)min_int; ++ if (c == 'e' || c == 'E') { ++ exp10 = 0; ++ goto fs; ++ } else if (c == '.') { ++ GET_NEXT(c, sp, c = EOFC); ++ exp10 = 0; ++ goto fd; ++ } else if (!IS_DIGIT(d, c)) { ++ ival = min_int; ++ break; ++ } ++ } else ++ dval = ival; ++ goto l2d; ++ } + } + ind: /* We saw a non-digit while accumulating an integer in ival. */ + switch (c) { +@@ -116,6 +133,8 @@ scan_number(const byte * str, const byte + *psp = sp; + code = 1; + break; ++ case EOFC: ++ break; + case 'e': + case 'E': + if (sign < 0) +@@ -125,8 +144,8 @@ scan_number(const byte * str, const byte + goto fe; + case '#': + { +- const uint radix = (uint)ival; +- ulong uval = 0, lmax; ++ const int radix = ival; ++ uint uval = 0, imax; + + if (sign || radix < min_radix || radix > max_radix) + return_error(e_syntaxerror); +@@ -136,19 +155,19 @@ scan_number(const byte * str, const byte + + switch (radix) { + case 2: +- shift = 1, lmax = max_ulong >> 1; ++ shift = 1, imax = max_uint >> 1; + break; + case 4: +- shift = 2, lmax = max_ulong >> 2; ++ shift = 2, imax = max_uint >> 2; + break; + case 8: +- shift = 3, lmax = max_ulong >> 3; ++ shift = 3, imax = max_uint >> 3; + break; + case 16: +- shift = 4, lmax = max_ulong >> 4; ++ shift = 4, imax = max_uint >> 4; + break; + case 32: +- shift = 5, lmax = max_ulong >> 5; ++ shift = 5, imax = max_uint >> 5; + break; + default: /* can't happen */ + return_error(e_rangecheck); +@@ -161,13 +180,13 @@ scan_number(const byte * str, const byte + code = 1; + break; + } +- if (uval > lmax) ++ if (uval > imax) + return_error(e_limitcheck); + } + } else { +- int lrem = max_ulong % radix; ++ int irem = max_uint % radix; + +- lmax = max_ulong / radix; ++ imax = max_uint / radix; + for (;; uval = uval * radix + d) { + GET_NEXT(c, sp, break); + d = decoder[c]; +@@ -176,8 +195,8 @@ scan_number(const byte * str, const byte + code = 1; + break; + } +- if (uval >= lmax && +- (uval > lmax || d > lrem) ++ if (uval >= imax && ++ (uval > imax || d > irem) + ) + return_error(e_limitcheck); + } +@@ -190,55 +209,6 @@ iret: + make_int(pref, (sign < 0 ? -ival : ival)); + return code; + +- /* Accumulate a long in lval. */ +-i2l: +- for (lval = ival;;) { +- if (WOULD_OVERFLOW(lval, d, max_long)) { +- /* Make a special check for entering the smallest */ +- /* (most negative) integer. */ +- if (lval == max_long / 10 && +- d == (int)(max_long % 10) + 1 && sign < 0 +- ) { +- GET_NEXT(c, sp, c = EOFC); +- dval = -(double)min_long; +- if (c == 'e' || c == 'E' || c == '.') { +- exp10 = 0; +- goto fs; +- } else if (!IS_DIGIT(d, c)) { +- lval = min_long; +- break; +- } +- } else +- dval = lval; +- goto l2d; +- } +- lval = lval * 10 + d; +- GET_NEXT(c, sp, goto lret); +- if (!IS_DIGIT(d, c)) +- break; +- } +- switch (c) { +- case '.': +- GET_NEXT(c, sp, c = EOFC); +- exp10 = 0; +- goto l2r; +- case EOFC: +- break; +- default: +- *psp = sp; +- code = 1; +- break; +- case 'e': +- case 'E': +- exp10 = 0; +- goto le; +- case '#': +- return_error(e_syntaxerror); +- } +-lret: +- make_int(pref, (sign < 0 ? -lval : lval)); +- return code; +- + /* Accumulate a double in dval. */ + l2d: + exp10 = 0; +@@ -274,8 +244,8 @@ i2r: + exp10 = 0; + while (IS_DIGIT(d, c)) { + if (WOULD_OVERFLOW(ival, d, max_int)) { +- lval = ival; +- goto l2r; ++ dval = ival; ++ goto fd; + } + ival = ival * 10 + d; + exp10--; +@@ -293,23 +263,6 @@ i2r: + dval = ival; + goto fe; + +- /* We saw a '.' while accumulating a long in lval. */ +-l2r: +- while (IS_DIGIT(d, c)) { +- if (WOULD_OVERFLOW(lval, d, max_long)) { +- dval = lval; +- goto fd; +- } +- lval = lval * 10 + d; +- exp10--; +- GET_NEXT(c, sp, c = EOFC); +- } +-le: +- if (sign < 0) +- lval = -lval; +- dval = lval; +- goto fe; +- + /* Now we are accumulating a double in dval. */ + fd: + while (IS_DIGIT(d, c)) { diff --git a/print/ghostscript7-x11/files/patch-src_iutil.c b/print/ghostscript7-x11/files/patch-src_iutil.c new file mode 100644 index 000000000000..7e754463bd42 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_iutil.c @@ -0,0 +1,11 @@ +--- src/iutil.c.orig 2003-01-17 00:49:04 UTC ++++ src/iutil.c +@@ -428,7 +428,7 @@ other: + data = (const byte *)(op->value.boolval ? "true" : "false"); + break; + case t_integer: +- sprintf(buf, "%ld", op->value.intval); ++ sprintf(buf, "%d", op->value.intval); + break; + case t_string: + check_read(*op); diff --git a/print/ghostscript7-x11/files/patch-src_lib.mak b/print/ghostscript7-x11/files/patch-src_lib.mak new file mode 100644 index 000000000000..2656c5831d92 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_lib.mak @@ -0,0 +1,46 @@ +--- src/lib.mak.orig 2003-01-17 00:49:05 UTC ++++ src/lib.mak +@@ -35,6 +35,7 @@ GLICCCC=$(CC_) $(I_)$(GLI_) $(II)$(ICCI_ + GLJCC=$(CC_) $(I_)$(GLI_) $(II)$(JI_)$(_I) $(JCF_) $(GLF_) + GLZCC=$(CC_) $(I_)$(GLI_) $(II)$(ZI_)$(_I) $(ZCF_) $(GLF_) + GLCCLEAF=$(CC_LEAF) $(I_)$(GLI_)$(_I) $(GLF_) ++GLCCSHARED=$(CC_SHARED) $(GLCCFLAGS) + # All top-level makefiles define GLD. + #GLD=$(GLGEN) + +@@ -187,22 +188,22 @@ gsnogc_=$(GLOBJ)gsnogc.$(OBJ) + $(GLD)gsnogc.dev : $(LIB_MAK) $(ECHOGS_XE) $(gsnogc_) + $(SETMOD) $(GLD)gsnogc $(gsnogc_) + +-$(GLOBJ)gsnogc.$(OBJ) : $(GLSRC)gsnogc.c $(GX)\ ++$(GLOBJ)gsnogc.$(OBJ) : $(arch_h) $(GLSRC)gsnogc.c $(GX)\ + $(gsmdebug_h) $(gsnogc_h) $(gsstruct_h) $(gxalloc_h) + $(GLCC) $(GLO_)gsnogc.$(OBJ) $(C_) $(GLSRC)gsnogc.c + + ### Bitmap processing + +-$(GLOBJ)gsbitcom.$(OBJ) : $(GLSRC)gsbitcom.c $(AK) $(std_h)\ ++$(GLOBJ)gsbitcom.$(OBJ) : $(arch_h) $(GLSRC)gsbitcom.c $(AK) $(std_h)\ + $(gdebug_h) $(gsbitops_h) $(gstypes_h) + $(GLCC) $(GLO_)gsbitcom.$(OBJ) $(C_) $(GLSRC)gsbitcom.c + +-$(GLOBJ)gsbitops.$(OBJ) : $(GLSRC)gsbitops.c $(AK) $(memory__h) $(stdio__h)\ ++$(GLOBJ)gsbitops.$(OBJ) : $(arch_h) $(GLSRC)gsbitops.c $(AK) $(memory__h) $(stdio__h)\ + $(gdebug_h) $(gsbittab_h) $(gserror_h) $(gserrors_h) $(gstypes_h)\ + $(gxbitops_h) + $(GLCC) $(GLO_)gsbitops.$(OBJ) $(C_) $(GLSRC)gsbitops.c + +-$(GLOBJ)gsbittab.$(OBJ) : $(GLSRC)gsbittab.c $(AK) $(stdpre_h) $(gsbittab_h) ++$(GLOBJ)gsbittab.$(OBJ) : $(arch_h) $(GLSRC)gsbittab.c $(AK) $(stdpre_h) $(gsbittab_h) + $(GLCC) $(GLO_)gsbittab.$(OBJ) $(C_) $(GLSRC)gsbittab.c + + # gsflip is not part of the standard configuration: it's rather large, +@@ -765,7 +766,7 @@ $(GLOBJ)gsparam.$(OBJ) : $(GLSRC)gsparam + $(GLOBJ)gsparamx.$(OBJ) : $(GLSRC)gsparamx.c $(string__h)\ + $(gserror_h) $(gserrors_h) $(gsmemory_h) $(gsparam_h) $(gsparamx_h)\ + $(gstypes_h) +- $(GLCC) $(GLO_)gsparamx.$(OBJ) $(C_) $(GLSRC)gsparamx.c ++ $(GLCCSHARED) $(GLO_)gsparamx.$(OBJ) $(C_) $(GLSRC)gsparamx.c + + # Future replacement for gsparams.c + $(GLOBJ)gsparam2.$(OBJ) : $(GLSRC)gsparam2.c $(GXERR) $(memory__h)\ diff --git a/print/ghostscript7-x11/files/patch-src_unix-dll.mak b/print/ghostscript7-x11/files/patch-src_unix-dll.mak new file mode 100644 index 000000000000..3762f90eda3a --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_unix-dll.mak @@ -0,0 +1,87 @@ +--- src/unix-dll.mak.orig 2003-01-17 00:49:05 UTC ++++ src/unix-dll.mak +@@ -47,12 +47,17 @@ GSSOX_XE=$(BINDIR)/$(GSSOX_XENAME) + GSSOX=$(BINDIR)/$(SOBINRELDIR)/$(GSSOX_XENAME) + + # shared library +-GS_SONAME=lib$(GS).so ++GS_SONAME_BASE=lib$(GS) ++ ++GS_SOEXT=so ++GS_SONAME=$(GS_SONAME_BASE).$(GS_SOEXT) + GS_SONAME_MAJOR=$(GS_SONAME).$(GS_VERSION_MAJOR) +-GS_SONAME_MAJOR_MINOR= $(GS_SONAME).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR) ++GS_SONAME_MAJOR_MINOR=$(GS_SONAME).$(GS_VERSION_MAJOR).$(GS_VERSION_MINOR) ++LDFLAGS_SO=-shared -Wl,-soname=$(GS_SONAME_MAJOR) ++ + GS_SO=$(BINDIR)/$(GS_SONAME) +-GS_SO_MAJOR=$(GS_SO).$(GS_VERSION_MAJOR) +-GS_SO_MAJOR_MINOR=$(GS_SO_MAJOR).$(GS_VERSION_MINOR) ++GS_SO_MAJOR=$(BINDIR)/$(GS_SONAME_MAJOR) ++GS_SO_MAJOR_MINOR=$(BINDIR)/$(GS_SONAME_MAJOR_MINOR) + + # Shared object is built by redefining GS_XE in a recursive make. + +@@ -68,15 +73,16 @@ $(GS_SO_MAJOR): $(GS_SO_MAJOR_MINOR) + + # Build the small Ghostscript loaders, with Gtk+ and without + +-$(GSSOX_XE): $(GS_SO) $(GLSRC)dxmain.c +- $(GLCC) -g `gtk-config --cflags` -o $(GSSOX_XE) $(GLSRC)dxmain.c -L$(BINDIR) -l$(GS) `gtk-config --libs` ++$(GSSOX_XE): $(GS_SO) $(GLSRC)$(SOC_LOADER) ++ $(GLCC) -g -o $(GSSOX_XE) $(GLSRC)dxmainc.c -L$(BINDIR) -l$(GS) + +-$(GSSOC_XE): $(GS_SO) $(GLSRC)dxmainc.c +- $(GLCC) -g -o $(GSSOC_XE) $(GLSRC)dxmainc.c -L$(BINDIR) -l$(GS) ++$(GSSOC_XE): $(GS_SO) $(GLSRC)$(SOC_LOADER) ++ $(GLCC) -g $(SOC_CFLAGS) -o $(GSSOC_XE) $(GLSRC)$(SOC_LOADER) \ ++ -L$(BINDIR) -l$(GS) $(SOC_LIBS) + + # ------------------------- Recursive make targets ------------------------- # + +-SODEFS=LDFLAGS='$(LDFLAGS) $(CFLAGS_SO) -shared -Wl,-soname,$(GS_SONAME_MAJOR)'\ ++SODEFS=LDFLAGS='$(LDFLAGS) $(LDFLAGS_SO)'\ + GS_XE=$(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR)\ + STDIO_IMPLEMENTATION=c\ + DISPLAY_DEV=$(DD)$(SOOBJRELDIR)/display.dev\ +@@ -98,21 +104,26 @@ sodebug: SODIRS + $(MAKE) $(SODEFS) GENOPT='-DDEBUG' CFLAGS='$(CFLAGS_DEBUG) $(CFLAGS_SO) $(GCFLAGS) $(XCFLAGS)' $(GSSOC) $(GSSOX) + + install-so: so +- -mkdir -p $(prefix) +- -mkdir -p $(datadir) +- -mkdir -p $(gsdir) +- -mkdir -p $(gsdatadir) +- -mkdir -p $(bindir) +- -mkdir -p $(libdir) +- $(INSTALL_PROGRAM) $(GSSOC) $(bindir)/$(GSSOC_XENAME) +- $(INSTALL_PROGRAM) $(GSSOX) $(bindir)/$(GSSOX_XENAME) +- $(INSTALL_PROGRAM) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME_MAJOR_MINOR) +- $(RM_) $(libdir)/$(GS_SONAME) +- ln -s $(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME) +- $(RM_) $(libdir)/$(GS_SONAME_MAJOR) +- ln -s $(GS_SONAME_MAJOR_MINOR) $(libdir)/$(GS_SONAME_MAJOR) ++ -mkdir -p $(DESTDIR)$(prefix) ++ -mkdir -p $(DESTDIR)$(datadir) ++ -mkdir -p $(DESTDIR)$(gsdir) ++ -mkdir -p $(DESTDIR)$(gsdatadir) ++ -mkdir -p $(DESTDIR)$(bindir) ++ -mkdir -p $(DESTDIR)$(libdir) ++ -mkdir -p $(DESTDIR)$(gsincludedir) ++ $(INSTALL_PROGRAM) $(GSSOC) $(DESTDIR)$(bindir)/$(GSSOC_XENAME) ++ $(INSTALL_PROGRAM) $(GSSOX) $(DESTDIR)$(bindir)/$(GSSOX_XENAME) ++ $(INSTALL_PROGRAM) $(BINDIR)/$(SOBINRELDIR)/$(GS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GS_SONAME_MAJOR_MINOR) ++ $(RM_) $(DESTDIR)$(libdir)/$(GS_SONAME) ++ ln -s $(GS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GS_SONAME) ++ $(RM_) $(DESTDIR)$(libdir)/$(GS_SONAME_MAJOR) ++ ln -s $(GS_SONAME_MAJOR_MINOR) $(DESTDIR)$(libdir)/$(GS_SONAME_MAJOR) ++ $(INSTALL_DATA) $(GLSRC)iapi.h $(DESTDIR)$(gsincludedir)iapi.h ++ $(INSTALL_DATA) $(GLSRC)errors.h $(DESTDIR)$(gsincludedir)ierrors.h ++ $(INSTALL_DATA) $(GLSRC)gdevdsp.h $(DESTDIR)$(gsincludedir)gdevdsp.h + +-soinstall: install-so install-scripts install-data ++ ++soinstall: install-so install-scripts install-data $(INSTALL_SHARED) $(INSTALL_CONTRIB) + + # Make the build directories + SODIRS: STDDIRS diff --git a/print/ghostscript7-x11/files/patch-src_unixinst.mak b/print/ghostscript7-x11/files/patch-src_unixinst.mak new file mode 100644 index 000000000000..4236b575f6af --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_unixinst.mak @@ -0,0 +1,122 @@ +--- src/unixinst.mak.orig 2003-01-17 00:49:05 UTC ++++ src/unixinst.mak +@@ -30,24 +30,24 @@ install: install-exec install-scripts in + # rules, just in case bindir or scriptdir is a subdirectory of any of these. + + install-exec: $(GS_XE) +- -mkdir -p $(datadir) +- -mkdir -p $(gsdir) +- -mkdir -p $(gsdatadir) +- -mkdir -p $(bindir) +- $(INSTALL_PROGRAM) $(GS_XE) $(bindir)/$(GS) ++ -mkdir -p $(DESTDIR)$(datadir) ++ -mkdir -p $(DESTDIR)$(gsdir) ++ -mkdir -p $(DESTDIR)$(gsdatadir) ++ -mkdir -p $(DESTDIR)$(bindir) ++ $(INSTALL_PROGRAM) $(GS_XE) $(DESTDIR)$(bindir)/$(GS) + + install-scripts: $(PSLIBDIR)/gsnd +- -mkdir -p $(datadir) +- -mkdir -p $(gsdir) +- -mkdir -p $(gsdatadir) +- -mkdir -p $(scriptdir) ++ -mkdir -p $(DESTDIR)$(datadir) ++ -mkdir -p $(DESTDIR)$(gsdir) ++ -mkdir -p $(DESTDIR)$(gsdatadir) ++ -mkdir -p $(DESTDIR)$(scriptdir) + $(SH) -c 'for f in \ + gsbj gsdj gsdj500 gslj gslp gsnd \ + bdftops dvipdf eps2eps font2c \ + pdf2dsc pdf2ps pdfopt pf2afm pfbtopfa printafm \ + ps2ascii ps2epsi ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr ps2ps wftopfa \ + fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh ;\ +- do if ( test -f $(PSLIBDIR)/$$f ); then $(INSTALL_PROGRAM) $(PSLIBDIR)/$$f $(scriptdir); fi;\ ++ do if ( test -f $(PSLIBDIR)/$$f ); then $(INSTALL_SCRIPT) $(PSLIBDIR)/$$f $(DESTDIR)$(scriptdir); fi;\ + done' + + PSDOCDIR=$(PSLIBDIR)/../doc +@@ -60,10 +60,10 @@ install-data: install-libdata install-do + # one file from each subdirectory just as a sanity check. + + install-libdata: +- -mkdir -p $(datadir) +- -mkdir -p $(gsdir) +- -mkdir -p $(gsdatadir) +- -mkdir -p $(gsdatadir)/lib ++ -mkdir -p $(DESTDIR)$(datadir) ++ -mkdir -p $(DESTDIR)$(gsdir) ++ -mkdir -p $(DESTDIR)$(gsdatadir) ++ -mkdir -p $(DESTDIR)$(gsdatadir)/lib + $(SH) -c 'for f in \ + Fontmap Fontmap.GS \ + CIDFnmap CIDFnmap.Ore CIDFnmap.ARP CIDFnmap.Bae CIDFnmap.Koc \ +@@ -83,13 +83,13 @@ viewcmyk.ps viewgif.ps viewjpeg.ps viewm + viewpcx.ps viewpbm.ps viewps2a.ps \ + winmaps.ps wftopfa.ps wrfont.ps zeroline.ps \ + pdf2dsc.ps pdfopt.ps ;\ +- do if ( test -f $(PSLIBDIR)/$$f ); then $(INSTALL_DATA) $(PSLIBDIR)/$$f $(gsdatadir)/lib; fi;\ ++ do if ( test -f $(PSLIBDIR)/$$f ); then $(INSTALL_DATA) $(PSLIBDIR)/$$f $(DESTDIR)$(gsdatadir)/lib; fi;\ + done' + $(SH) -c 'for f in $(PSLIBDIR)/gs_*.ps $(PSLIBDIR)/pdf*.ps;\ +- do $(INSTALL_DATA) $$f $(gsdatadir)/lib ;\ ++ do $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)/lib ;\ + done' + $(SH) -c 'for f in $(PSLIBDIR)/*.ppd $(PSLIBDIR)/*.rpd $(PSLIBDIR)/*.upp $(PSLIBDIR)/*.xbm $(PSLIBDIR)/*.xpm;\ +- do $(INSTALL_DATA) $$f $(gsdatadir)/lib ;\ ++ do $(INSTALL_DATA) $$f $(DESTDIR)$(gsdatadir)/lib ;\ + done' + + # install html documentation +@@ -106,20 +106,20 @@ DOC_PAGES=PUBLIC README index.html gs.cs + Psfiles.htm Public.htm Readme.htm Release.htm \ + Source.htm Tester.htm Unix-lpr.htm Use.htm Xfonts.htm + install-doc: $(PSDOCDIR)/News.htm +- -mkdir -p $(docdir) ++ -mkdir -p $(DESTDIR)$(docdir) + $(SH) -c 'for f in $(DOC_PAGES) ;\ +- do if ( test -f $(PSDOCDIR)/$$f ); then $(INSTALL_DATA) $(PSDOCDIR)/$$f $(docdir); fi;\ ++ do if ( test -f $(PSDOCDIR)/$$f ); then $(INSTALL_DATA) $(PSDOCDIR)/$$f $(DESTDIR)$(docdir); fi;\ + done' + + # install the man pages for each locale +-MAN_LCDIRS=. de ++MAN_LCDIRS=. + MAN1_LINKS_PS2PS=eps2eps + MAN1_LINKS_PS2PDF=ps2pdf12 ps2pdf13 + MAN1_LINKS_GSLP=gsbj gsdj gsdj500 gslj + install-man: $(PSMANDIR)/gs.1 +- $(SH) -c 'test -d $(mandir) || mkdir -p $(mandir)' ++ $(SH) -c 'test -d $(DESTDIR)$(mandir) || mkdir -p $(DESTDIR)$(mandir)' + $(SH) -c 'for d in $(MAN_LCDIRS) ;\ +- do man1dir=$(mandir)/$$d/man$(man1ext) ;\ ++ do man1dir=$(DESTDIR)$(mandir)/$$d/man$(man1ext) ;\ + ( test -d $$man1dir || mkdir -p $$man1dir ) ;\ + for f in $(PSMANDIR)/$$d/*.1 ;\ + do $(INSTALL_DATA) $$f $$man1dir ;\ +@@ -146,17 +146,22 @@ install-man: $(PSMANDIR)/gs.1 + + # install the example files + install-examples: +- -mkdir -p $(exdir) ++ -mkdir -p $(DESTDIR)$(exdir) + for f in \ + alphabet.ps colorcir.ps doretree.ps escher.ps golfer.ps \ + grayalph.ps snowflak.ps tiger.ps vasarely.ps waterfal.ps \ + ridt91.eps ;\ +- do $(INSTALL_DATA) $(PSEXDIR)/$$f $(exdir) ;\ ++ do $(INSTALL_DATA) $(PSEXDIR)/$$f $(DESTDIR)$(exdir) ;\ + done +- -mkdir -p $(exdir)/cjk ++ -mkdir -p $(DESTDIR)$(exdir)/cjk + for f in \ + all_ac1.ps all_ag1.ps all_aj1.ps all_aj2.ps all_ak1.ps \ + gscjk_ac.ps gscjk_ag.ps gscjk_aj.ps gscjk_ak.ps \ + iso2022.ps;\ +- do $(INSTALL_DATA) $(PSEXDIR)/cjk/$$f $(exdir)/cjk ;\ ++ do $(INSTALL_DATA) $(PSEXDIR)/cjk/$$f $(DESTDIR)$(exdir)/cjk ;\ + done ++ ++install-shared: $(GS_SHARED_OBJS) ++ -mkdir -p $(DESTDIR)$(gssharedir) ++ $(SH) -c 'for obj in $(GS_SHARED_OBJS); do \ ++ $(INSTALL_PROGRAM) $$obj $(DESTDIR)$(gssharedir)/; done' diff --git a/print/ghostscript7-x11/files/patch-src_zarith.c b/print/ghostscript7-x11/files/patch-src_zarith.c new file mode 100644 index 000000000000..371179a786fc --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_zarith.c @@ -0,0 +1,48 @@ +--- src/zarith.c.orig 2003-01-17 00:49:05 UTC ++++ src/zarith.c +@@ -32,9 +32,9 @@ + */ + + /* Define max and min values for what will fit in value.intval. */ +-#define MIN_INTVAL min_long +-#define MAX_INTVAL max_long +-#define MAX_HALF_INTVAL ((1L << (size_of(long) * 4 - 1)) - 1) ++#define MIN_INTVAL 0x80000000 ++#define MAX_INTVAL 0x7fffffff ++#define MAX_HALF_INTVAL 0x7fff + + /* add */ + /* We make this into a separate procedure because */ +@@ -64,7 +64,7 @@ zop_add(register os_ptr op) + op[-1].value.realval += (double)op->value.intval; + break; + case t_integer: { +- long int2 = op->value.intval; ++ int int2 = op->value.intval; + + if (((op[-1].value.intval += int2) ^ int2) < 0 && + ((op[-1].value.intval - int2) ^ int2) >= 0 +@@ -158,10 +158,10 @@ zmul(i_ctx_t *i_ctx_p) + op[-1].value.realval *= (double)op->value.intval; + break; + case t_integer: { +- long int1 = op[-1].value.intval; +- long int2 = op->value.intval; +- long abs1 = (int1 >= 0 ? int1 : -int1); +- long abs2 = (int2 >= 0 ? int2 : -int2); ++ int int1 = op[-1].value.intval; ++ int int2 = op->value.intval; ++ uint abs1 = (uint)(int1 >= 0 ? int1 : -int1); ++ uint abs2 = (uint)(int2 >= 0 ? int2 : -int2); + float fprod; + + if ((abs1 > MAX_HALF_INTVAL || abs2 > MAX_HALF_INTVAL) && +@@ -212,7 +212,7 @@ zop_sub(register os_ptr op) + op[-1].value.realval -= (double)op->value.intval; + break; + case t_integer: { +- long int1 = op[-1].value.intval; ++ int int1 = op[-1].value.intval; + + if ((int1 ^ (op[-1].value.intval = int1 - op->value.intval)) < 0 && + (int1 ^ op->value.intval) < 0 diff --git a/print/ghostscript7-x11/files/patch-src_zcontrol.c b/print/ghostscript7-x11/files/patch-src_zcontrol.c new file mode 100644 index 000000000000..ca23edd3f421 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_zcontrol.c @@ -0,0 +1,20 @@ +--- src/zcontrol.c.orig 2003-01-17 00:49:05 UTC ++++ src/zcontrol.c +@@ -356,7 +356,7 @@ for_pos_int_continue(i_ctx_t *i_ctx_p) + { + os_ptr op = osp; + register es_ptr ep = esp; +- long var = ep[-3].value.intval; ++ int var = ep[-3].value.intval; + + if (var > ep[-1].value.intval) { + esp -= 5; /* pop everything */ +@@ -375,7 +375,7 @@ for_neg_int_continue(i_ctx_t *i_ctx_p) + { + os_ptr op = osp; + register es_ptr ep = esp; +- long var = ep[-3].value.intval; ++ int var = ep[-3].value.intval; + + if (var < ep[-1].value.intval) { + esp -= 5; /* pop everything */ diff --git a/print/ghostscript7-x11/files/patch-src_zdict.c b/print/ghostscript7-x11/files/patch-src_zdict.c new file mode 100644 index 000000000000..7c806e3c0810 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_zdict.c @@ -0,0 +1,29 @@ +--- src/zdict.c.orig 2003-01-17 00:49:05 UTC ++++ src/zdict.c +@@ -35,12 +35,9 @@ zdict(i_ctx_t *i_ctx_p) + os_ptr op = osp; + + check_type(*op, t_integer); +-#if arch_sizeof_int < arch_sizeof_long +- check_int_leu(*op, max_uint); +-#else + if (op->value.intval < 0) + return_error(e_rangecheck); +-#endif ++ + return dict_create((uint) op->value.intval, op); + } + +@@ -458,12 +455,8 @@ zsetmaxlength(i_ctx_t *i_ctx_p) + check_type(*op1, t_dictionary); + check_dict_write(*op1); + check_type(*op, t_integer); +-#if arch_sizeof_int < arch_sizeof_long +- check_int_leu(*op, max_uint); +-#else + if (op->value.intval < 0) + return_error(e_rangecheck); +-#endif + new_size = (uint) op->value.intval; + if (dict_length(op - 1) > new_size) + return_error(e_dictfull); diff --git a/print/ghostscript7-x11/files/patch-src_zdps.c b/print/ghostscript7-x11/files/patch-src_zdps.c new file mode 100644 index 000000000000..e520715fbfdc --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_zdps.c @@ -0,0 +1,25 @@ +--- src/zdps.c.orig 2003-01-17 00:49:05 UTC ++++ src/zdps.c +@@ -46,19 +46,18 @@ zsetscreenphase(i_ctx_t *i_ctx_p) + { + os_ptr op = osp; + int code; +- long x, y; ++ int x, y; + + check_type(op[-2], t_integer); + check_type(op[-1], t_integer); + check_type(*op, t_integer); + x = op[-1].value.intval; + y = op->value.intval; +- if (x != (int)x || y != (int)y || +- op[-2].value.intval < -1 || ++ if (op[-2].value.intval < -1 || + op[-2].value.intval >= gs_color_select_count + ) + return_error(e_rangecheck); +- code = gs_setscreenphase(igs, (int)x, (int)y, ++ code = gs_setscreenphase(igs, x, y, + (gs_color_select_t) op[-2].value.intval); + if (code >= 0) + pop(3); diff --git a/print/ghostscript7-x11/files/patch-src_zfunc4.c b/print/ghostscript7-x11/files/patch-src_zfunc4.c new file mode 100644 index 000000000000..a1d67a42e6ab --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_zfunc4.c @@ -0,0 +1,13 @@ +--- src/zfunc4.c.orig 2003-01-17 00:49:06 UTC ++++ src/zfunc4.c +@@ -150,10 +150,6 @@ check_psc_function(i_ctx_t *i_ctx_p, con + case t_integer: { + int i = elt.value.intval; + +-#if ARCH_SIZEOF_INT < ARCH_SIZEOF_LONG +- if (i != elt.value.intval) /* check for truncation */ +- return_error(e_rangecheck); +-#endif + if (i == (byte)i) { + *p = PtCr_byte; + p[1] = (byte)i; diff --git a/print/ghostscript7-x11/files/patch-src_zgeneric.c b/print/ghostscript7-x11/files/patch-src_zgeneric.c new file mode 100644 index 000000000000..8f4415d717e8 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_zgeneric.c @@ -0,0 +1,20 @@ +--- src/zgeneric.c.orig 2003-01-17 00:49:06 UTC ++++ src/zgeneric.c +@@ -76,7 +76,7 @@ zcopy_integer(i_ctx_t *i_ctx_p) + int count, i; + int code; + +- if ((ulong) op->value.intval > op - osbot) { ++ if ((uint)op->value.intval > (uint)(op - osbot)) { + /* There might be enough elements in other blocks. */ + check_int_ltu(*op, ref_stack_count(&o_stack)); + count = op->value.intval; +@@ -471,7 +471,7 @@ dict_continue(i_ctx_t *i_ctx_p) + { + os_ptr op = osp; + es_ptr obj = esp - 2; +- int index = (int)esp->value.intval; ++ int index = esp->value.intval; + + push(2); /* make room for key and value */ + if ((index = dict_next(obj, index, op - 1)) >= 0) { /* continue */ diff --git a/print/ghostscript7-x11/files/patch-src_ziodev.c b/print/ghostscript7-x11/files/patch-src_ziodev.c new file mode 100644 index 000000000000..8dd578526301 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_ziodev.c @@ -0,0 +1,11 @@ +--- src/ziodev.c.orig 2003-01-17 00:49:06 UTC ++++ src/ziodev.c +@@ -79,8 +79,6 @@ zgetiodevice(i_ctx_t *i_ctx_p) + const byte *dname; + + check_type(*op, t_integer); +- if (op->value.intval != (int)op->value.intval) +- return_error(e_rangecheck); + iodev = gs_getiodevice((int)(op->value.intval)); + if (iodev == 0) /* index out of range */ + return_error(e_rangecheck); diff --git a/print/ghostscript7-x11/files/patch-src_zmath.c b/print/ghostscript7-x11/files/patch-src_zmath.c new file mode 100644 index 000000000000..40b47b967330 --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_zmath.c @@ -0,0 +1,18 @@ +--- src/zmath.c.orig 2003-01-17 00:49:06 UTC ++++ src/zmath.c +@@ -229,14 +229,10 @@ private int + zsrand(i_ctx_t *i_ctx_p) + { + os_ptr op = osp; +- long state; ++ int state; + + check_type(*op, t_integer); + state = op->value.intval; +-#if arch_sizeof_long > 4 +- /* Trim the state back to 32 bits. */ +- state = (int)state; +-#endif + /* + * The following somewhat bizarre adjustments are according to + * public information from Adobe describing their implementation. diff --git a/print/ghostscript7-x11/files/patch-src_zmedia2.c b/print/ghostscript7-x11/files/patch-src_zmedia2.c new file mode 100644 index 000000000000..73e050c2aeaa --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_zmedia2.c @@ -0,0 +1,25 @@ +--- src/zmedia2.c.orig 2003-01-17 00:49:06 UTC ++++ src/zmedia2.c +@@ -429,11 +429,17 @@ make_adjustment_matrix(const gs_point * + + rx = ry, ry = temp; + } +- /* Adjust the medium size if flexible. */ +- if (medium->p.x < MIN_MEDIA_SIZE && mx > rx) +- mx = rx; +- if (medium->p.y < MIN_MEDIA_SIZE && my > ry) +- my = ry; ++ /* If 'medium' is flexible, adjust 'mx' and 'my' towards 'rx' and 'ry', ++ respectively. Note that 'mx' and 'my' have just acquired the largest ++ permissible value, medium->q. */ ++ if (medium->p.x < mx) /* non-empty width range */ ++ if (rx < medium->p.x) mx = medium->p.x; /* minimum */ ++ else if (mx > rx) mx = rx; /* fits */ ++ /* else use medium->q.x, i.e., the maximum */ ++ if (medium->p.y < my) /* non-empty height range */ ++ if (ry < medium->p.y) my = medium->p.y; /* minimum */ ++ else if (my > ry) my = ry; /* fits */ ++ /* else use medium->q.y, i.e., the maximum */ + + /* Translate to align the centers. */ + gs_make_translation(mx / 2, my / 2, pmat); diff --git a/print/ghostscript7-x11/files/patch-src_zstack.c b/print/ghostscript7-x11/files/patch-src_zstack.c new file mode 100644 index 000000000000..3959aac5d4ae --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_zstack.c @@ -0,0 +1,11 @@ +--- src/zstack.c.orig 2003-01-17 00:49:06 UTC ++++ src/zstack.c +@@ -70,7 +70,7 @@ zindex(i_ctx_t *i_ctx_p) + register os_ptr opn; + + check_type(*op, t_integer); +- if ((ulong)op->value.intval >= op - osbot) { ++ if ((uint)op->value.intval >= op - osbot) { + /* Might be in an older stack block. */ + ref *elt; + diff --git a/print/ghostscript7-x11/files/patch-src_ztype.c b/print/ghostscript7-x11/files/patch-src_ztype.c new file mode 100644 index 000000000000..c9828301667f --- /dev/null +++ b/print/ghostscript7-x11/files/patch-src_ztype.c @@ -0,0 +1,34 @@ +--- src/ztype.c.orig 2003-01-17 00:49:06 UTC ++++ src/ztype.c +@@ -53,10 +53,10 @@ private int convert_to_string(P2(os_ptr, + * constant expressions, so we can't use min_long and max_long. + * What a nuisance! + */ +-#define ALT_MIN_LONG (-1L << (arch_sizeof_long * 8 - 1)) +-#define ALT_MAX_LONG (~(ALT_MIN_LONG)) +-private const double min_int_real = (ALT_MIN_LONG * 1.0 - 1); +-private const double max_int_real = (ALT_MAX_LONG * 1.0 + 1); ++#define ALT_MIN_INT (-1 << 31) ++#define ALT_MAX_INT (~(ALT_MIN_INT)) ++static const double min_int_real = (ALT_MIN_INT * 1.0 - 1); ++static const double max_int_real = (ALT_MAX_INT * 1.0 + 1); + + #define REAL_CAN_BE_INT(v)\ + ((v) > min_int_real && (v) < max_int_real) +@@ -356,14 +356,14 @@ zcvrs(i_ctx_t *i_ctx_p) + return_op_typecheck(op - 2); + } + } else { +- ulong ival; ++ uint ival; + byte digits[sizeof(ulong) * 8]; + byte *endp = &digits[countof(digits)]; + byte *dp = endp; + + switch (r_type(op - 2)) { + case t_integer: +- ival = (ulong) op[-2].value.intval; ++ ival = (uint) op[-2].value.intval; + break; + case t_real: + { -- cgit