Commit | Line | Data |
---|---|---|
c62d1274 ILT |
1 | AC_PREREQ(2.0) |
2 | AC_INIT(z8k-dis.c) | |
3 | # configure.in script for the opcodes library. | |
7919b9ec | 4 | # Copyright (C) 1995, 1996 Free Software Foundation, Inc. |
c62d1274 ILT |
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 | |
e0bf1022 ILT |
29 | AC_ARG_ENABLE(shared, |
30 | [ --enable-shared build shared opcodes library], | |
31 | [case "${enableval}" in | |
32 | yes) shared=true ;; | |
33 | no) shared=false ;; | |
34 | *) AC_MSG_ERROR([bad value ${enableval} for opcodes shared option]) ;; | |
35 | esac])dnl | |
36 | AC_ARG_ENABLE(commonbfdlib, | |
37 | [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library], | |
38 | [case "${enableval}" in | |
39 | yes) commonbfdlib=true ;; | |
40 | no) commonbfdlib=false ;; | |
41 | *) AC_MSG_ERROR([bad value ${enableval} for opcodes commonbfdlib option]) ;; | |
42 | esac])dnl | |
c62d1274 | 43 | |
f98c3369 ILT |
44 | AC_CONFIG_HEADER(config.h:config.in) |
45 | ||
46 | AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`) | |
47 | AC_CANONICAL_SYSTEM | |
48 | if test -z "$target" ; then | |
49 | AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) | |
50 | fi | |
46bcd2ec | 51 | AC_ARG_PROGRAM |
f98c3369 | 52 | |
c62d1274 ILT |
53 | # host-specific stuff: |
54 | ||
9b17e0ea | 55 | ALLLIBS='$(TARGETLIB)' |
e0bf1022 | 56 | PICFLAG= |
7919b9ec ILT |
57 | SHLIB=unused-shlib |
58 | SHLINK=unused-shlink | |
e0bf1022 ILT |
59 | if test "${shared}" = "true"; then |
60 | ALLLIBS='$(TARGETLIB) $(SHLIB) $(SHLINK)' | |
61 | PICFLAG=-fpic | |
62 | if test "${commonbfdlib}" = "true"; then | |
63 | changequote(,)dnl | |
64 | SHLIB=../bfd/libbfd.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION` | |
65 | changequote([,])dnl | |
66 | SHLINK=../bfd/libbfd.so | |
67 | else | |
68 | changequote(,)dnl | |
69 | SHLIB=libopcodes.so.`sed -e 's/[^0-9]*\([0-9.]*\).*/\1/' ${srcdir}/../bfd/VERSION` | |
70 | changequote([,])dnl | |
71 | SHLINK=libopcodes.so | |
72 | fi | |
73 | fi | |
74 | ||
46bcd2ec ILT |
75 | AC_PROG_CC |
76 | ||
40db6118 ILT |
77 | . ${srcdir}/../bfd/configure.host |
78 | ||
40db6118 | 79 | AC_SUBST(HDEFINES) |
7919b9ec ILT |
80 | AC_CHECK_TOOL(AR, ar) |
81 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
40db6118 ILT |
82 | AC_PROG_INSTALL |
83 | ||
e0bf1022 ILT |
84 | if test "${shared}" = "true"; then |
85 | if test "${GCC}" != "yes" && test "${shared_non_gcc}" != "yes"; then | |
86 | AC_MSG_WARN([opcodes --enable-shared only supported when using gcc]) | |
87 | shared=false | |
7919b9ec | 88 | ALLLIBS='$(TARGETLIB)' |
e0bf1022 | 89 | PICFLAG= |
7919b9ec | 90 | SHLIB=unused-shlib |
e0bf1022 ILT |
91 | fi |
92 | fi | |
93 | ||
94 | AC_SUBST(ALLLIBS) | |
95 | AC_SUBST(PICFLAG) | |
96 | AC_SUBST(SHLIB) | |
97 | AC_SUBST(SHLIB_CC) | |
98 | AC_SUBST(SHLIB_CFLAGS) | |
99 | if test "${commonbfdlib}" = "true"; then | |
100 | COMMON_SHLIB=yes | |
7919b9ec ILT |
101 | # Rebuild the shared library if libiberty or libbfd changes. |
102 | SHLIB_DEP="../libiberty/libiberty.a ../bfd/libbfd.a" | |
e0bf1022 ILT |
103 | else |
104 | COMMON_SHLIB= | |
7919b9ec | 105 | SHLIB_DEP= |
e0bf1022 ILT |
106 | fi |
107 | AC_SUBST(COMMON_SHLIB) | |
7919b9ec | 108 | AC_SUBST(SHLIB_DEP) |
e0bf1022 ILT |
109 | AC_SUBST(SHLINK) |
110 | ||
c62d1274 ILT |
111 | AC_CHECK_HEADERS(string.h strings.h) |
112 | ||
c62d1274 | 113 | # target-specific stuff: |
d94aca1a MT |
114 | |
115 | # Canonicalize the secondary target names. | |
c62d1274 | 116 | if test -n "$enable_targets" ; then |
d94aca1a MT |
117 | for targ in `echo $enable_targets | sed 's/,/ /g'` |
118 | do | |
c62d1274 ILT |
119 | result=`$ac_config_sub $targ 2>/dev/null` |
120 | if test -n "$result" ; then | |
d94aca1a MT |
121 | canon_targets="$canon_targets $result" |
122 | else | |
123 | # Allow targets that config.sub doesn't recognize, like "all". | |
124 | canon_targets="$canon_targets $targ" | |
125 | fi | |
126 | done | |
127 | fi | |
128 | ||
129 | all_targets=false | |
c62d1274 | 130 | selarchs= |
d94aca1a MT |
131 | for targ in $target $canon_targets |
132 | do | |
c62d1274 | 133 | if test "x$targ" = "xall" ; then |
d94aca1a MT |
134 | all_targets=true |
135 | else | |
c62d1274 ILT |
136 | . $srcdir/../bfd/config.bfd |
137 | selarchs="$selarchs $targ_archs" | |
d94aca1a | 138 | fi |
c62d1274 | 139 | done |
d94aca1a MT |
140 | |
141 | # We don't do any links based on the target system, just makefile config. | |
142 | ||
c62d1274 | 143 | if test x${all_targets} = xfalse ; then |
d94aca1a MT |
144 | |
145 | # Target architecture .o files. | |
146 | ta= | |
147 | ||
c62d1274 | 148 | for arch in $selarchs |
d94aca1a MT |
149 | do |
150 | ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g` | |
151 | archdefs="$archdefs -DARCH_$ad" | |
152 | case "$arch" in | |
153 | bfd_a29k_arch) ta="$ta a29k-dis.o" ;; | |
e0bf1022 | 154 | bfd_alliant_arch) ;; |
d94aca1a | 155 | bfd_alpha_arch) ta="$ta alpha-dis.o" ;; |
c62d1274 ILT |
156 | # start-sanitize-arc |
157 | bfd_arc_arch) ta="$ta arc-dis.o arc-opc.o" ;; | |
158 | # end-sanitize-arc | |
d94aca1a | 159 | bfd_arm_arch) ta="$ta arm-dis.o" ;; |
e0bf1022 | 160 | bfd_convex_arch) ;; |
d94aca1a MT |
161 | bfd_h8300_arch) ta="$ta h8300-dis.o" ;; |
162 | bfd_h8500_arch) ta="$ta h8500-dis.o" ;; | |
163 | bfd_hppa_arch) ta="$ta hppa-dis.o" ;; | |
164 | bfd_i386_arch) ta="$ta i386-dis.o" ;; | |
f98c3369 | 165 | bfd_i860_arch) ;; |
d94aca1a | 166 | bfd_i960_arch) ta="$ta i960-dis.o" ;; |
c62d1274 | 167 | bfd_m68k_arch) ta="$ta m68k-dis.o m68k-opc.o" ;; |
d94aca1a MT |
168 | bfd_m88k_arch) ta="$ta m88k-dis.o" ;; |
169 | bfd_mips_arch) ta="$ta mips-dis.o mips-opc.o" ;; | |
170 | bfd_ns32k_arch) ta="$ta ns32k-dis.o" ;; | |
171 | bfd_powerpc_arch) ta="$ta ppc-dis.o ppc-opc.o" ;; | |
e0bf1022 ILT |
172 | bfd_pyramid_arch) ;; |
173 | bfd_romp_arch) ;; | |
d94aca1a | 174 | bfd_rs6000_arch) ta="$ta ppc-dis.o ppc-opc.o" ;; |
03c4ce2f MT |
175 | # start-sanitize-rce |
176 | bfd_rce_arch) ta="$ta rce-dis.o" ;; | |
177 | # end-sanitize-rce | |
e0bf1022 | 178 | bfd_sh_arch) ta="$ta sh-dis.o" ;; |
d94aca1a | 179 | bfd_sparc_arch) ta="$ta sparc-dis.o sparc-opc.o" ;; |
e0bf1022 | 180 | bfd_tahoe_arch) ;; |
d94aca1a | 181 | bfd_vax_arch) ;; |
e0bf1022 | 182 | bfd_w65_arch) ta="$ta w65-dis.o" ;; |
d94aca1a MT |
183 | bfd_we32k_arch) ;; |
184 | bfd_z8k_arch) ta="$ta z8k-dis.o" ;; | |
185 | ||
186 | "") ;; | |
c62d1274 | 187 | *) AC_MSG_ERROR(*** unknown target architecture $arch) ;; |
d94aca1a MT |
188 | esac |
189 | done | |
190 | ||
191 | # Weed out duplicate .o files. | |
192 | f="" | |
193 | for i in $ta ; do | |
194 | case " $f " in | |
195 | *" $i "*) ;; | |
196 | *) f="$f $i" ;; | |
197 | esac | |
198 | done | |
199 | ta="$f" | |
200 | ||
201 | # And duplicate -D flags. | |
202 | f="" | |
203 | for i in $archdefs ; do | |
204 | case " $f " in | |
205 | *" $i "*) ;; | |
206 | *) f="$f $i" ;; | |
207 | esac | |
208 | done | |
209 | archdefs="$f" | |
210 | ||
c62d1274 | 211 | BFD_MACHINES="$ta" |
d94aca1a MT |
212 | |
213 | else # all_targets is true | |
c62d1274 ILT |
214 | archdefs=-DARCH_all |
215 | BFD_MACHINES='$(ALL_MACHINES)' | |
216 | fi | |
217 | ||
218 | AC_SUBST(archdefs) | |
219 | AC_SUBST(BFD_MACHINES) | |
d94aca1a | 220 | |
f98c3369 ILT |
221 | AC_OUTPUT(Makefile, |
222 | [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac]) |