configure.host revision 33965
1284764Semaste# This is the linker host specific file.  This is invoked by the
2284764Semaste# autoconf generated configure script.  Putting it in a separate shell
3284764Semaste# file lets us skip running autoconf when modifying host specific
4# information.
5
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
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
22alpha-*-linux*)
23  HOSTING_CRT0=/usr/lib/crt0.o
24  ;;
25
26alpha-*-*)
27  HOSTING_CRT0=/usr/ccs/lib/crt0.o
28  NATIVE_LIB_DIRS=/usr/ccs/lib
29  ;;
30
31i[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.
36  NATIVE_LIB_DIRS=/lib
37  HOSTING_CRT0=/usr/lib/crt0.o
38  ;;
39
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'
43  NATIVE_LIB_DIRS=/usr/ccs/lib
44  ;;
45
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`'
49  ;;
50
51i[3456]86-*-sysv*)
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'
54  ;;
55
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`'
59  NATIVE_LIB_DIRS=/usr/ccs/lib
60  ;;
61
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'
75  ;;
76
77i[3456]86-*-linux*aout* | i[3456]86-*-linuxoldld)
78  HOSTING_CRT0=/usr/lib/crt0.o
79  ;;
80
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'
84  ;;
85
86i[3456]86-*-lynxos*)
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
91mips*-dec-bsd*)
92  HOSTING_CRT0=/usr/lib/crt0.o
93  ;;
94
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
100mips*-sgi-irix[56]*)
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
105m68*-*-linux*aout*)
106  HOSTING_CRT0=/usr/lib/crt0.o
107  ;;
108
109m68*-*-linux*)
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*-*-lynxos*)
115  HOSTING_CRT0=/lib/init1.o
116  HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
117  ;;
118
119m68*-motorola-sysv)
120  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`'
121  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`'
122  ;;
123
124m68*-sun-*)
125  HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o'
126  ;;
127
128m88*-*-dgux*)
129  HDEFINES=-D__using_DGUX
130  HOSTING_CRT0='/lib/crt0.o -X'
131  HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a
132  ;;
133
134m88*-motorola-sysv3)
135  HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
136  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`'
137  ;;
138
139romp-*-*)
140  HDEFINES=-DNO_VARARGS
141  ;;
142
143sparc*-*-solaris2*)
144  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`'
145  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`'
146  NATIVE_LIB_DIRS=/usr/ccs/lib
147  ;;
148
149esac
150
151HLDFLAGS=
152HLDENV=
153RPATH_ENVVAR=LD_LIBRARY_PATH
154# If we have shared libraries, try to set rpath reasonably.
155if test "${shared}" = "true"; then
156  case "${host}" in
157  *-*-hpux*)
158    HLDFLAGS='-Wl,+s,+b,$(libdir)'
159    RPATH_ENVVAR=SHLIB_PATH
160    ;;
161  *-*-irix[56]*)
162    HLDFLAGS='-Wl,-rpath,$(libdir)'
163    ;;
164  *-*-linux*aout*)
165    ;;
166  *-*-linux*)
167    HLDFLAGS='-Wl,-rpath,$(libdir)'
168    ;;
169  *-*-solaris*)
170    HLDFLAGS='-R $(libdir)'
171    ;;
172  *-*-sysv4*)
173    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;'
174    ;;
175  esac
176fi
177
178# On SunOS, if the linker supports the -rpath option, use it to
179# prevent ../bfd and ../opcodes from being included in the run time
180# search path.
181case "${host}" in
182  *-*-sunos*)
183    echo 'main () { }' > conftest.c
184    ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
185    if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
186      :
187    elif grep 'No such file' conftest.t >/dev/null 2>&1; then
188      :
189    elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
190      :
191    elif test "${shared}" = "true"; then
192      HLDFLAGS='-Wl,-rpath=$(libdir)'
193    else
194      HLDFLAGS='-Wl,-rpath='
195    fi
196    rm -f conftest.t conftest.c conftest
197    ;;
198esac
199