home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / binutils-2.7-src.tgz / tar.out / fsf / binutils / ld / configure.host < prev    next >
Text File  |  1996-09-28  |  9KB  |  198 lines

  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.
  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. #  RPATH_ENVVAR        environment variable used to find shared libraries
  13.  
  14. HDEFINES=
  15. HOSTING_CRT0=/lib/crt0.o
  16. HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc'
  17. NATIVE_LIB_DIRS=
  18.  
  19. case "${host}" in
  20.  
  21. alpha-*-linux*)
  22.   HOSTING_CRT0=/usr/lib/crt0.o
  23.   ;;
  24.  
  25. alpha-*-*)
  26.   HOSTING_CRT0=/usr/ccs/lib/crt0.o
  27.   NATIVE_LIB_DIRS=/usr/ccs/lib
  28.   ;;
  29.  
  30. i[345]86-*-bsd* | i[345]86-*-freebsd* | i[345]86-*-netbsd*)
  31.   # The new BSD `make' has a bug: it doesn't pass empty arguments in
  32.   # shell commands.  So we need to make this value non-empty in order
  33.   # for the genscripts.sh call to work.  There's nothing magic about
  34.   # the value `/lib'; it's just a dummy.
  35.   NATIVE_LIB_DIRS=/lib
  36.   HOSTING_CRT0=/usr/lib/crt0.o
  37.   ;;
  38.  
  39. i[345]86-*-sysv4*)
  40.   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`'
  41.   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'
  42.   NATIVE_LIB_DIRS=/usr/ccs/lib
  43.   ;;
  44.  
  45. i[345]86-sequent-ptx* | i[345]86-sequent-sysv*)
  46.   HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
  47.   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`'
  48.   ;;
  49.  
  50. i[345]86-*-sysv*)
  51.   HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; fi`'
  52.   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'
  53.   ;;
  54.  
  55. i[345]86-*-solaris*)
  56.   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`'
  57.   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`'
  58.   NATIVE_LIB_DIRS=/usr/ccs/lib
  59.   ;;
  60.  
  61. i[345]86-*-sco* | i[345]86-*-isc*)
  62.   # In some configurations gcc does not use crtbegin.o and crtend.o.
  63.   # In that case gcc -print-file-name=crtbegin.o will simply print
  64.   # crtbegin.o.  We create dummy crtbegin.o and crtend.o files to
  65.   # handle this.
  66.   echo "int dummy_crtbegin () { return 0; }" > crtbegin.c
  67.   ${CC} -c crtbegin.c -o crtbegin.o
  68.   rm -f crtbegin.c
  69.   echo "int dummy_crteng () { return 0; }" > crtend.c
  70.   ${CC} -c crtend.c -o crtend.o
  71.   rm -f crtend.c
  72.   HOSTING_CRT0='/lib/crt1.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
  73.   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'
  74.   ;;
  75.  
  76. i[345]86-*-linuxaout* | i[345]86-*-linuxoldld)
  77.   HOSTING_CRT0=/usr/lib/crt0.o
  78.   ;;
  79.  
  80. i[345]86-*-linux*)
  81.   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`'
  82.   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'
  83.   ;;
  84.  
  85. i[345]86-*-lynxos*)
  86.   HOSTING_CRT0=/lib/init1.o
  87.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
  88.   ;;
  89.  
  90. mips*-dec-bsd*)
  91.   HOSTING_CRT0=/usr/lib/crt0.o
  92.   ;;
  93.  
  94. mips*-sgi-irix4*)
  95.   HOSTING_CRT0=/usr/lib/crt1.o
  96.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
  97.   ;;
  98.  
  99. mips*-sgi-irix5*)
  100.   HOSTING_CRT0=/usr/lib/crt1.o
  101.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc /usr/lib/crtn.o'
  102.   ;;
  103.  
  104. m68*-*-amigaos*)
  105.   HDEFINES=-mstackextend
  106.   ;;
  107.  
  108. m68*-*-linuxaout*)
  109.   HOSTING_CRT0=/usr/lib/crt0.o
  110.   ;;
  111.  
  112. m68*-*-linux*)
  113.   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`'
  114.   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.   ;;
  116.  
  117. m68*-*-lynxos*)
  118.   HOSTING_CRT0=/lib/init1.o
  119.   HOSTING_LIBS='`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc -lm /lib/initn.o'
  120.   ;;
  121.  
  122. m68*-motorola-sysv)
  123.   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`'
  124.   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`'
  125.   ;;
  126.  
  127. m68*-sun-*)
  128.   HOSTING_CRT0='/usr/lib/crt0.o /usr/lib/Fcrt1.o -L/usr/lib/fsoft.o'
  129.   ;;
  130.  
  131. m88*-*-dgux*)
  132.   HDEFINES=-D__using_DGUX
  133.   HOSTING_CRT0='/lib/crt0.o -X'
  134.   HOSTING_LIBS=/usr/sde/m88kbcs/lib/libc.a
  135.   ;;
  136.  
  137. m88*-motorola-sysv3)
  138.   HOSTING_CRT0='/lib/crt0.o `if [ -f ../gcc/crtbegin.o ]; then echo ../gcc/crtbegin.o; else gcc -print-file-name=crtbegin.o; fi`'
  139.   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`'
  140.   ;;
  141.  
  142. romp-*-*)
  143.   HDEFINES=-DNO_VARARGS
  144.   ;;
  145.  
  146. sparc*-*-solaris2*)
  147.   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`'
  148.   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`'
  149.   NATIVE_LIB_DIRS=/usr/ccs/lib
  150.   ;;
  151.  
  152. esac
  153.  
  154. HLDFLAGS=
  155. RPATH_ENVVAR=LD_LIBRARY_PATH
  156. # If we have shared libraries, try to set rpath reasonably.
  157. if test "${shared}" = "true"; then
  158.   case "${host}" in
  159.   *-*-hpux*)
  160.     HLDFLAGS='-Wl,+s,+b,$(libdir)'
  161.     RPATH_ENVVAR=SHLIB_PATH
  162.     ;;
  163.   *-*-irix5*)
  164.     HLDFLAGS='-Wl,-rpath,$(libdir)'
  165.     ;;
  166.   *-*-linux*aout*)
  167.     ;;
  168.   *-*-linux*)
  169.     HLDFLAGS='-Wl,-rpath,$(libdir)'
  170.     ;;
  171.   *-*-sysv4* | *-*-solaris*)
  172.     HLDFLAGS='-R $(libdir)'
  173.     ;;
  174.   esac
  175. fi
  176.  
  177. # On SunOS, if the linker supports the -rpath option, use it to
  178. # prevent ../bfd and ../opcodes from being included in the run time
  179. # search path.
  180. case "${host}" in
  181.   *-*-sunos*)
  182.     echo 'main () { }' > conftest.c
  183.     ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
  184.     if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
  185.       :
  186.     elif grep 'No such file' conftest.t >/dev/null 2>&1; then
  187.       :
  188.     elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
  189.       :
  190.     elif test "${shared}" = "true"; then
  191.       HLDFLAGS='-Wl,-rpath=$(libdir)'
  192.     else
  193.       HLDFLAGS='-Wl,-rpath='
  194.     fi
  195.     rm -f conftest.t conftest.c conftest
  196.     ;;
  197. esac
  198.