configure.host revision 104844
160524Sobrien# $FreeBSD: head/contrib/binutils/ld/configure.host 104844 2002-10-11 06:13:25Z obrien $ 260524Sobrien 377317Sobrien 433965Sjdp# This is the linker host specific file. This is invoked by the 533965Sjdp# autoconf generated configure script. Putting it in a separate shell 633965Sjdp# file lets us skip running autoconf when modifying host specific 733965Sjdp# information. 833965Sjdp 933965Sjdp# This file sets the following shell variables: 1033965Sjdp# HDEFINES host specific compiler flags 1133965Sjdp# HOSTING_CRT0 crt0.o file used for bootstrapping 1233965Sjdp# HOSTING_LIBS libraries used for bootstrapping 1333965Sjdp# NATIVE_LIB_DIRS library directories to search on this host 1433965Sjdp 1533965SjdpHDEFINES= 1633965SjdpHOSTING_CRT0=/lib/crt0.o 1794548SobrienHOSTING_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`' 18104844SobrienNATIVE_LIB_DIRS='/usr/local/lib /lib /usr/lib' 1933965Sjdp 2094548Sobrien# 2194548Sobrien# Generic configurations: 2294548Sobrien# 2394548Sobrien 2433965Sjdpcase "${host}" in 2533965Sjdp 2694548Sobrien*-*-freebsd*) 27104844Sobrien NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib' 2894548Sobrien # Older versions of gcc do not use a specs file. In those cases, 2994548Sobrien # gcc -print-file-name=specs will simply print specs. We create a 3094548Sobrien # dummy specs files to handle this. 3194548Sobrien echo "-dynamic-linker `${CC} --print-file-name=ld-elf.so.1`" > specs 3294548Sobrien HOSTING_CRT0='-dynamic-linker `${CC} --print-file-name=ld-elf.so.1` `${CC} --print-file-name=crt1.o` `${CC} --print-file-name=crti.o` `${CC} --print-file-name=crtbegin.o`' 3394548Sobrien 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`' 3494548Sobrien ;; 3594548Sobrien 3694548Sobrien*-*-linux*aout* | *-*-linux*oldld) 3794548Sobrien HOSTING_CRT0=/usr/lib/crt0.o 3894548Sobrien ;; 3994548Sobrien 4094548Sobrien*-*-linux*libc1*) 4194548Sobrien 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`' 4294548Sobrien 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' 4394548Sobrien ;; 4494548Sobrien 4594548Sobrien*-*-linux*) 4694548Sobrien 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`' 4794548Sobrien 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`' 4894548Sobrien ;; 4994548Sobrien 5094548Sobrienesac 5194548Sobrien 5294548Sobrien# 5394548Sobrien# Now more specific configurations 5494548Sobrien# 5594548Sobrien 5694548Sobriencase "${host}" in 5794548Sobrien 5894548Sobrien*-*-linux*aout* | *-*-linux*oldld | *-*-linux*libc1*) 5994548Sobrien # No further tweaking needed 6094548Sobrien ;; 6194548Sobrien 6238889Sjdpalpha*-*-netbsd*) 6333965Sjdp HOSTING_CRT0=/usr/lib/crt0.o 6433965Sjdp ;; 6533965Sjdp 6660484Sobrienarm*-*-linux-gnu*) 6794548Sobrien HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux,g"` 6860484Sobrien ;; 6960484Sobrien 70104844Sobrienhppa*64*-*-hpux11*) 71104844Sobrien NATIVE_LIB_DIRS=/usr/lib/pa20_64 72104844Sobrien HOSTING_CRT0=/usr/ccs/lib/pa20_64/crt0.o 73104844Sobrien # Even if CC is not gcc, the tests use gcc. 74104844Sobrien 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' 75104844Sobrien ;; 76104844Sobrien 7777317Sobrieni[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34567]86-*-freebsd*aout* | i[3456]86-*-netbsd*) 7860524Sobrien HOSTING_CRT0=/usr/lib/crt0.o 7960484Sobrien ;; 8060484Sobrien 8133965Sjdpi[3456]86-*-sysv4*) 8260484Sobrien 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`' 8394548Sobrien 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' 84104844Sobrien NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' 8533965Sjdp ;; 8633965Sjdp 8733965Sjdpi[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*) 8860484Sobrien HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 8994548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' 9033965Sjdp ;; 9133965Sjdp 9233965Sjdpi[3456]86-*-sysv*) 9333965Sjdp HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`' 9494548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o' 9533965Sjdp ;; 9633965Sjdp 9733965Sjdpi[3456]86-*-solaris*) 9860484Sobrien 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`' 9994548Sobrien 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`' 100104844Sobrien NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' 10133965Sjdp ;; 10233965Sjdp 10333965Sjdpi[3456]86-*-sco* | i[3456]86-*-isc*) 10433965Sjdp # In some configurations gcc does not use crtbegin.o and crtend.o. 10533965Sjdp # In that case gcc -print-file-name=crtbegin.o will simply print 10633965Sjdp # crtbegin.o. We create dummy crtbegin.o and crtend.o files to 10733965Sjdp # handle this. 10833965Sjdp echo "int dummy_crtbegin () { return 0; }" > crtbegin.c 10933965Sjdp ${CC} -c crtbegin.c -o crtbegin.o 11033965Sjdp rm -f crtbegin.c 11133965Sjdp echo "int dummy_crteng () { return 0; }" > crtend.c 11233965Sjdp ${CC} -c crtend.c -o crtend.o 11333965Sjdp rm -f crtend.c 11460484Sobrien HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 11594548Sobrien 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' 11633965Sjdp ;; 11733965Sjdp 11833965Sjdpi[3456]86-*-lynxos*) 11933965Sjdp HOSTING_CRT0=/lib/init1.o 12094548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o' 12133965Sjdp ;; 12233965Sjdp 12360484Sobrieni[3456]86-pc-interix*) 12460484Sobrien HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o' 125104844Sobrien NATIVE_LIB_DIRS='/usr/local/lib $$INTERIX_ROOT/usr/lib /lib /usr/lib' 12694548Sobrien 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' 12760484Sobrien ;; 12860484Sobrien 12977317Sobrieni[3456]86-*-cygwin*) 13094548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`' 13177317Sobrien ;; 13277317Sobrien 13377317Sobrienia64-*-linux-gnu*) 13494548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"` 13577317Sobrien ;; 13677317Sobrien 13789870Sobrienia64-*-aix*) 13889870Sobrien 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`' 13994548Sobrien 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`' 140104844Sobrien NATIVE_LIB_DIRS='/usr/local/lib /usr/lib/ia64l64 /lib /usr/lib' 14189870Sobrien ;; 14289870Sobrien 14333965Sjdpmips*-dec-bsd*) 14433965Sjdp HOSTING_CRT0=/usr/lib/crt0.o 14533965Sjdp ;; 14633965Sjdp 14794548Sobrienmips*-sgi-irix4* | mips*-sgi-irix5*) 14833965Sjdp HOSTING_CRT0=/usr/lib/crt1.o 14994548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o' 15033965Sjdp ;; 15133965Sjdp 15260484Sobrienmips*-sgi-irix6*) 15360484Sobrien HOSTING_CRT0='/usr/lib32/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o ; else ${CC} -print-file-name=crtbegin.o; fi`' 15494548Sobrien 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' 15560484Sobrien ;; 15660484Sobrien 15760484Sobrienmips*-*-linux-gnu*) 15894548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"` 15960484Sobrien ;; 16060484Sobrien 16138889Sjdpm68*-*-linux-gnu*) 16294548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"` 16338889Sjdp ;; 16438889Sjdp 16533965Sjdpm68*-*-lynxos*) 16633965Sjdp HOSTING_CRT0=/lib/init1.o 16794548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o' 16833965Sjdp ;; 16933965Sjdp 17033965Sjdpm68*-motorola-sysv) 17160484Sobrien 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`' 17294548Sobrien HOSTING_LIBS=`echo "$HOSTING_LIBS" | sed -e "s,-lc,-lc881,"` 17333965Sjdp ;; 17433965Sjdp 17533965Sjdpm68*-sun-*) 17633965Sjdp HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o' 17733965Sjdp ;; 17833965Sjdp 17933965Sjdpm88*-*-dgux*) 18033965Sjdp HDEFINES=-D__using_DGUX 18133965Sjdp HOSTING_CRT0='/lib/crt0.o -X' 18233965Sjdp HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a 18333965Sjdp ;; 18433965Sjdp 18533965Sjdpm88*-motorola-sysv3) 18660484Sobrien HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 18794548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' 18833965Sjdp ;; 18933965Sjdp 19060484Sobrienpowerpc*-*-linux-gnu*) 19194548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"` 19260484Sobrien ;; 19360484Sobrien 19489870Sobriens390x-*-linux-gnu*) 19594548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld64.so.1,"` 19689870Sobrien ;; 19789870Sobrien 19889870Sobriens390-*-linux-gnu*) 19994548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"` 20089870Sobrien ;; 20189870Sobrien 20233965Sjdpsparc*-*-solaris2*) 20360484Sobrien 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`' 20494548Sobrien 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`' 205104844Sobrien NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' 20633965Sjdp ;; 20733965Sjdp 20860484Sobriensparc-*-linux-gnu*) 20994548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld-linux.so.2,"` 21060484Sobrien ;; 21160484Sobrien 21260484Sobriensparc64-*-linux-gnu*) 21394548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux.so.2,"` 21460484Sobrien ;; 21560484Sobrien 21689870Sobrienx86_64-*-linux-gnu*) 21794548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"` 21889870Sobrien ;; 21989870Sobrien 22077317Sobrien*-*-freebsd*) 22177317Sobrien ;; 22277317Sobrien 22389870Sobrien*-*-linux*) 22489870Sobrien ;; 22589870Sobrien 22699470Sobrien*-*-netbsd*) 22799470Sobrien # NetBSD typically does not use the GCC crtstuff, so ignore it. 22899470Sobrien HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crtbegin.o' 22999470Sobrien 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' 23099470Sobrien ;; 23199470Sobrien 23277317Sobrienalpha*-*-*) 23377317Sobrien HOSTING_CRT0=/usr/ccs/lib/crt0.o 234104844Sobrien NATIVE_LIB_DIRS='/usr/local/lib /usr/ccs/lib /lib /usr/lib' 23577317Sobrien ;; 23677317Sobrien 23733965Sjdpesac 238