~ubuntu-branches/ubuntu/trusty/libgksu1.2/trusty

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2005-11-10 22:41:26 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051110224126-qas4smtk4w5gcgfr
Tags: 1.3.6-1ubuntu1
merged with debian

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: 215 $"
 
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
          ;;
1867
2022
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1868
2023
            continue
1869
2024
          fi
1870
 
          if test "$pass" = conv; then
1871
 
            deplibs="$deplib $deplibs"
1872
 
            continue
1873
 
          fi
1874
2025
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1875
2026
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1876
2027
            for search_ext in .la $std_shrext .so .a; do
1981
2132
          fi
1982
2133
          case $linkmode in
1983
2134
          lib)
1984
 
            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
1985
2151
              $echo
1986
2152
              $echo "*** Warning: Trying to link with static lib archive $deplib."
1987
2153
              $echo "*** I have the capability to make that library automatically link in when"
2055
2221
        # it will not redefine variables installed, or shouldnotlink
2056
2222
        installed=yes
2057
2223
        shouldnotlink=no
 
2224
        avoidtemprpath=
 
2225
 
2058
2226
 
2059
2227
        # Read the .la file
2060
2228
        case $lib in
2153
2321
            dir="$libdir"
2154
2322
            absdir="$libdir"
2155
2323
          fi
 
2324
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2156
2325
        else
2157
 
          dir="$ladir/$objdir"
2158
 
          absdir="$abs_ladir/$objdir"
2159
 
          # Remove this search path later
2160
 
          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
2161
2337
        fi # $installed = yes
2162
2338
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2163
2339
 
2230
2406
          if test -n "$library_names" &&
2231
2407
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2232
2408
            # We need to hardcode the library path
2233
 
            if test -n "$shlibpath_var"; then
 
2409
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2234
2410
              # Make sure the rpath contains only unique directories.
2235
2411
              case "$temp_rpath " in
2236
2412
              *" $dir "*) ;;
2237
2413
              *" $absdir "*) ;;
2238
 
              *) temp_rpath="$temp_rpath $dir" ;;
 
2414
              *) temp_rpath="$temp_rpath $absdir" ;;
2239
2415
              esac
2240
2416
            fi
2241
2417
 
2421
2597
                add_dir="-L$dir"
2422
2598
                # Try looking first in the location we're being installed to.
2423
2599
                if test -n "$inst_prefix_dir"; then
2424
 
                  case "$libdir" in
 
2600
                  case $libdir in
2425
2601
                    [\\/]*)
2426
2602
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
2427
2603
                      ;;
2494
2670
              add_dir="-L$libdir"
2495
2671
              # Try looking first in the location we're being installed to.
2496
2672
              if test -n "$inst_prefix_dir"; then
2497
 
                case "$libdir" in
 
2673
                case $libdir in
2498
2674
                  [\\/]*)
2499
2675
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
2500
2676
                    ;;
2555
2731
              fi
2556
2732
            fi
2557
2733
          else
2558
 
            convenience="$convenience $dir/$old_library"
2559
 
            old_convenience="$old_convenience $dir/$old_library"
2560
2734
            deplibs="$dir/$old_library $deplibs"
2561
2735
            link_static=yes
2562
2736
          fi
2674
2848
              *) continue ;;
2675
2849
              esac
2676
2850
              case " $deplibs " in
 
2851
              *" $path "*) ;;
 
2852
              *) deplibs="$path $deplibs" ;;
 
2853
              esac
 
2854
              case " $deplibs " in
2677
2855
              *" $depdepl "*) ;;
2678
2856
              *) deplibs="$depdepl $deplibs" ;;
2679
2857
              esac
2680
 
              case " $deplibs " in
2681
 
              *" $path "*) ;;
2682
 
              *) deplibs="$deplibs $path" ;;
2683
 
              esac
2684
2858
            done
2685
2859
          fi # link_all_deplibs != no
2686
2860
        fi # linkmode = lib
2949
3123
 
2950
3124
        # Check that each of the things are valid numbers.
2951
3125
        case $current in
2952
 
        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]) ;;
2953
3127
        *)
2954
 
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
 
3128
          $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2955
3129
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2956
3130
          exit $EXIT_FAILURE
2957
3131
          ;;
2958
3132
        esac
2959
3133
 
2960
3134
        case $revision in
2961
 
        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]) ;;
2962
3136
        *)
2963
 
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
 
3137
          $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2964
3138
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2965
3139
          exit $EXIT_FAILURE
2966
3140
          ;;
2967
3141
        esac
2968
3142
 
2969
3143
        case $age in
2970
 
        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]) ;;
2971
3145
        *)
2972
 
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
 
3146
          $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2973
3147
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2974
3148
          exit $EXIT_FAILURE
2975
3149
          ;;
2995
3169
          versuffix="$major.$age.$revision"
2996
3170
          # Darwin ld doesn't like 0 for these options...
2997
3171
          minor_current=`expr $current + 1`
2998
 
          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"
2999
3173
          ;;
3000
3174
 
3001
3175
        freebsd-aout)
3201
3375
          *-*-netbsd*)
3202
3376
            # Don't link with libc until the a.out ld.so is fixed.
3203
3377
            ;;
3204
 
          *-*-openbsd* | *-*-freebsd*)
 
3378
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3205
3379
            # Do not include libc due to us having libc/libc_r.
3206
3380
            test "X$arg" = "X-lc" && continue
3207
3381
            ;;
3251
3425
          if test "$?" -eq 0 ; then
3252
3426
            ldd_output=`ldd conftest`
3253
3427
            for i in $deplibs; do
3254
 
              name="`expr $i : '-l\(.*\)'`"
 
3428
              name=`expr $i : '-l\(.*\)'`
3255
3429
              # If $name is empty we are operating on a -L argument.
3256
3430
              if test "$name" != "" && test "$name" -ne "0"; then
3257
3431
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3288
3462
            # Error occurred in the first compile.  Let's try to salvage
3289
3463
            # the situation: Compile a separate program for each library.
3290
3464
            for i in $deplibs; do
3291
 
              name="`expr $i : '-l\(.*\)'`"
 
3465
              name=`expr $i : '-l\(.*\)'`
3292
3466
              # If $name is empty we are operating on a -L argument.
3293
3467
              if test "$name" != "" && test "$name" != "0"; then
3294
3468
                $rm conftest
3340
3514
          set dummy $deplibs_check_method
3341
3515
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3342
3516
          for a_deplib in $deplibs; do
3343
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3517
            name=`expr $a_deplib : '-l\(.*\)'`
3344
3518
            # If $name is empty we are operating on a -L argument.
3345
3519
            if test "$name" != "" && test  "$name" != "0"; then
3346
3520
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3409
3583
          set dummy $deplibs_check_method
3410
3584
          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3411
3585
          for a_deplib in $deplibs; do
3412
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3586
            name=`expr $a_deplib : '-l\(.*\)'`
3413
3587
            # If $name is empty we are operating on a -L argument.
3414
3588
            if test -n "$name" && test "$name" != "0"; then
3415
3589
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3650
3824
                # The command line is too long to execute in one step.
3651
3825
                $show "using reloadable object file for export list..."
3652
3826
                skipped_export=:
 
3827
                # Break out early, otherwise skipped_export may be
 
3828
                # set to false by a later but shorter cmd.
 
3829
                break
3653
3830
              fi
3654
3831
            done
3655
3832
            IFS="$save_ifs"
3683
3860
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3684
3861
          else
3685
3862
            gentop="$output_objdir/${outputname}x"
3686
 
            $show "${rm}r $gentop"
3687
 
            $run ${rm}r "$gentop"
3688
 
            $show "$mkdir $gentop"
3689
 
            $run $mkdir "$gentop"
3690
 
            status=$?
3691
 
            if test "$status" -ne 0 && test ! -d "$gentop"; then
3692
 
              exit $status
3693
 
            fi
3694
3863
            generated="$generated $gentop"
3695
3864
 
3696
 
            for xlib in $convenience; do
3697
 
              # Extract the objects.
3698
 
              case $xlib in
3699
 
              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3700
 
              *) xabs=`pwd`"/$xlib" ;;
3701
 
              esac
3702
 
              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3703
 
              xdir="$gentop/$xlib"
3704
 
 
3705
 
              $show "${rm}r $xdir"
3706
 
              $run ${rm}r "$xdir"
3707
 
              $show "$mkdir $xdir"
3708
 
              $run $mkdir "$xdir"
3709
 
              status=$?
3710
 
              if test "$status" -ne 0 && test ! -d "$xdir"; then
3711
 
                exit $status
3712
 
              fi
3713
 
              # We will extract separately just the conflicting names and we will no
3714
 
              # longer touch any unique names. It is faster to leave these extract
3715
 
              # automatically by $AR in one run.
3716
 
              $show "(cd $xdir && $AR x $xabs)"
3717
 
              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3718
 
              if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3719
 
                :
3720
 
              else
3721
 
                $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3722
 
                $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3723
 
                $AR t "$xabs" | sort | uniq -cd | while read -r count name
3724
 
                do
3725
 
                  i=1
3726
 
                  while test "$i" -le "$count"
3727
 
                  do
3728
 
                   # Put our $i before any first dot (extension)
3729
 
                   # Never overwrite any file
3730
 
                   name_to="$name"
3731
 
                   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3732
 
                   do
3733
 
                     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3734
 
                   done
3735
 
                   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3736
 
                   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3737
 
                   i=`expr $i + 1`
3738
 
                  done
3739
 
                done
3740
 
              fi
3741
 
 
3742
 
              libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3743
 
            done
 
3865
            func_extract_archives $gentop $convenience
 
3866
            libobjs="$libobjs $func_extract_archives_result"
3744
3867
          fi
3745
3868
        fi
3746
 
 
 
3869
        
3747
3870
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3748
3871
          eval flag=\"$thread_safe_flag_spec\"
3749
3872
          linker_flags="$linker_flags $flag"
3773
3896
          fi
3774
3897
        fi
3775
3898
 
3776
 
        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` &&
3777
3901
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3778
3902
          :
3779
3903
        else
3792
3916
            save_libobjs=$libobjs
3793
3917
          fi
3794
3918
          save_output=$output
 
3919
          output_la=`$echo "X$output" | $Xsed -e "$basename"`
3795
3920
 
3796
3921
          # Clear the reloadable object creation command queue and
3797
3922
          # initialize k to one.
3801
3926
          delfiles=
3802
3927
          last_robj=
3803
3928
          k=1
3804
 
          output=$output_objdir/$save_output-${k}.$objext
 
3929
          output=$output_objdir/$output_la-${k}.$objext
3805
3930
          # Loop over the list of objects to be linked.
3806
3931
          for obj in $save_libobjs
3807
3932
          do
3808
3933
            eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3809
3934
            if test "X$objlist" = X ||
3810
 
               { len=`expr "X$test_cmds" : ".*"` &&
 
3935
               { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3811
3936
                 test "$len" -le "$max_cmd_len"; }; then
3812
3937
              objlist="$objlist $obj"
3813
3938
            else
3821
3946
                # the last one created.
3822
3947
                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3823
3948
              fi
3824
 
              last_robj=$output_objdir/$save_output-${k}.$objext
 
3949
              last_robj=$output_objdir/$output_la-${k}.$objext
3825
3950
              k=`expr $k + 1`
3826
 
              output=$output_objdir/$save_output-${k}.$objext
 
3951
              output=$output_objdir/$output_la-${k}.$objext
3827
3952
              objlist=$obj
3828
3953
              len=1
3829
3954
            fi
3843
3968
            eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3844
3969
          fi
3845
3970
 
3846
 
          # Set up a command to remove the reloadale object files
 
3971
          # Set up a command to remove the reloadable object files
3847
3972
          # after they are used.
3848
3973
          i=0
3849
3974
          while test "$i" -lt "$k"
3850
3975
          do
3851
3976
            i=`expr $i + 1`
3852
 
            delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
 
3977
            delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3853
3978
          done
3854
3979
 
3855
3980
          $echo "creating a temporary reloadable object file: $output"
3897
4022
          IFS="$save_ifs"
3898
4023
          eval cmd=\"$cmd\"
3899
4024
          $show "$cmd"
3900
 
          $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
          }
3901
4035
        done
3902
4036
        IFS="$save_ifs"
3903
4037
 
3904
4038
        # Restore the uninstalled library and exit
3905
4039
        if test "$mode" = relink; then
3906
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
 
3907
4049
          exit $EXIT_SUCCESS
3908
4050
        fi
3909
4051
 
3981
4123
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3982
4124
        else
3983
4125
          gentop="$output_objdir/${obj}x"
3984
 
          $show "${rm}r $gentop"
3985
 
          $run ${rm}r "$gentop"
3986
 
          $show "$mkdir $gentop"
3987
 
          $run $mkdir "$gentop"
3988
 
          status=$?
3989
 
          if test "$status" -ne 0 && test ! -d "$gentop"; then
3990
 
            exit $status
3991
 
          fi
3992
4126
          generated="$generated $gentop"
3993
4127
 
3994
 
          for xlib in $convenience; do
3995
 
            # Extract the objects.
3996
 
            case $xlib in
3997
 
            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3998
 
            *) xabs=`pwd`"/$xlib" ;;
3999
 
            esac
4000
 
            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
4001
 
            xdir="$gentop/$xlib"
4002
 
 
4003
 
            $show "${rm}r $xdir"
4004
 
            $run ${rm}r "$xdir"
4005
 
            $show "$mkdir $xdir"
4006
 
            $run $mkdir "$xdir"
4007
 
            status=$?
4008
 
            if test "$status" -ne 0 && test ! -d "$xdir"; then
4009
 
              exit $status
4010
 
            fi
4011
 
            # We will extract separately just the conflicting names and we will no
4012
 
            # longer touch any unique names. It is faster to leave these extract
4013
 
            # automatically by $AR in one run.
4014
 
            $show "(cd $xdir && $AR x $xabs)"
4015
 
            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4016
 
            if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4017
 
              :
4018
 
            else
4019
 
              $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4020
 
              $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4021
 
              $AR t "$xabs" | sort | uniq -cd | while read -r count name
4022
 
              do
4023
 
                i=1
4024
 
                while test "$i" -le "$count"
4025
 
                do
4026
 
                 # Put our $i before any first dot (extension)
4027
 
                 # Never overwrite any file
4028
 
                 name_to="$name"
4029
 
                 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4030
 
                 do
4031
 
                   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4032
 
                 done
4033
 
                 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4034
 
                 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4035
 
                 i=`expr $i + 1`
4036
 
                done
4037
 
              done
4038
 
            fi
4039
 
 
4040
 
            reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4041
 
          done
 
4128
          func_extract_archives $gentop $convenience
 
4129
          reload_conv_objs="$reload_objs $func_extract_archives_result"
4042
4130
        fi
4043
4131
      fi
4044
4132
 
4300
4388
 
4301
4389
            # Prepare the list of exported symbols
4302
4390
            if test -z "$export_symbols"; then
4303
 
              export_symbols="$output_objdir/$output.exp"
 
4391
              export_symbols="$output_objdir/$outputname.exp"
4304
4392
              $run $rm $export_symbols
4305
 
              $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"'
4306
4394
            else
4307
 
              $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4308
 
              $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'
4309
4397
              $run eval 'mv "$nlist"T "$nlist"'
4310
4398
            fi
4311
4399
          fi
4357
4445
#endif
4358
4446
 
4359
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" "\
4360
4461
const struct {
 
4462
"
 
4463
              ;;
 
4464
            esac
 
4465
 
 
4466
 
 
4467
          $echo >> "$output_objdir/$dlsyms" "\
4361
4468
  const char *name;
4362
4469
  lt_ptr address;
4363
4470
}
4586
4693
        esac
4587
4694
        case $host in
4588
4695
          *cygwin* | *mingw* )
4589
 
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
 
4696
            cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4590
4697
            cwrapper=`$echo ${output}.exe`
4591
4698
            $rm $cwrappersource $cwrapper
4592
4699
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4685
4792
EOF
4686
4793
 
4687
4794
            cat >> $cwrappersource <<"EOF"
 
4795
  return 127;
4688
4796
}
4689
4797
 
4690
4798
void *
4819
4927
 
4820
4928
# The HP-UX ksh and POSIX shell print the target directory to stdout
4821
4929
# if CDPATH is set.
4822
 
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
 
4930
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4823
4931
 
4824
4932
relink_command=\"$relink_command\"
4825
4933
 
4948
5056
        # Backslashes separate directories on plain windows
4949
5057
        *-*-mingw | *-*-os2*)
4950
5058
          $echo >> $output "\
4951
 
      exec \$progdir\\\\\$program \${1+\"\$@\"}
 
5059
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4952
5060
"
4953
5061
          ;;
4954
5062
 
4955
5063
        *)
4956
5064
          $echo >> $output "\
4957
 
      exec \$progdir/\$program \${1+\"\$@\"}
 
5065
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
4958
5066
"
4959
5067
          ;;
4960
5068
        esac
4964
5072
    fi
4965
5073
  else
4966
5074
    # The program doesn't exist.
4967
 
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
 
5075
    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4968
5076
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4969
5077
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4970
5078
    exit $EXIT_FAILURE
4996
5104
 
4997
5105
      if test -n "$addlibs"; then
4998
5106
        gentop="$output_objdir/${outputname}x"
4999
 
        $show "${rm}r $gentop"
5000
 
        $run ${rm}r "$gentop"
5001
 
        $show "$mkdir $gentop"
5002
 
        $run $mkdir "$gentop"
5003
 
        status=$?
5004
 
        if test "$status" -ne 0 && test ! -d "$gentop"; then
5005
 
          exit $status
5006
 
        fi
5007
5107
        generated="$generated $gentop"
5008
5108
 
5009
 
        # Add in members from convenience archives.
5010
 
        for xlib in $addlibs; do
5011
 
          # Extract the objects.
5012
 
          case $xlib in
5013
 
          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5014
 
          *) xabs=`pwd`"/$xlib" ;;
5015
 
          esac
5016
 
          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5017
 
          xdir="$gentop/$xlib"
5018
 
 
5019
 
          $show "${rm}r $xdir"
5020
 
          $run ${rm}r "$xdir"
5021
 
          $show "$mkdir $xdir"
5022
 
          $run $mkdir "$xdir"
5023
 
          status=$?
5024
 
          if test "$status" -ne 0 && test ! -d "$xdir"; then
5025
 
            exit $status
5026
 
          fi
5027
 
          # We will extract separately just the conflicting names and we will no
5028
 
          # longer touch any unique names. It is faster to leave these extract
5029
 
          # automatically by $AR in one run.
5030
 
          $show "(cd $xdir && $AR x $xabs)"
5031
 
          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5032
 
          if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5033
 
            :
5034
 
          else
5035
 
            $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5036
 
            $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5037
 
            $AR t "$xabs" | sort | uniq -cd | while read -r count name
5038
 
            do
5039
 
              i=1
5040
 
              while test "$i" -le "$count"
5041
 
              do
5042
 
               # Put our $i before any first dot (extension)
5043
 
               # Never overwrite any file
5044
 
               name_to="$name"
5045
 
               while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5046
 
               do
5047
 
                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5048
 
               done
5049
 
               $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5050
 
               $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5051
 
               i=`expr $i + 1`
5052
 
              done
5053
 
            done
5054
 
          fi
5055
 
 
5056
 
          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5057
 
        done
 
5109
        func_extract_archives $gentop $addlibs
 
5110
        oldobjs="$oldobjs $func_extract_archives_result"
5058
5111
      fi
5059
5112
 
5060
5113
      # Do each command in the archive commands.
5061
5114
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5062
5115
       cmds=$old_archive_from_new_cmds
5063
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
 
5064
5174
        eval cmds=\"$old_archive_cmds\"
5065
5175
 
5066
5176
        if len=`expr "X$cmds" : ".*"` &&
5074
5184
          objlist=
5075
5185
          concat_cmds=
5076
5186
          save_oldobjs=$oldobjs
5077
 
          # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5078
 
          # encoded into archives.  This makes 'ar r' malfunction in
5079
 
          # this piecewise linking case whenever conflicting object
5080
 
          # names appear in distinct ar calls; check, warn and compensate.
5081
 
            if (for obj in $save_oldobjs
5082
 
            do
5083
 
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
5084
 
            done | sort | sort -uc >/dev/null 2>&1); then
5085
 
            :
5086
 
          else
5087
 
            $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5088
 
            $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5089
 
            AR_FLAGS=cq
5090
 
          fi
 
5187
 
5091
5188
          # Is there a better way of finding the last object in the list?
5092
5189
          for obj in $save_oldobjs
5093
5190
          do
5098
5195
            oldobjs="$objlist $obj"
5099
5196
            objlist="$objlist $obj"
5100
5197
            eval test_cmds=\"$old_archive_cmds\"
5101
 
            if len=`expr "X$test_cmds" : ".*"` &&
 
5198
            if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5102
5199
               test "$len" -le "$max_cmd_len"; then
5103
5200
              :
5104
5201
            else
5295
5392
    # install_prog (especially on Windows NT).
5296
5393
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5297
5394
       # Allow the use of GNU shtool's install command.
5298
 
       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
 
5395
       $echo "X$nonopt" | grep shtool > /dev/null; then
5299
5396
      # Aesthetically quote it.
5300
5397
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5301
5398
      case $arg in
5302
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5399
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5303
5400
        arg="\"$arg\""
5304
5401
        ;;
5305
5402
      esac
5308
5405
      shift
5309
5406
    else
5310
5407
      install_prog=
5311
 
      arg="$nonopt"
 
5408
      arg=$nonopt
5312
5409
    fi
5313
5410
 
5314
5411
    # The real first argument should be the name of the installation program.
5315
5412
    # Aesthetically quote it.
5316
5413
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5317
5414
    case $arg in
5318
 
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
 
5415
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
5319
5416
      arg="\"$arg\""
5320
5417
      ;;
5321
5418
    esac
5333
5430
    do
5334
5431
      if test -n "$dest"; then
5335
5432
        files="$files $dest"
5336
 
        dest="$arg"
 
5433
        dest=$arg
5337
5434
        continue
5338
5435
      fi
5339
5436
 
5340
5437
      case $arg in
5341
5438
      -d) isdir=yes ;;
5342
 
      -f) prev="-f" ;;
5343
 
      -g) prev="-g" ;;
5344
 
      -m) prev="-m" ;;
5345
 
      -o) prev="-o" ;;
 
5439
      -f) 
 
5440
        case " $install_prog " in
 
5441
        *[\\\ /]cp\ *) ;;
 
5442
        *) prev=$arg ;;
 
5443
        esac
 
5444
        ;;
 
5445
      -g | -m | -o) prev=$arg ;;
5346
5446
      -s)
5347
5447
        stripme=" -s"
5348
5448
        continue
5349
5449
        ;;
5350
 
      -*) ;;
5351
 
 
 
5450
      -*)
 
5451
        ;;
5352
5452
      *)
5353
5453
        # If the previous option needed an argument, then skip it.
5354
5454
        if test -n "$prev"; then
5355
5455
          prev=
5356
5456
        else
5357
 
          dest="$arg"
 
5457
          dest=$arg
5358
5458
          continue
5359
5459
        fi
5360
5460
        ;;
5363
5463
      # Aesthetically quote the argument.
5364
5464
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5365
5465
      case $arg in
5366
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5466
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5367
5467
        arg="\"$arg\""
5368
5468
        ;;
5369
5469
      esac
5532
5632
 
5533
5633
          if test "$#" -gt 0; then
5534
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.
5535
5638
            for linkname
5536
5639
            do
5537
5640
              if test "$linkname" != "$realname"; then
5538
 
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5539
 
                $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; }; })"
5540
5643
              fi
5541
5644
            done
5542
5645
          fi
5549
5652
            IFS="$save_ifs"
5550
5653
            eval cmd=\"$cmd\"
5551
5654
            $show "$cmd"
5552
 
            $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
            }
5553
5665
          done
5554
5666
          IFS="$save_ifs"
5555
5667
        fi
5643
5755
          notinst_deplibs=
5644
5756
          relink_command=
5645
5757
 
5646
 
          # To insure that "foo" is sourced, and not "foo.exe",
5647
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5648
 
          # which disallows the automatic-append-.exe behavior.
5649
 
          case $build in
5650
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5651
 
          *) wrapperdot=${wrapper} ;;
5652
 
          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
          #
5653
5763
          # If there is no directory component, then add one.
5654
 
          case $file in
5655
 
          */* | *\\*) . ${wrapperdot} ;;
5656
 
          *) . ./${wrapperdot} ;;
 
5764
          case $wrapper in
 
5765
          */* | *\\*) . ${wrapper} ;;
 
5766
          *) . ./${wrapper} ;;
5657
5767
          esac
5658
5768
 
5659
5769
          # Check the variables that should have been set.
5681
5791
          done
5682
5792
 
5683
5793
          relink_command=
5684
 
          # To insure that "foo" is sourced, and not "foo.exe",
5685
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5686
 
          # which disallows the automatic-append-.exe behavior.
5687
 
          case $build in
5688
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5689
 
          *) wrapperdot=${wrapper} ;;
5690
 
          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
          #
5691
5799
          # If there is no directory component, then add one.
5692
 
          case $file in
5693
 
          */* | *\\*) . ${wrapperdot} ;;
5694
 
          *) . ./${wrapperdot} ;;
 
5800
          case $wrapper in
 
5801
          */* | *\\*) . ${wrapper} ;;
 
5802
          *) . ./${wrapper} ;;
5695
5803
          esac
5696
5804
 
5697
5805
          outputname=
5732
5840
        fi
5733
5841
 
5734
5842
        # remove .exe since cygwin /usr/bin/install will append another
5735
 
        # one anyways
 
5843
        # one anyway 
5736
5844
        case $install_prog,$host in
5737
5845
        */usr/bin/install*,*cygwin*)
5738
5846
          case $file:$destfile in
6402
6510
$echo
6403
6511
$echo "Try \`$modename --help' for more information about other modes."
6404
6512
 
6405
 
exit $EXIT_SUCCESS
 
6513
exit $?
6406
6514
 
6407
6515
# The TAGs below are defined such that we never get into a situation
6408
6516
# in which we disable both kinds of libraries.  Given conflicting