2003-02-27 Andrew Cagney <cagney@redhat.com>
[binutils.git] / ld / configure.host
blob8cd7336a0fae21c529aaa9ad83cd6310a4fd59c5
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.
6 # This file sets the following shell variables:
7 #  HDEFINES             host specific compiler flags
8 #  HOSTING_CRT0         crt0.o file used for bootstrapping
9 #  HOSTING_LIBS         libraries used for bootstrapping
11 HDEFINES=
12 HOSTING_CRT0=/lib/crt0.o
13 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ]; then libgcc=../gcc/libgcc.a; else libgcc=\`${CC} -print-libgcc-file-name\`; fi; if [ -f ../gcc/libgcc_eh.a ]; then libgcc="$libgcc ../gcc/libgcc_eh.a"; else libgcc_eh=\`${CC} -print-file-name=libgcc_eh.a\`; if [ x"$libgcc_eh" != xlibgcc_eh.a ]; then libgcc="$libgcc $libgcc_eh"; fi; fi; echo $libgcc -lc $libgcc`'
16 #       Generic configurations:
19 case "${host}" in
21 *-*-freebsd*)
22   # Older versions of gcc do not use a specs file.  In those cases,
23   # gcc -print-file-name=specs will simply print specs.  We create a
24   # dummy specs files to handle this.
25   echo "-dynamic-linker `${CC} --print-file-name=ld-elf.so.1`" > specs
26   HOSTING_CRT0='-dynamic-linker `${CC} --print-prog-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`'
27   HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
28   ;;
30 *-*-linux*aout* | *-*-linux*oldld)
31   HOSTING_CRT0=/usr/lib/crt0.o
32   ;;
34 *-*-linux*libc1*)
35   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 ${CC} --print-file-name=crtbegin.o; fi`'
36   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; elif [ -f /usr/lib/crtend.o ]; then echo /usr/lib/crtend.o; else ${CC} --print-file-name=crtend.o; fi` /usr/lib/crtn.o'
37   ;;
39 *-*-linux*)
40   HOSTING_CRT0='-dynamic-linker `egrep "ld[^ ]*\.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[   ][      ]*\(.*/ld[^ ]*\.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
41   HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
42   ;;
44 esac
47 # Now more specific configurations
50 case "${host}" in
52 *-*-linux*aout* | *-*-linux*oldld | *-*-linux*libc1*)
53   # No further tweaking needed
54   ;;
56 alpha*-*-netbsd*)
57   HOSTING_CRT0=/usr/lib/crt0.o
58   ;;
60 arm*-*-linux-gnu*)
61   HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux,g"`
62   ;;
64 hppa*64*-*-hpux11*)
65   HOSTING_CRT0=/usr/ccs/lib/pa20_64/crt0.o
66   # Even if CC is not gcc, the tests use gcc.
67   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else if test "$GCC" = yes; then ${CC} --print-libgcc-file-name; else gcc --print-libgcc-file-name; fi fi` -lc /usr/lib/pa20_64/milli.a'
68   ;;
70 i[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34567]86-*-freebsd*aout* | i[3456]86-*-netbsd*)
71   HOSTING_CRT0=/usr/lib/crt0.o
72   ;;
74 i[3456]86-*-sysv4*)
75   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 ${CC} -print-file-name=crtbegin.o; fi`'
76   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /usr/ccs/lib/crtn.o'
77   ;;
79 i[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*)
80   HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
81   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
82   ;;
84 i[3456]86-*-sysv*)
85   HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`'
86   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o'
87   ;;
89 i[3456]86-*-solaris*)
90   HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
91   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
92   ;;
94 i[3456]86-*-sco* | i[3456]86-*-isc*)
95   # In some configurations gcc does not use crtbegin.o and crtend.o.
96   # In that case gcc -print-file-name=crtbegin.o will simply print
97   # crtbegin.o.  We create dummy crtbegin.o and crtend.o files to
98   # handle this.
99   echo "int dummy_crtbegin () { return 0; }" > crtbegin.c
100   ${CC} -c crtbegin.c -o crtbegin.o
101   rm -f crtbegin.c
102   echo "int dummy_crteng () { return 0; }" > crtend.c
103   ${CC} -c crtend.c -o crtend.o
104   rm -f crtend.c
105   HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
106   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` /lib/crtn.o'
107   ;;
109 i[3456]86-*-lynxos*)
110   HOSTING_CRT0=/lib/init1.o
111   HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o'
112   ;;
114 i[3456]86-pc-interix*)
115   HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o'
116   HOSTING_LIBS='-L $$X/local_bin -L $$INTERIX_ROOT/usr/lib '"$HOSTING_LIBS"' -lcpsx -lc -lcpsx $$INTERIX_ROOT/usr/lib/psxdll.a $$INTERIX_ROOT/usr/lib/psxdll2.a'
117   ;;
119 i[3456]86-*-cygwin*)
120   HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
121   ;;
123 ia64-*-linux-gnu*)
124   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"`
125   ;;
127 ia64-*-aix*)
128   HOSTING_CRT0='-dynamic-linker `egrep "libc.so" \`${CC} --print-file-name=specs\` | sed -e "s,.*-dynamic-linker[       ][      ]*\(.*/libc.so..\).*,\1,"` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} --print-file-name=crtbegin.o; fi`'
129   HOSTING_LIBS='-L`dirname \`${CC} --print-file-name=libc.so\`` '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} --print-file-name=crtend.o; fi` `${CC} --print-file-name=crtn.o`'
130   ;;
132 mips*-dec-bsd*)
133   HOSTING_CRT0=/usr/lib/crt0.o
134   ;;
136 mips*-sgi-irix4* | mips*-sgi-irix5*)
137   HOSTING_CRT0=/usr/lib/crt1.o
138   HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o'
139   ;;
141 mips*-sgi-irix6*)
142   HOSTING_CRT0='/usr/lib32/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o ; else ${CC} -print-file-name=crtbegin.o; fi`'
143   HOSTING_LIBS='-L/usr/lib32 '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else ${CC} -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors'
144   ;;
146 mips*-*-linux-gnu*)
147   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
148   ;;
150 m68*-*-linux-gnu*)
151   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
152   ;;
154 m68*-*-lynxos*)
155   HOSTING_CRT0=/lib/init1.o
156   HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o'
157   ;;
159 m68*-motorola-sysv)
160   HOSTING_CRT0='`if [ -f ../gcc/crt0.o ]; then echo ../gcc/crt0.o; elif [ -f \`${CC} -print-file-name=\`crt0.o ]; then echo \`${CC} -print-file-name=\`crt0.o; else echo /lib/crt0.o; fi`'
161   HOSTING_LIBS=`echo "$HOSTING_LIBS" | sed -e "s,-lc,-lc881,"`
162   ;;
164 m68*-sun-*)
165   HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o'
166   ;;
168 m88*-*-dgux*)
169   HDEFINES=-D__using_DGUX
170   HOSTING_CRT0='/lib/crt0.o -X'
171   HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a
172   ;;
174 m88*-motorola-sysv3)
175   HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
176   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
177   ;;
179 powerpc64*-*-linux-gnu*)
180   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld64.so.1,"`
181   ;;
183 powerpc*-*-linux-gnu*)
184   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
185   ;;
187 s390x-*-linux-gnu*)
188   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld64.so.1,"`
189   ;;
191 s390-*-linux-gnu*)
192   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"`
193   ;;
195 sparc*-*-solaris2*)
196   HOSTING_CRT0='`if [ -f ../gcc/crt1.o ]; then echo ../gcc/crt1.o; else ${CC} -print-file-name=crt1.o; fi` `if [ -f ../gcc/crti.o ]; then echo ../gcc/crti.o; else ${CC} -print-file-name=crti.o; fi` /usr/ccs/lib/values-Xa.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`'
197   HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
198   ;;
200 sparc-*-linux-gnu*)
201   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld-linux.so.2,"`
202   ;;
204 sparc64-*-linux-gnu*)
205   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux.so.2,"`
206   ;;
208 x86_64-*-linux-gnu*)
209   HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"`
210   ;;
212 *-*-freebsd*)
213   ;;
215 *-*-linux*)
216   ;;
218 *-*-netbsd*)
219   # NetBSD typically does not use the GCC crtstuff, so ignore it.
220   HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crtbegin.o'
221   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` -lc `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi` /usr/lib/crtend.o'
222   ;;
224 alpha*-*-*)
225   HOSTING_CRT0=/usr/ccs/lib/crt0.o
226   ;;
228 esac