~ubuntu-branches/ubuntu/precise/vorbis-tools/precise

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Clint Adams
  • Date: 2008-06-09 21:04:10 UTC
  • mfrom: (4.1.10 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080609210410-h0dkh8f8riyiiv4m
Tags: 1.2.0-5
* Bump to Standards-Version 3.8.0. 
* Refresh upstream_r14957-ogg123_stop_decode_on_closed_buffer.diff and
  upstream_r14982-ogg123_man_page_http_only.diff to -p ab.
  closes: #484961.

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: 224 $"
 
46
VERSION="1.5.22 Debian 1.5.22-4"
 
47
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
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
125
132
show="$echo"
126
133
show_help=
127
134
execute_dlfiles=
 
135
duplicate_deps=no
 
136
preserve_args=
128
137
lo2o="s/\\.lo\$/.${objext}/"
129
138
o2lo="s/\\.${objext}\$/.lo/"
130
139
 
132
141
# Shell function definitions:
133
142
# This seems to be the best place for them
134
143
 
 
144
# func_mktempdir [string]
 
145
# Make a temporary directory that won't clash with other running
 
146
# libtool processes, and avoids race conditions if possible.  If
 
147
# given, STRING is the basename for that directory.
 
148
func_mktempdir ()
 
149
{
 
150
    my_template="${TMPDIR-/tmp}/${1-$progname}"
 
151
 
 
152
    if test "$run" = ":"; then
 
153
      # Return a directory name, but don't create it in dry-run mode
 
154
      my_tmpdir="${my_template}-$$"
 
155
    else
 
156
 
 
157
      # If mktemp works, use that first and foremost
 
158
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
 
159
 
 
160
      if test ! -d "$my_tmpdir"; then
 
161
        # Failing that, at least try and use $RANDOM to avoid a race
 
162
        my_tmpdir="${my_template}-${RANDOM-0}$$"
 
163
 
 
164
        save_mktempdir_umask=`umask`
 
165
        umask 0077
 
166
        $mkdir "$my_tmpdir"
 
167
        umask $save_mktempdir_umask
 
168
      fi
 
169
 
 
170
      # If we're not in dry-run mode, bomb out on failure
 
171
      test -d "$my_tmpdir" || {
 
172
        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
 
173
        exit $EXIT_FAILURE
 
174
      }
 
175
    fi
 
176
 
 
177
    $echo "X$my_tmpdir" | $Xsed
 
178
}
 
179
 
 
180
 
135
181
# func_win32_libid arg
136
182
# return the library type of file 'arg'
137
183
#
138
184
# Need a lot of goo to handle *both* DLLs and import libs
139
185
# Has to be a shell function in order to 'eat' the argument
140
186
# that is supplied when $file_magic_command is called.
141
 
func_win32_libid () {
 
187
func_win32_libid ()
 
188
{
142
189
  win32_libid_type="unknown"
143
190
  win32_fileres=`file -L $1 2>/dev/null`
144
191
  case $win32_fileres in
149
196
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
150
197
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
151
198
      win32_nmres=`eval $NM -f posix -A $1 | \
152
 
        sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
153
 
      if test "X$win32_nmres" = "Ximport" ; then
154
 
        win32_libid_type="x86 archive import"
155
 
      else
156
 
        win32_libid_type="x86 archive static"
157
 
      fi
 
199
        $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
 
200
      case $win32_nmres in
 
201
      import*)  win32_libid_type="x86 archive import";;
 
202
      *)        win32_libid_type="x86 archive static";;
 
203
      esac
158
204
    fi
159
205
    ;;
160
206
  *DLL*)
178
224
# Only attempt this if the compiler in the base compile
179
225
# command doesn't match the default compiler.
180
226
# arg is usually of the form 'gcc ...'
181
 
func_infer_tag () {
 
227
func_infer_tag ()
 
228
{
182
229
    if test -n "$available_tags" && test -z "$tagname"; then
183
230
      CC_quoted=
184
231
      for arg in $CC; do
235
282
      esac
236
283
    fi
237
284
}
 
285
 
 
286
 
 
287
# func_extract_an_archive dir oldlib
 
288
func_extract_an_archive ()
 
289
{
 
290
    f_ex_an_ar_dir="$1"; shift
 
291
    f_ex_an_ar_oldlib="$1"
 
292
 
 
293
    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
 
294
    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
 
295
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
 
296
     :
 
297
    else
 
298
      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
 
299
      exit $EXIT_FAILURE
 
300
    fi
 
301
}
 
302
 
 
303
# func_extract_archives gentop oldlib ...
 
304
func_extract_archives ()
 
305
{
 
306
    my_gentop="$1"; shift
 
307
    my_oldlibs=${1+"$@"}
 
308
    my_oldobjs=""
 
309
    my_xlib=""
 
310
    my_xabs=""
 
311
    my_xdir=""
 
312
    my_status=""
 
313
 
 
314
    $show "${rm}r $my_gentop"
 
315
    $run ${rm}r "$my_gentop"
 
316
    $show "$mkdir $my_gentop"
 
317
    $run $mkdir "$my_gentop"
 
318
    my_status=$?
 
319
    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
 
320
      exit $my_status
 
321
    fi
 
322
 
 
323
    for my_xlib in $my_oldlibs; do
 
324
      # Extract the objects.
 
325
      case $my_xlib in
 
326
        [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
 
327
        *) my_xabs=`pwd`"/$my_xlib" ;;
 
328
      esac
 
329
      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
 
330
      my_xdir="$my_gentop/$my_xlib"
 
331
 
 
332
      $show "${rm}r $my_xdir"
 
333
      $run ${rm}r "$my_xdir"
 
334
      $show "$mkdir $my_xdir"
 
335
      $run $mkdir "$my_xdir"
 
336
      exit_status=$?
 
337
      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
 
338
        exit $exit_status
 
339
      fi
 
340
      case $host in
 
341
      *-darwin*)
 
342
        $show "Extracting $my_xabs"
 
343
        # Do not bother doing anything if just a dry run
 
344
        if test -z "$run"; then
 
345
          darwin_orig_dir=`pwd`
 
346
          cd $my_xdir || exit $?
 
347
          darwin_archive=$my_xabs
 
348
          darwin_curdir=`pwd`
 
349
          darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
 
350
          darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
 
351
          if test -n "$darwin_arches"; then 
 
352
            darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
 
353
            darwin_arch=
 
354
            $show "$darwin_base_archive has multiple architectures $darwin_arches"
 
355
            for darwin_arch in  $darwin_arches ; do
 
356
              mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
 
357
              lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
 
358
              cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
 
359
              func_extract_an_archive "`pwd`" "${darwin_base_archive}"
 
360
              cd "$darwin_curdir"
 
361
              $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
 
362
            done # $darwin_arches
 
363
      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
 
364
            darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
 
365
            darwin_file=
 
366
            darwin_files=
 
367
            for darwin_file in $darwin_filelist; do
 
368
              darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
 
369
              lipo -create -output "$darwin_file" $darwin_files
 
370
            done # $darwin_filelist
 
371
            ${rm}r unfat-$$
 
372
            cd "$darwin_orig_dir"
 
373
          else
 
374
            cd "$darwin_orig_dir"
 
375
            func_extract_an_archive "$my_xdir" "$my_xabs"
 
376
          fi # $darwin_arches
 
377
        fi # $run
 
378
        ;;
 
379
      *)
 
380
        func_extract_an_archive "$my_xdir" "$my_xabs"
 
381
        ;;
 
382
      esac
 
383
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
 
384
    done
 
385
    func_extract_archives_result="$my_oldobjs"
 
386
}
238
387
# End of Shell function definitions
239
388
#####################################
240
389
 
241
390
# Darwin sucks
242
391
eval std_shrext=\"$shrext_cmds\"
243
392
 
 
393
disable_libs=no
 
394
 
244
395
# Parse our command line options once, thoroughly.
245
396
while test "$#" -gt 0
246
397
do
305
456
  --version)
306
457
    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
307
458
    $echo
308
 
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
 
459
    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
309
460
    $echo "This is free software; see the source for copying conditions.  There is NO"
310
461
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
311
 
    exit $EXIT_SUCCESS
 
462
    exit $?
312
463
    ;;
313
464
 
314
465
  --config)
317
468
    for tagname in $taglist; do
318
469
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
319
470
    done
320
 
    exit $EXIT_SUCCESS
 
471
    exit $?
321
472
    ;;
322
473
 
323
474
  --debug)
342
493
    else
343
494
      $echo "disable static libraries"
344
495
    fi
345
 
    exit $EXIT_SUCCESS
 
496
    exit $?
346
497
    ;;
347
498
 
348
499
  --finish) mode="finish" ;;
357
508
    preserve_args="$preserve_args $arg"
358
509
    ;;
359
510
 
360
 
  --tag) prevopt="--tag" prev=tag ;;
 
511
  --tag)
 
512
    prevopt="--tag"
 
513
    prev=tag
 
514
    preserve_args="$preserve_args --tag"
 
515
    ;;
361
516
  --tag=*)
362
517
    set tag "$optarg" ${1+"$@"}
363
518
    shift
389
544
  exit $EXIT_FAILURE
390
545
fi
391
546
 
 
547
case $disable_libs in
 
548
no) 
 
549
  ;;
 
550
shared)
 
551
  build_libtool_libs=no
 
552
  build_old_libs=yes
 
553
  ;;
 
554
static)
 
555
  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 
556
  ;;
 
557
esac
 
558
 
392
559
# If this variable is set in any of the actions, the command in it
393
560
# will be execed at the end.  This prevents here-documents from being
394
561
# left over by shells.
399
566
  # Infer the operation mode.
400
567
  if test -z "$mode"; then
401
568
    $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
 
569
    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
403
570
    case $nonopt in
404
571
    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
405
572
      mode=link
465
632
 
466
633
    for arg
467
634
    do
468
 
      case "$arg_mode" in
 
635
      case $arg_mode in
469
636
      arg  )
470
637
        # do not "continue".  Instead, add this to base_compile
471
638
        lastarg="$arg"
547
714
      case $lastarg in
548
715
      # Double-quote args containing other shell metacharacters.
549
716
      # Many Bourne shells cannot handle close brackets correctly
550
 
      # in scan sets, so we specify it separately.
 
717
      # in scan sets, and some SunOS ksh mistreat backslash-escaping
 
718
      # in scan sets (worked around with variable expansion),
 
719
      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
 
720
      # at all, so we specify them separately.
551
721
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
552
722
        lastarg="\"$lastarg\""
553
723
        ;;
621
791
      esac
622
792
    done
623
793
 
 
794
    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
 
795
    case $qlibobj in
 
796
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
797
        qlibobj="\"$qlibobj\"" ;;
 
798
    esac
 
799
    test "X$libobj" != "X$qlibobj" \
 
800
        && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"'  &()|`$[]' \
 
801
        && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
624
802
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
625
803
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
626
804
    if test "X$xdir" = "X$obj"; then
693
871
        $run $rm $removelist
694
872
        exit $EXIT_FAILURE
695
873
      fi
696
 
      $echo $srcfile > "$lockfile"
 
874
      $echo "$srcfile" > "$lockfile"
697
875
    fi
698
876
 
699
877
    if test -n "$fix_srcfile_path"; then
700
878
      eval srcfile=\"$fix_srcfile_path\"
701
879
    fi
 
880
    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
 
881
    case $qsrcfile in
 
882
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
883
      qsrcfile="\"$qsrcfile\"" ;;
 
884
    esac
702
885
 
703
886
    $run $rm "$libobj" "${libobj}T"
704
887
 
720
903
      fbsd_hideous_sh_bug=$base_compile
721
904
 
722
905
      if test "$pic_mode" != no; then
723
 
        command="$base_compile $srcfile $pic_flag"
 
906
        command="$base_compile $qsrcfile $pic_flag"
724
907
      else
725
908
        # Don't build PIC code
726
 
        command="$base_compile $srcfile"
 
909
        command="$base_compile $qsrcfile"
727
910
      fi
728
911
 
729
912
      if test ! -d "${xdir}$objdir"; then
730
913
        $show "$mkdir ${xdir}$objdir"
731
914
        $run $mkdir ${xdir}$objdir
732
 
        status=$?
733
 
        if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
734
 
          exit $status
 
915
        exit_status=$?
 
916
        if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
 
917
          exit $exit_status
735
918
        fi
736
919
      fi
737
920
 
803
986
    if test "$build_old_libs" = yes; then
804
987
      if test "$pic_mode" != yes; then
805
988
        # Don't build PIC code
806
 
        command="$base_compile $srcfile"
 
989
        command="$base_compile $qsrcfile"
807
990
      else
808
 
        command="$base_compile $srcfile $pic_flag"
 
991
        command="$base_compile $qsrcfile $pic_flag"
809
992
      fi
810
993
      if test "$compiler_c_o" = yes; then
811
994
        command="$command -o $obj"
934
1117
    no_install=no
935
1118
    objs=
936
1119
    non_pic_objects=
 
1120
    notinst_path= # paths that contain not-installed libtool libraries
937
1121
    precious_files_regex=
938
1122
    prefer_static_libs=no
939
1123
    preload=no
962
1146
          if test -n "$link_static_flag"; then
963
1147
            dlopen_self=$dlopen_self_static
964
1148
          fi
 
1149
          prefer_static_libs=yes
965
1150
        else
966
1151
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
967
1152
            dlopen_self=$dlopen_self_static
968
1153
          fi
 
1154
          prefer_static_libs=built
969
1155
        fi
970
1156
        build_libtool_libs=no
971
1157
        build_old_libs=yes
972
 
        prefer_static_libs=yes
973
1158
        break
974
1159
        ;;
975
1160
      esac
1144
1329
                  if test -z "$pic_object" || test "$pic_object" = none ; then
1145
1330
                    arg="$non_pic_object"
1146
1331
                  fi
 
1332
                else
 
1333
                  # If the PIC object exists, use it instead.
 
1334
                  # $xdir was prepended to $pic_object above.
 
1335
                  non_pic_object="$pic_object"
 
1336
                  non_pic_objects="$non_pic_objects $non_pic_object"
1147
1337
                fi
1148
1338
              else
1149
1339
                # Only an error if not doing a dry-run.
1227
1417
          prev=
1228
1418
          continue
1229
1419
          ;;
 
1420
        darwin_framework|darwin_framework_skip)
 
1421
          test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
 
1422
          compile_command="$compile_command $arg"
 
1423
          finalize_command="$finalize_command $arg"
 
1424
          prev=
 
1425
          continue
 
1426
          ;;
1230
1427
        *)
1231
1428
          eval "$prev=\"\$arg\""
1232
1429
          prev=
1285
1482
        continue
1286
1483
        ;;
1287
1484
 
 
1485
      -framework|-arch|-isysroot)
 
1486
        case " $CC " in
 
1487
          *" ${arg} ${1} "* | *" ${arg} ${1} "*) 
 
1488
                prev=darwin_framework_skip ;;
 
1489
          *) compiler_flags="$compiler_flags $arg"
 
1490
             prev=darwin_framework ;;
 
1491
        esac
 
1492
        compile_command="$compile_command $arg"
 
1493
        finalize_command="$finalize_command $arg"
 
1494
        continue
 
1495
        ;;
 
1496
 
1288
1497
      -inst-prefix-dir)
1289
1498
        prev=inst_prefix
1290
1499
        continue
1311
1520
          absdir=`cd "$dir" && pwd`
1312
1521
          if test -z "$absdir"; then
1313
1522
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1314
 
            exit $EXIT_FAILURE
 
1523
            absdir="$dir"
 
1524
            notinst_path="$notinst_path $dir"
1315
1525
          fi
1316
1526
          dir="$absdir"
1317
1527
          ;;
1325
1535
        esac
1326
1536
        case $host in
1327
1537
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
1538
          testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1328
1539
          case :$dllsearchpath: in
1329
1540
          *":$dir:"*) ;;
1330
1541
          *) dllsearchpath="$dllsearchpath:$dir";;
1331
1542
          esac
 
1543
          case :$dllsearchpath: in
 
1544
          *":$testbindir:"*) ;;
 
1545
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
1546
          esac
1332
1547
          ;;
1333
1548
        esac
1334
1549
        continue
1337
1552
      -l*)
1338
1553
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1339
1554
          case $host in
1340
 
          *-*-cygwin* | *-*-pw32* | *-*-beos*)
 
1555
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1341
1556
            # These systems don't actually have a C or math library (as such)
1342
1557
            continue
1343
1558
            ;;
1344
 
          *-*-mingw* | *-*-os2*)
 
1559
          *-*-os2*)
1345
1560
            # These systems don't actually have a C library (as such)
1346
1561
            test "X$arg" = "X-lc" && continue
1347
1562
            ;;
1348
 
          *-*-openbsd* | *-*-freebsd*)
 
1563
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1349
1564
            # Do not include libc due to us having libc/libc_r.
1350
1565
            test "X$arg" = "X-lc" && continue
1351
1566
            ;;
1353
1568
            # Rhapsody C and math libraries are in the System framework
1354
1569
            deplibs="$deplibs -framework System"
1355
1570
            continue
 
1571
            ;;
 
1572
          *-*-sco3.2v5* | *-*-sco5v6*)
 
1573
            # Causes problems with __ctype
 
1574
            test "X$arg" = "X-lc" && continue
 
1575
            ;;
 
1576
          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 
1577
            # Compiler inserts libc in the correct place for threads to work
 
1578
            test "X$arg" = "X-lc" && continue
 
1579
            ;;
1356
1580
          esac
1357
1581
        elif test "X$arg" = "X-lc_r"; then
1358
1582
         case $host in
1359
 
         *-*-openbsd* | *-*-freebsd*)
 
1583
         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1360
1584
           # Do not include libc_r directly, use -pthread flag.
1361
1585
           continue
1362
1586
           ;;
1366
1590
        continue
1367
1591
        ;;
1368
1592
 
 
1593
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
 
1594
      # classes, name mangling, and exception handling.
 
1595
      -model)
 
1596
        compile_command="$compile_command $arg"
 
1597
        compiler_flags="$compiler_flags $arg"
 
1598
        finalize_command="$finalize_command $arg"
 
1599
        prev=xcompiler
 
1600
        continue
 
1601
        ;;
 
1602
 
1369
1603
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1370
 
        deplibs="$deplibs $arg"
 
1604
        compiler_flags="$compiler_flags $arg"
 
1605
        compile_command="$compile_command $arg"
 
1606
        finalize_command="$finalize_command $arg"
1371
1607
        continue
1372
1608
        ;;
1373
1609
 
1376
1612
        continue
1377
1613
        ;;
1378
1614
 
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*)
 
1615
      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
 
1616
      # -r[0-9][0-9]* specifies the processor on the SGI compiler
 
1617
      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
 
1618
      # +DA*, +DD* enable 64-bit mode on the HP compiler
 
1619
      # -q* pass through compiler args for the IBM compiler
 
1620
      # -m* pass through architecture-specific compiler args for GCC
 
1621
      # -m*, -t[45]*, -txscale* pass through architecture-specific
 
1622
      # compiler args for GCC
 
1623
      # -pg pass through profiling flag for GCC
 
1624
      # @file GCC response files
 
1625
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \
 
1626
      -t[45]*|-txscale*|@*)
 
1627
 
1386
1628
        # Unknown arguments in both finalize_command and compile_command need
1387
1629
        # to be aesthetically quoted because they are evaled later.
1388
1630
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1393
1635
        esac
1394
1636
        compile_command="$compile_command $arg"
1395
1637
        finalize_command="$finalize_command $arg"
1396
 
        if test "$with_gcc" = "yes" ; then
1397
 
          compiler_flags="$compiler_flags $arg"
1398
 
        fi
 
1638
        compiler_flags="$compiler_flags $arg"
1399
1639
        continue
1400
1640
        ;;
1401
1641
 
1633
1873
            if test -z "$pic_object" || test "$pic_object" = none ; then
1634
1874
              arg="$non_pic_object"
1635
1875
            fi
 
1876
          else
 
1877
            # If the PIC object exists, use it instead.
 
1878
            # $xdir was prepended to $pic_object above.
 
1879
            non_pic_object="$pic_object"
 
1880
            non_pic_objects="$non_pic_objects $non_pic_object"
1636
1881
          fi
1637
1882
        else
1638
1883
          # Only an error if not doing a dry-run.
1738
1983
    if test ! -d "$output_objdir"; then
1739
1984
      $show "$mkdir $output_objdir"
1740
1985
      $run $mkdir $output_objdir
1741
 
      status=$?
1742
 
      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1743
 
        exit $status
 
1986
      exit_status=$?
 
1987
      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
 
1988
        exit $exit_status
1744
1989
      fi
1745
1990
    fi
1746
1991
 
1803
2048
    newlib_search_path=
1804
2049
    need_relink=no # whether we're linking any uninstalled libtool libraries
1805
2050
    notinst_deplibs= # not-installed libtool libraries
1806
 
    notinst_path= # paths that contain not-installed libtool libraries
1807
2051
    case $linkmode in
1808
2052
    lib)
1809
2053
        passes="conv link"
1858
2102
            compile_deplibs="$deplib $compile_deplibs"
1859
2103
            finalize_deplibs="$deplib $finalize_deplibs"
1860
2104
          else
1861
 
            deplibs="$deplib $deplibs"
 
2105
            compiler_flags="$compiler_flags $deplib"
1862
2106
          fi
1863
2107
          continue
1864
2108
          ;;
1977
2221
          fi
1978
2222
          case $linkmode in
1979
2223
          lib)
1980
 
            if test "$deplibs_check_method" != pass_all; then
 
2224
            valid_a_lib=no
 
2225
            case $deplibs_check_method in
 
2226
              match_pattern*)
 
2227
                set dummy $deplibs_check_method
 
2228
                match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
 
2229
                if eval $echo \"$deplib\" 2>/dev/null \
 
2230
                    | $SED 10q \
 
2231
                    | $EGREP "$match_pattern_regex" > /dev/null; then
 
2232
                  valid_a_lib=yes
 
2233
                fi
 
2234
                ;;
 
2235
              pass_all)
 
2236
                valid_a_lib=yes
 
2237
                ;;
 
2238
            esac
 
2239
            if test "$valid_a_lib" != yes; then
1981
2240
              $echo
1982
2241
              $echo "*** Warning: Trying to link with static lib archive $deplib."
1983
2242
              $echo "*** I have the capability to make that library automatically link in when"
2027
2286
        esac # case $deplib
2028
2287
        if test "$found" = yes || test -f "$lib"; then :
2029
2288
        else
2030
 
          $echo "$modename: cannot find the library \`$lib'" 1>&2
 
2289
          $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2031
2290
          exit $EXIT_FAILURE
2032
2291
        fi
2033
2292
 
2051
2310
        # it will not redefine variables installed, or shouldnotlink
2052
2311
        installed=yes
2053
2312
        shouldnotlink=no
 
2313
        avoidtemprpath=
 
2314
 
2054
2315
 
2055
2316
        # Read the .la file
2056
2317
        case $lib in
2149
2410
            dir="$libdir"
2150
2411
            absdir="$libdir"
2151
2412
          fi
 
2413
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2152
2414
        else
2153
 
          dir="$ladir/$objdir"
2154
 
          absdir="$abs_ladir/$objdir"
2155
 
          # Remove this search path later
2156
 
          notinst_path="$notinst_path $abs_ladir"
 
2415
          if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 
2416
            dir="$ladir"
 
2417
            absdir="$abs_ladir"
 
2418
            # Remove this search path later
 
2419
            notinst_path="$notinst_path $abs_ladir"
 
2420
          else
 
2421
            dir="$ladir/$objdir"
 
2422
            absdir="$abs_ladir/$objdir"
 
2423
            # Remove this search path later
 
2424
            notinst_path="$notinst_path $abs_ladir"
 
2425
          fi
2157
2426
        fi # $installed = yes
2158
2427
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2159
2428
 
2226
2495
          if test -n "$library_names" &&
2227
2496
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2228
2497
            # We need to hardcode the library path
2229
 
            if test -n "$shlibpath_var"; then
 
2498
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2230
2499
              # Make sure the rpath contains only unique directories.
2231
2500
              case "$temp_rpath " in
2232
2501
              *" $dir "*) ;;
2233
2502
              *" $absdir "*) ;;
2234
 
              *) temp_rpath="$temp_rpath $dir" ;;
 
2503
              *) temp_rpath="$temp_rpath $absdir" ;;
2235
2504
              esac
2236
2505
            fi
2237
2506
 
2268
2537
        fi
2269
2538
 
2270
2539
        link_static=no # Whether the deplib will be linked statically
 
2540
        use_static_libs=$prefer_static_libs
 
2541
        if test "$use_static_libs" = built && test "$installed" = yes ; then
 
2542
          use_static_libs=no
 
2543
        fi
2271
2544
        if test -n "$library_names" &&
2272
 
           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
 
2545
           { test "$use_static_libs" = no || test -z "$old_library"; }; then
2273
2546
          if test "$installed" = no; then
2274
2547
            notinst_deplibs="$notinst_deplibs $lib"
2275
2548
            need_relink=yes
2382
2655
              if test "$hardcode_direct" = no; then
2383
2656
                add="$dir/$linklib"
2384
2657
                case $host in
2385
 
                  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
 
2658
                  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
 
2659
                  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
 
2660
                  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
 
2661
                    *-*-unixware7*) add_dir="-L$dir" ;;
2386
2662
                  *-*-darwin* )
2387
2663
                    # if the lib is a module then we can not link against
2388
2664
                    # it, someone is ignoring the new warnings I added
2389
 
                    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
 
2665
                    if /usr/bin/file -L $add 2> /dev/null |
 
2666
                      $EGREP ": [^:]* bundle" >/dev/null ; then
2390
2667
                      $echo "** Warning, lib $linklib is a module, not a shared library"
2391
2668
                      if test -z "$old_library" ; then
2392
2669
                        $echo
2417
2694
                add_dir="-L$dir"
2418
2695
                # Try looking first in the location we're being installed to.
2419
2696
                if test -n "$inst_prefix_dir"; then
2420
 
                  case "$libdir" in
 
2697
                  case $libdir in
2421
2698
                    [\\/]*)
2422
2699
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
2423
2700
                      ;;
2490
2767
              add_dir="-L$libdir"
2491
2768
              # Try looking first in the location we're being installed to.
2492
2769
              if test -n "$inst_prefix_dir"; then
2493
 
                case "$libdir" in
 
2770
                case $libdir in
2494
2771
                  [\\/]*)
2495
2772
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
2496
2773
                    ;;
2551
2828
              fi
2552
2829
            fi
2553
2830
          else
2554
 
            convenience="$convenience $dir/$old_library"
2555
 
            old_convenience="$old_convenience $dir/$old_library"
2556
2831
            deplibs="$dir/$old_library $deplibs"
2557
2832
            link_static=yes
2558
2833
          fi
2670
2945
              *) continue ;;
2671
2946
              esac
2672
2947
              case " $deplibs " in
 
2948
              *" $path "*) ;;
 
2949
              *) deplibs="$path $deplibs" ;;
 
2950
              esac
 
2951
              case " $deplibs " in
2673
2952
              *" $depdepl "*) ;;
2674
2953
              *) deplibs="$depdepl $deplibs" ;;
2675
2954
              esac
2676
 
              case " $deplibs " in
2677
 
              *" $path "*) ;;
2678
 
              *) deplibs="$deplibs $path" ;;
2679
 
              esac
2680
2955
            done
2681
2956
          fi # link_all_deplibs != no
2682
2957
        fi # linkmode = lib
2947
3222
        case $current in
2948
3223
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2949
3224
        *)
2950
 
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
 
3225
          $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2951
3226
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2952
3227
          exit $EXIT_FAILURE
2953
3228
          ;;
2956
3231
        case $revision in
2957
3232
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2958
3233
        *)
2959
 
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
 
3234
          $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2960
3235
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2961
3236
          exit $EXIT_FAILURE
2962
3237
          ;;
2965
3240
        case $age in
2966
3241
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2967
3242
        *)
2968
 
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
 
3243
          $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2969
3244
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2970
3245
          exit $EXIT_FAILURE
2971
3246
          ;;
2991
3266
          versuffix="$major.$age.$revision"
2992
3267
          # Darwin ld doesn't like 0 for these options...
2993
3268
          minor_current=`expr $current + 1`
2994
 
          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
 
3269
          verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
2995
3270
          ;;
2996
3271
 
2997
3272
        freebsd-aout)
3144
3419
 
3145
3420
      # Eliminate all temporary directories.
3146
3421
      for path in $notinst_path; do
3147
 
        lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3148
 
        deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3149
 
        dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
 
3422
        lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
 
3423
        deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
 
3424
        dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
3150
3425
      done
3151
3426
 
3152
3427
      if test -n "$xrpath"; then
3197
3472
          *-*-netbsd*)
3198
3473
            # Don't link with libc until the a.out ld.so is fixed.
3199
3474
            ;;
3200
 
          *-*-openbsd* | *-*-freebsd*)
 
3475
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3201
3476
            # Do not include libc due to us having libc/libc_r.
3202
 
            test "X$arg" = "X-lc" && continue
 
3477
            ;;
 
3478
          *-*-sco3.2v5* | *-*-sco5v6*)
 
3479
            # Causes problems with __ctype
 
3480
            ;;
 
3481
          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 
3482
            # Compiler inserts libc in the correct place for threads to work
3203
3483
            ;;
3204
3484
          *)
3205
3485
            # Add libc to deplibs on all other systems if necessary.
3243
3523
          int main() { return 0; }
3244
3524
EOF
3245
3525
          $rm conftest
3246
 
          $LTCC -o conftest conftest.c $deplibs
 
3526
          $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
3247
3527
          if test "$?" -eq 0 ; then
3248
3528
            ldd_output=`ldd conftest`
3249
3529
            for i in $deplibs; do
3250
 
              name="`expr $i : '-l\(.*\)'`"
 
3530
              name=`expr $i : '-l\(.*\)'`
3251
3531
              # If $name is empty we are operating on a -L argument.
3252
3532
              if test "$name" != "" && test "$name" -ne "0"; then
3253
3533
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3284
3564
            # Error occurred in the first compile.  Let's try to salvage
3285
3565
            # the situation: Compile a separate program for each library.
3286
3566
            for i in $deplibs; do
3287
 
              name="`expr $i : '-l\(.*\)'`"
 
3567
              name=`expr $i : '-l\(.*\)'`
3288
3568
              # If $name is empty we are operating on a -L argument.
3289
3569
              if test "$name" != "" && test "$name" != "0"; then
3290
3570
                $rm conftest
3291
 
                $LTCC -o conftest conftest.c $i
 
3571
                $LTCC $LTCFLAGS -o conftest conftest.c $i
3292
3572
                # Did it work?
3293
3573
                if test "$?" -eq 0 ; then
3294
3574
                  ldd_output=`ldd conftest`
3336
3616
          set dummy $deplibs_check_method
3337
3617
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3338
3618
          for a_deplib in $deplibs; do
3339
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3619
            name=`expr $a_deplib : '-l\(.*\)'`
3340
3620
            # If $name is empty we are operating on a -L argument.
3341
3621
            if test "$name" != "" && test  "$name" != "0"; then
3342
3622
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3405
3685
          set dummy $deplibs_check_method
3406
3686
          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3407
3687
          for a_deplib in $deplibs; do
3408
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3688
            name=`expr $a_deplib : '-l\(.*\)'`
3409
3689
            # If $name is empty we are operating on a -L argument.
3410
3690
            if test -n "$name" && test "$name" != "0"; then
3411
3691
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3535
3815
        deplibs=$newdeplibs
3536
3816
      fi
3537
3817
 
 
3818
 
 
3819
      # move library search paths that coincide with paths to not yet
 
3820
      # installed libraries to the beginning of the library search list
 
3821
      new_libs=
 
3822
      for path in $notinst_path; do
 
3823
        case " $new_libs " in
 
3824
        *" -L$path/$objdir "*) ;;
 
3825
        *)
 
3826
          case " $deplibs " in
 
3827
          *" -L$path/$objdir "*)
 
3828
            new_libs="$new_libs -L$path/$objdir" ;;
 
3829
          esac
 
3830
          ;;
 
3831
        esac
 
3832
      done
 
3833
      for deplib in $deplibs; do
 
3834
        case $deplib in
 
3835
        -L*)
 
3836
          case " $new_libs " in
 
3837
          *" $deplib "*) ;;
 
3838
          *) new_libs="$new_libs $deplib" ;;
 
3839
          esac
 
3840
          ;;
 
3841
        *) new_libs="$new_libs $deplib" ;;
 
3842
        esac
 
3843
      done
 
3844
      deplibs="$new_libs"
 
3845
 
 
3846
 
3538
3847
      # All the library-specific variables (install_libdir is set above).
3539
3848
      library_names=
3540
3849
      old_library=
3618
3927
        fi
3619
3928
 
3620
3929
        lib="$output_objdir/$realname"
 
3930
        linknames=
3621
3931
        for link
3622
3932
        do
3623
3933
          linknames="$linknames $link"
3646
3956
                # The command line is too long to execute in one step.
3647
3957
                $show "using reloadable object file for export list..."
3648
3958
                skipped_export=:
 
3959
                # Break out early, otherwise skipped_export may be
 
3960
                # set to false by a later but shorter cmd.
 
3961
                break
3649
3962
              fi
3650
3963
            done
3651
3964
            IFS="$save_ifs"
3679
3992
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3680
3993
          else
3681
3994
            gentop="$output_objdir/${outputname}x"
3682
 
            $show "${rm}r $gentop"
3683
 
            $run ${rm}r "$gentop"
3684
 
            $show "$mkdir $gentop"
3685
 
            $run $mkdir "$gentop"
3686
 
            status=$?
3687
 
            if test "$status" -ne 0 && test ! -d "$gentop"; then
3688
 
              exit $status
3689
 
            fi
3690
3995
            generated="$generated $gentop"
3691
3996
 
3692
 
            for xlib in $convenience; do
3693
 
              # Extract the objects.
3694
 
              case $xlib in
3695
 
              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3696
 
              *) xabs=`pwd`"/$xlib" ;;
3697
 
              esac
3698
 
              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3699
 
              xdir="$gentop/$xlib"
3700
 
 
3701
 
              $show "${rm}r $xdir"
3702
 
              $run ${rm}r "$xdir"
3703
 
              $show "$mkdir $xdir"
3704
 
              $run $mkdir "$xdir"
3705
 
              status=$?
3706
 
              if test "$status" -ne 0 && test ! -d "$xdir"; then
3707
 
                exit $status
3708
 
              fi
3709
 
              # We will extract separately just the conflicting names and we will no
3710
 
              # longer touch any unique names. It is faster to leave these extract
3711
 
              # automatically by $AR in one run.
3712
 
              $show "(cd $xdir && $AR x $xabs)"
3713
 
              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3714
 
              if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3715
 
                :
3716
 
              else
3717
 
                $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3718
 
                $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3719
 
                $AR t "$xabs" | sort | uniq -cd | while read -r count name
3720
 
                do
3721
 
                  i=1
3722
 
                  while test "$i" -le "$count"
3723
 
                  do
3724
 
                   # Put our $i before any first dot (extension)
3725
 
                   # Never overwrite any file
3726
 
                   name_to="$name"
3727
 
                   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3728
 
                   do
3729
 
                     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3730
 
                   done
3731
 
                   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3732
 
                   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3733
 
                   i=`expr $i + 1`
3734
 
                  done
3735
 
                done
3736
 
              fi
3737
 
 
3738
 
              libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3739
 
            done
 
3997
            func_extract_archives $gentop $convenience
 
3998
            libobjs="$libobjs $func_extract_archives_result"
3740
3999
          fi
3741
4000
        fi
3742
 
 
 
4001
        
3743
4002
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3744
4003
          eval flag=\"$thread_safe_flag_spec\"
3745
4004
          linker_flags="$linker_flags $flag"
3769
4028
          fi
3770
4029
        fi
3771
4030
 
3772
 
        if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
 
4031
        if test "X$skipped_export" != "X:" &&
 
4032
           len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3773
4033
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3774
4034
          :
3775
4035
        else
3788
4048
            save_libobjs=$libobjs
3789
4049
          fi
3790
4050
          save_output=$output
 
4051
          output_la=`$echo "X$output" | $Xsed -e "$basename"`
3791
4052
 
3792
4053
          # Clear the reloadable object creation command queue and
3793
4054
          # initialize k to one.
3797
4058
          delfiles=
3798
4059
          last_robj=
3799
4060
          k=1
3800
 
          output=$output_objdir/$save_output-${k}.$objext
 
4061
          output=$output_objdir/$output_la-${k}.$objext
3801
4062
          # Loop over the list of objects to be linked.
3802
4063
          for obj in $save_libobjs
3803
4064
          do
3804
4065
            eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3805
4066
            if test "X$objlist" = X ||
3806
 
               { len=`expr "X$test_cmds" : ".*"` &&
 
4067
               { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3807
4068
                 test "$len" -le "$max_cmd_len"; }; then
3808
4069
              objlist="$objlist $obj"
3809
4070
            else
3817
4078
                # the last one created.
3818
4079
                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3819
4080
              fi
3820
 
              last_robj=$output_objdir/$save_output-${k}.$objext
 
4081
              last_robj=$output_objdir/$output_la-${k}.$objext
3821
4082
              k=`expr $k + 1`
3822
 
              output=$output_objdir/$save_output-${k}.$objext
 
4083
              output=$output_objdir/$output_la-${k}.$objext
3823
4084
              objlist=$obj
3824
4085
              len=1
3825
4086
            fi
3839
4100
            eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3840
4101
          fi
3841
4102
 
3842
 
          # Set up a command to remove the reloadale object files
 
4103
          # Set up a command to remove the reloadable object files
3843
4104
          # after they are used.
3844
4105
          i=0
3845
4106
          while test "$i" -lt "$k"
3846
4107
          do
3847
4108
            i=`expr $i + 1`
3848
 
            delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
 
4109
            delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3849
4110
          done
3850
4111
 
3851
4112
          $echo "creating a temporary reloadable object file: $output"
3893
4154
          IFS="$save_ifs"
3894
4155
          eval cmd=\"$cmd\"
3895
4156
          $show "$cmd"
3896
 
          $run eval "$cmd" || exit $?
 
4157
          $run eval "$cmd" || {
 
4158
            lt_exit=$?
 
4159
 
 
4160
            # Restore the uninstalled library and exit
 
4161
            if test "$mode" = relink; then
 
4162
              $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
 
4163
            fi
 
4164
 
 
4165
            exit $lt_exit
 
4166
          }
3897
4167
        done
3898
4168
        IFS="$save_ifs"
3899
4169
 
3900
4170
        # Restore the uninstalled library and exit
3901
4171
        if test "$mode" = relink; then
3902
4172
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
 
4173
 
 
4174
          if test -n "$convenience"; then
 
4175
            if test -z "$whole_archive_flag_spec"; then
 
4176
              $show "${rm}r $gentop"
 
4177
              $run ${rm}r "$gentop"
 
4178
            fi
 
4179
          fi
 
4180
 
3903
4181
          exit $EXIT_SUCCESS
3904
4182
        fi
3905
4183
 
3977
4255
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
3978
4256
        else
3979
4257
          gentop="$output_objdir/${obj}x"
3980
 
          $show "${rm}r $gentop"
3981
 
          $run ${rm}r "$gentop"
3982
 
          $show "$mkdir $gentop"
3983
 
          $run $mkdir "$gentop"
3984
 
          status=$?
3985
 
          if test "$status" -ne 0 && test ! -d "$gentop"; then
3986
 
            exit $status
3987
 
          fi
3988
4258
          generated="$generated $gentop"
3989
4259
 
3990
 
          for xlib in $convenience; do
3991
 
            # Extract the objects.
3992
 
            case $xlib in
3993
 
            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3994
 
            *) xabs=`pwd`"/$xlib" ;;
3995
 
            esac
3996
 
            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3997
 
            xdir="$gentop/$xlib"
3998
 
 
3999
 
            $show "${rm}r $xdir"
4000
 
            $run ${rm}r "$xdir"
4001
 
            $show "$mkdir $xdir"
4002
 
            $run $mkdir "$xdir"
4003
 
            status=$?
4004
 
            if test "$status" -ne 0 && test ! -d "$xdir"; then
4005
 
              exit $status
4006
 
            fi
4007
 
            # We will extract separately just the conflicting names and we will no
4008
 
            # longer touch any unique names. It is faster to leave these extract
4009
 
            # automatically by $AR in one run.
4010
 
            $show "(cd $xdir && $AR x $xabs)"
4011
 
            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4012
 
            if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4013
 
              :
4014
 
            else
4015
 
              $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4016
 
              $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4017
 
              $AR t "$xabs" | sort | uniq -cd | while read -r count name
4018
 
              do
4019
 
                i=1
4020
 
                while test "$i" -le "$count"
4021
 
                do
4022
 
                 # Put our $i before any first dot (extension)
4023
 
                 # Never overwrite any file
4024
 
                 name_to="$name"
4025
 
                 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4026
 
                 do
4027
 
                   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4028
 
                 done
4029
 
                 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4030
 
                 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4031
 
                 i=`expr $i + 1`
4032
 
                done
4033
 
              done
4034
 
            fi
4035
 
 
4036
 
            reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4037
 
          done
 
4260
          func_extract_archives $gentop $convenience
 
4261
          reload_conv_objs="$reload_objs $func_extract_archives_result"
4038
4262
        fi
4039
4263
      fi
4040
4264
 
4135
4359
        ;;
4136
4360
      esac
4137
4361
 
 
4362
 
 
4363
      # move library search paths that coincide with paths to not yet
 
4364
      # installed libraries to the beginning of the library search list
 
4365
      new_libs=
 
4366
      for path in $notinst_path; do
 
4367
        case " $new_libs " in
 
4368
        *" -L$path/$objdir "*) ;;
 
4369
        *)
 
4370
          case " $compile_deplibs " in
 
4371
          *" -L$path/$objdir "*)
 
4372
            new_libs="$new_libs -L$path/$objdir" ;;
 
4373
          esac
 
4374
          ;;
 
4375
        esac
 
4376
      done
 
4377
      for deplib in $compile_deplibs; do
 
4378
        case $deplib in
 
4379
        -L*)
 
4380
          case " $new_libs " in
 
4381
          *" $deplib "*) ;;
 
4382
          *) new_libs="$new_libs $deplib" ;;
 
4383
          esac
 
4384
          ;;
 
4385
        *) new_libs="$new_libs $deplib" ;;
 
4386
        esac
 
4387
      done
 
4388
      compile_deplibs="$new_libs"
 
4389
 
 
4390
 
4138
4391
      compile_command="$compile_command $compile_deplibs"
4139
4392
      finalize_command="$finalize_command $finalize_deplibs"
4140
4393
 
4179
4432
        fi
4180
4433
        case $host in
4181
4434
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
4435
          testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4182
4436
          case :$dllsearchpath: in
4183
4437
          *":$libdir:"*) ;;
4184
4438
          *) dllsearchpath="$dllsearchpath:$libdir";;
4185
4439
          esac
 
4440
          case :$dllsearchpath: in
 
4441
          *":$testbindir:"*) ;;
 
4442
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
4443
          esac
4186
4444
          ;;
4187
4445
        esac
4188
4446
      done
4296
4554
 
4297
4555
            # Prepare the list of exported symbols
4298
4556
            if test -z "$export_symbols"; then
4299
 
              export_symbols="$output_objdir/$output.exp"
 
4557
              export_symbols="$output_objdir/$outputname.exp"
4300
4558
              $run $rm $export_symbols
4301
 
              $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 
4559
              $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 
4560
              case $host in
 
4561
              *cygwin* | *mingw* )
 
4562
                $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
 
4563
                $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
 
4564
                ;;
 
4565
              esac
4302
4566
            else
4303
 
              $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4304
 
              $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
 
4567
              $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 
4568
              $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4305
4569
              $run eval 'mv "$nlist"T "$nlist"'
 
4570
              case $host in
 
4571
              *cygwin* | *mingw* )
 
4572
                $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
 
4573
                $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
 
4574
                ;;
 
4575
              esac
4306
4576
            fi
4307
4577
          fi
4308
4578
 
4353
4623
#endif
4354
4624
 
4355
4625
/* The mapping between symbol names and symbols. */
 
4626
"
 
4627
 
 
4628
            case $host in
 
4629
            *cygwin* | *mingw* )
 
4630
          $echo >> "$output_objdir/$dlsyms" "\
 
4631
/* DATA imports from DLLs on WIN32 can't be const, because
 
4632
   runtime relocations are performed -- see ld's documentation
 
4633
   on pseudo-relocs */
 
4634
struct {
 
4635
"
 
4636
              ;;
 
4637
            * )
 
4638
          $echo >> "$output_objdir/$dlsyms" "\
4356
4639
const struct {
 
4640
"
 
4641
              ;;
 
4642
            esac
 
4643
 
 
4644
 
 
4645
          $echo >> "$output_objdir/$dlsyms" "\
4357
4646
  const char *name;
4358
4647
  lt_ptr address;
4359
4648
}
4400
4689
          esac
4401
4690
 
4402
4691
          # Now compile the dynamic symbol file.
4403
 
          $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4404
 
          $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
4692
          $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
 
4693
          $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4405
4694
 
4406
4695
          # Clean up the generated files.
4407
4696
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4408
4697
          $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4409
4698
 
4410
4699
          # Transform the symbol file into the correct name.
4411
 
          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4412
 
          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
4700
          case $host in
 
4701
          *cygwin* | *mingw* )
 
4702
            if test -f "$output_objdir/${outputname}.def" ; then
 
4703
              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
 
4704
              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
 
4705
            else
 
4706
              compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
4707
              finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
4708
             fi
 
4709
            ;;
 
4710
          * )
 
4711
            compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
4712
            finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
4713
            ;;
 
4714
          esac
4413
4715
          ;;
4414
4716
        *)
4415
4717
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4434
4736
        # We have no uninstalled library dependencies, so finalize right now.
4435
4737
        $show "$link_command"
4436
4738
        $run eval "$link_command"
4437
 
        status=$?
 
4739
        exit_status=$?
4438
4740
 
4439
4741
        # Delete the generated files.
4440
4742
        if test -n "$dlsyms"; then
4442
4744
          $run $rm "$output_objdir/${outputname}S.${objext}"
4443
4745
        fi
4444
4746
 
4445
 
        exit $status
 
4747
        exit $exit_status
4446
4748
      fi
4447
4749
 
4448
4750
      if test -n "$shlibpath_var"; then
4582
4884
        esac
4583
4885
        case $host in
4584
4886
          *cygwin* | *mingw* )
4585
 
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
4586
 
            cwrapper=`$echo ${output}.exe`
4587
 
            $rm $cwrappersource $cwrapper
4588
 
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
4887
            output_name=`basename $output`
 
4888
            output_path=`dirname $output`
 
4889
            cwrappersource="$output_path/$objdir/lt-$output_name.c"
 
4890
            cwrapper="$output_path/$output_name.exe"
 
4891
            $rm $cwrappersource $cwrapper
 
4892
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4589
4893
 
4590
4894
            cat > $cwrappersource <<EOF
4591
4895
 
4610
4914
#include <malloc.h>
4611
4915
#include <stdarg.h>
4612
4916
#include <assert.h>
 
4917
#include <string.h>
 
4918
#include <ctype.h>
 
4919
#include <sys/stat.h>
4613
4920
 
4614
4921
#if defined(PATH_MAX)
4615
4922
# define LT_PATHMAX PATH_MAX
4620
4927
#endif
4621
4928
 
4622
4929
#ifndef DIR_SEPARATOR
4623
 
#define DIR_SEPARATOR '/'
 
4930
# define DIR_SEPARATOR '/'
 
4931
# define PATH_SEPARATOR ':'
4624
4932
#endif
4625
4933
 
4626
4934
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4627
4935
  defined (__OS2__)
4628
 
#define HAVE_DOS_BASED_FILE_SYSTEM
4629
 
#ifndef DIR_SEPARATOR_2
4630
 
#define DIR_SEPARATOR_2 '\\'
4631
 
#endif
 
4936
# define HAVE_DOS_BASED_FILE_SYSTEM
 
4937
# ifndef DIR_SEPARATOR_2
 
4938
#  define DIR_SEPARATOR_2 '\\'
 
4939
# endif
 
4940
# ifndef PATH_SEPARATOR_2
 
4941
#  define PATH_SEPARATOR_2 ';'
 
4942
# endif
4632
4943
#endif
4633
4944
 
4634
4945
#ifndef DIR_SEPARATOR_2
4638
4949
        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4639
4950
#endif /* DIR_SEPARATOR_2 */
4640
4951
 
 
4952
#ifndef PATH_SEPARATOR_2
 
4953
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
 
4954
#else /* PATH_SEPARATOR_2 */
 
4955
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
 
4956
#endif /* PATH_SEPARATOR_2 */
 
4957
 
4641
4958
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
4642
4959
#define XFREE(stale) do { \
4643
4960
  if (stale) { free ((void *) stale); stale = 0; } \
4644
4961
} while (0)
4645
4962
 
 
4963
/* -DDEBUG is fairly common in CFLAGS.  */
 
4964
#undef DEBUG
 
4965
#if defined DEBUGWRAPPER
 
4966
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
 
4967
#else
 
4968
# define DEBUG(format, ...)
 
4969
#endif
 
4970
 
4646
4971
const char *program_name = NULL;
4647
4972
 
4648
4973
void * xmalloc (size_t num);
4649
4974
char * xstrdup (const char *string);
4650
 
char * basename (const char *name);
4651
 
char * fnqualify(const char *path);
 
4975
const char * base_name (const char *name);
 
4976
char * find_executable(const char *wrapper);
 
4977
int    check_executable(const char *path);
4652
4978
char * strendzap(char *str, const char *pat);
4653
4979
void lt_fatal (const char *message, ...);
4654
4980
 
4658
4984
  char **newargz;
4659
4985
  int i;
4660
4986
 
4661
 
  program_name = (char *) xstrdup ((char *) basename (argv[0]));
 
4987
  program_name = (char *) xstrdup (base_name (argv[0]));
 
4988
  DEBUG("(main) argv[0]      : %s\n",argv[0]);
 
4989
  DEBUG("(main) program_name : %s\n",program_name);
4662
4990
  newargz = XMALLOC(char *, argc+2);
4663
4991
EOF
4664
4992
 
4665
 
            cat >> $cwrappersource <<EOF
4666
 
  newargz[0] = "$SHELL";
 
4993
            cat >> $cwrappersource <<EOF
 
4994
  newargz[0] = (char *) xstrdup("$SHELL");
4667
4995
EOF
4668
4996
 
4669
 
            cat >> $cwrappersource <<"EOF"
4670
 
  newargz[1] = fnqualify(argv[0]);
 
4997
            cat >> $cwrappersource <<"EOF"
 
4998
  newargz[1] = find_executable(argv[0]);
 
4999
  if (newargz[1] == NULL)
 
5000
    lt_fatal("Couldn't find %s", argv[0]);
 
5001
  DEBUG("(main) found exe at : %s\n",newargz[1]);
4671
5002
  /* we know the script has the same name, without the .exe */
4672
5003
  /* so make sure newargz[1] doesn't end in .exe */
4673
5004
  strendzap(newargz[1],".exe");
4674
5005
  for (i = 1; i < argc; i++)
4675
5006
    newargz[i+1] = xstrdup(argv[i]);
4676
5007
  newargz[argc+1] = NULL;
4677
 
EOF
4678
 
 
4679
 
            cat >> $cwrappersource <<EOF
 
5008
 
 
5009
  for (i=0; i<argc+1; i++)
 
5010
  {
 
5011
    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
 
5012
    ;
 
5013
  }
 
5014
 
 
5015
EOF
 
5016
 
 
5017
            case $host_os in
 
5018
              mingw*)
 
5019
                cat >> $cwrappersource <<EOF
 
5020
  execv("$SHELL",(char const **)newargz);
 
5021
EOF
 
5022
              ;;
 
5023
              *)
 
5024
                cat >> $cwrappersource <<EOF
4680
5025
  execv("$SHELL",newargz);
4681
5026
EOF
 
5027
              ;;
 
5028
            esac
4682
5029
 
4683
 
            cat >> $cwrappersource <<"EOF"
 
5030
            cat >> $cwrappersource <<"EOF"
 
5031
  return 127;
4684
5032
}
4685
5033
 
4686
5034
void *
4700
5048
;
4701
5049
}
4702
5050
 
4703
 
char *
4704
 
basename (const char *name)
 
5051
const char *
 
5052
base_name (const char *name)
4705
5053
{
4706
5054
  const char *base;
4707
5055
 
4708
5056
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4709
5057
  /* Skip over the disk name in MSDOS pathnames. */
4710
 
  if (isalpha (name[0]) && name[1] == ':')
 
5058
  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
4711
5059
    name += 2;
4712
5060
#endif
4713
5061
 
4714
5062
  for (base = name; *name; name++)
4715
5063
    if (IS_DIR_SEPARATOR (*name))
4716
5064
      base = name + 1;
4717
 
  return (char *) base;
4718
 
}
4719
 
 
 
5065
  return base;
 
5066
}
 
5067
 
 
5068
int
 
5069
check_executable(const char * path)
 
5070
{
 
5071
  struct stat st;
 
5072
 
 
5073
  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
 
5074
  if ((!path) || (!*path))
 
5075
    return 0;
 
5076
 
 
5077
  if ((stat (path, &st) >= 0) &&
 
5078
      (
 
5079
        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
 
5080
#if defined (S_IXOTH)
 
5081
       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
 
5082
#endif
 
5083
#if defined (S_IXGRP)
 
5084
       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
 
5085
#endif
 
5086
       ((st.st_mode & S_IXUSR) == S_IXUSR))
 
5087
      )
 
5088
    return 1;
 
5089
  else
 
5090
    return 0;
 
5091
}
 
5092
 
 
5093
/* Searches for the full path of the wrapper.  Returns
 
5094
   newly allocated full path name if found, NULL otherwise */
4720
5095
char *
4721
 
fnqualify(const char *path)
 
5096
find_executable (const char* wrapper)
4722
5097
{
4723
 
  size_t size;
4724
 
  char *p;
 
5098
  int has_slash = 0;
 
5099
  const char* p;
 
5100
  const char* p_next;
 
5101
  /* static buffer for getcwd */
4725
5102
  char tmp[LT_PATHMAX + 1];
4726
 
 
4727
 
  assert(path != NULL);
4728
 
 
4729
 
  /* Is it qualified already? */
4730
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4731
 
  if (isalpha (path[0]) && path[1] == ':')
4732
 
    return xstrdup (path);
4733
 
#endif
4734
 
  if (IS_DIR_SEPARATOR (path[0]))
4735
 
    return xstrdup (path);
4736
 
 
4737
 
  /* prepend the current directory */
4738
 
  /* doesn't handle '~' */
 
5103
  int tmp_len;
 
5104
  char* concat_name;
 
5105
 
 
5106
  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
 
5107
 
 
5108
  if ((wrapper == NULL) || (*wrapper == '\0'))
 
5109
    return NULL;
 
5110
 
 
5111
  /* Absolute path? */
 
5112
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
 
5113
  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
 
5114
  {
 
5115
    concat_name = xstrdup (wrapper);
 
5116
    if (check_executable(concat_name))
 
5117
      return concat_name;
 
5118
    XFREE(concat_name);
 
5119
  }
 
5120
  else
 
5121
  {
 
5122
#endif
 
5123
    if (IS_DIR_SEPARATOR (wrapper[0]))
 
5124
    {
 
5125
      concat_name = xstrdup (wrapper);
 
5126
      if (check_executable(concat_name))
 
5127
        return concat_name;
 
5128
      XFREE(concat_name);
 
5129
    }
 
5130
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
 
5131
  }
 
5132
#endif
 
5133
 
 
5134
  for (p = wrapper; *p; p++)
 
5135
    if (*p == '/')
 
5136
    {
 
5137
      has_slash = 1;
 
5138
      break;
 
5139
    }
 
5140
  if (!has_slash)
 
5141
  {
 
5142
    /* no slashes; search PATH */
 
5143
    const char* path = getenv ("PATH");
 
5144
    if (path != NULL)
 
5145
    {
 
5146
      for (p = path; *p; p = p_next)
 
5147
      {
 
5148
        const char* q;
 
5149
        size_t p_len;
 
5150
        for (q = p; *q; q++)
 
5151
          if (IS_PATH_SEPARATOR(*q))
 
5152
            break;
 
5153
        p_len = q - p;
 
5154
        p_next = (*q == '\0' ? q : q + 1);
 
5155
        if (p_len == 0)
 
5156
        {
 
5157
          /* empty path: current directory */
 
5158
          if (getcwd (tmp, LT_PATHMAX) == NULL)
 
5159
            lt_fatal ("getcwd failed");
 
5160
          tmp_len = strlen(tmp);
 
5161
          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
 
5162
          memcpy (concat_name, tmp, tmp_len);
 
5163
          concat_name[tmp_len] = '/';
 
5164
          strcpy (concat_name + tmp_len + 1, wrapper);
 
5165
        }
 
5166
        else
 
5167
        {
 
5168
          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
 
5169
          memcpy (concat_name, p, p_len);
 
5170
          concat_name[p_len] = '/';
 
5171
          strcpy (concat_name + p_len + 1, wrapper);
 
5172
        }
 
5173
        if (check_executable(concat_name))
 
5174
          return concat_name;
 
5175
        XFREE(concat_name);
 
5176
      }
 
5177
    }
 
5178
    /* not found in PATH; assume curdir */
 
5179
  }
 
5180
  /* Relative path | not found in path: prepend cwd */
4739
5181
  if (getcwd (tmp, LT_PATHMAX) == NULL)
4740
5182
    lt_fatal ("getcwd failed");
4741
 
  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4742
 
  p = XMALLOC(char, size);
4743
 
  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4744
 
  return p;
 
5183
  tmp_len = strlen(tmp);
 
5184
  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
 
5185
  memcpy (concat_name, tmp, tmp_len);
 
5186
  concat_name[tmp_len] = '/';
 
5187
  strcpy (concat_name + tmp_len + 1, wrapper);
 
5188
 
 
5189
  if (check_executable(concat_name))
 
5190
    return concat_name;
 
5191
  XFREE(concat_name);
 
5192
  return NULL;
4745
5193
}
4746
5194
 
4747
5195
char *
4785
5233
  va_end (ap);
4786
5234
}
4787
5235
EOF
4788
 
          # we should really use a build-platform specific compiler
4789
 
          # here, but OTOH, the wrappers (shell script and this C one)
4790
 
          # are only useful if you want to execute the "real" binary.
4791
 
          # Since the "real" binary is built for $host, then this
4792
 
          # wrapper might as well be built for $host, too.
4793
 
          $run $LTCC -s -o $cwrapper $cwrappersource
4794
 
          ;;
4795
 
        esac
4796
 
        $rm $output
4797
 
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
5236
          # we should really use a build-platform specific compiler
 
5237
          # here, but OTOH, the wrappers (shell script and this C one)
 
5238
          # are only useful if you want to execute the "real" binary.
 
5239
          # Since the "real" binary is built for $host, then this
 
5240
          # wrapper might as well be built for $host, too.
 
5241
          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
 
5242
          ;;
 
5243
        esac
 
5244
        $rm $output
 
5245
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4798
5246
 
4799
5247
        $echo > $output "\
4800
5248
#! $SHELL
4815
5263
 
4816
5264
# The HP-UX ksh and POSIX shell print the target directory to stdout
4817
5265
# if CDPATH is set.
4818
 
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
 
5266
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4819
5267
 
4820
5268
relink_command=\"$relink_command\"
4821
5269
 
4944
5392
        # Backslashes separate directories on plain windows
4945
5393
        *-*-mingw | *-*-os2*)
4946
5394
          $echo >> $output "\
4947
 
      exec \$progdir\\\\\$program \${1+\"\$@\"}
 
5395
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4948
5396
"
4949
5397
          ;;
4950
5398
 
4951
5399
        *)
4952
5400
          $echo >> $output "\
4953
 
      exec \$progdir/\$program \${1+\"\$@\"}
 
5401
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
4954
5402
"
4955
5403
          ;;
4956
5404
        esac
4960
5408
    fi
4961
5409
  else
4962
5410
    # The program doesn't exist.
4963
 
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
 
5411
    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4964
5412
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4965
5413
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4966
5414
    exit $EXIT_FAILURE
4992
5440
 
4993
5441
      if test -n "$addlibs"; then
4994
5442
        gentop="$output_objdir/${outputname}x"
4995
 
        $show "${rm}r $gentop"
4996
 
        $run ${rm}r "$gentop"
4997
 
        $show "$mkdir $gentop"
4998
 
        $run $mkdir "$gentop"
4999
 
        status=$?
5000
 
        if test "$status" -ne 0 && test ! -d "$gentop"; then
5001
 
          exit $status
5002
 
        fi
5003
5443
        generated="$generated $gentop"
5004
5444
 
5005
 
        # Add in members from convenience archives.
5006
 
        for xlib in $addlibs; do
5007
 
          # Extract the objects.
5008
 
          case $xlib in
5009
 
          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5010
 
          *) xabs=`pwd`"/$xlib" ;;
5011
 
          esac
5012
 
          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5013
 
          xdir="$gentop/$xlib"
5014
 
 
5015
 
          $show "${rm}r $xdir"
5016
 
          $run ${rm}r "$xdir"
5017
 
          $show "$mkdir $xdir"
5018
 
          $run $mkdir "$xdir"
5019
 
          status=$?
5020
 
          if test "$status" -ne 0 && test ! -d "$xdir"; then
5021
 
            exit $status
5022
 
          fi
5023
 
          # We will extract separately just the conflicting names and we will no
5024
 
          # longer touch any unique names. It is faster to leave these extract
5025
 
          # automatically by $AR in one run.
5026
 
          $show "(cd $xdir && $AR x $xabs)"
5027
 
          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5028
 
          if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5029
 
            :
5030
 
          else
5031
 
            $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5032
 
            $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5033
 
            $AR t "$xabs" | sort | uniq -cd | while read -r count name
5034
 
            do
5035
 
              i=1
5036
 
              while test "$i" -le "$count"
5037
 
              do
5038
 
               # Put our $i before any first dot (extension)
5039
 
               # Never overwrite any file
5040
 
               name_to="$name"
5041
 
               while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5042
 
               do
5043
 
                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5044
 
               done
5045
 
               $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5046
 
               $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5047
 
               i=`expr $i + 1`
5048
 
              done
5049
 
            done
5050
 
          fi
5051
 
 
5052
 
          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5053
 
        done
 
5445
        func_extract_archives $gentop $addlibs
 
5446
        oldobjs="$oldobjs $func_extract_archives_result"
5054
5447
      fi
5055
5448
 
5056
5449
      # Do each command in the archive commands.
5057
5450
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5058
5451
       cmds=$old_archive_from_new_cmds
5059
5452
      else
 
5453
        # POSIX demands no paths to be encoded in archives.  We have
 
5454
        # to avoid creating archives with duplicate basenames if we
 
5455
        # might have to extract them afterwards, e.g., when creating a
 
5456
        # static archive out of a convenience library, or when linking
 
5457
        # the entirety of a libtool archive into another (currently
 
5458
        # not supported by libtool).
 
5459
        if (for obj in $oldobjs
 
5460
            do
 
5461
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
 
5462
            done | sort | sort -uc >/dev/null 2>&1); then
 
5463
          :
 
5464
        else
 
5465
          $echo "copying selected object files to avoid basename conflicts..."
 
5466
 
 
5467
          if test -z "$gentop"; then
 
5468
            gentop="$output_objdir/${outputname}x"
 
5469
            generated="$generated $gentop"
 
5470
 
 
5471
            $show "${rm}r $gentop"
 
5472
            $run ${rm}r "$gentop"
 
5473
            $show "$mkdir $gentop"
 
5474
            $run $mkdir "$gentop"
 
5475
            exit_status=$?
 
5476
            if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
 
5477
              exit $exit_status
 
5478
            fi
 
5479
          fi
 
5480
 
 
5481
          save_oldobjs=$oldobjs
 
5482
          oldobjs=
 
5483
          counter=1
 
5484
          for obj in $save_oldobjs
 
5485
          do
 
5486
            objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
 
5487
            case " $oldobjs " in
 
5488
            " ") oldobjs=$obj ;;
 
5489
            *[\ /]"$objbase "*)
 
5490
              while :; do
 
5491
                # Make sure we don't pick an alternate name that also
 
5492
                # overlaps.
 
5493
                newobj=lt$counter-$objbase
 
5494
                counter=`expr $counter + 1`
 
5495
                case " $oldobjs " in
 
5496
                *[\ /]"$newobj "*) ;;
 
5497
                *) if test ! -f "$gentop/$newobj"; then break; fi ;;
 
5498
                esac
 
5499
              done
 
5500
              $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
 
5501
              $run ln "$obj" "$gentop/$newobj" ||
 
5502
              $run cp "$obj" "$gentop/$newobj"
 
5503
              oldobjs="$oldobjs $gentop/$newobj"
 
5504
              ;;
 
5505
            *) oldobjs="$oldobjs $obj" ;;
 
5506
            esac
 
5507
          done
 
5508
        fi
 
5509
 
5060
5510
        eval cmds=\"$old_archive_cmds\"
5061
5511
 
5062
5512
        if len=`expr "X$cmds" : ".*"` &&
5070
5520
          objlist=
5071
5521
          concat_cmds=
5072
5522
          save_oldobjs=$oldobjs
5073
 
          # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5074
 
          # encoded into archives.  This makes 'ar r' malfunction in
5075
 
          # this piecewise linking case whenever conflicting object
5076
 
          # names appear in distinct ar calls; check, warn and compensate.
5077
 
            if (for obj in $save_oldobjs
5078
 
            do
5079
 
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
5080
 
            done | sort | sort -uc >/dev/null 2>&1); then
5081
 
            :
5082
 
          else
5083
 
            $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5084
 
            $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5085
 
            AR_FLAGS=cq
5086
 
          fi
 
5523
 
5087
5524
          # Is there a better way of finding the last object in the list?
5088
5525
          for obj in $save_oldobjs
5089
5526
          do
5094
5531
            oldobjs="$objlist $obj"
5095
5532
            objlist="$objlist $obj"
5096
5533
            eval test_cmds=\"$old_archive_cmds\"
5097
 
            if len=`expr "X$test_cmds" : ".*"` &&
 
5534
            if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5098
5535
               test "$len" -le "$max_cmd_len"; then
5099
5536
              :
5100
5537
            else
5291
5728
    # install_prog (especially on Windows NT).
5292
5729
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5293
5730
       # Allow the use of GNU shtool's install command.
5294
 
       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
 
5731
       $echo "X$nonopt" | grep shtool > /dev/null; then
5295
5732
      # Aesthetically quote it.
5296
5733
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5297
5734
      case $arg in
5298
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5735
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5299
5736
        arg="\"$arg\""
5300
5737
        ;;
5301
5738
      esac
5304
5741
      shift
5305
5742
    else
5306
5743
      install_prog=
5307
 
      arg="$nonopt"
 
5744
      arg=$nonopt
5308
5745
    fi
5309
5746
 
5310
5747
    # The real first argument should be the name of the installation program.
5311
5748
    # Aesthetically quote it.
5312
5749
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5313
5750
    case $arg in
5314
 
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
 
5751
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
5315
5752
      arg="\"$arg\""
5316
5753
      ;;
5317
5754
    esac
5329
5766
    do
5330
5767
      if test -n "$dest"; then
5331
5768
        files="$files $dest"
5332
 
        dest="$arg"
 
5769
        dest=$arg
5333
5770
        continue
5334
5771
      fi
5335
5772
 
5336
5773
      case $arg in
5337
5774
      -d) isdir=yes ;;
5338
 
      -f) prev="-f" ;;
5339
 
      -g) prev="-g" ;;
5340
 
      -m) prev="-m" ;;
5341
 
      -o) prev="-o" ;;
 
5775
      -f) 
 
5776
        case " $install_prog " in
 
5777
        *[\\\ /]cp\ *) ;;
 
5778
        *) prev=$arg ;;
 
5779
        esac
 
5780
        ;;
 
5781
      -g | -m | -o) prev=$arg ;;
5342
5782
      -s)
5343
5783
        stripme=" -s"
5344
5784
        continue
5345
5785
        ;;
5346
 
      -*) ;;
5347
 
 
 
5786
      -*)
 
5787
        ;;
5348
5788
      *)
5349
5789
        # If the previous option needed an argument, then skip it.
5350
5790
        if test -n "$prev"; then
5351
5791
          prev=
5352
5792
        else
5353
 
          dest="$arg"
 
5793
          dest=$arg
5354
5794
          continue
5355
5795
        fi
5356
5796
        ;;
5359
5799
      # Aesthetically quote the argument.
5360
5800
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5361
5801
      case $arg in
5362
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5802
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5363
5803
        arg="\"$arg\""
5364
5804
        ;;
5365
5805
      esac
5528
5968
 
5529
5969
          if test "$#" -gt 0; then
5530
5970
            # Delete the old symlinks, and create new ones.
 
5971
            # Try `ln -sf' first, because the `ln' binary might depend on
 
5972
            # the symlink we replace!  Solaris /bin/ln does not understand -f,
 
5973
            # so we also need to try rm && ln -s.
5531
5974
            for linkname
5532
5975
            do
5533
5976
              if test "$linkname" != "$realname"; then
5534
 
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5535
 
                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
 
5977
                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
 
5978
                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5536
5979
              fi
5537
5980
            done
5538
5981
          fi
5545
5988
            IFS="$save_ifs"
5546
5989
            eval cmd=\"$cmd\"
5547
5990
            $show "$cmd"
5548
 
            $run eval "$cmd" || exit $?
 
5991
            $run eval "$cmd" || {
 
5992
              lt_exit=$?
 
5993
 
 
5994
              # Restore the uninstalled library and exit
 
5995
              if test "$mode" = relink; then
 
5996
                $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
 
5997
              fi
 
5998
 
 
5999
              exit $lt_exit
 
6000
            }
5549
6001
          done
5550
6002
          IFS="$save_ifs"
5551
6003
        fi
5639
6091
          notinst_deplibs=
5640
6092
          relink_command=
5641
6093
 
5642
 
          # To insure that "foo" is sourced, and not "foo.exe",
5643
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5644
 
          # which disallows the automatic-append-.exe behavior.
5645
 
          case $build in
5646
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5647
 
          *) wrapperdot=${wrapper} ;;
5648
 
          esac
 
6094
          # Note that it is not necessary on cygwin/mingw to append a dot to
 
6095
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
 
6096
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
 
6097
          # `FILE.' does not work on cygwin managed mounts.
 
6098
          #
5649
6099
          # If there is no directory component, then add one.
5650
 
          case $file in
5651
 
          */* | *\\*) . ${wrapperdot} ;;
5652
 
          *) . ./${wrapperdot} ;;
 
6100
          case $wrapper in
 
6101
          */* | *\\*) . ${wrapper} ;;
 
6102
          *) . ./${wrapper} ;;
5653
6103
          esac
5654
6104
 
5655
6105
          # Check the variables that should have been set.
5677
6127
          done
5678
6128
 
5679
6129
          relink_command=
5680
 
          # To insure that "foo" is sourced, and not "foo.exe",
5681
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5682
 
          # which disallows the automatic-append-.exe behavior.
5683
 
          case $build in
5684
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5685
 
          *) wrapperdot=${wrapper} ;;
5686
 
          esac
 
6130
          # Note that it is not necessary on cygwin/mingw to append a dot to
 
6131
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
 
6132
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
 
6133
          # `FILE.' does not work on cygwin managed mounts.
 
6134
          #
5687
6135
          # If there is no directory component, then add one.
5688
 
          case $file in
5689
 
          */* | *\\*) . ${wrapperdot} ;;
5690
 
          *) . ./${wrapperdot} ;;
 
6136
          case $wrapper in
 
6137
          */* | *\\*) . ${wrapper} ;;
 
6138
          *) . ./${wrapper} ;;
5691
6139
          esac
5692
6140
 
5693
6141
          outputname=
5694
6142
          if test "$fast_install" = no && test -n "$relink_command"; then
5695
6143
            if test "$finalize" = yes && test -z "$run"; then
5696
 
              tmpdir="/tmp"
5697
 
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
5698
 
              tmpdir="$tmpdir/libtool-$$"
5699
 
              save_umask=`umask`
5700
 
              umask 0077
5701
 
              if $mkdir "$tmpdir"; then
5702
 
                umask $save_umask
5703
 
              else
5704
 
                umask $save_umask
5705
 
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5706
 
                continue
5707
 
              fi
 
6144
              tmpdir=`func_mktempdir`
5708
6145
              file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5709
6146
              outputname="$tmpdir/$file"
5710
6147
              # Replace the output file specification.
5728
6165
        fi
5729
6166
 
5730
6167
        # remove .exe since cygwin /usr/bin/install will append another
5731
 
        # one anyways
 
6168
        # one anyway 
5732
6169
        case $install_prog,$host in
5733
6170
        */usr/bin/install*,*cygwin*)
5734
6171
          case $file:$destfile in
5828
6265
    # Exit here if they wanted silent mode.
5829
6266
    test "$show" = : && exit $EXIT_SUCCESS
5830
6267
 
5831
 
    $echo "----------------------------------------------------------------------"
 
6268
    $echo "X----------------------------------------------------------------------" | $Xsed
5832
6269
    $echo "Libraries have been installed in:"
5833
6270
    for libdir in $libdirs; do
5834
6271
      $echo "   $libdir"
5861
6298
    $echo
5862
6299
    $echo "See any operating system documentation about shared libraries for"
5863
6300
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5864
 
    $echo "----------------------------------------------------------------------"
 
6301
    $echo "X----------------------------------------------------------------------" | $Xsed
5865
6302
    exit $EXIT_SUCCESS
5866
6303
    ;;
5867
6304
 
6078
6515
            rmfiles="$rmfiles $objdir/$n"
6079
6516
          done
6080
6517
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6081
 
          test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6082
6518
 
6083
 
          if test "$mode" = uninstall; then
 
6519
          case "$mode" in
 
6520
          clean)
 
6521
            case "  $library_names " in
 
6522
            # "  " in the beginning catches empty $dlname
 
6523
            *" $dlname "*) ;;
 
6524
            *) rmfiles="$rmfiles $objdir/$dlname" ;;
 
6525
            esac
 
6526
             test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
6527
            ;;
 
6528
          uninstall)
6084
6529
            if test -n "$library_names"; then
6085
6530
              # Do each command in the postuninstall commands.
6086
6531
              cmds=$postuninstall_cmds
6113
6558
              IFS="$save_ifs"
6114
6559
            fi
6115
6560
            # FIXME: should reinstall the best remaining shared library.
6116
 
          fi
 
6561
            ;;
 
6562
          esac
6117
6563
        fi
6118
6564
        ;;
6119
6565
 
6398
6844
$echo
6399
6845
$echo "Try \`$modename --help' for more information about other modes."
6400
6846
 
6401
 
exit $EXIT_SUCCESS
 
6847
exit $?
6402
6848
 
6403
6849
# The TAGs below are defined such that we never get into a situation
6404
6850
# in which we disable both kinds of libraries.  Given conflicting
6412
6858
# configuration.  But we'll never go from static-only to shared-only.
6413
6859
 
6414
6860
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6415
 
build_libtool_libs=no
6416
 
build_old_libs=yes
 
6861
disable_libs=shared
6417
6862
# ### END LIBTOOL TAG CONFIG: disable-shared
6418
6863
 
6419
6864
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6420
 
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
 
6865
disable_libs=static
6421
6866
# ### END LIBTOOL TAG CONFIG: disable-static
6422
6867
 
6423
6868
# Local Variables: