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

  1. AC_PREREQ(2.5)
  2. AC_INIT(z8k-dis.c)
  3. #    configure.in script for the opcodes library.
  4. #    Copyright (C) 1995, 1996 Free Software Foundation, Inc.
  5. #    Written by Cygnus Support.
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2 of the License, or
  9. # (at your option) any later version.
  10. # This program is distributed in the hope that it will be useful,
  11. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. # GNU General Public License for more details.
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  
  18. AC_ARG_ENABLE(targets,
  19. [  --enable-targets        alternative target configurations],
  20. [case "${enableval}" in
  21.   yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
  22.             ;;
  23.   no)       enable_targets= ;;
  24.   *)        enable_targets=$enableval ;;
  25. esac])dnl
  26. AC_ARG_ENABLE(shared,
  27. [  --enable-shared         build shared opcodes library],
  28. [case "${enableval}" in
  29.   yes) shared=true ;;
  30.   no)  shared=false ;;
  31.   *opcodes*) shared=true ;;
  32.   *) shared=false ;;
  33. esac])dnl
  34. AC_ARG_ENABLE(commonbfdlib,
  35. [  --enable-commonbfdlib   build shared BFD/opcodes/libiberty library],
  36. [case "${enableval}" in
  37.   yes) commonbfdlib=true ;;
  38.   no)  commonbfdlib=false ;;
  39.   *)   AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;;
  40. esac])dnl
  41.  
  42. AC_CONFIG_HEADER(config.h:config.in)
  43.  
  44. AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
  45. AC_CANONICAL_SYSTEM
  46. if test -z "$target" ; then
  47.     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
  48. fi
  49. AC_ARG_PROGRAM
  50.  
  51. # host-specific stuff:
  52.  
  53. ALLLIBS='$(TARGETLIB)'
  54. PICFLAG=
  55. SHLIB=unused-shlib
  56. SHLINK=unused-shlink
  57. if test "${shared}" = "true"; then
  58.   ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
  59.   PICFLAG=-fpic
  60.   if test "${commonbfdlib}" = "true"; then
  61. changequote(,)dnl
  62.     SHLIB=../bfd/libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
  63. changequote([,])dnl
  64.     SHLINK=../bfd/libbfd.so
  65.   else
  66. changequote(,)dnl
  67.     SHLIB=libopcodes.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
  68. changequote([,])dnl
  69.     SHLINK=libopcodes.so
  70.   fi
  71. fi
  72.  
  73. AC_PROG_CC
  74.  
  75. . ${srcdir}/../bfd/configure.host
  76.  
  77. AC_SUBST(HDEFINES)
  78. AC_CHECK_TOOL(AR, ar)
  79. AC_CHECK_TOOL(RANLIB, ranlib, :)
  80. AC_PROG_INSTALL
  81.  
  82. if test "${shared}" = "true"; then
  83.   if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
  84.     AC_MSG_WARN([opcodes --enable-shared only supported when using gcc])
  85.     shared=false
  86.     ALLLIBS='$(TARGETLIB)'
  87.     PICFLAG=
  88.     SHLIB=unused-shlib
  89.   fi
  90. fi
  91.  
  92. AC_SUBST(ALLLIBS)
  93. AC_SUBST(PICFLAG)
  94. AC_SUBST(SHLIB)
  95. AC_SUBST(SHLIB_CC)
  96. AC_SUBST(SHLIB_CFLAGS)
  97. if test "${commonbfdlib}" = "true"; then
  98.   COMMON_SHLIB=yes
  99.   # Rebuild the shared library if libiberty or libbfd changes.
  100.   SHLIB_DEP="../libiberty/libiberty.a ../bfd/libbfd.a"
  101.   BFD_PICLIST=../bfd/piclist
  102. else
  103.   COMMON_SHLIB=
  104.   SHLIB_DEP=
  105.   BFD_PICLIST=
  106. fi
  107. AC_SUBST(COMMON_SHLIB)
  108. AC_SUBST(SHLIB_DEP)
  109. AC_SUBST(BFD_PICLIST)
  110. AC_SUBST(SHLINK)
  111.  
  112. AC_CHECK_HEADERS(string.h strings.h)
  113.  
  114. # target-specific stuff:
  115.  
  116. # Canonicalize the secondary target names.
  117. if test -n "$enable_targets" ; then
  118.     for targ in `echo $enable_targets | sed 's/,/ /g'`
  119.     do
  120.     result=`$ac_config_sub $targ 2>/dev/null`
  121.     if test -n "$result" ; then
  122.         canon_targets="$canon_targets $result"
  123.     else
  124.         # Allow targets that config.sub doesn't recognize, like "all".
  125.         canon_targets="$canon_targets $targ"
  126.     fi
  127.     done
  128. fi
  129.  
  130. all_targets=false
  131. selarchs=
  132. for targ in $target $canon_targets
  133. do
  134.     if test "x$targ" = "xall" ; then
  135.         all_targets=true
  136.     else
  137.     . $srcdir/../bfd/config.bfd
  138.     selarchs="$selarchs $targ_archs"
  139.     fi
  140. done    
  141.  
  142. # We don't do any links based on the target system, just makefile config.
  143.  
  144. if test x${all_targets} = xfalse ; then
  145.  
  146.     # Target architecture .o files.
  147.     ta=
  148.  
  149.     for arch in $selarchs
  150.     do
  151.     ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
  152.     archdefs="$archdefs -DARCH_$ad"
  153.     case "$arch" in
  154.     bfd_a29k_arch)        ta="$ta a29k-dis.o" ;;
  155.     bfd_alliant_arch)    ;;
  156.     bfd_alpha_arch)        ta="$ta alpha-dis.o alpha-opc.o" ;;
  157.     bfd_arm_arch)        ta="$ta arm-dis.o" ;;
  158.     bfd_convex_arch)    ;;
  159.     bfd_h8300_arch)        ta="$ta h8300-dis.o" ;;
  160.     bfd_h8500_arch)        ta="$ta h8500-dis.o" ;;
  161.     bfd_hppa_arch)        ta="$ta hppa-dis.o" ;;
  162.     bfd_i386_arch)        ta="$ta i386-dis.o" ;;
  163.     bfd_i860_arch)        ;;
  164.     bfd_i960_arch)        ta="$ta i960-dis.o" ;;
  165.     bfd_m68k_arch)        ta="$ta m68k-dis.o m68k-opc.o" ;;
  166.     bfd_m88k_arch)        ta="$ta m88k-dis.o" ;;
  167.     bfd_mips_arch)        ta="$ta mips-dis.o mips-opc.o" ;;
  168.     bfd_ns32k_arch)        ta="$ta ns32k-dis.o" ;;
  169.     bfd_powerpc_arch)    ta="$ta ppc-dis.o ppc-opc.o" ;;
  170.     bfd_pyramid_arch)    ;;
  171.     bfd_romp_arch)        ;;
  172.     bfd_rs6000_arch)    ta="$ta ppc-dis.o ppc-opc.o" ;;
  173.     bfd_sh_arch)        ta="$ta sh-dis.o" ;;
  174.     bfd_sparc_arch)        ta="$ta sparc-dis.o sparc-opc.o" ;;
  175.     bfd_tahoe_arch)        ;;
  176.     bfd_vax_arch)        ;;
  177.     bfd_w65_arch)        ta="$ta w65-dis.o" ;;
  178.     bfd_we32k_arch)        ;;
  179.     bfd_z8k_arch)        ta="$ta z8k-dis.o" ;;
  180.  
  181.     "")            ;;
  182.     *)        AC_MSG_ERROR(*** unknown target architecture $arch) ;;
  183.     esac
  184.     done
  185.  
  186.     # Weed out duplicate .o files.
  187.     f=""
  188.     for i in $ta ; do
  189.     case " $f " in
  190.     *" $i "*) ;;
  191.     *) f="$f $i" ;;
  192.     esac
  193.     done
  194.     ta="$f"
  195.  
  196.     # And duplicate -D flags.
  197.     f=""
  198.     for i in $archdefs ; do
  199.     case " $f " in
  200.     *" $i "*) ;;
  201.     *) f="$f $i" ;;
  202.     esac
  203.     done
  204.     archdefs="$f"
  205.  
  206.     BFD_MACHINES="$ta"
  207.  
  208. else    # all_targets is true
  209.     archdefs=-DARCH_all
  210.     BFD_MACHINES='$(ALL_MACHINES)'
  211. fi
  212.  
  213. AC_SUBST(archdefs)
  214. AC_SUBST(BFD_MACHINES)
  215.  
  216. AC_OUTPUT(Makefile,
  217. [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
  218.