1 dnl Process this file with autoconf to produce a configure script.
4 dnl Default to a non shared library. This may be overridden by the
5 dnl configure option --enable-shared. The divert stuff is a hack
6 dnl to set the variable before argument parsing is done.
7 divert(AC_DIVERSION_INIT)
16 AM_INIT_AUTOMAKE(opcodes, 2.8.2)
18 dnl These must be called before AM_PROG_LIBTOOL, because it may want
19 dnl to call AC_CHECK_PROG.
21 AC_CHECK_TOOL(RANLIB, ranlib, :)
25 AC_ARG_ENABLE(targets,
26 [ --enable-targets alternative target configurations],
27 [case "${enableval}" in
28 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
30 no) enable_targets= ;;
31 *) enable_targets=$enableval ;;
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]) ;;
41 AM_CONFIG_HEADER(config.h:config.in)
43 if test -z "$target" ; then
44 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
52 # host-specific stuff:
56 . ${srcdir}/../bfd/configure.host
61 AC_CHECK_HEADERS(string.h strings.h stdlib.h)
63 # target-specific stuff:
65 # Canonicalize the secondary target names.
66 if test -n "$enable_targets" ; then
67 for targ in `echo $enable_targets | sed 's/,/ /g'`
69 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
70 if test -n "$result" ; then
71 canon_targets="$canon_targets $result"
73 # Allow targets that config.sub doesn't recognize, like "all".
74 canon_targets="$canon_targets $targ"
81 for targ in $target $canon_targets
83 if test "x$targ" = "xall" ; then
86 . $srcdir/../bfd/config.bfd
87 selarchs="$selarchs $targ_archs"
91 # Utility var, documents generic cgen support files.
93 cgen_files="cgen-opc.lo cgen-asm.lo cgen-dis.lo"
95 # We don't do any links based on the target system, just makefile config.
97 if test x${all_targets} = xfalse ; then
99 # Target architecture .o files.
102 for arch in $selarchs
104 ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
105 archdefs="$archdefs -DARCH_$ad"
107 bfd_a29k_arch) ta="$ta a29k-dis.lo" ;;
109 bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;;
110 bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo" ;;
111 bfd_arm_arch) ta="$ta arm-dis.lo" ;;
113 bfd_d10v_arch) ta="$ta d10v-dis.lo d10v-opc.lo" ;;
114 # start-sanitize-d30v
115 bfd_d30v_arch) ta="$ta d30v-dis.lo d30v-opc.lo" ;;
117 bfd_h8300_arch) ta="$ta h8300-dis.lo" ;;
118 bfd_h8500_arch) ta="$ta h8500-dis.lo" ;;
119 bfd_hppa_arch) ta="$ta hppa-dis.lo" ;;
120 bfd_i386_arch) ta="$ta i386-dis.lo" ;;
122 bfd_i960_arch) ta="$ta i960-dis.lo" ;;
123 bfd_m32r_arch) ta="$ta $cgen_files m32r-opc.lo m32r-asm.lo m32r-dis.lo" ;;
124 bfd_m68k_arch) ta="$ta m68k-dis.lo m68k-opc.lo" ;;
125 bfd_m88k_arch) ta="$ta m88k-dis.lo" ;;
126 bfd_mips_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo" ;;
127 bfd_mn10200_arch) ta="$ta m10200-dis.lo m10200-opc.lo" ;;
128 bfd_mn10300_arch) ta="$ta m10300-dis.lo m10300-opc.lo" ;;
129 bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;;
130 bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
133 bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
134 bfd_sh_arch) ta="$ta sh-dis.lo" ;;
135 bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;;
137 # start-sanitize-tic80
138 bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;;
141 bfd_txvu_arch) ta="$ta txvu-dis.lo txvu-opc.lo" ;;
143 bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
144 # start-sanitize-v850e
145 bfd_v850e_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
146 bfd_v850ea_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
149 bfd_w65_arch) ta="$ta w65-dis.lo" ;;
151 bfd_z8k_arch) ta="$ta z8k-dis.lo" ;;
154 *) AC_MSG_ERROR(*** unknown target architecture $arch) ;;
158 # Weed out duplicate .o files.
168 # And duplicate -D flags.
170 for i in $archdefs ; do
180 else # all_targets is true
182 BFD_MACHINES='$(ALL_MACHINES)'
186 AC_SUBST(BFD_MACHINES)