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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [config-ml.in] - Blame information for rev 853

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

Line No. Rev Author Line
1 263 jeremybenn
# Configure fragment invoked in the post-target section for subdirs
2
# wanting multilib support.
3
#
4
# Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5
# 2005, 2006, 2007  Free Software Foundation, Inc.
6
#
7
# This file is free software; you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 2 of the License, or
10
# (at your option) any later version.
11
#
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
# Boston, MA 02110-1301, USA.
21
#
22
# As a special exception to the GNU General Public License, if you
23
# distribute this file as part of a program that contains a
24
# configuration script generated by Autoconf, you may include it under
25
# the same distribution terms that you use for the rest of that program.
26
#
27
# Please report bugs to 
28
# and send patches to .
29
 
30
# It is advisable to support a few --enable/--disable options to let the
31
# user select which libraries s/he really wants.
32
#
33
# Subdirectories wishing to use multilib should put the following lines
34
# in the "post-target" section of configure.in.
35
#
36
# if [ "${srcdir}" = "." ] ; then
37
#   if [ "${with_target_subdir}" != "." ] ; then
38
#     . ${with_multisrctop}../../config-ml.in
39
#   else
40
#     . ${with_multisrctop}../config-ml.in
41
#   fi
42
# else
43
#   . ${srcdir}/../config-ml.in
44
# fi
45
#
46
#
47
# Things are complicated because 6 separate cases must be handled:
48
# 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6.
49
#
50
# srcdir=. is special.  It must handle make programs that don't handle VPATH.
51
# To implement this, a symlink tree is built for each library and for each
52
# multilib subdir.
53
#
54
# The build tree is layed out as
55
#
56
# ./
57
#   newlib
58
#   m68020/
59
#          newlib
60
#          m68881/
61
#                 newlib
62
#
63
# The nice feature about this arrangement is that inter-library references
64
# in the build tree work without having to care where you are.  Note that
65
# inter-library references also work in the source tree because symlink trees
66
# are built when srcdir=.
67
#
68
# Unfortunately, trying to access the libraries in the build tree requires
69
# the user to manually choose which library to use as GCC won't be able to
70
# find the right one.  This is viewed as the lesser of two evils.
71
#
72
# Configure variables:
73
# ${with_target_subdir} = "." for native, or ${target_alias} for cross.
74
# Set by top level Makefile.
75
# ${with_multisrctop} = how many levels of multilibs there are in the source
76
# tree.  It exists to handle the case of configuring in the source tree:
77
# ${srcdir} is not constant.
78
# ${with_multisubdir} = name of multilib subdirectory (eg: m68020/m68881).
79
#
80
# Makefile variables:
81
# MULTISRCTOP = number of multilib levels in source tree (+1 if cross)
82
# (FIXME: note that this is different than ${with_multisrctop}.  Check out.).
83
# MULTIBUILDTOP = number of multilib levels in build tree
84
# MULTIDIRS = list of multilib subdirs (eg: m68000 m68020 ...)
85
# (only defined in each library's main Makefile).
86
# MULTISUBDIR = installed subdirectory name with leading '/' (eg: /m68000)
87
# (only defined in each multilib subdir).
88
 
89
# FIXME: Multilib is currently disabled by default for everything other than
90
# newlib.  It is up to each target to turn on multilib support for the other
91
# libraries as desired.
92
 
93
# Autoconf incoming variables:
94
# srcdir, host, ac_configure_args
95
#
96
# We *could* figure srcdir and host out, but we'd have to do work that
97
# our caller has already done to figure them out and requiring these two
98
# seems reasonable.
99
# Note that `host' in this case is GCC's `target'.  Target libraries are
100
# configured for a particular host.
101
 
102
Makefile=${ac_file-Makefile}
103
ml_config_shell=${CONFIG_SHELL-/bin/sh}
104
ml_realsrcdir=${srcdir}
105
 
106
# Scan all the arguments and set all the ones we need.
107
 
108
ml_verbose=--verbose
109
for option in ${ac_configure_args}
110
do
111
  # strip single quotes surrounding individual options
112
  case $option in
113
  \'*\') eval option=$option ;;
114
  esac
115
 
116
  case $option in
117
  --*) ;;
118
  -*) option=-$option ;;
119
  esac
120
 
121
  case $option in
122
  --*=*)
123
        optarg=`echo $option | sed -e 's/^[^=]*=//'`
124
        ;;
125
  esac
126
 
127
  case $option in
128
  --disable-*)
129
        enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'`
130
        eval $enableopt=no
131
        ;;
132
  --enable-*)
133
        case "$option" in
134
        *=*)    ;;
135
        *)      optarg=yes ;;
136
        esac
137
        enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
138
        # enable_shared and enable_static are handled by configure.
139
        # Don't undo its work.
140
        case $enableopt in
141
        enable_shared | enable_static) ;;
142
        *) eval $enableopt="$optarg" ;;
143
        esac
144
        ;;
145
  --norecursion | --no-recursion)
146
        ml_norecursion=yes
147
        ;;
148
  --silent | --sil* | --quiet | --q*)
149
        ml_verbose=--silent
150
        ;;
151
  --verbose | --v | --verb*)
152
        ml_verbose=--verbose
153
        ;;
154
  --with-*)
155
        case "$option" in
156
        *=*)    ;;
157
        *)      optarg=yes ;;
158
        esac
159
        withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'`
160
        eval $withopt="$optarg"
161
        ;;
162
  --without-*)
163
        withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'`
164
        eval $withopt=no
165
        ;;
166
  esac
167
done
168
 
169
# Only do this if --enable-multilib.
170
if [ "${enable_multilib}" = yes ]; then
171
 
172
# Compute whether this is the library's top level directory
173
# (ie: not a multilib subdirectory, and not a subdirectory like newlib/src).
174
# ${with_multisubdir} tells us we're in the right branch, but we could be
175
# in a subdir of that.
176
# ??? The previous version could void this test by separating the process into
177
# two files: one that only the library's toplevel configure.in ran (to
178
# configure the multilib subdirs), and another that all configure.in's ran to
179
# update the Makefile.  It seemed reasonable to collapse all multilib support
180
# into one file, but it does leave us with having to perform this test.
181
ml_toplevel_p=no
182
if [ -z "${with_multisubdir}" ]; then
183
  if [ "${srcdir}" = "." ]; then
184
    # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
185
    # ${with_target_subdir} = "." for native, otherwise target alias.
186
    if [ "${with_target_subdir}" = "." ]; then
187
      if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
188
        ml_toplevel_p=yes
189
      fi
190
    else
191
      if [ -f ${ml_realsrcdir}/../../config-ml.in ]; then
192
        ml_toplevel_p=yes
193
      fi
194
    fi
195
  else
196
    # Use ${ml_realsrcdir} instead of ${srcdir} here to account for ${subdir}.
197
    if [ -f ${ml_realsrcdir}/../config-ml.in ]; then
198
      ml_toplevel_p=yes
199
    fi
200
  fi
201
fi
202
 
203
# If this is the library's top level directory, set multidirs to the
204
# multilib subdirs to support.  This lives at the top because we need
205
# `multidirs' set right away.
206
 
207
if [ "${ml_toplevel_p}" = yes ]; then
208
 
209
multidirs=
210
for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
211
  dir=`echo $i | sed -e 's/;.*$//'`
212
  if [ "${dir}" = "." ]; then
213
    true
214
  else
215
    if [ -z "${multidirs}" ]; then
216
      multidirs="${dir}"
217
    else
218
      multidirs="${multidirs} ${dir}"
219
    fi
220
  fi
221
done
222
 
223
# Target libraries are configured for the host they run on, so we check
224
# $host here, not $target.
225
 
226
case "${host}" in
227
arc-*-elf*)
228
        if [ x$enable_biendian != xyes ]
229
        then
230
          old_multidirs=${multidirs}
231
          multidirs=""
232
          for x in ${old_multidirs}; do
233
            case "${x}" in
234
              *be*) : ;;
235
              *) multidirs="${multidirs} ${x}" ;;
236
            esac
237
          done
238
        fi
239
        ;;
240
arm-*-*)
241
        if [ x"$enable_fpu" = xno ]
242
        then
243
          old_multidirs=${multidirs}
244
          multidirs=""
245
          for x in ${old_multidirs}; do
246
            case "${x}" in
247
              *fpu*) : ;;
248
              *) multidirs="${multidirs} ${x}" ;;
249
            esac
250
          done
251
        fi
252
        if [ x"$enable_26bit" = xno ]
253
        then
254
          old_multidirs=${multidirs}
255
          multidirs=""
256
          for x in ${old_multidirs}; do
257
            case "${x}" in
258
              *26bit*) : ;;
259
              *) multidirs="${multidirs} ${x}" ;;
260
            esac
261
          done
262
        fi
263
        if [ x"$enable_underscore" = xno ]
264
        then
265
          old_multidirs=${multidirs}
266
          multidirs=""
267
          for x in ${old_multidirs}; do
268
            case "${x}" in
269
              *under*) : ;;
270
              *) multidirs="${multidirs} ${x}" ;;
271
            esac
272
          done
273
        fi
274
        if [ x"$enable_interwork" = xno ]
275
        then
276
          old_multidirs=${multidirs}
277
          multidirs=""
278
          for x in ${old_multidirs}; do
279
            case "${x}" in
280
              *interwork*) : ;;
281
              *) multidirs="${multidirs} ${x}" ;;
282
            esac
283
          done
284
        fi
285
        if [ x$enable_biendian = xno ]
286
        then
287
          old_multidirs="${multidirs}"
288
          multidirs=""
289
          for x in ${old_multidirs}; do
290
            case "$x" in
291
              *le* ) : ;;
292
              *be* ) : ;;
293
              *) multidirs="${multidirs} ${x}" ;;
294
            esac
295
          done
296
        fi
297
        if [ x"$enable_nofmult" = xno ]
298
        then
299
          old_multidirs="${multidirs}"
300
          multidirs=""
301
          for x in ${old_multidirs}; do
302
            case "$x" in
303
              *nofmult* ) : ;;
304
              *) multidirs="${multidirs} ${x}" ;;
305
            esac
306
          done
307
        fi
308
        ;;
309
m68*-*-*)
310
        if [ x$enable_softfloat = xno ]
311
        then
312
          old_multidirs="${multidirs}"
313
          multidirs=""
314
          for x in ${old_multidirs}; do
315
            case "$x" in
316
              *soft-float* ) : ;;
317
              *) multidirs="${multidirs} ${x}" ;;
318
            esac
319
          done
320
        fi
321
        if [ x$enable_m68881 = xno ]
322
        then
323
          old_multidirs="${multidirs}"
324
          multidirs=""
325
          for x in ${old_multidirs}; do
326
            case "$x" in
327
              *m68881* ) : ;;
328
              *) multidirs="${multidirs} ${x}" ;;
329
            esac
330
          done
331
        fi
332
        if [ x$enable_m68000 = xno ]
333
        then
334
          old_multidirs="${multidirs}"
335
          multidirs=""
336
          for x in ${old_multidirs}; do
337
            case "$x" in
338
              *m68000* ) : ;;
339
              *) multidirs="${multidirs} ${x}" ;;
340
            esac
341
          done
342
        fi
343
        if [ x$enable_m68020 = xno ]
344
        then
345
          old_multidirs="${multidirs}"
346
          multidirs=""
347
          for x in ${old_multidirs}; do
348
            case "$x" in
349
              *m68020* ) : ;;
350
              *) multidirs="${multidirs} ${x}" ;;
351
            esac
352
          done
353
        fi
354
        ;;
355
mips*-*-*)
356
        if [ x$enable_single_float = xno ]
357
        then
358
          old_multidirs="${multidirs}"
359
          multidirs=""
360
          for x in ${old_multidirs}; do
361
            case "$x" in
362
              *single* ) : ;;
363
              *) multidirs="${multidirs} ${x}" ;;
364
            esac
365
          done
366
        fi
367
        if [ x$enable_biendian = xno ]
368
        then
369
          old_multidirs="${multidirs}"
370
          multidirs=""
371
          for x in ${old_multidirs}; do
372
            case "$x" in
373
              *el* ) : ;;
374
              *eb* ) : ;;
375
              *) multidirs="${multidirs} ${x}" ;;
376
            esac
377
          done
378
        fi
379
        if [ x$enable_softfloat = xno ]
380
        then
381
          old_multidirs="${multidirs}"
382
          multidirs=""
383
          for x in ${old_multidirs}; do
384
            case "$x" in
385
              *soft-float* ) : ;;
386
              *) multidirs="${multidirs} ${x}" ;;
387
            esac
388
          done
389
        fi
390
        ;;
391
powerpc*-*-* | rs6000*-*-*)
392
        if [ x$enable_aix64 = xno ]
393
        then
394
          old_multidirs="${multidirs}"
395
          multidirs=""
396
          for x in ${old_multidirs}; do
397
            case "$x" in
398
              *ppc64* ) : ;;
399
              *) multidirs="${multidirs} ${x}" ;;
400
            esac
401
          done
402
        fi
403
        if [ x$enable_pthread = xno ]
404
        then
405
          old_multidirs="${multidirs}"
406
          multidirs=""
407
          for x in ${old_multidirs}; do
408
            case "$x" in
409
              *pthread* ) : ;;
410
              *) multidirs="${multidirs} ${x}" ;;
411
            esac
412
          done
413
        fi
414
        if [ x$enable_softfloat = xno ]
415
        then
416
          old_multidirs="${multidirs}"
417
          multidirs=""
418
          for x in ${old_multidirs}; do
419
            case "$x" in
420
              *soft-float* ) : ;;
421
              *) multidirs="${multidirs} ${x}" ;;
422
            esac
423
          done
424
        fi
425
        if [ x$enable_powercpu = xno ]
426
        then
427
          old_multidirs="${multidirs}"
428
          multidirs=""
429
          for x in ${old_multidirs}; do
430
            case "$x" in
431
              power | */power | */power/* ) : ;;
432
              *) multidirs="${multidirs} ${x}" ;;
433
            esac
434
          done
435
        fi
436
        if [ x$enable_powerpccpu = xno ]
437
        then
438
          old_multidirs="${multidirs}"
439
          multidirs=""
440
          for x in ${old_multidirs}; do
441
            case "$x" in
442
              *powerpc* ) : ;;
443
              *) multidirs="${multidirs} ${x}" ;;
444
            esac
445
          done
446
        fi
447
        if [ x$enable_powerpcos = xno ]
448
        then
449
          old_multidirs="${multidirs}"
450
          multidirs=""
451
          for x in ${old_multidirs}; do
452
            case "$x" in
453
              *mcall-linux* | *mcall-solaris* ) : ;;
454
              *) multidirs="${multidirs} ${x}" ;;
455
            esac
456
          done
457
        fi
458
        if [ x$enable_biendian = xno ]
459
        then
460
          old_multidirs="${multidirs}"
461
          multidirs=""
462
          for x in ${old_multidirs}; do
463
            case "$x" in
464
              *mlittle* | *mbig* ) : ;;
465
              *) multidirs="${multidirs} ${x}" ;;
466
            esac
467
          done
468
        fi
469
        if [ x$enable_sysv = xno ]
470
        then
471
          old_multidirs="${multidirs}"
472
          multidirs=""
473
          for x in ${old_multidirs}; do
474
            case "$x" in
475
              *mcall-sysv* ) : ;;
476
              *) multidirs="${multidirs} ${x}" ;;
477
            esac
478
          done
479
        fi
480
        ;;
481
esac
482
 
483
# Remove extraneous blanks from multidirs.
484
# Tests like `if [ -n "$multidirs" ]' require it.
485
multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'`
486
 
487
# Add code to library's top level makefile to handle building the multilib
488
# subdirs.
489
 
490
cat > Multi.tem <<\EOF
491
 
492
PWD_COMMAND=$${PWDCMD-pwd}
493
 
494
# FIXME: There should be an @-sign in front of the `if'.
495
# Leave out until this is tested a bit more.
496
multi-do:
497
        if [ -z "$(MULTIDIRS)" ]; then \
498
          true; \
499
        else \
500
          rootpre=`${PWD_COMMAND}`/; export rootpre; \
501
          srcrootpre=`cd $(srcdir); ${PWD_COMMAND}`/; export srcrootpre; \
502
          lib=`echo "$${rootpre}" | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
503
          compiler="$(CC)"; \
504
          for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \
505
            dir=`echo $$i | sed -e 's/;.*$$//'`; \
506
            if [ "$${dir}" = "." ]; then \
507
              true; \
508
            else \
509
              if [ -d ../$${dir}/$${lib} ]; then \
510
                flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
511
                if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
512
                                CFLAGS="$(CFLAGS) $${flags}" \
513
                                CCASFLAGS="$(CCASFLAGS) $${flags}" \
514
                                FCFLAGS="$(FCFLAGS) $${flags}" \
515
                                FFLAGS="$(FFLAGS) $${flags}" \
516
                                ADAFLAGS="$(ADAFLAGS) $${flags}" \
517
                                prefix="$(prefix)" \
518
                                exec_prefix="$(exec_prefix)" \
519
                                GCJFLAGS="$(GCJFLAGS) $${flags}" \
520
                                CXXFLAGS="$(CXXFLAGS) $${flags}" \
521
                                LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
522
                                LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
523
                                LDFLAGS="$(LDFLAGS) $${flags}" \
524
                                MULTIFLAGS="$${flags}" \
525
                                DESTDIR="$(DESTDIR)" \
526
                                INSTALL="$(INSTALL)" \
527
                                INSTALL_DATA="$(INSTALL_DATA)" \
528
                                INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
529
                                INSTALL_SCRIPT="$(INSTALL_SCRIPT)" \
530
                                $(DO)); then \
531
                  true; \
532
                else \
533
                  exit 1; \
534
                fi; \
535
              else true; \
536
              fi; \
537
            fi; \
538
          done; \
539
        fi
540
 
541
# FIXME: There should be an @-sign in front of the `if'.
542
# Leave out until this is tested a bit more.
543
multi-clean:
544
        if [ -z "$(MULTIDIRS)" ]; then \
545
          true; \
546
        else \
547
          lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
548
          for dir in : $(MULTIDIRS); do \
549
            test $$dir != : || continue; \
550
EOF
551
cat >>Multi.tem <
552
            if [ -f ../\$\${dir}/\$\${lib}/${Makefile} ]; then \\
553
EOF
554
cat >>Multi.tem <<\EOF
555
              if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \
556
              then true; \
557
              else exit 1; \
558
              fi; \
559
            else true; \
560
            fi; \
561
          done; \
562
        fi
563
EOF
564
 
565
cat ${Makefile} Multi.tem > Makefile.tem
566
rm -f ${Makefile} Multi.tem
567
mv Makefile.tem ${Makefile}
568
 
569
fi # ${ml_toplevel_p} = yes
570
 
571
if [ "${ml_verbose}" = --verbose ]; then
572
  echo "Adding multilib support to ${Makefile} in ${ml_realsrcdir}"
573
  if [ "${ml_toplevel_p}" = yes ]; then
574
    echo "multidirs=${multidirs}"
575
  fi
576
  echo "with_multisubdir=${with_multisubdir}"
577
fi
578
 
579
if [ "${srcdir}" = "." ]; then
580
  if [ "${with_target_subdir}" != "." ]; then
581
    ml_srcdotdot="../"
582
  else
583
    ml_srcdotdot=""
584
  fi
585
else
586
  ml_srcdotdot=""
587
fi
588
 
589
if [ -z "${with_multisubdir}" ]; then
590
  ml_subdir=
591
  ml_builddotdot=
592
  : # ml_srcdotdot= # already set
593
else
594
  ml_subdir="/${with_multisubdir}"
595
  # The '[^/][^/]*' appears that way to work around a SunOS sed bug.
596
  ml_builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`/
597
  if [ "$srcdir" = "." ]; then
598
    ml_srcdotdot=${ml_srcdotdot}${ml_builddotdot}
599
  else
600
    : # ml_srcdotdot= # already set
601
  fi
602
fi
603
 
604
if [ "${ml_toplevel_p}" = yes ]; then
605
  ml_do='$(MAKE)'
606
  ml_clean='$(MAKE)'
607
else
608
  ml_do=true
609
  ml_clean=true
610
fi
611
 
612
# TOP is used by newlib and should not be used elsewhere for this purpose.
613
# MULTI{SRC,BUILD}TOP are the proper ones to use.  MULTISRCTOP is empty
614
# when srcdir != builddir.  MULTIBUILDTOP is always some number of ../'s.
615
# FIXME: newlib needs to be updated to use MULTI{SRC,BUILD}TOP so we can
616
# delete TOP.  Newlib may wish to continue to use TOP for its own purposes
617
# of course.
618
# MULTIDIRS is non-empty for the cpu top level Makefile (eg: newlib/Makefile)
619
# and lists the subdirectories to recurse into.
620
# MULTISUBDIR is non-empty in each cpu subdirectory's Makefile
621
# (eg: newlib/h8300h/Makefile) and is the installed subdirectory name with
622
# a leading '/'.
623
# MULTIDO is used for targets like all, install, and check where
624
# $(FLAGS_TO_PASS) augmented with the subdir's compiler option is needed.
625
# MULTICLEAN is used for the *clean targets.
626
#
627
# ??? It is possible to merge MULTIDO and MULTICLEAN into one.  They are
628
# currently kept separate because we don't want the *clean targets to require
629
# the existence of the compiler (which MULTIDO currently requires) and
630
# therefore we'd have to record the directory options as well as names
631
# (currently we just record the names and use --print-multi-lib to get the
632
# options).
633
 
634
sed -e "s:^TOP[         ]*=[    ]*\([./]*\)[    ]*$:TOP = ${ml_builddotdot}\1:" \
635
    -e "s:^MULTISRCTOP[         ]*=.*$:MULTISRCTOP = ${ml_srcdotdot}:" \
636
    -e "s:^MULTIBUILDTOP[       ]*=.*$:MULTIBUILDTOP = ${ml_builddotdot}:" \
637
    -e "s:^MULTIDIRS[   ]*=.*$:MULTIDIRS = ${multidirs}:" \
638
    -e "s:^MULTISUBDIR[         ]*=.*$:MULTISUBDIR = ${ml_subdir}:" \
639
    -e "s:^MULTIDO[     ]*=.*$:MULTIDO = $ml_do:" \
640
    -e "s:^MULTICLEAN[  ]*=.*$:MULTICLEAN = $ml_clean:" \
641
        ${Makefile} > Makefile.tem
642
rm -f ${Makefile}
643
mv Makefile.tem ${Makefile}
644
 
645
# If this is the library's top level, configure each multilib subdir.
646
# This is done at the end because this is the loop that runs configure
647
# in each multilib subdir and it seemed reasonable to finish updating the
648
# Makefile before going on to configure the subdirs.
649
 
650
if [ "${ml_toplevel_p}" = yes ]; then
651
 
652
# We must freshly configure each subdirectory.  This bit of code is
653
# actually partially stolen from the main configure script.  FIXME.
654
 
655
if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
656
 
657
  if [ "${ml_verbose}" = --verbose ]; then
658
    echo "Running configure in multilib subdirs ${multidirs}"
659
    echo "pwd: `${PWDCMD-pwd}`"
660
  fi
661
 
662
  ml_origdir=`${PWDCMD-pwd}`
663
  ml_libdir=`echo "$ml_origdir" | sed -e 's,^.*/,,'`
664
  # cd to top-level-build-dir/${with_target_subdir}
665
  cd ..
666
 
667
  for ml_dir in ${multidirs}; do
668
 
669
    if [ "${ml_verbose}" = --verbose ]; then
670
      echo "Running configure in multilib subdir ${ml_dir}"
671
      echo "pwd: `${PWDCMD-pwd}`"
672
    fi
673
 
674
    if [ -d ${ml_dir} ]; then true; else
675
      # ``mkdir -p ${ml_dir}'' See also mkinstalldirs.
676
      pathcomp=""
677
      for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do
678
        pathcomp="$pathcomp$d"
679
        case "$pathcomp" in
680
          -* ) pathcomp=./$pathcomp ;;
681
        esac
682
        if test ! -d "$pathcomp"; then
683
           echo "mkdir $pathcomp" 1>&2
684
           mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
685
        fi
686
        if test ! -d "$pathcomp"; then
687
           exit $lasterr
688
        fi
689
        pathcomp="$pathcomp/"
690
      done
691
    fi
692
    if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi
693
 
694
    # Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../
695
    dotdot=../`echo ${ml_dir} | sed -e 's|[^/]||g' -e 's|/|../|g'`
696
 
697
    case ${srcdir} in
698
    ".")
699
      echo "Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir}"
700
      if [ "${with_target_subdir}" != "." ]; then
701
        ml_unsubdir="../"
702
      else
703
        ml_unsubdir=""
704
      fi
705
      (cd ${ml_dir}/${ml_libdir};
706
       ../${dotdot}${ml_unsubdir}symlink-tree ../${dotdot}${ml_unsubdir}${ml_libdir} "")
707
      if [ -f ${ml_dir}/${ml_libdir}/${Makefile} ]; then
708
        if [ x"${MAKE}" = x ]; then
709
          (cd ${ml_dir}/${ml_libdir}; make distclean)
710
        else
711
          (cd ${ml_dir}/${ml_libdir}; ${MAKE} distclean)
712
        fi
713
      fi
714
      ml_newsrcdir="."
715
      ml_srcdiroption=
716
      multisrctop=${dotdot}
717
      ;;
718
    *)
719
      case "${srcdir}" in
720
      /* | [A-Za-z]:[\\/]* ) # absolute path
721
        ml_newsrcdir=${srcdir}
722
        ;;
723
      *) # otherwise relative
724
        ml_newsrcdir=${dotdot}${srcdir}
725
        ;;
726
      esac
727
      ml_srcdiroption="-srcdir=${ml_newsrcdir}"
728
      multisrctop=
729
      ;;
730
    esac
731
 
732
    case "${progname}" in
733
    /* | [A-Za-z]:[\\/]* )     ml_recprog=${progname} ;;
734
    *)      ml_recprog=${dotdot}${progname} ;;
735
    esac
736
 
737
    # FIXME: POPDIR=${PWD=`pwd`} doesn't work here.
738
    ML_POPDIR=`${PWDCMD-pwd}`
739
    cd ${ml_dir}/${ml_libdir}
740
 
741
    if [ -f ${ml_newsrcdir}/configure ]; then
742
      ml_recprog="${ml_newsrcdir}/configure"
743
    fi
744
 
745
    # find compiler flag corresponding to ${ml_dir}
746
    for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
747
      dir=`echo $i | sed -e 's/;.*$//'`
748
      if [ "${dir}" = "${ml_dir}" ]; then
749
        flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
750
        break
751
      fi
752
    done
753
    ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags"'
754
 
755
    if [ "${with_target_subdir}" = "." ]; then
756
        CC_=$CC' '
757
        CXX_=$CXX' '
758
        F77_=$F77' '
759
        GCJ_=$GCJ' '
760
        GFORTRAN_=$GFORTRAN' '
761
    else
762
        # Create a regular expression that matches any string as long
763
        # as ML_POPDIR.
764
        popdir_rx=`echo "${ML_POPDIR}" | sed 's,.,.,g'`
765
        CC_=
766
        for arg in ${CC}; do
767
          case $arg in
768
          -[BIL]"${ML_POPDIR}"/*)
769
            CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\1/p"`' ' ;;
770
          "${ML_POPDIR}"/*)
771
            CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
772
          *)
773
            CC_="${CC_}${arg} " ;;
774
          esac
775
        done
776
 
777
        CXX_=
778
        for arg in ${CXX}; do
779
          case $arg in
780
          -[BIL]"${ML_POPDIR}"/*)
781
            CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
782
          "${ML_POPDIR}"/*)
783
            CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
784
          *)
785
            CXX_="${CXX_}${arg} " ;;
786
          esac
787
        done
788
 
789
        F77_=
790
        for arg in ${F77}; do
791
          case $arg in
792
          -[BIL]"${ML_POPDIR}"/*)
793
            F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
794
          "${ML_POPDIR}"/*)
795
            F77_="${F77_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
796
          *)
797
            F77_="${F77_}${arg} " ;;
798
          esac
799
        done
800
 
801
        GCJ_=
802
        for arg in ${GCJ}; do
803
          case $arg in
804
          -[BIL]"${ML_POPDIR}"/*)
805
            GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
806
          "${ML_POPDIR}"/*)
807
            GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
808
          *)
809
            GCJ_="${GCJ_}${arg} " ;;
810
          esac
811
        done
812
 
813
        GFORTRAN_=
814
        for arg in ${GFORTRAN}; do
815
          case $arg in
816
          -[BIL]"${ML_POPDIR}"/*)
817
            GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
818
          "${ML_POPDIR}"/*)
819
            GFORTRAN_="${GFORTRAN_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
820
          *)
821
            GFORTRAN_="${GFORTRAN_}${arg} " ;;
822
          esac
823
        done
824
 
825
        if test "x${LD_LIBRARY_PATH+set}" = xset; then
826
          LD_LIBRARY_PATH_=
827
          for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
828
            case "$arg" in
829
            "${ML_POPDIR}"/*)
830
              arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
831
              ;;
832
            esac
833
            if test "x$LD_LIBRARY_PATH_" != x; then
834
              LD_LIBRARY_PATH_=$LD_LIBRARY_PATH_:$arg
835
            else
836
              LD_LIBRARY_PATH_=$arg
837
            fi
838
          done
839
          ml_config_env="$ml_config_env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_"
840
        fi
841
 
842
        if test "x${SHLIB_PATH+set}" = xset; then
843
          SHLIB_PATH_=
844
          for arg in `echo "$SHLIB_PATH" | tr ':' ' '`; do
845
            case "$arg" in
846
            "${ML_POPDIR}"/*)
847
              arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`
848
              ;;
849
            esac
850
            if test "x$SHLIB_PATH_" != x; then
851
              SHLIB_PATH_=$SHLIB_PATH_:$arg
852
            else
853
              SHLIB_PATH_=$arg
854
            fi
855
          done
856
          ml_config_env="$ml_config_env SHLIB_PATH=$SHLIB_PATH_"
857
        fi
858
    fi
859
 
860
    if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
861
        --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
862
        ${ac_configure_args} ${ml_config_env} ${ml_srcdiroption} ; then
863
      true
864
    else
865
      exit 1
866
    fi
867
 
868
    cd "${ML_POPDIR}"
869
 
870
  done
871
 
872
  cd "${ml_origdir}"
873
fi
874
 
875
fi # ${ml_toplevel_p} = yes
876
fi # ${enable_multilib} = yes

powered by: WebSVN 2.1.0

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