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

Subversion Repositories open8_urisc

[/] [open8_urisc/] [trunk/] [gnu/] [binutils/] [config-ml.in] - Blame information for rev 155

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

Line No. Rev Author Line
1 147 khays
# 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, 2008, 2010, 2011  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
arm-*-*)
228
        if [ x"$enable_fpu" = xno ]
229
        then
230
          old_multidirs=${multidirs}
231
          multidirs=""
232
          for x in ${old_multidirs}; do
233
            case "${x}" in
234
              *fpu*) : ;;
235
              *) multidirs="${multidirs} ${x}" ;;
236
            esac
237
          done
238
        fi
239
        if [ x"$enable_26bit" = xno ]
240
        then
241
          old_multidirs=${multidirs}
242
          multidirs=""
243
          for x in ${old_multidirs}; do
244
            case "${x}" in
245
              *26bit*) : ;;
246
              *) multidirs="${multidirs} ${x}" ;;
247
            esac
248
          done
249
        fi
250
        if [ x"$enable_underscore" = xno ]
251
        then
252
          old_multidirs=${multidirs}
253
          multidirs=""
254
          for x in ${old_multidirs}; do
255
            case "${x}" in
256
              *under*) : ;;
257
              *) multidirs="${multidirs} ${x}" ;;
258
            esac
259
          done
260
        fi
261
        if [ x"$enable_interwork" = xno ]
262
        then
263
          old_multidirs=${multidirs}
264
          multidirs=""
265
          for x in ${old_multidirs}; do
266
            case "${x}" in
267
              *interwork*) : ;;
268
              *) multidirs="${multidirs} ${x}" ;;
269
            esac
270
          done
271
        fi
272
        if [ x$enable_biendian = xno ]
273
        then
274
          old_multidirs="${multidirs}"
275
          multidirs=""
276
          for x in ${old_multidirs}; do
277
            case "$x" in
278
              *le* ) : ;;
279
              *be* ) : ;;
280
              *) multidirs="${multidirs} ${x}" ;;
281
            esac
282
          done
283
        fi
284
        if [ x"$enable_nofmult" = xno ]
285
        then
286
          old_multidirs="${multidirs}"
287
          multidirs=""
288
          for x in ${old_multidirs}; do
289
            case "$x" in
290
              *nofmult* ) : ;;
291
              *) multidirs="${multidirs} ${x}" ;;
292
            esac
293
          done
294
        fi
295
        ;;
296
m68*-*-*)
297
        if [ x$enable_softfloat = xno ]
298
        then
299
          old_multidirs="${multidirs}"
300
          multidirs=""
301
          for x in ${old_multidirs}; do
302
            case "$x" in
303
              *soft-float* ) : ;;
304
              *) multidirs="${multidirs} ${x}" ;;
305
            esac
306
          done
307
        fi
308
        if [ x$enable_m68881 = xno ]
309
        then
310
          old_multidirs="${multidirs}"
311
          multidirs=""
312
          for x in ${old_multidirs}; do
313
            case "$x" in
314
              *m68881* ) : ;;
315
              *) multidirs="${multidirs} ${x}" ;;
316
            esac
317
          done
318
        fi
319
        if [ x$enable_m68000 = xno ]
320
        then
321
          old_multidirs="${multidirs}"
322
          multidirs=""
323
          for x in ${old_multidirs}; do
324
            case "$x" in
325
              *m68000* ) : ;;
326
              *) multidirs="${multidirs} ${x}" ;;
327
            esac
328
          done
329
        fi
330
        if [ x$enable_m68020 = xno ]
331
        then
332
          old_multidirs="${multidirs}"
333
          multidirs=""
334
          for x in ${old_multidirs}; do
335
            case "$x" in
336
              *m68020* ) : ;;
337
              *) multidirs="${multidirs} ${x}" ;;
338
            esac
339
          done
340
        fi
341
        ;;
342
mips*-*-*)
343
        if [ x$enable_single_float = xno ]
344
        then
345
          old_multidirs="${multidirs}"
346
          multidirs=""
347
          for x in ${old_multidirs}; do
348
            case "$x" in
349
              *single* ) : ;;
350
              *) multidirs="${multidirs} ${x}" ;;
351
            esac
352
          done
353
        fi
354
        if [ x$enable_biendian = xno ]
355
        then
356
          old_multidirs="${multidirs}"
357
          multidirs=""
358
          for x in ${old_multidirs}; do
359
            case "$x" in
360
              *el* ) : ;;
361
              *eb* ) : ;;
362
              *) multidirs="${multidirs} ${x}" ;;
363
            esac
364
          done
365
        fi
366
        if [ x$enable_softfloat = xno ]
367
        then
368
          old_multidirs="${multidirs}"
369
          multidirs=""
370
          for x in ${old_multidirs}; do
371
            case "$x" in
372
              *soft-float* ) : ;;
373
              *) multidirs="${multidirs} ${x}" ;;
374
            esac
375
          done
376
        fi
377
        ;;
378
powerpc*-*-* | rs6000*-*-*)
379
        if [ x$enable_aix64 = xno ]
380
        then
381
          old_multidirs="${multidirs}"
382
          multidirs=""
383
          for x in ${old_multidirs}; do
384
            case "$x" in
385
              *ppc64* ) : ;;
386
              *) multidirs="${multidirs} ${x}" ;;
387
            esac
388
          done
389
        fi
390
        if [ x$enable_pthread = xno ]
391
        then
392
          old_multidirs="${multidirs}"
393
          multidirs=""
394
          for x in ${old_multidirs}; do
395
            case "$x" in
396
              *pthread* ) : ;;
397
              *) multidirs="${multidirs} ${x}" ;;
398
            esac
399
          done
400
        fi
401
        if [ x$enable_softfloat = xno ]
402
        then
403
          old_multidirs="${multidirs}"
404
          multidirs=""
405
          for x in ${old_multidirs}; do
406
            case "$x" in
407
              *soft-float* ) : ;;
408
              *) multidirs="${multidirs} ${x}" ;;
409
            esac
410
          done
411
        fi
412
        if [ x$enable_powercpu = xno ]
413
        then
414
          old_multidirs="${multidirs}"
415
          multidirs=""
416
          for x in ${old_multidirs}; do
417
            case "$x" in
418
              power | */power | */power/* ) : ;;
419
              *) multidirs="${multidirs} ${x}" ;;
420
            esac
421
          done
422
        fi
423
        if [ x$enable_powerpccpu = xno ]
424
        then
425
          old_multidirs="${multidirs}"
426
          multidirs=""
427
          for x in ${old_multidirs}; do
428
            case "$x" in
429
              *powerpc* ) : ;;
430
              *) multidirs="${multidirs} ${x}" ;;
431
            esac
432
          done
433
        fi
434
        if [ x$enable_powerpcos = xno ]
435
        then
436
          old_multidirs="${multidirs}"
437
          multidirs=""
438
          for x in ${old_multidirs}; do
439
            case "$x" in
440
              *mcall-linux* | *mcall-solaris* ) : ;;
441
              *) multidirs="${multidirs} ${x}" ;;
442
            esac
443
          done
444
        fi
445
        if [ x$enable_biendian = xno ]
446
        then
447
          old_multidirs="${multidirs}"
448
          multidirs=""
449
          for x in ${old_multidirs}; do
450
            case "$x" in
451
              *mlittle* | *mbig* ) : ;;
452
              *) multidirs="${multidirs} ${x}" ;;
453
            esac
454
          done
455
        fi
456
        if [ x$enable_sysv = xno ]
457
        then
458
          old_multidirs="${multidirs}"
459
          multidirs=""
460
          for x in ${old_multidirs}; do
461
            case "$x" in
462
              *mcall-sysv* ) : ;;
463
              *) multidirs="${multidirs} ${x}" ;;
464
            esac
465
          done
466
        fi
467
        ;;
468
esac
469
 
470
# Remove extraneous blanks from multidirs.
471
# Tests like `if [ -n "$multidirs" ]' require it.
472
multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'`
473
 
474
# Add code to library's top level makefile to handle building the multilib
475
# subdirs.
476
 
477
cat > Multi.tem <<\EOF
478
 
479
PWD_COMMAND=$${PWDCMD-pwd}
480
 
481
# FIXME: There should be an @-sign in front of the `if'.
482
# Leave out until this is tested a bit more.
483
multi-do:
484
        if [ -z "$(MULTIDIRS)" ]; then \
485
          true; \
486
        else \
487
          rootpre=`${PWD_COMMAND}`/; export rootpre; \
488
          srcrootpre=`cd $(srcdir); ${PWD_COMMAND}`/; export srcrootpre; \
489
          lib=`echo "$${rootpre}" | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \
490
          compiler="$(CC)"; \
491
          for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \
492
            dir=`echo $$i | sed -e 's/;.*$$//'`; \
493
            if [ "$${dir}" = "." ]; then \
494
              true; \
495
            else \
496
              if [ -d ../$${dir}/$${lib} ]; then \
497
                flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \
498
                if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \
499
                                CFLAGS="$(CFLAGS) $${flags}" \
500
                                CCASFLAGS="$(CCASFLAGS) $${flags}" \
501
                                FCFLAGS="$(FCFLAGS) $${flags}" \
502
                                FFLAGS="$(FFLAGS) $${flags}" \
503
                                ADAFLAGS="$(ADAFLAGS) $${flags}" \
504
                                prefix="$(prefix)" \
505
                                exec_prefix="$(exec_prefix)" \
506
                                GCJFLAGS="$(GCJFLAGS) $${flags}" \
507
                                GOCFLAGS="$(GOCFLAGS) $${flags}" \
508
                                CXXFLAGS="$(CXXFLAGS) $${flags}" \
509
                                LIBCFLAGS="$(LIBCFLAGS) $${flags}" \
510
                                LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \
511
                                LDFLAGS="$(LDFLAGS) $${flags}" \
512
                                MULTIFLAGS="$${flags}" \
513
                                DESTDIR="$(DESTDIR)" \
514
                                INSTALL="$(INSTALL)" \
515
                                INSTALL_DATA="$(INSTALL_DATA)" \
516
                                INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \
517
                                INSTALL_SCRIPT="$(INSTALL_SCRIPT)" \
518
                                $(DO)); then \
519
                  true; \
520
                else \
521
                  exit 1; \
522
                fi; \
523
              else true; \
524
              fi; \
525
            fi; \
526
          done; \
527
        fi
528
 
529
# FIXME: There should be an @-sign in front of the `if'.
530
# Leave out until this is tested a bit more.
531
multi-clean:
532
        if [ -z "$(MULTIDIRS)" ]; then \
533
          true; \
534
        else \
535
          lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \
536
          for dir in : $(MULTIDIRS); do \
537
            test $$dir != : || continue; \
538
EOF
539
cat >>Multi.tem <
540
            if [ -f ../\$\${dir}/\$\${lib}/${Makefile} ]; then \\
541
EOF
542
cat >>Multi.tem <<\EOF
543
              if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \
544
              then true; \
545
              else exit 1; \
546
              fi; \
547
            else true; \
548
            fi; \
549
          done; \
550
        fi
551
EOF
552
 
553
cat ${Makefile} Multi.tem > Makefile.tem
554
rm -f ${Makefile} Multi.tem
555
mv Makefile.tem ${Makefile}
556
 
557
fi # ${ml_toplevel_p} = yes
558
 
559
if [ "${ml_verbose}" = --verbose ]; then
560
  echo "Adding multilib support to ${Makefile} in ${ml_realsrcdir}"
561
  if [ "${ml_toplevel_p}" = yes ]; then
562
    echo "multidirs=${multidirs}"
563
  fi
564
  echo "with_multisubdir=${with_multisubdir}"
565
fi
566
 
567
if [ "${srcdir}" = "." ]; then
568
  if [ "${with_target_subdir}" != "." ]; then
569
    ml_srcdotdot="../"
570
  else
571
    ml_srcdotdot=""
572
  fi
573
else
574
  ml_srcdotdot=""
575
fi
576
 
577
if [ -z "${with_multisubdir}" ]; then
578
  ml_subdir=
579
  ml_builddotdot=
580
  : # ml_srcdotdot= # already set
581
else
582
  ml_subdir="/${with_multisubdir}"
583
  # The '[^/][^/]*' appears that way to work around a SunOS sed bug.
584
  ml_builddotdot=`echo ${with_multisubdir} | sed -e 's:[^/][^/]*:..:g'`/
585
  if [ "$srcdir" = "." ]; then
586
    ml_srcdotdot=${ml_srcdotdot}${ml_builddotdot}
587
  else
588
    : # ml_srcdotdot= # already set
589
  fi
590
fi
591
 
592
if [ "${ml_toplevel_p}" = yes ]; then
593
  ml_do='$(MAKE)'
594
  ml_clean='$(MAKE)'
595
else
596
  ml_do=true
597
  ml_clean=true
598
fi
599
 
600
# TOP is used by newlib and should not be used elsewhere for this purpose.
601
# MULTI{SRC,BUILD}TOP are the proper ones to use.  MULTISRCTOP is empty
602
# when srcdir != builddir.  MULTIBUILDTOP is always some number of ../'s.
603
# FIXME: newlib needs to be updated to use MULTI{SRC,BUILD}TOP so we can
604
# delete TOP.  Newlib may wish to continue to use TOP for its own purposes
605
# of course.
606
# MULTIDIRS is non-empty for the cpu top level Makefile (eg: newlib/Makefile)
607
# and lists the subdirectories to recurse into.
608
# MULTISUBDIR is non-empty in each cpu subdirectory's Makefile
609
# (eg: newlib/h8300h/Makefile) and is the installed subdirectory name with
610
# a leading '/'.
611
# MULTIDO is used for targets like all, install, and check where
612
# $(FLAGS_TO_PASS) augmented with the subdir's compiler option is needed.
613
# MULTICLEAN is used for the *clean targets.
614
#
615
# ??? It is possible to merge MULTIDO and MULTICLEAN into one.  They are
616
# currently kept separate because we don't want the *clean targets to require
617
# the existence of the compiler (which MULTIDO currently requires) and
618
# therefore we'd have to record the directory options as well as names
619
# (currently we just record the names and use --print-multi-lib to get the
620
# options).
621
 
622
sed -e "s:^TOP[         ]*=[    ]*\([./]*\)[    ]*$:TOP = ${ml_builddotdot}\1:" \
623
    -e "s:^MULTISRCTOP[         ]*=.*$:MULTISRCTOP = ${ml_srcdotdot}:" \
624
    -e "s:^MULTIBUILDTOP[       ]*=.*$:MULTIBUILDTOP = ${ml_builddotdot}:" \
625
    -e "s:^MULTIDIRS[   ]*=.*$:MULTIDIRS = ${multidirs}:" \
626
    -e "s:^MULTISUBDIR[         ]*=.*$:MULTISUBDIR = ${ml_subdir}:" \
627
    -e "s:^MULTIDO[     ]*=.*$:MULTIDO = $ml_do:" \
628
    -e "s:^MULTICLEAN[  ]*=.*$:MULTICLEAN = $ml_clean:" \
629
        ${Makefile} > Makefile.tem
630
rm -f ${Makefile}
631
mv Makefile.tem ${Makefile}
632
 
633
# If this is the library's top level, configure each multilib subdir.
634
# This is done at the end because this is the loop that runs configure
635
# in each multilib subdir and it seemed reasonable to finish updating the
636
# Makefile before going on to configure the subdirs.
637
 
638
if [ "${ml_toplevel_p}" = yes ]; then
639
 
640
# We must freshly configure each subdirectory.  This bit of code is
641
# actually partially stolen from the main configure script.  FIXME.
642
 
643
if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then
644
 
645
  if [ "${ml_verbose}" = --verbose ]; then
646
    echo "Running configure in multilib subdirs ${multidirs}"
647
    echo "pwd: `${PWDCMD-pwd}`"
648
  fi
649
 
650
  ml_origdir=`${PWDCMD-pwd}`
651
  ml_libdir=`echo "$ml_origdir" | sed -e 's,^.*/,,'`
652
  # cd to top-level-build-dir/${with_target_subdir}
653
  cd ..
654
 
655
  for ml_dir in ${multidirs}; do
656
 
657
    if [ "${ml_verbose}" = --verbose ]; then
658
      echo "Running configure in multilib subdir ${ml_dir}"
659
      echo "pwd: `${PWDCMD-pwd}`"
660
    fi
661
 
662
    if [ -d ${ml_dir} ]; then true; else
663
      # ``mkdir -p ${ml_dir}'' See also mkinstalldirs.
664
      pathcomp=""
665
      for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do
666
        pathcomp="$pathcomp$d"
667
        case "$pathcomp" in
668
          -* ) pathcomp=./$pathcomp ;;
669
        esac
670
        if test ! -d "$pathcomp"; then
671
           echo "mkdir $pathcomp" 1>&2
672
           mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
673
        fi
674
        if test ! -d "$pathcomp"; then
675
           exit $lasterr
676
        fi
677
        pathcomp="$pathcomp/"
678
      done
679
    fi
680
    if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi
681
 
682
    # Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../
683
    dotdot=../`echo ${ml_dir} | sed -e 's|[^/]||g' -e 's|/|../|g'`
684
 
685
    case ${srcdir} in
686
    ".")
687
      echo "Building symlink tree in `${PWDCMD-pwd}`/${ml_dir}/${ml_libdir}"
688
      if [ "${with_target_subdir}" != "." ]; then
689
        ml_unsubdir="../"
690
      else
691
        ml_unsubdir=""
692
      fi
693
      (cd ${ml_dir}/${ml_libdir};
694
       ../${dotdot}${ml_unsubdir}symlink-tree ../${dotdot}${ml_unsubdir}${ml_libdir} "")
695
      if [ -f ${ml_dir}/${ml_libdir}/${Makefile} ]; then
696
        if [ x"${MAKE}" = x ]; then
697
          (cd ${ml_dir}/${ml_libdir}; make distclean)
698
        else
699
          (cd ${ml_dir}/${ml_libdir}; ${MAKE} distclean)
700
        fi
701
      fi
702
      ml_newsrcdir="."
703
      ml_srcdiroption=
704
      multisrctop=${dotdot}
705
      ;;
706
    *)
707
      case "${srcdir}" in
708
      /* | [A-Za-z]:[\\/]* ) # absolute path
709
        ml_newsrcdir=${srcdir}
710
        ;;
711
      *) # otherwise relative
712
        ml_newsrcdir=${dotdot}${srcdir}
713
        ;;
714
      esac
715
      ml_srcdiroption="-srcdir=${ml_newsrcdir}"
716
      multisrctop=
717
      ;;
718
    esac
719
 
720
    case "${progname}" in
721
    /* | [A-Za-z]:[\\/]* )     ml_recprog=${progname} ;;
722
    *)      ml_recprog=${dotdot}${progname} ;;
723
    esac
724
 
725
    # FIXME: POPDIR=${PWD=`pwd`} doesn't work here.
726
    ML_POPDIR=`${PWDCMD-pwd}`
727
    cd ${ml_dir}/${ml_libdir}
728
 
729
    if [ -f ${ml_newsrcdir}/configure ]; then
730
      ml_recprog="${ml_newsrcdir}/configure"
731
    fi
732
 
733
    # find compiler flag corresponding to ${ml_dir}
734
    for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
735
      dir=`echo $i | sed -e 's/;.*$//'`
736
      if [ "${dir}" = "${ml_dir}" ]; then
737
        flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
738
        break
739
      fi
740
    done
741
    ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" F77="${F77_}$flags" GCJ="${GCJ_}$flags" GFORTRAN="${GFORTRAN_}$flags" GOC="${GOC_}$flags"'
742
 
743
    if [ "${with_target_subdir}" = "." ]; then
744
        CC_=$CC' '
745
        CXX_=$CXX' '
746
        F77_=$F77' '
747
        GCJ_=$GCJ' '
748
        GFORTRAN_=$GFORTRAN' '
749
        GOC_=$GOC' '
750
    else
751
        # Create a regular expression that matches any string as long
752
        # as ML_POPDIR.
753
        popdir_rx=`echo "${ML_POPDIR}" | sed 's,.,.,g'`
754
        CC_=
755
        for arg in ${CC}; do
756
          case $arg in
757
          -[BIL]"${ML_POPDIR}"/*)
758
            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"`' ' ;;
759
          "${ML_POPDIR}"/*)
760
            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"`' ' ;;
761
          *)
762
            CC_="${CC_}${arg} " ;;
763
          esac
764
        done
765
 
766
        CXX_=
767
        for arg in ${CXX}; do
768
          case $arg in
769
          -[BIL]"${ML_POPDIR}"/*)
770
            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"`' ' ;;
771
          "${ML_POPDIR}"/*)
772
            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"`' ' ;;
773
          *)
774
            CXX_="${CXX_}${arg} " ;;
775
          esac
776
        done
777
 
778
        F77_=
779
        for arg in ${F77}; do
780
          case $arg in
781
          -[BIL]"${ML_POPDIR}"/*)
782
            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"`' ' ;;
783
          "${ML_POPDIR}"/*)
784
            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"`' ' ;;
785
          *)
786
            F77_="${F77_}${arg} " ;;
787
          esac
788
        done
789
 
790
        GCJ_=
791
        for arg in ${GCJ}; do
792
          case $arg in
793
          -[BIL]"${ML_POPDIR}"/*)
794
            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"`' ' ;;
795
          "${ML_POPDIR}"/*)
796
            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"`' ' ;;
797
          *)
798
            GCJ_="${GCJ_}${arg} " ;;
799
          esac
800
        done
801
 
802
        GFORTRAN_=
803
        for arg in ${GFORTRAN}; do
804
          case $arg in
805
          -[BIL]"${ML_POPDIR}"/*)
806
            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"`' ' ;;
807
          "${ML_POPDIR}"/*)
808
            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"`' ' ;;
809
          *)
810
            GFORTRAN_="${GFORTRAN_}${arg} " ;;
811
          esac
812
        done
813
 
814
        GOC_=
815
        for arg in ${GOC}; do
816
          case $arg in
817
          -[BIL]"${ML_POPDIR}"/*)
818
            GOC_="${GOC_}"`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"`' ' ;;
819
          "${ML_POPDIR}"/*)
820
            GOC_="${GOC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;;
821
          *)
822
            GOC_="${GOC_}${arg} " ;;
823
          esac
824
        done
825
 
826
        if test "x${LD_LIBRARY_PATH+set}" = xset; then
827
          LD_LIBRARY_PATH_=
828
          for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do
829
            case "$arg" in
830
            "${ML_POPDIR}"/*)
831
              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"`
832
              ;;
833
            esac
834
            if test "x$LD_LIBRARY_PATH_" != x; then
835
              LD_LIBRARY_PATH_=$LD_LIBRARY_PATH_:$arg
836
            else
837
              LD_LIBRARY_PATH_=$arg
838
            fi
839
          done
840
          ml_config_env="$ml_config_env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_"
841
        fi
842
 
843
        if test "x${SHLIB_PATH+set}" = xset; then
844
          SHLIB_PATH_=
845
          for arg in `echo "$SHLIB_PATH" | tr ':' ' '`; do
846
            case "$arg" in
847
            "${ML_POPDIR}"/*)
848
              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"`
849
              ;;
850
            esac
851
            if test "x$SHLIB_PATH_" != x; then
852
              SHLIB_PATH_=$SHLIB_PATH_:$arg
853
            else
854
              SHLIB_PATH_=$arg
855
            fi
856
          done
857
          ml_config_env="$ml_config_env SHLIB_PATH=$SHLIB_PATH_"
858
        fi
859
    fi
860
 
861
    if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
862
        --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
863
        ${ac_configure_args} ${ml_config_env} ${ml_srcdiroption} ; then
864
      true
865
    else
866
      exit 1
867
    fi
868
 
869
    cd "${ML_POPDIR}"
870
 
871
  done
872
 
873
  cd "${ml_origdir}"
874
fi
875
 
876
fi # ${ml_toplevel_p} = yes
877
fi # ${enable_multilib} = yes

powered by: WebSVN 2.1.0

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