Commit | Line | Data |
---|---|---|
1daed53f ILT |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | dnl | |
3 | ||
80c396f6 DE |
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 | ||
e3659cbf | 11 | AC_PREREQ(2.5) |
c62d1274 | 12 | AC_INIT(z8k-dis.c) |
1daed53f ILT |
13 | |
14 | AC_CANONICAL_SYSTEM | |
15 | ||
16 | AM_INIT_AUTOMAKE(opcodes, 2.8.2) | |
17 | ||
80c396f6 DE |
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 | ||
1daed53f | 23 | AM_PROG_LIBTOOL |
c62d1274 ILT |
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 | |
e0bf1022 ILT |
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 | |
c62d1274 | 40 | |
1daed53f | 41 | AM_CONFIG_HEADER(config.h:config.in) |
f98c3369 | 42 | |
f98c3369 ILT |
43 | if test -z "$target" ; then |
44 | AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) | |
45 | fi | |
46bcd2ec | 46 | AC_ARG_PROGRAM |
f98c3369 | 47 | |
1daed53f ILT |
48 | AM_MAINTAINER_MODE |
49 | AM_CYGWIN32 | |
50 | AM_EXEEXT | |
c62d1274 | 51 | |
1daed53f | 52 | # host-specific stuff: |
e0bf1022 | 53 | |
46bcd2ec ILT |
54 | AC_PROG_CC |
55 | ||
40db6118 ILT |
56 | . ${srcdir}/../bfd/configure.host |
57 | ||
40db6118 | 58 | AC_SUBST(HDEFINES) |
1daed53f | 59 | AM_PROG_INSTALL |
e0bf1022 | 60 | |
9c03036a | 61 | AC_CHECK_HEADERS(string.h strings.h stdlib.h) |
c62d1274 | 62 | |
bfc10abe DE |
63 | # start-sanitize-cygnus |
64 | use_cgen=no | |
65 | if test ${USE_MAINTAINER_MODE} = yes ; then | |
66 | for targ in $target $canon_targets | |
67 | do | |
68 | case $targ in | |
69 | all) use_cgen=yes ;; | |
70 | m32r-*-*) use_cgen=yes ;; | |
71 | esac | |
72 | done | |
73 | fi | |
74 | if test $use_cgen = yes ; then | |
75 | AC_CHECK_PROG(SCHEME, guile, guile, guile) | |
76 | fi | |
77 | # end-sanitize-cygnus | |
78 | ||
c62d1274 | 79 | # target-specific stuff: |
d94aca1a MT |
80 | |
81 | # Canonicalize the secondary target names. | |
c62d1274 | 82 | if test -n "$enable_targets" ; then |
d94aca1a MT |
83 | for targ in `echo $enable_targets | sed 's/,/ /g'` |
84 | do | |
1daed53f | 85 | result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null` |
c62d1274 | 86 | if test -n "$result" ; then |
d94aca1a MT |
87 | canon_targets="$canon_targets $result" |
88 | else | |
89 | # Allow targets that config.sub doesn't recognize, like "all". | |
90 | canon_targets="$canon_targets $targ" | |
91 | fi | |
92 | done | |
93 | fi | |
94 | ||
95 | all_targets=false | |
c62d1274 | 96 | selarchs= |
d94aca1a MT |
97 | for targ in $target $canon_targets |
98 | do | |
c62d1274 | 99 | if test "x$targ" = "xall" ; then |
d94aca1a MT |
100 | all_targets=true |
101 | else | |
c62d1274 ILT |
102 | . $srcdir/../bfd/config.bfd |
103 | selarchs="$selarchs $targ_archs" | |
d94aca1a | 104 | fi |
c62d1274 | 105 | done |
d94aca1a | 106 | |
9c03036a DE |
107 | # Utility var, documents generic cgen support files. |
108 | ||
1daed53f | 109 | cgen_files="cgen-opc.lo cgen-asm.lo cgen-dis.lo" |
9c03036a | 110 | |
d94aca1a MT |
111 | # We don't do any links based on the target system, just makefile config. |
112 | ||
c62d1274 | 113 | if test x${all_targets} = xfalse ; then |
d94aca1a MT |
114 | |
115 | # Target architecture .o files. | |
116 | ta= | |
117 | ||
c62d1274 | 118 | for arch in $selarchs |
d94aca1a MT |
119 | do |
120 | ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g` | |
121 | archdefs="$archdefs -DARCH_$ad" | |
122 | case "$arch" in | |
1daed53f | 123 | bfd_a29k_arch) ta="$ta a29k-dis.lo" ;; |
e0bf1022 | 124 | bfd_alliant_arch) ;; |
1daed53f | 125 | bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;; |
1daed53f | 126 | bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo" ;; |
1daed53f | 127 | bfd_arm_arch) ta="$ta arm-dis.lo" ;; |
e0bf1022 | 128 | bfd_convex_arch) ;; |
1daed53f | 129 | bfd_d10v_arch) ta="$ta d10v-dis.lo d10v-opc.lo" ;; |
b2e3f844 | 130 | # start-sanitize-d30v |
1daed53f | 131 | bfd_d30v_arch) ta="$ta d30v-dis.lo d30v-opc.lo" ;; |
b2e3f844 | 132 | # end-sanitize-d30v |
1daed53f ILT |
133 | bfd_h8300_arch) ta="$ta h8300-dis.lo" ;; |
134 | bfd_h8500_arch) ta="$ta h8500-dis.lo" ;; | |
135 | bfd_hppa_arch) ta="$ta hppa-dis.lo" ;; | |
136 | bfd_i386_arch) ta="$ta i386-dis.lo" ;; | |
f98c3369 | 137 | bfd_i860_arch) ;; |
1daed53f ILT |
138 | bfd_i960_arch) ta="$ta i960-dis.lo" ;; |
139 | bfd_m32r_arch) ta="$ta $cgen_files m32r-opc.lo m32r-asm.lo m32r-dis.lo" ;; | |
140 | bfd_m68k_arch) ta="$ta m68k-dis.lo m68k-opc.lo" ;; | |
141 | bfd_m88k_arch) ta="$ta m88k-dis.lo" ;; | |
142 | bfd_mips_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo" ;; | |
143 | bfd_mn10200_arch) ta="$ta m10200-dis.lo m10200-opc.lo" ;; | |
144 | bfd_mn10300_arch) ta="$ta m10300-dis.lo m10300-opc.lo" ;; | |
145 | bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;; | |
146 | bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; | |
e0bf1022 ILT |
147 | bfd_pyramid_arch) ;; |
148 | bfd_romp_arch) ;; | |
1daed53f ILT |
149 | bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; |
150 | bfd_sh_arch) ta="$ta sh-dis.lo" ;; | |
151 | bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;; | |
e0bf1022 | 152 | bfd_tahoe_arch) ;; |
b2e3f844 | 153 | # start-sanitize-tic80 |
1daed53f | 154 | bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;; |
b2e3f844 | 155 | # end-sanitize-tic80 |
80c396f6 | 156 | # start-sanitize-sky |
37130f11 | 157 | bfd_dvp_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo dvp-dis.lo dvp-opc.lo" ;; |
80c396f6 | 158 | # end-sanitize-sky |
1daed53f | 159 | bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; |
010916c2 NC |
160 | # start-sanitize-v850e |
161 | bfd_v850e_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; | |
80c396f6 | 162 | bfd_v850ea_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; |
010916c2 | 163 | # end-sanitize-v850e |
d94aca1a | 164 | bfd_vax_arch) ;; |
1daed53f | 165 | bfd_w65_arch) ta="$ta w65-dis.lo" ;; |
d94aca1a | 166 | bfd_we32k_arch) ;; |
1daed53f | 167 | bfd_z8k_arch) ta="$ta z8k-dis.lo" ;; |
d94aca1a MT |
168 | |
169 | "") ;; | |
c62d1274 | 170 | *) AC_MSG_ERROR(*** unknown target architecture $arch) ;; |
d94aca1a MT |
171 | esac |
172 | done | |
173 | ||
174 | # Weed out duplicate .o files. | |
175 | f="" | |
176 | for i in $ta ; do | |
177 | case " $f " in | |
178 | *" $i "*) ;; | |
179 | *) f="$f $i" ;; | |
180 | esac | |
181 | done | |
182 | ta="$f" | |
183 | ||
184 | # And duplicate -D flags. | |
185 | f="" | |
186 | for i in $archdefs ; do | |
187 | case " $f " in | |
188 | *" $i "*) ;; | |
189 | *) f="$f $i" ;; | |
190 | esac | |
191 | done | |
192 | archdefs="$f" | |
193 | ||
c62d1274 | 194 | BFD_MACHINES="$ta" |
d94aca1a MT |
195 | |
196 | else # all_targets is true | |
c62d1274 ILT |
197 | archdefs=-DARCH_all |
198 | BFD_MACHINES='$(ALL_MACHINES)' | |
199 | fi | |
200 | ||
201 | AC_SUBST(archdefs) | |
202 | AC_SUBST(BFD_MACHINES) | |
d94aca1a | 203 | |
1daed53f | 204 | AC_OUTPUT(Makefile) |