about summary refs log tree commit diff
path: root/buildtools
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools')
-rwxr-xr-xbuildtools/configure.pl48
-rwxr-xr-xbuildtools/makeman16
2 files changed, 48 insertions, 16 deletions
diff --git a/buildtools/configure.pl b/buildtools/configure.pl
index e82c229c..1219b437 100755
--- a/buildtools/configure.pl
+++ b/buildtools/configure.pl
@@ -1550,13 +1550,14 @@ sub testPngHdr($$) {
 
 
 
-sub printBadPngConfigLdflagsWarning($) {
-    my ($pngLdFlags) = @_;
+sub printBadPngConfigCFlagsWarning($) {
+    my ($pngCFlags) = @_;
 
     print << 'EOF';
-WARNING: 'libpng-config' in this environment (a program in your PATH)
-gives instructions that don't work for linking with the PNG library.
-Our test link failed.
+
+WARNING: 'libpng-config' in this environment (a program in your PATH) gives
+instructions that don't work for compiling for (not linking with) the PNG
+library.  Our test compile failed.
 
 This indicates Libpng is installed incorrectly on this system.  If so,
 your Netpbm build, which uses 'libpng-config', will fail.  But it
@@ -1568,13 +1569,29 @@ EOF
 
 
 
-sub printBadPngConfigCFlagsWarning($) {
-    my ($pngCFlags) = @_;
+sub printPngLinkWorksWithLzLm() {
 
     print << 'EOF';
+When we added "-lz -lm" to the linker flags, the link worked.  That means the
+fix for this may be to modify 'libpng-config' so that 'libpng-config
+--ldflags' includes "-lz -lm" in its output.  But the right fix may actually
+be to build libpng differently so that it specifies its dependency on those
+libraries, or to put those libraries in a different place, or to create
+missing symbolic links.
+
+EOF
+}
+
+
+
+sub printBadPngConfigLdflagsWarning($$) {
+    my ($pngLdFlags, $lzLmSuccess) = @_;
+
+    print << 'EOF';
+*****************************************************************************
 WARNING: 'libpng-config' in this environment (a program in your PATH)
-gives instructions that don't work for compiling for the PNG library.
-Our test compile failed.
+gives instructions that don't work for linking with the PNG library.
+Our test link failed.
 
 This indicates Libpng is installed incorrectly on this system.  If so,
 your Netpbm build, which uses 'libpng-config', will fail.  But it
@@ -1582,6 +1599,14 @@ might also just be our test that is broken.
 
 EOF
 
+    if ($lzLmSuccess) {
+        printPngLinkWorksWithLzLm();
+    }
+
+    print << 'EOF';
+*****************************************************************************
+
+EOF
 }
 
 
@@ -1607,7 +1632,10 @@ sub testLinkPnglib($$) {
                         \@cSourceCode, \my $success);
         
         if (!$success) {
-            printBadPngConfigLdflagsWarning($pngLdflags);
+            testCompileLink("$generalCflags $pngCflags $pngLdflags -lz -lm",
+                        \@cSourceCode, \my $lzLmSuccess);
+
+            printBadPngConfigLdflagsWarning($pngLdflags, $lzLmSuccess);
         }
     }
 }
diff --git a/buildtools/makeman b/buildtools/makeman
index 2e122779..100ad580 100755
--- a/buildtools/makeman
+++ b/buildtools/makeman
@@ -1,4 +1,4 @@
-#!/bin/env python
+#!/usr/bin/python
 #
 # makeman -- compile netpbm's stereotyped HTML to troff markup
 #
@@ -121,7 +121,10 @@ def makeman(name, file, indoc):
     indoc = re.sub("(?i)</SUP>", r"\\d", indoc)
     # Paragraph handling
     indoc = re.sub("(?i)\n*<P>\n*", r"\n.PP\n", indoc)
+    indoc = re.sub("(?i)<br */>", r"\n.PP\n", indoc)
     indoc = re.sub("(?i)</P>", "", indoc)
+    indoc = re.sub("(?i)<!--[^>]*-->", "", indoc)
+    indoc = re.sub("(?i)<meta[^>]*>", "", indoc)
     lines = indoc.split("\n")
     listdepth = 0
     for i in range(len(lines)):
@@ -138,13 +141,14 @@ def makeman(name, file, indoc):
     indoc = re.sub('(?i)<A[ \n]+HREF="mailto:[^>]+">([^<]+)</A>', r'\\fI\1\\fP', indoc)    
     # Format manual crossreferences
     def xrefmatch(match):
-        xrefto = match.group(1)
-        xrefsection = sectmap.get(xrefto, 1)
+        xrefto = match.group(2)
+        xrefurl = match.group(1)
+        xrefsection = sectmap.get(xrefurl, 1)
         if xrefsection == 0:
             return "\n.I " + xrefto
         else:
-            return "\n.BR %s (%d)" % (xrefto, xrefsection)
-    indoc = re.sub(r'(?i)\n* *(?:\\fB)?<A[ \n]+HREF="[^>]+.html">([^<]+)</A>(?:\\fP)?',
+            return "\n.BR %s (%d)\n" % (xrefto, xrefsection)
+    indoc = re.sub(r'(?i)\n* *(?:\\fB)?<A[ \n]+HREF="?([^>]+.html)"?>([^<]+)</A>(?:\\fP)?',
                    xrefmatch, indoc)
     # Format URLs
     def urlmatch(match):
@@ -159,7 +163,7 @@ def makeman(name, file, indoc):
     indoc = indoc.replace("&#174;", r"\*R")
     indoc = indoc.replace("&copy;", r"\(co")
     # Turn anchors into .UN tags
-    indoc = re.sub('(?i)<A NAME *= *"#?([a-zA-Z][a-zA-Z0-9.-]+)">(?:&nbsp;)*</A>\s*', ".UN \\1\n", indoc)
+    indoc = re.sub('(?i)<A NAME *= *"#?([a-zA-Z_][a-zA-Z_0-9.-]+)">(?:&nbsp;)*</A>\s*', ".UN \\1\n", indoc)
     # Strip off the index trailer
     trailer = re.compile('<HR */*>.*', re.DOTALL | re.IGNORECASE)
     indoc = re.sub(trailer, "", indoc)