This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl.h: Remove ';' from 'NOOP;'
[perl5.git] / Configure
index 15549ed..16d6370 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1335,6 +1335,7 @@ archname64=''
 use64bitall=''
 use64bitint=''
 usecbacktrace=''
+usedefaultstrict=''
 dtrace=''
 usedtrace=''
 usefaststdio=''
@@ -5387,23 +5388,24 @@ default|recommended)
        # is to add the flag to the flags passed to the compiler at link time,
        # as that way the compiler can do the right implementation dependant
        # thing. (NWC)
-       case "$osname" in
-       amigaos) ;; # -fstack-protector builds but doesn't work
-       *)      case "$gccversion" in
-               ?*)     set stack-protector-strong -fstack-protector-strong
-                       eval $checkccflag
-                       case "$dflt" in
-                       *-fstack-protector-strong*) ;; # It got added.
-                       *) # Try the plain/older -fstack-protector.
-                          set stack-protector -fstack-protector
-                          eval $checkccflag
-                          ;;
-                       esac
-                       ;;
+       case "$ccflags" in
+       *-fno-stack-protector*)
+           echo "Do not add -fstack-protector nor -fstack-protector-strong" 2>&1
+           ;;
+       *) case "$gccversion" in
+          ?*)  set stack-protector-strong -fstack-protector-strong
+               eval $checkccflag
+               case "$dflt" in
+               *-fstack-protector-strong*) ;; # It got added.
+               *) # Try the plain/older -fstack-protector.
+                  set stack-protector -fstack-protector
+                  eval $checkccflag
+                  ;;
                esac
                ;;
+           esac
+           ;;
        esac
-       ;;
 esac
 
 case "$mips_type" in
@@ -16052,6 +16054,7 @@ REENTRANT_PROTO*)
 #endif
 int main()
 {
+    int result = 0;
     time_t t = time(0L);
     char w_tz[]="TZ" "=GMT+5",
         e_tz[]="TZ" "=GMT-5",
@@ -16070,8 +16073,10 @@ int main()
     localtime_r(&t, &tm_w);
 
     if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
-       return 1;
-    return 0;
+       result = 1;
+
+    free(tz_e);free(tz_w);
+    return result;
 }
 EOCP
        set try
@@ -21479,6 +21484,9 @@ int
 main(int ac, char **av)
 {
   signal(SIGSEGV, exit);
+#ifdef SIGBUS
+  signal(SIGBUS,  exit);
+#endif
 
   myprintf("%s%cs all right, then\n", "that", '\'');
   exit(0);
@@ -22654,6 +22662,34 @@ case "$uidsign" in
        ;;
 esac
 
+: Ask about strict by default.
+case "$usedefaultstrict" in
+    $define|true|[Yy]*)
+       dflt="y"
+       ;;
+    *)
+       dflt="n"
+       ;;
+    esac
+
+cat <<EOM
+
+EXPERIMENTAL: Perl can now be built with strict on by default when not
+invoked with -e or -E. This is a diagnostic tool for development.
+
+Unless you are familiar with this feature, you should probably answer 'no'.
+
+EOM
+
+rp='Would you like to build perl with strict enabled by default?'
+. ./myread
+case "$ans" in
+y|Y) val="$define" ;;
+*)   val="$undef"  ;;
+esac
+set usedefaultstrict
+eval $setvar
+
 : Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
 echo " "
 echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
@@ -25109,6 +25145,7 @@ use64bitall='$use64bitall'
 use64bitint='$use64bitint'
 usecbacktrace='$usecbacktrace'
 usecrosscompile='$usecrosscompile'
+usedefaultstrict='$usedefaultstrict'
 usedevel='$usedevel'
 usedl='$usedl'
 usedtrace='$usedtrace'