[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-2023-g76bd0d7

[email protected] (Chris Liddell) Thu, 12 Dec 2019 17:25:37 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  76bd0d75823a571130f340ab6231e064d1f997f7 (commit)
       via  e39d57f23585b6fe71db5433dc205459be7a3c22 (commit)
       via  72f6dd34cd0732cb7cdd9246d5063fc0f70ce79b (commit)
       via  bcb6fb284fcbe776d9ddd44f98d196da7df2c054 (commit)
      from  044848a1752273471e9deab826045eca82030d62 (commit)

----------------------------------------------------------------------
commit 76bd0d75823a571130f340ab6231e064d1f997f7
Author: Chris Liddell <[email protected]>
Date:   Thu Dec 12 14:33:27 2019 +0000

    Move pdf_info.ps into lib (from toolbin)
    
    And add it to the list of files to install on Unix systems.
    
    Also, tweak the comments in pdf_info.ps to reflect its new home.

diff --git a/base/unixinst.mak b/base/unixinst.mak
index 32e1f3c..099d9f2 100644
--- a/base/unixinst.mak
+++ b/base/unixinst.mak
@@ -95,7 +95,7 @@ acctest.ps align.ps bdftops.ps \
 caption.ps cid2code.ps docie.ps \
 errpage.ps font2pcl.ps gslp.ps gsnup.ps image-qa.ps \
 jispaper.ps landscap.ps lines.ps \
-mkcidfm.ps PDFA_def.ps PDFX_def.ps \
+mkcidfm.ps PDFA_def.ps PDFX_def.ps pdf_info.ps \
 pf2afm.ps pfbtopfa.ps ppath.ps \
 pphs.ps \
 prfont.ps printafm.ps \
diff --git a/toolbin/pdf_info.ps b/lib/pdf_info.ps
similarity index 97%
rename from toolbin/pdf_info.ps
rename to lib/pdf_info.ps
index a5e662b..547809c 100644
--- a/toolbin/pdf_info.ps
+++ b/lib/pdf_info.ps
@@ -19,7 +19,7 @@
 % Dump some info from a PDF file
 
 % usage: gs -dNODISPLAY -q -sFile=____.pdf [-dDumpMediaSizes=false] [-dDumpFontsNeeded=false] [-dDumpXML]
-%                                          [-dDumpFontsUsed [-dShowEmbeddedFonts] ] toolbin/pdf_info.ps
+%                                          [-dDumpFontsUsed [-dShowEmbeddedFonts] ] lib/pdf_info.ps
 
 128 dict begin
 
@@ -44,7 +44,7 @@
   {
     { counttomark 1 eq {
         dup 0 get (-) 0 get ne {
-          % File specified on the command line using:  -- toolbin/pdf_info.ps infile.pdf
+          % File specified on the command line using:  -- lib/pdf_info.ps infile.pdf
           /File exch def
           false   % don't show usage
         } {
@@ -52,7 +52,7 @@
         } ifelse
       } { true } ifelse
       {
-        (\n*** Usage: gs [options] -- toolbin/pdf_info.ps infile.pdf  ***\n\n) print
+        (\n*** Usage: gs [options] -- lib/pdf_info.ps infile.pdf  ***\n\n) print
         showoptions
         quit
       } if
@@ -60,7 +60,7 @@
   } if
 /File where not {
   (\n   *** Missing input file name \(use -sFile=____.pdf\)\n) =
-  (    usage: gs -dNODISPLAY -q -sFile=____.pdf [ options ] toolbin/pdf_info.ps\n) =
+  (    usage: gs -dNODISPLAY -q -sFile=____.pdf [ options ] lib/pdf_info.ps\n) =
   showoptions
   quit
 } if

----------------------------------------------------------------------
commit e39d57f23585b6fe71db5433dc205459be7a3c22
Author: Chris Liddell <[email protected]>
Date:   Thu Dec 12 14:26:30 2019 +0000

    Tweak to handle .shellarguments throwing an error
    
    .shellarguments for quite some time has thrown an undefined error if Ghostscript
    is not invoked with the '--' option, so handle that.

diff --git a/toolbin/pdf_info.ps b/toolbin/pdf_info.ps
index 23e9cab..a5e662b 100644
--- a/toolbin/pdf_info.ps
+++ b/toolbin/pdf_info.ps
@@ -40,23 +40,24 @@
 /DumpMediaSizes where { pop } { /DumpMediaSizes true def } ifelse
 /DumpFontsNeeded where { pop } { /DumpFontsNeeded true def } ifelse
 
-[ .shellarguments
-  { counttomark 1 eq {
-      dup 0 get (-) 0 get ne {
-        % File specified on the command line using:  -- toolbin/pdf_info.ps infile.pdf
-        /File exch def
-        false	% don't show usage
-      } {
-        true	% show usage and quit
-      } ifelse
-    } { true } ifelse
-    {
-      (\n*** Usage: gs [options] -- toolbin/pdf_info.ps infile.pdf  ***\n\n) print
-      showoptions
-      quit
+[ {.shellarguments} stopped not
+  {
+    { counttomark 1 eq {
+        dup 0 get (-) 0 get ne {
+          % File specified on the command line using:  -- toolbin/pdf_info.ps infile.pdf
+          /File exch def
+          false   % don't show usage
+        } {
+          true    % show usage and quit
+        } ifelse
+      } { true } ifelse
+      {
+        (\n*** Usage: gs [options] -- toolbin/pdf_info.ps infile.pdf  ***\n\n) print
+        showoptions
+        quit
+      } if
     } if
   } if
-
 /File where not {
   (\n   *** Missing input file name \(use -sFile=____.pdf\)\n) =
   (    usage: gs -dNODISPLAY -q -sFile=____.pdf [ options ] toolbin/pdf_info.ps\n) =

----------------------------------------------------------------------
commit 72f6dd34cd0732cb7cdd9246d5063fc0f70ce79b
Author: Chris Liddell <[email protected]>
Date:   Thu Dec 12 14:16:41 2019 +0000

    Add hex string representation of font names
    
    Mainly CIDFonts come up with multibyte characters in their names, hence making
    the normal Postscript string pretty meaningless. This adds a hex string
    representation which can be used in Fontmap.GS or cidfmap for subsitution.

diff --git a/toolbin/pdf_info.ps b/toolbin/pdf_info.ps
index 6af5f58..23e9cab 100644
--- a/toolbin/pdf_info.ps
+++ b/toolbin/pdf_info.ps
@@ -332,13 +332,13 @@ currentdict /res-type-dict undef
 
   systemdict /DumpFontsUsed known
   {
-    (\nFont or CIDFont resources used:) =
-    { = } forall
+    (\nFont or CIDFont resources used (plain name and ASCIIHEX string representation):) =
+    { 128 string cvs dup print (    ) print (<) print 128 string cvs {16 8 string cvrs print} forall (>) print (\n) print} forall
   } {
     DumpFontsNeeded {
       dup length 0 gt {
         (\nFonts Needed that are not embedded \(system fonts required\):) =
-        { (    ) print = } forall
+        { (    ) print 128 string cvs dup print (    ) print (<) print {16 8 string cvrs print} forall (>) print (\n) print} forall
       } {
         pop
         (\nNo system fonts are needed.) =

----------------------------------------------------------------------
commit bcb6fb284fcbe776d9ddd44f98d196da7df2c054
Author: Chris Liddell <[email protected]>
Date:   Thu Dec 12 13:07:46 2019 +0000

    Add NDEBUG to the optimised build flags
    
    Without that, asserts get included in an optimised build, which we don't want.

diff --git a/base/unix-gcc.mak b/base/unix-gcc.mak
index ae85c06..c27d0e3 100644
--- a/base/unix-gcc.mak
+++ b/base/unix-gcc.mak
@@ -376,9 +376,9 @@ GCFLAGS=  -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-pro
 # Define the added flags for standard, debugging, profiling
 # and shared object builds.
 
-CFLAGS_STANDARD= -O2
+CFLAGS_STANDARD= -O2 -DNDEBUG
 CFLAGS_DEBUG= -g -O0
-CFLAGS_PROFILE=-pg  -O2
+CFLAGS_PROFILE=-pg  -O2 -DNDEBUG
 CFLAGS_SO=-fPIC
 
 # Define the other compilation flags.  Add at most one of the following:
diff --git a/base/unixansi.mak b/base/unixansi.mak
index 7376c71..283552b 100644
--- a/base/unixansi.mak
+++ b/base/unixansi.mak
@@ -221,9 +221,9 @@ CCLD=$(CC)
 
 # Define the added flags for standard, debugging, and profiling builds.
 
-CFLAGS_STANDARD=-O
+CFLAGS_STANDARD=-O -DNDEBUG
 CFLAGS_DEBUG=-g
-CFLAGS_PROFILE=-pg -O
+CFLAGS_PROFILE=-pg -O -DNDEBUG
 
 # Define the other compilation flags.  Add at most one of the following:
 #	-Aa -w -D_HPUX_SOURCE for the HP 400.
diff --git a/configure.ac b/configure.ac
index 11df330..b29b08a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -279,46 +279,46 @@ dnl --------------------------------------------------
 dnl Set build flags based on environment
 dnl --------------------------------------------------
 
-CC_OPT_FLAGS_TO_TRY="-O"
+CC_OPT_FLAGS_TO_TRY="-O -DNDEBUG"
 SET_DT_SONAME="-soname="
 CFLAGS_LARGEFILE=""
 
 case $host in
         *-linux*|*-gnu)
         if test $ac_cv_prog_gcc = yes; then
-            CC_OPT_FLAGS_TO_TRY="-O2"
+            CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
             CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
         fi
         ;;
         *bsd*)
         if test $ac_cv_prog_gcc = yes; then
-            CC_OPT_FLAGS_TO_TRY="-O2"
+            CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
             CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
         fi
         ;;
         *-darwin*)
         if test $ac_cv_prog_gcc = yes; then
-            CC_OPT_FLAGS_TO_TRY="-O2"
+            CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
             CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
         fi
         SET_DT_SONAME=""
         ;;
         *-mingw*|*-msys*|*-cygwin*)
         if test $ac_cv_prog_gcc = yes; then
-            CC_OPT_FLAGS_TO_TRY="-O2"
+            CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
             CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
         fi
         SET_DT_SONAME=""
         ;;
         *-sun*|*-solaris*)
-        CC_OPT_FLAGS_TO_TRY="-O2"
+        CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
         CFLAGS_LARGEFILE="-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64"
         # the trailing space is required!
         if test $ac_cv_prog_gcc = no; then
             SET_DT_SONAME="-h "
         fi
         if test $ac_cv_prog_gcc = yes; then
-            CC_OPT_FLAGS_TO_TRY="-O2"
+            CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
             CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
         else
             CC_DBG_FLAGS_TO_TRY="-g -O0"
@@ -326,7 +326,7 @@ case $host in
         ;;
         *-aix*)
         if test $ac_cv_prog_gcc = yes; then
-            CC_OPT_FLAGS_TO_TRY="-O2"
+            CC_OPT_FLAGS_TO_TRY="-O2 -DNDEBUG"
             CC_DBG_FLAGS_TO_TRY="-gdwarf-2 -g3 -O0"
             SET_DT_SONAME="so"
         fi
diff --git a/psi/msvc.mak b/psi/msvc.mak
index 794fb68..793d50d 100644
--- a/psi/msvc.mak
+++ b/psi/msvc.mak
@@ -793,8 +793,12 @@ XCFLAGS=
 !endif
 
 !ifndef CFLAGS
+!if !defined(DEBUG) || "$(DEBUG)"=="0"
+CFLAGS=/DNDEBUG
+!else
 CFLAGS=
 !endif
+!endif
 
 !ifdef DEVSTUDIO
 CFLAGS=$(CFLAGS) /FC


Summary of changes:
 base/unix-gcc.mak            |  4 ++--
 base/unixansi.mak            |  4 ++--
 base/unixinst.mak            |  2 +-
 configure.ac                 | 16 ++++++++--------
 {toolbin => lib}/pdf_info.ps | 41 +++++++++++++++++++++--------------------
 psi/msvc.mak                 |  4 ++++
 6 files changed, 38 insertions(+), 33 deletions(-)
 rename {toolbin => lib}/pdf_info.ps (92%)