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

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [newlib/] [configure.in] - Blame information for rev 39

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

powered by: WebSVN 2.1.0

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