This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Standardise the conditional compilation protection of ({}) from
[perl5.git] / cflags.SH
index 412beeb..4e62f92 100755 (executable)
--- a/cflags.SH
+++ b/cflags.SH
@@ -66,31 +66,31 @@ cat >_cflags.c <<__EOT__
 #ifdef I_UNISTD
 #include <unistd.h>
 #endif
-#ifdef I_SYSTYPES
+#ifdef I_SYS_TYPES
 #include <sys/types.h>
 #endif
-#ifdef I_SYSPARAM
+#ifdef I_SYS_PARAM
 #include <sys/param.h>
 #endif
-#ifdef I_SYSRESOURCE
+#ifdef I_SYS_RESOURCE
 #include <sys/resource.h>
 #endif
-#ifdef I_SYSSELECT
+#ifdef I_SYS_SELECT
 #include <sys/select.h>
 #endif
 #if defined(HAS_SOCKET) && !defined(VMS) && !defined(WIN32) /* See perl.h. */
 #include <sys/socket.h>
 #endif
-#ifdef I_SYSSTAT
+#ifdef I_SYS_STAT
 #include <sys/stat.h>
 #endif
-#ifdef I_SYSTIME
+#ifdef I_SYS_TIME
 #include <sys/time.h>
 #endif
-#ifdef I_SYSTIMES
+#ifdef I_SYS_TIMES
 #include <sys/times.h>
 #endif
-#ifdef I_SYSWAIT
+#ifdef I_SYS_WAIT
 #include <sys/wait.h>
 #endif
 /* The gcc -ansi can cause a lot of noise in Solaris because of:
@@ -134,12 +134,12 @@ case "$gccversion" in
 '') ;;
 [12]*) ;; # gcc versions 1 (gasp!) and 2 are not good for this.
 Intel*) ;; # # Is that you, Intel C++?
-*)  for opt in -ansi -pedantic -std=c89 -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat
+*)  for opt in -ansi -std=c89 -W -Wextra -Wdeclaration-after-statement -Wendif-labels -Wc++-compat
     do
        case " $ccflags " in
        *" $opt "*) ;; # Skip if already there.
        *) rm -f _cflags$_exe
-          case "`$cc $cflags $warn $opt _cflags.c -o _cflags$_exe 2>&1`" in
+          case "`$cc $cflags $warn $stdflags $opt _cflags.c -o _cflags$_exe 2>&1`" in
           *"unrecognized"*) ;;
           *"implicit declaration"*) ;; # Was something useful hidden?
           *"Invalid"*) ;;
@@ -183,7 +183,7 @@ case "$gccversion" in
     "long long")
        ccflags=`echo $ccflags|sed -e 's/-pedantic/ /' -e 's/-std=c89/ /' -e 's/-ansi/ /'`
        warn=`echo $warn|sed -e 's/-pedantic/ /' -e 's/-ansi/ /'`
-       stdflags=`echo $warn|sed -e 's/-std=c89/ /'`
+       stdflags=`echo $stdflags|sed -e 's/-std=c89/ /'`
        ;;
     esac
   fi