home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gdb-4.16-base.tgz / gdb-4.16-base.tar / fsf / gdb / opcodes / configure.in < prev    next >
Text File  |  1996-04-23  |  6KB  |  217 lines

  1. AC_PREREQ(2.0)
  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.   *)   AC_MSG_ERROR([bad value ${enableval} for opcodes shared option]) ;;
  32. esac])dnl
  33. AC_ARG_ENABLE(commonbfdlib,
  34. [  --enable-commonbfdlib   build shared BFD/opcodes/libiberty library],
  35. [case "${enableval}" in
  36.   yes) commonbfdlib=true ;;
  37.   no)  commonbfdlib=false ;;
  38.   *)   AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;;
  39. esac])dnl
  40.  
  41. AC_CONFIG_HEADER(config.h:config.in)
  42.  
  43. AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
  44. AC_CANONICAL_SYSTEM
  45. if test -z "$target" ; then
  46.     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
  47. fi
  48. AC_ARG_PROGRAM
  49.  
  50. # host-specific stuff:
  51.  
  52. ALLLIBS='$(TARGETLIB)'
  53. PICFLAG=
  54. SHLIB=unused-shlib
  55. SHLINK=unused-shlink
  56. if test "${shared}" = "true"; then
  57.   ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
  58.   PICFLAG=-fpic
  59.   if test "${commonbfdlib}" = "true"; then
  60. changequote(,)dnl
  61.     SHLIB=../bfd/libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
  62. changequote([,])dnl
  63.     SHLINK=../bfd/libbfd.so
  64.   else
  65. changequote(,)dnl
  66.     SHLIB=libopcodes.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
  67. changequote([,])dnl
  68.     SHLINK=libopcodes.so
  69.   fi
  70. fi
  71.  
  72. AC_PROG_CC
  73.  
  74. . ${srcdir}/../bfd/configure.host
  75.  
  76. AC_SUBST(HDEFINES)
  77. AC_CHECK_TOOL(AR, ar)
  78. AC_CHECK_TOOL(RANLIB, ranlib, :)
  79. AC_PROG_INSTALL
  80.  
  81. if test "${shared}" = "true"; then
  82.   if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
  83.     AC_MSG_WARN([opcodes --enable-shared only supported when using gcc])
  84.     shared=false
  85.     ALLLIBS='$(TARGETLIB)'
  86.     PICFLAG=
  87.     SHLIB=unused-shlib
  88.   fi
  89. fi
  90.  
  91. AC_SUBST(ALLLIBS)
  92. AC_SUBST(PICFLAG)
  93. AC_SUBST(SHLIB)
  94. AC_SUBST(SHLIB_CC)
  95. AC_SUBST(SHLIB_CFLAGS)
  96. if test "${commonbfdlib}" = "true"; then
  97.   COMMON_SHLIB=yes
  98.   # Rebuild the shared library if libiberty or libbfd changes.
  99.   SHLIB_DEP="../libiberty/libiberty.a ../bfd/libbfd.a"
  100. else
  101.   COMMON_SHLIB=
  102.   SHLIB_DEP=
  103. fi
  104. AC_SUBST(COMMON_SHLIB)
  105. AC_SUBST(SHLIB_DEP)
  106. AC_SUBST(SHLINK)
  107.  
  108. AC_CHECK_HEADERS(string.h strings.h)
  109.  
  110. # target-specific stuff:
  111.  
  112. # Canonicalize the secondary target names.
  113. if test -n "$enable_targets" ; then
  114.     for targ in `echo $enable_targets | sed 's/,/ /g'`
  115.     do
  116.     result=`$ac_config_sub $targ 2>/dev/null`
  117.     if test -n "$result" ; then
  118.         canon_targets="$canon_targets $result"
  119.     else
  120.         # Allow targets that config.sub doesn't recognize, like "all".
  121.         canon_targets="$canon_targets $targ"
  122.     fi
  123.     done
  124. fi
  125.  
  126. all_targets=false
  127. selarchs=
  128. for targ in $target $canon_targets
  129. do
  130.     if test "x$targ" = "xall" ; then
  131.         all_targets=true
  132.     else
  133.     . $srcdir/../bfd/config.bfd
  134.     selarchs="$selarchs $targ_archs"
  135.     fi
  136. done    
  137.  
  138. # We don't do any links based on the target system, just makefile config.
  139.  
  140. if test x${all_targets} = xfalse ; then
  141.  
  142.     # Target architecture .o files.
  143.     ta=
  144.  
  145.     for arch in $selarchs
  146.     do
  147.     ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
  148.     archdefs="$archdefs -DARCH_$ad"
  149.     case "$arch" in
  150.     bfd_a29k_arch)        ta="$ta a29k-dis.o" ;;
  151.     bfd_alliant_arch)    ;;
  152.     bfd_alpha_arch)        ta="$ta alpha-dis.o" ;;
  153.     bfd_arm_arch)        ta="$ta arm-dis.o" ;;
  154.     bfd_convex_arch)    ;;
  155.     bfd_h8300_arch)        ta="$ta h8300-dis.o" ;;
  156.     bfd_h8500_arch)        ta="$ta h8500-dis.o" ;;
  157.     bfd_hppa_arch)        ta="$ta hppa-dis.o" ;;
  158.     bfd_i386_arch)        ta="$ta i386-dis.o" ;;
  159.     bfd_i860_arch)        ;;
  160.     bfd_i960_arch)        ta="$ta i960-dis.o" ;;
  161.     bfd_m68k_arch)        ta="$ta m68k-dis.o m68k-opc.o" ;;
  162.     bfd_m88k_arch)        ta="$ta m88k-dis.o" ;;
  163.     bfd_mips_arch)        ta="$ta mips-dis.o mips-opc.o" ;;
  164.     bfd_ns32k_arch)        ta="$ta ns32k-dis.o" ;;
  165.     bfd_powerpc_arch)    ta="$ta ppc-dis.o ppc-opc.o" ;;
  166.     bfd_pyramid_arch)    ;;
  167.     bfd_romp_arch)        ;;
  168.     bfd_rs6000_arch)    ta="$ta ppc-dis.o ppc-opc.o" ;;
  169.     bfd_sh_arch)        ta="$ta sh-dis.o" ;;
  170.     bfd_sparc_arch)        ta="$ta sparc-dis.o sparc-opc.o" ;;
  171.     bfd_tahoe_arch)        ;;
  172.     bfd_vax_arch)        ;;
  173.     bfd_w65_arch)        ta="$ta w65-dis.o" ;;
  174.     bfd_we32k_arch)        ;;
  175.     bfd_z8k_arch)        ta="$ta z8k-dis.o" ;;
  176.  
  177.     "")            ;;
  178.     *)        AC_MSG_ERROR(*** unknown target architecture $arch) ;;
  179.     esac
  180.     done
  181.  
  182.     # Weed out duplicate .o files.
  183.     f=""
  184.     for i in $ta ; do
  185.     case " $f " in
  186.     *" $i "*) ;;
  187.     *) f="$f $i" ;;
  188.     esac
  189.     done
  190.     ta="$f"
  191.  
  192.     # And duplicate -D flags.
  193.     f=""
  194.     for i in $archdefs ; do
  195.     case " $f " in
  196.     *" $i "*) ;;
  197.     *) f="$f $i" ;;
  198.     esac
  199.     done
  200.     archdefs="$f"
  201.  
  202.     BFD_MACHINES="$ta"
  203.  
  204. else    # all_targets is true
  205.     archdefs=-DARCH_all
  206.     BFD_MACHINES='$(ALL_MACHINES)'
  207. fi
  208.  
  209. AC_SUBST(archdefs)
  210. AC_SUBST(BFD_MACHINES)
  211.  
  212. AC_OUTPUT(Makefile,
  213. [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])
  214.