This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorJonathan Stowe <gellyfish@gellyfish.com>
Wed, 7 Feb 2007 11:56:17 +0000 (11:56 +0000)
committerNicholas Clark <nick@ccl4.org>
Tue, 13 Feb 2007 23:49:45 +0000 (23:49 +0000)
[ 27001]
Add -DPTR_IS_LONG when building with -Duse64bitint on Solaris/i386.
Otherwise, the build fails in POSIX.

[ 29339]
Silence some warnings during Configure

[ 29341]
Upgrade warning should only be issued if upgrade happens

[ 30155]
Subject: [PATCH hints/linux.sh] libdb may require pthread
Message-Id: <1170849377.13207.14.camel@coriolanus.gellyfish.com>
p4raw-link: @30155 on //depot/perl: 5d3df70f5debb91e49b4e0e6c1dec152e98e3220
p4raw-link: @29341 on //depot/perl: 0215cc28a64f0c5ec200bf5c210bc0178850683f
p4raw-link: @29339 on //depot/perl: 33773f1a6c844b2c59f262a2b0f9af000d7d13b7
p4raw-link: @27001 on //depot/perl: 25909821eb3e0c6b8049a206da47b68b90d7e46a

p4raw-id: //depot/maint-5.8/perl@30274
p4raw-integrated: from //depot/perl@30273 'copy in' hints/linux.sh
(@28979..)
p4raw-integrated: from //depot/perl@29341 'edit in' hints/hpux.sh
(@29339..)
p4raw-integrated: from //depot/perl@27001 'merge in' hints/solaris_2.sh
(@25737..)

hints/hpux.sh
hints/linux.sh
hints/solaris_2.sh

index 94600a9..762afe7 100644 (file)
@@ -188,14 +188,17 @@ toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"'
     gcc_64native=no
 case "$ccisgcc" in
     $define|true|[Yy])
-       echo 'int main(){long l;printf("%d\\n",sizeof(l));}'>try.c
+       echo '#include <stdio.h>\nint main(){long l;printf("%d\\n",sizeof(l));}'>try.c
        $cc -o try $ccflags $ldflags try.c
        if [ "`try`" = "8" ]; then
-           cat <<EOM >&4
+           case "$use64bitall" in
+               $define|true|[Yy]) ;;
+               *)  cat <<EOM >&4
 
 *** This version of gcc uses 64 bit longs. -Duse64bitall is
 *** implicitly set to enable continuation
 EOM
+               esac
            use64bitall=$define
            gcc_64native=yes
            fi
@@ -336,6 +339,7 @@ else
 
 ## Optimization limits
 cat >try.c <<EOF
+#include <stdio.h>
 #include <sys/resource.h>
 
 int main ()
index 2415136..bd6afd2 100644 (file)
@@ -311,9 +311,12 @@ cat > UU/usethreads.cbu <<'EOCBU'
 case "$usethreads" in
 $define|true|[yY]*)
         ccflags="-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS $ccflags"
-        set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
-        shift
-        libswanted="$*"
+        if echo $libswanted | grep -v pthread >/dev/null
+        then
+            set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
+            shift
+            libswanted="$*"
+        fi
 
        # Somehow at least in Debian 2.2 these manage to escape
        # the #define forest of <features.h> and <time.h> so that
@@ -372,3 +375,37 @@ case "$cc" in
   d_dlerror='define'
   ;;
 esac
+
+# Under some circumstances libdb can get built in such a way as to
+# need pthread explicitly linked.
+
+libdb_needs_pthread="N"
+
+if echo " $libswanted " | grep -v " pthread " >/dev/null
+then
+   if echo " $libswanted " | grep " db " >/dev/null
+   then
+     for DBDIR in $glibpth
+     do
+       DBLIB="$DBDIR/libdb.so"
+       if [ -f $DBLIB ]
+       then
+         if nm -u $DBLIB | grep pthread >/dev/null
+         then
+           if ldd $DBLIB | grep pthread >/dev/null
+           then
+             libdb_needs_pthread="N"
+           else
+             libdb_needs_pthread="Y"
+           fi
+         fi
+       fi
+     done
+   fi
+fi
+
+case "$libdb_needs_pthread" in
+  "Y")
+    libswanted="$libswanted pthread"
+    ;;
+esac
index 62bf015..82e3941 100644 (file)
@@ -456,6 +456,14 @@ case "$usemorebits" in
        ;;
 esac
 
+if test `uname -p` = i386; then
+    case "$use64bitint" in
+    "$define"|true|[yY]*)
+            ccflags="$ccflags -DPTR_IS_LONG"
+            ;;
+    esac
+fi
+
 if test `uname -p` = sparc -o `uname -p` = i386; then
     cat > UU/use64bitint.cbu <<'EOCBU'
 # This script UU/use64bitint.cbu will get 'called-back' by Configure