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 # start-sanitize-cygnus
65 if test ${USE_MAINTAINER_MODE} = yes ; then
66 for targ in $target $canon_targets
70 m32r-*-*) use_cgen=yes ;;
74 if test $use_cgen = yes ; then
75 AC_CHECK_PROG(SCHEME, guile, guile, guile)
79 # target-specific stuff:
81 # Canonicalize the secondary target names.
82 if test -n "$enable_targets" ; then
83 for targ in `echo $enable_targets | sed 's/,/ /g'`
85 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
86 if test -n "$result" ; then
87 canon_targets="$canon_targets $result"
89 # Allow targets that config.sub doesn't recognize, like "all".
90 canon_targets="$canon_targets $targ"
97 for targ in $target $canon_targets
99 if test "x$targ" = "xall" ; then
102 . $srcdir/../bfd/config.bfd
103 selarchs="$selarchs $targ_archs"
107 # Utility var, documents generic cgen support files.
109 cgen_files="cgen-opc.lo cgen-asm.lo cgen-dis.lo"
111 # We don't do any links based on the target system, just makefile config.
113 if test x${all_targets} = xfalse ; then
115 # Target architecture .o files.
118 for arch in $selarchs
120 ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
121 archdefs="$archdefs -DARCH_$ad"
123 bfd_a29k_arch) ta="$ta a29k-dis.lo" ;;
125 bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;;
126 bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo" ;;
127 bfd_arm_arch) ta="$ta arm-dis.lo" ;;
129 bfd_d10v_arch) ta="$ta d10v-dis.lo d10v-opc.lo" ;;
130 # start-sanitize-d30v
131 bfd_d30v_arch) ta="$ta d30v-dis.lo d30v-opc.lo" ;;
133 bfd_h8300_arch) ta="$ta h8300-dis.lo" ;;
134 bfd_h8500_arch) ta="$ta h8500-dis.lo" ;;
135 bfd_hppa_arch) ta="$ta hppa-dis.lo" ;;
136 bfd_i386_arch) ta="$ta i386-dis.lo" ;;
138 bfd_i960_arch) ta="$ta i960-dis.lo" ;;
139 bfd_m32r_arch) ta="$ta $cgen_files m32r-opc.lo m32r-asm.lo m32r-dis.lo" ;;
140 bfd_m68k_arch) ta="$ta m68k-dis.lo m68k-opc.lo" ;;
141 bfd_m88k_arch) ta="$ta m88k-dis.lo" ;;
142 bfd_mips_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo" ;;
143 bfd_mn10200_arch) ta="$ta m10200-dis.lo m10200-opc.lo" ;;
144 bfd_mn10300_arch) ta="$ta m10300-dis.lo m10300-opc.lo" ;;
145 bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;;
146 bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
149 bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
150 bfd_sh_arch) ta="$ta sh-dis.lo" ;;
151 bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;;
153 # start-sanitize-tic80
154 bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;;
157 bfd_dvp_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo dvp-dis.lo dvp-opc.lo" ;;
159 bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
160 # start-sanitize-v850e
161 bfd_v850e_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
162 bfd_v850ea_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
165 bfd_w65_arch) ta="$ta w65-dis.lo" ;;
167 bfd_z8k_arch) ta="$ta z8k-dis.lo" ;;
170 *) AC_MSG_ERROR(*** unknown target architecture $arch) ;;
174 # Weed out duplicate .o files.
184 # And duplicate -D flags.
186 for i in $archdefs ; do
196 else # all_targets is true
198 BFD_MACHINES='$(ALL_MACHINES)'
202 AC_SUBST(BFD_MACHINES)