This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove old Class-ISA remnants
[perl5.git] / Configure
index 1213a53..a8e4a48 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -28,7 +28,7 @@
 # See Porting/pumpkin.pod for more information on metaconfig.
 #
 
-# Generated on Wed Jan 22 12:03:46 CET 2014 [metaconfig 3.5 PL0]
+# Generated on Wed Apr  9 12:24:24 CEST 2014 [metaconfig 3.5 PL0]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -91,7 +91,7 @@ esac
 : Proper separator for the PATH environment variable
 p_=:
 : On OS/2 this directory should exist if this is not floppy only system ":-]"
-if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
+if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' 2>&1 ) 2>&1 >/dev/null ; then
        if test -n "$OS2_SHELL"; then
                p_=\;
                PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
@@ -206,9 +206,13 @@ ccsymbols=''
 cppccsymbols=''
 cppsymbols=''
 from=''
+hostgenerate=''
+hostosname=''
+hostperl=''
 run=''
 targetarch=''
 targetdir=''
+targetenv=''
 targethost=''
 targetmkdir=''
 targetport=''
@@ -1163,6 +1167,7 @@ scriptdirexp=''
 selectminbits=''
 selecttype=''
 sh=''
+targetsh=''
 sig_count=''
 sig_name=''
 sig_name_init=''
@@ -1436,6 +1441,10 @@ EOM
        ;;
 esac
 
+: When cross-compiling we need to separate the sh-to-run-Configure-with from the sh-to-use-in-Perl
+: default both to the same thing, cross-compilers can then set targetsh differently if they like
+targetsh=$sh
+
 : see if sh knows # comments
 if `$sh -c '#' >/dev/null 2>&1`; then
        shsharp=true
@@ -2832,6 +2841,9 @@ esac
 if $test "X$targethost" = "X"; then
     targethost=""
 fi
+if $test "X$targetenv" = "X"; then
+    targetenv=""
+fi
 case "$usecrosscompile" in
 $define|true|[yY]*)
        $echo "Cross-compiling..."
@@ -2871,9 +2883,32 @@ $define|true|[yY]*)
        case "$croak" in
        y) echo "Cannot continue, aborting." >&4; exit 1 ;;
        esac
+    : compile a host miniperl and generate_uudmap, unless we got passed them
+    if $test "X$hostperl" = X; then
+      echo "Building host miniperl and generate_uudmap binaries" >&4
+      before_host=`pwd`
+      cd ..
+      cd $src
+      src=`pwd`
+      rm -rf $src/host
+      mkdir $src/host
+      cd $src/host
+      $src/Configure -des -Dusedevel -Dmksymlinks
+      $make miniperl
+      case "$hostgenerate" in
+      '') $make generate_uudmap
+          hostgenerate=$src/host/generate_uudmap
+          ;;
+       "$undef") hostgenerate=''
+          ;;
+      esac
+      hostperl=$src/host/miniperl
+      cd $before_host
+    fi
+    hostosname=`$hostperl -le 'print $^O'`
     ;;
 *)
-    usecrosscompile='undef'
+    usecrosscompile="$undef"
     ;;
 esac
 
@@ -2946,6 +2981,7 @@ case "$targethost" in
        ssh|rsh)
            cat >$run <<EOF
 #!/bin/sh
+env=''
 case "\$1" in
 -cwd)
   shift
@@ -2953,15 +2989,25 @@ case "\$1" in
   shift
   ;;
 esac
+case "\$1" in
+-env)
+  shift
+  env=\$1
+  shift
+  ;;
+esac
 case "\$cwd" in
 '') cwd=$targetdir ;;
 esac
 exe=\$1
 shift
 $to \$exe
-$targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
+$targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
 EOF
            ;;
+       adb)
+           $touch $run
+           ;;
        *)  echo "Unknown targetrun '$targetrun'" >&4
            exit 1
            ;;
@@ -2987,11 +3033,11 @@ do
   case "\$f" in
   /*)
     $targetmkdir \`dirname \$f\`
-    $targetto -P $targetport $q \$f $targetuser@$targethost:\$f            || exit 1
+    $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f           2>/dev/null  || exit 1
     ;;
   *)
     $targetmkdir $targetdir/\`dirname \$f\`
-    $targetto -P $targetport $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
+    $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
     ;;
   esac
 done
@@ -3073,7 +3119,7 @@ EOF
 *)     run=''
        to=:
        from=:
-       usecrosscompile='undef'
+       usecrosscompile="$undef"
        targetarch=''
        ;;
 esac
@@ -3350,6 +3396,7 @@ EOM
                        case "$3" in
                        *)      osvers="$3" ;;
                        esac
+                       $test -f /system/lib/libandroid.so && osname=linux-android
                        ;;
                MiNT)   osname=mint
                        ;;
@@ -3499,8 +3546,42 @@ EOM
         case "$targetarch" in
         '') ;;
         *)  hostarch=$osname
-            osname=`echo $targetarch|sed 's,^[^-]*-,,'`
-            osvers=''
+            case "$targetarch" in
+                nto*|*-nto-*)
+                    # Will load qnx.sh, which should change osname to nto
+                    osname=qnx
+                    osvers=''
+                    ;;
+                *linux-android*)
+                    # Catch arm-linux-androideabi, mipsel-linux-android,
+                    # and i686-linux-android
+                    osname=linux-android
+                    osvers=''
+                    ;;
+                *linux*)
+                    # Something like arm-linux-gnueabihf is really just
+                    # plain linux.
+                    osname=linux
+                    osvers=''
+                    ;;
+                *solaris*|*sunos*)
+                    osname=solaris
+                    # XXX perhaps we should just assume
+                    # osvers to be 2, or maybe take the value
+                    # from targetarch. Using $run before the
+                    # hints are run is somewhat icky.
+                    set X `$run $uname -a 2>/dev/null`
+                    shift
+                    case "$3" in
+                        5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
+                        *)  osvers="$3" ;;
+                    esac
+                    ;;
+                *)
+                   osname=`echo $targetarch|sed 's,^[^-]*-,,'`
+                   osvers=''
+                ;;
+            esac
             ;;
         esac
 
@@ -4562,6 +4643,22 @@ case "$gccversion" in
     $rm -f try try.*
 esac
 
+# gcc 4.9 by default does some optimizations that break perl.
+# see ticket 121505.
+#
+# The -fwrapv disables those optimizations (and probably others,) so
+# for gcc 4.9 (and later, since the optimizations probably won't go
+# away), add -fwrapv unless the user requests -fno-wrapv, which
+# disables -fwrapv, or if the user requests -fsanitize=undefined,
+# which turns the overflows -fwrapv ignores into runtime errors.
+case "$gccversion" in
+4.[3-9].*|4.[1-9][0-9]*|[5-9].*|[1-9][0-9]*)
+    case "$ccflags" in
+    *-fno-wrapv*|*-fsanitize=undefined*|*-fwrapv*) ;;
+    *) ccflags="$ccflags -fwrapv" ;;
+    esac
+esac
+
 : What should the include directory be ?
 : Use sysroot if set, so findhdr looks in the right place.
 echo " "
@@ -5204,7 +5301,7 @@ esac
 checkccflag='check=$1; flag=$2; callback=$3;
 echo " ";
 echo "Checking if your compiler accepts $flag" 2>&1;
-[ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot"
+[ "X$sysroot" != "X" ] && echo "For sysroot = $sysroot";
 echo "int main(void) { return 0; }" > gcctest.c;
 if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
     echo "Yes, it does." 2>&1;
@@ -7896,13 +7993,13 @@ yes)
                if $contains $tlook $tf >/dev/null 2>&1; then
                        tval=true;
                elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
-                       echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+                       echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
                        $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
                        $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
                        $rm_try;
                fi;
        else
-               echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+               echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
                $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
                $rm_try;
        fi;
@@ -19653,9 +19750,10 @@ EOCP
                    # Copy the .c file to the remote host ($to is an ssh-alike if targethost is set)
                    if $test "X$targethost" != X; then
                        $to tryp.c
-                       $run ./tryp \< tryp.c 2>/dev/null > tryp.out
+                       $to tryp
+                       $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
                    else
-                       $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
+                       $cat tryp.c | $run ./tryp   2>/dev/null > tryp.out
                    fi
                    if cmp tryp.c tryp.out >/dev/null 2>&1; then
                       $cat >&4 <<EOM
@@ -19722,9 +19820,10 @@ EOCP
            $rm -f tryp.out
            if $test "X$targethost" != X; then
                $to tryp.c
-               $run ./tryp \< tryp.c 2>/dev/null > tryp.out
+               $to tryp
+               $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
            else
-               $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
+               $cat tryp.c | $run ./tryp   2>/dev/null > tryp.out
            fi
            if cmp tryp.c tryp.out >/dev/null 2>&1; then
               $cat >&4 <<EOM
@@ -23403,6 +23502,9 @@ h_fcntl='$h_fcntl'
 h_sysfile='$h_sysfile'
 hint='$hint'
 hostcat='$hostcat'
+hostgenerate='$hostgenerate'
+hostosname='$hostosname'
+hostperl='$hostperl'
 html1dir='$html1dir'
 html1direxp='$html1direxp'
 html3dir='$html3dir'
@@ -23778,9 +23880,11 @@ tail='$tail'
 tar='$tar'
 targetarch='$targetarch'
 targetdir='$targetdir'
+targetenv='$targetenv'
 targethost='$targethost'
 targetmkdir='$targetmkdir'
 targetport='$targetport'
+targetsh='$targetsh'
 tbl='$tbl'
 tee='$tee'
 test='$test'