1# GCC host-specific configuration file.
2# Copyright (C) 1997-2015 Free Software Foundation, Inc.
3
4#This file is part of GCC.
5
6#GCC is free software; you can redistribute it and/or modify it under
7#the terms of the GNU General Public License as published by the Free
8#Software Foundation; either version 3, or (at your option) any later
9#version.
10
11#GCC is distributed in the hope that it will be useful, but WITHOUT
12#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13#FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14#for more details.
15
16#You should have received a copy of the GNU General Public License
17#along with GCC; see the file COPYING3.  If not see
18#<http://www.gnu.org/licenses/>.
19
20# This is the GCC host-specific configuration file
21# where a configuration type is mapped to different system-specific
22# definitions and files.  This is invoked by the autoconf-generated
23# configure script.  Putting it in a separate shell file lets us skip
24# running autoconf when modifying host-specific information.
25
26# This file switches on the shell variable ${host}.  As much of this as
27# is reasonable should be replaced with autoconf tests in the future.
28
29# This file sets the following shell variables for use by the
30# autoconf-generated configure script:
31#
32#  host_xm_file         List of files to include when compiling for the
33#                       host machine.
34#
35#  host_xm_defines      List of macros to define when compiling for the
36#                       host machine.
37#
38#  host_xmake_file      List of host-specific makefile-fragments.
39#
40#  host_exeext          Set to the suffix, if the host machine requires
41#                       executables to have a file name suffix.
42#
43#  host_extra_objs      List of extra host-dependent objects that should
44#                       be linked into the compiler proper.
45#
46#  host_extra_gcc_objs  List of extra host-dependent objects that should
47#                       be linked into the gcc driver.
48#
49#  out_host_hook_obj    An object file that provides the host hooks.
50#
51#  host_can_use_collect2 Set to yes normally; to no if the host cannot
52#			link or otherwise use collect2
53#
54#  use_long_long_for_widest_fast_int Set this to 'yes' if 'long long'
55#			(or '__int64') is wider than 'long' but still
56#			efficeiently supported by the host hardware.
57#			Only affects compile speed.  Default is 'no'.
58#
59#  host_lto_plugin_soname Set this to the name to which the LTO linker
60#			plugin gets compiled on this host, if it is
61#			different from the default "liblto_plugin.so".
62
63# When setting any of these variables, check to see if a corresponding
64# variable is present in config.build; if so, you will likely want to 
65# set it in both places.
66
67# Default settings.
68host_xm_file=
69host_xm_defines=
70host_xmake_file=
71host_exeext=
72host_extra_objs=
73host_extra_gcc_objs=
74out_host_hook_obj=host-default.o
75host_can_use_collect2=yes
76use_long_long_for_widest_fast_int=no
77host_lto_plugin_soname=liblto_plugin.so
78
79# Unsupported hosts list.  Generally, only include hosts known to fail here,
80# since we allow hosts not listed to be supported generically.
81case ${host} in
82   i[34567]86-sequent-sysv \
83 | i[34567]86-sequent-sysv[123]* \
84 | i[34567]86-go32-* \
85 | i[34567]86-*-go32* \
86 | vax-*-vms*)
87    echo "*** Configuration for host ${host} not supported" 1>&2
88    exit 1
89    ;;
90esac
91
92# Common parts for widely ported systems.
93case ${host} in
94  *-darwin*)
95    # Generic darwin host support.
96    out_host_hook_obj=host-darwin.o
97    host_xmake_file="${host_xmake_file} x-darwin"
98    ;;
99esac
100
101case ${host} in
102  arm*-*-freebsd* | arm*-*-haiku* | arm*-*-linux*)
103    case ${target} in
104      arm*-*-*)
105	host_extra_gcc_objs="driver-arm.o"
106	host_xmake_file="${host_xmake_file} arm/x-arm"
107	;;
108    esac
109    ;;
110  alpha*-*-linux*)
111    case ${target} in
112      alpha*-*-linux*)
113	host_extra_gcc_objs="driver-alpha.o"
114	host_xmake_file="${host_xmake_file} alpha/x-alpha"
115	;;
116    esac
117    ;;
118  i[34567]86-*-* \
119  | x86_64-*-* )
120    case ${target} in
121      i[34567]86-*-* \
122      | x86_64-*-* )
123	host_extra_gcc_objs="driver-i386.o"
124	host_xmake_file="${host_xmake_file} i386/x-i386"
125	;;
126    esac
127    ;;
128  mips*-*-linux* \
129  | mips*-*-haiku* )
130    case ${target} in
131      mips*-*-linux* \
132      | mips*-*-haiku* )
133	host_extra_gcc_objs="driver-native.o"
134	host_xmake_file="${host_xmake_file} mips/x-native"
135      ;;
136    esac
137    ;;
138  rs6000-*-* \
139  | powerpc*-*-* )
140    case ${target} in
141      rs6000-*-* \
142      | powerpc*-*-* )
143        host_extra_gcc_objs="driver-rs6000.o"
144        host_xmake_file="${host_xmake_file} rs6000/x-rs6000"
145        ;;
146    esac
147    case ${host} in
148      *-*-linux* | *-*-freebsd*)
149	if test "${GCC}:${ac_cv_sizeof_long}" = yes:4; then
150	  # On powerpc*-*-linux* use -Wl,--relax to link cc1,
151	  # if ld is new enough, otherwise force -O1 in CFLAGS.
152	  host_ppc_relax_xmake_file=
153	  host_ld_ver=`${CC} -Wl,--version 2>/dev/null | sed 1q`
154	  if echo "$host_ld_ver" | grep GNU > /dev/null; then
155	    host_ld_date=`echo $host_ld_ver \
156			  | sed -n 's,^.*\([2-9][0-9][0-9][0-9]\)[-]*\([01][0-9]\)[-]*\([0-3][0-9]\).*$,\1\2\3,p'`
157	    if test 0"$host_ld_date" -gt 20080806; then
158	      host_ppc_relax_xmake_file=rs6000/x-linux-relax
159	    fi
160	  fi
161	  if test -z "${host_ppc_relax_xmake_file}"; then
162	    host_ppc_relax_xmake_file=x-cflags-O1
163	  fi
164	  host_xmake_file="${host_xmake_file} ${host_ppc_relax_xmake_file}"
165	fi
166	;;
167    esac
168    ;;
169  sparc*-*-solaris2*)
170    case ${target} in
171      sparc*-*-solaris2*)
172	host_extra_gcc_objs="driver-sparc.o"
173	host_xmake_file="${host_xmake_file} sparc/x-sparc"
174	;;
175    esac
176    ;;
177  sparc*-*-linux*)
178    case ${target} in
179      sparc*-*-linux*)
180	host_extra_gcc_objs="driver-sparc.o"
181	host_xmake_file="${host_xmake_file} sparc/x-sparc"
182	;;
183    esac
184    ;;
185esac
186
187# Machine-specific settings.
188case ${host} in
189  hppa1.0-*-hpux10* | hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
190    out_host_hook_obj=host-hpux.o
191    host_xmake_file="${host_xmake_file} x-hpux"
192    ;;
193  hppa1.0-*-hpux11* | hppa1.1-*-hpux11* | hppa2*-*-hpux11* | \
194  hppa*64*-*-hpux11*)
195    out_host_hook_obj=host-hpux.o
196    host_xmake_file="${host_xmake_file} x-hpux"
197    ;;
198  hppa*-*-linux*)
199    out_host_hook_obj=host-hpux.o
200    host_xmake_file="${host_xmake_file} x-hpux"
201    ;;
202  i370-*-opened* | i370-*-mvs* ) # IBM 360/370/390 Architecture
203    host_xm_defines='FATAL_EXIT_CODE=12'
204    ;;
205  i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
206    out_host_hook_obj=host-solaris.o
207    host_xmake_file="${host_xmake_file} x-solaris"
208    ;;
209  i[34567]86-pc-msdosdjgpp*)
210    host_xm_file=i386/xm-djgpp.h
211    host_exeext=.exe
212    # Shorten $target_noncanonical for 8.3 filename conventions.
213    case ${target} in
214      *pc-msdosdjgpp*)
215        target_noncanonical=djgpp
216        ;;
217    esac
218    ;;
219  i[34567]86-*-cygwin* | x86_64-*-cygwin*)
220    host_xm_file=i386/xm-cygwin.h
221    out_host_hook_obj=host-cygwin.o
222    host_xmake_file="${host_xmake_file} i386/x-cygwin"
223    host_exeext=.exe
224    host_lto_plugin_soname=cyglto_plugin-0.dll
225    ;;
226  i[34567]86-*-mingw32*)
227    host_xm_file=i386/xm-mingw32.h
228    host_xmake_file="${host_xmake_file} i386/x-mingw32"
229    host_exeext=.exe
230    out_host_hook_obj=host-mingw32.o
231    host_lto_plugin_soname=liblto_plugin-0.dll
232    ;;
233  x86_64-*-mingw*)
234    use_long_long_for_widest_fast_int=yes
235    host_xm_file=i386/xm-mingw32.h
236    host_xmake_file="${host_xmake_file} i386/x-mingw32"
237    host_exeext=.exe
238    out_host_hook_obj=host-mingw32.o
239    host_lto_plugin_soname=liblto_plugin-0.dll
240    ;;
241  i[34567]86-*-uwin*)
242    echo "*** UWIN may not be used as a host platform because"
243    echo "*** linking with posix.dll is not allowed by the GNU GPL."
244    exit 1
245    ;;
246  i[34567]86-*-darwin* | x86_64-*-darwin*)
247    out_host_hook_obj="${out_host_hook_obj} host-i386-darwin.o"
248    host_xmake_file="${host_xmake_file} i386/x-darwin"
249    ;;
250  powerpc-*-beos*)
251    host_can_use_collect2=no
252    ;;
253  powerpc-*-darwin*)
254    out_host_hook_obj="${out_host_hook_obj} host-ppc-darwin.o"
255    host_xmake_file="${host_xmake_file} rs6000/x-darwin"
256    ;;
257  powerpc64-*-darwin*)
258    out_host_hook_obj="${out_host_hook_obj} host-ppc64-darwin.o"
259    host_xmake_file="${host_xmake_file} rs6000/x-darwin64"
260    ;;
261  rs6000-ibm-aix* | powerpc-ibm-aix*)
262    host_xmake_file="${host_xmake_file} rs6000/x-aix"
263    ;;
264  *-*-solaris2*)
265    out_host_hook_obj=host-solaris.o
266    host_xmake_file="${host_xmake_file} x-solaris"
267    ;;
268  *-*-linux*)
269    out_host_hook_obj=host-linux.o
270    host_xmake_file="${host_xmake_file} x-linux"
271    ;;
272  *-*-openbsd*)
273    out_host_hook_obj=host-openbsd.o
274    host_xmake_file="${host_xmake_file} x-openbsd"
275    ;;
276  ia64-*-hpux*)
277    use_long_long_for_widest_fast_int=yes
278    out_host_hook_obj=host-hpux.o
279    host_xmake_file="${host_xmake_file} x-hpux"
280    ;;
281  *-*-*vms*)
282    host_xm_file="vms/xm-vms.h"
283    host_xmake_file=vms/x-vms
284    host_exeext=.exe
285    host_can_use_collect2=no
286    ;;
287esac
288