This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldelta for 95309d6ba0f3
[perl5.git] / Configure
index 34dfc5f..9d91a81 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -438,14 +438,6 @@ d_dlerror=''
 d_dlopen=''
 d_dlsymun=''
 d_dosuid=''
-d_double_has_inf=''
-d_double_has_nan=''
-d_double_has_negative_zero=''
-d_double_has_subnormals=''
-d_double_style_cray=''
-d_double_style_ibm=''
-d_double_style_ieee=''
-d_double_style_vax=''
 d_suidsafe=''
 d_drand48_r=''
 drand48_r_proto=''
@@ -643,12 +635,12 @@ d_log1p=''
 d_log2=''
 d_logb=''
 d_ldexpl=''
-d_longdbl=''
 d_long_double_style_ieee=''
 d_long_double_style_ieee_doubledouble=''
 d_long_double_style_ieee_extended=''
 d_long_double_style_ieee_std=''
 d_long_double_style_vax=''
+d_longdbl=''
 longdblkind=''
 longdblsize=''
 d_longlong=''
@@ -945,6 +937,7 @@ d_wcstombs=''
 d_wcsxfrm=''
 d_wctomb=''
 d_writev=''
+default_inc_excludes_dot='undef'
 dlext=''
 bin_ELF=''
 cccdlflags=''
@@ -956,6 +949,7 @@ lddlflags=''
 usedl=''
 doublesize=''
 dtraceobject=''
+dtracexnolibs=''
 ebcdic=''
 fflushNULL=''
 fflushall=''
@@ -1133,6 +1127,14 @@ d_PRIeldbl=''
 d_PRIfldbl=''
 d_PRIgldbl=''
 d_SCNfldbl=''
+d_double_has_inf=''
+d_double_has_nan=''
+d_double_has_negative_zero=''
+d_double_has_subnormals=''
+d_double_style_cray=''
+d_double_style_ibm=''
+d_double_style_ieee=''
+d_double_style_vax=''
 doublekind=''
 sPRIEUldbl=''
 sPRIFUldbl=''
@@ -10295,7 +10297,7 @@ case "$doublekind" in
 1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
 9|10|11) d_double_style_vax=$define ;;
 12|13) d_double_style_ibm=$define ;;
-14) double_style_cray=$define ;;
+14) d_double_style_cray=$define ;;
 esac
 case "$d_double_style_ieee" in
 $define)
@@ -20625,6 +20627,34 @@ EOCP
        ;;
 esac
 
+: Include . in @INC
+$cat <<EOM
+
+Historically Perl has provided a final fallback of the current working
+directory '.' when searching for a library. This, however, can lead to
+problems when a Perl program which loads optional modules is called from
+a shared directory. This can lead to executing unexpected code.
+
+EOM
+
+# When changing to exclude by default:
+#case "$default_inc_excludes_dot" in
+#    $undef|false|[nN]*) dflt="n" ;;
+#    *)                  dflt="y" ;;
+#esac
+# For now:
+case "$default_inc_excludes_dot" in
+    $define|true|[yY]*) dflt="y" ;;
+    *)                  dflt="n" ;;
+esac
+
+rp='Exclude '.' from @INC by default? '
+. ./myread
+case "$ans" in
+    [nN]|undef) default_inc_excludes_dot="$undef"  ;;
+    *)          default_inc_excludes_dot="$define" ;;
+esac
+
 : Check what kind of inf/nan your system has
 $echo "Checking the kind of infinities and nans you have..." >&4
 $echo "(The following tests may crash.  That's okay.)" >&4
@@ -20632,8 +20662,8 @@ $cat >try.c <<EOP
 #define DOUBLESIZE $doublesize
 #$d_longdbl HAS_LONG_DOUBLE
 #ifdef HAS_LONG_DOUBLE
-#define LONGDBLSIZE $longdblsize
-#define LONGDBLKIND $longdblkind
+#define LONG_DOUBLESIZE $longdblsize
+#define LONG_DOUBLEKIND $longdblkind
 #endif
 #$i_math I_MATH
 #ifdef I_MATH
@@ -20670,16 +20700,15 @@ int main(int argc, char *argv[]) {
 #ifdef HAS_LONG_DOUBLE
    long double ldinf = (long double)exp(1e9);
    long double ldnan = (long double)sqrt(-1.0);
-#endif
-  if (argc == 2) {
-    switch (argv[1][0]) {
-    case '1': bytes(&dinf, sizeof(dinf)); break;
-    case '2': bytes(&dnan, sizeof(dnan)); break;
-#ifdef HAS_LONG_DOUBLE
 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
 /* the 80-bit long doubles might have garbage in their excess bytes */
     memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
+    memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
 # endif
+  if (argc == 2) {
+    switch (argv[1][0]) {
+    case '1': bytes(&dinf, sizeof(dinf)); break;
+    case '2': bytes(&dnan, sizeof(dnan)); break;
     case '3': bytes(&ldinf, sizeof(ldinf)); break;
     case '4': bytes(&ldnan, sizeof(ldnan)); break;
 #endif
@@ -20810,17 +20839,17 @@ else
     esac
 fi
 # In case the program crashed the values are empty, turn them undef.
-case "$dblinfbytes" in
-'') dblinfbytes=$undef ;;
+case "$doubleinfbytes" in
+'') doubleinfbytes=$undef ;;
 esac
-case "$dblnanbytes" in
-'') dblnanbytes=$undef ;;
+case "$doublenanbytes" in
+'') doublenanbytes=$undef ;;
 esac
-case "$ldblinfbytes" in
-'') ldblinfbytes=$undef ;;
+case "$longdblinfbytes" in
+'') longdblinfbytes=$undef ;;
 esac
-case "$ldblnanbytes" in
-'') ldblnanbytes=$undef ;;
+case "$longdblnanbytes" in
+'') longdblnanbytes=$undef ;;
 esac
 $rm_try
 
@@ -20938,12 +20967,38 @@ randseedtype=U32
 : object file that uses at least one of the probes defined in the .d file
 case "$usedtrace" in
 $define)
+    case "$dtracexnolibs" in
+    $define|true|[yY]*)
+        dtracexnolibs=$define
+       $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
+       ;;
+    ' '|'')
+        if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
+            dtracexnolibs=$define
+            echo "Your dtrace accepts -xnolibs"
+       elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
+            dtracexnolibs=$undef
+            echo "Your dtrace doesn't accept -xnolibs"
+       else
+             echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
+            exit 1
+       fi
+       ;;
+    *)
+        dtracexnolibs=$undef
+       $dtrace -h -s ../perldtrace.d -o perldtrace.h
+       ;;
+    esac
+    case $dtracexnolibs in
+    $define) xnolibs=-xnolibs ;;
+    *) xnolibs= ;;
+    esac
+
     case "$dtraceobject" in
     $define|true|[yY]*)
         dtraceobject=$define
         ;;
     ' '|'')
-        $dtrace -h -s ../perldtrace.d -o perldtrace.h
         $cat >try.c <<EOM
 #include "perldtrace.h"
 int main(void) {
@@ -20953,14 +21008,14 @@ int main(void) {
 EOM
         dtraceobject=$undef
         if $cc -c -o try.o $optimize $ccflags try.c \
-                    && $dtrace -G -s ../perldtrace.d try.o >/dev/null 2>&1; then
+                    && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
                 dtraceobject=$define
             echo "Your dtrace builds an object file"
         fi
-        $rm -f try.c try.o perldtrace.o
         ;;
     *) dtraceobject=$undef ;;
     esac
+    $rm -f try.c try.o perldtrace.o perldtrace.h
 esac
 
 : Determine if this is an EBCDIC system
@@ -24627,13 +24682,13 @@ d_lockf='$d_lockf'
 d_log1p='$d_log1p'
 d_log2='$d_log2'
 d_logb='$d_logb'
-d_longdbl='$d_longdbl'
-d_longlong='$d_longlong'
 d_long_double_style_ieee='$d_long_double_style_ieee'
 d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
 d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
 d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
 d_long_double_style_vax='$d_long_double_style_vax'
+d_longdbl='$d_longdbl'
+d_longlong='$d_longlong'
 d_lrint='$d_lrint'
 d_lrintl='$d_lrintl'
 d_lround='$d_lround'
@@ -24913,6 +24968,7 @@ db_prefixtype='$db_prefixtype'
 db_version_major='$db_version_major'
 db_version_minor='$db_version_minor'
 db_version_patch='$db_version_patch'
+default_inc_excludes_dot='$default_inc_excludes_dot'
 direntrytype='$direntrytype'
 dlext='$dlext'
 dlsrc='$dlsrc'
@@ -24925,6 +24981,7 @@ drand01='$drand01'
 drand48_r_proto='$drand48_r_proto'
 dtrace='$dtrace'
 dtraceobject='$dtraceobject'
+dtracexnolibs='$dtracexnolibs'
 dynamic_ext='$dynamic_ext'
 eagain='$eagain'
 ebcdic='$ebcdic'