This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Backporting work on AmigaOS
[metaconfig.git] / U / compline / ccflags.U
index caf6074..4226327 100644 (file)
@@ -45,7 +45,7 @@
 ?RCS: Revision 3.0  1993/08/18  12:05:31  ram
 ?RCS: Baseline for dist 3.0 netwide release.
 ?RCS:
-?MAKE:ccflags ldflags lkflags cppflags optimize locincpth: test cat \
+?MAKE:ccflags ldflags lkflags cppflags optimize locincpth: test cat osname \
        Myread Guess Options Oldconfig +gccversion mips_type +usrinc \
        package contains rm +cc cppstdin cppminus cpprun cpplast libpth \
        libs loclibpth hint usesocks sh run rm_try sysroot
@@ -231,9 +231,20 @@ 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 "$gccversion" in
-       ?*)     set stack-protector -fstack-protector
-               eval $checkccflag
+       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
+                       ;;
+               esac
                ;;
        esac
        ;;
@@ -384,6 +395,12 @@ case "$ldflags" in
 esac
 # See note above about -fstack-protector
 case "$ccflags" in
+*-fstack-protector-strong*)
+       case "$dflt" in
+       *-fstack-protector-strong*) ;; # Don't add it again
+       *) dflt="$dflt -fstack-protector-strong" ;;
+       esac
+       ;;
 *-fstack-protector*)
        case "$dflt" in
        *-fstack-protector*) ;; # Don't add it again