This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Change names of some OPpTRANS flags
[perl5.git] / Configure
index 5c02255..fad1c9f 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -657,6 +657,7 @@ d_lstat=''
 d_madvise=''
 d_malloc_good_size=''
 d_malloc_size=''
+d_malloc_usable_size=''
 d_mblen=''
 d_mbrlen=''
 d_mbrtowc=''
@@ -4169,14 +4170,9 @@ EOSC
 
 : determine root of directory hierarchy where package will be installed.
 case "$prefix" in
-'')
-       dflt=`./loc . /usr/local /usr/local /local /opt /usr`
-       ;;
-*?/)
-       dflt=`echo "$prefix" | sed 's/.$//'`
+'')    dflt=`./loc . /usr/local /usr/local /local /opt /usr`
        ;;
-*)
-       dflt="$prefix"
+*)     dflt="$prefix"
        ;;
 esac
 $cat <<EOM
@@ -4195,16 +4191,25 @@ rp='Installation prefix to use?'
 . ./getfile
 oldprefix=''
 case "$prefix" in
-'') ;;
-*)
-       case "$ans" in
+'')    ;;
+*)     case "$ans" in
        "$prefix") ;;
        *) oldprefix="$prefix";;
        esac
        ;;
 esac
-prefix="$ans"
-prefixexp="$ansexp"
+
+case "$ans" in
+*?/)   prefix=`echo "$ans" | sed 's/.$//'`
+       ;;
+*)     prefix="$ans"
+esac
+
+case "$ansexp" in
+*?/)   prefixexp=`echo "$ansexp" | sed 's/.$//'`
+       ;;
+*)     prefixexp="$ansexp"
+esac
 
 : allow them to override the AFS root
 case "$afsroot" in
@@ -7256,7 +7261,7 @@ prefixit='case "$3" in
                none)
                        eval "tp=\"\$$2\"";
                        case "$tp" in
-                       ""|" ") eval "$1=\"\$$2\"";;
+                       ""|" "|none) eval "$1=\"\$$2\"";;
                        *) eval "$1=";;
                        esac;;
                esac;;
@@ -8550,7 +8555,7 @@ EOM
        if $test "X$sysroot" != X; then
            case "$gccversion" in
                '') ;;
-               *)  dflt="$dflt --sysroot $sysroot" ;;
+               *)  dflt="$dflt --sysroot=$sysroot" ;;
            esac
        fi
 
@@ -10382,15 +10387,15 @@ esac
 $cat >>try.c <<EOP
 #ifdef TRY_gconvert
 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
-char *myname = "gconvert";
+const char *myname = "gconvert";
 #endif
 #ifdef TRY_gcvt
 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
-char *myname = "gcvt";
+const char *myname = "gcvt";
 #endif
 #ifdef TRY_qgcvt
 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
-char *myname = "qgcvt";
+const char *myname = "qgcvt";
 #define DOUBLETYPE long double
 #endif
 #ifdef TRY_sprintf
@@ -10403,7 +10408,7 @@ char *myname = "qgcvt";
 #else
 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
 #endif
-char *myname = "sprintf";
+const char *myname = "sprintf";
 #endif
 
 #ifndef DOUBLETYPE
@@ -10422,7 +10427,7 @@ char *myname = "sprintf";
 #endif
 #include <string.h>
 
-int checkit(char *expect, char *got)
+void checkit(const char *expect, char *got)
 {
     if (strcmp(expect, got)) {
                printf("%s oddity:  Expected %s, got %s\n",
@@ -10571,6 +10576,7 @@ for xxx_convert in $xxx_list; do
                fi
        else
                echo "$xxx_convert NOT found." >&4
+               xxx_convert=''
        fi
 done
 
@@ -14086,6 +14092,7 @@ $cat >try.c <<EOCP
 #include <sys/time.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <stdlib.h>
 
 int main ()
 {
@@ -16144,6 +16151,10 @@ eval $inlibc
 set malloc_good_size d_malloc_good_size
 eval $inlibc
 
+: see if malloc_usable_size exists
+set malloc_usable_size d_malloc_usable_size
+eval $inlibc
+
 : see if mblen exists
 set mblen d_mblen
 eval $inlibc
        ;;
 esac
 
-: Checking 32bit alignedness
 $cat <<EOM
 
 Checking to see whether you can access character data unalignedly...
-EOM
-case "$d_u32align" in
-'')   $cat >try.c <<EOCP
-#include <stdio.h>
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-#define U32 $u32type
-#define BYTEORDER 0x$byteorder
-#define U8 $u8type
-#include <signal.h>
-#ifdef SIGBUS
-$signal_t bletch(int s) { exit(4); }
-#endif
-int main() {
-#if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
-    volatile U8 buf[8];
-    volatile U32 *up;
-    int i;
-
-    if (sizeof(U32) != 4) {
-       printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
-       exit(1);
-    }
 
-    fflush(stdout);
-
-#ifdef SIGBUS
-    signal(SIGBUS, bletch);
-#endif
-
-    buf[0] = 0;
-    buf[1] = 0;
-    buf[2] = 0;
-    buf[3] = 1;
-    buf[4] = 0;
-    buf[5] = 0;
-    buf[6] = 0;
-    buf[7] = 1;
-
-    for (i = 0; i < 4; i++) {
-       up = (U32*)(buf + i);
-       if (! ((*up == 1 << (8*i)) ||   /* big-endian */
-              (*up == 1 << (8*(3-i)))  /* little-endian */
-             )
-          )
-       {
-           printf("read failed (%x)\n", *up);
-           exit(2);
-       }
-    }
-
-    /* write test */
-    for (i = 0; i < 4; i++) {
-       up = (U32*)(buf + i);
-       *up = 0xBeef;
-       if (*up != 0xBeef) {
-           printf("write failed (%x)\n", *up);
-           exit(3);
-       }
-    }
-
-    exit(0);
-#else
-    printf("1\n");
-    exit(1);
-#endif
-    return 0;
-}
-EOCP
-set try
-if eval $compile_ok; then
-       echo "(Testing for character data alignment may crash the test.  That's okay.)" >&4
-       $run ./try 2>&1 >/dev/null
-       case "$?" in
-       0)      cat >&4 <<EOM
-You can access character data pretty unalignedly.
-EOM
-               d_u32align="$undef"
-               ;;
-       *)      cat >&4 <<EOM
-It seems that you must access character data in an aligned manner.
+We assume only aligned access is permitted.
 EOM
-               d_u32align="$define"
-               ;;
-       esac
-else
-       rp='Can you access character data at unaligned addresses?'
-       dflt='n'
-       . ./myread
-       case "$ans" in
-       [yY]*)  d_u32align="$undef"  ;;
-       *)      d_u32align="$define" ;;
-       esac
-fi
-$rm_try
-;;
+: Checking 32bit alignedness
+: We no longer check and assume it is required.
+case "$d_u32align" in
+'') d_u32align="$define" ;;
 esac
 
 : see if ualarm exists
@@ -24294,6 +24213,7 @@ d_lstat='$d_lstat'
 d_madvise='$d_madvise'
 d_malloc_good_size='$d_malloc_good_size'
 d_malloc_size='$d_malloc_size'
+d_malloc_usable_size='$d_malloc_usable_size'
 d_mblen='$d_mblen'
 d_mbrlen='$d_mbrlen'
 d_mbrtowc='$d_mbrtowc'