# 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
: 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 '\\\\' / `
cppccsymbols=''
cppsymbols=''
from=''
+hostgenerate=''
+hostosname=''
+hostperl=''
run=''
targetarch=''
targetdir=''
+targetenv=''
targethost=''
targetmkdir=''
targetport=''
to=''
usecrosscompile=''
-hostperl=''
-hostgenerate=''
extern_C=''
mistrustnm=''
usedevel=''
selectminbits=''
selecttype=''
sh=''
+targetsh=''
sig_count=''
sig_name=''
sig_name_init=''
;;
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
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..."
: 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 ..
- test -d host || mkdir host
- cd host && rm -rf ./*
- ../Configure -des -Dusedevel -Dmksymlinks
- make miniperl
- make generate_uudmap
- hostperl=host/miniperl
- hostgenerate=host/generate_uudmap
- cd ..
- cd UU
+ 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
exe=\$1
shift
$to \$exe
-$targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env ./\$exe \$@"
+$targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
EOF
;;
+ adb)
+ $touch $run
+ ;;
*) echo "Unknown targetrun '$targetrun'" >&4
exit 1
;;
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 || exit 1
+ $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f 2>/dev/null || exit 1
;;
esac
done
*) run=''
to=:
from=:
- usecrosscompile='undef'
+ usecrosscompile="$undef"
targetarch=''
;;
esac
case "$3" in
*) osvers="$3" ;;
esac
+ $test -f /system/lib/libandroid.so && osname=linux-android
;;
MiNT) osname=mint
;;
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
$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 " "
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;
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;
# 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
$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
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'
i16size='$i16size'
i16type='$i16type'
i32size='$i32size'
tar='$tar'
targetarch='$targetarch'
targetdir='$targetdir'
+targetenv='$targetenv'
targethost='$targethost'
targetmkdir='$targetmkdir'
targetport='$targetport'
+targetsh='$targetsh'
tbl='$tbl'
tee='$tee'
test='$test'