coarray_43.f90: Add "-latomic" option if libatomic_available.
[gcc.git] / libatomic / configure.tgt
index 0caa0f42ff99766d1020acd8d966509d0f3447ce..6d77c9482a5120e929870be5b4715696e1d22fab 100644 (file)
@@ -1,5 +1,5 @@
 # -*- shell-script -*-
-#  Copyright (C) 2012 Free Software Foundation, Inc.
+#  Copyright (C) 2012-2017 Free Software Foundation, Inc.
 #  Contributed by Richard Henderson <rth@redhat.com>.
 #
 #  This file is part of the GNU Atomic Library (libatomic).
 # Map the target cpu to an ARCH sub-directory.  At the same time,
 # work out any special compilation flags as necessary.
 
+# Give operating systems the opportunity to discard XCFLAGS modifications based
+# on ${target_cpu}.  For example to allow proper use of multilibs.
+configure_tgt_pre_target_cpu_XCFLAGS="${XCFLAGS}"
+
 case "${target_cpu}" in
-  alpha*)              ARCH=alpha ;;
+  alpha*)
+       # fenv.c needs this option to generate inexact exceptions.
+       XCFLAGS="${XCFLAGS} -mfp-trap-mode=sui"
+       ARCH=alpha
+       ;;
   rs6000 | powerpc*)   ARCH=powerpc ;;
   sh*)                 ARCH=sh ;;
 
   arm*)
        ARCH=arm
-       # ??? Detect when -march=armv7 is already enabled.
-       try_ifunc=yes
-       ;;
-
+       case "${target}" in
+            arm*-*-freebsd*)
+                ;;
+            *)
+                # ??? Detect when -march=armv7 is already enabled.
+                try_ifunc=yes
+                ;;
+        esac
+        ;;
   sparc)
        case " ${CC} ${CFLAGS} " in
          *" -m64 "*)
@@ -59,7 +72,7 @@ case "${target_cpu}" in
 
   i[3456]86)
        case " ${CC} ${CFLAGS} " in
-         *" -m64 "*)
+         *" -m64 "*|*" -mx32 "*)
            ;;
          *)
            if test -z "$with_arch"; then
@@ -95,24 +108,36 @@ fi
 
 # Other system configury
 case "${target}" in
-  aarch64*)
-       # This is currently not supported in AArch64.
-       UNSUPPORTED=1
-       ;;
-
   arm*-*-linux*)
        # OS support for atomic primitives.
        config_path="${config_path} linux/arm posix"
        ;;
 
   *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu \
-  | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \
+  | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* | *-*-dragonfly* \
   | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \
-  | *-*-darwin* | *-*-aix*)
+  | *-*-darwin* | *-*-aix* | *-*-cygwin*)
        # POSIX system.  The OS is supported.
        config_path="${config_path} posix"
        ;;
 
+  *-*-mingw*)
+       # OS support for atomic primitives.
+        case ${target_thread_file} in
+          win32)
+            config_path="${config_path} mingw"
+            ;;
+          posix)
+            config_path="${config_path} posix"
+            ;;
+        esac
+       ;;
+
+  *-*-rtems*)
+       XCFLAGS="${configure_tgt_pre_target_cpu_XCFLAGS}"
+       config_path="rtems"
+       ;;
+
   *-*-elf*)
        # ??? No target OS.  We could be targeting bare-metal kernel-mode,
        # or user-mode for some custom OS.  If the target supports TAS,