Commit | Line | Data |
---|---|---|
c62d1274 ILT |
1 | AC_PREREQ(2.0) |
2 | AC_INIT(z8k-dis.c) | |
3 | # configure.in script for the opcodes library. | |
4 | # Copyright (C) 1995 Free Software Foundation, Inc. | |
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 | |
29 | ||
f98c3369 ILT |
30 | AC_CONFIG_HEADER(config.h:config.in) |
31 | ||
32 | AC_CONFIG_AUX_DIR(`cd $srcdir/..;pwd`) | |
33 | AC_CANONICAL_SYSTEM | |
34 | if test -z "$target" ; then | |
35 | AC_MSG_ERROR(Unrecognized target system type; please check config.sub.) | |
36 | fi | |
37 | ||
c62d1274 ILT |
38 | # host-specific stuff: |
39 | ||
40db6118 ILT |
40 | . ${srcdir}/../bfd/configure.host |
41 | ||
c62d1274 | 42 | AC_PROG_CC |
40db6118 ILT |
43 | AC_SUBST(CFLAGS) |
44 | AC_SUBST(HDEFINES) | |
45 | AR=${AR-ar} | |
46 | AC_SUBST(AR) | |
c62d1274 | 47 | AC_PROG_RANLIB |
40db6118 ILT |
48 | AC_PROG_INSTALL |
49 | ||
c62d1274 ILT |
50 | AC_CHECK_HEADERS(string.h strings.h) |
51 | ||
c62d1274 | 52 | # target-specific stuff: |
d94aca1a MT |
53 | |
54 | # Canonicalize the secondary target names. | |
c62d1274 | 55 | if test -n "$enable_targets" ; then |
d94aca1a MT |
56 | for targ in `echo $enable_targets | sed 's/,/ /g'` |
57 | do | |
c62d1274 ILT |
58 | result=`$ac_config_sub $targ 2>/dev/null` |
59 | if test -n "$result" ; then | |
d94aca1a MT |
60 | canon_targets="$canon_targets $result" |
61 | else | |
62 | # Allow targets that config.sub doesn't recognize, like "all". | |
63 | canon_targets="$canon_targets $targ" | |
64 | fi | |
65 | done | |
66 | fi | |
67 | ||
68 | all_targets=false | |
c62d1274 | 69 | selarchs= |
d94aca1a MT |
70 | for targ in $target $canon_targets |
71 | do | |
c62d1274 | 72 | if test "x$targ" = "xall" ; then |
d94aca1a MT |
73 | all_targets=true |
74 | else | |
c62d1274 ILT |
75 | . $srcdir/../bfd/config.bfd |
76 | selarchs="$selarchs $targ_archs" | |
d94aca1a | 77 | fi |
c62d1274 | 78 | done |
d94aca1a MT |
79 | |
80 | # We don't do any links based on the target system, just makefile config. | |
81 | ||
c62d1274 | 82 | if test x${all_targets} = xfalse ; then |
d94aca1a MT |
83 | |
84 | # Target architecture .o files. | |
85 | ta= | |
86 | ||
c62d1274 | 87 | for arch in $selarchs |
d94aca1a MT |
88 | do |
89 | ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g` | |
90 | archdefs="$archdefs -DARCH_$ad" | |
91 | case "$arch" in | |
92 | bfd_a29k_arch) ta="$ta a29k-dis.o" ;; | |
93 | bfd_alpha_arch) ta="$ta alpha-dis.o" ;; | |
c62d1274 ILT |
94 | # start-sanitize-arc |
95 | bfd_arc_arch) ta="$ta arc-dis.o arc-opc.o" ;; | |
96 | # end-sanitize-arc | |
d94aca1a MT |
97 | bfd_arm_arch) ta="$ta arm-dis.o" ;; |
98 | bfd_h8300_arch) ta="$ta h8300-dis.o" ;; | |
99 | bfd_h8500_arch) ta="$ta h8500-dis.o" ;; | |
100 | bfd_hppa_arch) ta="$ta hppa-dis.o" ;; | |
101 | bfd_i386_arch) ta="$ta i386-dis.o" ;; | |
f98c3369 | 102 | bfd_i860_arch) ;; |
d94aca1a | 103 | bfd_i960_arch) ta="$ta i960-dis.o" ;; |
c62d1274 | 104 | bfd_m68k_arch) ta="$ta m68k-dis.o m68k-opc.o" ;; |
d94aca1a MT |
105 | bfd_m88k_arch) ta="$ta m88k-dis.o" ;; |
106 | bfd_mips_arch) ta="$ta mips-dis.o mips-opc.o" ;; | |
107 | bfd_ns32k_arch) ta="$ta ns32k-dis.o" ;; | |
108 | bfd_powerpc_arch) ta="$ta ppc-dis.o ppc-opc.o" ;; | |
109 | bfd_rs6000_arch) ta="$ta ppc-dis.o ppc-opc.o" ;; | |
110 | bfd_sh_arch) ta="$ta sh-dis.o" ;; | |
03c4ce2f MT |
111 | # start-sanitize-rce |
112 | bfd_rce_arch) ta="$ta rce-dis.o" ;; | |
113 | # end-sanitize-rce | |
d94aca1a MT |
114 | bfd_sparc_arch) ta="$ta sparc-dis.o sparc-opc.o" ;; |
115 | bfd_vax_arch) ;; | |
116 | bfd_we32k_arch) ;; | |
117 | bfd_z8k_arch) ta="$ta z8k-dis.o" ;; | |
c62d1274 | 118 | bfd_w65_arch) ta="$ta w65-dis.o" ;; |
d94aca1a MT |
119 | |
120 | "") ;; | |
c62d1274 | 121 | *) AC_MSG_ERROR(*** unknown target architecture $arch) ;; |
d94aca1a MT |
122 | esac |
123 | done | |
124 | ||
125 | # Weed out duplicate .o files. | |
126 | f="" | |
127 | for i in $ta ; do | |
128 | case " $f " in | |
129 | *" $i "*) ;; | |
130 | *) f="$f $i" ;; | |
131 | esac | |
132 | done | |
133 | ta="$f" | |
134 | ||
135 | # And duplicate -D flags. | |
136 | f="" | |
137 | for i in $archdefs ; do | |
138 | case " $f " in | |
139 | *" $i "*) ;; | |
140 | *) f="$f $i" ;; | |
141 | esac | |
142 | done | |
143 | archdefs="$f" | |
144 | ||
c62d1274 | 145 | BFD_MACHINES="$ta" |
d94aca1a MT |
146 | |
147 | else # all_targets is true | |
c62d1274 ILT |
148 | archdefs=-DARCH_all |
149 | BFD_MACHINES='$(ALL_MACHINES)' | |
150 | fi | |
151 | ||
152 | AC_SUBST(archdefs) | |
153 | AC_SUBST(BFD_MACHINES) | |
d94aca1a | 154 | |
f98c3369 ILT |
155 | AC_OUTPUT(Makefile, |
156 | [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac]) |