1#
2#   Copyright (C) 2012-2017 Free Software Foundation, Inc.
3#
4# This file is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; either version 3 of the License, or
7# (at your option) any later version.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; see the file COPYING3.  If not see
16# <http://www.gnu.org/licenses/>.
17#
18# This file is a shell script that overrides some of the tools and
19# flags used on a host specific basis.
20
21# Since the "bfd/hosts" directory is shared by the bfd, opcodes, and
22# binutils directories (at least), the index to it is also shared.
23# This is that index.  Each configure.ac file should source this file
24# in its per-host part.
25
26# This sets the following shell variables:
27#  HDEFINES		host specific compiler options
28#  host64		set to true if 64 bit types are as fast as 32 bit
29#  HOST_64BIT_TYPE	host 64 bit type
30#  HOST_U_64BIT_TYPE	unsigned 64 bit type (not needed if 64BIT_TYPE is long)
31
32HDEFINES=
33host64=false
34HOST_64BIT_TYPE=
35HOST_U_64BIT_TYPE=
36
37case "${host}" in
38
39hppa*64*-*-hpux*)	# HP/UX's ftello64 et.al. declarations are only
40			# visible when _LARGEFILE64_SOURCE is defined.
41			# Without those declarations, real_ftell et.al.
42			# get mis-compiled.
43			HDEFINES="-DHOST_HPPAHPUX -D_LARGEFILE64_SOURCE"
44			host64=true;;
45hppa*-*-hpux*)		HDEFINES="-DHOST_HPPAHPUX -D_LARGEFILE64_SOURCE" ;;
46hppa*-*-hiux*)		HDEFINES=-DHOST_HPPAHPUX ;;
47hppa*-*-mpeix*)		HDEFINES=-DHOST_HPPAMPEIX ;;
48hppa*-*-bsd*)		HDEFINES=-DHOST_HPPABSD ;;
49hppa*-*-osf*)		HDEFINES=-DHOST_HPPAOSF ;;
50
51ia64-*-hpux*)		HDEFINES=-D_LARGEFILE64_SOURCE
52			host64=true;;
53ia64-*-*)		host64=true;;
54
55# Workaround for limitations on win9x where file contents are
56# not zero'd out if you seek past the end and then write.
57i[3-7]86-*-mingw32*)	HDEFINES=-D__USE_MINGW_FSEEK;;
58
59i[3-7]86-sequent-bsd*)	HDEFINES=-Dshared=genshared ;;
60i[3-7]86-sequent-sysv4*) ;;
61i[3-7]86-sequent-sysv*)	HDEFINES=-Dshared=genshared ;;
62
63mips*-*-netbsd*)	;;
64mips*-*-openbsd*)	;;
65mips*-dec-*)		HDEFINES="-G 4"	;;
66mips*-sgi-irix3*)	HDEFINES="-G 4" ;;
67mips*-sgi-irix4*)	HDEFINES="-G 4" ;;
68mips*-sgi-irix6*)	host64=true;;
69mips64*-*-linux*)	host64=true;;
70mips64*-*-freebsd* | mips64*-*-kfreebsd*-gnu) host64=true;;
71mips*-*-sysv4*)		;;
72mips*-*-sysv*)		HDEFINES="-G 4" ;;
73mips*-*-riscos*)	HDEFINES="-G 4" ;;
74
75m68*-hp-hpux*)		HDEFINES=-DHOST_HP300HPUX ;;
76
77# Some Solaris systems (osol0906 at least) have a libc that doesn't recognise
78# the "MS-ANSI" code page name, so we define an override for CP_ACP (sets the
79# default code page used by windres/windmc when not specified by a commandline
80# option) to select the "WINDOWS-1252" name instead.  See PR11280 for details.
81*-*-solaris2.11)	HDEFINES=-DCP_ACP=1 ;;
82
83*-*-windows*)
84			HOST_64BIT_TYPE=__int64
85			HOST_U_64BIT_TYPE="unsigned __int64"
86# The following krock is necessary because we can't run the build compiler
87# (MSVC) on the configure host, so we have to explicitly set the values here.
88# Note that this file is never run through autoconf, so we can't use any
89# autoconf macros here.  Because of this, we have to muck with autoconf
90# variables explicitly.
91			ac_cv_func_mmap_fixed_mapped=no
92			ac_cv_header_time=no
93			ac_cv_func_getpagesize=no
94			ac_cv_func_madvise=no
95			ac_cv_func_mprotect=no
96			ac_cv_func_getuid=no
97			ac_cv_func_getgid=no
98			ac_cv_header_sys_file_h=no
99			ac_cv_header_sys_time_h=no
100			ac_cv_header_unistd_h=no
101			;;
102esac
103