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
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
10 # NATIVE_LIB_DIRS library directories to search on this host
11 # HLDFLAGS link flags to use on this host
12 # HLDENV environment variable to set when linking for the host
13 # RPATH_ENVVAR environment variable used to find shared libraries
16 HOSTING_CRT0=/lib/crt0.o
17 HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc'
23 HOSTING_CRT0=/usr/lib/crt0.o
27 HOSTING_CRT0=/usr/ccs/lib/crt0.o
28 NATIVE_LIB_DIRS=/usr/ccs/lib
31 i[3456]86-*-bsd* | i[3456]86-*-freebsd* | i[3456]86-*-netbsd*)
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.
37 HOSTING_CRT0=/usr/lib/crt0.o
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'
43 NATIVE_LIB_DIRS=/usr/ccs/lib
46 i[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`'
52 HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`'
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'
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`'
59 NATIVE_LIB_DIRS=/usr/ccs/lib
62 i[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
67 echo "int dummy_crtbegin () { return 0; }" > crtbegin.c
68 ${CC} -c crtbegin.c -o crtbegin.o
70 echo "int dummy_crteng () { return 0; }" > crtend.c
71 ${CC} -c crtend.c -o crtend.o
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'
77 i[3456]86-*-linux*aout* | i[3456]86-*-linuxoldld)
78 HOSTING_CRT0=/usr/lib/crt0.o
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'
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'
92 HOSTING_CRT0=/usr/lib/crt0.o
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'
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'
106 HOSTING_CRT0=/usr/lib/crt0.o
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'
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'
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'
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`'
130 HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o'
134 HDEFINES=-D__using_DGUX
135 HOSTING_CRT0='/lib/crt0.o -X'
136 HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a
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`'
145 HDEFINES=-DNO_VARARGS
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`'
151 NATIVE_LIB_DIRS=/usr/ccs/lib
158 RPATH_ENVVAR=LD_LIBRARY_PATH
159 # If we have shared libraries, try to set rpath reasonably.
160 if test "${shared}" = "true"; then
163 HLDFLAGS='-Wl,+s,+b,$(libdir)'
164 RPATH_ENVVAR=SHLIB_PATH
167 HLDFLAGS='-Wl,-rpath,$(libdir)'
172 HLDFLAGS='-Wl,-rpath,$(libdir)'
175 HLDFLAGS='-R $(libdir)'
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;'
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
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
192 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
194 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
196 elif test "${shared}" = "true"; then
197 HLDFLAGS='-Wl,-rpath=$(libdir)'
199 HLDFLAGS='-Wl,-rpath='
201 rm -f conftest.t conftest.c conftest