This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Get rid of "grep empty(sub)expression" noise.
[perl5.git] / Configure
index 0d505d7..a8e4a48 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -28,7 +28,7 @@
 # See Porting/pumpkin.pod for more information on metaconfig.
 #
 
-# Generated on Wed Jan  1 18:06:40 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,10 +206,17 @@ ccsymbols=''
 cppccsymbols=''
 cppsymbols=''
 from=''
+hostgenerate=''
+hostosname=''
+hostperl=''
 run=''
 targetarch=''
+targetdir=''
+targetenv=''
+targethost=''
+targetmkdir=''
+targetport=''
 to=''
-sysroot=''
 usecrosscompile=''
 extern_C=''
 mistrustnm=''
@@ -313,6 +320,7 @@ RCSfile=''
 Revision=''
 Source=''
 State=''
+sysroot=''
 _a=''
 _exe=''
 _o=''
@@ -576,7 +584,6 @@ d_killpg=''
 d_lchown=''
 d_ldbl_dig=''
 d_libm_lib_version=''
-d_libname_unique=''
 d_link=''
 d_localtime_r=''
 d_localtime_r_needs_tzset=''
@@ -1001,6 +1008,7 @@ libperl=''
 shrpenv=''
 useshrplib=''
 glibpth=''
+incpth=''
 libpth=''
 loclibpth=''
 plibpth=''
@@ -1159,6 +1167,7 @@ scriptdirexp=''
 selectminbits=''
 selecttype=''
 sh=''
+targetsh=''
 sig_count=''
 sig_name=''
 sig_name_init=''
@@ -1195,6 +1204,7 @@ sitescript=''
 sitescriptexp=''
 sizesize=''
 sizetype=''
+d_libname_unique=''
 so=''
 socksizetype=''
 sharpbang=''
@@ -1431,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
@@ -1953,44 +1967,6 @@ true)
        ;;
 esac
 
-: Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
-: This is primarily meant for cross-compile environments, and may fail to be useful in other cases
-
-if test "X$sysroot" != X; then
-  case "$cc" in
-    *gcc*|*g++*)
-        echo "Using $sysroot to find your headers and libraries, adding to ccflags"
-        case "$ccflags" in
-            *sysroot*) ;;
-            'undef'|*)
-                ccflags="$ccflags --sysroot=$sysroot"
-        esac
-        case "$ldflags" in
-            *sysroot*) ;;
-            'undef'|*)
-                ldflags="$ldflags --sysroot=$sysroot"
-        esac
-        case "$cppflags" in
-            *sysroot*) ;;
-            'undef'|*)
-                cppflags="$cppflags --sysroot=$sysroot"
-        esac
-        # lddlflags updated below in lddlflags section;
-        # same with cccdlflags
-  ;;
-  esac
-  
-  # Adjust some defaults to also use $sysroot
-  for var in xlibpth loclibpth locincpth glibpth; do
-    eval xxx=\$$var
-    eval $var=''
-    for path in $xxx; do
-      eval $var=\"\$$var $sysroot$path\"
-    done
-  done
-
-fi
-
 : Eunice requires " " instead of "", can you believe it
 echo " "
 : Here we go...
@@ -2340,6 +2316,48 @@ EOH
        esac
 fi
 
+: Set 'sysroot' to change the logical root directory to your headers and libraries see man gcc
+: This is primarily meant for cross-compile environments, and may fail to be useful in other cases
+if test "X$sysroot" = X; then
+    sysroot=""
+else
+    case "$cc" in
+       *gcc*|*g++*)
+           echo "Using $sysroot to find your headers and libraries, adding to ccflags"
+           # _sysroot is used in places where we need --sysroot=foo
+           # but using the rest of the flags could cause issues.
+           _sysroot="--sysroot=$sysroot";
+           case "$ccflags" in
+               *sysroot*) ;;
+               'undef'|*)
+               ccflags="$ccflags $_sysroot"
+           esac
+           case "$ldflags" in
+               *sysroot*) ;;
+               'undef'|*)
+               ldflags="$ldflags $_sysroot"
+           esac
+           case "$cppflags" in
+               *sysroot*) ;;
+               'undef'|*)
+               cppflags="$cppflags $_sysroot"
+           esac
+           # lddlflags updated below in lddlflags section;
+           # same with cccdlflags
+           ;;
+    esac
+
+    # Adjust some defaults to also use $sysroot
+    for var in xlibpth loclibpth locincpth glibpth; do
+       eval xxx=\$$var
+       eval $var=''
+       for path in $xxx; do
+           eval $var=\"\$$var $sysroot$path\"
+       done
+    done
+
+fi
+
 : find out where common programs are
 echo " "
 echo "Locating common programs..." >&4
@@ -2820,34 +2838,101 @@ $define|true|[yY]*)
 esac
 
 : Check for Cross-Compilation
+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..."
-        croak=''
-       case "$cc" in
-        *-gcc*|*-g++*) # A cross-compiling gcc, probably.
-            # arm-linux-androideabi-gcc  -> arm-linux-androideabi
-            # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
-            targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
-            ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
-            # leave out ld, choosing it is more complex
-            nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
-            ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
-           ;;
+       croak=''
+       case "$cc" in
+       *-gcc*|*-g++*) # A cross-compiling gcc, probably.
+           # arm-linux-androideabi-gcc  -> arm-linux-androideabi
+           # x86_64-w64-mingw32-gcc.exe -> x86_64-w64-mingw32
+           targetarch=`$echo $cc|$sed 's/-g[c\+][c\+].*$//'`
+           ar=`$echo $cc|$sed 's/-g[c\+][c\+]/-ar/'`
+           # leave out ld, choosing it is more complex
+           nm=`$echo $cc|$sed 's/-g[c\+][c\+]/-nm/'`
+           ranlib=`$echo $cc|$sed 's/-g[c\+][c\+]/-ranlib/'`
+           # We are in a weird spot. Just before us, some values
+           # were 'saved', to be restored after the hints are
+           # run.  This means that the changes we made to ar,
+           # nm and ranlib will get reverted.
+           # To avoid that, we hijack the saving mechanism and
+           # have it save our new values.
+           for file in ar nm ranlib; do
+               eval xxx=\$$file
+               eval $file=$xxx$_exe
+               eval _$file=$xxx
+           done
+       ;;
        esac
        case "$targetarch" in
        '') echo "Targetarch not defined." >&4; croak=y ;;
-        *)  echo "Using targetarch $targetarch." >&4 ;;
+       *)  echo "Using targetarch $targetarch." >&4 ;;
        esac
        case "$targethost" in
        '') echo "Targethost not defined." >&4; croak=y ;;
-        *)  echo "Using targethost $targethost." >&4
+       *)  echo "Using targethost $targethost." >&4
        esac
        locincpth=' '
        loclibpth=' '
        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"
+    ;;
+esac
+
+: Define -Dtargethost=somecomputer to run compiled tests on another machine
+case "$targethost" in
+    '') echo "Checking for cross-compile" >&4
+    case "$usecrosscompile$multiarch" in
+       *$define*) echo "Skipping the try tests in the rest of Configure as no targethost was defined when cross-compiling" >&4
+         if [ -f Makefile ]; then
+           echo " "
+           echo "Now you must ensure config.sh, config.h and the generated headers exist and run a $make."
+         else
+           echo "Configure done."
+         fi
+       exit 0
+       ;;
+     *) echo "No targethost for running compiler tests against defined, running locally" >&4
+        run=''
+        to=:
+        from=:
+        ;;
+    esac
+    ;;
+    *) echo "Using targethost $targethost." >&4
        case "$src" in
        /*) run=$src/Cross/run
            targetmkdir=$src/Cross/mkdir
@@ -2870,18 +2955,23 @@ $define|true|[yY]*)
        case "$targetfrom" in
        '') targetfrom=scp ;;
        esac
-       run=$run-$targetrun
-       to=$to-$targetto
-       from=$from-$targetfrom
+       run=$run-$targetrun
+       to=$to-$targetto
+       from=$from-$targetfrom
        case "$targetdir" in
        '')  targetdir=/tmp
-             echo "Guessing targetdir $targetdir." >&4
-             ;;
+            echo "Guessing targetdir $targetdir." >&4
+            ;;
        esac
        case "$targetuser" in
        '')  targetuser=root
-             echo "Guessing targetuser $targetuser." >&4
-             ;;
+            echo "Guessing targetuser $targetuser." >&4
+            ;;
+       esac
+       case "$targetport" in
+       '')  targetport=22
+            echo "Guessing targetport $targetport." >&4
+            ;;
        esac
        case "$targetfrom" in
        scp)    q=-q ;;
@@ -2891,6 +2981,7 @@ $define|true|[yY]*)
        ssh|rsh)
            cat >$run <<EOF
 #!/bin/sh
+env=''
 case "\$1" in
 -cwd)
   shift
@@ -2898,18 +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
-if $test ! -f \$exe.xok; then
-  $to \$exe
-  $touch \$exe.xok
-fi
-$targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
+$to \$exe
+$targetrun -p $targetport -l $targetuser $targethost "cd \$cwd && \$env \$exe \$@"
 EOF
            ;;
+       adb)
+           $touch $run
+           ;;
        *)  echo "Unknown targetrun '$targetrun'" >&4
            exit 1
            ;;
@@ -2918,7 +3016,7 @@ EOF
        */Cross/mkdir)
            cat >$targetmkdir <<EOF
 #!/bin/sh
-$targetrun -l $targetuser $targethost "mkdir -p \$@"
+$targetrun -p $targetport -l $targetuser $targethost "mkdir -p \$@"
 EOF
            $chmod a+rx $targetmkdir
            ;;
@@ -2935,11 +3033,11 @@ do
   case "\$f" in
   /*)
     $targetmkdir \`dirname \$f\`
-    $targetto $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 $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
@@ -2975,7 +3073,7 @@ EOF
 for f in \$@
 do
   $rm -f \$f
-  $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
+  $targetfrom -P $targetport $q $targetuser@$targethost:$targetdir/\$f . || exit 1
 done
 exit 0
 EOF
@@ -3021,7 +3119,7 @@ EOF
 *)     run=''
        to=:
        from=:
-       usecrosscompile='undef'
+       usecrosscompile="$undef"
        targetarch=''
        ;;
 esac
@@ -3298,6 +3396,7 @@ EOM
                        case "$3" in
                        *)      osvers="$3" ;;
                        esac
+                       $test -f /system/lib/libandroid.so && osname=linux-android
                        ;;
                MiNT)   osname=mint
                        ;;
@@ -3447,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
 
@@ -4510,6 +4643,69 @@ 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 " "
+$echo $n "Hmm...  $c"
+dflt="$sysroot/usr/include"
+incpath=''
+mips_type=''
+if $test -f /bin/mips && /bin/mips; then
+       echo "Looks like a MIPS system..."
+       $cat >usr.c <<'EOCP'
+#ifdef SYSTYPE_BSD43
+/bsd43
+#endif
+EOCP
+       if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
+               dflt='/bsd43/usr/include'
+               incpath='/bsd43'
+               mips_type='BSD 4.3'
+       else
+               mips_type='System V'
+       fi
+       $rm -f usr.c usr.out
+       echo "and you're compiling with the $mips_type compiler and libraries."
+       xxx_prompt=y
+       echo "exit 0" >mips
+else
+       echo "Doesn't look like a MIPS system."
+       xxx_prompt=n
+       echo "exit 1" >mips
+fi
+chmod +x mips
+$eunicefix mips
+case "$usrinc" in
+'') ;;
+*) dflt="$usrinc";;
+esac
+case "$xxx_prompt" in
+y)     fn=d/
+       echo " "
+       rp='Where are the include files you want to use?'
+       . ./getfile
+       usrinc="$ans"
+       ;;
+*)     usrinc="$dflt"
+       ;;
+esac
+
 : see how we invoke the C preprocessor
 echo " "
 echo "Now, how can we feed standard input to your C preprocessor..." >&4
@@ -4658,123 +4854,78 @@ case "$cppstdin" in
 esac
 $rm -f testcpp.c testcpp.out
 
+: Adjust cppfilter for path component separator
 case "$osname" in
 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
 *)   cppfilter='' ;;
 esac
 
+: Use gcc to determine libpth and incpth
 # If using gcc or clang, we can get better values for libpth, incpth
 # and usrinc directly from the compiler.
 # Note that ccname for clang is also gcc.
 case "$ccname" in
     gcc)
-        $echo 'extern int foo;' > try.c
-        set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
-        shift
-        if $test $# -gt 0; then
-            incpth="$incpth $*"
-            incpth="`$echo $incpth|$sed 's/^ //'`"
-            for i in $*; do
-                j="`$echo $i|$sed 's,/include$,/lib,'`"
-                if $test -d $j; then
-                    libpth="$libpth $j"
-                fi
-            done
-            libpth="`$echo $libpth|$sed 's/^ //'`"
-            for xxx in $libpth $loclibpth $plibpth $glibpth; do
-                if $test -d $xxx; then
-                    case " $libpth " in
-                    *" $xxx "*) ;;
-                    *) libpth="$libpth $xxx";;
-                    esac
-                fi
-            done
-        fi
-        $rm -f try.c
-        case "$usrinc" in
-        '') for i in $incpth; do
-                if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
-                    usrinc="$i"
-                    break
-                fi
-            done
-            ;;
-        esac
-        
-        case "$usecrosscompile" in
-        $define|true|[yY]*)
-            case "$incpth" in
-                '') echo "Incpth not defined." >&4; croak=y ;;
-                *)  echo "Using incpth '$incpth'." >&4 ;;
-            esac
-            case "$libpth" in
-                '') echo "Libpth not defined." >&4; croak=y ;;
-                *)  echo "Using libpth '$libpth'." >&4 ;;
-            esac
-            case "$usrinc" in
-                '') echo "Usrinc not defined." >&4; croak=y ;;
-                *)  echo "Using usrinc $usrinc." >&4 ;;
-            esac
-            case "$croak" in
-                y) 
-                if test "X$sysroot" = X; then
-                    echo "Cannot continue, aborting." >&4; exit 1
-                else
-                    echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
-                fi
-                ;;
-            esac
-            ;;
-        esac
-    ;;
-esac
-
-: What should the include directory be ?
-: Use sysroot if set, so findhdr looks in the right place.
-echo " "
-$echo $n "Hmm...  $c"
-dflt="$sysroot/usr/include"
-incpath=''
-mips_type=''
-if $test -f /bin/mips && /bin/mips; then
-       echo "Looks like a MIPS system..."
-       $cat >usr.c <<'EOCP'
-#ifdef SYSTYPE_BSD43
-/bsd43
-#endif
-EOCP
-       if $cc $cppflags -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
-               dflt='/bsd43/usr/include'
-               incpath='/bsd43'
-               mips_type='BSD 4.3'
-       else
-               mips_type='System V'
+       $echo 'extern int foo;' > try.c
+       set X `$cppstdin -v try.c 2>&1 | $awk '/^#include </,/^End of search /'|$cppfilter $grep '/include'`
+       shift
+       if $test $# -gt 0; then
+           incpth="$incpth $*"
+           incpth="`$echo $incpth|$sed 's/^ //'`"
+           for i in $*; do
+               j="`$echo $i|$sed 's,/include$,/lib,'`"
+               if $test -d $j; then
+                   libpth="$libpth $j"
+               fi
+           done
+           libpth="`$echo $libpth|$sed 's/^ //'`"
+           for xxx in $libpth $loclibpth $plibpth $glibpth; do
+               if $test -d $xxx; then
+                   case " $libpth " in
+                   *" $xxx "*) ;;
+                   *) libpth="$libpth $xxx";;
+                   esac
+               fi
+           done
        fi
-       $rm -f usr.c usr.out
-       echo "and you're compiling with the $mips_type compiler and libraries."
-       xxx_prompt=y
-       echo "exit 0" >mips
-else
-       echo "Doesn't look like a MIPS system."
-       xxx_prompt=n
-       echo "exit 1" >mips
-fi
-chmod +x mips
-$eunicefix mips
-case "$usrinc" in
-'') ;;
-*) dflt="$usrinc";;
-esac
-case "$xxx_prompt" in
-y)     fn=d/
-       echo " "
-       rp='Where are the include files you want to use?'
-       . ./getfile
-       usrinc="$ans"
-       ;;
-*)     usrinc="$dflt"
-       ;;
+       $rm -f try.c
+       case "$usrinc" in
+       '') for i in $incpth; do
+               if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
+                   usrinc="$i"
+                   break
+               fi
+           done
+           ;;
+       esac
+
+       case "$usecrosscompile" in
+       $define|true|[yY]*)
+           case "$incpth" in
+               '') echo "Incpth not defined." >&4; croak=y ;;
+               *)  echo "Using incpth '$incpth'." >&4 ;;
+           esac
+           case "$libpth" in
+               '') echo "Libpth not defined." >&4; croak=y ;;
+               *)  echo "Using libpth '$libpth'." >&4 ;;
+           esac
+           case "$usrinc" in
+               '') echo "Usrinc not defined." >&4; croak=y ;;
+               *)  echo "Using usrinc $usrinc." >&4 ;;
+           esac
+           case "$croak" in
+               y)
+               if test "X$sysroot" = X; then
+                   echo "Cannot continue, aborting." >&4; exit 1
+               else
+                   echo "Cross-compiling using sysroot $sysroot, failing to guess inc/lib paths is not fatal" >&4
+               fi
+               ;;
+           esac
+           ;;
+       esac
+    ;;
 esac
 
 : Default value for incpth is just usrinc
@@ -4785,8 +4936,8 @@ esac
 : Set private lib path
 case "$plibpth" in
 '') if ./mips; then
-               plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
-       fi;;
+       plibpth="$incpath/usr/lib $sysroot/usr/local/lib $sysroot/usr/ccs/lib"
+    fi;;
 esac
 case "$libpth" in
 ' ') dlist='';;
@@ -4814,7 +4965,7 @@ Say "none" for none.
 EOM
 
 if test "X$sysroot" != X; then
-  $cat <<EOM
+    $cat <<EOM
 You have set sysroot to $sysroot, please supply the directories excluding sysroot
 
 EOM
@@ -4860,10 +5011,9 @@ so="$ans"
 : Does target system insist that shared library basenames are unique
 $cat << EOM
 
-Some dynamic loaders assume that the *basename* of shared
-library filenames are globally unique.
-We'll default this to undef as we assume your system is not this
-weird. Set to defined if you're on one of them.
+Some dynamic loaders assume that the *basename* of shared library filenames
+are globally unique.  We'll default this to undef as we assume your system
+is not this weird. Set to defined if you're on one of them.
 
 EOM
 
@@ -4871,8 +5021,8 @@ dflt='n'
 rp='Make shared library basenames unique?'
 . ./myread
 case "$ans" in
-y|Y)    val="$define" ;;
-*)      val="$undef"  ;;
+y|Y) val="$define" ;;
+*)   val="$undef"  ;;
 esac
 set d_libname_unique
 eval $setvar
@@ -5151,8 +5301,9 @@ 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";
 echo "int main(void) { return 0; }" > gcctest.c;
-if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
+if $cc $_sysroot -O2 $flag -o gcctest gcctest.c 2>gcctest.out && $run ./gcctest; then
     echo "Yes, it does." 2>&1;
     if $test -s gcctest.out ; then
         echo "But your platform does not like it:";
@@ -5974,7 +6125,7 @@ int main (void)
 EOCP
        set try
        if eval $compile_ok; then
-           libcquad=`./try`
+           libcquad=`$run ./try`
            echo "Your C library's 64-bit functions are $libcquad."
        else
            echo "(I can't seem to compile the test program.)"
@@ -7842,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;
@@ -7914,15 +8065,15 @@ eval $inhdr
 echo " "
 dldir="ext/DynaLoader"
 case "$usedl" in
-$define|y|true)
+    $define|y|true)
        dflt='y'
        usedl="$define"
        ;;
-$undef|n|false)
+    $undef|n|false)
        dflt='n'
        usedl="$undef"
        ;;
-*)
+    *)
        dflt='n'
        case "$d_dlopen" in
            $define) dflt='y' ;;
@@ -7936,21 +8087,20 @@ rp="Do you wish to use dynamic loading?"
 usedl="$ans"
 bin_ELF="$undef"
 case "$ans" in
-y*) usedl="$define"
+    y*) usedl="$define"
        case "$dlsrc" in
-       '')
-               if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
-                       dflt="$dldir/dl_${osname}.xs"
+           '') if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
+                   dflt="$dldir/dl_${osname}.xs"
                elif $test "$d_dlopen" = "$define" ; then
-                       dflt="$dldir/dl_dlopen.xs"
+                   dflt="$dldir/dl_dlopen.xs"
                else
-                       dflt=''
+                   dflt=''
                fi
                ;;
-       *)      dflt="$dldir/$dlsrc"
+           *)  dflt="$dldir/$dlsrc"
                ;;
        esac
-    echo "The following dynamic loading files are available:"
+       echo "The following dynamic loading files are available:"
        : Can not go over to $dldir because getfile has path hard-coded in.
        tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
        rp="Source file to use for dynamic loading"
@@ -7968,8 +8118,8 @@ compile modules that will be used to create a shared library.
 To use no flags, say "none".
 
 EOM
-    case "$cccdlflags" in
-    '')        case "$gccversion" in
+       case "$cccdlflags" in
+           '') case "$gccversion" in
                '') case "$osname" in
                        hpux)   dflt='+z' ;;
                        next)   dflt='none' ;;
@@ -7978,47 +8128,47 @@ EOM
                        sunos)  dflt='-pic' ;;
                        *)      dflt='none' ;;
                    esac
-                       ;;
+                   ;;
                *)  case "$osname" in
-                       darwin) dflt='none' ;;
+                       darwin) dflt='none' ;;
                        *linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
                        *)      dflt='-fpic' ;;
                    esac ;;
-           esac ;;
-       ' ') dflt='none' ;;
-    *) dflt="$cccdlflags" ;;
-    esac
-    
-    case "$dflt" in
-    none) dflt='' ;;
-    esac
-    
-    # If -Dsysroot was specified, now's the time to add it
-    # to cccdlflags
-    if test "X$sysroot" != X; then
-        case "$gccversion" in
-        '') ;;
-        *)  case "$dflt" in
-                *sysroot*) ;;
-                'undef'|*)
-                    dflt="$dflt --sysroot=$sysroot" ;;
-            esac
-            ;;
-        esac
-    fi
-    
-    case "$dflt" in
-    '') dflt='none';;
-    esac
-    
-    rp="Any special flags to pass to $cc -c to compile shared library modules?"
-    . ./myread
-    case "$ans" in
-    none) cccdlflags=' ' ;;
-    *) cccdlflags="$ans" ;;
-    esac
+               esac ;;
+           ' ') dflt='none' ;;
+           *)   dflt="$cccdlflags" ;;
+       esac
+
+       case "$dflt" in
+           none) dflt='' ;;
+       esac
+
+       # If -Dsysroot was specified, now's the time to add it
+       # to cccdlflags
+       if test "X$sysroot" != X; then
+           case "$gccversion" in
+               '') ;;
+               *)  case "$dflt" in
+                       *sysroot*) ;;
+                       'undef'|*)
+                           dflt="$dflt --sysroot=$sysroot" ;;
+                   esac
+                   ;;
+           esac
+       fi
 
-    cat << EOM
+       case "$dflt" in
+           '') dflt='none';;
+       esac
+
+       rp="Any special flags to pass to $cc -c to compile shared library modules?"
+       . ./myread
+       case "$ans" in
+           none) cccdlflags=' ' ;;
+           *)    cccdlflags="$ans" ;;
+       esac
+
+       cat << EOM
 
 Some systems use ld to create libraries that can be dynamically loaded,
 while other systems (such as those using ELF) use $cc.
@@ -8038,41 +8188,40 @@ EOM
 #include <unistd.h>
 #endif
 int main() {
-       char b[4];
-       int i = open("a.out",O_RDONLY);
-       if(i == -1)
-               exit(1); /* fail */
-       if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
-               exit(0); /* succeed (yes, it is ELF) */
-       else
-               exit(1); /* fail */
+    char b[4];
+    int i = open("a.out",O_RDONLY);
+    if(i == -1)
+       exit(1); /* fail */
+    if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
+       exit(0); /* succeed (yes, it is ELF) */
+    exit(1); /* fail */
 }
 EOM
        if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
-               bin_ELF="$define"
+           bin_ELF="$define"
        fi
        $rm_try
 
        case "$ld" in
-       '')     if $test $bin_ELF = "$define"; then
-                       cat <<EOM
+           '') if $test $bin_ELF = "$define"; then
+                   cat <<EOM
 You appear to have ELF support.  I'll use $cc to build dynamic libraries.
 EOM
-                       dflt="$cc"
+                   dflt="$cc"
                else
-                       echo "I'll use ld to build dynamic libraries."
-                       dflt='ld'
+                   echo "I'll use ld to build dynamic libraries."
+                   dflt='ld'
                fi
                ;;
-       *)      dflt="$ld"
+           *)  dflt="$ld"
                ;;
        esac
 
-    rp="What command should be used to create dynamic libraries?"
-    . ./myread
+       rp="What command should be used to create dynamic libraries?"
+       . ./myread
        ld="$ans"
 
-    cat << EOM
+       cat << EOM
 
 Some systems may require passing special flags to $ld to create a
 library that can be dynamically loaded.  If your ld flags include
@@ -8081,86 +8230,83 @@ search path, you may need to specify those -L options here as well.  To
 use no flags, say "none".
 
 EOM
-    case "$lddlflags" in
-    '') case "$osname" in
-                       haiku) dflt='-shared' ;;
-                       hpux) dflt='-b';
-                             case "$gccversion" in
+       case "$lddlflags" in
+           '') case "$osname" in
+                   haiku) dflt='-shared' ;;
+                   hpux) dflt='-b';
+                         case "$gccversion" in
                              '') dflt="$dflt +vnocompatwarnings" ;;
-                             esac
-                             ;;
-                       *linux*|irix*|gnu*)  dflt="-shared $optimize" ;;
-                       next)  dflt='none' ;;
-                       solaris) # See [perl #66604].
-                               # On Solaris 11, gcc -m64 on amd64 
-                               # appears not to understand -G.  gcc versions at
-                               # least as old as 3.4.3 support -shared, so just
-                               # use that with Solaris 11 and later, but keep
-                               # the old behavior for older Solaris versions.
-                               case "$gccversion" in
-                                       '') dflt='-G' ;;
-                                       *)      case "$osvers" in
-                                                       2.?|2.10) dflt='-G' ;;
-                                                       *) dflt='-shared' ;;
-                                               esac
-                                               ;;
-                               esac
-                               ;;
-                       sunos) dflt='-assert nodefinitions' ;;
-                       svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
-               *)     dflt='none' ;;
-                       esac
-                       ;;
-    *) dflt="$lddlflags" ;;
-    esac
+                         esac
+                         ;;
+                   *linux*|irix*|gnu*)  dflt="-shared $optimize" ;;
+                   next)  dflt='none' ;;
+                   solaris) # See [perl #66604].
+                           # On Solaris 11, gcc -m64 on amd64
+                           # appears not to understand -G.  gcc versions at
+                           # least as old as 3.4.3 support -shared, so just
+                           # use that with Solaris 11 and later, but keep
+                           # the old behavior for older Solaris versions.
+                           case "$gccversion" in
+                               '') dflt='-G' ;;
+                               *)  case "$osvers" in
+                                       2.?|2.10) dflt='-G' ;;
+                                       *) dflt='-shared' ;;
+                                   esac
+                                   ;;
+                           esac
+                           ;;
+                   sunos) dflt='-assert nodefinitions' ;;
+                   svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
+                   *)     dflt='none' ;;
+               esac
+               ;;
+           *) dflt="$lddlflags" ;;
+       esac
 
-    : Only do this for gcc, since, for example, qcc has no concept
-    : of --sysroot.
-    if $test "X$sysroot" != X; then
-        case "$gccversion" in
-        '') ;;
-        *)
-               dflt="$dflt --sysroot $sysroot"
-        ;;
-        esac
-    fi
+       : Only do this for gcc, since, for example, qcc has no concept
+       : of --sysroot.
+       if $test "X$sysroot" != X; then
+           case "$gccversion" in
+               '') ;;
+               *)  dflt="$dflt --sysroot $sysroot" ;;
+           esac
+       fi
 
        : Try to guess additional flags to pick up local libraries.
        : Be careful not to append to a plain 'none'
        case "$dflt" in
-       none) dflt='' ;;
+           none) dflt='' ;;
        esac
        for thisflag in $ldflags; do
-               case "$thisflag" in
+           case "$thisflag" in
                -L*|-R*|-Wl,-R*)
-                       case " $dflt " in
+                   case " $dflt " in
                        *" $thisflag "*) ;;
                        *) dflt="$dflt $thisflag" ;;
-                       esac
-                       ;;
-               esac
+                   esac
+                   ;;
+           esac
        done
 
        case "$dflt" in
-       ''|' ') dflt='none' ;;
+           ''|' ') dflt='none' ;;
        esac
 
        case "$ldflags" in
-       *-fstack-protector*)
-           case "$dflt" in
-                       *-fstack-protector*) ;; # Don't add it again
-                       *) dflt="$dflt -fstack-protector" ;; 
+           *-fstack-protector*)
+               case "$dflt" in
+                   *-fstack-protector*) ;; # Don't add it again
+                   *) dflt="$dflt -fstack-protector" ;;
                esac
                ;;
        esac
 
-
-    rp="Any special flags to pass to $ld to create a dynamically loaded library?"
-    . ./myread
-    case "$ans" in
-    none) lddlflags=' ' ;;
-    *) lddlflags="$ans" ;;
-    esac
+       rp="Any special flags to pass to $ld to create a dynamically loaded library?"
+       . ./myread
+       case "$ans" in
+           none) lddlflags=' ' ;;
+           *) lddlflags="$ans" ;;
+       esac
 
        cat <<EOM
 
@@ -8169,56 +8315,57 @@ the resulting executable will use dynamic linking.  To use no flags,
 say "none".
 
 EOM
-    case "$ccdlflags" in
-    '') case "$osname" in
-           *linux*|hpux|gnu*)  dflt='-Wl,-E' ;;
-           next|sunos) dflt='none' ;;
-           *)          dflt='none' ;;
-           esac ;;
-    ' ')  dflt='none' ;;
-    *)  dflt="$ccdlflags" ;;
-    esac
-    rp="Any special flags to pass to $cc to use dynamic linking?"
-    . ./myread
-    case "$ans" in
-    none) ccdlflags=' ' ;;
-    *) ccdlflags="$ans" ;;
-    esac
-    ;;
-*)  usedl="$undef"
+       case "$ccdlflags" in
+           '') case "$osname" in
+                   *linux*|hpux|gnu*) dflt='-Wl,-E' ;;
+                   next|sunos)      dflt='none'   ;;
+                   *)               dflt='none'   ;;
+               esac ;;
+           ' ') dflt='none' ;;
+           *)   dflt="$ccdlflags" ;;
+       esac
+       rp="Any special flags to pass to $cc to use dynamic linking?"
+       . ./myread
+       case "$ans" in
+           none) ccdlflags=' ' ;;
+           *)    ccdlflags="$ans" ;;
+       esac
+       ;;
+
+    *)  usedl="$undef"
        ld='ld'
-    dlsrc='dl_none.xs'
-    lddlflags=''
-    ccdlflags=''
-    ;;
+       dlsrc='dl_none.xs'
+       lddlflags=''
+       ccdlflags=''
+       ;;
 esac
 
 ld_can_script="$undef"
 case "$bin_ELF$usedl" in
-$define$define)
-    # Abuse try.h and a.out names for neat cleanup
-    $cat >try.c <<EOM
+    $define$define)
+       # Abuse try.h and a.out names for neat cleanup
+       $cat >try.c <<EOM
 void foo() {}
 void bar() {}
 EOM
-    $cat >try.h <<EOM
+       $cat >try.h <<EOM
 LIBTEST_42 {
  global:
   foo;
  local: *;
  };
 EOM
-    if $cc $cccdlflags $ccdlflags $ccflags \
-           $ldflags $lddlflags -o a.out try.c \
-           -Wl,--version-script=try.h >/dev/null 2>&1 \
-       &&  $test -s a.out ; then
-       echo "ld supports scripting" >&4
-       ld_can_script="$define"
-    else
-       echo "ld does not support scripting" >&4
-    fi
-    $rm_try
-    ;;
+       if $cc $cccdlflags $ccdlflags $ccflags \
+              $ldflags $lddlflags -o a.out try.c \
+              -Wl,--version-script=try.h >/dev/null 2>&1 \
+          &&  $test -s a.out ; then
+           echo "ld supports scripting" >&4
+           ld_can_script="$define"
+       else
+           echo "ld does not support scripting" >&4
+       fi
+       $rm_try
+       ;;
 esac
 
 : Do we want a shared libperl?
@@ -11378,57 +11525,57 @@ sockethdr=''
 echo " "
 $echo $n "Hmm... $c" >&4
 if set socket val -f d_socket; eval $csym; $val; then
+    echo "Looks like you have Berkeley networking support." >&4
+    d_socket="$define"
+    if set setsockopt val -f; eval $csym; $val; then
+       d_oldsock="$undef"
+    else
+       echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
+       d_oldsock="$define"
+    fi
+else
+    if $contains socklib libc.list >/dev/null 2>&1; then
        echo "Looks like you have Berkeley networking support." >&4
        d_socket="$define"
-       if set setsockopt val -f; eval $csym; $val; then
-               d_oldsock="$undef"
-       else
-               echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
-               d_oldsock="$define"
-       fi
-else
-       if $contains socklib libc.list >/dev/null 2>&1; then
-               echo "Looks like you have Berkeley networking support." >&4
-               d_socket="$define"
-               : we will have to assume that it supports the 4.2 BSD interface
-               d_oldsock="$undef"
+       : we will have to assume that it supports the 4.2 BSD interface
+       d_oldsock="$undef"
+    else
+       echo "You don't have Berkeley networking in libc$_a..." >&4
+       if test "X$d_socket" = "X$define"; then
+           echo "...but you seem to believe that you have sockets." >&4
        else
-               echo "You don't have Berkeley networking in libc$_a..." >&4
-               if test "X$d_socket" = "X$define"; then
-                  echo "...but you seem to believe that you have sockets." >&4
-               else
-                       for net in net socket
-                       do
-                               if test -f $sysroot/usr/lib/lib$net$_a; then
-                                       ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) ||  \
-                                       $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
-                                       if $contains socket libc.list >/dev/null 2>&1; then
-                                               d_socket="$define"
-                                               socketlib="-l$net"
-                                               case "$net" in
-                                               net)
-                                                       echo "...but the Wollongong group seems to have hacked it in." >&4
-                                                       sockethdr="-I$sysroot/usr/netinclude"
-                                                       ;;
-                                               esac
-                                               echo "Found Berkeley sockets interface in lib$net." >&4
-                                               if $contains setsockopt libc.list >/dev/null 2>&1; then
-                                                       d_oldsock="$undef"
-                                               else
-                                                       echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
-                                                       d_oldsock="$define"
-                                               fi
-                                               break
-                                       fi
-                               fi
-                       done
-                       if test "X$d_socket" != "X$define"; then
-                          echo "or anywhere else I see." >&4
-                          d_socket="$undef"
-                          d_oldsock="$undef"
+           for net in net socket
+           do
+               if test -f $sysroot/usr/lib/lib$net$_a; then
+                   ( ($nm $nm_opt $sysroot/usr/lib/lib$net$_a | eval $nm_extract) ||  \
+                   $ar t $sysroot/usr/lib/lib$net$_a) 2>/dev/null >> libc.list
+                   if $contains socket libc.list >/dev/null 2>&1; then
+                       d_socket="$define"
+                       socketlib="-l$net"
+                       case "$net" in
+                       net)
+                           echo "...but the Wollongong group seems to have hacked it in." >&4
+                           sockethdr="-I$sysroot/usr/netinclude"
+                           ;;
+                       esac
+                       echo "Found Berkeley sockets interface in lib$net." >&4
+                       if $contains setsockopt libc.list >/dev/null 2>&1; then
+                           d_oldsock="$undef"
+                       else
+                           echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
+                           d_oldsock="$define"
                        fi
+                       break
+                   fi
                fi
+           done
+           if test "X$d_socket" != "X$define"; then
+              echo "or anywhere else I see." >&4
+              d_socket="$undef"
+              d_oldsock="$undef"
+           fi
        fi
+    fi
 fi
 
 : see if socketpair exists
@@ -11448,7 +11595,7 @@ return (sa.sa_len);
 EOF
 val="$undef"
 set try; if eval $compile; then
-       val="$define"
+    val="$define"
 fi
 set d_sockaddr_sa_len; eval $setvar
 $rm_try
@@ -11466,7 +11613,7 @@ return (sin6.sin6_family);
 EOF
 val="$undef"
 set try; if eval $compile; then
-       val="$define"
+    val="$define"
 fi
 set d_sockaddr_in6; eval $setvar
 $rm_try
@@ -11484,7 +11631,7 @@ return (sin6.sin6_scope_id);
 EOF
 val="$undef"
 set try; if eval $compile; then
-       val="$define"
+    val="$define"
 fi
 set d_sin6_scope_id; eval $setvar
 $rm_try
@@ -11538,7 +11685,7 @@ return (mreq.ipv6mr_interface);
 EOF
 val="$undef"
 set try; if eval $compile; then
-       val="$define"
+    val="$define"
 fi
 set d_ipv6_mreq; eval $setvar
 $rm_try
@@ -11564,20 +11711,20 @@ $rm_try
 echo " "
 echo "Checking the availability of certain socket constants..." >&4
 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
-       enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
-       $cat >try.c <<EOF
+    enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
+    $cat >try.c <<EOF
 #include <sys/types.h>
 #include <sys/socket.h>
 int main() {
     int i = $ENUM;
 }
 EOF
-       val="$undef"
-       set try; if eval $compile; then
-               val="$define"
-       fi
-       set d_${enum}; eval $setvar
-       $rm_try
+    val="$undef"
+    set try; if eval $compile; then
+       val="$define"
+    fi
+    set d_${enum}; eval $setvar
+    $rm_try
 done
 
 : see if this is a sys/uio.h system
@@ -12915,7 +13062,7 @@ EOCP
                echo "$startsh" >mtry
                echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
                chmod +x mtry
-               ./mtry >/dev/null 2>&1
+               $run ./mtry >/dev/null 2>&1
                case $? in
                0) eagain=`$cat try.out`;;
                1) echo "Could not perform non-blocking setting!";;
@@ -19073,33 +19220,22 @@ Revision='$Revision'
 
 : check for alignment requirements
 echo " "
-case "$usecrosscompile" in
-*$define*)
-       $cat <<EOM
-You seem to be cross-compiling.  Skipping the memory alignment check.
-
-EOM
-       case "$alignbytes" in
-       '') alignbytes=8 ;;
-       esac
-       ;;
-*)
-       case "$alignbytes" in
-       '') echo "Checking alignment constraints..." >&4
-               if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
-                       $cat >try.c <<'EOCP'
+case "$alignbytes" in
+    '') echo "Checking alignment constraints..." >&4
+       if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
+           $cat >try.c <<'EOCP'
 typedef long double NV;
 EOCP
-               else
-                       $cat >try.c <<'EOCP'
+       else
+           $cat >try.c <<'EOCP'
 typedef double NV;
 EOCP
-               fi
-               $cat >>try.c <<'EOCP'
+       fi
+       $cat >>try.c <<'EOCP'
 #include <stdio.h>
 struct foobar {
-       char foo;
-       NV bar;
+    char foo;
+    NV bar;
 } try_algn;
 int main()
 {
@@ -19107,35 +19243,32 @@ int main()
     return(0);
 }
 EOCP
-               set try
-               if eval $compile_ok; then
-                       dflt=`$run ./try`
-               else
-                       dflt='8'
-                       echo "(I can't seem to compile the test program...)"
+       set try
+       if eval $compile_ok; then
+           dflt=`$run ./try`
+       else
+           dflt='8'
+           echo "(I can't seem to compile the test program...)"
+       fi
+       case "$multiarch" in
+           *$define*)
+               : The usual safe value is 8, but Darwin with -Duselongdouble
+               : needs 16.  Hence, we will take 8 as a minimum, but allow
+               : Configure to pick a larger value if needed.
+               if $test "$dflt" -lt 8; then
+                   dflt='8'
+                   echo "Setting alignment to 8 for multiarch support.">&4
                fi
-               case "$multiarch" in
-               *$define*)
-                       : The usual safe value is 8, but Darwin with -Duselongdouble
-                       : needs 16.  Hence, we will take 8 as a minimum, but allow
-                       : Configure to pick a larger value if needed.
-                       if $test "$dflt" -lt 8; then
-                           dflt='8'
-                               echo "Setting alignment to 8 for multiarch support.">&4
-                       fi
-                       ;;
-               esac
-               ;;
-       *) dflt="$alignbytes"
                ;;
        esac
-       rp="Doubles must be aligned on a how-many-byte boundary?"
-       . ./myread
-       alignbytes="$ans"
-       $rm_try
+       ;;
+    *) dflt="$alignbytes"
        ;;
 esac
-
+rp="Doubles must be aligned on a how-many-byte boundary?"
+. ./myread
+alignbytes="$ans"
+$rm_try
 
 : set the base revision
 baserev=5.0
@@ -19541,7 +19674,7 @@ if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
     output=''
     set try -DTRY_FPUTC
     if eval $compile; then
-           $run ./try 2>/dev/null
+           $run ./try 2>/dev/null
            code="$?"
            $from try.out
            if $test ! -s try.out -a "X$code" = X42; then
@@ -19552,7 +19685,7 @@ if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
     '')
            set try -DTRY_FPRINTF
            if eval $compile; then
-                   $run ./try 2>/dev/null
+                   $run ./try 2>/dev/null
                    code="$?"
                    $from try.out
                    if $test ! -s try.out -a "X$code" = X42; then
@@ -19566,7 +19699,7 @@ fi
 case "$fflushNULL" in
 '')    set try -DTRY_FFLUSH_NULL $output
        if eval $compile; then
-               $run ./try 2>/dev/null
+               $run ./try 2>/dev/null
                code="$?"
                $from try.out
                if $test -s try.out -a "X$code" = X42; then
@@ -19597,43 +19730,44 @@ main(int argc, char **argv)
     int i;
     char *bp = buf;
     while (1) {
-        while ((i = getc(stdin)) != -1
-               && (*bp++ = i) != '\n'
-               && bp < &buf[1024])
-       /* DO NOTHING */ ;
-        *bp = '\0';
-        fprintf(stdout, "%s", buf);
-        fflush(NULL);
-        if (i == -1)
+       while ((i = getc(stdin)) != -1
+              && (*bp++ = i) != '\n'
+              && bp < &buf[1024])
+       /* DO NOTHING */ ;
+       *bp = '\0';
+       fprintf(stdout, "%s", buf);
+       fflush(NULL);
+       if (i == -1)
            return 0;
-        bp = buf;
+       bp = buf;
     }
 }
 EOCP
-                fflushNULL="$define"
-                set tryp
-                if eval $compile; then
-                    $rm -f tryp.out
-                    # 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
-                    else
-                        $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
+               fflushNULL="$define"
+               set tryp
+               if eval $compile; then
+                   $rm -f tryp.out
+                   # 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
+                       $to tryp
+                       $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
+                   else
+                       $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
 fflush(NULL) seems to behave okay with input streams.
 EOM
                        fflushNULL="$define"
-                    else
+                   else
                        $cat >&4 <<EOM
 Ouch, fflush(NULL) clobbers input pipes!  We will not use it.
 EOM
-                        fflushNULL="$undef"
-                    fi
-                fi
-               $rm -f core tryp.c tryp.core core.tryp.*
+                       fflushNULL="$undef"
+                   fi
+               fi
+               $rm -f core tryp.c tryp.core core.tryp.*
                ;;
        '')     $cat >&4 <<EOM
 Your fflush(NULL) isn't working (contrary to ANSI C).
@@ -19684,12 +19818,13 @@ EOCP
        set tryp
        if eval $compile; then
            $rm -f tryp.out
-            if $test "X$targethost" != X; then
-                $to tryp.c
-                $run ./tryp \< tryp.c 2>/dev/null > tryp.out
-            else
-                $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
-            fi
+           if $test "X$targethost" != X; then
+               $to tryp.c
+               $to tryp
+               $run "cat tryp.c | ./tryp " 2>/dev/null > tryp.out
+           else
+               $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
 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
@@ -22056,50 +22191,50 @@ val="$undef"
 val2="$undef"
 val3="$undef"
 if $test `./findhdr termios.h`; then
-       set tcsetattr i_termios
-       eval $inlibc
-       val3="$i_termios"
+    set tcsetattr i_termios
+    eval $inlibc
+    val3="$i_termios"
 fi
 echo " "
 case "$val3" in
-"$define") echo "You have POSIX termios.h... good!" >&4;;
-*) if ./Cppsym pyr; then
-               case "`/bin/universe`" in
+    "$define") echo "You have POSIX termios.h... good!" >&4;;
+    *)  if ./Cppsym pyr; then
+           case "`$run /bin/universe`" in
                ucb) if $test `./findhdr sgtty.h`; then
-                               val2="$define"
-                               echo "<sgtty.h> found." >&4
-                       else
-                               echo "System is pyramid with BSD universe."
-                               ./warn "<sgtty.h> not found--you could have problems."
-                       fi;;
-               *) if $test `./findhdr termio.h`; then
-                               val="$define"
-                               echo "<termio.h> found." >&4
-                       else
-                               echo "System is pyramid with USG universe."
-                               ./warn "<termio.h> not found--you could have problems."
-                       fi;;
-               esac
-       elif ./usg; then
-               if $test `./findhdr termio.h`; then
-                       echo "<termio.h> found." >&4
-                       val="$define"
-               elif $test `./findhdr sgtty.h`; then
-                       echo "<sgtty.h> found." >&4
                        val2="$define"
-               else
-                       ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
-               fi
-       else
-               if $test `./findhdr sgtty.h`; then
                        echo "<sgtty.h> found." >&4
-                       val2="$define"
-               elif $test `./findhdr termio.h`; then
-                       echo "<termio.h> found." >&4
+                   else
+                       echo "System is pyramid with BSD universe."
+                       ./warn "<sgtty.h> not found--you could have problems."
+                   fi;;
+               *)  if $test `./findhdr termio.h`; then
                        val="$define"
-               else
-                       ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
-               fi
+                       echo "<termio.h> found." >&4
+                   else
+                       echo "System is pyramid with USG universe."
+                       ./warn "<termio.h> not found--you could have problems."
+                   fi;;
+           esac
+       elif ./usg; then
+           if $test `./findhdr termio.h`; then
+               echo "<termio.h> found." >&4
+               val="$define"
+           elif $test `./findhdr sgtty.h`; then
+               echo "<sgtty.h> found." >&4
+               val2="$define"
+           else
+               ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
+           fi
+       else
+           if $test `./findhdr sgtty.h`; then
+               echo "<sgtty.h> found." >&4
+               val2="$define"
+           elif $test `./findhdr termio.h`; then
+               echo "<termio.h> found." >&4
+               val="$define"
+           else
+               ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
+           fi
        fi;;
 esac
 set i_termio; eval $setvar
@@ -23367,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'
@@ -23469,6 +23607,7 @@ ignore_versioned_solibs='$ignore_versioned_solibs'
 inc_version_list='$inc_version_list'
 inc_version_list_init='$inc_version_list_init'
 incpath='$incpath'
+incpth='$incpth'
 inews='$inews'
 initialinstalllocation='$initialinstalllocation'
 installarchlib='$installarchlib'
@@ -23740,6 +23879,12 @@ sysroot='$sysroot'
 tail='$tail'
 tar='$tar'
 targetarch='$targetarch'
+targetdir='$targetdir'
+targetenv='$targetenv'
+targethost='$targethost'
+targetmkdir='$targetmkdir'
+targetport='$targetport'
+targetsh='$targetsh'
 tbl='$tbl'
 tee='$tee'
 test='$test'