* source.c (OPEN_MODE, FDOPEN_MODE): Define; value depends upon
[deliverable/binutils-gdb.git] / ld / configure.host
CommitLineData
36ea6198
ILT
1# This is the linker host specific file. This is invoked by the
2# autoconf generated configure script. Putting it in a separate shell
3# file lets us skip running autoconf when modifying host specific
4# information.
5
6# This file sets the following shell variables:
36ea6198
ILT
7# HDEFINES host specific compiler flags
8# HOSTING_CRT0 crt0.o file used for bootstrapping
9# HOSTING_LIBS libraries used for bootstrapping
10# NATIVE_LIB_DIRS library directories to search on this host
ad43e45b 11# HLDFLAGS link flags to use on this host
fe80f638 12# HLDENV environment variable to set when linking for the host
ad43e45b 13# RPATH_ENVVAR environment variable used to find shared libraries
36ea6198
ILT
14
15HDEFINES=
16HOSTING_CRT0=/lib/crt0.o
17HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc'
18NATIVE_LIB_DIRS=
19
20case "${host}" in
21
02a5d235
ILT
22alpha-*-linux*)
23 HOSTING_CRT0=/usr/lib/crt0.o
24 ;;
25
36ea6198
ILT
26alpha-*-*)
27 HOSTING_CRT0=/usr/ccs/lib/crt0.o
28 NATIVE_LIB_DIRS=/usr/ccs/lib
29 ;;
30
fe80f638 31i[3456]86-*-bsd* | i[3456]86-*-freebsd* | i[3456]86-*-netbsd*)
36ea6198
ILT
32 # The new BSD `make' has a bug: it doesn't pass empty arguments in
33 # shell commands. So we need to make this value non-empty in order
34 # for the genscripts.sh call to work. There's nothing magic about
35 # the value `/lib'; it's just a dummy.
02a5d235 36 NATIVE_LIB_DIRS=/lib
ed1f99e7 37 HOSTING_CRT0=/usr/lib/crt0.o
36ea6198
ILT
38 ;;
39
fe80f638
ILT
40i[3456]86-*-sysv4*)
41 HOSTING_CRT0='/usr/ccs/lib/crt1.o /usr/ccs/lib/crti.o /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
42 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o'
36ea6198
ILT
43 NATIVE_LIB_DIRS=/usr/ccs/lib
44 ;;
45
fe80f638
ILT
46i[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*)
47 HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
48 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi`'
673f5b9f
ILT
49 ;;
50
fe80f638 51i[3456]86-*-sysv*)
36ea6198 52 HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`'
fe80f638 53 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o'
36ea6198
ILT
54 ;;
55
fe80f638
ILT
56i[3456]86-*-solaris*)
57 HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else gcc -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else gcc -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
58 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else gcc -print-file-name=crtn.o; fi`'
36ea6198
ILT
59 NATIVE_LIB_DIRS=/usr/ccs/lib
60 ;;
61
fe80f638
ILT
62i[3456]86-*-sco* | i[3456]86-*-isc*)
63 # In some configurations gcc does not use crtbegin.o and crtend.o.
64 # In that case gcc -print-file-name=crtbegin.o will simply print
65 # crtbegin.o. We create dummy crtbegin.o and crtend.o files to
66 # handle this.
67 echo "int dummy_crtbegin () { return 0; }" > crtbegin.c
68 ${CC} -c crtbegin.c -o crtbegin.o
69 rm -f crtbegin.c
70 echo "int dummy_crteng () { return 0; }" > crtend.c
71 ${CC} -c crtend.c -o crtend.o
72 rm -f crtend.c
73 HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
74 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` /lib/crtn.o'
36ea6198
ILT
75 ;;
76
fe80f638 77i[3456]86-*-linux*aout* | i[3456]86-*-linuxoldld)
36ea6198
ILT
78 HOSTING_CRT0=/usr/lib/crt0.o
79 ;;
80
fe80f638
ILT
81i[3456]86-*-linux*)
82 HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
83 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
ed1f99e7
ILT
84 ;;
85
fe80f638 86i[3456]86-*-lynxos*)
36ea6198
ILT
87 HOSTING_CRT0=/lib/init1.o
88 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
89 ;;
90
2e598345 91mips*-dec-bsd*)
36ea6198
ILT
92 HOSTING_CRT0=/usr/lib/crt0.o
93 ;;
94
2e598345
ILT
95mips*-sgi-irix4*)
96 HOSTING_CRT0=/usr/lib/crt1.o
97 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
98 ;;
99
fe80f638 100mips*-sgi-irix[56]*)
36ea6198
ILT
101 HOSTING_CRT0=/usr/lib/crt1.o
102 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
103 ;;
104
fe80f638
ILT
105m68*-*-linux*aout*)
106 HOSTING_CRT0=/usr/lib/crt0.o
107 ;;
108
109m68*-*-linux*libc1*)
110 HOSTING_CRT0='-dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; elif [ -f /usr/lib/crtbegin.o ]; then echo /usr/lib/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
111 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
112 ;;
113
114m68*-*-linux*)
115 HOSTING_CRT0='-dynamic-linker /lib/ld.so.1 /usr/lib/crt1.o /usr/lib/crti.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc --print-file-name=crtbegin.o; fi`'
116 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
117 ;;
118
36ea6198
ILT
119m68*-*-lynxos*)
120 HOSTING_CRT0=/lib/init1.o
121 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
122 ;;
123
ed1f99e7
ILT
124m68*-motorola-sysv)
125 HOSTING_CRT0='`if [ -f ../gcc/crt0.o ]; then echo ../gcc/crt0.o; elif [ -f \`gcc -print-file-name=\`crt0.o ]; then echo \`gcc -print-file-name=\`crt0.o; else echo /lib/crt0.o; fi`'
126 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc881 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi`'
127 ;;
128
36ea6198
ILT
129m68*-sun-*)
130 HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o'
131 ;;
132
133m88*-*-dgux*)
02a5d235 134 HDEFINES=-D__using_DGUX
fe80f638 135 HOSTING_CRT0='/lib/crt0.o -X'
36ea6198
ILT
136 HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a
137 ;;
138
ed1f99e7 139m88*-motorola-sysv3)
fe80f638
ILT
140 HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
141 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi`'
ed1f99e7
ILT
142 ;;
143
36ea6198
ILT
144romp-*-*)
145 HDEFINES=-DNO_VARARGS
36ea6198
ILT
146 ;;
147
fe80f638
ILT
148sparc*-*-solaris2*)
149 HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else gcc -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else gcc -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
150 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else gcc -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else gcc -print-file-name=crtn.o; fi`'
36ea6198
ILT
151 NATIVE_LIB_DIRS=/usr/ccs/lib
152 ;;
153
154esac
2e598345
ILT
155
156HLDFLAGS=
fe80f638 157HLDENV=
ad43e45b 158RPATH_ENVVAR=LD_LIBRARY_PATH
2e598345
ILT
159# If we have shared libraries, try to set rpath reasonably.
160if test "${shared}" = "true"; then
161 case "${host}" in
b6acf084
ILT
162 *-*-hpux*)
163 HLDFLAGS='-Wl,+s,+b,$(libdir)'
ad43e45b 164 RPATH_ENVVAR=SHLIB_PATH
b6acf084 165 ;;
fe80f638 166 *-*-irix[56]*)
2e598345
ILT
167 HLDFLAGS='-Wl,-rpath,$(libdir)'
168 ;;
169 *-*-linux*aout*)
170 ;;
171 *-*-linux*)
172 HLDFLAGS='-Wl,-rpath,$(libdir)'
173 ;;
fe80f638 174 *-*-solaris*)
2e598345
ILT
175 HLDFLAGS='-R $(libdir)'
176 ;;
fe80f638
ILT
177 *-*-sysv4*)
178 HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
179 ;;
2e598345
ILT
180 esac
181fi
182
183# On SunOS, if the linker supports the -rpath option, use it to
184# prevent ../bfd and ../opcodes from being included in the run time
185# search path.
186case "${host}" in
187 *-*-sunos*)
188 echo 'main () { }' > conftest.c
189 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
190 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
191 :
192 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
193 :
9e2ef098
ILT
194 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
195 :
2e598345
ILT
196 elif test "${shared}" = "true"; then
197 HLDFLAGS='-Wl,-rpath=$(libdir)'
198 else
199 HLDFLAGS='-Wl,-rpath='
200 fi
201 rm -f conftest.t conftest.c conftest
202 ;;
203esac
This page took 0.115414 seconds and 4 git commands to generate.