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