about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-12-25 17:36:41 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2016-12-25 17:36:41 +0000
commit9df60b4c472359d6d1a92fd62dd74feb002f14fc (patch)
tree9ea46580cac4aa19cbb07881b98d52200f5b9c36
parentba0c660b33b95c870f275466af5e6342759e621a (diff)
downloadnetpbm-mirror-9df60b4c472359d6d1a92fd62dd74feb002f14fc.tar.gz
netpbm-mirror-9df60b4c472359d6d1a92fd62dd74feb002f14fc.tar.xz
netpbm-mirror-9df60b4c472359d6d1a92fd62dd74feb002f14fc.zip
Copy Development as new Advanced
git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2861 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--GNUmakefile26
-rwxr-xr-xbuildtools/configure.pl32
-rw-r--r--buildtools/libopt.c1
-rwxr-xr-xbuildtools/makeman24
-rw-r--r--config.mk.in6
-rw-r--r--converter/other/Makefile12
-rw-r--r--converter/other/cameratopam/camera.c1
-rw-r--r--converter/other/cameratopam/cameratopam.c1
-rw-r--r--converter/other/cameratopam/identify.c1
-rw-r--r--converter/other/cameratopam/ljpeg.c1
-rw-r--r--converter/other/fiasco/binerror.c1
-rw-r--r--converter/other/fiasco/codec/coder.c1
-rw-r--r--converter/other/fiasco/codec/options.c1
-rw-r--r--converter/other/fiasco/codec/wfalib.c1
-rw-r--r--converter/other/fiasco/fiascotopnm.c1
-rw-r--r--converter/other/fiasco/input/read.c1
-rw-r--r--converter/other/fiasco/lib/bit-io.c1
-rw-r--r--converter/other/fiasco/params.c1
-rw-r--r--converter/other/giftopnm.c1
-rw-r--r--converter/other/ipdb.c1
-rw-r--r--converter/other/jpeg2000/jpeg2ktopam.c1
-rw-r--r--converter/other/jpeg2000/pamtojpeg2k.c1
-rw-r--r--converter/other/jpegtopnm.c1
-rw-r--r--converter/other/pamtotga.c1
-rw-r--r--converter/other/pamtotiff.c1
-rw-r--r--converter/other/pamtouil.c1
-rw-r--r--converter/other/pgmtoppm.c1
-rw-r--r--converter/other/pnmtojpeg.c1
-rw-r--r--converter/other/pnmtops.c1
-rw-r--r--converter/other/pstopnm.c1
-rw-r--r--converter/other/rletopnm.c1
-rw-r--r--converter/other/svgtopam.c1
-rw-r--r--converter/other/tiff.c1
-rw-r--r--converter/other/tifftopnm.c1
-rw-r--r--converter/other/xwdtopnm.c1
-rw-r--r--converter/pbm/g3topbm.c1
-rw-r--r--converter/pbm/pbmtoascii.c49
-rw-r--r--converter/pbm/pbmtoepson.c1
-rw-r--r--converter/pbm/pbmtonokia.c1
-rw-r--r--converter/pbm/pbmtopk.c1
-rw-r--r--converter/pbm/pbmtoppa/pbmtoppa.c1
-rw-r--r--converter/pbm/pbmtoxbm.c1
-rw-r--r--converter/ppm/ppmtobmp.c1
-rw-r--r--converter/ppm/ppmtogif.c1
-rw-r--r--converter/ppm/ppmtompeg/gethostname.c1
-rw-r--r--converter/ppm/ppmtompeg/mpeg.c1
-rw-r--r--converter/ppm/ppmtompeg/param.c2
-rw-r--r--converter/ppm/ppmtompeg/ppmtompeg.c1
-rw-r--r--converter/ppm/ppmtompeg/readframe.c1
-rw-r--r--converter/ppm/ppmtoxpm.c1
-rw-r--r--converter/ppm/tgatoppm.c1
-rw-r--r--converter/ppm/winicontoppm.c1
-rw-r--r--converter/ppm/ximtoppm.c1
-rw-r--r--converter/ppm/xpmtoppm.c1
-rw-r--r--doc/HISTORY10
-rw-r--r--doc/TESTS20
-rw-r--r--editor/pamcomp.c1
-rw-r--r--editor/pamflip/pamflip.c1
-rw-r--r--editor/pamperspective.c1
-rw-r--r--editor/pnmmontage.c1
-rw-r--r--editor/pnmpad.c3
-rw-r--r--editor/pnmstitch.c1
-rw-r--r--editor/ppmcolormask.c1
-rw-r--r--editor/ppmdraw.c1
-rw-r--r--editor/specialty/pammixinterlace.c1
-rw-r--r--editor/specialty/pnmindex.c1
-rw-r--r--editor/specialty/ppmntsc.c1
-rw-r--r--generator/pbmtext.c1
-rw-r--r--generator/pbmtextps.c1
-rw-r--r--lib/colorname.c1
-rw-r--r--lib/libpam.c1
-rw-r--r--lib/libpamcolor.c1
-rw-r--r--lib/libpm.c1
-rw-r--r--lib/libppmcolor.c1
-rw-r--r--lib/libsystem.c1
-rw-r--r--lib/pmfileio.c1
-rw-r--r--lib/util/nstring.c1
-rw-r--r--lib/util/pm_c_util.h6
-rw-r--r--other/pamexec.c1
-rw-r--r--other/pamsplit.c1
-rw-r--r--other/pamx/Makefile10
-rw-r--r--other/pamx/pamx.c1
-rw-r--r--other/pamx/window.c1
-rwxr-xr-xtest/Available-Testprog52
-rwxr-xr-xtest/Execute-Tests35
-rwxr-xr-xtest/all-in-place.test9
-rwxr-xr-xtest/jbig-roundtrip.test1
-rwxr-xr-xtest/legacy-names.test9
-rwxr-xr-xtest/pbmtext.test2
-rwxr-xr-xtest/tiff-roundtrip.test1
-rwxr-xr-xtest/utahrle-roundtrip.test1
-rw-r--r--version.mk4
92 files changed, 301 insertions, 84 deletions
diff --git a/GNUmakefile b/GNUmakefile
index ddcc882b..4e10e12c 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -455,6 +455,21 @@ deb:
 .PHONY: check-package
 .PHONY: check-install
 
+# Variables from the make env we pass down to the test scripts.
+CHECK_VARS = \
+	BUILDDIR=$(BUILDDIR) \
+	RGBDEF=$(RGBDEF) \
+	BUILD_FIASCO=$(BUILD_FIASCO) \
+	JASPERLIB="$(JASPERLIB)" \
+	JBIGLIB="$(JBIGLIB)" \
+	JPEGLIB="$(JPEGLIB)" \
+	PNGLIB="$(PNGLIB)" \
+	TIFFLIB="$(TIFFLIB)" \
+	URTLIB="$(URTLIB)" \
+	X11LIB="$(X11LIB)" \
+	XML2_LIBS="$(XML2_LIBS)" \
+	ZLIB="$(ZLIB)"
+
 # Test files in source tree.
 
 check-tree : BUILDBINDIRS :=./analyzer \
@@ -525,10 +540,10 @@ resultdir-backup: FORCE
 
 check-tree: $(TESTRANDOM) resultdir-backup
 	cd $(RESULTDIR); \
+	  $(CHECK_VARS) \
 	  CHECK_TYPE=tree \
-	  PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
+	  PBM_TEST_PATH=$(PBM_TEST_PATH) \
 	  LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
-	  RGBDEF=$(RGBDEF) \
 	  $(SRCDIR)/test/Execute-Tests 2>&1
 
 # Execute-Tests needs to know BUILDDIR in order to locate testrandom.
@@ -545,19 +560,18 @@ check: check-package
 
 check-package: $(TESTRANDOM) resultdir-backup
 	cd $(RESULTDIR); \
+	  $(CHECK_VARS) \
 	  CHECK_TYPE=package \
-	  PBM_TEST_PATH=$(PBM_TEST_PATH) BUILDDIR=$(BUILDDIR) \
+	  PBM_TEST_PATH=$(PBM_TEST_PATH) \
 	  LD_LIBRARY_PATH=$(PBM_LIBRARY_PATH):${LD_LIBRARY_PATH} \
-	  RGBDEF=$(RGBDEF) \
 	  $(SRCDIR)/test/Execute-Tests 2>&1
 
 
 # Check after install
 check-install: $(TESTRANDOM) resultdir-backup
 	cd $(RESULTDIR); \
+	  $(CHECK_VARS) \
 	  CHECK_TYPE=install \
-	  BUILDDIR=$(BUILDDIR) \
-	  RGBDEF=$(RGBDEF) \
 	  $(SRCDIR)/test/Execute-Tests 2>&1
 
 
diff --git a/buildtools/configure.pl b/buildtools/configure.pl
index 5a7d8a33..93045b77 100755
--- a/buildtools/configure.pl
+++ b/buildtools/configure.pl
@@ -1164,10 +1164,20 @@ sub getPngLibrary($@) {
 
     my ($pnglib, $pnghdr_dir);
 
-    if (commandExists('libpng-config')) {
-        # We don't need to ask where Libpng is; there's a 'libpng-config'
-        # That tells exactly how to access it, and the make files will use
-        # that.
+    if (system('pkg-config libpng --exists') == 0) {
+        # We don't need to ask where Libpng is; the Pkg-config database knows
+        # and the make files will use that.
+        #
+        # To limit the confusion when someone tries to use our result in
+        # spite of the fact that 'libpng-config' exists, we assign suggestive
+        # dummy values (just for use in human debugging).
+        $pnglib     = 'USE_PKG_CONFIG.a';
+        $pnghdr_dir = 'USE_PKG_CONFIG.a';
+    } elsif (commandExists('libpng-config')) {
+        # As with Pkg-config above, we can find out how to access the
+        # library by invoking a 'libpng-config' command.
+        $pnglib     = 'USE_LIBPNG-CONFIG.a';
+        $pnghdr_dir = 'USE_LIBPNG-CONFIG.a';
     } else {
         {
             my $default = "libpng" . libSuffix($platform);
@@ -1252,6 +1262,12 @@ sub getX11Library($@) {
     if (system('pkg-config x11 --exists') == 0) {
         # We don't need to ask where X libraries are; pkg-config knows and the
         # make files will use that.
+        #
+        # To limit the confusion when someone tries to use our result in
+        # spite of the fact that 'libpng-config' exists, we assign suggestive
+        # dummy values (just for use in human debugging).
+        $x11lib     = 'USE_PKGCONFIG.a';
+        $x11hdr_dir = 'USE_PKGCONFIG.a';
     } else {
         {
             my $default;
@@ -1465,8 +1481,8 @@ sub wnostrictoverflowWorks($) {
     
     my $compileCommand =
         "$gccCommandName -c -o /dev/null -Wno-strict-overflow $cFileName";
-    print ("Doing test compile to see if -Wno-strict-overflow works: "
-           . "$compileCommand\n");
+    print("Doing test compile to see if -Wno-strict-overflow works: "
+          . "$compileCommand\n");
     my $rc = system($compileCommand);
     
     unlink($cFileName);
@@ -2180,8 +2196,8 @@ my ($linuxsvgalib, $linuxsvgahdr_dir) = getLinuxsvgaLibrary($platform);
 
 print("\n");
 
-# We should add the JBIG and URT libraries here too.  They're a little
-# more complicated because there are versions shipped with Netpbm.
+# We should add the URT, JBIG, and Jasper libraries here too.  They're a
+# little more complicated because there are versions shipped with Netpbm.
 
 
 #******************************************************************************
diff --git a/buildtools/libopt.c b/buildtools/libopt.c
index 274e7c66..f62194e5 100644
--- a/buildtools/libopt.c
+++ b/buildtools/libopt.c
@@ -65,6 +65,7 @@
   handle explicit file names.
 
 -----------------------------------------------------------------------------*/
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in stdio.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/buildtools/makeman b/buildtools/makeman
index 538accad..13c54a70 100755
--- a/buildtools/makeman
+++ b/buildtools/makeman
@@ -160,7 +160,7 @@ def makeman(name, file, indoc):
         if xrefsection == 0:
             return "\n.I " + xrefto
         else:
-            return "\n.BR %s (%d)\n" % (xrefto, xrefsection)
+            return '\n.BR "%s" (%d)\\c\n\\&' % (xrefto, xrefsection)
     indoc = re.sub(r'(?i)\n* *(?:\\fB)?<A[ \n]+HREF="?([^>]+.html)"?>([^<]+)</A>(?:\\fP)?',
                    xrefmatch, indoc)
     # Format URLs
@@ -231,25 +231,25 @@ def makeman(name, file, indoc):
     indoc = indoc.replace("&mu;", "mu")
     indoc = indoc.replace("&sigma;", "sigma")
     # Tables
-    indoc = re.sub(' *<table[^>]*>.*', ".TS", indoc)
-    indoc = re.sub(" *</table>.*", ".TE", indoc)
+    indoc = re.sub('(?i) *<table[^>]*>.*', ".TS", indoc)
+    indoc = re.sub("(?i) *</table>.*", ".TE", indoc)
     # First the single-line case
-    indoc = re.sub("</td> *<td>", "\t", indoc)
-    indoc = re.sub("<tr> *<td>", "", indoc)
-    indoc = re.sub("</td> *</tr>", "", indoc)
+    indoc = re.sub("(?i)</td> *<td>", "\t", indoc)
+    indoc = re.sub("(?i)<tr> *<td>", "", indoc)
+    indoc = re.sub("(?i)</td> *</tr>", "", indoc)
     # Then the multiline case
-    indoc = re.sub(r'\s*<t[hd][^>]*>([^<\n]*)</t[dh]>\s*', '\t\\1', indoc)
-    indoc = re.sub(r'\s*<t[hd][^>]*>([^<]*)</t[dh]>\s*', '\tT{\n\\1T}', indoc)
+    indoc = re.sub(r'(?i)\s*<t[hd][^>]*>([^<\n]*)</t[dh]>\s*', '\t\\1', indoc)
+    indoc = re.sub(r'(?i)\s*<t[hd][^>]*>([^<]*)</t[dh]>\s*', '\tT{\n\\1T}', indoc)
     indoc = indoc.replace("\n\\&T}", "\nT}")
-    indoc = re.sub(" *</tr>", "", indoc)
-    indoc = re.sub(" *<tr[^>]*>\t*", "", indoc)
-    indoc = re.sub(r"\.TS\s+<caption>([^<]*)</caption>\s*", ".B \\1\n.TS\n", indoc)
+    indoc = re.sub("(?i) *</tr>", "", indoc)
+    indoc = re.sub("(?i) *<tr[^>]*>\t*", "", indoc)
+    indoc = re.sub(r"\.TS\s+<[Cc][Aa][Pp][Tt][Ii][Oo][Nn]>([^<]*)</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]>\s*", ".B \\1\n.TS\n", indoc)
     # Debugging
     #sys.stderr.write("Name: %s, Title: %s, Date: %s\n" % (name, title, date))
     # Time for error checking now
     badlines = []
     for line in indoc.split("\n"):
-        if "<" in line or ">" in line.replace(" >", "") or re.search("&.*;", line):
+        if "<" in line or ">" in line.replace(" >", "") or re.search(r'(?<!^\\)&.*;', line):
             badlines.append(line)
     if badlines:
         sys.stderr.write(("Bad lines from %s:\n-----------------\n" % file) + "\n".join(badlines) + "\n-----------------\n")
diff --git a/config.mk.in b/config.mk.in
index b63831aa..ee692332 100644
--- a/config.mk.in
+++ b/config.mk.in
@@ -161,6 +161,12 @@ LEX = flex
 # 
 # LEX = lex
 
+# PKG_CONFIG is the beginning of a shell command that tells things about how
+# some package (e.g. the PNG library) is installed on the build system.  For
+# example, it can tell what link options you need to link the PNG library to a
+# program.
+PKG_CONFIG = pkg-config
+
 # C compiler options 
 
 # gcc:
diff --git a/converter/other/Makefile b/converter/other/Makefile
index 6a3d14ed..b01f66ae 100644
--- a/converter/other/Makefile
+++ b/converter/other/Makefile
@@ -7,12 +7,12 @@ VPATH=.:$(SRCDIR)/$(SUBDIR)
 
 include $(BUILDDIR)/config.mk
 
-TEST_PKGCONFIG_LIBXML2 = if pkg-config libxml-2.0; then echo exists; fi
+TEST_PKGCONFIG_LIBXML2 = if $(PKG_CONFIG) libxml-2.0; then echo exists; fi
 
 ifneq ($(shell $(TEST_PKGCONFIG_LIBXML2)),)
   # pkg-config libxml2 works on this system
-  XML2_LIBS = $(shell pkg-config libxml-2.0 --libs)
-  XML2_CFLAGS = $(shell pkg-config libxml-2.0 --cflags)
+  XML2_LIBS = $(shell $(PKG_CONFIG) libxml-2.0 --libs)
+  XML2_CFLAGS = $(shell $(PKG_CONFIG) libxml-2.0 --cflags)
 else
   ifeq ($(shell xml2-config --version),)
     XML2_LIBS=NONE
@@ -34,12 +34,12 @@ ifneq ($(TIFFLIB),NONE)
   endif
 endif
 
-TEST_PKGCONFIG_LIBPNG = if pkg-config libpng$(PNGVER); then echo exists; fi
+TEST_PKGCONFIG_LIBPNG = if $(PKG_CONFIG) libpng$(PNGVER); then echo exists; fi
 
 ifneq ($(shell $(TEST_PKGCONFIG_LIBPNG)),)
   # pkg-config libpng works on this system
   HAVE_PNGLIB = Y
-  EXTERN_INCLUDES += $(shell pkg-config libpng$(PNGVER) --cflags)
+  EXTERN_INCLUDES += $(shell $(PKG_CONFIG) libpng$(PNGVER) --cflags)
 else
   ifneq ($(shell libpng$(PNGVER)-config --version),)
     # No pkg-config, but we have libpng-config on this system
@@ -192,7 +192,7 @@ tifftopnm pamtotiff pnmtotiffcmyk: \
 
 ifneq ($(shell $(TEST_PKGCONFIG_LIBPNG)),)
   # pkg-config libpng works on this system
-  PNGLIB_LIBOPTS = $(shell pkg-config libpng$(PNGVER) --libs)
+  PNGLIB_LIBOPTS = $(shell $(PKG_CONFIG) libpng$(PNGVER) --libs)
 else
   ifneq ($(shell libpng$(PNGVER)-config --version),)
     # No pkg-config, but we have libpng-config on this system
diff --git a/converter/other/cameratopam/camera.c b/converter/other/cameratopam/camera.c
index 04a6ed01..503551f1 100644
--- a/converter/other/cameratopam/camera.c
+++ b/converter/other/cameratopam/camera.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE
     /* Make sure strcasecmp is in string.h */
 #define _XOPEN_SOURCE
diff --git a/converter/other/cameratopam/cameratopam.c b/converter/other/cameratopam/cameratopam.c
index ec33dd31..2c832714 100644
--- a/converter/other/cameratopam/cameratopam.c
+++ b/converter/other/cameratopam/cameratopam.c
@@ -7,6 +7,7 @@
  */
 
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure string.h contains strdup() */
 #define _XOPEN_SOURCE 500
    /* Make sure unistd.h contains swab(), string.h constains strdup() */
diff --git a/converter/other/cameratopam/identify.c b/converter/other/cameratopam/identify.c
index 02208be6..7e77adb2 100644
--- a/converter/other/cameratopam/identify.c
+++ b/converter/other/cameratopam/identify.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE   /* Make sure strcasecmp() is in string.h */
 #include <string.h>
 
diff --git a/converter/other/cameratopam/ljpeg.c b/converter/other/cameratopam/ljpeg.c
index 07791e25..331d258c 100644
--- a/converter/other/cameratopam/ljpeg.c
+++ b/converter/other/cameratopam/ljpeg.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE    /* Make sure string.h containst strcasecmp() */
 #include <stdlib.h>
 #include <string.h>
diff --git a/converter/other/fiasco/binerror.c b/converter/other/fiasco/binerror.c
index 80a2e461..9820d853 100644
--- a/converter/other/fiasco/binerror.c
+++ b/converter/other/fiasco/binerror.c
@@ -18,6 +18,7 @@
  *  $State: Exp $
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _ERROR_C
diff --git a/converter/other/fiasco/codec/coder.c b/converter/other/fiasco/codec/coder.c
index ce4a24f1..1e21994d 100644
--- a/converter/other/fiasco/codec/coder.c
+++ b/converter/other/fiasco/codec/coder.c
@@ -14,6 +14,7 @@
  *  $State: Exp $
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/fiasco/codec/options.c b/converter/other/fiasco/codec/options.c
index af2cfb48..b9c64efd 100644
--- a/converter/other/fiasco/codec/options.c
+++ b/converter/other/fiasco/codec/options.c
@@ -14,6 +14,7 @@
  *  $State: Exp $
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/fiasco/codec/wfalib.c b/converter/other/fiasco/codec/wfalib.c
index 75792627..90420d6f 100644
--- a/converter/other/fiasco/codec/wfalib.c
+++ b/converter/other/fiasco/codec/wfalib.c
@@ -14,6 +14,7 @@
  *  $State: Exp $
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/fiasco/fiascotopnm.c b/converter/other/fiasco/fiascotopnm.c
index 503d023f..e95e27fc 100644
--- a/converter/other/fiasco/fiascotopnm.c
+++ b/converter/other/fiasco/fiascotopnm.c
@@ -15,6 +15,7 @@
  *  $State: Exp $
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/fiasco/input/read.c b/converter/other/fiasco/input/read.c
index 862fec39..9f4ac993 100644
--- a/converter/other/fiasco/input/read.c
+++ b/converter/other/fiasco/input/read.c
@@ -14,6 +14,7 @@
  *  $State: Exp $
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/fiasco/lib/bit-io.c b/converter/other/fiasco/lib/bit-io.c
index fdcd70b9..f69343e6 100644
--- a/converter/other/fiasco/lib/bit-io.c
+++ b/converter/other/fiasco/lib/bit-io.c
@@ -14,6 +14,7 @@
  *  $State: Exp $
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/fiasco/params.c b/converter/other/fiasco/params.c
index 14f1529e..7d0b84ab 100644
--- a/converter/other/fiasco/params.c
+++ b/converter/other/fiasco/params.c
@@ -15,6 +15,7 @@
  *  $State: Exp $
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1
     /* Make sure strdup() is in string.h and strcaseeq() is in nstring.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
diff --git a/converter/other/giftopnm.c b/converter/other/giftopnm.c
index 76cf4bff..b0d479d5 100644
--- a/converter/other/giftopnm.c
+++ b/converter/other/giftopnm.c
@@ -19,6 +19,7 @@
    describe the Lempel-Ziv base.
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* for strcaseeq */
 #include <string.h>
diff --git a/converter/other/ipdb.c b/converter/other/ipdb.c
index d6bd6ef5..1d72cc31 100644
--- a/converter/other/ipdb.c
+++ b/converter/other/ipdb.c
@@ -19,6 +19,7 @@
  *   Authors:  Eric A. Howe (mu@trends.net)
  *             Bryan Henderson, 2010
  */
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Ensure strdup() is in <string.h> */
 #include <assert.h>
diff --git a/converter/other/jpeg2000/jpeg2ktopam.c b/converter/other/jpeg2000/jpeg2ktopam.c
index 405de9c9..b7276241 100644
--- a/converter/other/jpeg2000/jpeg2ktopam.c
+++ b/converter/other/jpeg2000/jpeg2ktopam.c
@@ -8,6 +8,7 @@
 
 *****************************************************************************/
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500 /* Make sure strdup() is in string.h */
     /* In 2014.09, this was _XOPEN_SOURCE 600, with a comment saying it was
diff --git a/converter/other/jpeg2000/pamtojpeg2k.c b/converter/other/jpeg2000/pamtojpeg2k.c
index b8905518..3d8a97af 100644
--- a/converter/other/jpeg2000/pamtojpeg2k.c
+++ b/converter/other/jpeg2000/pamtojpeg2k.c
@@ -8,6 +8,7 @@
 
 *****************************************************************************/
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1    /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500 /* Make sure strdup() is in string.h */
     /* In 2014.09, this was _XOPEN_SOURCE 600, with a comment saying it was
diff --git a/converter/other/jpegtopnm.c b/converter/other/jpegtopnm.c
index ab3b18e5..98552c00 100644
--- a/converter/other/jpegtopnm.c
+++ b/converter/other/jpegtopnm.c
@@ -48,6 +48,7 @@
     
 *****************************************************************************/
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/pamtotga.c b/converter/other/pamtotga.c
index aca93015..27974dd3 100644
--- a/converter/other/pamtotga.c
+++ b/converter/other/pamtotga.c
@@ -10,6 +10,7 @@
 ** implied warranty.
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE  /* Make sure string.h contains strdup() */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/pamtotiff.c b/converter/other/pamtotiff.c
index 7b645b23..9270fd4c 100644
--- a/converter/other/pamtotiff.c
+++ b/converter/other/pamtotiff.c
@@ -21,6 +21,7 @@
 ** other special, indirect and consequential damages.
 */
 
+#define _DEFAULT_SOURCE  /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE    /* Make sure stdio.h contains fileno() */
 #define _BSD_SOURCE      /* Make sure string.h contains strcasecmp() */
 
diff --git a/converter/other/pamtouil.c b/converter/other/pamtouil.c
index ee7f5ae6..01858cbc 100644
--- a/converter/other/pamtouil.c
+++ b/converter/other/pamtouil.c
@@ -13,6 +13,7 @@
 ** implied warranty.
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE  /* Make sure string.h contains strdup() */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #include <ctype.h>
diff --git a/converter/other/pgmtoppm.c b/converter/other/pgmtoppm.c
index f8a69424..c3a26594 100644
--- a/converter/other/pgmtoppm.c
+++ b/converter/other/pgmtoppm.c
@@ -10,6 +10,7 @@
 ** implied warranty.
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #include <string.h>
diff --git a/converter/other/pnmtojpeg.c b/converter/other/pnmtojpeg.c
index ce231c94..86cb3eea 100644
--- a/converter/other/pnmtojpeg.c
+++ b/converter/other/pnmtojpeg.c
@@ -16,6 +16,7 @@
 
 *****************************************************************************/
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/pnmtops.c b/converter/other/pnmtops.c
index c1dadc3e..c827f549 100644
--- a/converter/other/pnmtops.c
+++ b/converter/other/pnmtops.c
@@ -33,6 +33,7 @@
    goes in separate from the rest of the raster.
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE  /* Make sure string.h contains strdup() */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #include <stdlib.h>
diff --git a/converter/other/pstopnm.c b/converter/other/pstopnm.c
index 016db2f6..e19a0fa4 100644
--- a/converter/other/pstopnm.c
+++ b/converter/other/pstopnm.c
@@ -14,6 +14,7 @@
 
 -----------------------------------------------------------------------------*/
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  
     /* Make sure fdopen() is in stdio.h and strdup() is in string.h */
diff --git a/converter/other/rletopnm.c b/converter/other/rletopnm.c
index ff37cfe4..018456c8 100644
--- a/converter/other/rletopnm.c
+++ b/converter/other/rletopnm.c
@@ -35,6 +35,7 @@
  *
  */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/svgtopam.c b/converter/other/svgtopam.c
index 137f4732..a10f51da 100644
--- a/converter/other/svgtopam.c
+++ b/converter/other/svgtopam.c
@@ -26,6 +26,7 @@
    
 ============================================================================*/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #define _POSIX_SOURCE   /* Make sure fileno() is in <stdio.h> */
diff --git a/converter/other/tiff.c b/converter/other/tiff.c
index d0cbbd74..39e3b0ce 100644
--- a/converter/other/tiff.c
+++ b/converter/other/tiff.c
@@ -6,6 +6,7 @@
 
 ============================================================================*/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE    /* Make sure strcaseeq() is in nstring.h */
 
 #include <string.h>
diff --git a/converter/other/tifftopnm.c b/converter/other/tifftopnm.c
index 58efe1fd..fb0a7739 100644
--- a/converter/other/tifftopnm.c
+++ b/converter/other/tifftopnm.c
@@ -46,6 +46,7 @@
    give the user the -byrow option to order (2) only.
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/other/xwdtopnm.c b/converter/other/xwdtopnm.c
index d49a2b09..df3c7375 100644
--- a/converter/other/xwdtopnm.c
+++ b/converter/other/xwdtopnm.c
@@ -23,6 +23,7 @@
 */
 
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/pbm/g3topbm.c b/converter/pbm/g3topbm.c
index b0d08f9e..83479b91 100644
--- a/converter/pbm/g3topbm.c
+++ b/converter/pbm/g3topbm.c
@@ -18,6 +18,7 @@
   contributing their work to the public domain.
 ===========================================================================*/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE   /* Make nstring.h define strcaseeq() */
 
 #include "pm_c_util.h"
diff --git a/converter/pbm/pbmtoascii.c b/converter/pbm/pbmtoascii.c
index fd590aa6..0305a47b 100644
--- a/converter/pbm/pbmtoascii.c
+++ b/converter/pbm/pbmtoascii.c
@@ -83,15 +83,15 @@ BSQ,D04, D04,D05, D04,'L', D05,'[', '<','Z', '/','Z', 'c','k',D06,'R',/*D0-DF*/
 
 
 static void
-makeRowOfSigs(FILE *         const ifP,
-              unsigned int   const cols,
-              unsigned int   const rows,
-              int            const format,
-              unsigned int   const cellWidth,
-              unsigned int   const cellHeight,
-              unsigned int   const row,
-              unsigned int * const sig,
-              unsigned int   const ccols) {
+makeRowOfSignatures(FILE *         const ifP,
+                    unsigned int   const cols,
+                    unsigned int   const rows,
+                    int            const format,
+                    unsigned int   const cellWidth,
+                    unsigned int   const cellHeight,
+                    unsigned int   const row,
+                    unsigned int * const sig,
+                    unsigned int   const ccols) {
 /*----------------------------------------------------------------------------
    Compute the signatures for every cell in a row.
 
@@ -183,23 +183,30 @@ pbmtoascii(FILE *       const ifP,
            unsigned int const cellHeight,
            const char * const carr) {
 
-    int cols, rows, format;
+    int format;
+    int cols, rows;
+        /* Dimensions of the input in pixels */
     unsigned int ccols;
+        /* Width of the output in characters */
     char * line;         /* malloc'ed array */
     unsigned int row;
-    unsigned int * sig;  /* malloc'ed array */
-        /* This describes in a single integer the pixels of a cell,
-           as described above.
+    unsigned int * signatureRow;  /* malloc'ed array */
+        /* This is the cell signatures of a row of cells.
+           signatureRow[0] is the signature for the first (leftmost) cell
+           in the row, signatureRow[1] is the signature for the next one,
+           etc.  A signature is an encoding of the pixels of a cell as
+           an integer, as described above.
         */
-    assert(cellWidth * cellHeight <= sizeof(sig[0]*8));
+    assert(cellWidth * cellHeight <= sizeof(signatureRow[0])*8);
 
     pbm_readpbminit(ifP, &cols, &rows, &format);
 
     ccols = (cols + cellWidth - 1) / cellWidth;
 
-    MALLOCARRAY(sig, ccols);
-    if (sig == NULL)
+    MALLOCARRAY(signatureRow, ccols);
+    if (signatureRow == NULL)
         pm_error("No memory for %u columns", ccols);
+
     MALLOCARRAY_NOFAIL(line, ccols+1);
     if (line == NULL)
         pm_error("No memory for %u columns", ccols);
@@ -207,16 +214,16 @@ pbmtoascii(FILE *       const ifP,
     for (row = 0; row < rows; row += cellHeight) {
         unsigned int endCol;
 
-        makeRowOfSigs(ifP, cols, rows, format, cellWidth, cellHeight,
-                      row, sig, ccols);
+        makeRowOfSignatures(ifP, cols, rows, format, cellWidth, cellHeight,
+                            row, signatureRow, ccols);
 
-        findRightMargin(sig, ccols, carr, &endCol);
+        findRightMargin(signatureRow, ccols, carr, &endCol);
 
-        assembleCellRow(sig, endCol, carr, line);
+        assembleCellRow(signatureRow, endCol, carr, line);
 
         puts(line);
     }
-    free(sig);
+    free(signatureRow);
     free(line);
 }
 
diff --git a/converter/pbm/pbmtoepson.c b/converter/pbm/pbmtoepson.c
index bb36791d..122a438f 100644
--- a/converter/pbm/pbmtoepson.c
+++ b/converter/pbm/pbmtoepson.c
@@ -11,6 +11,7 @@
 ** implied warranty.
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE    /* Make sure strcaseeq() is in nstring.h */
 #include <stdio.h>
 
diff --git a/converter/pbm/pbmtonokia.c b/converter/pbm/pbmtonokia.c
index e803e413..73b62b96 100644
--- a/converter/pbm/pbmtonokia.c
+++ b/converter/pbm/pbmtonokia.c
@@ -4,6 +4,7 @@
    Copyright information is at end of file.
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE    /* Make sure strcaseeq() is in nstring.h */
 #include <string.h>
diff --git a/converter/pbm/pbmtopk.c b/converter/pbm/pbmtopk.c
index 3948ae0d..2f05d449 100644
--- a/converter/pbm/pbmtopk.c
+++ b/converter/pbm/pbmtopk.c
@@ -9,6 +9,7 @@
   https://www.tug.org/TUGboat/tb06-1/tb11gf.pdf
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/pbm/pbmtoppa/pbmtoppa.c b/converter/pbm/pbmtoppa/pbmtoppa.c
index f43c08a8..ff4a599e 100644
--- a/converter/pbm/pbmtoppa/pbmtoppa.c
+++ b/converter/pbm/pbmtoppa/pbmtoppa.c
@@ -4,6 +4,7 @@
  * 2-24-98
  */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE
     /* This makes sure strcasecmp() is in string.h */
 #include <stdio.h>
diff --git a/converter/pbm/pbmtoxbm.c b/converter/pbm/pbmtoxbm.c
index 14c6b85e..ecb72b30 100644
--- a/converter/pbm/pbmtoxbm.c
+++ b/converter/pbm/pbmtoxbm.c
@@ -20,6 +20,7 @@
 
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/ppmtobmp.c b/converter/ppm/ppmtobmp.c
index 6bdec8c3..a0de38e3 100644
--- a/converter/ppm/ppmtobmp.c
+++ b/converter/ppm/ppmtobmp.c
@@ -13,6 +13,7 @@
  *
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1    /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/ppmtogif.c b/converter/ppm/ppmtogif.c
index fa7d1dbe..8dd133b5 100644
--- a/converter/ppm/ppmtogif.c
+++ b/converter/ppm/ppmtogif.c
@@ -10,6 +10,7 @@
      - Pamtogif requires a user-specififed map file (-mapfile) to
        match the input in depth.
 */
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/ppmtompeg/gethostname.c b/converter/ppm/ppmtompeg/gethostname.c
index d20af17c..649fff91 100644
--- a/converter/ppm/ppmtompeg/gethostname.c
+++ b/converter/ppm/ppmtompeg/gethostname.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/ppmtompeg/mpeg.c b/converter/ppm/ppmtompeg/mpeg.c
index 24d337ed..33e1a9f9 100644
--- a/converter/ppm/ppmtompeg/mpeg.c
+++ b/converter/ppm/ppmtompeg/mpeg.c
@@ -30,6 +30,7 @@
  * HEADER FILES *
  *==============*/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/ppmtompeg/param.c b/converter/ppm/ppmtompeg/param.c
index 45605981..87fdfa6b 100644
--- a/converter/ppm/ppmtompeg/param.c
+++ b/converter/ppm/ppmtompeg/param.c
@@ -7,6 +7,8 @@
 
 /* COPYRIGHT INFORMATION IS AT THE END OF THIS FILE */
 
+#define _DEFAULT_SOURCE 1
+    /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500
     /* This makes sure popen() is in stdio.h.  In GNU libc 2.1.3, 
      _POSIX_C_SOURCE = 2 is sufficient, but on AIX 4.3, the higher level
diff --git a/converter/ppm/ppmtompeg/ppmtompeg.c b/converter/ppm/ppmtompeg/ppmtompeg.c
index 46224e84..837b1b9d 100644
--- a/converter/ppm/ppmtompeg/ppmtompeg.c
+++ b/converter/ppm/ppmtompeg/ppmtompeg.c
@@ -30,6 +30,7 @@
  * HEADER FILES *
  *==============*/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/ppmtompeg/readframe.c b/converter/ppm/ppmtompeg/readframe.c
index 23752706..2a359b2f 100644
--- a/converter/ppm/ppmtompeg/readframe.c
+++ b/converter/ppm/ppmtompeg/readframe.c
@@ -17,6 +17,7 @@
  * HEADER FILES *
  *==============*/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE   /* Make sure popen() is in stdio.h */
 #include "all.h"
 #include <time.h>
diff --git a/converter/ppm/ppmtoxpm.c b/converter/ppm/ppmtoxpm.c
index 38d99972..0e316928 100644
--- a/converter/ppm/ppmtoxpm.c
+++ b/converter/ppm/ppmtoxpm.c
@@ -33,6 +33,7 @@
 **    (base 93 not base 28 -> saves a lot of space for colorful xpms)
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/tgatoppm.c b/converter/ppm/tgatoppm.c
index 95893089..3660e646 100644
--- a/converter/ppm/tgatoppm.c
+++ b/converter/ppm/tgatoppm.c
@@ -12,6 +12,7 @@
 ** implied warranty.
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/winicontoppm.c b/converter/ppm/winicontoppm.c
index 6b1376b2..2c9015f5 100644
--- a/converter/ppm/winicontoppm.c
+++ b/converter/ppm/winicontoppm.c
@@ -14,6 +14,7 @@
 ** 03/2003 - Added 24+32 bpp capability.
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/ximtoppm.c b/converter/ppm/ximtoppm.c
index ce5e6396..75faac69 100644
--- a/converter/ppm/ximtoppm.c
+++ b/converter/ppm/ximtoppm.c
@@ -10,6 +10,7 @@
 ** implied warranty.
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/converter/ppm/xpmtoppm.c b/converter/ppm/xpmtoppm.c
index 27f17931..9471ec7c 100644
--- a/converter/ppm/xpmtoppm.c
+++ b/converter/ppm/xpmtoppm.c
@@ -3,6 +3,7 @@
    Copyright and history information is at end of file
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/doc/HISTORY b/doc/HISTORY
index 2a8d5733..177531b7 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -4,11 +4,17 @@ Netpbm.
 CHANGE HISTORY 
 --------------
 
-16.12.01 BJH  Release 10.76.01
+16.12.25 BJH  Release 10.77.00
 
               pnmpad: fix bug: incorrect output width.  Introduced in
               Netpbm 10.72 (July 2015).
 
+              Makeman: slight improvement to formatting of man pages.
+              Thanks Werner LEMBERG <wl@gnu.org>.
+
+              Test: skip tests of some parts that are configured out of the
+              build.
+
 16.09.27 BJH  Release 10.76.00
 
               pnmquantall: Fix failure when temporary file location is
@@ -24,6 +30,8 @@ CHANGE HISTORY
               cmuwmtopbm: fix trivial memory leak.  Always broken (cmuwmtopbm
               was in primordial Pbmplus, in 1988).
 
+              Build: Add PKG_CONFIG make variable.
+
               Build: tifftopnm.c: fix undefined WIFSIGNALED, etc. in 
 
 16.06.26 BJH  Release 10.75.00
diff --git a/doc/TESTS b/doc/TESTS
index e87f5570..544c0673 100644
--- a/doc/TESTS
+++ b/doc/TESTS
@@ -246,12 +246,20 @@ problem, such as a misconfigured dynamic library or a directory-wide
 permission issue.  This kind of failure is known to happen when N is
 set too high with "make -jN" (overambitious parallel make.) 
 
-The current test routines assume a typical build configuration - they are
-not aware of the actual configuration you chose.  If a choice you make
-during configure causes "make" to skip compilation of certain programs,
-the test routines won't know and will report failures.
-
-For details read 'Netpbm Library Prerequisites':
+Configuration choices affect tests.  If a choice you make during configure
+causes "make" to skip compilation of certain programs, the corresponding
+test routines will be skipped and reported as NOT TESTABLE.  However,
+if you override a glitch with "make --keep-going" the test programs
+won't know and quite certainly you'll get failure messages.
+
+If you run the tests as "make check-install" information about
+configuration choices is deliberately ignored.  This is because the
+post-install check is typically run on systems with multiple versions
+of Netpbm and in this case users want to get a clear idea of absent
+components.
+
+For details on the effects of missing libraries, read
+'Netpbm Library Prerequisites':
 http://netpbm.sourceforge.net/prereq.html .
 
 
diff --git a/editor/pamcomp.c b/editor/pamcomp.c
index 9855e173..548882e3 100644
--- a/editor/pamcomp.c
+++ b/editor/pamcomp.c
@@ -22,6 +22,7 @@
    additional work by multiple authors.
 -----------------------------------------------------------------------------*/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE    /* Make sure strcaseceq() is in nstring.h */
 #include <assert.h>
 #include <string.h>
diff --git a/editor/pamflip/pamflip.c b/editor/pamflip/pamflip.c
index 149ab310..e6f1d6ed 100644
--- a/editor/pamflip/pamflip.c
+++ b/editor/pamflip/pamflip.c
@@ -58,6 +58,7 @@
    the source image, reading the input image through multiple times.
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/editor/pamperspective.c b/editor/pamperspective.c
index 16715c2e..a206b57f 100644
--- a/editor/pamperspective.c
+++ b/editor/pamperspective.c
@@ -18,6 +18,7 @@
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup is int string.h */
 
diff --git a/editor/pnmmontage.c b/editor/pnmmontage.c
index e54afc45..7bd00dbe 100644
--- a/editor/pnmmontage.c
+++ b/editor/pnmmontage.c
@@ -10,6 +10,7 @@
  * implied warranty.
  */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #include <assert.h>
diff --git a/editor/pnmpad.c b/editor/pnmpad.c
index 051f3895..9c7a77e5 100644
--- a/editor/pnmpad.c
+++ b/editor/pnmpad.c
@@ -2,6 +2,7 @@
    ** AJCD 4/9/90
  */
 
+#include <assert.h>
 #include <string.h>
 #include <stdio.h>
 
@@ -315,8 +316,10 @@ computePadSizeBeforeMult(unsigned int   const unpaddedSize,
                 (unpaddedSize + endPadReq);
         } else {
             if (sizeReq > unpaddedSize) {
+                assert(align <= 1.0 && align >= 0.0);
                 *begPadP = ROUNDU((sizeReq - unpaddedSize) * align);
                 *endPadP = sizeReq - unpaddedSize - *begPadP;
+                assert(*begPadP + unpaddedSize + *endPadP == sizeReq);
             } else {
                 *begPadP = 0;
                 *endPadP = 0;
diff --git a/editor/pnmstitch.c b/editor/pnmstitch.c
index 849445fb..eae5e1b9 100644
--- a/editor/pnmstitch.c
+++ b/editor/pnmstitch.c
@@ -82,6 +82,7 @@
  *      - user selectable blending algorithms?
  */
 
+#define _DEFAULT_SOURCE 1 /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1   /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/editor/ppmcolormask.c b/editor/ppmcolormask.c
index 31fbff2a..f3b18ce1 100644
--- a/editor/ppmcolormask.c
+++ b/editor/ppmcolormask.c
@@ -9,6 +9,7 @@
   Contributed to the public domain by its author.
 =========================================================================*/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #include <assert.h>
diff --git a/editor/ppmdraw.c b/editor/ppmdraw.c
index 63d781ec..b2ed39ca 100644
--- a/editor/ppmdraw.c
+++ b/editor/ppmdraw.c
@@ -1,3 +1,4 @@
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500 
    /* Make sure M_PI is in math.h, strdup is in string.h */
 #define _BSD_SOURCE      /* Make sure strdup is in string.h (alternate) */
diff --git a/editor/specialty/pammixinterlace.c b/editor/specialty/pammixinterlace.c
index 7410a8f1..1392777e 100644
--- a/editor/specialty/pammixinterlace.c
+++ b/editor/specialty/pammixinterlace.c
@@ -14,6 +14,7 @@
 
 ******************************************************************************/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE    /* Make sure strcaseeq() is in nstring.h */
 
 #include <string.h>
diff --git a/editor/specialty/pnmindex.c b/editor/specialty/pnmindex.c
index 4ec9edaa..0a8e35cc 100644
--- a/editor/specialty/pnmindex.c
+++ b/editor/specialty/pnmindex.c
@@ -14,6 +14,7 @@
 
 ============================================================================*/
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE   /* Make sure strdup is in string.h */
 
diff --git a/editor/specialty/ppmntsc.c b/editor/specialty/ppmntsc.c
index b44c64aa..08fbc835 100644
--- a/editor/specialty/ppmntsc.c
+++ b/editor/specialty/ppmntsc.c
@@ -39,6 +39,7 @@
 
  */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/generator/pbmtext.c b/generator/pbmtext.c
index cfb858a6..357f0429 100644
--- a/generator/pbmtext.c
+++ b/generator/pbmtext.c
@@ -10,6 +10,7 @@
 ** implied warranty.
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/generator/pbmtextps.c b/generator/pbmtextps.c
index fb55fa0a..68df2b15 100644
--- a/generator/pbmtextps.c
+++ b/generator/pbmtextps.c
@@ -25,6 +25,7 @@
  * http://partners.adobe.com/public/developer/ps/index_specs.html
  */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE   /* Make sure popen() is in stdio.h */
 #define _BSD_SOURCE     /* Make sure stdrup() is in string.h */
 #include <unistd.h>
diff --git a/lib/colorname.c b/lib/colorname.c
index 123de75e..fd265870 100644
--- a/lib/colorname.c
+++ b/lib/colorname.c
@@ -12,6 +12,7 @@
 ** implied warranty.
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/lib/libpam.c b/lib/libpam.c
index cc6368e1..fa1be8f4 100644
--- a/lib/libpam.c
+++ b/lib/libpam.c
@@ -13,6 +13,7 @@
 */
 #define _FILE_OFFSET_BITS 64
 #define _LARGE_FILES  
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/lib/libpamcolor.c b/lib/libpamcolor.c
index f3ca9a86..06dd2493 100644
--- a/lib/libpamcolor.c
+++ b/lib/libpamcolor.c
@@ -14,6 +14,7 @@
 #define _FILE_OFFSET_BITS 64
 #define _LARGE_FILES  
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/lib/libpm.c b/lib/libpm.c
index 4374bbe3..d5bad7a4 100644
--- a/lib/libpm.c
+++ b/lib/libpm.c
@@ -8,6 +8,7 @@
   Netpbm library subroutines.
 **************************************************************************/
 
+#define _DEFAULT_SOURCE      /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE          /* Make sure strdup is in string.h */
 #define _XOPEN_SOURCE 500    /* Make sure ftello, fseeko are defined */
 
diff --git a/lib/libppmcolor.c b/lib/libppmcolor.c
index aee8fd83..9a1ee5c1 100644
--- a/lib/libppmcolor.c
+++ b/lib/libppmcolor.c
@@ -9,6 +9,7 @@
 ** implied warranty.
 */
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/lib/libsystem.c b/lib/libsystem.c
index 9491c03a..4ff473dd 100644
--- a/lib/libsystem.c
+++ b/lib/libsystem.c
@@ -17,6 +17,7 @@
 
    Contributed to the public domain.
 =============================================================================*/
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE
 #define _BSD_SOURCE  /* Make SIGWINCH defined on OpenBSD */
 
diff --git a/lib/pmfileio.c b/lib/pmfileio.c
index 8176ae6a..035037ba 100644
--- a/lib/pmfileio.c
+++ b/lib/pmfileio.c
@@ -5,6 +5,7 @@
   These are external functions, unlike 'fileio.c', but are not
   particular to any Netpbm format.
 **************************************************************************/
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _SVID_SOURCE
     /* Make sure P_tmpdir is defined in GNU libc 2.0.7 (_XOPEN_SOURCE 500
        does it in other libc's).  pm_config.h defines TMPDIR as P_tmpdir
diff --git a/lib/util/nstring.c b/lib/util/nstring.c
index 5644d3b9..6c28095f 100644
--- a/lib/util/nstring.c
+++ b/lib/util/nstring.c
@@ -113,6 +113,7 @@
  */
 
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in string.h */
 #define _GNU_SOURCE
diff --git a/lib/util/pm_c_util.h b/lib/util/pm_c_util.h
index 01a07657..4890da05 100644
--- a/lib/util/pm_c_util.h
+++ b/lib/util/pm_c_util.h
@@ -53,9 +53,11 @@
 #else
   /* The test for __STDC__ is paranoid.  It is there just in case some
      nonstandard compiler defines __STDC_VERSION__ in an arbitrary manner.
+
+     We know GCC 2.95.3 has stdbool; not sure about earlier GCC 2.
   */
-  #if ( defined(__GNUC__) && (__GNUC__ >= 3) ) || \
-      ( defined(__STDC__) && (__STDC__ ==1) && \
+  #if ( defined(__GNUC__) && (__GNUC__ >= 2) ) || \
+      ( defined(__STDC__) && (__STDC__ == 1) && \
         defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) ) 
     #include <stdbool.h>
   #else
diff --git a/other/pamexec.c b/other/pamexec.c
index d14d8752..c3a1ee78 100644
--- a/other/pamexec.c
+++ b/other/pamexec.c
@@ -11,6 +11,7 @@
 
 ******************************************************************************/
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/other/pamsplit.c b/other/pamsplit.c
index 26eb0d59..93c1726a 100644
--- a/other/pamsplit.c
+++ b/other/pamsplit.c
@@ -9,6 +9,7 @@
   Contributed to the public domain by its author.
 ******************************************************************************/
 
+#define _DEFAULT_SOURCE 1  /* New name for SVID & BSD source defines */
 #define _BSD_SOURCE 1      /* Make sure strdup() is in string.h */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 
diff --git a/other/pamx/Makefile b/other/pamx/Makefile
index 4e06e0fd..e4892540 100644
--- a/other/pamx/Makefile
+++ b/other/pamx/Makefile
@@ -9,7 +9,7 @@ include $(BUILDDIR)/config.mk
 
 EXTERN_INCLUDE =
 
-ifeq ($(shell pkg-config x11 --modversion --silence-errors),)
+ifeq ($(shell $(PKG_CONFIG) x11 --modversion --silence-errors),)
   # Pkg-config has never heard of X11, or doesn't even exist
 
   ifneq ($(X11LIB),NONE)
@@ -20,8 +20,8 @@ ifeq ($(shell pkg-config x11 --modversion --silence-errors),)
   endif
 else
   HAVE_X11LIB = Y
-  X11LIB = $(shell pkg-config x11 --libs)
-  EXTERN_INCLUDES += $(shell pkg-config x11 --cflags)
+  X11LIB = $(shell $(PKG_CONFIG) x11 --libs)
+  EXTERN_INCLUDES += $(shell $(PKG_CONFIG) x11 --cflags)
 endif
 
 ifeq ($(HAVE_X11LIB),Y)
@@ -46,10 +46,10 @@ all: $(BINARIES)
 
 include $(SRCDIR)/common.mk
 
-ifeq ($(shell pkg-config x11 --libs),)
+ifeq ($(shell $(PKG_CONFIG) x11 --libs),)
   X11_LIBOPTS = $(shell $(LIBOPT) $(LIBOPTR) $(X11LIB))
 else
-  X11_LIBOPTS = $(shell pkg-config x11 --libs)
+  X11_LIBOPTS = $(shell $(PKG_CONFIG) x11 --libs)
 endif
 
 pamx: image.o send.o window.o
diff --git a/other/pamx/pamx.c b/other/pamx/pamx.c
index e22693ea..35900f82 100644
--- a/other/pamx/pamx.c
+++ b/other/pamx/pamx.c
@@ -3,6 +3,7 @@
    Copyright information is in the file COPYRIGHT
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE  /* Make sure strdup() is in <string.h> */
 #include <signal.h>
diff --git a/other/pamx/window.c b/other/pamx/window.c
index e2de1577..d907163b 100644
--- a/other/pamx/window.c
+++ b/other/pamx/window.c
@@ -6,6 +6,7 @@
    See COPYRIGHT file for copyright information.
 */
 
+#define _DEFAULT_SOURCE /* New name for SVID & BSD source defines */
 #define _XOPEN_SOURCE 500  /* Make sure strdup() is in string.h */
 #define _BSD_SOURCE    /* Make sure strcaseeq() is in nstring.h */
 
diff --git a/test/Available-Testprog b/test/Available-Testprog
new file mode 100755
index 00000000..67df13c1
--- /dev/null
+++ b/test/Available-Testprog
@@ -0,0 +1,52 @@
+#! /bin/bash
+
+# If make target is "check-install" assume that all programs are available
+if [ "${CHECK_TYPE}" = "install" ]; then
+  exit 0
+fi
+
+# Special case: no arguments were passed to this program
+# For all-in-place.test and legacy-names.test
+
+if [ $# = 0 ]; then
+  exit 0
+fi
+
+# Normal operation: Walk through the argument list and exit if an
+# unavailable program is encountered.
+
+for i in $@
+    do
+    case $i in
+      fiascotopnm|\
+      pnmtofiasco)
+        [ "${BUILD_FIASCO}" = "N" ] && exit 1 ;;
+
+      jpeg2ktopam|\
+      pamtojpeg2k)
+        [ "${JASPERLIB}" = "NONE" ] && exit 1 ;;
+
+      jbigtopnm|\
+      pnmtojbig)
+        [ "${JBIGLIB}" = "NONE" ] && exit 1 ;;
+
+      jpegtopnm|\
+      pnmtojpeg|\
+      ppmtojpeg)
+        [ "${JPEGLIB}" = "NONE" ] && exit 1 ;;
+
+      pamtotiff|\
+      pnmtotiff|\
+      pnmtotiffcmyk|\
+      tifftopnm)
+        [ "${TIFFLIB}" = "NONE" ] && exit 1 ;;
+
+      pnmtorle|\
+      rletopnm)
+        [ "${URTLIB}" = "NONE" ] && exit 1 ;;
+
+    esac
+done
+
+# All checks passed.  Exit with success status.
+exit 0
\ No newline at end of file
diff --git a/test/Execute-Tests b/test/Execute-Tests
index 78091e6b..39d6a5d1 100755
--- a/test/Execute-Tests
+++ b/test/Execute-Tests
@@ -236,18 +236,29 @@ if [ $VALGRIND_TESTS = "on" ]
 fi
 
 # Execute a single test and test its result.
-
-PATH=${testpath} $vg_command ${srcdir}/$tname > ${tname%.test}.out;
-let result=$?
-case $result in
-0)   cmp -s ${tname%.test}.out ${srcdir}/${tname%.test}.ok ;
-     if [ $? -eq 0 ]
-        then let result=0;  rm  ${tname%.test}.out ;
-        else let result=1;
-             grep "^##" ${srcdir}/$tname  # Print failure message.
-     fi ;;
-80) let result=4 ;;
-*)  let result=1 ;;
+# But first see if the target programs and requirements are in place.
+
+${srcdir}/Available-Testprog \
+  `sed -n -e '/^# This script tests: /s/# This script tests: //p' \
+          -e '/^# Also requires: /s/^# Also requires: //p' \
+          -e '/^$/q' ${srcdir}/$tname | tr '\n' ' '`
+case $? in
+0)
+  PATH=${testpath} $vg_command ${srcdir}/$tname > ${tname%.test}.out;
+  let retval=$?
+  case $retval in
+  0)   cmp -s ${tname%.test}.out ${srcdir}/${tname%.test}.ok ;
+       if [ $? -eq 0 ]
+          then let result=0;  rm  ${tname%.test}.out ;
+          else let result=1;
+               grep "^##" ${srcdir}/$tname  # Print failure message.
+       fi ;;
+  80) let result=4 ;;
+  *)  let result=1 ;;
+  esac ;;
+
+1)   let result=4 ;;
+*)   let result=1 ;;
 esac
 
 # Report whether a single test succeeded or failed.
diff --git a/test/all-in-place.test b/test/all-in-place.test
index e372d373..1cdae7f6 100755
--- a/test/all-in-place.test
+++ b/test/all-in-place.test
@@ -367,11 +367,20 @@ ordinary_testprogs="\
   zeisstopnm \
 "
 
+
 # The string "fiascotopnm" has to be filtered out by egrep for fiascotopnm
 # has a slightly different version report format.
 
 for i in $ordinary_testprogs
   do
+    # Stub out programs that aren't built.
+    Available-Testprog "$i"
+      if [ $? = 1 ]; then
+      echo "$i: program was not built" 1>&2
+      echo "$i: ok"
+      continue
+      fi
+
     $i --version  2>&1 | \
     egrep -v -e fiascotopnm -e \
     "(Using libnetpbm|Compiled|(BSD|SYSV|MSDOS|AMIGA) defined|RGB_?ENV=)" \
diff --git a/test/jbig-roundtrip.test b/test/jbig-roundtrip.test
index 5e96a001..570d7336 100755
--- a/test/jbig-roundtrip.test
+++ b/test/jbig-roundtrip.test
@@ -2,7 +2,6 @@
 # This script tests: pnmtojbig jbigtopnm
 # Also requires: pamchannel pamtopnm
 
-
 # Test 1.  Should print 2425386270 41
 pnmtojbig testgrid.pbm | jbigtopnm | cksum
 
diff --git a/test/legacy-names.test b/test/legacy-names.test
index 30509d20..46bc9ee4 100755
--- a/test/legacy-names.test
+++ b/test/legacy-names.test
@@ -94,8 +94,17 @@ ordinary_testprogs="\
   ppmtouil \
 "
 
+
 for i in $ordinary_testprogs
   do
+    # Stub out programs that aren't built.
+    Available-Testprog "$i"
+      if [ $? = 1 ]; then
+      echo "$i: program was not built" 1>&2
+      echo "$i: ok"
+      continue
+      fi
+
     $i --version  2>&1 | \
     egrep -v \
     "(Using libnetpbm|Compiled|(BSD|SYSV|MSDOS|AMIGA) defined|RGB_?ENV=)" \
diff --git a/test/pbmtext.test b/test/pbmtext.test
index 064b1660..eeb8bf50 100755
--- a/test/pbmtext.test
+++ b/test/pbmtext.test
@@ -81,12 +81,14 @@ rm ${fontRectangle_txt} ${font_pbm}
 
 # One long row
 # Should print 3233136020 4535
+LC_CTYPE=C \
 awk 'BEGIN { for (i=32; i<=125;++i) printf("%c",i);
              for (i=160;i<=255;++i) printf("%c",i); }' | \
     pbmtext -builtin bdf | cksum
 
 # One tall column
 # Should print 1216262214 5711
+LC_CTYPE=C \
 awk 'BEGIN { for (i=32; i<=125;++i) printf("%c\n",i);
              for (i=160;i<=255;++i) printf("%c\n",i); }' | \
     pbmtext -nomargins -builtin bdf | cksum
diff --git a/test/tiff-roundtrip.test b/test/tiff-roundtrip.test
index a99425fa..624337f1 100755
--- a/test/tiff-roundtrip.test
+++ b/test/tiff-roundtrip.test
@@ -2,7 +2,6 @@
 # This script tests: pamtotiff tifftopnm
 # Also requires:
 
-
 # Failure message
 ## Second test fails if Netpbm was built without the flate library
 
diff --git a/test/utahrle-roundtrip.test b/test/utahrle-roundtrip.test
index 982b72a9..17f1a6c4 100755
--- a/test/utahrle-roundtrip.test
+++ b/test/utahrle-roundtrip.test
@@ -2,7 +2,6 @@
 # This script tests: pnmtorle rletopnm
 # Also requires: pamchannel pamtopnm
 
-
 #Test 1.  Should produce 1571496937 33838, cksum of testimg.red
 pamchannel -infile=testimg.ppm -tupletype="GRAYSCALE" 0 | pamtopnm | \
   pnmtorle | rletopnm | cksum
diff --git a/version.mk b/version.mk
index 48a06143..668be6b8 100644
--- a/version.mk
+++ b/version.mk
@@ -1,3 +1,3 @@
 NETPBM_MAJOR_RELEASE = 10
-NETPBM_MINOR_RELEASE = 76
-NETPBM_POINT_RELEASE = 1
+NETPBM_MINOR_RELEASE = 77
+NETPBM_POINT_RELEASE = 0