* configure.in: Group targets by CPU. Merge some m68k target entries with
[binutils-gdb.git] / ld / configure.in
1 # This file is a shell script fragment that supplies the information
2 # necessary to tailor a template configure script into the configure
3 # script appropriate for this directory. For more information, check
4 # any existing configure script.
5
6 srctrigger=ldmain.c
7 srcname="linker"
8 target_dependent=true
9
10 # per-host:
11
12 . ${srcdir}/../bfd/configure.host
13
14 host_makefile_frag=
15
16 if [ -f ${srcdir}/config/${my_host}.mh ] ; then
17 host_makefile_frag=config/${my_host}.mh
18 fi
19
20 # per-target:
21
22 # Canonicalize the secondary target names.
23 if [ -n "$with_targets" ]; then
24 for targ in `echo $with_targets | sed 's/,/ /g'`
25 do
26 result=`$configsub $targ 2>/dev/null`
27 if [ -n "$result" ]; then
28 canon_targets="$canon_targets $result"
29 else
30 # Allow targets that config.sub doesn't recognize, like "all".
31 canon_targets="$canon_targets $targ"
32 fi
33 done
34 fi
35
36 all_targets=false
37
38 for targ in $target $canon_targets
39 do
40
41 case "${targ}" in
42
43 sparc-sun-sunos4*) ld_target=sun4 ;;
44 sparclite*-fujitsu-*) ld_target=sun4 ;;
45 # start-sanitize-v9
46 sparc64-*-elf*) ld_target=sparc64-elf ;;
47 sparc64*) ld_target=sun4 ;;
48 # end-sanitize-v9
49 sparc*-*-aout) ld_target=sun4 ;;
50 sparc*-*-coff) ld_target=coff-sparc ;;
51 sparc*-*-elf) ld_target=sun4sol2 ;;
52 sparc*-*-lynxos*) ld_target=sparc-lynx ;;
53 sparc*-*-solaris2*) ld_target=sun4sol2 ;;
54 sparc*-wrs-vxworks*) ld_target=sun4 ;;
55 sparc*-*-netware) ld_target=sun4sol2 ;;
56 i960-wrs-vxworks*) ld_target=i960 ;;
57 i960-intel-nindy) ld_target=i960 ;;
58 m68*-sun-sunos[34]*) ld_target=sun3 ;;
59 m68*-wrs-vxworks*) ld_target=vxworks68 ;;
60 m68*-ericsson-ose) ld_target=ose68 ;;
61 *-tandem-none) ld_target=st2000 ;; # FIXME needs better name
62 i[34]86-*-go32) ld_target=go32 ;;
63 i[34]86-*-aix*) ld_target=i386-coff ;;
64 i[34]86-*-sco*) ld_target=i386-coff ;;
65 i[34]86-*-lynxos*) ld_target=i386-lynx ;;
66 i[34]86-*-coff) ld_target=i386-coff ;;
67 i[34]86-*-bsd) ld_target=i386-bsd ;;
68 i[34]86-*-aout) ld_target=i386-aout ;;
69 i[34]86-*-linux) ld_target=i386-linux ;;
70 i[34]86-*-sysv4*) ld_target=i386-elf ;;
71 i[34]86-*-unixware) ld_target=i386-elf ;;
72 i[34]86-*-netware) ld_target=i386-elf ;;
73 i[34]86-*-elf*) ld_target=i386-elf ;;
74 i[34]86-*-sysv*) ld_target=i386-coff ;;
75 i[34]86-*-mach*) ld_target=i386-mach ;;
76 m8*-*-*) ld_target=m88k-bcs ;;
77 a29k-*-udi) ld_target=sa29200 ;;
78 a29k-*-ebmon) ld_target=ebmon29k ;;
79 a29k-*-*) ld_target=coff-a29k ;;
80 h8300-*-hms) ld_target=coff-h8300 ;;
81 h8300h-*-hms) ld_target=coff-h8300h ;;
82 h8500-*-hms) ld_target=coff-h8500 ;;
83 sh-*-*) ld_target=coff-sh ;;
84 m68k-sony-*) ld_target=news ;;
85 m68k-hp-bsd*) ld_target=hp300bsd ;;
86 m68*-*-aout) ld_target=m68k ;;
87 m68*-*-coff) ld_target=m68k-coff ;;
88 m68*-*-hpux) ld_target=hp300hpux ;;
89 m68*-*-lynxos*) ld_target=m68k-lynx ;;
90 m68*-*-*)
91 echo '***' "Unknown m68k target vendor for ld:" ${target_vendor} 1>&2
92 exit 1 ;;
93 hppa*-hp-osf) ld_target=hppaosf ;;
94 vax-dec-ultrix* | vax-dec-bsd*) ld_target=vax ;;
95 mips*-dec-ultrix*) ld_target=mips-lit ;;
96 mips*-sgi-irix5*) ld_target=mipsb-elf32 ;;
97 mips*-sgi-irix*) ld_target=mips-big ;;
98 mips*el-idt-ecoff*) ld_target=mips-idtl ;;
99 mips*-idt-ecoff*) ld_target=mips-idt ;;
100 mips*-dec-bsd*) ld_target=mipsbsd ;;
101 mips*-*-elf*) ld_target=mipsb-elf32 ;;
102 alpha-*-osf*) ld_target=alpha ;;
103 z8k-*-sim | z8k-*-coff) ld_target=z8ksim ;;
104 *-*-aout) ld_target=${target_cpu}-${target_vendor} ;;
105 *-*-coff) ld_target=${target_cpu}-${target_vendor} ;;
106 *-*-netware) ld_target=${target_cpu}-elf ;;
107
108 all) ld_target=all ;;
109 esac
110
111 if [ "x$ld_target" = "xall" ]; then
112 all_targets=true
113 else
114 if [ ! -f ${srcdir}/config/${ld_target}.mt ] ; then
115 echo '***' No file ${srcdir}/config/${ld_target}.mt 1>&2
116 echo '***' GNU LD does not support target ${ld_target} 1>&2
117 echo '***' Look in ld/configure.in for supported targets 1>&2
118 exit 1
119 fi
120
121 if [ "x$targ" = "x$target" ]; then
122 target_makefile_frag=${srcdir}/config/${ld_target}.mt
123 else
124 target_extra_frags="$target_extra_frags ${srcdir}/config/${ld_target}.mt"
125 fi
126 fi
127 done
128
129 # We don't do any links based on the target system, just makefile config.
130
131 # post-target:
132
133 rm -f Makefile.tmp Makefile.2
134 mv Makefile Makefile.tmp
135
136 if [ x${all_targets} = xfalse ]; then
137
138 allfrags="$target_makefile_frag $target_extra_frags"
139
140 # The emulations in all the configured targets.
141 tb=`sed -n '
142 s/EMUL[ ]*=[ ]*\([^ ]*\)/em_\1.o/p
143 ' $allfrags`
144 # uniq the list.
145 f=""
146 for i in $tb ; do
147 case " $f " in
148 *" $i "*) ;;
149 *) f="$f $i" ;;
150 esac
151 done
152 tb="$f"
153
154 echo "EMULATION_OFILES = $tb" >> Makefile.2
155
156 else # all_targets is true
157 echo 'EMULATION_OFILES = $(ALL_EMULATIONS)' >> Makefile.2
158 fi # all_targets is true
159
160 cat Makefile.tmp >> Makefile.2
161 rm -f Makefile.tmp
162 mv Makefile.2 Makefile
163
164 mkdir ldscripts 2>/dev/null