Commit | Line | Data |
---|---|---|
1daed53f ILT |
1 | dnl Process this file with autoconf to produce a configure script. |
2 | dnl | |
3 | ||
e3659cbf | 4 | AC_PREREQ(2.5) |
c62d1274 | 5 | AC_INIT(z8k-dis.c) |
1daed53f ILT |
6 | |
7 | AC_CANONICAL_SYSTEM | |
8 | ||
072aa625 NC |
9 | # We currently only use the version number for the name of any shared |
10 | # library. For user convenience, we always use the same version | |
11 | # number that BFD is using. | |
12 | changequote(,)dnl | |
13 | BFD_VERSION=`grep INIT_AUTOMAKE ${srcdir}/../bfd/configure.in | sed -n -e 's/[ ]//g' -e 's/^.*,\(.*\)).*$/\1/p'` | |
14 | changequote([,])dnl | |
15 | ||
16 | AM_INIT_AUTOMAKE(opcodes, ${BFD_VERSION}) | |
1daed53f | 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 | ||
072aa625 NC |
23 | dnl Default to a non shared library. This may be overridden by the |
24 | dnl configure option --enable-shared. | |
25 | AM_DISABLE_SHARED | |
26 | ||
1daed53f | 27 | AM_PROG_LIBTOOL |
c62d1274 ILT |
28 | |
29 | AC_ARG_ENABLE(targets, | |
30 | [ --enable-targets alternative target configurations], | |
31 | [case "${enableval}" in | |
32 | yes | "") AC_ERROR(enable-targets option must specify target names or 'all') | |
33 | ;; | |
34 | no) enable_targets= ;; | |
35 | *) enable_targets=$enableval ;; | |
36 | esac])dnl | |
e0bf1022 ILT |
37 | AC_ARG_ENABLE(commonbfdlib, |
38 | [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library], | |
39 | [case "${enableval}" in | |
40 | yes) commonbfdlib=true ;; | |
41 | no) commonbfdlib=false ;; | |
42 | *) AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;; | |
43 | esac])dnl | |
c62d1274 | 44 | |
1daed53f | 45 | AM_CONFIG_HEADER(config.h:config.in) |
f98c3369 | 46 | |
f98c3369 ILT |
47 | if test -z "$target" ; then |
48 | AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) | |
49 | fi | |
46bcd2ec | 50 | AC_ARG_PROGRAM |
f98c3369 | 51 | |
072aa625 NC |
52 | ALL_LINGUAS= |
53 | CY_GNU_GETTEXT | |
54 | ||
1daed53f ILT |
55 | AM_MAINTAINER_MODE |
56 | AM_CYGWIN32 | |
57 | AM_EXEEXT | |
c62d1274 | 58 | |
1daed53f | 59 | # host-specific stuff: |
e0bf1022 | 60 | |
46bcd2ec ILT |
61 | AC_PROG_CC |
62 | ||
40db6118 ILT |
63 | . ${srcdir}/../bfd/configure.host |
64 | ||
40db6118 | 65 | AC_SUBST(HDEFINES) |
1daed53f | 66 | AM_PROG_INSTALL |
e0bf1022 | 67 | |
9c03036a | 68 | AC_CHECK_HEADERS(string.h strings.h stdlib.h) |
c62d1274 | 69 | |
bfc10abe DE |
70 | # start-sanitize-cygnus |
71 | use_cgen=no | |
72 | if test ${USE_MAINTAINER_MODE} = yes ; then | |
73 | for targ in $target $canon_targets | |
74 | do | |
75 | case $targ in | |
76 | all) use_cgen=yes ;; | |
77 | m32r-*-*) use_cgen=yes ;; | |
78 | esac | |
79 | done | |
80 | fi | |
81 | if test $use_cgen = yes ; then | |
82 | AC_CHECK_PROG(SCHEME, guile, guile, guile) | |
83 | fi | |
84 | # end-sanitize-cygnus | |
85 | ||
072aa625 NC |
86 | # Horrible hacks to build DLLs on Windows. |
87 | WIN32LDFLAGS= | |
88 | WIN32LIBADD= | |
89 | case "${host}" in | |
90 | *-*-cygwin32*) | |
91 | if test "$enable_shared" = "yes"; then | |
92 | WIN32LDFLAGS="-no-undefined" | |
93 | WIN32LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -lcygwin" | |
94 | fi | |
95 | ;; | |
96 | esac | |
97 | AC_SUBST(WIN32LDFLAGS) | |
98 | AC_SUBST(WIN32LIBADD) | |
99 | ||
c62d1274 | 100 | # target-specific stuff: |
d94aca1a MT |
101 | |
102 | # Canonicalize the secondary target names. | |
c62d1274 | 103 | if test -n "$enable_targets" ; then |
d94aca1a MT |
104 | for targ in `echo $enable_targets | sed 's/,/ /g'` |
105 | do | |
1daed53f | 106 | result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null` |
c62d1274 | 107 | if test -n "$result" ; then |
d94aca1a MT |
108 | canon_targets="$canon_targets $result" |
109 | else | |
110 | # Allow targets that config.sub doesn't recognize, like "all". | |
111 | canon_targets="$canon_targets $targ" | |
112 | fi | |
113 | done | |
114 | fi | |
115 | ||
116 | all_targets=false | |
c62d1274 | 117 | selarchs= |
d94aca1a MT |
118 | for targ in $target $canon_targets |
119 | do | |
c62d1274 | 120 | if test "x$targ" = "xall" ; then |
d94aca1a MT |
121 | all_targets=true |
122 | else | |
c62d1274 ILT |
123 | . $srcdir/../bfd/config.bfd |
124 | selarchs="$selarchs $targ_archs" | |
d94aca1a | 125 | fi |
c62d1274 | 126 | done |
d94aca1a | 127 | |
9c03036a DE |
128 | # Utility var, documents generic cgen support files. |
129 | ||
1daed53f | 130 | cgen_files="cgen-opc.lo cgen-asm.lo cgen-dis.lo" |
9c03036a | 131 | |
d94aca1a MT |
132 | # We don't do any links based on the target system, just makefile config. |
133 | ||
c62d1274 | 134 | if test x${all_targets} = xfalse ; then |
d94aca1a MT |
135 | |
136 | # Target architecture .o files. | |
137 | ta= | |
138 | ||
c62d1274 | 139 | for arch in $selarchs |
d94aca1a MT |
140 | do |
141 | ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g` | |
142 | archdefs="$archdefs -DARCH_$ad" | |
143 | case "$arch" in | |
1daed53f | 144 | bfd_a29k_arch) ta="$ta a29k-dis.lo" ;; |
e0bf1022 | 145 | bfd_alliant_arch) ;; |
1daed53f | 146 | bfd_alpha_arch) ta="$ta alpha-dis.lo alpha-opc.lo" ;; |
1daed53f | 147 | bfd_arc_arch) ta="$ta arc-dis.lo arc-opc.lo" ;; |
1daed53f | 148 | bfd_arm_arch) ta="$ta arm-dis.lo" ;; |
e0bf1022 | 149 | bfd_convex_arch) ;; |
1daed53f | 150 | bfd_d10v_arch) ta="$ta d10v-dis.lo d10v-opc.lo" ;; |
b2e3f844 | 151 | # start-sanitize-d30v |
1daed53f | 152 | bfd_d30v_arch) ta="$ta d30v-dis.lo d30v-opc.lo" ;; |
b2e3f844 | 153 | # end-sanitize-d30v |
1daed53f ILT |
154 | bfd_h8300_arch) ta="$ta h8300-dis.lo" ;; |
155 | bfd_h8500_arch) ta="$ta h8500-dis.lo" ;; | |
156 | bfd_hppa_arch) ta="$ta hppa-dis.lo" ;; | |
157 | bfd_i386_arch) ta="$ta i386-dis.lo" ;; | |
f98c3369 | 158 | bfd_i860_arch) ;; |
1daed53f ILT |
159 | bfd_i960_arch) ta="$ta i960-dis.lo" ;; |
160 | bfd_m32r_arch) ta="$ta $cgen_files m32r-opc.lo m32r-asm.lo m32r-dis.lo" ;; | |
161 | bfd_m68k_arch) ta="$ta m68k-dis.lo m68k-opc.lo" ;; | |
162 | bfd_m88k_arch) ta="$ta m88k-dis.lo" ;; | |
163 | bfd_mips_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo" ;; | |
164 | bfd_mn10200_arch) ta="$ta m10200-dis.lo m10200-opc.lo" ;; | |
165 | bfd_mn10300_arch) ta="$ta m10300-dis.lo m10300-opc.lo" ;; | |
166 | bfd_ns32k_arch) ta="$ta ns32k-dis.lo" ;; | |
167 | bfd_powerpc_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; | |
e0bf1022 ILT |
168 | bfd_pyramid_arch) ;; |
169 | bfd_romp_arch) ;; | |
1daed53f ILT |
170 | bfd_rs6000_arch) ta="$ta ppc-dis.lo ppc-opc.lo" ;; |
171 | bfd_sh_arch) ta="$ta sh-dis.lo" ;; | |
172 | bfd_sparc_arch) ta="$ta sparc-dis.lo sparc-opc.lo" ;; | |
e0bf1022 | 173 | bfd_tahoe_arch) ;; |
072aa625 | 174 | bfd_tic30_arch) ta="$ta tic30-dis.lo" ;; |
b2e3f844 | 175 | # start-sanitize-tic80 |
1daed53f | 176 | bfd_tic80_arch) ta="$ta tic80-dis.lo tic80-opc.lo" ;; |
b2e3f844 | 177 | # end-sanitize-tic80 |
80c396f6 | 178 | # start-sanitize-sky |
37130f11 | 179 | bfd_dvp_arch) ta="$ta mips-dis.lo mips-opc.lo mips16-opc.lo dvp-dis.lo dvp-opc.lo" ;; |
80c396f6 | 180 | # end-sanitize-sky |
1daed53f | 181 | bfd_v850_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; |
010916c2 NC |
182 | # start-sanitize-v850e |
183 | bfd_v850e_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; | |
80c396f6 | 184 | bfd_v850ea_arch) ta="$ta v850-opc.lo v850-dis.lo" ;; |
010916c2 | 185 | # end-sanitize-v850e |
d94aca1a | 186 | bfd_vax_arch) ;; |
1daed53f | 187 | bfd_w65_arch) ta="$ta w65-dis.lo" ;; |
d94aca1a | 188 | bfd_we32k_arch) ;; |
1daed53f | 189 | bfd_z8k_arch) ta="$ta z8k-dis.lo" ;; |
d94aca1a MT |
190 | |
191 | "") ;; | |
c62d1274 | 192 | *) AC_MSG_ERROR(*** unknown target architecture $arch) ;; |
d94aca1a MT |
193 | esac |
194 | done | |
195 | ||
196 | # Weed out duplicate .o files. | |
197 | f="" | |
198 | for i in $ta ; do | |
199 | case " $f " in | |
200 | *" $i "*) ;; | |
201 | *) f="$f $i" ;; | |
202 | esac | |
203 | done | |
204 | ta="$f" | |
205 | ||
206 | # And duplicate -D flags. | |
207 | f="" | |
208 | for i in $archdefs ; do | |
209 | case " $f " in | |
210 | *" $i "*) ;; | |
211 | *) f="$f $i" ;; | |
212 | esac | |
213 | done | |
214 | archdefs="$f" | |
215 | ||
c62d1274 | 216 | BFD_MACHINES="$ta" |
d94aca1a MT |
217 | |
218 | else # all_targets is true | |
c62d1274 ILT |
219 | archdefs=-DARCH_all |
220 | BFD_MACHINES='$(ALL_MACHINES)' | |
221 | fi | |
222 | ||
223 | AC_SUBST(archdefs) | |
224 | AC_SUBST(BFD_MACHINES) | |
d94aca1a | 225 | |
072aa625 NC |
226 | AC_OUTPUT(Makefile po/Makefile.in:po/Make-in, |
227 | [sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile]) |