Do not set undefined symbols to BSF_OBJECT.
[deliverable/binutils-gdb.git] / bfd / configure.host
CommitLineData
b7577823
ILT
1# This file is a shell script that overrides some of the tools and
2# flags used on a host specific basis.
60ac749c
ILT
3
4# Since the "bfd/hosts" directory is shared by the bfd, opcodes, and
5# binutils directories (at least), the index to it is also shared.
6# This is that index. Each configure.in file should source this file
7# in its per-host part.
8
b7577823
ILT
9# This sets the following shell variables:
10# CC compiler to use (only if needed and not already set)
11# CFLAGS override CFLAGS (only if needed and not already set)
12# LDFLAGS override LDFLAGS (only if needed and not already set)
13# AR archiver to use (only if needed and not already set)
14# RANLIB ranlib to use (only if needed and not already set)
15# HDEFINES host specific compiler options
16# host64 set to true if this is a 64 bit host
17# HOST_64BIT_TYPE host 64 bit type
44f795f7
ILT
18# SHLIB_CC compiler to use when building shared library
19# SHLIB_CFLAGS flags to use when building shared library
20# PICFLAG may be set to flag to use to compile PIC
21# SHLINK may be set to the name to link the shared library to
22# ALLLIBS may be set to libraries to build
23# HLDFLAGS LDFLAGS specific to the host
b5e4f369 24# RPATH_ENVVAR environment variable used to find shared libraries
b7577823
ILT
25
26HDEFINES=
27host64=false
28HOST_64BIT_TYPE=
29
60ac749c
ILT
30case "${host}" in
31# WHEN ADDING ENTRIES TO THIS MATRIX:
32# Make sure that the left side always has two dashes. Otherwise you
33# can get spurious matches. Even for unambiguous cases, do this as a
34# convention, else the table becomes a real mess to understand and maintain.
35#
36# Note that these entries cannot be fully alphabetical. Don't try.
37# The order of matching is critical when multiple lines could match.
38
b7577823
ILT
39alpha-*-*) host64=true; HOST_64BIT_TYPE=long ;;
40
41a29k-*-*) CC=${CC-u3cc}; AR=${AR-u3ar} ;;
42
43hppa*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX ;;
44hppa*-*-hiux*) HDEFINES=-DHOST_HPPAHPUX ;;
45hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;;
46hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;;
47
48i[345]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;;
49i[345]86-sequent-sysv4*) ;;
50i[345]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;;
51i[345]86-ncr*-sysv4*) CC=${CC-/usr/ccs/ATT/cc}
52 test -z "$CFLAGS" && CFLAGS=" "
53 ;;
b7577823 54
44f795f7 55mips-dec-netbsd*) ;;
b7577823
ILT
56mips-dec-*) HDEFINES="-G 4" ;;
57mips-sgi-irix3*) HDEFINES="-G 4"
58 test -z "$LDFLAGS" && LDFLAGS=-lmalloc
59 ;;
60mips-sgi-irix4*) HDEFINES="-G 4"
61 test -z "$LDFLAGS" && LDFLAGS=-lmalloc
62 ;;
63mips-*-sysv4*) ;;
64mips-*-sysv*) HDEFINES="-G 4" ;;
65mips-*-riscos*) HDEFINES="-G 4" ;;
66
67m68*-apollo*-sysv*) # sef@cygnus.com says this is how to compile
68 # on an apollo in the SysV environment.
69 test -z "$CC" && CC="cc -A nansi -A cpu,3000 -A runtype,any -A systype,any -DSHORT_ENUM_BUG -DUSG -U__STDC__ -Dm68000=mc68000"
70 ;;
71m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;;
72
73m88*-*-dgux*) test -z "$CC" && CC="gcc -Wall -ansi -D__using_DGUX"
74 ;;
75
76romp-*-*) # hc/pcc just can't cut it
77 CC=${CC-gcc}
78 ;;
79
80rs6000-*-aix4) HDEFINES=-DHOST_AIX ;;
81rs6000-*-*) HDEFINES=-DHOST_AIX ;;
82powerpc-*-aix4*) HDEFINES=-DHOST_AIX ;;
83powerpc-*-aix*) HDEFINES=-DHOST_AIX ;;
60ac749c
ILT
84
85esac
44f795f7
ILT
86
87# If we are configuring with --enable-shared, adjust the shared
88# library support based on the host. This support must work for both
89# the BFD and the opcodes libraries.
b5e4f369
ILT
90HLDFLAGS=
91RPATH_ENVVAR=LD_LIBRARY_PATH
44f795f7
ILT
92SHLIB_CC='$(CC)'
93SHLIB_CFLAGS='-shared'
94if [ "${shared}" = "true" ]; then
95 case "${host}" in
96 hppa*-*-*) picfrag=../config/mh-papic ;;
97 i[3456]86-*-*) picfrag=../config/mh-x86pic ;;
98 *-*-*) picfrag=../config/mh-${host_cpu}pic ;;
99 esac
100 if [ -f "${picfrag}" ]; then
101 pic=`sed -n -e 's/^PICFLAG[ ]*=[ ]*\(.*\)$/\1/p' ${picfrag}`
102 if [ -n "${pic}" ]; then
103 PICFLAG=${pic}
104 fi
105 fi
106
44f795f7
ILT
107 case "${host}" in
108 *-dec-osf*)
109 # -fpic is not needed on the Alpha.
110 PICFLAG=
111 ;;
112 *-*-hpux*)
113 # HP/UX uses .sl for shared libraries.
114 SHLINK=`echo ${SHLINK} | sed -e 's/so$/sl/'`
2300e217 115 SHLIB_CFLAGS='-shared $(PICFLAG)'
b5e4f369
ILT
116 HLDFLAGS='-Wl,+s,+b,$(libdir)'
117 RPATH_ENVVAR=SHLIB_PATH
44f795f7
ILT
118 ;;
119 *-*-irix5*)
120 # -fpic is not needed on Irix 5.
121 PICFLAG=
b5e4f369
ILT
122 SHLIB_CFLAGS='-shared -Wl,-soname,$(SONAME)'
123 HLDFLAGS='-Wl,-rpath,$(libdir)'
44f795f7
ILT
124 ;;
125 *-*-linux*aout*)
126 ;;
127 *-*-linux*)
b5e4f369
ILT
128 SHLIB_CFLAGS='-shared -Wl,-soname,$(SONAME)'
129 HLDFLAGS='-Wl,-rpath,$(libdir)'
44f795f7
ILT
130 ;;
131 *-*-sysv4* | *-*-solaris*)
b5e4f369
ILT
132 SHLIB_CFLAGS='-shared -h $(SONAME)'
133 HLDFLAGS='-R $(libdir)'
44f795f7
ILT
134 ;;
135 *-*-sunos*)
b5e4f369
ILT
136 # Build a libTARGET-bfd.so.VERSION symlink in the object directory.
137 ALLLIBS=`echo ${ALLLIBS} | sed -e 's/\$(SHLINK)/stamp-tshlink/'`
44f795f7
ILT
138 ;;
139 esac
140fi
141
142# On SunOS, if the linker supports the -rpath option, use it to
143# prevent ../bfd and ../opcodes from being included in the run time
144# search path.
44f795f7
ILT
145case "${host}" in
146 *-*-sunos*)
147 echo 'main () { }' > conftest.c
b5e4f369 148 ${CC-gcc} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
44f795f7
ILT
149 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
150 :
151 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
152 :
b5e4f369
ILT
153 elif [ "${shared}" = "true" ]; then
154 HLDFLAGS='-Wl,-rpath=$(libdir)'
44f795f7
ILT
155 else
156 HLDFLAGS='-Wl,-rpath='
157 fi
158 rm -f conftest.t conftest.c conftest
159 ;;
160esac
This page took 0.188471 seconds and 4 git commands to generate.