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.
11 . ${srcdir}/../bfd/configure.host
13 # Set up to make a link between the host's include file and "sysdep.h".
14 files="../bfd/hosts/${my_host}.h"
17 if [ ! -f ${srcdir}/${files} ] ; then
18 files=../bfd/hosts/std-host.h
19 echo "[${srcname} has no specific support for host ${host} -- using std-host]"
23 if [ -f ${srcdir}/../bfd/config/${my_host}.mh ] ; then
24 host_makefile_frag=../bfd/config/${my_host}.mh
29 # Canonicalize the secondary target names.
30 if [ -n "$enable_targets" ]; then
31 for targ in `echo $enable_targets | sed 's/,/ /g'`
33 result=`$configsub $targ 2>/dev/null`
34 if [ -n "$result" ]; then
35 canon_targets="$canon_targets $result"
37 # Allow targets that config.sub doesn't recognize, like "all".
38 canon_targets="$canon_targets $targ"
45 for targ in $target $canon_targets
47 bfd_target=`${config_shell} $srcdir/../bfd/config.bfd $targ`
49 if [ "x$bfd_target" = "xall" ]; then
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
59 if [ "x$targ" = "x$target" ]; then
60 target_makefile_frag=${srcdir}/../bfd/config/${bfd_target}.mt
62 target_extra_frags="$target_extra_frags ${srcdir}/../bfd/config/${bfd_target}.mt"
67 # We don't do any links based on the target system, just makefile config.
71 rm -f Makefile.tmp Makefile.2
72 mv Makefile Makefile.tmp
74 if [ x${all_targets} = xfalse ]; then
76 allfrags="$target_makefile_frag $target_extra_frags"
78 # The architectures in all the configured targets.
79 SELECT_ARCHITECTURES=`sed -n '
80 s/SELECT_ARCHITECTURES[ ]*=[ ]*//p
83 # Target architecture .o files.
86 for arch in $SELECT_ARCHITECTURES
88 ad=`echo $arch | sed -e s/bfd_//g -e s/_arch//g`
89 archdefs="$archdefs -DARCH_$ad"
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" ;;
107 bfd_rce_arch) ta="$ta rce-dis.o" ;;
109 bfd_sparc_arch) ta="$ta sparc-dis.o sparc-opc.o" ;;
112 bfd_z8k_arch) ta="$ta z8k-dis.o" ;;
115 *) echo "*** unknown target architecture $arch" 1>&2; exit 1 ;;
119 # Weed out duplicate .o files.
129 # And duplicate -D flags.
131 for i in $archdefs ; do
139 echo "ARCHDEFS = $archdefs" >> Makefile.2
140 echo "BFD_MACHINES = $ta" >> Makefile.2
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
147 cat Makefile.tmp >> Makefile.2
149 mv Makefile.2 Makefile