Commit | Line | Data |
---|---|---|
57cae454 SG |
1 | # This file is a shell script that supplies the information necessary |
2 | # to tailor a template configure script into the configure script | |
3 | # appropriate for this directory. For more information, check any | |
4 | # existing configure script. | |
5 | ||
6 | srctrigger=z8k-dis.c | |
7 | srcname="opcodes" | |
8 | ||
9 | # per-host: | |
10 | ||
d94aca1a | 11 | . ${srcdir}/../bfd/configure.host |
d5dcef63 | 12 | |
57cae454 SG |
13 | # Set up to make a link between the host's include file and "sysdep.h". |
14 | files="../bfd/hosts/${my_host}.h" | |
57cae454 SG |
15 | links="sysdep.h" |
16 | ||
17 | if [ ! -f ${srcdir}/${files} ] ; then | |
d94aca1a MT |
18 | files=../bfd/hosts/std-host.h |
19 | echo "[${srcname} has no specific support for host ${host} -- using std-host]" | |
57cae454 SG |
20 | fi |
21 | ||
22 | host_makefile_frag= | |
23 | if [ -f ${srcdir}/../bfd/config/${my_host}.mh ] ; then | |
24 | host_makefile_frag=../bfd/config/${my_host}.mh | |
25 | fi | |
26 | ||
27 | # per-target: | |
d94aca1a MT |
28 | |
29 | # Canonicalize the secondary target names. | |
30 | if [ -n "$enable_targets" ]; then | |
31 | for targ in `echo $enable_targets | sed 's/,/ /g'` | |
32 | do | |
33 | result=`$configsub $targ 2>/dev/null` | |
34 | if [ -n "$result" ]; then | |
35 | canon_targets="$canon_targets $result" | |
36 | else | |
37 | # Allow targets that config.sub doesn't recognize, like "all". | |
38 | canon_targets="$canon_targets $targ" | |
39 | fi | |
40 | done | |
41 | fi | |
42 | ||
43 | all_targets=false | |
44 | ||
45 | for targ in $target $canon_targets | |
46 | do | |
47 | bfd_target=`${config_shell} $srcdir/../bfd/config.bfd $targ` | |
48 | ||
49 | if [ "x$bfd_target" = "xall" ]; then | |
50 | all_targets=true | |
51 | else | |
52 | if [ ! -f ${srcdir}/../bfd/config/${bfd_target}.mt ] ; then | |
53 | echo '***' No file ${srcdir}/../bfd/config/${bfd_target}.mt 1>&2 | |
54 | echo '***' opcodes does not support target ${bfd_target} 1>&2 | |
55 | echo '***' Look in bfd/config.bfd for supported targets 1>&2 | |
56 | exit 1 | |
57 | fi | |
58 | ||
59 | if [ "x$targ" = "x$target" ]; then | |
60 | target_makefile_frag=${srcdir}/../bfd/config/${bfd_target}.mt | |
61 | else | |
62 | target_extra_frags="$target_extra_frags ${srcdir}/../bfd/config/${bfd_target}.mt" | |
63 | fi | |
64 | fi | |
65 | done | |
66 | ||
67 | # We don't do any links based on the target system, just makefile config. | |
68 | ||
69 | # post-target: | |
70 | ||
71 | rm -f Makefile.tmp Makefile.2 | |
72 | mv Makefile Makefile.tmp | |
73 | ||
74 | if [ x${all_targets} = xfalse ]; then | |
75 | ||
76 | allfrags="$target_makefile_frag $target_extra_frags" | |
77 | ||
78 | # The architectures in all the configured targets. | |
79 | SELECT_ARCHITECTURES=`sed -n ' | |
80 | s/SELECT_ARCHITECTURES[ ]*=[ ]*//p | |
81 | ' $allfrags` | |
82 | ||
83 | # Target architecture .o files. | |
84 | ta= | |
85 | ||
86 | for arch in $SELECT_ARCHITECTURES | |
87 | do | |
88 | ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g` | |
89 | archdefs="$archdefs -DARCH_$ad" | |
90 | case "$arch" in | |
91 | bfd_a29k_arch) ta="$ta a29k-dis.o" ;; | |
92 | bfd_alpha_arch) ta="$ta alpha-dis.o" ;; | |
93 | bfd_arm_arch) ta="$ta arm-dis.o" ;; | |
94 | bfd_h8300_arch) ta="$ta h8300-dis.o" ;; | |
95 | bfd_h8500_arch) ta="$ta h8500-dis.o" ;; | |
96 | bfd_hppa_arch) ta="$ta hppa-dis.o" ;; | |
97 | bfd_i386_arch) ta="$ta i386-dis.o" ;; | |
98 | bfd_i960_arch) ta="$ta i960-dis.o" ;; | |
99 | bfd_m68k_arch) ta="$ta m68k-dis.o" ;; | |
100 | bfd_m88k_arch) ta="$ta m88k-dis.o" ;; | |
101 | bfd_mips_arch) ta="$ta mips-dis.o mips-opc.o" ;; | |
102 | bfd_ns32k_arch) ta="$ta ns32k-dis.o" ;; | |
103 | bfd_powerpc_arch) ta="$ta ppc-dis.o ppc-opc.o" ;; | |
104 | bfd_rs6000_arch) ta="$ta ppc-dis.o ppc-opc.o" ;; | |
105 | bfd_sh_arch) ta="$ta sh-dis.o" ;; | |
03c4ce2f MT |
106 | # start-sanitize-rce |
107 | bfd_rce_arch) ta="$ta rce-dis.o" ;; | |
108 | # end-sanitize-rce | |
d94aca1a MT |
109 | bfd_sparc_arch) ta="$ta sparc-dis.o sparc-opc.o" ;; |
110 | bfd_vax_arch) ;; | |
111 | bfd_we32k_arch) ;; | |
112 | bfd_z8k_arch) ta="$ta z8k-dis.o" ;; | |
113 | ||
114 | "") ;; | |
115 | *) echo "*** unknown target architecture $arch" 1>&2; exit 1 ;; | |
116 | esac | |
117 | done | |
118 | ||
119 | # Weed out duplicate .o files. | |
120 | f="" | |
121 | for i in $ta ; do | |
122 | case " $f " in | |
123 | *" $i "*) ;; | |
124 | *) f="$f $i" ;; | |
125 | esac | |
126 | done | |
127 | ta="$f" | |
128 | ||
129 | # And duplicate -D flags. | |
130 | f="" | |
131 | for i in $archdefs ; do | |
132 | case " $f " in | |
133 | *" $i "*) ;; | |
134 | *) f="$f $i" ;; | |
135 | esac | |
136 | done | |
137 | archdefs="$f" | |
138 | ||
139 | echo "ARCHDEFS = $archdefs" >> Makefile.2 | |
140 | echo "BFD_MACHINES = $ta" >> Makefile.2 | |
141 | ||
142 | else # all_targets is true | |
143 | echo 'ARCHDEFS = -DARCH_all' >> Makefile.2 | |
144 | echo 'BFD_MACHINES = $(ALL_MACHINES)' >> Makefile.2 | |
145 | fi # all_targets is true | |
146 | ||
147 | cat Makefile.tmp >> Makefile.2 | |
148 | rm -f Makefile.tmp | |
149 | mv Makefile.2 Makefile |