re PR libgomp/29494 (libgomp build fails with missing pthread_mutexattr_settype)
[gcc.git] / libgomp / configure.tgt
1 # This is the target specific configuration file. This is invoked by the
2 # autoconf generated configure script. Putting it in a separate shell file
3 # lets us skip running autoconf when modifying target specific information.
4
5 # This file switches on the shell variable ${target}, and sets the
6 # following shell variables:
7 # config_path An ordered list of directories to search for
8 # sources and headers. This is relative to the
9 # config subdirectory of the source tree.
10 # XCFLAGS Add extra compile flags to use.
11 # XLDFLAGS Add extra link flags to use.
12
13 # Optimize TLS usage by avoiding the overhead of dynamic allocation.
14 # This does require that the library be present during process
15 # startup, so mark the library as not to be dlopened.
16 if test $have_tls = yes && test "$with_gnu_ld" = "yes"; then
17 XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
18 XLDFLAGS="${XLDFLAGS} -Wl,-z,nodlopen"
19 fi
20
21 # Since we require POSIX threads, assume a POSIX system by default.
22 config_path="posix"
23
24 # Check for futex enabled all at once.
25 if test $enable_linux_futex = yes; then
26 case "${target}" in
27
28 alpha*-*-linux*)
29 config_path="linux/alpha linux posix"
30 ;;
31
32 ia64*-*-linux*)
33 config_path="linux/ia64 linux posix"
34 ;;
35
36 powerpc*-*-linux*)
37 config_path="linux/powerpc linux posix"
38 ;;
39
40 s390*-*-linux*)
41 config_path="linux/s390 linux posix"
42 ;;
43
44 # Note that bare i386 is not included here. We need cmpxchg.
45 i[456]86-*-linux*)
46 config_path="linux/x86 linux posix"
47 if test -z "$with_arch"; then
48 XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
49 fi
50 ;;
51
52 # Similar jiggery-pokery for x86_64 multilibs, except here we
53 # can't rely on the --with-arch configure option, since that
54 # applies to the 64-bit side.
55 x86_64-*-linux*)
56 config_path="linux/x86 linux posix"
57 case " ${CC} ${CFLAGS} " in
58 *" -m32 "*)
59 XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
60 ;;
61 esac
62 ;;
63
64 # Note that sparcv7 and sparcv8 is not included here. We need cas.
65 sparcv9-*-linux* | sparc64-*-linux*)
66 echo "int i;" > conftestx.c
67 if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
68 config_path="linux/sparc linux posix"
69 case "`/usr/bin/file conftestx.o`" in
70 *32-bit*)
71 case " ${CC} ${CFLAGS}" in
72 *" -mcpu=ultrasparc"*)
73 ;;
74 *)
75 XCFLAGS="${XCFLAGS} -mcpu=v9"
76 ;;
77 esac
78 ;;
79 esac
80 fi
81 rm -f conftestx.c conftestx.o
82 ;;
83 esac
84 fi
85
86 # Other system configury
87 case "${target}" in
88
89 *-*-hpux11*)
90 # HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
91 XLDFLAGS="${XLDFLAGS} -lrt"
92 ;;
93
94 *-*-mingw32*)
95 config_path="mingw32 posix"
96 ;;
97
98 *-*-solaris2.[56]*)
99 config_path="posix95 posix"
100 XLDFLAGS="${XLDFLAGS} -lposix4"
101 ;;
102
103 *)
104 ;;
105
106 esac