~ubuntu-branches/ubuntu/edgy/libxfce4util/edgy

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2005-11-27 12:08:34 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127120834-uq5ptp5p6fyipwkt
Tags: 4.2.3.2-1
* Yves-Alexis Perez
 * New Upstream Release
* Simon Huggins
 * Configure sysconfdir correctly                             closes: #329139
 

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
33
33
# function.
34
34
progpath="$0"
35
35
 
36
 
# RH: define SED for historic ltconfig's generated by Libtool 1.3
37
 
[ -z "$SED" ] && SED=sed
38
 
 
39
36
# The name of this program:
40
37
progname=`echo "$progpath" | $SED $basename`
41
38
modename="$progname"
46
43
 
47
44
PROGRAM=ltmain.sh
48
45
PACKAGE=libtool
49
 
VERSION=1.5.6
50
 
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
 
46
VERSION=1.5.20
 
47
TIMESTAMP=" (1.1220.2.287 2005/08/31 18:54:15)"
51
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
52
54
 
53
55
# Check that we have a working $echo.
54
56
if test "X$1" = X--no-reexec; then
86
88
Xsed="${SED}"' -e 1s/^X//'
87
89
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
88
90
# test EBCDIC or ASCII
89
 
case `echo A|tr A '\301'` in
90
 
 A) # EBCDIC based system
91
 
  SP2NL="tr '\100' '\n'"
92
 
  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'
93
96
  ;;
94
 
 *) # Assume ASCII based system
95
 
  SP2NL="tr '\040' '\012'"
96
 
  NL2SP="tr '\015\012' '\040\040'"
 
97
 *) # EBCDIC based system
 
98
  SP2NL='tr \100 \n'
 
99
  NL2SP='tr \r\n \100\100'
97
100
  ;;
98
101
esac
99
102
 
110
113
fi
111
114
 
112
115
# Make sure IFS has a sensible default
113
 
: ${IFS="       
114
 
"}
 
116
lt_nl='
 
117
'
 
118
IFS="   $lt_nl"
115
119
 
116
120
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
117
121
  $echo "$modename: not configured to build any kind of library" 1>&2
141
145
# Need a lot of goo to handle *both* DLLs and import libs
142
146
# Has to be a shell function in order to 'eat' the argument
143
147
# that is supplied when $file_magic_command is called.
144
 
func_win32_libid () {
 
148
func_win32_libid ()
 
149
{
145
150
  win32_libid_type="unknown"
146
151
  win32_fileres=`file -L $1 2>/dev/null`
147
152
  case $win32_fileres in
181
186
# Only attempt this if the compiler in the base compile
182
187
# command doesn't match the default compiler.
183
188
# arg is usually of the form 'gcc ...'
184
 
func_infer_tag () {
 
189
func_infer_tag ()
 
190
{
185
191
    if test -n "$available_tags" && test -z "$tagname"; then
186
192
      CC_quoted=
187
193
      for arg in $CC; do
238
244
      esac
239
245
    fi
240
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
}
241
349
# End of Shell function definitions
242
350
#####################################
243
351
 
308
416
  --version)
309
417
    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
310
418
    $echo
311
 
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
 
419
    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
312
420
    $echo "This is free software; see the source for copying conditions.  There is NO"
313
421
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
314
 
    exit $EXIT_SUCCESS
 
422
    exit $?
315
423
    ;;
316
424
 
317
425
  --config)
320
428
    for tagname in $taglist; do
321
429
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
322
430
    done
323
 
    exit $EXIT_SUCCESS
 
431
    exit $?
324
432
    ;;
325
433
 
326
434
  --debug)
345
453
    else
346
454
      $echo "disable static libraries"
347
455
    fi
348
 
    exit $EXIT_SUCCESS
 
456
    exit $?
349
457
    ;;
350
458
 
351
459
  --finish) mode="finish" ;;
402
510
  # Infer the operation mode.
403
511
  if test -z "$mode"; then
404
512
    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
405
 
    $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
406
514
    case $nonopt in
407
515
    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
408
516
      mode=link
468
576
 
469
577
    for arg
470
578
    do
471
 
      case "$arg_mode" in
 
579
      case $arg_mode in
472
580
      arg  )
473
581
        # do not "continue".  Instead, add this to base_compile
474
582
        lastarg="$arg"
550
658
      case $lastarg in
551
659
      # Double-quote args containing other shell metacharacters.
552
660
      # Many Bourne shells cannot handle close brackets correctly
553
 
      # 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.
554
665
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
555
666
        lastarg="\"$lastarg\""
556
667
        ;;
624
735
      esac
625
736
    done
626
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."
627
746
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
628
747
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
629
748
    if test "X$xdir" = "X$obj"; then
696
815
        $run $rm $removelist
697
816
        exit $EXIT_FAILURE
698
817
      fi
699
 
      $echo $srcfile > "$lockfile"
 
818
      $echo "$srcfile" > "$lockfile"
700
819
    fi
701
820
 
702
821
    if test -n "$fix_srcfile_path"; then
703
822
      eval srcfile=\"$fix_srcfile_path\"
704
823
    fi
 
824
    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
 
825
    case $qsrcfile in
 
826
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
827
      qsrcfile="\"$qsrcfile\"" ;;
 
828
    esac
705
829
 
706
830
    $run $rm "$libobj" "${libobj}T"
707
831
 
723
847
      fbsd_hideous_sh_bug=$base_compile
724
848
 
725
849
      if test "$pic_mode" != no; then
726
 
        command="$base_compile $srcfile $pic_flag"
 
850
        command="$base_compile $qsrcfile $pic_flag"
727
851
      else
728
852
        # Don't build PIC code
729
 
        command="$base_compile $srcfile"
 
853
        command="$base_compile $qsrcfile"
730
854
      fi
731
855
 
732
856
      if test ! -d "${xdir}$objdir"; then
806
930
    if test "$build_old_libs" = yes; then
807
931
      if test "$pic_mode" != yes; then
808
932
        # Don't build PIC code
809
 
        command="$base_compile $srcfile"
 
933
        command="$base_compile $qsrcfile"
810
934
      else
811
 
        command="$base_compile $srcfile $pic_flag"
 
935
        command="$base_compile $qsrcfile $pic_flag"
812
936
      fi
813
937
      if test "$compiler_c_o" = yes; then
814
938
        command="$command -o $obj"
1230
1354
          prev=
1231
1355
          continue
1232
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
          ;;
1233
1364
        *)
1234
1365
          eval "$prev=\"\$arg\""
1235
1366
          prev=
1288
1419
        continue
1289
1420
        ;;
1290
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
 
1291
1430
      -inst-prefix-dir)
1292
1431
        prev=inst_prefix
1293
1432
        continue
1348
1487
            # These systems don't actually have a C library (as such)
1349
1488
            test "X$arg" = "X-lc" && continue
1350
1489
            ;;
1351
 
          *-*-openbsd* | *-*-freebsd*)
 
1490
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1352
1491
            # Do not include libc due to us having libc/libc_r.
1353
1492
            test "X$arg" = "X-lc" && continue
1354
1493
            ;;
1359
1498
          esac
1360
1499
        elif test "X$arg" = "X-lc_r"; then
1361
1500
         case $host in
1362
 
         *-*-openbsd* | *-*-freebsd*)
 
1501
         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1363
1502
           # Do not include libc_r directly, use -pthread flag.
1364
1503
           continue
1365
1504
           ;;
1369
1508
        continue
1370
1509
        ;;
1371
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
 
1372
1521
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1373
 
        deplibs="$deplibs $arg"
 
1522
        compiler_flags="$compiler_flags $arg"
 
1523
        compile_command="$compile_command $arg"
 
1524
        finalize_command="$finalize_command $arg"
1374
1525
        continue
1375
1526
        ;;
1376
1527
 
1379
1530
        continue
1380
1531
        ;;
1381
1532
 
1382
 
      # gcc -m* arguments should be passed to the linker via $compiler_flags
1383
 
      # in order to pass architecture information to the linker
1384
 
      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
1385
 
      # but this is not reliable with gcc because gcc may use -mfoo to
1386
 
      # select a different linker, different libraries, etc, while
1387
 
      # -Wl,-mfoo simply passes -mfoo to the linker.
1388
 
      -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
 
1389
1541
        # Unknown arguments in both finalize_command and compile_command need
1390
1542
        # to be aesthetically quoted because they are evaled later.
1391
1543
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1858
2010
            compile_deplibs="$deplib $compile_deplibs"
1859
2011
            finalize_deplibs="$deplib $finalize_deplibs"
1860
2012
          else
1861
 
            deplibs="$deplib $deplibs"
 
2013
            compiler_flags="$compiler_flags $deplib"
1862
2014
          fi
1863
2015
          continue
1864
2016
          ;;
1867
2019
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1868
2020
            continue
1869
2021
          fi
1870
 
          if test "$pass" = conv; then
1871
 
            deplibs="$deplib $deplibs"
1872
 
            continue
1873
 
          fi
1874
2022
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1875
2023
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
1876
2024
            for search_ext in .la $std_shrext .so .a; do
1981
2129
          fi
1982
2130
          case $linkmode in
1983
2131
          lib)
1984
 
            if test "$deplibs_check_method" != pass_all; then
 
2132
            valid_a_lib=no
 
2133
            case $deplibs_check_method in
 
2134
              match_pattern*)
 
2135
                set dummy $deplibs_check_method
 
2136
                match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
 
2137
                if eval $echo \"$deplib\" 2>/dev/null \
 
2138
                    | $SED 10q \
 
2139
                    | $EGREP "$match_pattern_regex" > /dev/null; then
 
2140
                  valid_a_lib=yes
 
2141
                fi
 
2142
                ;;
 
2143
              pass_all)
 
2144
                valid_a_lib=yes
 
2145
                ;;
 
2146
            esac
 
2147
            if test "$valid_a_lib" != yes; then
1985
2148
              $echo
1986
2149
              $echo "*** Warning: Trying to link with static lib archive $deplib."
1987
2150
              $echo "*** I have the capability to make that library automatically link in when"
2055
2218
        # it will not redefine variables installed, or shouldnotlink
2056
2219
        installed=yes
2057
2220
        shouldnotlink=no
 
2221
        avoidtemprpath=
 
2222
 
2058
2223
 
2059
2224
        # Read the .la file
2060
2225
        case $lib in
2153
2318
            dir="$libdir"
2154
2319
            absdir="$libdir"
2155
2320
          fi
 
2321
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2156
2322
        else
2157
 
          dir="$ladir/$objdir"
2158
 
          absdir="$abs_ladir/$objdir"
2159
 
          # Remove this search path later
2160
 
          notinst_path="$notinst_path $abs_ladir"
 
2323
          if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 
2324
            dir="$ladir"
 
2325
            absdir="$abs_ladir"
 
2326
            # Remove this search path later
 
2327
            notinst_path="$notinst_path $abs_ladir"
 
2328
          else
 
2329
            dir="$ladir/$objdir"
 
2330
            absdir="$abs_ladir/$objdir"
 
2331
            # Remove this search path later
 
2332
            notinst_path="$notinst_path $abs_ladir"
 
2333
          fi
2161
2334
        fi # $installed = yes
2162
2335
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2163
2336
 
2230
2403
          if test -n "$library_names" &&
2231
2404
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2232
2405
            # We need to hardcode the library path
2233
 
            if test -n "$shlibpath_var"; then
 
2406
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2234
2407
              # Make sure the rpath contains only unique directories.
2235
2408
              case "$temp_rpath " in
2236
2409
              *" $dir "*) ;;
2237
2410
              *" $absdir "*) ;;
2238
 
              *) temp_rpath="$temp_rpath $dir" ;;
 
2411
              *) temp_rpath="$temp_rpath $absdir" ;;
2239
2412
              esac
2240
2413
            fi
2241
2414
 
2421
2594
                add_dir="-L$dir"
2422
2595
                # Try looking first in the location we're being installed to.
2423
2596
                if test -n "$inst_prefix_dir"; then
2424
 
                  case "$libdir" in
 
2597
                  case $libdir in
2425
2598
                    [\\/]*)
2426
2599
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
2427
2600
                      ;;
2494
2667
              add_dir="-L$libdir"
2495
2668
              # Try looking first in the location we're being installed to.
2496
2669
              if test -n "$inst_prefix_dir"; then
2497
 
                case "$libdir" in
 
2670
                case $libdir in
2498
2671
                  [\\/]*)
2499
2672
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
2500
2673
                    ;;
2555
2728
              fi
2556
2729
            fi
2557
2730
          else
2558
 
            convenience="$convenience $dir/$old_library"
2559
 
            old_convenience="$old_convenience $dir/$old_library"
2560
2731
            deplibs="$dir/$old_library $deplibs"
2561
2732
            link_static=yes
2562
2733
          fi
2674
2845
              *) continue ;;
2675
2846
              esac
2676
2847
              case " $deplibs " in
 
2848
              *" $path "*) ;;
 
2849
              *) deplibs="$path $deplibs" ;;
 
2850
              esac
 
2851
              case " $deplibs " in
2677
2852
              *" $depdepl "*) ;;
2678
2853
              *) deplibs="$depdepl $deplibs" ;;
2679
2854
              esac
2680
 
              case " $deplibs " in
2681
 
              *" $path "*) ;;
2682
 
              *) deplibs="$deplibs $path" ;;
2683
 
              esac
2684
2855
            done
2685
2856
          fi # link_all_deplibs != no
2686
2857
        fi # linkmode = lib
2944
3115
 
2945
3116
        # Check that each of the things are valid numbers.
2946
3117
        case $current in
2947
 
        [0-9]*) ;;
 
3118
        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]) ;;
2948
3119
        *)
2949
 
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
 
3120
          $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2950
3121
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2951
3122
          exit $EXIT_FAILURE
2952
3123
          ;;
2953
3124
        esac
2954
3125
 
2955
3126
        case $revision in
2956
 
        [0-9]*) ;;
 
3127
        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]) ;;
2957
3128
        *)
2958
 
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
 
3129
          $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2959
3130
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2960
3131
          exit $EXIT_FAILURE
2961
3132
          ;;
2962
3133
        esac
2963
3134
 
2964
3135
        case $age in
2965
 
        [0-9]*) ;;
 
3136
        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]) ;;
2966
3137
        *)
2967
 
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
 
3138
          $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2968
3139
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2969
3140
          exit $EXIT_FAILURE
2970
3141
          ;;
2990
3161
          versuffix="$major.$age.$revision"
2991
3162
          # Darwin ld doesn't like 0 for these options...
2992
3163
          minor_current=`expr $current + 1`
2993
 
          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
 
3164
          verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
2994
3165
          ;;
2995
3166
 
2996
3167
        freebsd-aout)
3196
3367
          *-*-netbsd*)
3197
3368
            # Don't link with libc until the a.out ld.so is fixed.
3198
3369
            ;;
3199
 
          *-*-openbsd* | *-*-freebsd*)
 
3370
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3200
3371
            # Do not include libc due to us having libc/libc_r.
3201
3372
            test "X$arg" = "X-lc" && continue
3202
3373
            ;;
3246
3417
          if test "$?" -eq 0 ; then
3247
3418
            ldd_output=`ldd conftest`
3248
3419
            for i in $deplibs; do
3249
 
              name="`expr $i : '-l\(.*\)'`"
 
3420
              name=`expr $i : '-l\(.*\)'`
3250
3421
              # If $name is empty we are operating on a -L argument.
3251
3422
              if test "$name" != "" && test "$name" -ne "0"; then
3252
3423
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3283
3454
            # Error occurred in the first compile.  Let's try to salvage
3284
3455
            # the situation: Compile a separate program for each library.
3285
3456
            for i in $deplibs; do
3286
 
              name="`expr $i : '-l\(.*\)'`"
 
3457
              name=`expr $i : '-l\(.*\)'`
3287
3458
              # If $name is empty we are operating on a -L argument.
3288
3459
              if test "$name" != "" && test "$name" != "0"; then
3289
3460
                $rm conftest
3335
3506
          set dummy $deplibs_check_method
3336
3507
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3337
3508
          for a_deplib in $deplibs; do
3338
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3509
            name=`expr $a_deplib : '-l\(.*\)'`
3339
3510
            # If $name is empty we are operating on a -L argument.
3340
3511
            if test "$name" != "" && test  "$name" != "0"; then
3341
3512
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3404
3575
          set dummy $deplibs_check_method
3405
3576
          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3406
3577
          for a_deplib in $deplibs; do
3407
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3578
            name=`expr $a_deplib : '-l\(.*\)'`
3408
3579
            # If $name is empty we are operating on a -L argument.
3409
3580
            if test -n "$name" && test "$name" != "0"; then
3410
3581
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3645
3816
                # The command line is too long to execute in one step.
3646
3817
                $show "using reloadable object file for export list..."
3647
3818
                skipped_export=:
 
3819
                # Break out early, otherwise skipped_export may be
 
3820
                # set to false by a later but shorter cmd.
 
3821
                break
3648
3822
              fi
3649
3823
            done
3650
3824
            IFS="$save_ifs"
3678
3852
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3679
3853
          else
3680
3854
            gentop="$output_objdir/${outputname}x"
3681
 
            $show "${rm}r $gentop"
3682
 
            $run ${rm}r "$gentop"
3683
 
            $show "$mkdir $gentop"
3684
 
            $run $mkdir "$gentop"
3685
 
            status=$?
3686
 
            if test "$status" -ne 0 && test ! -d "$gentop"; then
3687
 
              exit $status
3688
 
            fi
3689
3855
            generated="$generated $gentop"
3690
3856
 
3691
 
            for xlib in $convenience; do
3692
 
              # Extract the objects.
3693
 
              case $xlib in
3694
 
              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3695
 
              *) xabs=`pwd`"/$xlib" ;;
3696
 
              esac
3697
 
              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3698
 
              xdir="$gentop/$xlib"
3699
 
 
3700
 
              $show "${rm}r $xdir"
3701
 
              $run ${rm}r "$xdir"
3702
 
              $show "$mkdir $xdir"
3703
 
              $run $mkdir "$xdir"
3704
 
              status=$?
3705
 
              if test "$status" -ne 0 && test ! -d "$xdir"; then
3706
 
                exit $status
3707
 
              fi
3708
 
              # We will extract separately just the conflicting names and we will no
3709
 
              # longer touch any unique names. It is faster to leave these extract
3710
 
              # automatically by $AR in one run.
3711
 
              $show "(cd $xdir && $AR x $xabs)"
3712
 
              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3713
 
              if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3714
 
                :
3715
 
              else
3716
 
                $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3717
 
                $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3718
 
                $AR t "$xabs" | sort | uniq -cd | while read -r count name
3719
 
                do
3720
 
                  i=1
3721
 
                  while test "$i" -le "$count"
3722
 
                  do
3723
 
                   # Put our $i before any first dot (extension)
3724
 
                   # Never overwrite any file
3725
 
                   name_to="$name"
3726
 
                   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3727
 
                   do
3728
 
                     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3729
 
                   done
3730
 
                   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3731
 
                   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3732
 
                   i=`expr $i + 1`
3733
 
                  done
3734
 
                done
3735
 
              fi
3736
 
 
3737
 
              libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3738
 
            done
 
3857
            func_extract_archives $gentop $convenience
 
3858
            libobjs="$libobjs $func_extract_archives_result"
3739
3859
          fi
3740
3860
        fi
3741
 
 
 
3861
        
3742
3862
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3743
3863
          eval flag=\"$thread_safe_flag_spec\"
3744
3864
          linker_flags="$linker_flags $flag"
3768
3888
          fi
3769
3889
        fi
3770
3890
 
3771
 
        if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
 
3891
        if test "X$skipped_export" != "X:" &&
 
3892
           len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3772
3893
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3773
3894
          :
3774
3895
        else
3787
3908
            save_libobjs=$libobjs
3788
3909
          fi
3789
3910
          save_output=$output
 
3911
          output_la=`$echo "X$output" | $Xsed -e "$basename"`
3790
3912
 
3791
3913
          # Clear the reloadable object creation command queue and
3792
3914
          # initialize k to one.
3796
3918
          delfiles=
3797
3919
          last_robj=
3798
3920
          k=1
3799
 
          output=$output_objdir/$save_output-${k}.$objext
 
3921
          output=$output_objdir/$output_la-${k}.$objext
3800
3922
          # Loop over the list of objects to be linked.
3801
3923
          for obj in $save_libobjs
3802
3924
          do
3803
3925
            eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3804
3926
            if test "X$objlist" = X ||
3805
 
               { len=`expr "X$test_cmds" : ".*"` &&
 
3927
               { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3806
3928
                 test "$len" -le "$max_cmd_len"; }; then
3807
3929
              objlist="$objlist $obj"
3808
3930
            else
3816
3938
                # the last one created.
3817
3939
                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3818
3940
              fi
3819
 
              last_robj=$output_objdir/$save_output-${k}.$objext
 
3941
              last_robj=$output_objdir/$output_la-${k}.$objext
3820
3942
              k=`expr $k + 1`
3821
 
              output=$output_objdir/$save_output-${k}.$objext
 
3943
              output=$output_objdir/$output_la-${k}.$objext
3822
3944
              objlist=$obj
3823
3945
              len=1
3824
3946
            fi
3838
3960
            eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3839
3961
          fi
3840
3962
 
3841
 
          # Set up a command to remove the reloadale object files
 
3963
          # Set up a command to remove the reloadable object files
3842
3964
          # after they are used.
3843
3965
          i=0
3844
3966
          while test "$i" -lt "$k"
3845
3967
          do
3846
3968
            i=`expr $i + 1`
3847
 
            delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
 
3969
            delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3848
3970
          done
3849
3971
 
3850
3972
          $echo "creating a temporary reloadable object file: $output"
3892
4014
          IFS="$save_ifs"
3893
4015
          eval cmd=\"$cmd\"
3894
4016
          $show "$cmd"
3895
 
          $run eval "$cmd" || exit $?
 
4017
          $run eval "$cmd" || {
 
4018
            lt_exit=$?
 
4019
 
 
4020
            # Restore the uninstalled library and exit
 
4021
            if test "$mode" = relink; then
 
4022
              $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
 
4023
            fi
 
4024
 
 
4025
            exit $lt_exit
 
4026
          }
3896
4027
        done
3897
4028
        IFS="$save_ifs"
3898
4029
 
3899
4030
        # Restore the uninstalled library and exit
3900
4031
        if test "$mode" = relink; then
3901
4032
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
 
4033
 
 
4034
          if test -n "$convenience"; then
 
4035
            if test -z "$whole_archive_flag_spec"; then
 
4036
              $show "${rm}r $gentop"
 
4037
              $run ${rm}r "$gentop"
 
4038
            fi
 
4039
          fi
 
4040
 
3902
4041
          exit $EXIT_SUCCESS
3903
4042
        fi
3904
4043
 
3976
4115
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3977
4116
        else
3978
4117
          gentop="$output_objdir/${obj}x"
3979
 
          $show "${rm}r $gentop"
3980
 
          $run ${rm}r "$gentop"
3981
 
          $show "$mkdir $gentop"
3982
 
          $run $mkdir "$gentop"
3983
 
          status=$?
3984
 
          if test "$status" -ne 0 && test ! -d "$gentop"; then
3985
 
            exit $status
3986
 
          fi
3987
4118
          generated="$generated $gentop"
3988
4119
 
3989
 
          for xlib in $convenience; do
3990
 
            # Extract the objects.
3991
 
            case $xlib in
3992
 
            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3993
 
            *) xabs=`pwd`"/$xlib" ;;
3994
 
            esac
3995
 
            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3996
 
            xdir="$gentop/$xlib"
3997
 
 
3998
 
            $show "${rm}r $xdir"
3999
 
            $run ${rm}r "$xdir"
4000
 
            $show "$mkdir $xdir"
4001
 
            $run $mkdir "$xdir"
4002
 
            status=$?
4003
 
            if test "$status" -ne 0 && test ! -d "$xdir"; then
4004
 
              exit $status
4005
 
            fi
4006
 
            # We will extract separately just the conflicting names and we will no
4007
 
            # longer touch any unique names. It is faster to leave these extract
4008
 
            # automatically by $AR in one run.
4009
 
            $show "(cd $xdir && $AR x $xabs)"
4010
 
            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4011
 
            if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4012
 
              :
4013
 
            else
4014
 
              $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4015
 
              $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4016
 
              $AR t "$xabs" | sort | uniq -cd | while read -r count name
4017
 
              do
4018
 
                i=1
4019
 
                while test "$i" -le "$count"
4020
 
                do
4021
 
                 # Put our $i before any first dot (extension)
4022
 
                 # Never overwrite any file
4023
 
                 name_to="$name"
4024
 
                 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4025
 
                 do
4026
 
                   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4027
 
                 done
4028
 
                 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4029
 
                 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4030
 
                 i=`expr $i + 1`
4031
 
                done
4032
 
              done
4033
 
            fi
4034
 
 
4035
 
            reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4036
 
          done
 
4120
          func_extract_archives $gentop $convenience
 
4121
          reload_conv_objs="$reload_objs $func_extract_archives_result"
4037
4122
        fi
4038
4123
      fi
4039
4124
 
4295
4380
 
4296
4381
            # Prepare the list of exported symbols
4297
4382
            if test -z "$export_symbols"; then
4298
 
              export_symbols="$output_objdir/$output.exp"
 
4383
              export_symbols="$output_objdir/$outputname.exp"
4299
4384
              $run $rm $export_symbols
4300
 
              $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 
4385
              $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4301
4386
            else
4302
 
              $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4303
 
              $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
 
4387
              $run eval "${SED} -e 's/\([ ][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 
4388
              $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4304
4389
              $run eval 'mv "$nlist"T "$nlist"'
4305
4390
            fi
4306
4391
          fi
4352
4437
#endif
4353
4438
 
4354
4439
/* The mapping between symbol names and symbols. */
 
4440
"
 
4441
 
 
4442
            case $host in
 
4443
            *cygwin* | *mingw* )
 
4444
          $echo >> "$output_objdir/$dlsyms" "\
 
4445
/* DATA imports from DLLs on WIN32 can't be const, because
 
4446
   runtime relocations are performed -- see ld's documentation
 
4447
   on pseudo-relocs */
 
4448
struct {
 
4449
"
 
4450
              ;;
 
4451
            * )
 
4452
          $echo >> "$output_objdir/$dlsyms" "\
4355
4453
const struct {
 
4454
"
 
4455
              ;;
 
4456
            esac
 
4457
 
 
4458
 
 
4459
          $echo >> "$output_objdir/$dlsyms" "\
4356
4460
  const char *name;
4357
4461
  lt_ptr address;
4358
4462
}
4581
4685
        esac
4582
4686
        case $host in
4583
4687
          *cygwin* | *mingw* )
4584
 
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
 
4688
            cwrappersource=`$echo ${objdir}/lt-${outputname}.c`
4585
4689
            cwrapper=`$echo ${output}.exe`
4586
4690
            $rm $cwrappersource $cwrapper
4587
4691
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4680
4784
EOF
4681
4785
 
4682
4786
            cat >> $cwrappersource <<"EOF"
 
4787
  return 127;
4683
4788
}
4684
4789
 
4685
4790
void *
4814
4919
 
4815
4920
# The HP-UX ksh and POSIX shell print the target directory to stdout
4816
4921
# if CDPATH is set.
4817
 
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
 
4922
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4818
4923
 
4819
4924
relink_command=\"$relink_command\"
4820
4925
 
4943
5048
        # Backslashes separate directories on plain windows
4944
5049
        *-*-mingw | *-*-os2*)
4945
5050
          $echo >> $output "\
4946
 
      exec \$progdir\\\\\$program \${1+\"\$@\"}
 
5051
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4947
5052
"
4948
5053
          ;;
4949
5054
 
4950
5055
        *)
4951
5056
          $echo >> $output "\
4952
 
      exec \$progdir/\$program \${1+\"\$@\"}
 
5057
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
4953
5058
"
4954
5059
          ;;
4955
5060
        esac
4959
5064
    fi
4960
5065
  else
4961
5066
    # The program doesn't exist.
4962
 
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
 
5067
    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4963
5068
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4964
5069
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4965
5070
    exit $EXIT_FAILURE
4991
5096
 
4992
5097
      if test -n "$addlibs"; then
4993
5098
        gentop="$output_objdir/${outputname}x"
4994
 
        $show "${rm}r $gentop"
4995
 
        $run ${rm}r "$gentop"
4996
 
        $show "$mkdir $gentop"
4997
 
        $run $mkdir "$gentop"
4998
 
        status=$?
4999
 
        if test "$status" -ne 0 && test ! -d "$gentop"; then
5000
 
          exit $status
5001
 
        fi
5002
5099
        generated="$generated $gentop"
5003
5100
 
5004
 
        # Add in members from convenience archives.
5005
 
        for xlib in $addlibs; do
5006
 
          # Extract the objects.
5007
 
          case $xlib in
5008
 
          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5009
 
          *) xabs=`pwd`"/$xlib" ;;
5010
 
          esac
5011
 
          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5012
 
          xdir="$gentop/$xlib"
5013
 
 
5014
 
          $show "${rm}r $xdir"
5015
 
          $run ${rm}r "$xdir"
5016
 
          $show "$mkdir $xdir"
5017
 
          $run $mkdir "$xdir"
5018
 
          status=$?
5019
 
          if test "$status" -ne 0 && test ! -d "$xdir"; then
5020
 
            exit $status
5021
 
          fi
5022
 
          # We will extract separately just the conflicting names and we will no
5023
 
          # longer touch any unique names. It is faster to leave these extract
5024
 
          # automatically by $AR in one run.
5025
 
          $show "(cd $xdir && $AR x $xabs)"
5026
 
          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5027
 
          if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5028
 
            :
5029
 
          else
5030
 
            $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5031
 
            $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5032
 
            $AR t "$xabs" | sort | uniq -cd | while read -r count name
5033
 
            do
5034
 
              i=1
5035
 
              while test "$i" -le "$count"
5036
 
              do
5037
 
               # Put our $i before any first dot (extension)
5038
 
               # Never overwrite any file
5039
 
               name_to="$name"
5040
 
               while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5041
 
               do
5042
 
                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5043
 
               done
5044
 
               $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5045
 
               $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5046
 
               i=`expr $i + 1`
5047
 
              done
5048
 
            done
5049
 
          fi
5050
 
 
5051
 
          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5052
 
        done
 
5101
        func_extract_archives $gentop $addlibs
 
5102
        oldobjs="$oldobjs $func_extract_archives_result"
5053
5103
      fi
5054
5104
 
5055
5105
      # Do each command in the archive commands.
5056
5106
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5057
5107
       cmds=$old_archive_from_new_cmds
5058
5108
      else
 
5109
        # POSIX demands no paths to be encoded in archives.  We have
 
5110
        # to avoid creating archives with duplicate basenames if we
 
5111
        # might have to extract them afterwards, e.g., when creating a
 
5112
        # static archive out of a convenience library, or when linking
 
5113
        # the entirety of a libtool archive into another (currently
 
5114
        # not supported by libtool).
 
5115
        if (for obj in $oldobjs
 
5116
            do
 
5117
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
 
5118
            done | sort | sort -uc >/dev/null 2>&1); then
 
5119
          :
 
5120
        else
 
5121
          $echo "copying selected object files to avoid basename conflicts..."
 
5122
 
 
5123
          if test -z "$gentop"; then
 
5124
            gentop="$output_objdir/${outputname}x"
 
5125
            generated="$generated $gentop"
 
5126
 
 
5127
            $show "${rm}r $gentop"
 
5128
            $run ${rm}r "$gentop"
 
5129
            $show "$mkdir $gentop"
 
5130
            $run $mkdir "$gentop"
 
5131
            status=$?
 
5132
            if test "$status" -ne 0 && test ! -d "$gentop"; then
 
5133
              exit $status
 
5134
            fi
 
5135
          fi
 
5136
 
 
5137
          save_oldobjs=$oldobjs
 
5138
          oldobjs=
 
5139
          counter=1
 
5140
          for obj in $save_oldobjs
 
5141
          do
 
5142
            objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
 
5143
            case " $oldobjs " in
 
5144
            " ") oldobjs=$obj ;;
 
5145
            *[\ /]"$objbase "*)
 
5146
              while :; do
 
5147
                # Make sure we don't pick an alternate name that also
 
5148
                # overlaps.
 
5149
                newobj=lt$counter-$objbase
 
5150
                counter=`expr $counter + 1`
 
5151
                case " $oldobjs " in
 
5152
                *[\ /]"$newobj "*) ;;
 
5153
                *) if test ! -f "$gentop/$newobj"; then break; fi ;;
 
5154
                esac
 
5155
              done
 
5156
              $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
 
5157
              $run ln "$obj" "$gentop/$newobj" ||
 
5158
              $run cp "$obj" "$gentop/$newobj"
 
5159
              oldobjs="$oldobjs $gentop/$newobj"
 
5160
              ;;
 
5161
            *) oldobjs="$oldobjs $obj" ;;
 
5162
            esac
 
5163
          done
 
5164
        fi
 
5165
 
5059
5166
        eval cmds=\"$old_archive_cmds\"
5060
5167
 
5061
5168
        if len=`expr "X$cmds" : ".*"` &&
5069
5176
          objlist=
5070
5177
          concat_cmds=
5071
5178
          save_oldobjs=$oldobjs
5072
 
          # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5073
 
          # encoded into archives.  This makes 'ar r' malfunction in
5074
 
          # this piecewise linking case whenever conflicting object
5075
 
          # names appear in distinct ar calls; check, warn and compensate.
5076
 
            if (for obj in $save_oldobjs
5077
 
            do
5078
 
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
5079
 
            done | sort | sort -uc >/dev/null 2>&1); then
5080
 
            :
5081
 
          else
5082
 
            $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5083
 
            $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5084
 
            AR_FLAGS=cq
5085
 
          fi
 
5179
 
5086
5180
          # Is there a better way of finding the last object in the list?
5087
5181
          for obj in $save_oldobjs
5088
5182
          do
5093
5187
            oldobjs="$objlist $obj"
5094
5188
            objlist="$objlist $obj"
5095
5189
            eval test_cmds=\"$old_archive_cmds\"
5096
 
            if len=`expr "X$test_cmds" : ".*"` &&
 
5190
            if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5097
5191
               test "$len" -le "$max_cmd_len"; then
5098
5192
              :
5099
5193
            else
5290
5384
    # install_prog (especially on Windows NT).
5291
5385
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5292
5386
       # Allow the use of GNU shtool's install command.
5293
 
       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
 
5387
       $echo "X$nonopt" | grep shtool > /dev/null; then
5294
5388
      # Aesthetically quote it.
5295
5389
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5296
5390
      case $arg in
5297
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5391
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5298
5392
        arg="\"$arg\""
5299
5393
        ;;
5300
5394
      esac
5303
5397
      shift
5304
5398
    else
5305
5399
      install_prog=
5306
 
      arg="$nonopt"
 
5400
      arg=$nonopt
5307
5401
    fi
5308
5402
 
5309
5403
    # The real first argument should be the name of the installation program.
5310
5404
    # Aesthetically quote it.
5311
5405
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5312
5406
    case $arg in
5313
 
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
 
5407
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
5314
5408
      arg="\"$arg\""
5315
5409
      ;;
5316
5410
    esac
5328
5422
    do
5329
5423
      if test -n "$dest"; then
5330
5424
        files="$files $dest"
5331
 
        dest="$arg"
 
5425
        dest=$arg
5332
5426
        continue
5333
5427
      fi
5334
5428
 
5335
5429
      case $arg in
5336
5430
      -d) isdir=yes ;;
5337
 
      -f) prev="-f" ;;
5338
 
      -g) prev="-g" ;;
5339
 
      -m) prev="-m" ;;
5340
 
      -o) prev="-o" ;;
 
5431
      -f) 
 
5432
        case " $install_prog " in
 
5433
        *[\\\ /]cp\ *) ;;
 
5434
        *) prev=$arg ;;
 
5435
        esac
 
5436
        ;;
 
5437
      -g | -m | -o) prev=$arg ;;
5341
5438
      -s)
5342
5439
        stripme=" -s"
5343
5440
        continue
5344
5441
        ;;
5345
 
      -*) ;;
5346
 
 
 
5442
      -*)
 
5443
        ;;
5347
5444
      *)
5348
5445
        # If the previous option needed an argument, then skip it.
5349
5446
        if test -n "$prev"; then
5350
5447
          prev=
5351
5448
        else
5352
 
          dest="$arg"
 
5449
          dest=$arg
5353
5450
          continue
5354
5451
        fi
5355
5452
        ;;
5358
5455
      # Aesthetically quote the argument.
5359
5456
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5360
5457
      case $arg in
5361
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5458
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5362
5459
        arg="\"$arg\""
5363
5460
        ;;
5364
5461
      esac
5527
5624
 
5528
5625
          if test "$#" -gt 0; then
5529
5626
            # Delete the old symlinks, and create new ones.
 
5627
            # Try `ln -sf' first, because the `ln' binary might depend on
 
5628
            # the symlink we replace!  Solaris /bin/ln does not understand -f,
 
5629
            # so we also need to try rm && ln -s.
5530
5630
            for linkname
5531
5631
            do
5532
5632
              if test "$linkname" != "$realname"; then
5533
 
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5534
 
                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
 
5633
                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
 
5634
                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5535
5635
              fi
5536
5636
            done
5537
5637
          fi
5544
5644
            IFS="$save_ifs"
5545
5645
            eval cmd=\"$cmd\"
5546
5646
            $show "$cmd"
5547
 
            $run eval "$cmd" || exit $?
 
5647
            $run eval "$cmd" || {
 
5648
              lt_exit=$?
 
5649
 
 
5650
              # Restore the uninstalled library and exit
 
5651
              if test "$mode" = relink; then
 
5652
                $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
 
5653
              fi
 
5654
 
 
5655
              exit $lt_exit
 
5656
            }
5548
5657
          done
5549
5658
          IFS="$save_ifs"
5550
5659
        fi
5638
5747
          notinst_deplibs=
5639
5748
          relink_command=
5640
5749
 
5641
 
          # To insure that "foo" is sourced, and not "foo.exe",
5642
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5643
 
          # which disallows the automatic-append-.exe behavior.
5644
 
          case $build in
5645
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5646
 
          *) wrapperdot=${wrapper} ;;
5647
 
          esac
 
5750
          # Note that it is not necessary on cygwin/mingw to append a dot to
 
5751
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
 
5752
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
 
5753
          # `FILE.' does not work on cygwin managed mounts.
 
5754
          #
5648
5755
          # If there is no directory component, then add one.
5649
 
          case $file in
5650
 
          */* | *\\*) . ${wrapperdot} ;;
5651
 
          *) . ./${wrapperdot} ;;
 
5756
          case $wrapper in
 
5757
          */* | *\\*) . ${wrapper} ;;
 
5758
          *) . ./${wrapper} ;;
5652
5759
          esac
5653
5760
 
5654
5761
          # Check the variables that should have been set.
5676
5783
          done
5677
5784
 
5678
5785
          relink_command=
5679
 
          # To insure that "foo" is sourced, and not "foo.exe",
5680
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5681
 
          # which disallows the automatic-append-.exe behavior.
5682
 
          case $build in
5683
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5684
 
          *) wrapperdot=${wrapper} ;;
5685
 
          esac
 
5786
          # Note that it is not necessary on cygwin/mingw to append a dot to
 
5787
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
 
5788
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
 
5789
          # `FILE.' does not work on cygwin managed mounts.
 
5790
          #
5686
5791
          # If there is no directory component, then add one.
5687
 
          case $file in
5688
 
          */* | *\\*) . ${wrapperdot} ;;
5689
 
          *) . ./${wrapperdot} ;;
 
5792
          case $wrapper in
 
5793
          */* | *\\*) . ${wrapper} ;;
 
5794
          *) . ./${wrapper} ;;
5690
5795
          esac
5691
5796
 
5692
5797
          outputname=
5727
5832
        fi
5728
5833
 
5729
5834
        # remove .exe since cygwin /usr/bin/install will append another
5730
 
        # one anyways
 
5835
        # one anyway 
5731
5836
        case $install_prog,$host in
5732
5837
        */usr/bin/install*,*cygwin*)
5733
5838
          case $file:$destfile in
6397
6502
$echo
6398
6503
$echo "Try \`$modename --help' for more information about other modes."
6399
6504
 
6400
 
exit $EXIT_SUCCESS
 
6505
exit $?
6401
6506
 
6402
6507
# The TAGs below are defined such that we never get into a situation
6403
6508
# in which we disable both kinds of libraries.  Given conflicting