Thu Oct 26 10:23:14 1995 steve chamberlain <sac@slash.cygnus.com>
[deliverable/binutils-gdb.git] / opcodes / configure.in
CommitLineData
c62d1274
ILT
1AC_PREREQ(2.0)
2AC_INIT(z8k-dis.c)
3# configure.in script for the opcodes library.
4# Copyright (C) 1995 Free Software Foundation, Inc.
5# Written by Cygnus Support.
6#
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.
11#
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.
16#
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.
20
21AC_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')
25 ;;
26 no) enable_targets= ;;
27 *) enable_targets=$enableval ;;
28esac])dnl
29
30# host-specific stuff:
31
40db6118
ILT
32. ${srcdir}/../bfd/configure.host
33
c62d1274 34AC_PROG_CC
40db6118
ILT
35AC_SUBST(CFLAGS)
36AC_SUBST(HDEFINES)
37AR=${AR-ar}
38AC_SUBST(AR)
c62d1274 39AC_PROG_RANLIB
40db6118
ILT
40AC_PROG_INSTALL
41
c62d1274
ILT
42AC_CHECK_HEADERS(string.h strings.h)
43
44AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`)
45AC_CANONICAL_SYSTEM
46if test -z "$target" ; then
47 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
48fi
49if test -z "$host" ; then
50 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
51fi
52AC_ARG_PROGRAM
57cae454 53
c62d1274 54# target-specific stuff:
d94aca1a
MT
55
56# Canonicalize the secondary target names.
c62d1274 57if test -n "$enable_targets" ; then
d94aca1a
MT
58 for targ in `echo $enable_targets | sed 's/,/ /g'`
59 do
c62d1274
ILT
60 result=`$ac_config_sub $targ 2>/dev/null`
61 if test -n "$result" ; then
d94aca1a
MT
62 canon_targets="$canon_targets $result"
63 else
64 # Allow targets that config.sub doesn't recognize, like "all".
65 canon_targets="$canon_targets $targ"
66 fi
67 done
68fi
69
70all_targets=false
c62d1274 71selarchs=
d94aca1a
MT
72for targ in $target $canon_targets
73do
c62d1274 74 if test "x$targ" = "xall" ; then
d94aca1a
MT
75 all_targets=true
76 else
c62d1274
ILT
77 . $srcdir/../bfd/config.bfd
78 selarchs="$selarchs $targ_archs"
d94aca1a 79 fi
c62d1274 80done
d94aca1a
MT
81
82# We don't do any links based on the target system, just makefile config.
83
c62d1274 84if test x${all_targets} = xfalse ; then
d94aca1a
MT
85
86 # Target architecture .o files.
87 ta=
88
c62d1274 89 for arch in $selarchs
d94aca1a
MT
90 do
91 ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
92 archdefs="$archdefs -DARCH_$ad"
93 case "$arch" in
94 bfd_a29k_arch) ta="$ta a29k-dis.o" ;;
95 bfd_alpha_arch) ta="$ta alpha-dis.o" ;;
c62d1274
ILT
96# start-sanitize-arc
97 bfd_arc_arch) ta="$ta arc-dis.o arc-opc.o" ;;
98# end-sanitize-arc
d94aca1a
MT
99 bfd_arm_arch) ta="$ta arm-dis.o" ;;
100 bfd_h8300_arch) ta="$ta h8300-dis.o" ;;
101 bfd_h8500_arch) ta="$ta h8500-dis.o" ;;
102 bfd_hppa_arch) ta="$ta hppa-dis.o" ;;
103 bfd_i386_arch) ta="$ta i386-dis.o" ;;
104 bfd_i960_arch) ta="$ta i960-dis.o" ;;
c62d1274 105 bfd_m68k_arch) ta="$ta m68k-dis.o m68k-opc.o" ;;
d94aca1a
MT
106 bfd_m88k_arch) ta="$ta m88k-dis.o" ;;
107 bfd_mips_arch) ta="$ta mips-dis.o mips-opc.o" ;;
108 bfd_ns32k_arch) ta="$ta ns32k-dis.o" ;;
109 bfd_powerpc_arch) ta="$ta ppc-dis.o ppc-opc.o" ;;
110 bfd_rs6000_arch) ta="$ta ppc-dis.o ppc-opc.o" ;;
111 bfd_sh_arch) ta="$ta sh-dis.o" ;;
03c4ce2f
MT
112# start-sanitize-rce
113 bfd_rce_arch) ta="$ta rce-dis.o" ;;
114# end-sanitize-rce
d94aca1a
MT
115 bfd_sparc_arch) ta="$ta sparc-dis.o sparc-opc.o" ;;
116 bfd_vax_arch) ;;
117 bfd_we32k_arch) ;;
118 bfd_z8k_arch) ta="$ta z8k-dis.o" ;;
c62d1274 119 bfd_w65_arch) ta="$ta w65-dis.o" ;;
d94aca1a
MT
120
121 "") ;;
c62d1274 122 *) AC_MSG_ERROR(*** unknown target architecture $arch) ;;
d94aca1a
MT
123 esac
124 done
125
126 # Weed out duplicate .o files.
127 f=""
128 for i in $ta ; do
129 case " $f " in
130 *" $i "*) ;;
131 *) f="$f $i" ;;
132 esac
133 done
134 ta="$f"
135
136 # And duplicate -D flags.
137 f=""
138 for i in $archdefs ; do
139 case " $f " in
140 *" $i "*) ;;
141 *) f="$f $i" ;;
142 esac
143 done
144 archdefs="$f"
145
c62d1274 146 BFD_MACHINES="$ta"
d94aca1a
MT
147
148else # all_targets is true
c62d1274
ILT
149 archdefs=-DARCH_all
150 BFD_MACHINES='$(ALL_MACHINES)'
151fi
152
153AC_SUBST(archdefs)
154AC_SUBST(BFD_MACHINES)
d94aca1a 155
c62d1274
ILT
156AC_CONFIG_HEADER(config.h:config.in)
157AC_OUTPUT(Makefile)
This page took 0.118767 seconds and 4 git commands to generate.