]> Git Repo - binutils.git/blame - configure.in
Add missing file for solaris on powerpc
[binutils.git] / configure.in
CommitLineData
59d95e81 1#! /bin/bash
9bdd52dd 2##############################################################################
eb02fd64 3
041164e4
DZ
4## This file is a shell script fragment that supplies the information
5## necessary to tailor a template configure script into the configure
6## script appropriate for this directory. For more information, check
7## any existing configure script.
ba4513e7 8
041164e4
DZ
9## Be warned, there are two types of configure.in files. There are those
10## used by Autoconf, which are macros which are expanded into a configure
11## script by autoconf. The other sort, of which this is one, is executed
12## by Cygnus configure.
ba4513e7 13
041164e4
DZ
14## For more information on these two systems, check out the documentation
15## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
ba4513e7 16
9bdd52dd 17##############################################################################
041164e4
DZ
18
19### To add a new directory to the tree, first choose whether it is a target
20### or a host dependent tool. Then put it into the appropriate list
21### (library or tools, host or target), doing a dependency sort. For
22### example, gdb requires that byacc (or bison) be built first, so it is in
23### the ${host_tools} list after byacc and bison.
24
25
26# these libraries are used by various programs built for the host environment
27#
6d3055cb 28host_libs="mmalloc libiberty opcodes bfd readline gash tcl tk tclX"
041164e4 29
f4a7dca7
TL
30if [ "${enable_gdbgui}" = "yes" ] ; then
31 host_libs="${host_libs} libgui"
32fi
33
041164e4
DZ
34# these tools are built for the host environment
35#
36host_tools="texinfo byacc flex bison binutils ld gas gcc gdb make patch
d6c8b354 37 prms send-pr gprof gdbtest tgas etc expect dejagnu sim
e718498b 38 m4 autoconf ispell grep diff rcs cvs fileutils shellutils
e37bb3c7 39 textutils wdiff find emacs emacs19 uudecode hello tar gzip indent
ed21219c 40 recode release sed utils guile perl apache inet"
041164e4
DZ
41
42
9bdd52dd
DZ
43# these libraries are built for the target environment, and are built after
44# the host libraries and the host tools (which may be a cross compiler)
041164e4 45#
77cd090a 46target_libs="target-libiberty target-libgloss target-newlib target-libio target-librx target-libstdc++ target-libg++"
6218894f 47
041164e4 48
9bdd52dd 49# these tools are built using the target libs, and are intended to run only
9623e828 50# in the target environment
83a47678 51#
9bdd52dd
DZ
52# note: any program that *uses* libraries that are in the "target_libs"
53# list belongs in this list. those programs are also very likely
54# candidates for the "native_only" list which follows
041164e4 55#
b58d9e5d 56target_tools="target-examples target-groff"
041164e4
DZ
57
58################################################################################
59
60## These two lists are of directories that are to be removed from the
61## ${configdirs} list for either cross-compilations or for native-
62## compilations. For example, it doesn't make that much sense to
ab1cbc67 63## cross-compile Emacs, nor is it terribly useful to compile target-libiberty in
041164e4
DZ
64## a native environment.
65
66# directories to be built in the native environment only
67#
b58d9e5d 68native_only="autoconf cvs emacs emacs19 fileutils find grep gzip hello
86c3abaa 69 indent ispell m4 rcs recode sed shellutils tar textutils gash
ed21219c 70 uudecode wdiff gprof target-groff guile perl apache inet"
041164e4 71
9bdd52dd 72# directories to be built in a cross environment only
041164e4 73#
ab1cbc67 74cross_only="target-libiberty target-libgloss target-newlib"
041164e4
DZ
75
76## All tools belong in one of the four categories, and are assigned above
8f30a41e
DE
77## We assign ${configdirs} this way to remove all embedded newlines. This
78## is important because configure will choke if they ever get through.
ca2ce3b3
ILT
79## ${configdirs} is directories we build using the host tools.
80## ${target_configdirs} is directories we build using the target tools.
041164e4 81#
ca2ce3b3
ILT
82configdirs=`echo ${host_libs} ${host_tools}`
83target_configdirs=`echo ${target_libs} ${target_tools}`
041164e4
DZ
84
85################################################################################
ba4513e7 86
378fd382 87srctrigger=move-if-change
eb02fd64 88srcname="gnu development package"
0df06ca0 89
af9fa3c1
ILT
90# This gets set non-empty for some net releases of packages.
91appdirs=""
92
0df06ca0
RP
93# per-host:
94
594c548a
DM
95# Work in distributions that contain no compiler tools, like Autoconf.
96if [ -d ${srcdir}/config ]; then
cec673a2 97case "${host}" in
c71350fc 98 m68k-hp-hpux*) host_makefile_frag=config/mh-hp300 ;;
cec673a2
DZ
99 m68k-apollo-sysv*) host_makefile_frag=config/mh-apollo68 ;;
100 m68k-apollo-bsd*) host_makefile_frag=config/mh-a68bsd ;;
769e064d 101 m68k-*-linux*) host_makefile_frag=config/mh-linux ;;
cec673a2 102 m88k-dg-dgux*) host_makefile_frag=config/mh-dgux ;;
48de3495
SS
103 m88k-harris-cxux*) host_makefile_frag=config/mh-cxux ;;
104 m88k-motorola-sysv*) host_makefile_frag=config/mh-delta88;;
e718498b 105 mips*-dec-ultrix*) host_makefile_frag=config/mh-decstation ;;
a527d9d7 106 mips*-nec-sysv4*) host_makefile_frag=config/mh-necv4 ;;
031eff55 107 mips*-sgi-irix[56]*) host_makefile_frag=config/mh-irix5 ;;
e718498b
DZ
108 mips*-sgi-irix4*) host_makefile_frag=config/mh-irix4 ;;
109 mips*-sgi-irix3*) host_makefile_frag=config/mh-sysv ;;
49ad26c2 110 mips*-*-sysv4*) host_makefile_frag=config/mh-sysv4 ;;
e718498b 111 mips*-*-sysv*) host_makefile_frag=config/mh-riscos ;;
7e290a5d 112 i[345]86-ncr-sysv4.3) host_makefile_frag=config/mh-ncrsvr43 ;;
a73fc881 113 i[345]86-ncr-sysv4*) host_makefile_frag=config/mh-ncr3000 ;;
a48876fc 114 i[345]86-*-sco3.2v5*) host_makefile_frag=config/mh-sysv ;;
a73fc881
ILT
115 i[345]86-*-sco*) host_makefile_frag=config/mh-sco ;;
116 i[345]86-*-isc*) host_makefile_frag=config/mh-sysv ;;
117 i[345]86-*-linux*) host_makefile_frag=config/mh-linux ;;
118 i[345]86-*-solaris2*) host_makefile_frag=config/mh-sysv4 ;;
119 i[345]86-*-aix*) host_makefile_frag=config/mh-aix386 ;;
120 i[345]86-*-go32*) host_makefile_frag=config/mh-go32 ;;
d3c06c91 121 vax-*-ultrix2*) host_makefile_frag=config/mh-vaxult2 ;;
54fdaa7b 122 *-*-solaris2*) host_makefile_frag=config/mh-solaris ;;
39772dd8 123 m68k-sun-sunos*) host_makefile_frag=config/mh-sun3 ;;
0259fc73 124 *-hp-hpux[78]*) host_makefile_frag=config/mh-hpux8 ;;
c71350fc 125 *-hp-hpux*) host_makefile_frag=config/mh-hpux ;;
9117f609 126 *-*-hiux*) host_makefile_frag=config/mh-hpux ;;
af9fa3c1 127 rs6000-*-lynxos*) host_makefile_frag=config/mh-lynxrs6k ;;
89c27486 128 *-*-lynxos*) host_makefile_frag=config/mh-lynxos ;;
fab5d4e3
DZ
129 *-*-sysv4*) host_makefile_frag=config/mh-sysv4 ;;
130 *-*-sysv*) host_makefile_frag=config/mh-sysv ;;
f4bda0ff 131esac
594c548a 132fi
f4bda0ff 133
0e47ce97
ILT
134# If we aren't going to be using gcc, see if we can extract a definition
135# of CC from the fragment.
136if [ -z "${CC}" -a "${build}" = "${host}" ]; then
137 IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:"
138 found=
139 for dir in $PATH; do
140 test -z "$dir" && dir=.
141 if test -f $dir/gcc; then
142 found=yes
143 break
144 fi
145 done
146 IFS="$save_ifs"
147 if [ -z "${found}" -a -n "${host_makefile_frag}" -a -f "${srcdir}/${host_makefile_frag}" ]; then
2f9bfdfa
SG
148 xx=`sed -n -e 's/^[ ]*CC[ ]*=[ ]*\(.*\)$/\1/p' < ${srcdir}/${host_makefile_frag}`
149 if [ -n "${xx}" ] ; then
150 CC=$xx
151 fi
ca2ce3b3
ILT
152 fi
153fi
154
45329a2c
JM
155# We default to --with-shared on platforms where -fpic is meaningless.
156# Well, we don't yet, but we will.
157if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then
158 case "${target}" in
159 alpha-dec-osf*) enable_shared=yes ;;
553c179c 160 alpha-*-linux*) enable_shared=yes ;;
45329a2c
JM
161 mips-sgi-irix5*) enable_shared=yes ;;
162 *) enable_shared=no ;;
163 esac
164fi
165
d4be7765
ILT
166case "${enable_shared}" in
167 yes) shared=yes ;;
168 no) shared=no ;;
feb522ad 169 "") shared=no ;;
d4be7765
ILT
170 *) shared=yes ;;
171esac
172
173if [ x${shared} = xyes ]; then
45329a2c
JM
174 waugh=
175 case "${host}" in
c9e55665
JM
176 hppa*) waugh=config/mh-papic ;;
177 i[345]86-*) waugh=config/mh-x86pic ;;
be317b06 178 sparc64-*) waugh=config/mh-sparcpic ;;
c9e55665 179 *) waugh=config/mh-${host_cpu}pic ;;
45329a2c 180 esac
4350753e
JM
181 if [ -f ${srcdir}/${waugh} ]; then
182 if [ -n "${host_makefile_frag}" ] ; then
183 cat ${srcdir}/${host_makefile_frag} > mh-frag
184 cat ${srcdir}/${waugh} >> mh-frag
185 host_makefile_frag=mh-frag
c9e55665
JM
186 else
187 host_makefile_frag=${waugh}
4350753e 188 fi
45329a2c
JM
189 fi
190fi
191
0df06ca0 192# per-target:
bc58b41d 193
9ab10a5b
SEF
194case "${target}" in
195 v810*) target_makefile_frag=config/mt-v810 ;;
138e8532
JM
196 i[345]86-*-netware*) target_makefile_frag=config/mt-netware ;;
197 powerpc-*-netware*) target_makefile_frag=config/mt-netware ;;
9ab10a5b
SEF
198esac
199
ca2ce3b3 200skipdirs=
719cb03f
DZ
201gasdir=gas
202use_gnu_ld=
203use_gnu_as=
204
9f579565
DZ
205# some tools are so dependent upon X11 that if we're not building with X,
206# it's not even worth trying to configure, much less build, that tool.
207
208case ${with_x} in
e13fa011 209 yes | "") # the default value for this tree is that X11 is available
6a42d184 210 ;;
e13fa011 211 no)
ca2ce3b3 212 skipdirs="${skipdirs} tk gash"
9f579565
DZ
213 ;;
214 *)
215 echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2
216 ;;
217esac
218
5357f128 219# Some tools are only suitable for building in a "native" situation.
ba4513e7
DZ
220# Those are added when we have a host==target configuration. For cross
221# toolchains, we add some directories that should only be useful in a
222# cross-compiler.
43557c0a 223
2a38983c
DHW
224is_cross_compiler=
225
94028943 226if [ x"${host}" = x"${target}" ] ; then
041164e4
DZ
227 # when doing a native toolchain, don't build the targets
228 # that are in the 'cross only' list
ca2ce3b3 229 skipdirs="${skipdirs} ${cross_only}"
2a38983c 230 is_cross_compiler=no
ab1cbc67 231 target_subdir=.
43557c0a 232else
041164e4
DZ
233 # similarly, don't build the targets in the 'native only'
234 # list when building a cross compiler
ca2ce3b3 235 skipdirs="${skipdirs} ${native_only}"
2a38983c 236 is_cross_compiler=yes
ab1cbc67
PB
237 target_subdir=${target_alias}
238 if [ ! -d ${target_subdir} ] ; then
239 if mkdir ${target_subdir} ; then true
240 else
241 echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
242 exit 1
243 fi
244 fi
43557c0a
DZ
245fi
246
055cca84
ILT
247copy_dirs=
248
249# Handle --with-headers=XXX. The contents of the named directory are
52b5deb9 250# copied to $(tooldir)/sys-include.
055cca84
ILT
251if [ x"${with_headers}" != x ]; then
252 if [ x${is_cross_compiler} = xno ]; then
253 echo 1>&2 '***' --with-headers is only supported when cross compiling
254 exit 1
255 fi
256 case "${exec_prefixoption}" in
257 "") x=${prefix} ;;
258 *) x=${exec_prefix} ;;
259 esac
52b5deb9 260 copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
055cca84
ILT
261fi
262
263# Handle --with-libs=XXX. Multiple directories are permitted. The
264# contents are copied to $(tooldir)/lib.
265if [ x"${with_libs}" != x ]; then
266 if [ x${is_cross_compiler} = xno ]; then
267 echo 1>&2 '***' --with-libs is only supported when cross compiling
268 exit 1
269 fi
270 # Copy the libraries in reverse order, so that files in the first named
271 # library override files in subsequent libraries.
272 case "${exec_prefixoption}" in
273 "") x=${prefix} ;;
274 *) x=${exec_prefix} ;;
275 esac
276 for l in ${with_libs}; do
277 copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
278 done
279fi
280
281# If both --with-headers and --with-libs are specified, default to
282# --without-newlib.
283if [ x"${with_headers}" != x ] && [ x"${with_libs}" != x ]; then
284 if [ x"${with_newlib}" = x ]; then
285 with_newlib=no
286 fi
287fi
288
99dff294 289# Recognize --with-newlib/--without-newlib.
055cca84 290if [ x${with_newlib} = xno ]; then
ab1cbc67 291 skipdirs="${skipdirs} target-newlib"
99dff294 292elif [ x${with_newlib} = xyes ]; then
ab1cbc67 293 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
055cca84
ILT
294fi
295
4f0ad91b
ILT
296# Default to using --with-stabs for certain targets.
297if [ x${with_stabs} = x ]; then
298 case "${target}" in
299 mips*-*-* | alpha*-*-osf* | i[345]86*-*-sysv4* | i[345]86*-*-unixware*)
300 with_stabs=yes;
301 withoptions="${withoptions} --with-stabs"
302 ;;
303 esac
304fi
305
055cca84
ILT
306# Handle ${copy_dirs}
307set fnord ${copy_dirs}
308shift
309while [ $# != 0 ]; do
310 if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then
311 :
312 else
313 echo Copying $1 to $2
314
315 # Use the install script to create the directory and all required
316 # parent directories.
317 if [ -d $2 ]; then
318 :
319 else
320 echo >config.temp
321 ${srcdir}/install.sh -c -m 644 config.temp $2/COPIED
322 fi
323
324 # Copy the directory, assuming we have tar.
325 # FIXME: Should we use B in the second tar? Not all systems support it.
326 (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
327
328 # It is the responsibility of the user to correctly adjust all
329 # symlinks. If somebody can figure out how to handle them correctly
330 # here, feel free to add the code.
331
332 echo $1 > $2/COPIED
333 fi
334 shift; shift
335done
336
eebd76cb
SC
337# Configure extra directories which are host specific
338
339case "${host}" in
9daacfc4 340 i[345]86-*-go32*)
a220ba0f 341 configdirs="$configdirs dosrel" ;;
eebd76cb
SC
342esac
343
5357f128 344# Remove more programs from consideration, based on the host or
dfa891fc 345# target this usually means that a port of the program doesn't
8ae559b7 346# exist yet.
dfa891fc 347
52e3ad87
KR
348noconfigdirs=""
349
9f579565 350case "${host}" in
a73fc881 351 i[345]86-*-vsta)
ed21219c 352 noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet"
8a3871bb 353 ;;
a73fc881 354 i[345]86-*-go32)
ed21219c 355 noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet"
8c7fd353 356 ;;
9daacfc4 357 *-*-cygwin32)
bc68eff4 358 noconfigdirs="patch diff tk tcl expect dejagnu cvs autoconf texinfo bison send-pr gprof rcs guile perl apache inet"
9f579565 359 ;;
a51794f1 360 ppc*-*-pe)
bc68eff4 361 noconfigdirs="patch diff make tk tcl expect dejagnu cvs autoconf texinfo bison send-pr gprof rcs guile perl apache inet"
a51794f1 362 ;;
9f579565 363esac
dfa891fc 364
eebd76cb 365
43557c0a 366case "${target}" in
0f45fbc1 367 *-*-netware)
35cb2108 368 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
0f45fbc1 369 ;;
406477a6 370 *-*-vxworks*)
35cb2108 371 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
849367a2 372 ;;
8e85fd5f
MS
373 *-*-ose)
374 noconfigdirs="$noconfigdirs target-libgloss"
375 ;;
6bd3f765
ILT
376 alpha-dec-osf*)
377 # ld works, but does not support shared libraries. emacs doesn't
f4791d95 378 # work. newlib is not 64 bit ready. I'm not sure about fileutils or grep.
2a3486d2 379 # gas doesn't generate exception information.
35cb2108 380 noconfigdirs="$noconfigdirs gas ld emacs fileutils grep target-newlib target-libgloss"
0f45fbc1 381 ;;
04b9315f 382 alpha*-*-*)
6bd3f765 383 # newlib is not 64 bit ready
35cb2108 384 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
0f45fbc1 385 ;;
7c71fc39
DE
386# start-sanitize-arc
387 arc-*-*)
35cb2108 388 noconfigdirs="$noconfigdirs target-libgloss"
7c71fc39
DE
389 ;;
390# end-sanitize-arc
bf150019 391 arm-*-pe*)
35cb2108 392 noconfigdirs="$noconfigdirs target-libgloss"
bf150019 393 ;;
ff15324f 394 arm-*-riscix*)
35cb2108 395 noconfigdirs="$noconfigdirs ld target-libgloss"
318b02b6 396 ;;
52e3ad87 397 h8300*-*-* | \
8388b9df 398 h8500-*-*)
35cb2108 399 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
15ae586e 400 ;;
8a71f0f3 401 hppa*-*-*elf* | \
55ac59da 402 hppa*-*-lites*)
8c92a7d1 403 # Do configure ld/binutils/gas for this case.
99a5da15 404 ;;
15ae586e 405 hppa*-*-*)
408f64bc
JK
406 # HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
407 # cc is gcc, and on any system a user should be able to link cc to
e37bb3c7 408 # whatever they want. FIXME, emacs emacs19).
8b5405d2 409 case "${CC}" in
e37bb3c7 410 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
772ebace 411 *) ;;
8b5405d2 412 esac
d9f1d487 413 noconfigdirs="$noconfigdirs ld shellutils"
15ae586e 414 ;;
a73fc881 415 i[345]86-*-go32)
632ee4a1 416 # but don't build gdb
ab1cbc67 417 noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
8c92a7d1 418 ;;
9daacfc4 419 *-*-cygwin32)
77cd090a 420 target_configdirs="$target_configdirs target-winsup"
bc68eff4 421 noconfigdirs="$noconfigdirs tcl tk expect target-libgloss"
e1a1ddc6 422 # always build newlib.
ab1cbc67 423 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
9daacfc4
SC
424
425 # Can't build gdb for cygwin32 if not native.
44ccfc3c
MM
426 case "${host}:${build}" in
427 *-*-cygwin32 | *-*-cygwin32:*-*-cygwin32) ;; # keep gdb
9daacfc4
SC
428 *) noconfigdirs="$noconfigdirs gdb"
429 esac
a220ba0f 430 ;;
8c7fd353 431 i[345]86-*-pe)
35cb2108 432 noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
8c7fd353 433 ;;
a48876fc
SS
434 i[345]86-*-sco3.2v5*)
435 # The linker does not yet know about weak symbols in COFF,
436 # and is not configured to handle mixed ELF and COFF.
35cb2108 437 noconfigdirs="$noconfigdirs gprof ld target-libgloss"
a48876fc 438 ;;
a73fc881 439 i[345]86-*-sco*)
35cb2108 440 noconfigdirs="$noconfigdirs gprof target-libgloss"
de9117a7 441 ;;
a73fc881 442 i[345]86-*-solaris2*)
320c9fff
KR
443 # The linker does static linking correctly, but the Solaris C library
444 # has bugs such that some important functions won't work when statically
445 # linked. (See man pages for getpwuid, for example.)
35cb2108 446 noconfigdirs="$noconfigdirs ld target-libgloss"
320c9fff 447 ;;
a73fc881 448 i[345]86-*-sysv4*)
8b5405d2
DZ
449 # The SYSV4 C compiler doesn't handle Emacs correctly
450 case "${CC}" in
e37bb3c7 451 "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
8b5405d2
DZ
452 *) ;;
453 esac
454 # but that's okay since emacs doesn't work anyway
35cb2108 455 noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss"
8b5405d2 456 ;;
3e1e245d
ILT
457 powerpc-*-aix*)
458 # copied from rs6000-*-* entry
35cb2108 459 noconfigdirs="$noconfigdirs gprof cvs target-libgloss"
3d40ace0
ILT
460 # This is needed until gcc and ld are fixed to work together.
461 use_gnu_ld=no
3e1e245d 462 ;;
a51794f1
JM
463 powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
464 target_configdirs="$target_configdirs target-winsup"
35cb2108 465 noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss"
a51794f1
JM
466 # always build newlib.
467 skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
81d08d0c 468 ;;
59d95e81 469 # This is temporary until we can link against shared libraries
8970d123 470 powerpcle-*-solaris*)
59d95e81 471 noconfigdirs="$noconfigdirs gdb sim make tcl expect"
8970d123 472 ;;
2a38983c 473 rs6000-*-lynxos*)
2a38983c
DHW
474 # The CVS server code doesn't work on the RS/6000
475 # Newlib makes problems for libg++ in crosses.
92caaa6a 476 noconfigdirs="$noconfigdirs target-newlib gprof cvs"
2a38983c 477 ;;
3d40ace0
ILT
478 rs6000-*-aix*)
479 noconfigdirs="$noconfigdirs gprof"
480 # This is needed until gcc and ld are fixed to work together.
481 use_gnu_ld=no
482 ;;
8388b9df 483 rs6000-*-*)
92caaa6a 484 noconfigdirs="$noconfigdirs gprof"
fcf4d286 485 ;;
becf2d8a 486 m68k-apollo-*)
35cb2108 487 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
becf2d8a 488 ;;
04b9315f
ILT
489 mips*-*-irix5*)
490 # The GNU linker does not support shared libraries.
82633710 491 # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
35cb2108 492 noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
04b9315f 493 ;;
af9fa3c1 494 mips*-dec-bsd*)
35cb2108 495 noconfigdirs="$noconfigdirs gprof target-libgloss"
af9fa3c1
ILT
496 ;;
497 mips*-*-bsd*)
35cb2108 498 noconfigdirs="$noconfigdirs gprof target-libgloss"
af9fa3c1 499 ;;
04b9315f 500 mips*-*-*)
52e3ad87 501 noconfigdirs="$noconfigdirs gprof"
fcf4d286 502 ;;
de9117a7 503 romp-*-*)
35cb2108 504 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss"
de9117a7 505 ;;
817382d1 506 sh-*-*)
719cb03f 507 case "${host}" in
a73fc881 508 i[345]86-*-vsta) ;; # don't add gprof back in
a73fc881 509 i[345]86-*-go32) ;; # don't add gprof back in
ca2ce3b3 510 *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
719cb03f 511 esac
35cb2108 512 noconfigdirs="$noconfigdirs target-libgloss"
719cb03f
DZ
513 ;;
514 sparc-*-sunos4*)
2a38983c 515 if [ x${is_cross_compiler} != xno ] ; then
35cb2108 516 noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
2a38983c
DHW
517 else
518 use_gnu_ld=no
519 fi
1f69e88d 520 ;;
486e0f0a 521 v810-*-*)
35cb2108 522 noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
486e0f0a 523 ;;
de9117a7 524 vax-*-vms)
35cb2108 525 noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
de9117a7
KR
526 ;;
527 vax-*-*)
35cb2108 528 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
8388b9df 529 ;;
de9117a7 530 *-*-lynxos*)
19b1d034 531 # Newlib makes problems for libg++ in crosses.
35cb2108 532 noconfigdirs="$noconfigdirs target-newlib target-libgloss"
19b1d034
SS
533 ;;
534 *-*-macos* | \
535 *-*-mpw*)
536 # Macs want a resource compiler.
537 configdirs="$configdirs grez"
538 ;;
05cd8d98
HS
539esac
540
fcfcbf27 541# targets that need a second pass
0807a8af
GN
542case "${target}" in
543 *-gm-magic*)
35cb2108 544 noconfigdirs="$noconfigdirs target-libgloss"
0807a8af
GN
545 ;;
546esac
547
9a8629d5
ILT
548# If we aren't building newlib, then don't build libgloss, since libgloss
549# depends upon some newlib header files.
550case "${noconfigdirs}" in
551 *target-libgloss*) ;;
552 *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
553esac
554
bfe725ec
ILT
555# If we are building a Canadian Cross, discard tools that can not be built
556# using a cross compiler. FIXME: These tools should be fixed.
557if [ "${build}" != "${host}" ]; then
558 noconfigdirs="$noconfigdirs expect dejagnu make texinfo diff"
559fi
560
d4cf72b3
BK
561# Make sure we don't let GNU ld be added if we didn't want it.
562if [ x$with_gnu_ld = xno ]; then
563 use_gnu_ld=no
564 noconfigdirs="$noconfigdirs ld"
0b0124c6
BK
565fi
566
d4cf72b3
BK
567# Make sure we don't let GNU as be added if we didn't want it.
568if [ x$with_gnu_as = xno ]; then
569 use_gnu_as=no
570 noconfigdirs="$noconfigdirs gas"
0b0124c6
BK
571fi
572
ca2ce3b3
ILT
573# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
574# $target_configdirs.
575# If we have the source for $noconfigdirs entries, add them to $notsupp.
efd7b806 576
52e3ad87 577notsupp=""
ca2ce3b3 578for dir in . $skipdirs $noconfigdirs ; do
b58d9e5d 579 dirname=`echo $dir | sed -e s/target-//g`
1c15a33d 580 if [ $dir != . ] && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
8f30a41e 581 configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
b58d9e5d
PB
582 if [ -r $srcdir/$dirname/configure ] \
583 || [ -r $srcdir/$dirname/configure.in ]; then
ca2ce3b3
ILT
584 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
585 true
586 else
587 notsupp="$notsupp $dir"
588 fi
589 fi
590 fi
591 if [ $dir != . ] && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
592 target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
b58d9e5d
PB
593 if [ -r $srcdir/$dirname/configure ] \
594 || [ -r $srcdir/$dirname/configure.in ]; then
ca2ce3b3
ILT
595 if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
596 true
597 else
598 notsupp="$notsupp $dir"
599 fi
52e3ad87
KR
600 fi
601 fi
602done
603
fba66802
ILT
604# Sometimes the tools are distributed with libiberty but with no other
605# libraries. In that case, we don't want to build target-libiberty.
606if [ -n "${target_configdirs}" ]; then
607 others=
b58d9e5d 608 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
fba66802
ILT
609 if [ "$i" != "libiberty" ]; then
610 if [ -r $srcdir/$i/configure ] || [ -r $srcdir/$i/configure.in ]; then
611 others=yes;
612 break;
613 fi
614 fi
615 done
616 if [ -z "${others}" ]; then
617 target_configdirs=
618 fi
619fi
620
ca2ce3b3
ILT
621# Deconfigure all subdirectories, in case we are changing the
622# configuration from one where a subdirectory is supported to one where it
623# is not.
ab1cbc67 624if [ -z "${norecursion}" -a -n "${configdirs}" ]; then
b58d9e5d 625 for i in `echo ${configdirs} | sed -e s/target-//g` ; do
ca2ce3b3
ILT
626 rm -f $i/Makefile
627 done
628fi
ab1cbc67 629if [ -z "${norecursion}" -a -n "${target_configdirs}" ]; then
9bbc0d58 630 for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
ab1cbc67
PB
631 rm -f ${target_subdir}/$i/Makefile
632 done
633fi
ca2ce3b3 634
52e3ad87
KR
635# Produce a warning message for the subdirs we can't configure.
636# This isn't especially interesting in the Cygnus tree, but in the individual
637# FSF releases, it's important to let people know when their machine isn't
638# supported by the one or two programs in a package.
639
9fe444b5 640if [ -n "${notsupp}" ] && [ -z "${norecursion}" ]; then
af9fa3c1
ILT
641 # If $appdirs is non-empty, at least one of those directories must still
642 # be configured, or we error out. (E.g., if the gas release supports a
643 # specified target in some subdirs but not the gas subdir, we shouldn't
644 # pretend that all is well.)
645 if [ -n "$appdirs" ]; then
646 for dir in $appdirs ; do
ca2ce3b3
ILT
647 if [ -r $dir/Makefile.in ]; then
648 if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
649 appdirs=""
650 break
651 fi
652 if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
653 appdirs=""
654 break
655 fi
af9fa3c1
ILT
656 fi
657 done
658 if [ -n "$appdirs" ]; then
659 echo "*** This configuration is not supported by this package." 1>&2
660 exit 1
661 fi
662 fi
663 # Okay, some application will build, or we don't care to check. Still
664 # notify of subdirs not getting built.
52e3ad87
KR
665 echo "*** This configuration is not supported in the following subdirectories:" 1>&2
666 echo " ${notsupp}" 1>&2
667 echo " (Any other directories should still work fine.)" 1>&2
668fi
669
d4cf72b3
BK
670# Set with_gnu_as and with_gnu_ld as appropriate.
671#
672# This is done by determining whether or not the appropriate directory
673# is available, and by checking whether or not specific configurations
674# have requested that this magic not happen.
675#
676# The command line options always override the explicit settings in
677# configure.in, and the settings in configure.in override this magic.
678#
679# If the default for a toolchain is to use GNU as and ld, and you don't
680# want to do that, then you should use the --without-gnu-as and
681# --without-gnu-ld options for the configure script.
682
683if [ x${use_gnu_as} = x ] ; then
684 if [ x${with_gnu_as} != xno ] && echo " ${configdirs} " | grep " ${gasdir} " > /dev/null 2>&1 && [ -d ${srcdir}/${gasdir} ] ; then
685 with_gnu_as=yes
686 withoptions="$withoptions --with-gnu-as"
687 fi
688fi
689
690if [ x${use_gnu_ld} = x ] ; then
691 if [ x${with_gnu_ld} != xno ] && echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 && [ -d ${srcdir}/ld ] ; then
692 with_gnu_ld=yes
693 withoptions="$withoptions --with-gnu-ld"
694 fi
695fi
696
d4be7765 697if [ x${shared} = xyes ]; then
45329a2c 698 case "${target}" in
c9e55665
JM
699 hppa*) target_makefile_frag=config/mt-papic ;;
700 i[345]86-*) target_makefile_frag=config/mt-x86pic ;;
701 *) target_makefile_frag=config/mt-${target_cpu}pic ;;
45329a2c
JM
702 esac
703fi
704
ca2ce3b3
ILT
705# post-target:
706
b5ae8419
ILT
707# Make sure that the compiler is able to generate an executable. If it
708# can't, we are probably in trouble. We don't care whether we can run the
709# executable--we might be using a cross compiler--we only care whether it
710# can be created. At this point the main configure script has set CC.
711echo "int main () { return 0; }" > conftest.c
712${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
713if [ $? = 0 ] && [ -s conftest ]; then
714 :
715else
716 echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
717 echo 1>&2 "*** You must set the environment variable CC to a working compiler."
718 rm -f conftest*
719 exit 1
720fi
721rm -f conftest*
722
0e47ce97
ILT
723# The Solaris /usr/ucb/cc compiler does not appear to work.
724case "${host}" in
725 sparc-sun-solaris2*)
e94c0e40
JM
726 CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
727 if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then
0e47ce97
ILT
728 could_use=
729 [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin"
730 if [ -d /opt/cygnus/bin ] ; then
731 if [ "$could_use" = "" ] ; then
732 could_use="/opt/cygnus/bin"
733 else
734 could_use="$could_use or /opt/cygnus/bin"
735 fi
736 fi
737 if [ "$could_use" = "" ] ; then
738 echo "Warning: compilation may fail because you're using"
739 echo "/usr/ucb/cc. You should change your PATH or CC "
740 echo "variable and rerun configure."
741 else
742 echo "Warning: compilation may fail because you're using"
743 echo "/usr/ucb/cc, when you should use the C compiler from"
744 echo "$could_use. You should change your"
745 echo "PATH or CC variable and rerun configure."
746 fi
747 fi
748 ;;
749esac
750
294fde1f
ILT
751# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
752# binutils tools will find libbfd.so.
d4be7765 753if [ "${shared}" = "yes" ]; then
294fde1f
ILT
754 sed -e 's/^SET_LIB_PATH[ ]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \
755 Makefile > Makefile.tem
756 rm -f Makefile
757 mv -f Makefile.tem Makefile
f2693093
ILT
758
759 case "${host}" in
760 *-*-hpux*)
761 sed -e 's/RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
762 Makefile > Makefile.tem
763 rm -f Makefile
764 mv -f Makefile.tem Makefile
765 ;;
766 esac
294fde1f
ILT
767fi
768
ca2ce3b3 769# Record target_configdirs and the configure arguments in Makefile.
ab1cbc67 770target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
ca2ce3b3 771targargs=`echo "${arguments}" | \
7fc36fda
ILT
772 sed -e 's/--norecursion//' \
773 -e 's/--cache[a-z-]*=[^ ]*//' \
774 -e 's/--ho[a-z-]*=[^ ]*//' \
775 -e 's/--ta[a-z-]*=[^ ]*//'`
776
777# Passing a --with-cross-host argument lets the target libraries know
778# whether they are being built with a cross-compiler or being built
779# native. However, it would be better to use other mechanisms to make the
780# sorts of decisions they want to make on this basis. Please consider
781# this option to be deprecated. FIXME.
782if [ x${is_cross_compiler} = xyes ]; then
90bdf864 783 targargs="--with-cross-host=${host_alias} ${targargs}"
7fc36fda
ILT
784fi
785
786targargs="--host=${target_alias} ${targargs}"
ca2ce3b3
ILT
787sed -e "s:^TARGET_CONFIGDIRS[ ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
788 -e "s%^CONFIG_ARGUMENTS[ ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
ab1cbc67 789 -e "s%^TARGET_SUBDIR[ ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
ca2ce3b3
ILT
790 Makefile > Makefile.tem
791rm -f Makefile
792mv -f Makefile.tem Makefile
793
bc58b41d
RP
794#
795# Local Variables:
796# fill-column: 131
797# End:
798#
This page took 0.48362 seconds and 4 git commands to generate.