* Makefile.am: New file, based on old Makefile.in.
[deliverable/binutils-gdb.git] / opcodes / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3
4 AC_PREREQ(2.5)
5 AC_INIT(z8k-dis.c)
6
7 AC_CANONICAL_SYSTEM
8
9 AM_INIT_AUTOMAKE(opcodes, 2.8.2)
10
11 AM_PROG_LIBTOOL
12
13 AC_ARG_ENABLE(targets,
14 [ --enable-targets alternative target configurations],
15 [case "${enableval}" in
16 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
17 ;;
18 no) enable_targets= ;;
19 *) enable_targets=$enableval ;;
20 esac])dnl
21 AC_ARG_ENABLE(commonbfdlib,
22 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
23 [case "${enableval}" in
24 yes) commonbfdlib=true ;;
25 no) commonbfdlib=false ;;
26 *) AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;;
27 esac])dnl
28
29 AM_CONFIG_HEADER(config.h:config.in)
30
31 if test -z "$target" ; then
32 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
33 fi
34 AC_ARG_PROGRAM
35
36 AM_MAINTAINER_MODE
37 AM_CYGWIN32
38 AM_EXEEXT
39
40 # host-specific stuff:
41
42 AC_PROG_CC
43
44 . ${srcdir}/../bfd/configure.host
45
46 AC_SUBST(HDEFINES)
47 AC_CHECK_TOOL(AR, ar)
48 AC_CHECK_TOOL(RANLIB, ranlib, :)
49 AM_PROG_INSTALL
50
51 AC_CHECK_HEADERS(string.h strings.h stdlib.h)
52
53 # target-specific stuff:
54
55 # Canonicalize the secondary target names.
56 if test -n "$enable_targets" ; then
57 for targ in `echo $enable_targets | sed 's/,/ /g'`
58 do
59 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
60 if test -n "$result" ; then
61 canon_targets="$canon_targets $result"
62 else
63 # Allow targets that config.sub doesn't recognize, like "all".
64 canon_targets="$canon_targets $targ"
65 fi
66 done
67 fi
68
69 all_targets=false
70 selarchs=
71 for targ in $target $canon_targets
72 do
73 if test "x$targ" = "xall" ; then
74 all_targets=true
75 else
76 . $srcdir/../bfd/config.bfd
77 selarchs="$selarchs $targ_archs"
78 fi
79 done
80
81 # Utility var, documents generic cgen support files.
82
83 cgen_files="cgen-opc.lo cgen-asm.lo cgen-dis.lo"
84
85 # We don't do any links based on the target system, just makefile config.
86
87 if test x${all_targets} = xfalse ; then
88
89 # Target architecture .o files.
90 ta=
91
92 for arch in $selarchs
93 do
94 ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
95 archdefs="$archdefs -DARCH_$ad"
96 case "$arch" in
97 bfd_a29k_arch) ta="$ta a29k-dis.lo" ;;
98 bfd_alliant_arch) ;;
99 bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;;
100 # start-sanitize-arc
101 bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo" ;;
102 # end-sanitize-arc
103 bfd_arm_arch) ta="$ta arm-dis.lo" ;;
104 bfd_convex_arch) ;;
105 bfd_d10v_arch) ta="$ta d10v-dis.lo d10v-opc.lo" ;;
106 # start-sanitize-d30v
107 bfd_d30v_arch) ta="$ta d30v-dis.lo d30v-opc.lo" ;;
108 # end-sanitize-d30v
109 bfd_h8300_arch) ta="$ta h8300-dis.lo" ;;
110 bfd_h8500_arch) ta="$ta h8500-dis.lo" ;;
111 bfd_hppa_arch) ta="$ta hppa-dis.lo" ;;
112 bfd_i386_arch) ta="$ta i386-dis.lo" ;;
113 bfd_i860_arch) ;;
114 bfd_i960_arch) ta="$ta i960-dis.lo" ;;
115 bfd_m32r_arch) ta="$ta $cgen_files m32r-opc.lo m32r-asm.lo m32r-dis.lo" ;;
116 bfd_m68k_arch) ta="$ta m68k-dis.lo m68k-opc.lo" ;;
117 bfd_m88k_arch) ta="$ta m88k-dis.lo" ;;
118 bfd_mips_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo" ;;
119 bfd_mn10200_arch) ta="$ta m10200-dis.lo m10200-opc.lo" ;;
120 bfd_mn10300_arch) ta="$ta m10300-dis.lo m10300-opc.lo" ;;
121 bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;;
122 bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
123 bfd_pyramid_arch) ;;
124 bfd_romp_arch) ;;
125 bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;;
126 bfd_sh_arch) ta="$ta sh-dis.lo" ;;
127 bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;;
128 bfd_tahoe_arch) ;;
129 # start-sanitize-tic80
130 bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;;
131 # end-sanitize-tic80
132 # start-sanitize-v850
133 bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;;
134 # end-sanitize-v850
135 bfd_vax_arch) ;;
136 bfd_w65_arch) ta="$ta w65-dis.lo" ;;
137 bfd_we32k_arch) ;;
138 bfd_z8k_arch) ta="$ta z8k-dis.lo" ;;
139
140 "") ;;
141 *) AC_MSG_ERROR(*** unknown target architecture $arch) ;;
142 esac
143 done
144
145 # Weed out duplicate .o files.
146 f=""
147 for i in $ta ; do
148 case " $f " in
149 *" $i "*) ;;
150 *) f="$f $i" ;;
151 esac
152 done
153 ta="$f"
154
155 # And duplicate -D flags.
156 f=""
157 for i in $archdefs ; do
158 case " $f " in
159 *" $i "*) ;;
160 *) f="$f $i" ;;
161 esac
162 done
163 archdefs="$f"
164
165 BFD_MACHINES="$ta"
166
167 else # all_targets is true
168 archdefs=-DARCH_all
169 BFD_MACHINES='$(ALL_MACHINES)'
170 fi
171
172 AC_SUBST(archdefs)
173 AC_SUBST(BFD_MACHINES)
174
175 AC_OUTPUT(Makefile)
This page took 0.034707 seconds and 5 git commands to generate.