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.in < prev    next >
Text File  |  1996-09-28  |  3KB  |  137 lines

  1. dnl Process this file with autoconf to produce a configure script
  2. dnl
  3. AC_PREREG(2.5)
  4. AC_INIT(ldmain.c)
  5.  
  6. AC_ARG_ENABLE(targets,
  7. [  --enable-targets        alternative target configurations],
  8. [case "${enableval}" in
  9.   yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
  10.             ;;
  11.   no)       enable_targets= ;;
  12.   *)        enable_targets=$enableval ;;
  13. esac])dnl
  14. AC_ARG_ENABLE(shared,
  15. [  --enable-shared         build shared BFD library],
  16. [case "${enableval}" in
  17.   yes) shared=true ;;
  18.   no)  shared=false ;;
  19.   *bfd*) shared=true ;;
  20.   *) shared=false ;;
  21. esac])dnl
  22.  
  23. AC_CONFIG_HEADER(config.h:config.in)
  24.  
  25. AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
  26. AC_CANONICAL_SYSTEM
  27. if test -z "$target" ; then
  28.     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
  29. fi
  30. if test -z "$host" ; then
  31.     AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
  32. fi
  33. AC_ARG_PROGRAM
  34.  
  35. # host-specific stuff:
  36.  
  37. AC_PROG_CC
  38. AC_PROG_INSTALL
  39.  
  40. . ${srcdir}/configure.host
  41.  
  42. AC_SUBST(HLDFLAGS)
  43. AC_SUBST(RPATH_ENVVAR)
  44. AC_SUBST(HDEFINES)
  45. AC_SUBST(HOSTING_CRT0)
  46. AC_SUBST(HOSTING_LIBS)
  47. AC_SUBST(NATIVE_LIB_DIRS)
  48.  
  49. # For most hosts we can use a simple definition to pick up the BFD and
  50. # opcodes libraries.  However, if we are building shared libraries, we
  51. # need to handle some hosts specially.
  52. BFDLIB='-L../bfd -lbfd'
  53. case "${host}" in
  54. *-*-sunos*)
  55.   # On SunOS, we must link against the name we are going to install,
  56.   # not -lbfd, since SunOS does not support SONAME.
  57.   if test "${shared}" = "true"; then
  58.     BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
  59.   fi
  60.   ;;
  61. alpha*-*-osf*)
  62.   # On Alpha OSF/1, the native linker searches all the -L
  63.   # directories for any LIB.so files, and only then searches for any
  64.   # LIB.a files.  That means that if there is an installed
  65.   # libbfd.so, but this build is not done with --enable-shared, the
  66.   # link will wind up being against the install libbfd.so rather
  67.   # than the newly built libbfd.  To avoid this, we must explicitly
  68.   # link against libbfd.a when --enable-shared is not used.
  69.   if test "${shared}" != "true"; then
  70.     BFDLIB='../bfd/libbfd.a'
  71.   fi
  72.   ;;
  73. esac
  74. AC_SUBST(BFDLIB)
  75.  
  76. AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
  77. AC_CHECK_FUNCS(sbrk)
  78. AC_HEADER_DIRENT
  79.  
  80. BFD_BINARY_FOPEN
  81.  
  82. BFD_NEED_DECLARATION(free)
  83.  
  84. # target-specific stuff:
  85.  
  86. all_targets=
  87. EMUL=
  88. all_emuls=
  89. TDIRS=
  90.  
  91. for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
  92. do
  93.   if test "$targ_alias" = "all"; then
  94.     all_targets=true
  95.   else
  96.     # Canonicalize the secondary target names.
  97.     result=`$ac_config_sub $targ_alias 2>/dev/null`
  98.     if test -n "$result"; then
  99.     targ=$result
  100.     else
  101.     targ=$targ_alias
  102.     fi
  103.  
  104.     . ${srcdir}/configure.tgt
  105.  
  106.     if test "$targ" = "$target"; then
  107.       EMUL=$targ_emul
  108.     fi
  109.  
  110.     for i in $targ_emul $targ_extra_emuls; do
  111.     case " $all_emuls " in
  112.     *" e${i}.o "*) ;;
  113.     *)
  114.       all_emuls="$all_emuls e${i}.o"
  115.       eval result=\$tdir_$i
  116.       test -z "$result" && result=$targ_alias
  117.       TDIRS="$TDIRS\\
  118. tdir_$i=$result"
  119.       ;;
  120.     esac
  121.     done
  122.   fi
  123. done
  124.  
  125. AC_SUBST(EMUL)
  126. AC_SUBST(TDIRS)
  127.  
  128. if test x${all_targets} = xtrue; then
  129.   EMULATION_OFILES='$(ALL_EMULATIONS)'
  130. else
  131.   EMULATION_OFILES=$all_emuls
  132. fi
  133. AC_SUBST(EMULATION_OFILES)
  134.  
  135. AC_OUTPUT(Makefile,
  136. [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
  137.