From 9df60b4c472359d6d1a92fd62dd74feb002f14fc Mon Sep 17 00:00:00 2001 From: giraffedata Date: Sun, 25 Dec 2016 17:36:41 +0000 Subject: Copy Development as new Advanced git-svn-id: http://svn.code.sf.net/p/netpbm/code/advanced@2861 9d0c8265-081b-0410-96cb-a4ca84ce46f8 --- buildtools/configure.pl | 32 ++++++++++++++++++++++++-------- buildtools/libopt.c | 1 + buildtools/makeman | 24 ++++++++++++------------ 3 files changed, 37 insertions(+), 20 deletions(-) (limited to 'buildtools') 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)?([^<]+)(?:\\fP)?', xrefmatch, indoc) # Format URLs @@ -231,25 +231,25 @@ def makeman(name, file, indoc): indoc = indoc.replace("μ", "mu") indoc = indoc.replace("σ", "sigma") # Tables - indoc = re.sub(' *]*>.*', ".TS", indoc) - indoc = re.sub(" *.*", ".TE", indoc) + indoc = re.sub('(?i) *]*>.*', ".TS", indoc) + indoc = re.sub("(?i) *.*", ".TE", indoc) # First the single-line case - indoc = re.sub(" *", "\t", indoc) - indoc = re.sub(" *", "", indoc) - indoc = re.sub(" *", "", indoc) + indoc = re.sub("(?i) *", "\t", indoc) + indoc = re.sub("(?i) *", "", indoc) + indoc = re.sub("(?i) *", "", indoc) # Then the multiline case - indoc = re.sub(r'\s*]*>([^<\n]*)\s*', '\t\\1', indoc) - indoc = re.sub(r'\s*]*>([^<]*)\s*', '\tT{\n\\1T}', indoc) + indoc = re.sub(r'(?i)\s*]*>([^<\n]*)\s*', '\t\\1', indoc) + indoc = re.sub(r'(?i)\s*]*>([^<]*)\s*', '\tT{\n\\1T}', indoc) indoc = indoc.replace("\n\\&T}", "\nT}") - indoc = re.sub(" *", "", indoc) - indoc = re.sub(" *]*>\t*", "", indoc) - indoc = re.sub(r"\.TS\s+([^<]*)\s*", ".B \\1\n.TS\n", indoc) + indoc = re.sub("(?i) *", "", indoc) + indoc = re.sub("(?i) *]*>\t*", "", indoc) + indoc = re.sub(r"\.TS\s+<[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'(?