76fcd525c807b8a94caf95c863f4bf1cd074d903
[deliverable/binutils-gdb.git] / opcodes / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3
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)
8 enable_shared=no
9 divert(-1)
10
11 AC_PREREQ(2.5)
12 AC_INIT(z8k-dis.c)
13
14 AC_CANONICAL_SYSTEM
15
16 AM_INIT_AUTOMAKE(opcodes, 2.8.2)
17
18 dnl These must be called before AM_PROG_LIBTOOL, because it may want
19 dnl to call AC_CHECK_PROG.
20 AC_CHECK_TOOL(AR, ar)
21 AC_CHECK_TOOL(RANLIB, ranlib, :)
22
23 AM_PROG_LIBTOOL
24
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')
29 ;;
30 no) enable_targets= ;;
31 *) enable_targets=$enableval ;;
32 esac])dnl
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]) ;;
39 esac])dnl
40
41 AM_CONFIG_HEADER(config.h:config.in)
42
43 if test -z "$target" ; then
44 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
45 fi
46 AC_ARG_PROGRAM
47
48 AM_MAINTAINER_MODE
49 AM_CYGWIN32
50 AM_EXEEXT
51
52 # host-specific stuff:
53
54 AC_PROG_CC
55
56 . ${srcdir}/../bfd/configure.host
57
58 AC_SUBST(HDEFINES)
59 AM_PROG_INSTALL
60
61 AC_CHECK_HEADERS(string.h strings.h stdlib.h)
62
63 # target-specific stuff:
64
65 # Canonicalize the secondary target names.
66 if test -n "$enable_targets" ; then
67 for targ in `echo $enable_targets | sed 's/,/ /g'`
68 do
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"
72 else
73 # Allow targets that config.sub doesn't recognize, like "all".
74 canon_targets="$canon_targets $targ"
75 fi
76 done
77 fi
78
79 all_targets=false
80 selarchs=
81 for targ in $target $canon_targets
82 do
83 if test "x$targ" = "xall" ; then
84 all_targets=true
85 else
86 . $srcdir/../bfd/config.bfd
87 selarchs="$selarchs $targ_archs"
88 fi
89 done
90
91 # Utility var, documents generic cgen support files.
92
93 cgen_files="cgen-opc.lo cgen-asm.lo cgen-dis.lo"
94
95 # We don't do any links based on the target system, just makefile config.
96
97 if test x${all_targets} = xfalse ; then
98
99 # Target architecture .o files.
100 ta=
101
102 for arch in $selarchs
103 do
104 ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
105 archdefs="$archdefs -DARCH_$ad"
106 case "$arch" in
107 bfd_a29k_arch) ta="$ta a29k-dis.lo" ;;
108 bfd_alliant_arch) ;;
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" ;;
112 bfd_convex_arch) ;;
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" ;;
116 # end-sanitize-d30v
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" ;;
121 bfd_i860_arch) ;;
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" ;;
131 bfd_pyramid_arch) ;;
132 bfd_romp_arch) ;;
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" ;;
136 bfd_tahoe_arch) ;;
137 # start-sanitize-tic80
138 bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;;
139 # end-sanitize-tic80
140 # start-sanitize-sky
141 bfd_txvu_arch) ta="$ta txvu-dis.lo txvu-opc.lo" ;;
142 # end-sanitize-sky
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" ;;
147 # end-sanitize-v850e
148 bfd_vax_arch) ;;
149 bfd_w65_arch) ta="$ta w65-dis.lo" ;;
150 bfd_we32k_arch) ;;
151 bfd_z8k_arch) ta="$ta z8k-dis.lo" ;;
152
153 "") ;;
154 *) AC_MSG_ERROR(*** unknown target architecture $arch) ;;
155 esac
156 done
157
158 # Weed out duplicate .o files.
159 f=""
160 for i in $ta ; do
161 case " $f " in
162 *" $i "*) ;;
163 *) f="$f $i" ;;
164 esac
165 done
166 ta="$f"
167
168 # And duplicate -D flags.
169 f=""
170 for i in $archdefs ; do
171 case " $f " in
172 *" $i "*) ;;
173 *) f="$f $i" ;;
174 esac
175 done
176 archdefs="$f"
177
178 BFD_MACHINES="$ta"
179
180 else # all_targets is true
181 archdefs=-DARCH_all
182 BFD_MACHINES='$(ALL_MACHINES)'
183 fi
184
185 AC_SUBST(archdefs)
186 AC_SUBST(BFD_MACHINES)
187
188 AC_OUTPUT(Makefile)
This page took 0.035164 seconds and 3 git commands to generate.