3 # configure.in script for the opcodes library.
4 # Copyright (C) 1995 Free Software Foundation, Inc.
5 # Written by Cygnus Support.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 AC_ARG_ENABLE(targets,
22 [ --enable-targets alternative target configurations],
23 [case "${enableval}" in
24 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
26 no) enable_targets= ;;
27 *) enable_targets=$enableval ;;
30 [ --enable-shared build shared opcodes library],
31 [case "${enableval}" in
34 *) AC_MSG_ERROR([bad value ${enableval} for opcodes shared option]) ;;
36 AC_ARG_ENABLE(commonbfdlib,
37 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
38 [case "${enableval}" in
39 yes) commonbfdlib=true ;;
40 no) commonbfdlib=false ;;
41 *) AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;;
44 AC_CONFIG_HEADER(config.h:config.in)
46 AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
48 if test -z "$target" ; then
49 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
53 # host-specific stuff:
55 ALLLIBS='$(TARGETLIB)'
59 if test "${shared}" = "true"; then
60 ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)'
62 if test "${commonbfdlib}" = "true"; then
64 SHLIB=../bfd/libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
66 SHLINK=../bfd/libbfd.so
69 SHLIB=libopcodes.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION`
77 . ${srcdir}/../bfd/configure.host
80 AC_CHECK_PROG(AR, ar, ar, :)
84 if test "${shared}" = "true"; then
85 if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then
86 AC_MSG_WARN([opcodes --enable-shared only supported when using gcc])
97 AC_SUBST(SHLIB_CFLAGS)
98 if test "${commonbfdlib}" = "true"; then
103 AC_SUBST(COMMON_SHLIB)
106 AC_CHECK_HEADERS(string.h strings.h)
108 # target-specific stuff:
110 # Canonicalize the secondary target names.
111 if test -n "$enable_targets" ; then
112 for targ in `echo $enable_targets | sed 's/,/ /g'`
114 result=`$ac_config_sub $targ 2>/dev/null`
115 if test -n "$result" ; then
116 canon_targets="$canon_targets $result"
118 # Allow targets that config.sub doesn't recognize, like "all".
119 canon_targets="$canon_targets $targ"
126 for targ in $target $canon_targets
128 if test "x$targ" = "xall" ; then
131 . $srcdir/../bfd/config.bfd
132 selarchs="$selarchs $targ_archs"
136 # We don't do any links based on the target system, just makefile config.
138 if test x${all_targets} = xfalse ; then
140 # Target architecture .o files.
143 for arch in $selarchs
145 ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
146 archdefs="$archdefs -DARCH_$ad"
148 bfd_a29k_arch) ta="$ta a29k-dis.o" ;;
150 bfd_alpha_arch) ta="$ta alpha-dis.o" ;;
152 bfd_arc_arch) ta="$ta arc-dis.o arc-opc.o" ;;
154 bfd_arm_arch) ta="$ta arm-dis.o" ;;
156 bfd_h8300_arch) ta="$ta h8300-dis.o" ;;
157 bfd_h8500_arch) ta="$ta h8500-dis.o" ;;
158 bfd_hppa_arch) ta="$ta hppa-dis.o" ;;
159 bfd_i386_arch) ta="$ta i386-dis.o" ;;
161 bfd_i960_arch) ta="$ta i960-dis.o" ;;
162 bfd_m68k_arch) ta="$ta m68k-dis.o m68k-opc.o" ;;
163 bfd_m88k_arch) ta="$ta m88k-dis.o" ;;
164 bfd_mips_arch) ta="$ta mips-dis.o mips-opc.o" ;;
165 bfd_ns32k_arch) ta="$ta ns32k-dis.o" ;;
166 bfd_powerpc_arch) ta="$ta ppc-dis.o ppc-opc.o" ;;
169 bfd_rs6000_arch) ta="$ta ppc-dis.o ppc-opc.o" ;;
171 bfd_rce_arch) ta="$ta rce-dis.o" ;;
173 bfd_sh_arch) ta="$ta sh-dis.o" ;;
174 bfd_sparc_arch) ta="$ta sparc-dis.o sparc-opc.o" ;;
177 bfd_w65_arch) ta="$ta w65-dis.o" ;;
179 bfd_z8k_arch) ta="$ta z8k-dis.o" ;;
182 *) AC_MSG_ERROR(*** unknown target architecture $arch) ;;
186 # Weed out duplicate .o files.
196 # And duplicate -D flags.
198 for i in $archdefs ; do
208 else # all_targets is true
210 BFD_MACHINES='$(ALL_MACHINES)'
214 AC_SUBST(BFD_MACHINES)
217 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])