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.
16if test $have_tls = yes ; then
17  case "${target}" in
18
19    *-*-linux*)
20	XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
21	XLDFLAGS="${XLDFLAGS} -Wl,-z,nodlopen"
22	;;
23  esac
24fi
25
26# Since we require POSIX threads, assume a POSIX system by default.
27config_path="posix"
28
29# Check for futex enabled all at once.
30if test $enable_linux_futex = yes; then
31  case "${target}" in
32
33    alpha*-*-linux*)
34	config_path="linux/alpha linux posix"
35	;;
36
37    ia64*-*-linux*)
38	config_path="linux/ia64 linux posix"
39	;;
40
41    powerpc*-*-linux*)
42	config_path="linux/powerpc linux posix"
43	;;
44
45    s390*-*-linux*)
46	config_path="linux/s390 linux posix"
47	;;
48
49    # Note that bare i386 is not included here.  We need cmpxchg.
50    i[456]86-*-linux*)
51	config_path="linux/x86 linux posix"
52	if test -z "$with_arch"; then
53	  XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
54	fi
55	;;
56
57    # Similar jiggery-pokery for x86_64 multilibs, except here we
58    # can't rely on the --with-arch configure option, since that
59    # applies to the 64-bit side.
60    x86_64-*-linux*)
61	config_path="linux/x86 linux posix"
62	case " ${CC} ${CFLAGS} " in
63	  *" -m32 "*)
64	    XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
65	    ;;
66	esac
67	;;
68
69    # Note that sparcv7 and sparcv8 is not included here.  We need cas.
70    sparcv9-*-linux* | sparc64-*-linux*)
71	echo "int i;" > conftestx.c
72	if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
73	  config_path="linux/sparc linux posix"
74	  case "`/usr/bin/file conftestx.o`" in
75	    *32-bit*)
76	      case " ${CC} ${CFLAGS}" in
77		*" -mcpu=ultrasparc"*)
78		  ;;
79		*)
80		  XCFLAGS="${XCFLAGS} -mcpu=v9"
81		  ;;
82	      esac
83	      ;;
84	  esac
85	fi
86	rm -f conftestx.c conftestx.o
87	;;
88  esac
89fi
90
91# Other system configury
92case "${target}" in
93
94  *-*-hpux11*)
95	# HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
96	XLDFLAGS="${XLDFLAGS} -lrt"
97	;;
98
99  *-*-mingw32*)
100	config_path="mingw32 posix"
101	;;
102
103  *-*-solaris2.[56]*)
104	config_path="posix95 posix"
105	XLDFLAGS="${XLDFLAGS} -lposix4"
106	;;
107
108  *)
109	;;
110
111esac
112