summaryrefslogtreecommitdiffstats
path: root/libitm/configure.tgt
blob: efc01e095aa26ccc7e46f5aa42793b7d268668aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# -*- shell-script -*-
#   Copyright (C) 2011 Free Software Foundation, Inc.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  

# This is the target specific configuration file.  This is invoked by the
# autoconf generated configure script.  Putting it in a separate shell file
# lets us skip running autoconf when modifying target specific information.

# This file switches on the shell variable ${target}, and sets the
# following shell variables:
#  config_path		An ordered list of directories to search for
#			sources and headers.  This is relative to the
#			config subdirectory of the source tree.
#  XCFLAGS		Add extra compile flags to use.
#  XLDFLAGS		Add extra link flags to use.

# Optimize TLS usage by avoiding the overhead of dynamic allocation.
if test $gcc_cv_have_tls = yes ; then
  case "${target}" in

    # For x86, we use slots in the TCB head for most of our TLS.
    # The setup of those slots in beginTransaction can afford to
    # use the global-dynamic model.
    i[456]86-*-linux* | x86_64-*-linux*)
	;;
    
    *-*-linux*)
	XCFLAGS="${XCFLAGS} -ftls-model=initial-exec"
	;;
  esac
fi

# Map the target cpu to an ARCH sub-directory.  At the same time,
# work out any special compilation flags as necessary.
case "${target_cpu}" in
  alpha*)	ARCH=alpha ;;
  ia64*)	ARCH=ia64 ;;
  mips*)	ARCH=mips ;;
  powerpc*)	ARCH=powerpc ;;
  s390*)	ARCH=s390 ;;

  i[456]86)
	case " ${CC} ${CFLAGS} " in
	  *" -m64 "*)
	    ;;
	  *)
	    if test -z "$with_arch"; then
	      XCFLAGS="${XCFLAGS} -march=i486 -mtune=${target_cpu}"
	      XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
	    fi
	esac
	ARCH=x86
	;;

  x86_64)
	case " ${CC} ${CFLAGS} " in
	  *" -m32 "*)
	    XCFLAGS="${XCFLAGS} -march=i486 -mtune=i686"
	    XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
	    ;;
	esac
	ARCH=x86
	;;

  sparcv9 | sparc64)
	# Note that sparcv7 and sparcv8 is not included here.  We need cas.
	echo "int i;" > conftestx.c
	if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then
	  case "`/usr/bin/file conftestx.o`" in
	    *32-bit*)
	      case " ${CC} ${CFLAGS}" in
		*" -mcpu=ultrasparc"*)
		  ;;
		*)
		  XCFLAGS="${XCFLAGS} -mcpu=v9"
		  ;;
	      esac
	      ;;
	  esac
	fi
	rm -f conftestx.c conftestx.o
	ARCH=sparc
	;;

  *)
	ARCH="${target_cpu}"
	;;
esac
  
# Since we require POSIX threads, assume a POSIX system by default.
config_path="$ARCH posix generic"

# Other system configury
case "${target}" in
  *-*-linux*)
	if test $enable_linux_futex = yes; then
	  config_path="linux/$ARCH linux $config_path"
	fi
	;;

  *-*-hpux11*)
	# HPUX v11.x requires -lrt to resolve sem_init in libgomp.la
	XLDFLAGS="${XLDFLAGS} -lrt"
	;;

  *-*-mingw32*)
	config_path="$ARCH mingw32 posix generic"
	;;

  *-*-solaris2.[56]*)
	config_path="$ARCH posix95 posix generic"
	XLDFLAGS="${XLDFLAGS} -lposix4"
	;;

  *-*-darwin*)
	config_path="$ARCH bsd posix generic"
	;;
esac
OpenPOWER on IntegriCloud