~ubuntu-branches/ubuntu/quantal/buffy/quantal

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-12-04 20:20:33 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051204202033-cl5rsf6jo9fzght2
Tags: 0.11-1build1
rebuild for libsigc++, libgtkmm, libxml++

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# ltmain.sh - Provide generalized library-building support services.
2
2
# NOTE: Changing this file will not affect anything until you rerun configure.
3
3
#
4
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
 
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
5
5
# Free Software Foundation, Inc.
6
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
7
#
17
17
#
18
18
# You should have received a copy of the GNU General Public License
19
19
# along with this program; if not, write to the Free Software
20
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
21
#
22
22
# As a special exception to the GNU General Public License, if you
23
23
# distribute this file as part of a program that contains a
43
43
 
44
44
PROGRAM=ltmain.sh
45
45
PACKAGE=libtool
46
 
VERSION=1.5.6
47
 
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 220 $"
 
46
VERSION="1.5.20 Debian 1.5.20-2"
 
47
TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
48
48
 
 
49
# See if we are running on zsh, and set the options which allow our
 
50
# commands through without removal of \ escapes.
 
51
if test -n "${ZSH_VERSION+set}" ; then
 
52
  setopt NO_GLOB_SUBST
 
53
fi
49
54
 
50
55
# Check that we have a working $echo.
51
56
if test "X$1" = X--no-reexec; then
83
88
Xsed="${SED}"' -e 1s/^X//'
84
89
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
85
90
# test EBCDIC or ASCII
86
 
case `echo A|tr A '\301'` in
87
 
 A) # EBCDIC based system
88
 
  SP2NL="tr '\100' '\n'"
89
 
  NL2SP="tr '\r\n' '\100\100'"
 
91
case `echo X|tr X '\101'` in
 
92
 A) # ASCII based system
 
93
    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
 
94
  SP2NL='tr \040 \012'
 
95
  NL2SP='tr \015\012 \040\040'
90
96
  ;;
91
 
 *) # Assume ASCII based system
92
 
  SP2NL="tr '\040' '\012'"
93
 
  NL2SP="tr '\015\012' '\040\040'"
 
97
 *) # EBCDIC based system
 
98
  SP2NL='tr \100 \n'
 
99
  NL2SP='tr \r\n \100\100'
94
100
  ;;
95
101
esac
96
102
 
107
113
fi
108
114
 
109
115
# Make sure IFS has a sensible default
110
 
: ${IFS="       
111
 
"}
 
116
lt_nl='
 
117
'
 
118
IFS="   $lt_nl"
112
119
 
113
120
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
114
121
  $echo "$modename: not configured to build any kind of library" 1>&2
138
145
# Need a lot of goo to handle *both* DLLs and import libs
139
146
# Has to be a shell function in order to 'eat' the argument
140
147
# that is supplied when $file_magic_command is called.
141
 
func_win32_libid () {
 
148
func_win32_libid ()
 
149
{
142
150
  win32_libid_type="unknown"
143
151
  win32_fileres=`file -L $1 2>/dev/null`
144
152
  case $win32_fileres in
178
186
# Only attempt this if the compiler in the base compile
179
187
# command doesn't match the default compiler.
180
188
# arg is usually of the form 'gcc ...'
181
 
func_infer_tag () {
 
189
func_infer_tag ()
 
190
{
182
191
    if test -n "$available_tags" && test -z "$tagname"; then
183
192
      CC_quoted=
184
193
      for arg in $CC; do
235
244
      esac
236
245
    fi
237
246
}
 
247
 
 
248
 
 
249
# func_extract_an_archive dir oldlib
 
250
func_extract_an_archive ()
 
251
{
 
252
    f_ex_an_ar_dir="$1"; shift
 
253
    f_ex_an_ar_oldlib="$1"
 
254
 
 
255
    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
 
256
    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
 
257
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
 
258
     :
 
259
    else
 
260
      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
 
261
      exit $EXIT_FAILURE
 
262
    fi
 
263
}
 
264
 
 
265
# func_extract_archives gentop oldlib ...
 
266
func_extract_archives ()
 
267
{
 
268
    my_gentop="$1"; shift
 
269
    my_oldlibs=${1+"$@"}
 
270
    my_oldobjs=""
 
271
    my_xlib=""
 
272
    my_xabs=""
 
273
    my_xdir=""
 
274
    my_status=""
 
275
 
 
276
    $show "${rm}r $my_gentop"
 
277
    $run ${rm}r "$my_gentop"
 
278
    $show "$mkdir $my_gentop"
 
279
    $run $mkdir "$my_gentop"
 
280
    my_status=$?
 
281
    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
 
282
      exit $my_status
 
283
    fi
 
284
 
 
285
    for my_xlib in $my_oldlibs; do
 
286
      # Extract the objects.
 
287
      case $my_xlib in
 
288
        [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
 
289
        *) my_xabs=`pwd`"/$my_xlib" ;;
 
290
      esac
 
291
      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
 
292
      my_xdir="$my_gentop/$my_xlib"
 
293
 
 
294
      $show "${rm}r $my_xdir"
 
295
      $run ${rm}r "$my_xdir"
 
296
      $show "$mkdir $my_xdir"
 
297
      $run $mkdir "$my_xdir"
 
298
      status=$?
 
299
      if test "$status" -ne 0 && test ! -d "$my_xdir"; then
 
300
        exit $status
 
301
      fi
 
302
      case $host in
 
303
      *-darwin*)
 
304
        $show "Extracting $my_xabs"
 
305
        # Do not bother doing anything if just a dry run
 
306
        if test -z "$run"; then
 
307
          darwin_orig_dir=`pwd`
 
308
          cd $my_xdir || exit $?
 
309
          darwin_archive=$my_xabs
 
310
          darwin_curdir=`pwd`
 
311
          darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
 
312
          darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
 
313
          if test -n "$darwin_arches"; then 
 
314
            darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
 
315
            darwin_arch=
 
316
            $show "$darwin_base_archive has multiple architectures $darwin_arches"
 
317
            for darwin_arch in  $darwin_arches ; do
 
318
              mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
 
319
              lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
 
320
              cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
 
321
              func_extract_an_archive "`pwd`" "${darwin_base_archive}"
 
322
              cd "$darwin_curdir"
 
323
              $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
 
324
            done # $darwin_arches
 
325
      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
 
326
            darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
 
327
            darwin_file=
 
328
            darwin_files=
 
329
            for darwin_file in $darwin_filelist; do
 
330
              darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
 
331
              lipo -create -output "$darwin_file" $darwin_files
 
332
            done # $darwin_filelist
 
333
            ${rm}r unfat-$$
 
334
            cd "$darwin_orig_dir"
 
335
          else
 
336
            cd "$darwin_orig_dir"
 
337
            func_extract_an_archive "$my_xdir" "$my_xabs"
 
338
          fi # $darwin_arches
 
339
        fi # $run
 
340
        ;;
 
341
      *)
 
342
        func_extract_an_archive "$my_xdir" "$my_xabs"
 
343
        ;;
 
344
      esac
 
345
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
 
346
    done
 
347
    func_extract_archives_result="$my_oldobjs"
 
348
}
238
349
# End of Shell function definitions
239
350
#####################################
240
351
 
305
416
  --version)
306
417
    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
307
418
    $echo
308
 
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
 
419
    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
309
420
    $echo "This is free software; see the source for copying conditions.  There is NO"
310
421
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
311
 
    exit $EXIT_SUCCESS
 
422
    exit $?
312
423
    ;;
313
424
 
314
425
  --config)
317
428
    for tagname in $taglist; do
318
429
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
319
430
    done
320
 
    exit $EXIT_SUCCESS
 
431
    exit $?
321
432
    ;;
322
433
 
323
434
  --debug)
342
453
    else
343
454
      $echo "disable static libraries"
344
455
    fi
345
 
    exit $EXIT_SUCCESS
 
456
    exit $?
346
457
    ;;
347
458
 
348
459
  --finish) mode="finish" ;;
399
510
  # Infer the operation mode.
400
511
  if test -z "$mode"; then
401
512
    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
402
 
    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
 
513
    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
403
514
    case $nonopt in
404
515
    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
405
516
      mode=link
465
576
 
466
577
    for arg
467
578
    do
468
 
      case "$arg_mode" in
 
579
      case $arg_mode in
469
580
      arg  )
470
581
        # do not "continue".  Instead, add this to base_compile
471
582
        lastarg="$arg"
547
658
      case $lastarg in
548
659
      # Double-quote args containing other shell metacharacters.
549
660
      # Many Bourne shells cannot handle close brackets correctly
550
 
      # in scan sets, so we specify it separately.
 
661
      # in scan sets, and some SunOS ksh mistreat backslash-escaping
 
662
      # in scan sets (worked around with variable expansion),
 
663
      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
 
664
      # at all, so we specify them separately.
551
665
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
552
666
        lastarg="\"$lastarg\""
553
667
        ;;
621
735
      esac
622
736
    done
623
737
 
 
738
    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
 
739
    case $qlibobj in
 
740
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
741
        qlibobj="\"$qlibobj\"" ;;
 
742
    esac
 
743
    test "X$libobj" != "X$qlibobj" \
 
744
        && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"'  &()|`$[]' \
 
745
        && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
624
746
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
625
747
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
626
748
    if test "X$xdir" = "X$obj"; then
693
815
        $run $rm $removelist
694
816
        exit $EXIT_FAILURE
695
817
      fi
696
 
      $echo $srcfile > "$lockfile"
 
818
      $echo "$srcfile" > "$lockfile"
697
819
    fi
698
820
 
699
821
    if test -n "$fix_srcfile_path"; then
700
822
      eval srcfile=\"$fix_srcfile_path\"
701
823
    fi
 
824
    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
 
825
    case $qsrcfile in
 
826
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
827
      qsrcfile="\"$qsrcfile\"" ;;
 
828
    esac
702
829
 
703
830
    $run $rm "$libobj" "${libobj}T"
704
831
 
720
847
      fbsd_hideous_sh_bug=$base_compile
721
848
 
722
849
      if test "$pic_mode" != no; then
723
 
        command="$base_compile $srcfile $pic_flag"
 
850
        command="$base_compile $qsrcfile $pic_flag"
724
851
      else
725
852
        # Don't build PIC code
726
 
        command="$base_compile $srcfile"
 
853
        command="$base_compile $qsrcfile"
727
854
      fi
728
855
 
729
856
      if test ! -d "${xdir}$objdir"; then
803
930
    if test "$build_old_libs" = yes; then
804
931
      if test "$pic_mode" != yes; then
805
932
        # Don't build PIC code
806
 
        command="$base_compile $srcfile"
 
933
        command="$base_compile $qsrcfile"
807
934
      else
808
 
        command="$base_compile $srcfile $pic_flag"
 
935
        command="$base_compile $qsrcfile $pic_flag"
809
936
      fi
810
937
      if test "$compiler_c_o" = yes; then
811
938
        command="$command -o $obj"
1227
1354
          prev=
1228
1355
          continue
1229
1356
          ;;
 
1357
        darwin_framework)
 
1358
          compiler_flags="$compiler_flags $arg"
 
1359
          compile_command="$compile_command $arg"
 
1360
          finalize_command="$finalize_command $arg"
 
1361
          prev=
 
1362
          continue
 
1363
          ;;
1230
1364
        *)
1231
1365
          eval "$prev=\"\$arg\""
1232
1366
          prev=
1285
1419
        continue
1286
1420
        ;;
1287
1421
 
 
1422
      -framework|-arch)
 
1423
        prev=darwin_framework
 
1424
        compiler_flags="$compiler_flags $arg"
 
1425
        compile_command="$compile_command $arg"
 
1426
        finalize_command="$finalize_command $arg"
 
1427
        continue
 
1428
        ;;
 
1429
 
1288
1430
      -inst-prefix-dir)
1289
1431
        prev=inst_prefix
1290
1432
        continue
1345
1487
            # These systems don't actually have a C library (as such)
1346
1488
            test "X$arg" = "X-lc" && continue
1347
1489
            ;;
1348
 
          *-*-openbsd* | *-*-freebsd*)
 
1490
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1349
1491
            # Do not include libc due to us having libc/libc_r.
1350
1492
            test "X$arg" = "X-lc" && continue
1351
1493
            ;;
1356
1498
          esac
1357
1499
        elif test "X$arg" = "X-lc_r"; then
1358
1500
         case $host in
1359
 
         *-*-openbsd* | *-*-freebsd*)
 
1501
         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1360
1502
           # Do not include libc_r directly, use -pthread flag.
1361
1503
           continue
1362
1504
           ;;
1366
1508
        continue
1367
1509
        ;;
1368
1510
 
 
1511
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
 
1512
      # classes, name mangling, and exception handling.
 
1513
      -model)
 
1514
        compile_command="$compile_command $arg"
 
1515
        compiler_flags="$compiler_flags $arg"
 
1516
        finalize_command="$finalize_command $arg"
 
1517
        prev=xcompiler
 
1518
        continue
 
1519
        ;;
 
1520
 
1369
1521
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1370
 
        deplibs="$deplibs $arg"
 
1522
        compiler_flags="$compiler_flags $arg"
 
1523
        compile_command="$compile_command $arg"
 
1524
        finalize_command="$finalize_command $arg"
1371
1525
        continue
1372
1526
        ;;
1373
1527
 
1376
1530
        continue
1377
1531
        ;;
1378
1532
 
1379
 
      # gcc -m* arguments should be passed to the linker via $compiler_flags
1380
 
      # in order to pass architecture information to the linker
1381
 
      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
1382
 
      # but this is not reliable with gcc because gcc may use -mfoo to
1383
 
      # select a different linker, different libraries, etc, while
1384
 
      # -Wl,-mfoo simply passes -mfoo to the linker.
1385
 
      -m*)
 
1533
      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
 
1534
      # -r[0-9][0-9]* specifies the processor on the SGI compiler
 
1535
      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
 
1536
      # +DA*, +DD* enable 64-bit mode on the HP compiler
 
1537
      # -q* pass through compiler args for the IBM compiler
 
1538
      # -m* pass through architecture-specific compiler args for GCC
 
1539
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*)
 
1540
 
1386
1541
        # Unknown arguments in both finalize_command and compile_command need
1387
1542
        # to be aesthetically quoted because they are evaled later.
1388
1543
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1858
2013
            compile_deplibs="$deplib $compile_deplibs"
1859
2014
            finalize_deplibs="$deplib $finalize_deplibs"
1860
2015
          else
1861
 
            deplibs="$deplib $deplibs"
 
2016
            compiler_flags="$compiler_flags $deplib"
1862
2017
          fi
1863
2018
          continue
1864
2019
          ;;
1977
2132
          fi
1978
2133
          case $linkmode in
1979
2134
          lib)
1980
 
            if test "$deplibs_check_method" != pass_all; then
 
2135
            valid_a_lib=no
 
2136
            case $deplibs_check_method in
 
2137
              match_pattern*)
 
2138
                set dummy $deplibs_check_method
 
2139
                match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
 
2140
                if eval $echo \"$deplib\" 2>/dev/null \
 
2141
                    | $SED 10q \
 
2142
                    | $EGREP "$match_pattern_regex" > /dev/null; then
 
2143
                  valid_a_lib=yes
 
2144
                fi
 
2145
                ;;
 
2146
              pass_all)
 
2147
                valid_a_lib=yes
 
2148
                ;;
 
2149
            esac
 
2150
            if test "$valid_a_lib" != yes; then
1981
2151
              $echo
1982
2152
              $echo "*** Warning: Trying to link with static lib archive $deplib."
1983
2153
              $echo "*** I have the capability to make that library automatically link in when"
2051
2221
        # it will not redefine variables installed, or shouldnotlink
2052
2222
        installed=yes
2053
2223
        shouldnotlink=no
 
2224
        avoidtemprpath=
 
2225
 
2054
2226
 
2055
2227
        # Read the .la file
2056
2228
        case $lib in
2149
2321
            dir="$libdir"
2150
2322
            absdir="$libdir"
2151
2323
          fi
 
2324
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2152
2325
        else
2153
 
          dir="$ladir/$objdir"
2154
 
          absdir="$abs_ladir/$objdir"
2155
 
          # Remove this search path later
2156
 
          notinst_path="$notinst_path $abs_ladir"
 
2326
          if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 
2327
            dir="$ladir"
 
2328
            absdir="$abs_ladir"
 
2329
            # Remove this search path later
 
2330
            notinst_path="$notinst_path $abs_ladir"
 
2331
          else
 
2332
            dir="$ladir/$objdir"
 
2333
            absdir="$abs_ladir/$objdir"
 
2334
            # Remove this search path later
 
2335
            notinst_path="$notinst_path $abs_ladir"
 
2336
          fi
2157
2337
        fi # $installed = yes
2158
2338
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2159
2339
 
2226
2406
          if test -n "$library_names" &&
2227
2407
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2228
2408
            # We need to hardcode the library path
2229
 
            if test -n "$shlibpath_var"; then
 
2409
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2230
2410
              # Make sure the rpath contains only unique directories.
2231
2411
              case "$temp_rpath " in
2232
2412
              *" $dir "*) ;;
2233
2413
              *" $absdir "*) ;;
2234
 
              *) temp_rpath="$temp_rpath $dir" ;;
 
2414
              *) temp_rpath="$temp_rpath $absdir" ;;
2235
2415
              esac
2236
2416
            fi
2237
2417
 
2417
2597
                add_dir="-L$dir"
2418
2598
                # Try looking first in the location we're being installed to.
2419
2599
                if test -n "$inst_prefix_dir"; then
2420
 
                  case "$libdir" in
 
2600
                  case $libdir in
2421
2601
                    [\\/]*)
2422
2602
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
2423
2603
                      ;;
2490
2670
              add_dir="-L$libdir"
2491
2671
              # Try looking first in the location we're being installed to.
2492
2672
              if test -n "$inst_prefix_dir"; then
2493
 
                case "$libdir" in
 
2673
                case $libdir in
2494
2674
                  [\\/]*)
2495
2675
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
2496
2676
                    ;;
2551
2731
              fi
2552
2732
            fi
2553
2733
          else
2554
 
            convenience="$convenience $dir/$old_library"
2555
 
            old_convenience="$old_convenience $dir/$old_library"
2556
2734
            deplibs="$dir/$old_library $deplibs"
2557
2735
            link_static=yes
2558
2736
          fi
2670
2848
              *) continue ;;
2671
2849
              esac
2672
2850
              case " $deplibs " in
 
2851
              *" $path "*) ;;
 
2852
              *) deplibs="$path $deplibs" ;;
 
2853
              esac
 
2854
              case " $deplibs " in
2673
2855
              *" $depdepl "*) ;;
2674
2856
              *) deplibs="$depdepl $deplibs" ;;
2675
2857
              esac
2676
 
              case " $deplibs " in
2677
 
              *" $path "*) ;;
2678
 
              *) deplibs="$deplibs $path" ;;
2679
 
              esac
2680
2858
            done
2681
2859
          fi # link_all_deplibs != no
2682
2860
        fi # linkmode = lib
2945
3123
 
2946
3124
        # Check that each of the things are valid numbers.
2947
3125
        case $current in
2948
 
        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
 
3126
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2949
3127
        *)
2950
 
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
 
3128
          $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2951
3129
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2952
3130
          exit $EXIT_FAILURE
2953
3131
          ;;
2954
3132
        esac
2955
3133
 
2956
3134
        case $revision in
2957
 
        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
 
3135
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2958
3136
        *)
2959
 
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
 
3137
          $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2960
3138
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2961
3139
          exit $EXIT_FAILURE
2962
3140
          ;;
2963
3141
        esac
2964
3142
 
2965
3143
        case $age in
2966
 
        0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
 
3144
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2967
3145
        *)
2968
 
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
 
3146
          $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2969
3147
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2970
3148
          exit $EXIT_FAILURE
2971
3149
          ;;
2991
3169
          versuffix="$major.$age.$revision"
2992
3170
          # Darwin ld doesn't like 0 for these options...
2993
3171
          minor_current=`expr $current + 1`
2994
 
          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
 
3172
          verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
2995
3173
          ;;
2996
3174
 
2997
3175
        freebsd-aout)
3197
3375
          *-*-netbsd*)
3198
3376
            # Don't link with libc until the a.out ld.so is fixed.
3199
3377
            ;;
3200
 
          *-*-openbsd* | *-*-freebsd*)
 
3378
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3201
3379
            # Do not include libc due to us having libc/libc_r.
3202
3380
            test "X$arg" = "X-lc" && continue
3203
3381
            ;;
3247
3425
          if test "$?" -eq 0 ; then
3248
3426
            ldd_output=`ldd conftest`
3249
3427
            for i in $deplibs; do
3250
 
              name="`expr $i : '-l\(.*\)'`"
 
3428
              name=`expr $i : '-l\(.*\)'`
3251
3429
              # If $name is empty we are operating on a -L argument.
3252
3430
              if test "$name" != "" && test "$name" -ne "0"; then
3253
3431
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3284
3462
            # Error occurred in the first compile.  Let's try to salvage
3285
3463
            # the situation: Compile a separate program for each library.
3286
3464
            for i in $deplibs; do
3287
 
              name="`expr $i : '-l\(.*\)'`"
 
3465
              name=`expr $i : '-l\(.*\)'`
3288
3466
              # If $name is empty we are operating on a -L argument.
3289
3467
              if test "$name" != "" && test "$name" != "0"; then
3290
3468
                $rm conftest
3336
3514
          set dummy $deplibs_check_method
3337
3515
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3338
3516
          for a_deplib in $deplibs; do
3339
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3517
            name=`expr $a_deplib : '-l\(.*\)'`
3340
3518
            # If $name is empty we are operating on a -L argument.
3341
3519
            if test "$name" != "" && test  "$name" != "0"; then
3342
3520
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3405
3583
          set dummy $deplibs_check_method
3406
3584
          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3407
3585
          for a_deplib in $deplibs; do
3408
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3586
            name=`expr $a_deplib : '-l\(.*\)'`
3409
3587
            # If $name is empty we are operating on a -L argument.
3410
3588
            if test -n "$name" && test "$name" != "0"; then
3411
3589
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3646
3824
                # The command line is too long to execute in one step.
3647
3825
                $show "using reloadable object file for export list..."
3648
3826
                skipped_export=:
 
3827
                # Break out early, otherwise skipped_export may be
 
3828
                # set to false by a later but shorter cmd.
 
3829
                break
3649
3830
              fi
3650
3831
            done
3651
3832
            IFS="$save_ifs"
3679
3860
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3680
3861
          else
3681
3862
            gentop="$output_objdir/${outputname}x"
3682
 
            $show "${rm}r $gentop"
3683
 
            $run ${rm}r "$gentop"
3684
 
            $show "$mkdir $gentop"
3685
 
            $run $mkdir "$gentop"
3686
 
            status=$?
3687
 
            if test "$status" -ne 0 && test ! -d "$gentop"; then
3688
 
              exit $status
3689
 
            fi
3690
3863
            generated="$generated $gentop"
3691
3864
 
3692
 
            for xlib in $convenience; do
3693
 
              # Extract the objects.
3694
 
              case $xlib in
3695
 
              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3696
 
              *) xabs=`pwd`"/$xlib" ;;
3697
 
              esac
3698
 
              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3699
 
              xdir="$gentop/$xlib"
3700
 
 
3701
 
              $show "${rm}r $xdir"
3702
 
              $run ${rm}r "$xdir"
3703
 
              $show "$mkdir $xdir"
3704
 
              $run $mkdir "$xdir"
3705
 
              status=$?
3706
 
              if test "$status" -ne 0 && test ! -d "$xdir"; then
3707
 
                exit $status
3708
 
              fi
3709
 
              # We will extract separately just the conflicting names and we will no
3710
 
              # longer touch any unique names. It is faster to leave these extract
3711
 
              # automatically by $AR in one run.
3712
 
              $show "(cd $xdir && $AR x $xabs)"
3713
 
              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3714
 
              if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3715
 
                :
3716
 
              else
3717
 
                $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3718
 
                $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3719
 
                $AR t "$xabs" | sort | uniq -cd | while read -r count name
3720
 
                do
3721
 
                  i=1
3722
 
                  while test "$i" -le "$count"
3723
 
                  do
3724
 
                   # Put our $i before any first dot (extension)
3725
 
                   # Never overwrite any file
3726
 
                   name_to="$name"
3727
 
                   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3728
 
                   do
3729
 
                     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3730
 
                   done
3731
 
                   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3732
 
                   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3733
 
                   i=`expr $i + 1`
3734
 
                  done
3735
 
                done
3736
 
              fi
3737
 
 
3738
 
              libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3739
 
            done
 
3865
            func_extract_archives $gentop $convenience
 
3866
            libobjs="$libobjs $func_extract_archives_result"
3740
3867
          fi
3741
3868
        fi
3742
 
 
 
3869
        
3743
3870
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3744
3871
          eval flag=\"$thread_safe_flag_spec\"
3745
3872
          linker_flags="$linker_flags $flag"
3769
3896
          fi
3770
3897
        fi
3771
3898
 
3772
 
        if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
 
3899
        if test "X$skipped_export" != "X:" &&
 
3900
           len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3773
3901
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3774
3902
          :
3775
3903
        else
3788
3916
            save_libobjs=$libobjs
3789
3917
          fi
3790
3918
          save_output=$output
 
3919
          output_la=`$echo "X$output" | $Xsed -e "$basename"`
3791
3920
 
3792
3921
          # Clear the reloadable object creation command queue and
3793
3922
          # initialize k to one.
3797
3926
          delfiles=
3798
3927
          last_robj=
3799
3928
          k=1
3800
 
          output=$output_objdir/$save_output-${k}.$objext
 
3929
          output=$output_objdir/$output_la-${k}.$objext
3801
3930
          # Loop over the list of objects to be linked.
3802
3931
          for obj in $save_libobjs
3803
3932
          do
3804
3933
            eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3805
3934
            if test "X$objlist" = X ||
3806
 
               { len=`expr "X$test_cmds" : ".*"` &&
 
3935
               { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3807
3936
                 test "$len" -le "$max_cmd_len"; }; then
3808
3937
              objlist="$objlist $obj"
3809
3938
            else
3817
3946
                # the last one created.
3818
3947
                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3819
3948
              fi
3820
 
              last_robj=$output_objdir/$save_output-${k}.$objext
 
3949
              last_robj=$output_objdir/$output_la-${k}.$objext
3821
3950
              k=`expr $k + 1`
3822
 
              output=$output_objdir/$save_output-${k}.$objext
 
3951
              output=$output_objdir/$output_la-${k}.$objext
3823
3952
              objlist=$obj
3824
3953
              len=1
3825
3954
            fi
3839
3968
            eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3840
3969
          fi
3841
3970
 
3842
 
          # Set up a command to remove the reloadale object files
 
3971
          # Set up a command to remove the reloadable object files
3843
3972
          # after they are used.
3844
3973
          i=0
3845
3974
          while test "$i" -lt "$k"
3846
3975
          do
3847
3976
            i=`expr $i + 1`
3848
 
            delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
 
3977
            delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3849
3978
          done
3850
3979
 
3851
3980
          $echo "creating a temporary reloadable object file: $output"
3893
4022
          IFS="$save_ifs"
3894
4023
          eval cmd=\"$cmd\"
3895
4024
          $show "$cmd"
3896
 
          $run eval "$cmd" || exit $?
 
4025
          $run eval "$cmd" || {
 
4026
            lt_exit=$?
 
4027
 
 
4028
            # Restore the uninstalled library and exit
 
4029
            if test "$mode" = relink; then
 
4030
              $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
 
4031
            fi
 
4032
 
 
4033
            exit $lt_exit
 
4034
          }
3897
4035
        done
3898
4036
        IFS="$save_ifs"
3899
4037
 
3900
4038
        # Restore the uninstalled library and exit
3901
4039
        if test "$mode" = relink; then
3902
4040
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
 
4041
 
 
4042
          if test -n "$convenience"; then
 
4043
            if test -z "$whole_archive_flag_spec"; then
 
4044
              $show "${rm}r $gentop"
 
4045
              $run ${rm}r "$gentop"
 
4046
            fi
 
4047
          fi
 
4048
 
3903
4049
          exit $EXIT_SUCCESS
3904
4050
        fi
3905
4051
 
3977
4123
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3978
4124
        else
3979
4125
          gentop="$output_objdir/${obj}x"
3980
 
          $show "${rm}r $gentop"
3981
 
          $run ${rm}r "$gentop"
3982
 
          $show "$mkdir $gentop"
3983
 
          $run $mkdir "$gentop"
3984
 
          status=$?
3985
 
          if test "$status" -ne 0 && test ! -d "$gentop"; then
3986
 
            exit $status
3987
 
          fi
3988
4126
          generated="$generated $gentop"
3989
4127
 
3990
 
          for xlib in $convenience; do
3991
 
            # Extract the objects.
3992
 
            case $xlib in
3993
 
            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3994
 
            *) xabs=`pwd`"/$xlib" ;;
3995
 
            esac
3996
 
            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3997
 
            xdir="$gentop/$xlib"
3998
 
 
3999
 
            $show "${rm}r $xdir"
4000
 
            $run ${rm}r "$xdir"
4001
 
            $show "$mkdir $xdir"
4002
 
            $run $mkdir "$xdir"
4003
 
            status=$?
4004
 
            if test "$status" -ne 0 && test ! -d "$xdir"; then
4005
 
              exit $status
4006
 
            fi
4007
 
            # We will extract separately just the conflicting names and we will no
4008
 
            # longer touch any unique names. It is faster to leave these extract
4009
 
            # automatically by $AR in one run.
4010
 
            $show "(cd $xdir && $AR x $xabs)"
4011
 
            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4012
 
            if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4013
 
              :
4014
 
            else
4015
 
              $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4016
 
              $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4017
 
              $AR t "$xabs" | sort | uniq -cd | while read -r count name
4018
 
              do
4019
 
                i=1
4020
 
                while test "$i" -le "$count"
4021
 
                do
4022
 
                 # Put our $i before any first dot (extension)
4023
 
                 # Never overwrite any file
4024
 
                 name_to="$name"
4025
 
                 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4026
 
                 do
4027
 
                   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4028
 
                 done
4029
 
                 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4030
 
                 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4031
 
                 i=`expr $i + 1`
4032
 
                done
4033
 
              done
4034
 
            fi
4035
 
 
4036
 
            reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4037
 
          done
 
4128
          func_extract_archives $gentop $convenience
 
4129
          reload_conv_objs="$reload_objs $func_extract_archives_result"
4038
4130
        fi
4039
4131
      fi
4040
4132
 
4296
4388
 
4297
4389
            # Prepare the list of exported symbols
4298
4390
            if test -z "$export_symbols"; then
4299
 
              export_symbols="$output_objdir/$output.exp"
 
4391
              export_symbols="$output_objdir/$outputname.exp"
4300
4392
              $run $rm $export_symbols
4301
 
              $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 
4393
              $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4302
4394
            else
4303
 
              $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4304
 
              $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
 
4395
              $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 
4396
              $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4305
4397
              $run eval 'mv "$nlist"T "$nlist"'
4306
4398
            fi
4307
4399
          fi
4353
4445
#endif
4354
4446
 
4355
4447
/* The mapping between symbol names and symbols. */
 
4448
"
 
4449
 
 
4450
            case $host in
 
4451
            *cygwin* | *mingw* )
 
4452
          $echo >> "$output_objdir/$dlsyms" "\
 
4453
/* DATA imports from DLLs on WIN32 can't be const, because
 
4454
   runtime relocations are performed -- see ld's documentation
 
4455
   on pseudo-relocs */
 
4456
struct {
 
4457
"
 
4458
              ;;
 
4459
            * )
 
4460
          $echo >> "$output_objdir/$dlsyms" "\
4356
4461
const struct {
 
4462
"
 
4463
              ;;
 
4464
            esac
 
4465
 
 
4466
 
 
4467
          $echo >> "$output_objdir/$dlsyms" "\
4357
4468
  const char *name;
4358
4469
  lt_ptr address;
4359
4470
}
4582
4693
        esac
4583
4694
        case $host in
4584
4695
          *cygwin* | *mingw* )
4585
 
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
 
4696
            cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4586
4697
            cwrapper=`$echo ${output}.exe`
4587
4698
            $rm $cwrappersource $cwrapper
4588
4699
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4681
4792
EOF
4682
4793
 
4683
4794
            cat >> $cwrappersource <<"EOF"
 
4795
  return 127;
4684
4796
}
4685
4797
 
4686
4798
void *
4815
4927
 
4816
4928
# The HP-UX ksh and POSIX shell print the target directory to stdout
4817
4929
# if CDPATH is set.
4818
 
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
 
4930
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4819
4931
 
4820
4932
relink_command=\"$relink_command\"
4821
4933
 
4944
5056
        # Backslashes separate directories on plain windows
4945
5057
        *-*-mingw | *-*-os2*)
4946
5058
          $echo >> $output "\
4947
 
      exec \$progdir\\\\\$program \${1+\"\$@\"}
 
5059
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4948
5060
"
4949
5061
          ;;
4950
5062
 
4951
5063
        *)
4952
5064
          $echo >> $output "\
4953
 
      exec \$progdir/\$program \${1+\"\$@\"}
 
5065
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
4954
5066
"
4955
5067
          ;;
4956
5068
        esac
4960
5072
    fi
4961
5073
  else
4962
5074
    # The program doesn't exist.
4963
 
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
 
5075
    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4964
5076
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4965
5077
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4966
5078
    exit $EXIT_FAILURE
4992
5104
 
4993
5105
      if test -n "$addlibs"; then
4994
5106
        gentop="$output_objdir/${outputname}x"
4995
 
        $show "${rm}r $gentop"
4996
 
        $run ${rm}r "$gentop"
4997
 
        $show "$mkdir $gentop"
4998
 
        $run $mkdir "$gentop"
4999
 
        status=$?
5000
 
        if test "$status" -ne 0 && test ! -d "$gentop"; then
5001
 
          exit $status
5002
 
        fi
5003
5107
        generated="$generated $gentop"
5004
5108
 
5005
 
        # Add in members from convenience archives.
5006
 
        for xlib in $addlibs; do
5007
 
          # Extract the objects.
5008
 
          case $xlib in
5009
 
          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5010
 
          *) xabs=`pwd`"/$xlib" ;;
5011
 
          esac
5012
 
          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5013
 
          xdir="$gentop/$xlib"
5014
 
 
5015
 
          $show "${rm}r $xdir"
5016
 
          $run ${rm}r "$xdir"
5017
 
          $show "$mkdir $xdir"
5018
 
          $run $mkdir "$xdir"
5019
 
          status=$?
5020
 
          if test "$status" -ne 0 && test ! -d "$xdir"; then
5021
 
            exit $status
5022
 
          fi
5023
 
          # We will extract separately just the conflicting names and we will no
5024
 
          # longer touch any unique names. It is faster to leave these extract
5025
 
          # automatically by $AR in one run.
5026
 
          $show "(cd $xdir && $AR x $xabs)"
5027
 
          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5028
 
          if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5029
 
            :
5030
 
          else
5031
 
            $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5032
 
            $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5033
 
            $AR t "$xabs" | sort | uniq -cd | while read -r count name
5034
 
            do
5035
 
              i=1
5036
 
              while test "$i" -le "$count"
5037
 
              do
5038
 
               # Put our $i before any first dot (extension)
5039
 
               # Never overwrite any file
5040
 
               name_to="$name"
5041
 
               while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5042
 
               do
5043
 
                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5044
 
               done
5045
 
               $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5046
 
               $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5047
 
               i=`expr $i + 1`
5048
 
              done
5049
 
            done
5050
 
          fi
5051
 
 
5052
 
          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5053
 
        done
 
5109
        func_extract_archives $gentop $addlibs
 
5110
        oldobjs="$oldobjs $func_extract_archives_result"
5054
5111
      fi
5055
5112
 
5056
5113
      # Do each command in the archive commands.
5057
5114
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5058
5115
       cmds=$old_archive_from_new_cmds
5059
5116
      else
 
5117
        # POSIX demands no paths to be encoded in archives.  We have
 
5118
        # to avoid creating archives with duplicate basenames if we
 
5119
        # might have to extract them afterwards, e.g., when creating a
 
5120
        # static archive out of a convenience library, or when linking
 
5121
        # the entirety of a libtool archive into another (currently
 
5122
        # not supported by libtool).
 
5123
        if (for obj in $oldobjs
 
5124
            do
 
5125
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
 
5126
            done | sort | sort -uc >/dev/null 2>&1); then
 
5127
          :
 
5128
        else
 
5129
          $echo "copying selected object files to avoid basename conflicts..."
 
5130
 
 
5131
          if test -z "$gentop"; then
 
5132
            gentop="$output_objdir/${outputname}x"
 
5133
            generated="$generated $gentop"
 
5134
 
 
5135
            $show "${rm}r $gentop"
 
5136
            $run ${rm}r "$gentop"
 
5137
            $show "$mkdir $gentop"
 
5138
            $run $mkdir "$gentop"
 
5139
            status=$?
 
5140
            if test "$status" -ne 0 && test ! -d "$gentop"; then
 
5141
              exit $status
 
5142
            fi
 
5143
          fi
 
5144
 
 
5145
          save_oldobjs=$oldobjs
 
5146
          oldobjs=
 
5147
          counter=1
 
5148
          for obj in $save_oldobjs
 
5149
          do
 
5150
            objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
 
5151
            case " $oldobjs " in
 
5152
            " ") oldobjs=$obj ;;
 
5153
            *[\ /]"$objbase "*)
 
5154
              while :; do
 
5155
                # Make sure we don't pick an alternate name that also
 
5156
                # overlaps.
 
5157
                newobj=lt$counter-$objbase
 
5158
                counter=`expr $counter + 1`
 
5159
                case " $oldobjs " in
 
5160
                *[\ /]"$newobj "*) ;;
 
5161
                *) if test ! -f "$gentop/$newobj"; then break; fi ;;
 
5162
                esac
 
5163
              done
 
5164
              $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
 
5165
              $run ln "$obj" "$gentop/$newobj" ||
 
5166
              $run cp "$obj" "$gentop/$newobj"
 
5167
              oldobjs="$oldobjs $gentop/$newobj"
 
5168
              ;;
 
5169
            *) oldobjs="$oldobjs $obj" ;;
 
5170
            esac
 
5171
          done
 
5172
        fi
 
5173
 
5060
5174
        eval cmds=\"$old_archive_cmds\"
5061
5175
 
5062
5176
        if len=`expr "X$cmds" : ".*"` &&
5070
5184
          objlist=
5071
5185
          concat_cmds=
5072
5186
          save_oldobjs=$oldobjs
5073
 
          # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5074
 
          # encoded into archives.  This makes 'ar r' malfunction in
5075
 
          # this piecewise linking case whenever conflicting object
5076
 
          # names appear in distinct ar calls; check, warn and compensate.
5077
 
            if (for obj in $save_oldobjs
5078
 
            do
5079
 
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
5080
 
            done | sort | sort -uc >/dev/null 2>&1); then
5081
 
            :
5082
 
          else
5083
 
            $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5084
 
            $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5085
 
            AR_FLAGS=cq
5086
 
          fi
 
5187
 
5087
5188
          # Is there a better way of finding the last object in the list?
5088
5189
          for obj in $save_oldobjs
5089
5190
          do
5094
5195
            oldobjs="$objlist $obj"
5095
5196
            objlist="$objlist $obj"
5096
5197
            eval test_cmds=\"$old_archive_cmds\"
5097
 
            if len=`expr "X$test_cmds" : ".*"` &&
 
5198
            if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5098
5199
               test "$len" -le "$max_cmd_len"; then
5099
5200
              :
5100
5201
            else
5291
5392
    # install_prog (especially on Windows NT).
5292
5393
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5293
5394
       # Allow the use of GNU shtool's install command.
5294
 
       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
 
5395
       $echo "X$nonopt" | grep shtool > /dev/null; then
5295
5396
      # Aesthetically quote it.
5296
5397
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5297
5398
      case $arg in
5298
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5399
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5299
5400
        arg="\"$arg\""
5300
5401
        ;;
5301
5402
      esac
5304
5405
      shift
5305
5406
    else
5306
5407
      install_prog=
5307
 
      arg="$nonopt"
 
5408
      arg=$nonopt
5308
5409
    fi
5309
5410
 
5310
5411
    # The real first argument should be the name of the installation program.
5311
5412
    # Aesthetically quote it.
5312
5413
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5313
5414
    case $arg in
5314
 
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
 
5415
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
5315
5416
      arg="\"$arg\""
5316
5417
      ;;
5317
5418
    esac
5329
5430
    do
5330
5431
      if test -n "$dest"; then
5331
5432
        files="$files $dest"
5332
 
        dest="$arg"
 
5433
        dest=$arg
5333
5434
        continue
5334
5435
      fi
5335
5436
 
5336
5437
      case $arg in
5337
5438
      -d) isdir=yes ;;
5338
 
      -f) prev="-f" ;;
5339
 
      -g) prev="-g" ;;
5340
 
      -m) prev="-m" ;;
5341
 
      -o) prev="-o" ;;
 
5439
      -f) 
 
5440
        case " $install_prog " in
 
5441
        *[\\\ /]cp\ *) ;;
 
5442
        *) prev=$arg ;;
 
5443
        esac
 
5444
        ;;
 
5445
      -g | -m | -o) prev=$arg ;;
5342
5446
      -s)
5343
5447
        stripme=" -s"
5344
5448
        continue
5345
5449
        ;;
5346
 
      -*) ;;
5347
 
 
 
5450
      -*)
 
5451
        ;;
5348
5452
      *)
5349
5453
        # If the previous option needed an argument, then skip it.
5350
5454
        if test -n "$prev"; then
5351
5455
          prev=
5352
5456
        else
5353
 
          dest="$arg"
 
5457
          dest=$arg
5354
5458
          continue
5355
5459
        fi
5356
5460
        ;;
5359
5463
      # Aesthetically quote the argument.
5360
5464
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5361
5465
      case $arg in
5362
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5466
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5363
5467
        arg="\"$arg\""
5364
5468
        ;;
5365
5469
      esac
5528
5632
 
5529
5633
          if test "$#" -gt 0; then
5530
5634
            # Delete the old symlinks, and create new ones.
 
5635
            # Try `ln -sf' first, because the `ln' binary might depend on
 
5636
            # the symlink we replace!  Solaris /bin/ln does not understand -f,
 
5637
            # so we also need to try rm && ln -s.
5531
5638
            for linkname
5532
5639
            do
5533
5640
              if test "$linkname" != "$realname"; then
5534
 
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5535
 
                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
 
5641
                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
 
5642
                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5536
5643
              fi
5537
5644
            done
5538
5645
          fi
5545
5652
            IFS="$save_ifs"
5546
5653
            eval cmd=\"$cmd\"
5547
5654
            $show "$cmd"
5548
 
            $run eval "$cmd" || exit $?
 
5655
            $run eval "$cmd" || {
 
5656
              lt_exit=$?
 
5657
 
 
5658
              # Restore the uninstalled library and exit
 
5659
              if test "$mode" = relink; then
 
5660
                $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
 
5661
              fi
 
5662
 
 
5663
              exit $lt_exit
 
5664
            }
5549
5665
          done
5550
5666
          IFS="$save_ifs"
5551
5667
        fi
5639
5755
          notinst_deplibs=
5640
5756
          relink_command=
5641
5757
 
5642
 
          # To insure that "foo" is sourced, and not "foo.exe",
5643
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5644
 
          # which disallows the automatic-append-.exe behavior.
5645
 
          case $build in
5646
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5647
 
          *) wrapperdot=${wrapper} ;;
5648
 
          esac
 
5758
          # Note that it is not necessary on cygwin/mingw to append a dot to
 
5759
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
 
5760
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
 
5761
          # `FILE.' does not work on cygwin managed mounts.
 
5762
          #
5649
5763
          # If there is no directory component, then add one.
5650
 
          case $file in
5651
 
          */* | *\\*) . ${wrapperdot} ;;
5652
 
          *) . ./${wrapperdot} ;;
 
5764
          case $wrapper in
 
5765
          */* | *\\*) . ${wrapper} ;;
 
5766
          *) . ./${wrapper} ;;
5653
5767
          esac
5654
5768
 
5655
5769
          # Check the variables that should have been set.
5677
5791
          done
5678
5792
 
5679
5793
          relink_command=
5680
 
          # To insure that "foo" is sourced, and not "foo.exe",
5681
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5682
 
          # which disallows the automatic-append-.exe behavior.
5683
 
          case $build in
5684
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5685
 
          *) wrapperdot=${wrapper} ;;
5686
 
          esac
 
5794
          # Note that it is not necessary on cygwin/mingw to append a dot to
 
5795
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
 
5796
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
 
5797
          # `FILE.' does not work on cygwin managed mounts.
 
5798
          #
5687
5799
          # If there is no directory component, then add one.
5688
 
          case $file in
5689
 
          */* | *\\*) . ${wrapperdot} ;;
5690
 
          *) . ./${wrapperdot} ;;
 
5800
          case $wrapper in
 
5801
          */* | *\\*) . ${wrapper} ;;
 
5802
          *) . ./${wrapper} ;;
5691
5803
          esac
5692
5804
 
5693
5805
          outputname=
5728
5840
        fi
5729
5841
 
5730
5842
        # remove .exe since cygwin /usr/bin/install will append another
5731
 
        # one anyways
 
5843
        # one anyway 
5732
5844
        case $install_prog,$host in
5733
5845
        */usr/bin/install*,*cygwin*)
5734
5846
          case $file:$destfile in
6398
6510
$echo
6399
6511
$echo "Try \`$modename --help' for more information about other modes."
6400
6512
 
6401
 
exit $EXIT_SUCCESS
 
6513
exit $?
6402
6514
 
6403
6515
# The TAGs below are defined such that we never get into a situation
6404
6516
# in which we disable both kinds of libraries.  Given conflicting