some ns32k updates from Ian Dall
[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 "$enable_targets" ]; then
24 for targ in `echo $enable_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 arm-*-pe) ld_target=arm-pe ;;
43 # start-sanitize-arc
44 arc-*-elf*) ld_target=arc-elf ;;
45 # end-sanitize-arc
46 sparc-sun-sunos4*) ld_target=sun4 ;;
47 sparclite*-*-coff) ld_target=coff-sparc ;;
48 sparclite*-fujitsu-*) ld_target=sun4 ;;
49 sparc*-*-aout) ld_target=sun4 ;;
50 sparc*-*-coff) ld_target=coff-sparc ;;
51 sparc64-*-elf*) ld_target=sparc64-elf ;;
52 sparc64*) ld_target=sun4 ;;
53 sparc*-*-elf) ld_target=sun4sol2 ;;
54 sparc*-*-lynxos*) ld_target=sparc-lynx ;;
55 sparc*-*-netbsd*) ld_target=sparc-nbsd ;;
56 sparc*-*-solaris2*) ld_target=sun4sol2 ;;
57 sparc*-wrs-vxworks*) ld_target=sun4 ;;
58 i960-wrs-vxworks5.0*) ld_target=i960 ;;
59 i960-wrs-vxworks5*) ld_target=i960coff ;;
60 i960-wrs-vxworks*) ld_target=i960 ;;
61 i960-*-coff) ld_target=i960coff ;;
62 i960-intel-nindy) ld_target=i960 ;;
63 m68*-sun-sunos[34]*) ld_target=sun3 ;;
64 m68*-wrs-vxworks*) ld_target=vxworks68 ;;
65 m68*-ericsson-ose) ld_target=ose68 ;;
66 *-tandem-none) ld_target=st2000 ;; # FIXME needs better name
67 i[345]86-*-vsta) ld_target=vsta ;;
68 i[345]86-*-go32) ld_target=i386-go32 ;;
69 i[345]86-*-aix*) ld_target=i386-coff ;;
70 i[345]86-*-sco*) ld_target=i386-coff ;;
71 i[345]86-*-lynxos*) ld_target=i386-lynx ;;
72 i[345]86-*-coff) ld_target=i386-coff ;;
73 i[345]86-*-bsd) ld_target=i386-bsd ;;
74 i[345]86-*-bsd386) ld_target=i386-bsd ;;
75 i[345]86-*-bsdi*) ld_target=i386-bsd ;;
76 i[345]86-*-aout) ld_target=i386-aout ;;
77 i[345]86-*-linuxaout*) ld_target=i386-laout ;;
78 i[345]86-*-linuxoldld) ld_target=i386-laout ;;
79 i[345]86-*-linux*) ld_target=i386-linux ;;
80 i[345]86-*-sysv4*) ld_target=i386-elf ;;
81 i[345]86-*-unixware) ld_target=i386-elf ;;
82 i[345]86-*-netbsd*) ld_target=i386-nbsd ;;
83 i[345]86-*-netware) ld_target=i386-nw ;;
84 i[345]86-*-elf*) ld_target=i386-elf ;;
85 i[345]86-*-sysv*) ld_target=i386-coff ;;
86 i[345]86-*-mach*) ld_target=i386-mach ;;
87 i[345]86-*-gnu*) ld_target=i386-gelf ;;
88 i[345]86-*-msdos*) ld_target=i386-msdos ;;
89 i[345]86-*-moss*) ld_target=i386-moss ;;
90 i[345]86-*-winnt) ld_target=i386-pe ;;
91 i[345]86-*-pe) ld_target=i386-pe ;;
92 i[345]86-*-win32) ld_target=i386-pe ;;
93 m8*-*-*) ld_target=m88k-bcs ;;
94 a29k-*-udi) ld_target=sa29200 ;;
95 a29k-*-ebmon) ld_target=ebmon29k ;;
96 a29k-*-*) ld_target=coff-a29k ;;
97 # arm-*-riscix*) ld_target=riscix ;;
98 arm-*-aout | armel-*-aout)
99 ld_target=arml-aout ;;
100 armeb-*-aout) ld_target=armb-aout ;;
101 h8300-*-hms) ld_target=coff-h8300 ;;
102 h8500-*-hms) ld_target=coff-h8500 ;;
103 sh-*-*) ld_target=coff-sh ;;
104 # start-sanitize-rce
105 rce-*-aout) ld_target=rce-aout ;;
106 # end-sanitize-rce
107 m68k-sony-*) ld_target=news ;;
108 m68k-hp-bsd*) ld_target=hp300bsd ;;
109 m68*-*-aout) ld_target=m68k ;;
110 m68*-*-coff) ld_target=m68k-coff ;;
111 m68*-*-elf) ld_target=m68k-elf ;;
112 m68*-*-hpux*) ld_target=hp300hpux ;;
113 m68*-*-lynxos*) ld_target=m68k-lynx ;;
114 m68*-*-netbsd*) ld_target=m68k-nbsd ;;
115 m68*-*-*)
116 echo '***' "Unknown m68k target vendor for ld:" ${target_vendor} 1>&2
117 exit 1 ;;
118 hppa*-*-*elf*) ld_target=hppaelf ;;
119 hppa*-*-lites*) ld_target=hppaelf ;;
120 vax-dec-ultrix* | vax-dec-bsd*) ld_target=vax ;;
121 mips*-dec-ultrix*) ld_target=mips-lit ;;
122 mips*-sgi-irix5*) ld_target=mipsb-elf32 ;;
123 mips*-sgi-irix*) ld_target=mips-big ;;
124 mips*el-*-ecoff*) ld_target=mipsl-idt ;;
125 mips*-*-ecoff*) ld_target=mips-idt ;;
126 mips*-dec-bsd*) ld_target=mipsbsd ;;
127 # CYGNUS LOCAL jsmith
128 mips*vr4300el-*-elf*) ld_target=mips-vr4300el ;;
129 mips*vr4300-*-elf*) ld_target=mips-vr4300 ;;
130 # END CYGNUS LOCAL
131 mips*el-*-elf*) ld_target=mipsl-elf32 ;;
132 mips*-*-elf*) ld_target=mipsb-elf32 ;;
133 alpha-*-osf*) ld_target=alpha ;;
134 alpha-*-netware*) ld_target=alpha ;;
135 z8k-*-coff) ld_target=z8k-coff ;;
136 ns32k-pc532-mach* | ns32k-pc532-ux*) ld_target=pc532mach ;;
137 ns32k-pc532-netbsd* | ns32k-pc532-lites*) ld_target=ns32k-nbsd ;;
138 powerpc-*-elf* | powerpc-*-eabi*) ld_target=ppc-elf32 ;;
139 powerpcle-*-elf* | powerpcle-*-eabi*) ld_target=ppcle-elf32 ;;
140 powerpc-*-netware*) ld_target=ppc-nw ;;
141 w65-*-*) ld_target=coff-w65 ;;
142 *-*-aout) ld_target=${target_cpu}-${target_vendor} ;;
143 *-*-coff) ld_target=${target_cpu}-${target_vendor} ;;
144 *-*-netware) ld_target=${target_cpu}-nw ;;
145
146 all) ld_target=all ;;
147 esac
148
149 if [ "x$ld_target" = "xall" ]; then
150 all_targets=true
151 else
152 if [ ! -f ${srcdir}/config/${ld_target}.mt ] ; then
153 echo '***' No file ${srcdir}/config/${ld_target}.mt 1>&2
154 echo '***' GNU LD does not support target ${ld_target} 1>&2
155 echo '***' Look in ld/configure.in for supported targets 1>&2
156 exit 1
157 fi
158
159 if [ "x$targ" = "x$target" ]; then
160 target_makefile_frag=${srcdir}/config/${ld_target}.mt
161 else
162 target_extra_frags="$target_extra_frags ${srcdir}/config/${ld_target}.mt"
163 fi
164 fi
165 done
166
167 # We don't do any links based on the target system, just makefile config.
168
169 # post-target:
170
171 rm -f Makefile.tmp Makefile.2
172 mv Makefile Makefile.tmp
173
174 if [ x${all_targets} = xfalse ]; then
175
176 allfrags="$target_makefile_frag $target_extra_frags"
177
178 # The emulations in all the configured targets.
179 tb=`sed -n '
180 s/EMUL[ ]*=[ ]*\([^ ]*\)/e\1.o/p
181 s/EMUL_EXTRA.*=[ ]*\([^ ]*\)/e\1.o/p
182 ' $allfrags`
183 # uniq the list.
184 f=""
185 for i in $tb ; do
186 case " $f " in
187 *" $i "*) ;;
188 *) f="$f $i" ;;
189 esac
190 done
191 tb="$f"
192
193 echo "EMULATION_OFILES = $tb" >> Makefile.2
194
195 else # all_targets is true
196 echo 'EMULATION_OFILES = $(ALL_EMULATIONS)' >> Makefile.2
197 fi # all_targets is true
198
199 cat Makefile.tmp >> Makefile.2
200 rm -f Makefile.tmp
201 mv Makefile.2 Makefile
202
203 mkdir ldscripts 2>/dev/null