OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib/] [configure.in] - Blame information for rev 1768

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 39 lampret
#! /bin/bash
2
##############################################################################
3
 
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.
8
 
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.
13
 
14
## For more information on these two systems, check out the documentation
15
## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi).
16
 
17 56 joel
#   Copyright (C) 1992, 93, 94, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc.
18 39 lampret
#
19
# This file is free software; you can redistribute it and/or modify it
20
# under the terms of the GNU General Public License as published by
21
# the Free Software Foundation; either version 2 of the License, or
22
# (at your option) any later version.
23
#
24
# This program is distributed in the hope that it will be useful, but
25
# WITHOUT ANY WARRANTY; without even the implied warranty of
26
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
# General Public License for more details.
28
#
29
# You should have received a copy of the GNU General Public License
30
# along with this program; if not, write to the Free Software
31
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32
 
33
##############################################################################
34
 
35
### To add a new directory to the tree, first choose whether it is a target
36
### or a host dependent tool.  Then put it into the appropriate list
37
### (library or tools, host or target), doing a dependency sort.  For
38
### example, gdb requires that byacc (or bison) be built first, so it is in
39
### the ${host_tools} list after byacc and bison.
40
 
41
 
42
# these libraries are used by various programs built for the host environment
43
#
44 56 joel
host_libs="intl mmalloc libiberty opcodes bfd readline gash db tcl tk tcl8.1 tk8.1 tclX itcl tix libgui"
45 39 lampret
 
46
if [ "${enable_gdbgui}" = "yes" ] ; then
47
        host_libs="${host_libs} libgui"
48
fi
49
 
50
# these tools are built for the host environment
51
# Note, the powerpc-eabi build depends on sim occurring before gdb in order to
52
# know that we are building the simulator.
53 56 joel
host_tools="byacc flex bison binutils ld gas gcc sim gdb make patch prms send-pr gprof gdbtest tgas etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool ispell grep diff rcs cvssrc fileutils shellutils time textutils wdiff find emacs emacs19 uudecode hello tar gzip indent recode release sed utils guile perl apache inet gawk findutils snavigator libtool gettext zip less"
54 39 lampret
 
55
# these libraries are built for the target environment, and are built after
56
# the host libraries and the host tools (which may be a cross compiler)
57
#
58
target_libs="target-libiberty \
59
                target-libgloss \
60
                target-newlib \
61
                target-libio \
62
                target-librx \
63
                target-libstdc++ \
64 56 joel
                target-libg++ \
65
                target-libf2c \
66
                target-libchill \
67
                target-libjava \
68
                target-zlib \
69
                target-boehm-gc \
70
                target-qthreads \
71
                target-libobjc"
72 39 lampret
 
73
# these tools are built using the target libs, and are intended to run only
74
# in the target environment
75
#
76
# note: any program that *uses* libraries that are in the "target_libs"
77
# list belongs in this list.  those programs are also very likely
78
# candidates for the "native_only" list which follows
79
#
80
target_tools="target-examples target-groff target-gperf"
81
 
82
################################################################################
83
 
84
## These two lists are of directories that are to be removed from the
85
## ${configdirs} list for either cross-compilations or for native-
86
## compilations.  For example, it doesn't make that much sense to
87
## cross-compile Emacs, nor is it terribly useful to compile target-libiberty in
88
## a native environment.
89
 
90
# directories to be built in the native environment only
91
#
92
# This must be a single line because of the way it is searched by grep in
93
# the code below.
94 56 joel
native_only="autoconf automake libtool cvssrc emacs emacs19 fileutils find gawk gettext grep gzip hello indent ispell m4 rcs recode sed shellutils tar textutils gash uudecode wdiff target-groff guile perl apache inet time ash bash bzip2 prms snavigator gnuserv target-gperf"
95 39 lampret
 
96
# directories to be built in a cross environment only
97
#
98
cross_only="target-libgloss target-newlib target-cygmon target-opcodes target-libstub"
99
 
100
## All tools belong in one of the four categories, and are assigned above
101
## We assign ${configdirs} this way to remove all embedded newlines.  This
102
## is important because configure will choke if they ever get through.
103
## ${configdirs} is directories we build using the host tools.
104
## ${target_configdirs} is directories we build using the target tools.
105
#
106
configdirs=`echo ${host_libs} ${host_tools}`
107
target_configdirs=`echo ${target_libs} ${target_tools}`
108
 
109
################################################################################
110
 
111
srctrigger=move-if-change
112
srcname="gnu development package"
113
 
114
# This gets set non-empty for some net releases of packages.
115
appdirs=""
116
 
117
# per-host:
118
 
119
# Work in distributions that contain no compiler tools, like Autoconf.
120
if [ -d ${srcdir}/config ]; then
121
case "${host}" in
122
  m68k-hp-hpux*)
123
    host_makefile_frag="${host_makefile_frag} config/mh-hp300"
124
    ;;
125
  m68k-apollo-sysv*)
126
    host_makefile_frag="${host_makefile_frag} config/mh-apollo68"
127
    ;;
128
  m68k-apollo-bsd*)
129
    host_makefile_frag="${host_makefile_frag} config/mh-a68bsd"
130
    ;;
131
  m88k-dg-dgux*)
132
    host_makefile_frag="${host_makefile_frag} config/mh-dgux"
133
    ;;
134
  m88k-harris-cxux*)
135
    host_makefile_frag="${host_makefile_frag} config/mh-cxux"
136
    ;;
137
  m88k-motorola-sysv*)
138
    host_makefile_frag="${host_makefile_frag} config/mh-delta88"
139
    ;;
140
  mips*-dec-ultrix*)
141
    host_makefile_frag="${host_makefile_frag} config/mh-decstation"
142
    ;;
143
  mips*-nec-sysv4*)
144
    host_makefile_frag="${host_makefile_frag} config/mh-necv4"
145
    ;;
146
  mips*-sgi-irix6*)
147
    host_makefile_frag="${host_makefile_frag} config/mh-irix6"
148
    ;;
149
  mips*-sgi-irix5*)
150
    host_makefile_frag="${host_makefile_frag} config/mh-irix5"
151
    ;;
152
  mips*-sgi-irix4*)
153
    host_makefile_frag="${host_makefile_frag} config/mh-irix4"
154
    ;;
155
  mips*-sgi-irix3*)
156
    host_makefile_frag="${host_makefile_frag} config/mh-sysv"
157
    ;;
158
  mips*-*-sysv4*)
159
    host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
160
    ;;
161
  mips*-*-sysv*)
162
    host_makefile_frag="${host_makefile_frag} config/mh-riscos"
163
    ;;
164 56 joel
  i370-ibm-opened*)
165
    host_makefile_frag="${host_makefile_frag} config/mh-openedition"
166
    ;;
167 39 lampret
  i[3456]86-*-sysv5*)
168
    host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
169
    ;;
170
  i[3456]86-*-dgux*)
171
    host_makefile_frag="${host_makefile_frag} config/mh-dgux386"
172
    ;;
173
  i[3456]86-ncr-sysv4.3*)
174
    host_makefile_frag="${host_makefile_frag} config/mh-ncrsvr43"
175
    ;;
176
  i[3456]86-ncr-sysv4*)
177
    host_makefile_frag="${host_makefile_frag} config/mh-ncr3000"
178
    ;;
179
  i[3456]86-*-sco3.2v5*)
180
    host_makefile_frag="${host_makefile_frag} config/mh-sysv"
181
    ;;
182
  i[3456]86-*-sco*)
183
    host_makefile_frag="${host_makefile_frag} config/mh-sco"
184
    ;;
185 56 joel
  i[3456]86-*-udk*)
186
    host_makefile_frag="${host_makefile_frag} config/mh-sysv5"
187
    ;;
188 39 lampret
  i[3456]86-*-isc*)
189
    host_makefile_frag="${host_makefile_frag} config/mh-sysv"
190
    ;;
191
  i[3456]86-*-solaris2*)
192
    host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
193
    ;;
194
  i[3456]86-*-aix*)
195
    host_makefile_frag="${host_makefile_frag} config/mh-aix386"
196
    ;;
197
  i[3456]86-*-msdosdjgpp*)
198 56 joel
    host_makefile_frag="${host_makefile_frag} config/mh-djgpp"
199 39 lampret
    ;;
200 56 joel
  *-cygwin*)
201
    host_makefile_frag="${host_makefile_frag} config/mh-cygwin"
202 39 lampret
    ;;
203
  *-mingw32*)
204
    host_makefile_frag="${host_makefile_frag} config/mh-mingw32"
205
    ;;
206 56 joel
  *-interix*)
207
    host_makefile_frag="${host_makefile_frag} config/mh-interix"
208
    ;;
209 39 lampret
  *-windows*)
210
    host_makefile_frag="${host_makefile_frag} config/mh-windows"
211
    ;;
212
  vax-*-ultrix2*)
213
    host_makefile_frag="${host_makefile_frag} config/mh-vaxult2"
214
    ;;
215
  *-*-solaris2*)
216
    host_makefile_frag="${host_makefile_frag} config/mh-solaris"
217
    ;;
218
  m68k-sun-sunos*)
219
    host_makefile_frag="${host_makefile_frag} config/mh-sun3"
220
    ;;
221
  *-hp-hpux[78]*)
222
    host_makefile_frag="${host_makefile_frag} config/mh-hpux8"
223
    ;;
224
  *-hp-hpux*)
225
    host_makefile_frag="${host_makefile_frag} config/mh-hpux"
226
    ;;
227
  *-*-hiux*)
228
    host_makefile_frag="${host_makefile_frag} config/mh-hpux"
229
    ;;
230
  rs6000-*-lynxos*)
231
    host_makefile_frag="${host_makefile_frag} config/mh-lynxrs6k"
232
    ;;
233
  *-*-lynxos*)
234
    host_makefile_frag="${host_makefile_frag} config/mh-lynxos"
235
    ;;
236 56 joel
  *-*-aix4.[3456789]* | *-*-aix[56789].*)
237
    host_makefile_frag="${host_makefile_frag} config/mh-aix43"
238
    ;;
239 39 lampret
  *-*-sysv4*)
240
    host_makefile_frag="${host_makefile_frag} config/mh-sysv4"
241
    ;;
242
  *-*-sysv*)
243
    host_makefile_frag="${host_makefile_frag} config/mh-sysv"
244
    ;;
245
esac
246
fi
247
 
248
# If we aren't going to be using gcc, see if we can extract a definition
249
# of CC from the fragment.
250 56 joel
if [ -z "${CC}" ] && [ "${build}" = "${host}" ]; then
251 39 lampret
  IFS="${IFS=   }"; save_ifs="$IFS"; IFS="${IFS}:"
252
  found=
253
  for dir in $PATH; do
254
    test -z "$dir" && dir=.
255
    if test -f $dir/gcc; then
256
      found=yes
257
      break
258
    fi
259
  done
260
  IFS="$save_ifs"
261 56 joel
  if [ -z "${found}" ] && [ -n "${host_makefile_frag}" ] && [ -f "${srcdir}/${host_makefile_frag}" ]; then
262 39 lampret
    xx=`sed -n -e 's/^[         ]*CC[   ]*=[    ]*\(.*\)$/\1/p' < ${srcdir}/${host_makefile_frag}`
263
    if [ -n "${xx}" ] ; then
264
      CC=$xx
265
    fi
266
  fi
267
fi
268
 
269
# We default to --with-shared on platforms where -fpic is meaningless.
270
# Well, we don't yet, but we will.
271
if false && [ "${host}" = "${target}" ] && [ x${enable_shared} = x ]; then
272
  case "${target}" in
273
    alpha*-dec-osf*)    enable_shared=yes ;;
274
    alpha*-*-linux*)    enable_shared=yes ;;
275
    mips-sgi-irix5*)    enable_shared=yes ;;
276
    *)                  enable_shared=no ;;
277
  esac
278
fi
279
 
280 56 joel
 
281 39 lampret
case "${enable_shared}" in
282
  yes) shared=yes ;;
283
  no) shared=no ;;
284
  "") shared=no ;;
285
  *) shared=yes ;;
286
esac
287
 
288
if [ x${shared} = xyes ]; then
289
  case "${host}" in
290 56 joel
    alpha*-*-linux*)
291
      host_makefile_frag="${host_makefile_frag} config/mh-elfalphapic"
292
      ;;
293
    arm*-*-*)
294
      host_makefile_frag="${host_makefile_frag} config/mh-armpic"
295
      ;;
296
    hppa*-*-*)
297 39 lampret
      host_makefile_frag="${host_makefile_frag} config/mh-papic"
298
      ;;
299 56 joel
    i[3456]86-*-cygwin*)
300
      # We don't want -fPIC on Cygwin.
301 39 lampret
      ;;
302 56 joel
    i[3456]86-*-*)
303 39 lampret
      host_makefile_frag="${host_makefile_frag} config/mh-x86pic"
304
      ;;
305 56 joel
    sparc64-*-*)
306 39 lampret
      host_makefile_frag="${host_makefile_frag} config/mh-sparcpic"
307
      ;;
308 56 joel
    powerpc*-*-aix*)
309
      # We don't want -fPIC on AIX.
310
      ;;
311
    powerpc*-*-*)
312 39 lampret
      host_makefile_frag="${host_makefile_frag} config/mh-ppcpic"
313
      ;;
314 56 joel
    *-*-*)
315 39 lampret
      if test -f ${srcdir}/config/mh-${host_cpu}pic; then
316
        host_makefile_frag="${host_makefile_frag} config/mh-${host_cpu}pic"
317
      fi
318
      ;;
319
  esac
320
fi
321
 
322
rm -f mh-frag
323
if [ -n "${host_makefile_frag}" ] ; then
324
  for f in ${host_makefile_frag}
325
  do
326
    cat ${srcdir}/$f >> mh-frag
327
  done
328
  host_makefile_frag=mh-frag
329
fi
330
 
331
# per-target:
332
 
333
case "${target}" in
334
  v810*)
335
    target_makefile_frag="${target_makefile_frag} config/mt-v810"
336
    ;;
337
  i[3456]86-*-netware*)
338
    target_makefile_frag="${target_makefile_frag} config/mt-netware"
339
    ;;
340
  powerpc-*-netware*)
341
    target_makefile_frag="${target_makefile_frag} config/mt-netware"
342
    ;;
343
  *-*-linux-gnu)
344
    target_makefile_frag="${target_makefile_frag} config/mt-linux"
345
    ;;
346
esac
347
 
348
# If --enable-target-optspace always use -Os instead of -O2 to build
349
# the target libraries, similarly if it is not specified, use -Os
350
# on selected platforms.
351
case "${enable_target_optspace}:${target}" in
352
  yes:*)
353
    target_makefile_frag="${target_makefile_frag} config/mt-ospace"
354
    ;;
355 56 joel
  # CYGNUS LOCAL d10v, d30v,
356
  :d30v-*)
357
    target_makefile_frag="${target_makefile_frag} config/mt-d30v"
358
    ;;
359
  :m32r-* | :d10v-* | :fr30-*)
360 39 lampret
    target_makefile_frag="${target_makefile_frag} config/mt-ospace"
361
    ;;
362
  no:* | :*)
363
    ;;
364
  *)
365
    echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2
366
    ;;
367
esac
368
 
369
skipdirs=
370
gasdir=gas
371
use_gnu_ld=
372
use_gnu_as=
373
 
374
# some tools are so dependent upon X11 that if we're not building with X,
375
# it's not even worth trying to configure, much less build, that tool.
376
 
377
case ${with_x} in
378
  yes | "")  # the default value for this tree is that X11 is available
379
        ;;
380
  no)
381
        skipdirs="${skipdirs} tk libgui gash"
382
        ;;
383
  *)
384
        echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2
385
        ;;
386
esac
387
 
388
# Some tools are only suitable for building in a "native" situation.
389
# Those are added when we have a host==target configuration.  For cross
390
# toolchains, we add some directories that should only be useful in a
391
# cross-compiler.
392
 
393
is_cross_compiler=
394
 
395
if [ x"${host}" = x"${target}" ] ; then
396
        # when doing a native toolchain, don't build the targets
397
        # that are in the 'cross only' list
398
        skipdirs="${skipdirs} ${cross_only}"
399
        is_cross_compiler=no
400
else
401
        # similarly, don't build the targets in the 'native only'
402
        # list when building a cross compiler
403
        skipdirs="${skipdirs} ${native_only}"
404
        is_cross_compiler=yes
405
fi
406
 
407 56 joel
# We always want to use the same name for this directory, so that dejagnu
408
# can reliably find it.
409
target_subdir=${target_alias}
410
 
411 39 lampret
if [ ! -d ${target_subdir} ] ; then
412
  if mkdir ${target_subdir} ; then true
413
  else
414
    echo "'*** could not make ${PWD=`pwd`}/${target_subdir}" 1>&2
415
    exit 1
416
  fi
417
fi
418
 
419
copy_dirs=
420
 
421
# Handle --with-headers=XXX.  The contents of the named directory are
422
# copied to $(tooldir)/sys-include.
423
if [ x"${with_headers}" != x ]; then
424
  if [ x${is_cross_compiler} = xno ]; then
425
    echo 1>&2 '***' --with-headers is only supported when cross compiling
426
    exit 1
427
  fi
428
  case "${exec_prefixoption}" in
429
  "") x=${prefix} ;;
430
  *) x=${exec_prefix} ;;
431
  esac
432
  copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include"
433
fi
434
 
435
# Handle --with-libs=XXX.  Multiple directories are permitted.  The
436
# contents are copied to $(tooldir)/lib.
437
if [ x"${with_libs}" != x ]; then
438
  if [ x${is_cross_compiler} = xno ]; then
439
    echo 1>&2 '***' --with-libs is only supported when cross compiling
440
    exit 1
441
  fi
442
  # Copy the libraries in reverse order, so that files in the first named
443
  # library override files in subsequent libraries.
444
  case "${exec_prefixoption}" in
445
  "") x=${prefix} ;;
446
  *) x=${exec_prefix} ;;
447
  esac
448
  for l in ${with_libs}; do
449
    copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}"
450
  done
451
fi
452
 
453
# If both --with-headers and --with-libs are specified, default to
454
# --without-newlib.
455
if [ x"${with_headers}" != x ] && [ x"${with_libs}" != x ]; then
456
  if [ x"${with_newlib}" = x ]; then
457
    with_newlib=no
458
  fi
459
fi
460
 
461
# Recognize --with-newlib/--without-newlib.
462
if [ x${with_newlib} = xno ]; then
463
  skipdirs="${skipdirs} target-newlib"
464
elif [ x${with_newlib} = xyes ]; then
465
  skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
466
fi
467
 
468
# Default to using --with-stabs for certain targets.
469
if [ x${with_stabs} = x ]; then
470
  case "${target}" in
471
  mips*-*-irix6*)
472
    ;;
473 56 joel
  mips*-*-* | alpha*-*-osf*)
474 39 lampret
    with_stabs=yes;
475
    withoptions="${withoptions} --with-stabs"
476
    ;;
477
  esac
478
fi
479
 
480
# Handle ${copy_dirs}
481
set fnord ${copy_dirs}
482
shift
483
while [ $# != 0 ]; do
484
  if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then
485
    :
486
  else
487
    echo Copying $1 to $2
488
 
489
    # Use the install script to create the directory and all required
490
    # parent directories.
491
    if [ -d $2 ]; then
492
      :
493
    else
494
      echo >config.temp
495
      ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED
496
    fi
497
 
498
    # Copy the directory, assuming we have tar.
499
    # FIXME: Should we use B in the second tar?  Not all systems support it.
500
    (cd $1; tar -cf - .) | (cd $2; tar -xpf -)
501
 
502
    # It is the responsibility of the user to correctly adjust all
503
    # symlinks.  If somebody can figure out how to handle them correctly
504
    # here, feel free to add the code.
505
 
506
    echo $1 > $2/COPIED
507
  fi
508
  shift; shift
509
done
510
 
511
# Configure extra directories which are host specific
512
 
513
case "${host}" in
514
        i[3456]86-*-go32*)
515
          configdirs="$configdirs dosrel" ;;
516
        i[3456]86-*-mingw32*)
517
          configdirs="$configdirs dosrel" ;;
518 56 joel
        *-cygwin*)
519
          configdirs="$configdirs libtermcap dosrel" ;;
520 39 lampret
esac
521
 
522
# Remove more programs from consideration, based on the host or
523
# target this usually means that a port of the program doesn't
524
# exist yet.
525
 
526
noconfigdirs=""
527
 
528
case "${host}" in
529
  i[3456]86-*-vsta)
530
    noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
531
    ;;
532
  i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*)
533
    noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv gettext"
534
        ;;
535
  i[3456]86-*-mingw32*)
536
    # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl apache inet itcl tix db snavigator gnuserv"
537
     noconfigdirs="expect dejagnu cvs autoconf automake send-pr gprof rcs guile perl texinfo apache inet libtool"
538
        ;;
539 56 joel
  i[3456]86-*-beos*)
540
     noconfigdirs="$noconfigdirs tk itcl tix libgui gdb"
541
     ;;
542
  *-*-cygwin*)
543
    noconfigdirs="send-pr rcs guile perl apache inet"
544
    # don't build texinfo when building a canadian cross compiler, build do build it when
545
    # running native building a normal cross compiler.
546
    if [ "${build}" != "${host}" ]; then
547
      noconfigdirs="$noconfigdirs texinfo"
548
    fi
549 39 lampret
    ;;
550
  *-*-netbsd*)
551
    noconfigdirs="rcs"
552
    ;;
553
  ppc*-*-pe)
554
     noconfigdirs="patch diff make tk tcl expect dejagnu cvssrc autoconf automake texinfo bison send-pr gprof rcs guile perl apache inet itcl tix db snavigator gnuserv"
555
    ;;
556 56 joel
  arm*-corel-linux*)
557
    noconfigdirs="$noconfigdirs gdb"
558
    ;;
559 39 lampret
esac
560
 
561
 
562
case "${target}" in
563
  *-*-netware)
564
    noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-librx target-newlib target-libiberty target-libgloss"
565
    ;;
566
  *-*-rtems*)
567
    noconfigdirs="$noconfigdirs target-libgloss"
568
    ;;
569
  *-*-vxworks*)
570
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
571
    ;;
572
  alpha*-dec-osf*)
573
    # ld works, but does not support shared libraries.  emacs doesn't
574
    # work.  newlib is not 64 bit ready.  I'm not sure about fileutils.
575
    # gas doesn't generate exception information.
576
    noconfigdirs="$noconfigdirs gas ld emacs fileutils target-newlib target-libgloss"
577
    ;;
578
  alpha*-*-*vms*)
579
    noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss"
580
    ;;
581
  alpha*-*-linux*)
582
    # newlib is not 64 bit ready
583
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
584
    # linux has rx in libc
585
    skipdirs="$skipdirs target-librx"
586
    ;;
587
  alpha*-*-*)
588
    # newlib is not 64 bit ready
589
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
590
    ;;
591
  arc-*-*)
592
    noconfigdirs="$noconfigdirs target-libgloss"
593
    ;;
594
  arm-*-pe*)
595
    noconfigdirs="$noconfigdirs target-libgloss"
596
    ;;
597
  arm-*-coff*)
598
    noconfigdirs="$noconfigdirs target-libgloss"
599 56 joel
    if [ x${is_cross_compiler} != xno ] ; then
600
           target_configdirs="${target_configdirs} target-bsp target-cygmon"
601
    fi
602 39 lampret
    ;;
603 56 joel
  arm-*-elf*)
604
    noconfigdirs="$noconfigdirs target-libgloss"
605
    if [ x${is_cross_compiler} != xno ] ; then
606
           target_configdirs="${target_configdirs} target-bsp target-cygmon"
607
    fi
608
    ;;
609
  arm-*-oabi*)
610
    noconfigdirs="$noconfigdirs target-libgloss"
611
    ;;
612
  arm*-corel-linux*)
613
    noconfigdirs="$noconfigdirs gdb"
614
    ;;
615
  c4x-*-*)
616
    noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
617
    ;;
618 39 lampret
  thumb-*-coff)
619
    noconfigdirs="$noconfigdirs target-libgloss"
620
    ;;
621 56 joel
# CYGNUS LOCAL clm/arm-elf
622
  thumb-*-elf)
623
    noconfigdirs="$noconfigdirs target-libgloss"
624
    ;;
625
  thumb-*-oabi)
626
    noconfigdirs="$noconfigdirs target-libgloss"
627
    ;;
628
# END CYGNUS LOCAL
629
# CYGNUS LOCAL nickc/strongarm
630
  strongarm*-*-elf)
631
    noconfigdirs="$noconfigdirs target-libgloss"
632
    if [ x${is_cross_compiler} != xno ] ; then
633
           target_configdirs="${target_configdirs} target-bsp target-cygmon"
634
    fi
635
    ;;
636
  strongarm*-*-coff)
637
    noconfigdirs="$noconfigdirs target-libgloss"
638
    if [ x${is_cross_compiler} != xno ] ; then
639
           target_configdirs="${target_configdirs} target-bsp target-cygmon"
640
    fi
641
    ;;
642
# END CYGNUS LOCAL
643 39 lampret
  thumb-*-pe) # CYGNUS LOCAL nickc/thumb
644
    noconfigdirs="$noconfigdirs target-libgloss"
645
    ;;
646
  arm-*-riscix*)
647
    noconfigdirs="$noconfigdirs ld target-libgloss"
648
    ;;
649
  d10v-*-*)
650 56 joel
    noconfigdirs="$noconfigdirs target-librx target-libg++ target-libstdc++ target-libio"
651 39 lampret
    ;;
652 56 joel
# CYGNUS LOCAL d30v
653
  d30v-*-*)
654
    ;;
655
# END CYGNUS LOCAL
656
  fr30-*-elf*)
657
    if [ x${is_cross_compiler} != xno ] ; then
658
           target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
659
    fi
660
    ;;
661 39 lampret
  h8300*-*-* | \
662
  h8500-*-*)
663
    noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
664
    ;;
665
  hppa*-*-*elf* | \
666 56 joel
  hppa*-*-linux-gnu* | \
667 39 lampret
  hppa*-*-lites*)
668 56 joel
    # Do configure ld/binutils/gas for the above cases.
669 39 lampret
    ;;
670
  hppa*-*-*)
671
    # HP's C compiler doesn't handle Emacs correctly (but on BSD and Mach
672
    # cc is gcc, and on any system a user should be able to link cc to
673
    # whatever they want.  FIXME, emacs emacs19).
674
    case "${CC}" in
675
        "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
676
        *) ;;
677
    esac
678
    noconfigdirs="$noconfigdirs ld shellutils"
679
    ;;
680 56 joel
  i[3456]86-*-coff | i[3456]86-*-elf)
681
    if [ x${is_cross_compiler} != xno ] ; then
682
         target_configdirs="${target_configdirs} target-libstub target-cygmon"
683
    fi
684
    ;;
685 39 lampret
  i[3456]86-*-go32* | i[3456]-*-msdosdjgpp*)
686
    # but don't build gdb
687
    noconfigdirs="$noconfigdirs gdb target-libg++ target-libstdc++ target-libio target-librx"
688
    ;;
689 56 joel
  *-*-linux*)
690
    # linux has rx in libc
691
    skipdirs="$skipdirs target-librx"
692
    ;;
693 39 lampret
  i[3456]86-*-mingw32*)
694
    target_configdirs="$target_configdirs target-mingw"
695
    noconfigdirs="$noconfigdirs expect target-libgloss"
696
 
697
    # Can't build gdb for mingw32 if not native.
698
    case "${host}" in
699
      i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc.
700
      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv"
701
         ;;
702
    esac
703
    ;;
704 56 joel
  *-*-cygwin*)
705
    target_configdirs="$target_configdirs target-libtermcap target-winsup"
706
    noconfigdirs="$noconfigdirs target-libgloss"
707 39 lampret
    # always build newlib.
708
    skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
709
 
710 56 joel
    # Can't build gdb for Cygwin if not native.
711 39 lampret
    case "${host}" in
712 56 joel
      *-*-cygwin*) ;; # keep gdb tcl tk expect etc.
713 39 lampret
      *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv"
714
         ;;
715
    esac
716
    ;;
717
  i[3456]86-*-pe)
718
    noconfigdirs="$noconfigdirs target-libg++ target-libstdc++ target-libio target-librx target-libgloss"
719
    ;;
720
  i[3456]86-*-sco3.2v5*)
721
    # The linker does not yet know about weak symbols in COFF,
722
    # and is not configured to handle mixed ELF and COFF.
723
    noconfigdirs="$noconfigdirs ld target-libgloss"
724
    ;;
725
  i[3456]86-*-sco*)
726
    noconfigdirs="$noconfigdirs gprof target-libgloss"
727
    ;;
728
  i[3456]86-*-solaris2*)
729 56 joel
    noconfigdirs="$noconfigdirs target-libgloss"
730 39 lampret
    ;;
731
  i[3456]86-*-sysv4*)
732
    # The SYSV4 C compiler doesn't handle Emacs correctly
733
    case "${CC}" in
734
        "" | cc*) noconfigdirs="$noconfigdirs emacs emacs19" ;;
735
        *) ;;
736
    esac
737
    # but that's okay since emacs doesn't work anyway
738
    noconfigdirs="$noconfigdirs emacs emacs19 target-libgloss"
739
    ;;
740 56 joel
  i[3456]86-*-beos*)
741
     noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss"
742
     ;;
743
  m68k-*-elf*)
744
    if [ x${is_cross_compiler} != xno ] ; then
745
           target_configdirs="${target_configdirs} target-bsp target-cygmon"
746
    fi
747
    ;;
748
  m68k-*-coff*)
749
    if [ x${is_cross_compiler} != xno ] ; then
750
           target_configdirs="${target_configdirs} target-bsp target-cygmon"
751
    fi
752
    ;;
753 39 lampret
  mn10200-*-*)
754 56 joel
    noconfigdirs="$noconfigdirs"
755
    if [ x${is_cross_compiler} != xno ] ; then
756
           target_configdirs="${target_configdirs} target-libstub target-cygmon"
757
    fi
758 39 lampret
    ;;
759
  mn10300-*-*)
760
    noconfigdirs="$noconfigdirs"
761 56 joel
    if [ x${is_cross_compiler} != xno ] ; then
762
           target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
763
    fi
764 39 lampret
    ;;
765
  powerpc-*-aix*)
766
    # copied from rs6000-*-* entry
767 56 joel
    # The configure and build of ld are currently disabled because
768
    # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
769
    # The symptom is that GDBtk 4.18 fails at startup with a segfault
770
    # if linked by GNU ld, but not if linked by the native ld.
771
    noconfigdirs="$noconfigdirs gprof cvssrc target-libgloss ld"
772 39 lampret
    use_gnu_ld=no
773
    ;;
774
  powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe)
775
    target_configdirs="$target_configdirs target-winsup"
776
    noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv"
777
    # always build newlib.
778
    skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'`
779
    ;;
780
    # This is temporary until we can link against shared libraries
781
  powerpcle-*-solaris*)
782
    noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv"
783
    ;;
784 56 joel
  powerpc-*-eabi)
785
    if [ x${is_cross_compiler} != xno ] ; then
786
           target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
787
    fi
788
    ;;
789 39 lampret
  rs6000-*-lynxos*)
790
    # The CVS server code doesn't work on the RS/6000
791
    # Newlib makes problems for libg++ in crosses.
792
    noconfigdirs="$noconfigdirs target-newlib gprof cvssrc"
793
    ;;
794
  rs6000-*-aix*)
795 56 joel
    # The configure and build of ld are currently disabled because
796
    # GNU ld is known to be broken for AIX 4.2 and 4.3 (at least)
797
    # The symptom is that GDBtk 4.18 fails at startup with a segfault
798
    # if linked by GNU ld, but not if linked by the native ld.
799
    noconfigdirs="$noconfigdirs gprof ld"
800 39 lampret
    use_gnu_ld=no
801
    ;;
802
  rs6000-*-*)
803
    noconfigdirs="$noconfigdirs gprof"
804
    ;;
805
  m68k-apollo-*)
806
    noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss"
807
    ;;
808
  mips*-*-irix5*)
809
    # The GNU linker does not support shared libraries.
810
    # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
811
    noconfigdirs="$noconfigdirs ld gprof emacs target-libgloss"
812
    ;;
813
  mips*-*-irix6*)
814 56 joel
    # The GNU assembler does not support IRIX 6.
815 39 lampret
    # emacs is emacs 18, which does not work on Irix 5 (emacs19 does work)
816 56 joel
    noconfigdirs="$noconfigdirs gas gprof emacs target-libgloss"
817 39 lampret
    ;;
818
  mips*-dec-bsd*)
819
    noconfigdirs="$noconfigdirs gprof target-libgloss"
820
    ;;
821
  mips*-*-bsd*)
822
    noconfigdirs="$noconfigdirs gprof target-libgloss"
823
    ;;
824 56 joel
  mipstx39-*-*)
825
    noconfigdirs="$noconfigdirs gprof"   # same as generic mips
826
    target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
827
   ;;
828 39 lampret
  mips*-*-*)
829
    noconfigdirs="$noconfigdirs gprof"
830
    ;;
831
  romp-*-*)
832
    noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss"
833
    ;;
834
  sh-*-*)
835
    case "${host}" in
836
      i[3456]86-*-vsta) ;; # don't add gprof back in
837
      i[3456]86-*-go32*) ;; # don't add gprof back in
838
      i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in
839
      *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;;
840
    esac
841 56 joel
    noconfigdirs="$noconfigdirs"
842 39 lampret
    ;;
843
  sparc-*-elf*)
844
    if [ x${is_cross_compiler} != xno ] ; then
845
           target_configdirs="${target_configdirs} target-libstub target-cygmon"
846
    fi
847
    ;;
848
  sparc64-*-elf*)
849
    if [ x${is_cross_compiler} != xno ] ; then
850
           target_configdirs="${target_configdirs} target-libstub target-cygmon"
851
    fi
852
    ;;
853 56 joel
  sparclite-*-*)
854 39 lampret
    if [ x${is_cross_compiler} != xno ] ; then
855 56 joel
           target_configdirs="${target_configdirs} target-bsp target-libstub target-cygmon"
856 39 lampret
    fi
857
    ;;
858
  sparc-*-sunos4*)
859
    if [ x${is_cross_compiler} != xno ] ; then
860
           noconfigdirs="$noconfigdirs gdb gdbtest target-newlib target-libgloss"
861
    else
862
           use_gnu_ld=no
863
    fi
864
    ;;
865
  v810-*-*)
866
    noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libio target-libg++ target-libstdc++ opcodes target-libgloss"
867
    ;;
868
  v850-*-*)
869
    noconfigdirs="$noconfigdirs target-libgloss"
870
    ;;
871 56 joel
  v850e-*-*) # CYGNUS LOCAL v850e
872
    noconfigdirs="$noconfigdirs target-libgloss"
873
    ;;
874
  v850ea-*-*)
875
    noconfigdirs="$noconfigdirs target-libgloss"
876
    ;;       # END CYGNUS LOCAL
877 39 lampret
  vax-*-vms)
878
    noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss"
879
    ;;
880
  vax-*-*)
881
    noconfigdirs="$noconfigdirs target-newlib target-libgloss"
882
    ;;
883
  *-*-lynxos*)
884
    # Newlib makes problems for libg++ in crosses.
885 56 joel
    noconfigdirs="$noconfigdirs target-newlib target-libgloss gdb"
886 39 lampret
    ;;
887
  *-*-macos* | \
888
  *-*-mpw*)
889
    # Macs want a resource compiler.
890
    configdirs="$configdirs grez"
891
    ;;
892
esac
893
 
894
# If we aren't building newlib, then don't build libgloss, since libgloss
895
# depends upon some newlib header files.
896
case "${noconfigdirs}" in
897
  *target-libgloss*) ;;
898
  *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;;
899
esac
900
 
901
# Make sure we don't let GNU ld be added if we didn't want it.
902
if [ x$with_gnu_ld = xno ]; then
903
  use_gnu_ld=no
904
  noconfigdirs="$noconfigdirs ld"
905
fi
906
 
907
# Make sure we don't let GNU as be added if we didn't want it.
908
if [ x$with_gnu_as = xno ]; then
909
  use_gnu_as=no
910
  noconfigdirs="$noconfigdirs gas"
911
fi
912
 
913
# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and
914
# $target_configdirs.
915
# If we have the source for $noconfigdirs entries, add them to $notsupp.
916
 
917
notsupp=""
918
for dir in . $skipdirs $noconfigdirs ; do
919
  dirname=`echo $dir | sed -e s/target-//g`
920
  if [ $dir != . ]  && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
921
    configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"`
922
    if [ -r $srcdir/$dirname/configure ] \
923
        || [ -r $srcdir/$dirname/configure.in ]; then
924
      if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
925
        true
926
      else
927
        notsupp="$notsupp $dir"
928
      fi
929
    fi
930
  fi
931
  if [ $dir != . ]  && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
932
    target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"`
933
    if [ -r $srcdir/$dirname/configure ] \
934
        || [ -r $srcdir/$dirname/configure.in ]; then
935
      if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then
936
        true
937
      else
938
        notsupp="$notsupp $dir"
939
      fi
940
    fi
941
  fi
942
done
943
 
944
# Sometimes the tools are distributed with libiberty but with no other
945
# libraries.  In that case, we don't want to build target-libiberty.
946
if [ -n "${target_configdirs}" ]; then
947
  others=
948
  for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
949
    if [ "$i" != "libiberty" ]; then
950
      if [ -r $srcdir/$i/configure ] || [ -r $srcdir/$i/configure.in ]; then
951
        others=yes;
952
        break;
953
      fi
954
    fi
955
  done
956
  if [ -z "${others}" ]; then
957
    target_configdirs=
958
  fi
959
fi
960
 
961
# Deconfigure all subdirectories, in case we are changing the
962
# configuration from one where a subdirectory is supported to one where it
963
# is not.
964 56 joel
if [ -z "${norecursion}" ] && [ -n "${configdirs}" ]; then
965 39 lampret
  for i in `echo ${configdirs} | sed -e s/target-//g` ; do
966
    rm -f $i/Makefile
967
  done
968
fi
969 56 joel
if [ -z "${norecursion}" ] && [ -n "${target_configdirs}" ]; then
970 39 lampret
  for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do
971
    rm -f ${target_subdir}/$i/Makefile
972
  done
973
fi
974
 
975
# Produce a warning message for the subdirs we can't configure.
976
# This isn't especially interesting in the Cygnus tree, but in the individual
977
# FSF releases, it's important to let people know when their machine isn't
978
# supported by the one or two programs in a package.
979
 
980
if [ -n "${notsupp}" ] && [ -z "${norecursion}" ]; then
981
  # If $appdirs is non-empty, at least one of those directories must still
982
  # be configured, or we error out.  (E.g., if the gas release supports a
983
  # specified target in some subdirs but not the gas subdir, we shouldn't
984
  # pretend that all is well.)
985
  if [ -n "$appdirs" ]; then
986
    for dir in $appdirs ; do
987
      if [ -r $dir/Makefile.in ]; then
988
        if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
989
          appdirs=""
990
          break
991
        fi
992
        if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then
993
          appdirs=""
994
          break
995
        fi
996
      fi
997
    done
998
    if [ -n "$appdirs" ]; then
999
      echo "*** This configuration is not supported by this package." 1>&2
1000
      exit 1
1001
    fi
1002
  fi
1003
  # Okay, some application will build, or we don't care to check.  Still
1004
  # notify of subdirs not getting built.
1005
  echo "*** This configuration is not supported in the following subdirectories:" 1>&2
1006
  echo "    ${notsupp}" 1>&2
1007
  echo "    (Any other directories should still work fine.)" 1>&2
1008
fi
1009
 
1010
# Set with_gnu_as and with_gnu_ld as appropriate.
1011
#
1012
# This is done by determining whether or not the appropriate directory
1013
# is available, and by checking whether or not specific configurations
1014
# have requested that this magic not happen.
1015
#
1016
# The command line options always override the explicit settings in
1017
# configure.in, and the settings in configure.in override this magic.
1018
#
1019
# If the default for a toolchain is to use GNU as and ld, and you don't
1020
# want to do that, then you should use the --without-gnu-as and
1021
# --without-gnu-ld options for the configure script.
1022
 
1023
if [ x${use_gnu_as} = x ] ; then
1024
  if [ x${with_gnu_as} != xno ] && echo " ${configdirs} " | grep " ${gasdir} " > /dev/null 2>&1 && [ -d ${srcdir}/${gasdir} ] ; then
1025
    with_gnu_as=yes
1026
    withoptions="$withoptions --with-gnu-as"
1027
  fi
1028
fi
1029
 
1030
if [ x${use_gnu_ld} = x ] ; then
1031
  if [ x${with_gnu_ld} != xno ] && echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 && [ -d ${srcdir}/ld ] ; then
1032
    with_gnu_ld=yes
1033
    withoptions="$withoptions --with-gnu-ld"
1034
  fi
1035
fi
1036
 
1037
# If using newlib, add --with-newlib to the withoptions so that gcc/configure
1038
# can detect this case.
1039
 
1040
if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1041
  with_newlib=yes
1042
  withoptions="$withoptions --with-newlib"
1043
fi
1044
 
1045
if [ x${shared} = xyes ]; then
1046
  case "${target}" in
1047
    hppa*)
1048
      target_makefile_frag="${target_makefile_frag} config/mt-papic"
1049
      ;;
1050
    i[3456]86-*)
1051
      target_makefile_frag="${target_makefile_frag} config/mt-x86pic"
1052
      ;;
1053
    powerpc*-*)
1054
      target_makefile_frag="${target_makefile_frag} config/mt-ppcpic"
1055
      ;;
1056
    alpha*-*-linux*)
1057
      target_makefile_frag="${target_makefile_frag} config/mt-elfalphapic"
1058
      ;;
1059
    *)
1060
      if test -f ${srcdir}/config/mt-${target_cpu}pic; then
1061
        target_makefile_frag="${target_makefile_frag} config/mt-${target_cpu}pic"
1062
      fi
1063
      ;;
1064
  esac
1065
fi
1066
 
1067
rm -f mt-frag
1068
if [ -n "${target_makefile_frag}" ] ; then
1069
  for f in ${target_makefile_frag}
1070
  do
1071
    cat ${srcdir}/$f >> mt-frag
1072
  done
1073
  target_makefile_frag=mt-frag
1074
fi
1075
 
1076
# post-target:
1077
 
1078
# Make sure that the compiler is able to generate an executable.  If it
1079
# can't, we are probably in trouble.  We don't care whether we can run the
1080
# executable--we might be using a cross compiler--we only care whether it
1081
# can be created.  At this point the main configure script has set CC.
1082
echo "int main () { return 0; }" > conftest.c
1083
${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c
1084
if [ $? = 0 ] && [ -s conftest -o -s conftest.exe ]; then
1085
  :
1086
else
1087
  echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed."
1088
  echo 1>&2 "*** You must set the environment variable CC to a working compiler."
1089
  rm -f conftest*
1090
  exit 1
1091
fi
1092
rm -f conftest*
1093
 
1094
# The Solaris /usr/ucb/cc compiler does not appear to work.
1095
case "${host}" in
1096
  sparc-sun-solaris2*)
1097
      CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`"
1098
      if [ "`/usr/bin/which $CCBASE`" = "/usr/ucb/cc" ] ; then
1099
          could_use=
1100
          [ -d /opt/SUNWspro/bin ] && could_use="/opt/SUNWspro/bin"
1101
          if [ -d /opt/cygnus/bin ] ; then
1102
              if [ "$could_use" = "" ] ; then
1103
                  could_use="/opt/cygnus/bin"
1104
              else
1105
                  could_use="$could_use or /opt/cygnus/bin"
1106
              fi
1107
          fi
1108
        if [ "$could_use" = "" ] ; then
1109
            echo "Warning: compilation may fail because you're using"
1110
            echo "/usr/ucb/cc.  You should change your PATH or CC "
1111
            echo "variable and rerun configure."
1112
        else
1113
            echo "Warning: compilation may fail because you're using"
1114
            echo "/usr/ucb/cc, when you should use the C compiler from"
1115
            echo "$could_use.  You should change your"
1116
            echo "PATH or CC variable and rerun configure."
1117
        fi
1118
      fi
1119
  ;;
1120
esac
1121
 
1122
# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the
1123
# binutils tools will find libbfd.so.
1124
if [ "${shared}" = "yes" ]; then
1125
  sed -e 's/^SET_LIB_PATH[      ]*=.*$/SET_LIB_PATH = $(REALLY_SET_LIB_PATH)/' \
1126
      Makefile > Makefile.tem
1127
  rm -f Makefile
1128
  mv -f Makefile.tem Makefile
1129
 
1130
  case "${host}" in
1131
  *-*-hpux*)
1132
    sed -e 's/^RPATH_ENVVAR[    ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \
1133
        Makefile > Makefile.tem
1134
    rm -f Makefile
1135
    mv -f Makefile.tem Makefile
1136
    ;;
1137
  esac
1138
fi
1139
 
1140
# Record target_configdirs and the configure arguments in Makefile.
1141
target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'`
1142
targargs=`echo "${arguments}" | \
1143 56 joel
        sed -e 's/--no[^        ]*//' \
1144 39 lampret
            -e 's/--cache[a-z-]*=[^     ]*//' \
1145
            -e 's/--ho[a-z-]*=[^        ]*//' \
1146
            -e 's/--bu[a-z-]*=[^        ]*//' \
1147
            -e 's/--ta[a-z-]*=[^        ]*//'`
1148
 
1149
# Passing a --with-cross-host argument lets the target libraries know
1150
# whether they are being built with a cross-compiler or being built
1151
# native.  However, it would be better to use other mechanisms to make the
1152
# sorts of decisions they want to make on this basis.  Please consider
1153
# this option to be deprecated.  FIXME.
1154
if [ x${is_cross_compiler} = xyes ]; then
1155
  targargs="--with-cross-host=${host_alias} ${targargs}"
1156
fi
1157
 
1158
# Default to --enable-multilib.
1159
if [ x${enable_multilib} = x ]; then
1160
  targargs="--enable-multilib ${targargs}"
1161
fi
1162
 
1163
# Pass --with-newlib if appropriate.  Note that target_configdirs has
1164
# changed from the earlier setting of with_newlib.
1165
if [ x${with_newlib} != xno ] && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && [ -d ${srcdir}/newlib ] ; then
1166
  targargs="--with-newlib ${targargs}"
1167
fi
1168
 
1169 56 joel
# provide a proper gxx_include_dir.
1170
# Note, if you change the default, make sure to fix both here and in
1171
# the gcc, libio, libstdc++ and libg++ subdirectories.
1172
# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given.
1173
gxx_include_dir=
1174
if test -n "${with_gxx_include_dir}"; then
1175
  case "${with_gxx_include_dir}" in
1176
    yes )
1177
      echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2
1178
      exit 1
1179
      ;;
1180
    no )
1181
      ;;
1182
    * )
1183
      gxx_include_dir=${with_gxx_include_dir}
1184
      ;;
1185
  esac
1186
fi
1187
if test x${gxx_include_dir} = x; then
1188
  if test x${enable_version_specific_runtime_libs} = xyes; then
1189
    gxx_include_dir='${libsubdir}/include/g++'
1190
  else
1191
    . ${topsrcdir}/config.if
1192
    gxx_include_dir='${prefix}/include/g++'-${libstdcxx_interface}
1193
  fi
1194
else
1195
  gxx_include_dir=${gxx_include_dir}
1196
fi
1197
 
1198 39 lampret
targargs="--host=${target_alias} --build=${build_alias} ${targargs}"
1199
sed -e "s:^TARGET_CONFIGDIRS[   ]*=.*$:TARGET_CONFIGDIRS = ${target_configdirs}:" \
1200
    -e "s%^CONFIG_ARGUMENTS[    ]*=.*$%CONFIG_ARGUMENTS = ${targargs}%" \
1201
    -e "s%^TARGET_SUBDIR[       ]*=.*$%TARGET_SUBDIR = ${target_subdir}%" \
1202 56 joel
    -e "s%^gxx_include_dir[     ]*=.*$%gxx_include_dir=${gxx_include_dir}%" \
1203 39 lampret
       Makefile > Makefile.tem
1204
rm -f Makefile
1205
mv -f Makefile.tem Makefile
1206
 
1207
#
1208
# Local Variables:
1209
# fill-column: 131
1210
# End:
1211
#

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.