This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Do not invert a NULL cp_list.
[perl5.git] / Configure
index 597eb08..293ef61 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
@@ -206,17 +206,18 @@ ccsymbols=''
 cppccsymbols=''
 cppsymbols=''
 from=''
+hostgenerate=''
+hostosname=''
+hostperl=''
 run=''
 targetarch=''
 targetdir=''
+targetenv=''
 targethost=''
 targetmkdir=''
 targetport=''
 to=''
 usecrosscompile=''
-hostperl=''
-hostgenerate=''
-hostosname=''
 extern_C=''
 mistrustnm=''
 usedevel=''
@@ -1166,6 +1167,7 @@ scriptdirexp=''
 selectminbits=''
 selecttype=''
 sh=''
+targetsh=''
 sig_count=''
 sig_name=''
 sig_name_init=''
@@ -1439,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
@@ -2835,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..."
@@ -2881,19 +2890,25 @@ $define|true|[yY]*)
       cd ..
       cd $src
       src=`pwd`
-      test -d $src/host || mkdir $src/host
-      cd $src/host && rm -rf ./*
+      rm -rf $src/host
+      mkdir $src/host
+      cd $src/host
       $src/Configure -des -Dusedevel -Dmksymlinks
-      make miniperl
-      make generate_uudmap
+      $make miniperl
+      case "$hostgenerate" in
+      '') $make generate_uudmap
+          hostgenerate=$src/host/generate_uudmap
+          ;;
+       "$undef") hostgenerate=''
+          ;;
+      esac
       hostperl=$src/host/miniperl
-      hostgenerate=$src/host/generate_uudmap
       cd $before_host
     fi
     hostosname=`$hostperl -le 'print $^O'`
     ;;
 *)
-    usecrosscompile='undef'
+    usecrosscompile="$undef"
     ;;
 esac
 
@@ -2990,6 +3005,9 @@ $to \$exe
 $targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
 EOF
            ;;
+       adb)
+           $touch $run
+           ;;
        *)  echo "Unknown targetrun '$targetrun'" >&4
            exit 1
            ;;
@@ -3015,11 +3033,11 @@ do
   case "\$f" in
   /*)
     $targetmkdir \`dirname \$f\`
-    $targetto -P $targetport -r $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 -r $q \$f $targetuser@$targethost:$targetdir/\$f  2>/dev/null || exit 1
+    $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
     ;;
   esac
 done
@@ -3101,7 +3119,7 @@ EOF
 *)     run=''
        to=:
        from=:
-       usecrosscompile='undef'
+       usecrosscompile="$undef"
        targetarch=''
        ;;
 esac
@@ -3378,6 +3396,7 @@ EOM
                        case "$3" in
                        *)      osvers="$3" ;;
                        esac
+                       $test -f /system/lib/libandroid.so && osname=linux-android
                        ;;
                MiNT)   osname=mint
                        ;;
@@ -3527,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
 
@@ -4590,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 " "
@@ -5232,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;
@@ -7924,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;
@@ -19681,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
@@ -19750,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
@@ -23431,13 +23502,13 @@ h_fcntl='$h_fcntl'
 h_sysfile='$h_sysfile'
 hint='$hint'
 hostcat='$hostcat'
+hostgenerate='$hostgenerate'
+hostosname='$hostosname'
+hostperl='$hostperl'
 html1dir='$html1dir'
 html1direxp='$html1direxp'
 html3dir='$html3dir'
 html3direxp='$html3direxp'
-hostgenerate='$hostgenerate'
-hostperl='$hostperl'
-hostosname='$hostosname'
 i16size='$i16size'
 i16type='$i16type'
 i32size='$i32size'
@@ -23809,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'