about summary refs log tree commit diff
path: root/buildtools
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/README.pkg10
-rwxr-xr-xbuildtools/configure.pl67
-rwxr-xr-xbuildtools/installnetpbm.pl14
3 files changed, 59 insertions, 32 deletions
diff --git a/buildtools/README.pkg b/buildtools/README.pkg
index b2a6b0ef..e544cbb7 100644
--- a/buildtools/README.pkg
+++ b/buildtools/README.pkg
@@ -69,6 +69,16 @@ The parts to be installed are:
     that is in the default search path of your compiler.  Typical
     directories for this are /usr/include and /usr/local/include.
 
+    All of the files are meant to be named like <netpbm/xxx.h> for C
+    #include purposes, which means on an ordinary system, they are
+    installed in a directory named "netpbm".  Thus, they are organized
+    this way in the package.  BUT: until Netpbm 10.41 (December 2007),
+    they were packaged for, and customarily used, just as <xxx.h>.
+    Therefore, for backward compatibility, it is a good idea to make
+    symbolic links from the parent directory into the netpbm/
+    directory.  But as that may pollute your namespace, you may prefer
+    just to make all users migrate to the <netpbm/xxx.h> form.
+
   Data Files
 
     These are files that you can use for various purposes as input to
diff --git a/buildtools/configure.pl b/buildtools/configure.pl
index 3a0592ad..9cb1313a 100755
--- a/buildtools/configure.pl
+++ b/buildtools/configure.pl
@@ -157,22 +157,14 @@ sub chooseTestCompiler($$) {
 
     my $cc;
 
-    if (!defined($compiler)) {
-        if ($ENV{'CC'}) {
-            $cc = $ENV{'CC'};
-        } else {
-            if (commandExists('cc')) {
-                $cc = 'cc';
-            } elsif (commandExists("gcc")) {
-                $cc = 'gcc';
-            }
-        }
-    } elsif ($compiler eq 'cc') {
-        $cc = "cc";
-    } elsif ($compiler eq 'gcc') {
-        $cc = 'gcc';
+    if ($ENV{'CC'}) {
+        $cc = $ENV{'CC'};
     } else {
-        die("Internal error: invalid value \"$compiler\" for \$compiler");
+        if (commandExists('cc')) {
+            $cc = 'cc';
+        } elsif (commandExists("gcc")) {
+            $cc = 'gcc';
+        }
     }
     $$testCcR = $cc;
 }
@@ -469,7 +461,8 @@ sub getCompiler($$) {
 #    need different options.
 #
 #  - There are basically two choices on any system:  native compiler or
-#    GNU compiler.  That's all this program recognizes, anyway.
+#    GNU compiler.  That's all this program recognizes, anyway.  On some,
+#    native _is_ GNU, and we return 'gcc'.
 #
 #  - A user may well have various compilers.  Different releases, using
 #    different standard libraries, for different target machines, etc.
@@ -488,15 +481,24 @@ sub getCompiler($$) {
 #
 # The value this subroutine returns is NOT the command name to invoke the
 # compiler.  It is simply "cc" to mean native compiler or "gcc" to mean
-# GNU compiler or undefined to express no preference.
+# GNU compiler.
 #-----------------------------------------------------------------------------
-    my %gccCapablePlatform = ("SOLARIS" => 1,
-                              "TRU64"   => 1,
-                              "SCO"     => 1,
-                              "AIX"     => 1,
-                              "HP"      => 1);
-
-    if ($gccCapablePlatform{$platform}) {
+    my %gccOptionalPlatform = ("SOLARIS" => 1,
+                               "TRU64"   => 1,
+                               "SCO"     => 1,
+                               "AIX"     => 1,
+                               "HP"      => 1);
+
+    my %gccUsualPlatform = ("GNU"     => 1,
+                            "NETBSD"  => 1,
+                            "OPENBSD" => 1,
+                            "FREEBSD" => 1,
+                            "DARWIN"  => 1,
+                            );
+
+    if ($gccUsualPlatform{$platform}) {
+        $$compilerR = "gcc";
+    } elsif ($gccOptionalPlatform{$platform}) {
         print("GNU compiler or native operating system compiler (cc)?\n");
         print("\n");
 
@@ -529,6 +531,8 @@ sub getCompiler($$) {
                   "makefile variable or install 'gcc'\n");
         }
         print("\n");
+    } else {
+        $$compilerR = 'cc';
     }
 }
 
@@ -1623,7 +1627,7 @@ sub printNoLibxml2Warning() {
 
 WARNING: You appear not to have Libxml2 installed ('xml2-config' does not
 exist in your program search PATH).  If this is the case at build time,
-the build will skip building 'svtgtopam'.
+the build will skip building 'svgtopam'.
 
 EOF
 }
@@ -2056,7 +2060,7 @@ if ($platform eq "GNU") {
         # above does NOT work for HP native compiler.
     }
 } elsif ($platform eq "AIX") {
-    push(@Makefile_config, 'LDFLAGS = -L /usr/pubsw/lib', "\n");
+    push(@Makefile_config, 'LDFLAGS += -L /usr/pubsw/lib', "\n");
     if ($compiler eq "cc") {
         # Yes, the -L option implies the runtime as well as linktime library
         # search path.  There's no way to specify runtime path independently.
@@ -2114,8 +2118,6 @@ if ($platform eq "GNU") {
          '-shared -Wl,--image-base=0x10000000 -Wl,--enable-auto-import', "\n");
 } elsif ($platform eq "BEOS") {
     push(@Makefile_config, "LDSHLIB = -nostart\n");
-} elsif ($platform eq "NETBSD") {
-    push(@Makefile_config, 'CFLAGS_SHLIB = -fpic', "\n");
 } elsif ($platform eq "OPENBSD") {
     # vedge@vedge.com.ar says on 2001.04.29 that there are a ton of 
     # undefined symbols in the Fiasco stuff on OpenBSD.  So we'll just
@@ -2132,13 +2134,12 @@ if ($platform eq "GNU") {
     if ($compiler eq "cc") {
         push(@Makefile_config, "CFLAGS = -O\n");
         push(@Makefile_config, "CFLAGS_SHLIB = -O -K pic\n");
-        push(@Makefile_config, "LD_SHLIB = -G\n");
+        push(@Makefile_config, "LDSHLIB = -G\n");
         push(@Makefile_config, "SHLIB_CLIB =\n");
     } else {
         makeCompilerGcc(\@Makefile_config);
+        push(@Makefile_config, "LDSHLIB = -shared\n"); 
     }
-    push(@Makefile_config, "CFLAGS_SHLIB = -fPIC\n");
-    push(@Makefile_config, "LDSHLIB = -shared\n"); 
     push(@Makefile_config, "NETWORKLD = -lsocket -lresolve\n");
 } elsif ($platform eq "DARWIN") {
     push(@Makefile_config, "CC = cc -no-cpp-precomp\n");
@@ -2192,6 +2193,10 @@ if (!$flex_result) {
     }
 }
 
+if ($compiler eq 'gcc') {
+    push(@Makefile_config, "CFLAGS_SHLIB += -fPIC\n");
+}
+
 if (defined($tiffhdr_dir)) {
     push(@Makefile_config, "TIFFHDR_DIR = $tiffhdr_dir\n");
 }
diff --git a/buildtools/installnetpbm.pl b/buildtools/installnetpbm.pl
index f6ab7ca0..25376ec3 100755
--- a/buildtools/installnetpbm.pl
+++ b/buildtools/installnetpbm.pl
@@ -554,7 +554,19 @@ sub installHeader($$$) {
               "failed.\n");
         print("cp exit code is $rc\n");
     } else {
-        print("done.\n");
+        # Install symbolic links for backward compatibility (because the
+        # netpbm/ subdirectory wasn't used before Netpbm 10.41 (December
+        # 2007).
+
+        my $rc = system("cd $hdrDir; ln -s netpbm/* .");
+
+        if ($rc != 0) {
+            print("Failed to create backward compatibilty symlinks from " .
+                  "$hdrDir into $hdrDir/netpbm\n");
+            print("ln exit code is $rc\n");
+        } else {
+            print("done.\n");
+        }
     }
     $$includedirR = $hdrDir;
 }