configure.host revision 99470
160524Sobrien# $FreeBSD: head/contrib/binutils/ld/configure.host 99470 2002-07-05 20:42:13Z 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`' 1833965SjdpNATIVE_LIB_DIRS= 1933965Sjdp 2094548Sobrien# 2194548Sobrien# Generic configurations: 2294548Sobrien# 2394548Sobrien 2433965Sjdpcase "${host}" in 2533965Sjdp 2694548Sobrien*-*-freebsd*) 2794548Sobrien NATIVE_LIB_DIRS=/usr/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*) 6338889Sjdp # The new BSD `make' has a bug: it doesn't pass empty arguments in 6438889Sjdp # shell commands. So we need to make this value non-empty in order 6538889Sjdp # for the genscripts.sh call to work. There's nothing magic about 6638889Sjdp # the value `/lib'; it's just a dummy. 6738889Sjdp NATIVE_LIB_DIRS=/lib 6833965Sjdp HOSTING_CRT0=/usr/lib/crt0.o 6933965Sjdp ;; 7033965Sjdp 7160484Sobrienarm*-*-linux-gnu*) 7294548Sobrien HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux,g"` 7360484Sobrien ;; 7460484Sobrien 7577317Sobrieni[3456]86-*-bsd* | i[34567]86-*-freebsd[12] | i[34567]86-*-freebsd[12]\.* | i[34567]86-*-freebsd*aout* | i[3456]86-*-netbsd*) 7660484Sobrien # The new BSD `make' has a bug: it doesn't pass empty arguments in 7760484Sobrien # shell commands. So we need to make this value non-empty in order 7860484Sobrien # for the genscripts.sh call to work. There's nothing magic about 7960484Sobrien # the value `/lib'; it's just a dummy. 8060484Sobrien NATIVE_LIB_DIRS=/lib 8160524Sobrien HOSTING_CRT0=/usr/lib/crt0.o 8260484Sobrien ;; 8360484Sobrien 8433965Sjdpi[3456]86-*-sysv4*) 8560484Sobrien 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`' 8694548Sobrien 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' 8733965Sjdp NATIVE_LIB_DIRS=/usr/ccs/lib 8833965Sjdp ;; 8933965Sjdp 9033965Sjdpi[3456]86-sequent-ptx* | i[3456]86-sequent-sysv*) 9160484Sobrien HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 9294548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' 9333965Sjdp ;; 9433965Sjdp 9533965Sjdpi[3456]86-*-sysv*) 9633965Sjdp HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`' 9794548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; fi` /lib/crtn.o' 9833965Sjdp ;; 9933965Sjdp 10033965Sjdpi[3456]86-*-solaris*) 10160484Sobrien 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`' 10294548Sobrien 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`' 10333965Sjdp NATIVE_LIB_DIRS=/usr/ccs/lib 10433965Sjdp ;; 10533965Sjdp 10633965Sjdpi[3456]86-*-sco* | i[3456]86-*-isc*) 10733965Sjdp # In some configurations gcc does not use crtbegin.o and crtend.o. 10833965Sjdp # In that case gcc -print-file-name=crtbegin.o will simply print 10933965Sjdp # crtbegin.o. We create dummy crtbegin.o and crtend.o files to 11033965Sjdp # handle this. 11133965Sjdp echo "int dummy_crtbegin () { return 0; }" > crtbegin.c 11233965Sjdp ${CC} -c crtbegin.c -o crtbegin.o 11333965Sjdp rm -f crtbegin.c 11433965Sjdp echo "int dummy_crteng () { return 0; }" > crtend.c 11533965Sjdp ${CC} -c crtend.c -o crtend.o 11633965Sjdp rm -f crtend.c 11760484Sobrien HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 11894548Sobrien 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' 11933965Sjdp ;; 12033965Sjdp 12133965Sjdpi[3456]86-*-lynxos*) 12233965Sjdp HOSTING_CRT0=/lib/init1.o 12394548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o' 12433965Sjdp ;; 12533965Sjdp 12660484Sobrieni[3456]86-pc-interix*) 12760484Sobrien HOSTING_CRT0='$$INTERIX_ROOT/usr/lib/crt0.o' 12860484Sobrien NATIVE_LIB_DIRS='$$INTERIX_ROOT/usr/lib/' 12994548Sobrien 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' 13060484Sobrien ;; 13160484Sobrien 13277317Sobrieni[3456]86-*-cygwin*) 13394548Sobrien 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`' 13477317Sobrien ;; 13577317Sobrien 13677317Sobrienia64-*-linux-gnu*) 13794548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"` 13877317Sobrien ;; 13977317Sobrien 14089870Sobrienia64-*-aix*) 14189870Sobrien 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`' 14294548Sobrien 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`' 14389870Sobrien NATIVE_LIB_DIRS=/usr/lib/ia64l64 14489870Sobrien ;; 14589870Sobrien 14633965Sjdpmips*-dec-bsd*) 14733965Sjdp HOSTING_CRT0=/usr/lib/crt0.o 14833965Sjdp ;; 14933965Sjdp 15094548Sobrienmips*-sgi-irix4* | mips*-sgi-irix5*) 15133965Sjdp HOSTING_CRT0=/usr/lib/crt1.o 15294548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' /usr/lib/crtn.o' 15333965Sjdp ;; 15433965Sjdp 15560484Sobrienmips*-sgi-irix6*) 15660484Sobrien HOSTING_CRT0='/usr/lib32/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o ; else ${CC} -print-file-name=crtbegin.o; fi`' 15794548Sobrien 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' 15860484Sobrien ;; 15960484Sobrien 16060484Sobrienmips*-*-linux-gnu*) 16194548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"` 16260484Sobrien ;; 16360484Sobrien 16438889Sjdpm68*-*-linux-gnu*) 16594548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"` 16638889Sjdp ;; 16738889Sjdp 16833965Sjdpm68*-*-lynxos*) 16933965Sjdp HOSTING_CRT0=/lib/init1.o 17094548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' -lm /lib/initn.o' 17133965Sjdp ;; 17233965Sjdp 17333965Sjdpm68*-motorola-sysv) 17460484Sobrien 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`' 17594548Sobrien HOSTING_LIBS=`echo "$HOSTING_LIBS" | sed -e "s,-lc,-lc881,"` 17633965Sjdp ;; 17733965Sjdp 17833965Sjdpm68*-sun-*) 17933965Sjdp HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o' 18033965Sjdp ;; 18133965Sjdp 18233965Sjdpm88*-*-dgux*) 18333965Sjdp HDEFINES=-D__using_DGUX 18433965Sjdp HOSTING_CRT0='/lib/crt0.o -X' 18533965Sjdp HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a 18633965Sjdp ;; 18733965Sjdp 18833965Sjdpm88*-motorola-sysv3) 18960484Sobrien HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else ${CC} -print-file-name=crtbegin.o; fi`' 19094548Sobrien HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`' 19133965Sjdp ;; 19233965Sjdp 19360484Sobrienpowerpc*-*-linux-gnu*) 19494548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"` 19560484Sobrien ;; 19660484Sobrien 19789870Sobriens390x-*-linux-gnu*) 19894548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld64.so.1,"` 19989870Sobrien ;; 20089870Sobrien 20189870Sobriens390-*-linux-gnu*) 20294548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld.so.1,"` 20389870Sobrien ;; 20489870Sobrien 20533965Sjdpsparc*-*-solaris2*) 20660484Sobrien 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`' 20794548Sobrien 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`' 20833965Sjdp NATIVE_LIB_DIRS=/usr/ccs/lib 20933965Sjdp ;; 21033965Sjdp 21160484Sobriensparc-*-linux-gnu*) 21294548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib/ld-linux.so.2,"` 21360484Sobrien ;; 21460484Sobrien 21560484Sobriensparc64-*-linux-gnu*) 21694548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux.so.2,"` 21760484Sobrien ;; 21860484Sobrien 21989870Sobrienx86_64-*-linux-gnu*) 22094548Sobrien HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`egrep.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"` 22189870Sobrien ;; 22289870Sobrien 22377317Sobrien*-*-freebsd*) 22477317Sobrien ;; 22577317Sobrien 22689870Sobrien*-*-linux*) 22789870Sobrien ;; 22889870Sobrien 22999470Sobrien*-*-netbsd*) 23099470Sobrien NATIVE_LIB_DIRS=/usr/lib 23199470Sobrien # NetBSD typically does not use the GCC crtstuff, so ignore it. 23299470Sobrien HOSTING_CRT0='-dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crtbegin.o' 23399470Sobrien 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' 23499470Sobrien ;; 23599470Sobrien 23677317Sobrienalpha*-*-*) 23777317Sobrien HOSTING_CRT0=/usr/ccs/lib/crt0.o 23877317Sobrien NATIVE_LIB_DIRS=/usr/ccs/lib 23977317Sobrien ;; 24077317Sobrien 24177317Sobrienromp-*-*) 24277317Sobrien HDEFINES=-DNO_VARARGS 24377317Sobrien ;; 24477317Sobrien 24533965Sjdpesac 246