~ubuntu-branches/ubuntu/intrepid/xfce4-panel/intrepid

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Jani Monoses
  • Date: 2006-09-12 15:36:53 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20060912153653-sajops08au69e9r6
Tags: 4.3.99.1-0ubuntu1
* New upstream release (4.4RC1)
* Bumped library and policy versions

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, 2005
 
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
20
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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.22 Debian 1.5.22-4"
47
 
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
 
46
VERSION=1.5.6
 
47
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
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
54
49
 
55
50
# Check that we have a working $echo.
56
51
if test "X$1" = X--no-reexec; then
88
83
Xsed="${SED}"' -e 1s/^X//'
89
84
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
90
85
# test EBCDIC or ASCII
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'
 
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'"
96
90
  ;;
97
 
 *) # EBCDIC based system
98
 
  SP2NL='tr \100 \n'
99
 
  NL2SP='tr \r\n \100\100'
 
91
 *) # Assume ASCII based system
 
92
  SP2NL="tr '\040' '\012'"
 
93
  NL2SP="tr '\015\012' '\040\040'"
100
94
  ;;
101
95
esac
102
96
 
113
107
fi
114
108
 
115
109
# Make sure IFS has a sensible default
116
 
lt_nl='
117
 
'
118
 
IFS="   $lt_nl"
 
110
: ${IFS="       
 
111
"}
119
112
 
120
113
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
121
114
  $echo "$modename: not configured to build any kind of library" 1>&2
132
125
show="$echo"
133
126
show_help=
134
127
execute_dlfiles=
135
 
duplicate_deps=no
136
 
preserve_args=
137
128
lo2o="s/\\.lo\$/.${objext}/"
138
129
o2lo="s/\\.${objext}\$/.lo/"
139
130
 
141
132
# Shell function definitions:
142
133
# This seems to be the best place for them
143
134
 
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
 
 
181
135
# func_win32_libid arg
182
136
# return the library type of file 'arg'
183
137
#
184
138
# Need a lot of goo to handle *both* DLLs and import libs
185
139
# Has to be a shell function in order to 'eat' the argument
186
140
# that is supplied when $file_magic_command is called.
187
 
func_win32_libid ()
188
 
{
 
141
func_win32_libid () {
189
142
  win32_libid_type="unknown"
190
143
  win32_fileres=`file -L $1 2>/dev/null`
191
144
  case $win32_fileres in
196
149
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
197
150
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
198
151
      win32_nmres=`eval $NM -f posix -A $1 | \
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
 
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
204
158
    fi
205
159
    ;;
206
160
  *DLL*)
224
178
# Only attempt this if the compiler in the base compile
225
179
# command doesn't match the default compiler.
226
180
# arg is usually of the form 'gcc ...'
227
 
func_infer_tag ()
228
 
{
 
181
func_infer_tag () {
229
182
    if test -n "$available_tags" && test -z "$tagname"; then
230
183
      CC_quoted=
231
184
      for arg in $CC; do
282
235
      esac
283
236
    fi
284
237
}
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
 
}
387
238
# End of Shell function definitions
388
239
#####################################
389
240
 
390
241
# Darwin sucks
391
242
eval std_shrext=\"$shrext_cmds\"
392
243
 
393
 
disable_libs=no
394
 
 
395
244
# Parse our command line options once, thoroughly.
396
245
while test "$#" -gt 0
397
246
do
456
305
  --version)
457
306
    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
458
307
    $echo
459
 
    $echo "Copyright (C) 2005  Free Software Foundation, Inc."
 
308
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
460
309
    $echo "This is free software; see the source for copying conditions.  There is NO"
461
310
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
462
 
    exit $?
 
311
    exit $EXIT_SUCCESS
463
312
    ;;
464
313
 
465
314
  --config)
468
317
    for tagname in $taglist; do
469
318
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
470
319
    done
471
 
    exit $?
 
320
    exit $EXIT_SUCCESS
472
321
    ;;
473
322
 
474
323
  --debug)
493
342
    else
494
343
      $echo "disable static libraries"
495
344
    fi
496
 
    exit $?
 
345
    exit $EXIT_SUCCESS
497
346
    ;;
498
347
 
499
348
  --finish) mode="finish" ;;
508
357
    preserve_args="$preserve_args $arg"
509
358
    ;;
510
359
 
511
 
  --tag)
512
 
    prevopt="--tag"
513
 
    prev=tag
514
 
    preserve_args="$preserve_args --tag"
515
 
    ;;
 
360
  --tag) prevopt="--tag" prev=tag ;;
516
361
  --tag=*)
517
362
    set tag "$optarg" ${1+"$@"}
518
363
    shift
544
389
  exit $EXIT_FAILURE
545
390
fi
546
391
 
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
 
 
559
392
# If this variable is set in any of the actions, the command in it
560
393
# will be execed at the end.  This prevents here-documents from being
561
394
# left over by shells.
566
399
  # Infer the operation mode.
567
400
  if test -z "$mode"; then
568
401
    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
569
 
    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
 
402
    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
570
403
    case $nonopt in
571
404
    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
572
405
      mode=link
632
465
 
633
466
    for arg
634
467
    do
635
 
      case $arg_mode in
 
468
      case "$arg_mode" in
636
469
      arg  )
637
470
        # do not "continue".  Instead, add this to base_compile
638
471
        lastarg="$arg"
714
547
      case $lastarg in
715
548
      # Double-quote args containing other shell metacharacters.
716
549
      # Many Bourne shells cannot handle close brackets correctly
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.
 
550
      # in scan sets, so we specify it separately.
721
551
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
722
552
        lastarg="\"$lastarg\""
723
553
        ;;
791
621
      esac
792
622
    done
793
623
 
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."
802
624
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
803
625
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
804
626
    if test "X$xdir" = "X$obj"; then
871
693
        $run $rm $removelist
872
694
        exit $EXIT_FAILURE
873
695
      fi
874
 
      $echo "$srcfile" > "$lockfile"
 
696
      $echo $srcfile > "$lockfile"
875
697
    fi
876
698
 
877
699
    if test -n "$fix_srcfile_path"; then
878
700
      eval srcfile=\"$fix_srcfile_path\"
879
701
    fi
880
 
    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
881
 
    case $qsrcfile in
882
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
883
 
      qsrcfile="\"$qsrcfile\"" ;;
884
 
    esac
885
702
 
886
703
    $run $rm "$libobj" "${libobj}T"
887
704
 
903
720
      fbsd_hideous_sh_bug=$base_compile
904
721
 
905
722
      if test "$pic_mode" != no; then
906
 
        command="$base_compile $qsrcfile $pic_flag"
 
723
        command="$base_compile $srcfile $pic_flag"
907
724
      else
908
725
        # Don't build PIC code
909
 
        command="$base_compile $qsrcfile"
 
726
        command="$base_compile $srcfile"
910
727
      fi
911
728
 
912
729
      if test ! -d "${xdir}$objdir"; then
913
730
        $show "$mkdir ${xdir}$objdir"
914
731
        $run $mkdir ${xdir}$objdir
915
 
        exit_status=$?
916
 
        if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
917
 
          exit $exit_status
 
732
        status=$?
 
733
        if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
 
734
          exit $status
918
735
        fi
919
736
      fi
920
737
 
986
803
    if test "$build_old_libs" = yes; then
987
804
      if test "$pic_mode" != yes; then
988
805
        # Don't build PIC code
989
 
        command="$base_compile $qsrcfile"
 
806
        command="$base_compile $srcfile"
990
807
      else
991
 
        command="$base_compile $qsrcfile $pic_flag"
 
808
        command="$base_compile $srcfile $pic_flag"
992
809
      fi
993
810
      if test "$compiler_c_o" = yes; then
994
811
        command="$command -o $obj"
1117
934
    no_install=no
1118
935
    objs=
1119
936
    non_pic_objects=
1120
 
    notinst_path= # paths that contain not-installed libtool libraries
1121
937
    precious_files_regex=
1122
938
    prefer_static_libs=no
1123
939
    preload=no
1146
962
          if test -n "$link_static_flag"; then
1147
963
            dlopen_self=$dlopen_self_static
1148
964
          fi
1149
 
          prefer_static_libs=yes
1150
965
        else
1151
966
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
1152
967
            dlopen_self=$dlopen_self_static
1153
968
          fi
1154
 
          prefer_static_libs=built
1155
969
        fi
1156
970
        build_libtool_libs=no
1157
971
        build_old_libs=yes
 
972
        prefer_static_libs=yes
1158
973
        break
1159
974
        ;;
1160
975
      esac
1329
1144
                  if test -z "$pic_object" || test "$pic_object" = none ; then
1330
1145
                    arg="$non_pic_object"
1331
1146
                  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"
1337
1147
                fi
1338
1148
              else
1339
1149
                # Only an error if not doing a dry-run.
1417
1227
          prev=
1418
1228
          continue
1419
1229
          ;;
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
 
          ;;
1427
1230
        *)
1428
1231
          eval "$prev=\"\$arg\""
1429
1232
          prev=
1482
1285
        continue
1483
1286
        ;;
1484
1287
 
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
 
 
1497
1288
      -inst-prefix-dir)
1498
1289
        prev=inst_prefix
1499
1290
        continue
1520
1311
          absdir=`cd "$dir" && pwd`
1521
1312
          if test -z "$absdir"; then
1522
1313
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1523
 
            absdir="$dir"
1524
 
            notinst_path="$notinst_path $dir"
 
1314
            exit $EXIT_FAILURE
1525
1315
          fi
1526
1316
          dir="$absdir"
1527
1317
          ;;
1535
1325
        esac
1536
1326
        case $host in
1537
1327
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
1538
 
          testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1539
1328
          case :$dllsearchpath: in
1540
1329
          *":$dir:"*) ;;
1541
1330
          *) dllsearchpath="$dllsearchpath:$dir";;
1542
1331
          esac
1543
 
          case :$dllsearchpath: in
1544
 
          *":$testbindir:"*) ;;
1545
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
1546
 
          esac
1547
1332
          ;;
1548
1333
        esac
1549
1334
        continue
1552
1337
      -l*)
1553
1338
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1554
1339
          case $host in
1555
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
 
1340
          *-*-cygwin* | *-*-pw32* | *-*-beos*)
1556
1341
            # These systems don't actually have a C or math library (as such)
1557
1342
            continue
1558
1343
            ;;
1559
 
          *-*-os2*)
 
1344
          *-*-mingw* | *-*-os2*)
1560
1345
            # These systems don't actually have a C library (as such)
1561
1346
            test "X$arg" = "X-lc" && continue
1562
1347
            ;;
1563
 
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 
1348
          *-*-openbsd* | *-*-freebsd*)
1564
1349
            # Do not include libc due to us having libc/libc_r.
1565
1350
            test "X$arg" = "X-lc" && continue
1566
1351
            ;;
1568
1353
            # Rhapsody C and math libraries are in the System framework
1569
1354
            deplibs="$deplibs -framework System"
1570
1355
            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
 
            ;;
1580
1356
          esac
1581
1357
        elif test "X$arg" = "X-lc_r"; then
1582
1358
         case $host in
1583
 
         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 
1359
         *-*-openbsd* | *-*-freebsd*)
1584
1360
           # Do not include libc_r directly, use -pthread flag.
1585
1361
           continue
1586
1362
           ;;
1590
1366
        continue
1591
1367
        ;;
1592
1368
 
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
 
 
1603
1369
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1604
 
        compiler_flags="$compiler_flags $arg"
1605
 
        compile_command="$compile_command $arg"
1606
 
        finalize_command="$finalize_command $arg"
 
1370
        deplibs="$deplibs $arg"
1607
1371
        continue
1608
1372
        ;;
1609
1373
 
1612
1376
        continue
1613
1377
        ;;
1614
1378
 
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
 
 
 
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*)
1628
1386
        # Unknown arguments in both finalize_command and compile_command need
1629
1387
        # to be aesthetically quoted because they are evaled later.
1630
1388
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1635
1393
        esac
1636
1394
        compile_command="$compile_command $arg"
1637
1395
        finalize_command="$finalize_command $arg"
1638
 
        compiler_flags="$compiler_flags $arg"
 
1396
        if test "$with_gcc" = "yes" ; then
 
1397
          compiler_flags="$compiler_flags $arg"
 
1398
        fi
1639
1399
        continue
1640
1400
        ;;
1641
1401
 
1873
1633
            if test -z "$pic_object" || test "$pic_object" = none ; then
1874
1634
              arg="$non_pic_object"
1875
1635
            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"
1881
1636
          fi
1882
1637
        else
1883
1638
          # Only an error if not doing a dry-run.
1983
1738
    if test ! -d "$output_objdir"; then
1984
1739
      $show "$mkdir $output_objdir"
1985
1740
      $run $mkdir $output_objdir
1986
 
      exit_status=$?
1987
 
      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
1988
 
        exit $exit_status
 
1741
      status=$?
 
1742
      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
 
1743
        exit $status
1989
1744
      fi
1990
1745
    fi
1991
1746
 
2048
1803
    newlib_search_path=
2049
1804
    need_relink=no # whether we're linking any uninstalled libtool libraries
2050
1805
    notinst_deplibs= # not-installed libtool libraries
 
1806
    notinst_path= # paths that contain not-installed libtool libraries
2051
1807
    case $linkmode in
2052
1808
    lib)
2053
1809
        passes="conv link"
2082
1838
        case $pass in
2083
1839
        dlopen) libs="$dlfiles" ;;
2084
1840
        dlpreopen) libs="$dlprefiles" ;;
2085
 
        link)
2086
 
          libs="$deplibs %DEPLIBS%"
2087
 
          test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
2088
 
          ;;
 
1841
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
2089
1842
        esac
2090
1843
      fi
2091
1844
      if test "$pass" = dlopen; then
2102
1855
            compile_deplibs="$deplib $compile_deplibs"
2103
1856
            finalize_deplibs="$deplib $finalize_deplibs"
2104
1857
          else
2105
 
            compiler_flags="$compiler_flags $deplib"
 
1858
            deplibs="$deplib $deplibs"
2106
1859
          fi
2107
1860
          continue
2108
1861
          ;;
2111
1864
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
2112
1865
            continue
2113
1866
          fi
 
1867
          if test "$pass" = conv; then
 
1868
            deplibs="$deplib $deplibs"
 
1869
            continue
 
1870
          fi
2114
1871
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
2115
1872
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
2116
1873
            for search_ext in .la $std_shrext .so .a; do
2221
1978
          fi
2222
1979
          case $linkmode in
2223
1980
          lib)
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
            if test "$deplibs_check_method" != pass_all; then
2240
1982
              $echo
2241
1983
              $echo "*** Warning: Trying to link with static lib archive $deplib."
2242
1984
              $echo "*** I have the capability to make that library automatically link in when"
2286
2028
        esac # case $deplib
2287
2029
        if test "$found" = yes || test -f "$lib"; then :
2288
2030
        else
2289
 
          $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
 
2031
          $echo "$modename: cannot find the library \`$lib'" 1>&2
2290
2032
          exit $EXIT_FAILURE
2291
2033
        fi
2292
2034
 
2310
2052
        # it will not redefine variables installed, or shouldnotlink
2311
2053
        installed=yes
2312
2054
        shouldnotlink=no
2313
 
        avoidtemprpath=
2314
 
 
2315
2055
 
2316
2056
        # Read the .la file
2317
2057
        case $lib in
2410
2150
            dir="$libdir"
2411
2151
            absdir="$libdir"
2412
2152
          fi
2413
 
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2414
2153
        else
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
 
2154
          dir="$ladir/$objdir"
 
2155
          absdir="$abs_ladir/$objdir"
 
2156
          # Remove this search path later
 
2157
          notinst_path="$notinst_path $abs_ladir"
2426
2158
        fi # $installed = yes
2427
2159
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2428
2160
 
2495
2227
          if test -n "$library_names" &&
2496
2228
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2497
2229
            # We need to hardcode the library path
2498
 
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
 
2230
            if test -n "$shlibpath_var"; then
2499
2231
              # Make sure the rpath contains only unique directories.
2500
2232
              case "$temp_rpath " in
2501
2233
              *" $dir "*) ;;
2502
2234
              *" $absdir "*) ;;
2503
 
              *) temp_rpath="$temp_rpath $absdir" ;;
 
2235
              *) temp_rpath="$temp_rpath $dir" ;;
2504
2236
              esac
2505
2237
            fi
2506
2238
 
2537
2269
        fi
2538
2270
 
2539
2271
        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
2544
2272
        if test -n "$library_names" &&
2545
 
           { test "$use_static_libs" = no || test -z "$old_library"; }; then
 
2273
           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
2546
2274
          if test "$installed" = no; then
2547
2275
            notinst_deplibs="$notinst_deplibs $lib"
2548
2276
            need_relink=yes
2655
2383
              if test "$hardcode_direct" = no; then
2656
2384
                add="$dir/$linklib"
2657
2385
                case $host in
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
                  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
2662
2387
                  *-*-darwin* )
2663
2388
                    # if the lib is a module then we can not link against
2664
2389
                    # it, someone is ignoring the new warnings I added
2665
 
                    if /usr/bin/file -L $add 2> /dev/null |
2666
 
                      $EGREP ": [^:]* bundle" >/dev/null ; then
 
2390
                    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
2667
2391
                      $echo "** Warning, lib $linklib is a module, not a shared library"
2668
2392
                      if test -z "$old_library" ; then
2669
2393
                        $echo
2694
2418
                add_dir="-L$dir"
2695
2419
                # Try looking first in the location we're being installed to.
2696
2420
                if test -n "$inst_prefix_dir"; then
2697
 
                  case $libdir in
 
2421
                  case "$libdir" in
2698
2422
                    [\\/]*)
2699
2423
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
2700
2424
                      ;;
2767
2491
              add_dir="-L$libdir"
2768
2492
              # Try looking first in the location we're being installed to.
2769
2493
              if test -n "$inst_prefix_dir"; then
2770
 
                case $libdir in
 
2494
                case "$libdir" in
2771
2495
                  [\\/]*)
2772
2496
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
2773
2497
                    ;;
2828
2552
              fi
2829
2553
            fi
2830
2554
          else
 
2555
            convenience="$convenience $dir/$old_library"
 
2556
            old_convenience="$old_convenience $dir/$old_library"
2831
2557
            deplibs="$dir/$old_library $deplibs"
2832
2558
            link_static=yes
2833
2559
          fi
2945
2671
              *) continue ;;
2946
2672
              esac
2947
2673
              case " $deplibs " in
2948
 
              *" $path "*) ;;
2949
 
              *) deplibs="$path $deplibs" ;;
2950
 
              esac
2951
 
              case " $deplibs " in
2952
2674
              *" $depdepl "*) ;;
2953
2675
              *) deplibs="$depdepl $deplibs" ;;
2954
2676
              esac
 
2677
              case " $deplibs " in
 
2678
              *" $path "*) ;;
 
2679
              *) deplibs="$deplibs $path" ;;
 
2680
              esac
2955
2681
            done
2956
2682
          fi # link_all_deplibs != no
2957
2683
        fi # linkmode = lib
3204
2930
            age="$number_minor"
3205
2931
            revision="$number_minor"
3206
2932
            ;;
3207
 
          *)
3208
 
            $echo "$modename: unknown library version type \`$version_type'" 1>&2
3209
 
            $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
3210
 
            exit $EXIT_FAILURE
3211
 
            ;;
3212
2933
          esac
3213
2934
          ;;
3214
2935
        no)
3220
2941
 
3221
2942
        # Check that each of the things are valid numbers.
3222
2943
        case $current in
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]) ;;
 
2944
        [0-9]*) ;;
3224
2945
        *)
3225
 
          $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
 
2946
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
3226
2947
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3227
2948
          exit $EXIT_FAILURE
3228
2949
          ;;
3229
2950
        esac
3230
2951
 
3231
2952
        case $revision in
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]) ;;
 
2953
        [0-9]*) ;;
3233
2954
        *)
3234
 
          $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
 
2955
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
3235
2956
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3236
2957
          exit $EXIT_FAILURE
3237
2958
          ;;
3238
2959
        esac
3239
2960
 
3240
2961
        case $age in
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]) ;;
 
2962
        [0-9]*) ;;
3242
2963
        *)
3243
 
          $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
 
2964
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
3244
2965
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
3245
2966
          exit $EXIT_FAILURE
3246
2967
          ;;
3266
2987
          versuffix="$major.$age.$revision"
3267
2988
          # Darwin ld doesn't like 0 for these options...
3268
2989
          minor_current=`expr $current + 1`
3269
 
          verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
 
2990
          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
3270
2991
          ;;
3271
2992
 
3272
2993
        freebsd-aout)
3419
3140
 
3420
3141
      # Eliminate all temporary directories.
3421
3142
      for path in $notinst_path; do
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"`
 
3143
        lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
 
3144
        deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
 
3145
        dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3425
3146
      done
3426
3147
 
3427
3148
      if test -n "$xrpath"; then
3472
3193
          *-*-netbsd*)
3473
3194
            # Don't link with libc until the a.out ld.so is fixed.
3474
3195
            ;;
3475
 
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
 
3196
          *-*-openbsd* | *-*-freebsd*)
3476
3197
            # Do not include libc due to us having libc/libc_r.
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
 
3198
            test "X$arg" = "X-lc" && continue
3483
3199
            ;;
3484
3200
          *)
3485
3201
            # Add libc to deplibs on all other systems if necessary.
3523
3239
          int main() { return 0; }
3524
3240
EOF
3525
3241
          $rm conftest
3526
 
          $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
 
3242
          $LTCC -o conftest conftest.c $deplibs
3527
3243
          if test "$?" -eq 0 ; then
3528
3244
            ldd_output=`ldd conftest`
3529
3245
            for i in $deplibs; do
3530
 
              name=`expr $i : '-l\(.*\)'`
 
3246
              name="`expr $i : '-l\(.*\)'`"
3531
3247
              # If $name is empty we are operating on a -L argument.
3532
3248
              if test "$name" != "" && test "$name" -ne "0"; then
3533
3249
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3564
3280
            # Error occurred in the first compile.  Let's try to salvage
3565
3281
            # the situation: Compile a separate program for each library.
3566
3282
            for i in $deplibs; do
3567
 
              name=`expr $i : '-l\(.*\)'`
 
3283
              name="`expr $i : '-l\(.*\)'`"
3568
3284
              # If $name is empty we are operating on a -L argument.
3569
3285
              if test "$name" != "" && test "$name" != "0"; then
3570
3286
                $rm conftest
3571
 
                $LTCC $LTCFLAGS -o conftest conftest.c $i
 
3287
                $LTCC -o conftest conftest.c $i
3572
3288
                # Did it work?
3573
3289
                if test "$?" -eq 0 ; then
3574
3290
                  ldd_output=`ldd conftest`
3616
3332
          set dummy $deplibs_check_method
3617
3333
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3618
3334
          for a_deplib in $deplibs; do
3619
 
            name=`expr $a_deplib : '-l\(.*\)'`
 
3335
            name="`expr $a_deplib : '-l\(.*\)'`"
3620
3336
            # If $name is empty we are operating on a -L argument.
3621
3337
            if test "$name" != "" && test  "$name" != "0"; then
3622
3338
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3685
3401
          set dummy $deplibs_check_method
3686
3402
          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3687
3403
          for a_deplib in $deplibs; do
3688
 
            name=`expr $a_deplib : '-l\(.*\)'`
 
3404
            name="`expr $a_deplib : '-l\(.*\)'`"
3689
3405
            # If $name is empty we are operating on a -L argument.
3690
3406
            if test -n "$name" && test "$name" != "0"; then
3691
3407
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3815
3531
        deplibs=$newdeplibs
3816
3532
      fi
3817
3533
 
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
 
 
3847
3534
      # All the library-specific variables (install_libdir is set above).
3848
3535
      library_names=
3849
3536
      old_library=
3927
3614
        fi
3928
3615
 
3929
3616
        lib="$output_objdir/$realname"
3930
 
        linknames=
3931
3617
        for link
3932
3618
        do
3933
3619
          linknames="$linknames $link"
3956
3642
                # The command line is too long to execute in one step.
3957
3643
                $show "using reloadable object file for export list..."
3958
3644
                skipped_export=:
3959
 
                # Break out early, otherwise skipped_export may be
3960
 
                # set to false by a later but shorter cmd.
3961
 
                break
3962
3645
              fi
3963
3646
            done
3964
3647
            IFS="$save_ifs"
3992
3675
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3993
3676
          else
3994
3677
            gentop="$output_objdir/${outputname}x"
 
3678
            $show "${rm}r $gentop"
 
3679
            $run ${rm}r "$gentop"
 
3680
            $show "$mkdir $gentop"
 
3681
            $run $mkdir "$gentop"
 
3682
            status=$?
 
3683
            if test "$status" -ne 0 && test ! -d "$gentop"; then
 
3684
              exit $status
 
3685
            fi
3995
3686
            generated="$generated $gentop"
3996
3687
 
3997
 
            func_extract_archives $gentop $convenience
3998
 
            libobjs="$libobjs $func_extract_archives_result"
 
3688
            for xlib in $convenience; do
 
3689
              # Extract the objects.
 
3690
              case $xlib in
 
3691
              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
 
3692
              *) xabs=`pwd`"/$xlib" ;;
 
3693
              esac
 
3694
              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
 
3695
              xdir="$gentop/$xlib"
 
3696
 
 
3697
              $show "${rm}r $xdir"
 
3698
              $run ${rm}r "$xdir"
 
3699
              $show "$mkdir $xdir"
 
3700
              $run $mkdir "$xdir"
 
3701
              status=$?
 
3702
              if test "$status" -ne 0 && test ! -d "$xdir"; then
 
3703
                exit $status
 
3704
              fi
 
3705
              # We will extract separately just the conflicting names and we will no
 
3706
              # longer touch any unique names. It is faster to leave these extract
 
3707
              # automatically by $AR in one run.
 
3708
              $show "(cd $xdir && $AR x $xabs)"
 
3709
              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
 
3710
              if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
 
3711
                :
 
3712
              else
 
3713
                $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
 
3714
                $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
 
3715
                $AR t "$xabs" | sort | uniq -cd | while read -r count name
 
3716
                do
 
3717
                  i=1
 
3718
                  while test "$i" -le "$count"
 
3719
                  do
 
3720
                   # Put our $i before any first dot (extension)
 
3721
                   # Never overwrite any file
 
3722
                   name_to="$name"
 
3723
                   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
 
3724
                   do
 
3725
                     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
 
3726
                   done
 
3727
                   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
 
3728
                   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
 
3729
                   i=`expr $i + 1`
 
3730
                  done
 
3731
                done
 
3732
              fi
 
3733
 
 
3734
              libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
 
3735
            done
3999
3736
          fi
4000
3737
        fi
4001
 
        
 
3738
 
4002
3739
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
4003
3740
          eval flag=\"$thread_safe_flag_spec\"
4004
3741
          linker_flags="$linker_flags $flag"
4028
3765
          fi
4029
3766
        fi
4030
3767
 
4031
 
        if test "X$skipped_export" != "X:" &&
4032
 
           len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 
3768
        if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
4033
3769
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
4034
3770
          :
4035
3771
        else
4048
3784
            save_libobjs=$libobjs
4049
3785
          fi
4050
3786
          save_output=$output
4051
 
          output_la=`$echo "X$output" | $Xsed -e "$basename"`
4052
3787
 
4053
3788
          # Clear the reloadable object creation command queue and
4054
3789
          # initialize k to one.
4058
3793
          delfiles=
4059
3794
          last_robj=
4060
3795
          k=1
4061
 
          output=$output_objdir/$output_la-${k}.$objext
 
3796
          output=$output_objdir/$save_output-${k}.$objext
4062
3797
          # Loop over the list of objects to be linked.
4063
3798
          for obj in $save_libobjs
4064
3799
          do
4065
3800
            eval test_cmds=\"$reload_cmds $objlist $last_robj\"
4066
3801
            if test "X$objlist" = X ||
4067
 
               { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 
3802
               { len=`expr "X$test_cmds" : ".*"` &&
4068
3803
                 test "$len" -le "$max_cmd_len"; }; then
4069
3804
              objlist="$objlist $obj"
4070
3805
            else
4078
3813
                # the last one created.
4079
3814
                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
4080
3815
              fi
4081
 
              last_robj=$output_objdir/$output_la-${k}.$objext
 
3816
              last_robj=$output_objdir/$save_output-${k}.$objext
4082
3817
              k=`expr $k + 1`
4083
 
              output=$output_objdir/$output_la-${k}.$objext
 
3818
              output=$output_objdir/$save_output-${k}.$objext
4084
3819
              objlist=$obj
4085
3820
              len=1
4086
3821
            fi
4100
3835
            eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
4101
3836
          fi
4102
3837
 
4103
 
          # Set up a command to remove the reloadable object files
 
3838
          # Set up a command to remove the reloadale object files
4104
3839
          # after they are used.
4105
3840
          i=0
4106
3841
          while test "$i" -lt "$k"
4107
3842
          do
4108
3843
            i=`expr $i + 1`
4109
 
            delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
 
3844
            delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
4110
3845
          done
4111
3846
 
4112
3847
          $echo "creating a temporary reloadable object file: $output"
4154
3889
          IFS="$save_ifs"
4155
3890
          eval cmd=\"$cmd\"
4156
3891
          $show "$cmd"
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
 
          }
 
3892
          $run eval "$cmd" || exit $?
4167
3893
        done
4168
3894
        IFS="$save_ifs"
4169
3895
 
4170
3896
        # Restore the uninstalled library and exit
4171
3897
        if test "$mode" = relink; then
4172
3898
          $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
 
 
4181
3899
          exit $EXIT_SUCCESS
4182
3900
        fi
4183
3901
 
4255
3973
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
4256
3974
        else
4257
3975
          gentop="$output_objdir/${obj}x"
 
3976
          $show "${rm}r $gentop"
 
3977
          $run ${rm}r "$gentop"
 
3978
          $show "$mkdir $gentop"
 
3979
          $run $mkdir "$gentop"
 
3980
          status=$?
 
3981
          if test "$status" -ne 0 && test ! -d "$gentop"; then
 
3982
            exit $status
 
3983
          fi
4258
3984
          generated="$generated $gentop"
4259
3985
 
4260
 
          func_extract_archives $gentop $convenience
4261
 
          reload_conv_objs="$reload_objs $func_extract_archives_result"
 
3986
          for xlib in $convenience; do
 
3987
            # Extract the objects.
 
3988
            case $xlib in
 
3989
            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
 
3990
            *) xabs=`pwd`"/$xlib" ;;
 
3991
            esac
 
3992
            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
 
3993
            xdir="$gentop/$xlib"
 
3994
 
 
3995
            $show "${rm}r $xdir"
 
3996
            $run ${rm}r "$xdir"
 
3997
            $show "$mkdir $xdir"
 
3998
            $run $mkdir "$xdir"
 
3999
            status=$?
 
4000
            if test "$status" -ne 0 && test ! -d "$xdir"; then
 
4001
              exit $status
 
4002
            fi
 
4003
            # We will extract separately just the conflicting names and we will no
 
4004
            # longer touch any unique names. It is faster to leave these extract
 
4005
            # automatically by $AR in one run.
 
4006
            $show "(cd $xdir && $AR x $xabs)"
 
4007
            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
 
4008
            if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
 
4009
              :
 
4010
            else
 
4011
              $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
 
4012
              $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
 
4013
              $AR t "$xabs" | sort | uniq -cd | while read -r count name
 
4014
              do
 
4015
                i=1
 
4016
                while test "$i" -le "$count"
 
4017
                do
 
4018
                 # Put our $i before any first dot (extension)
 
4019
                 # Never overwrite any file
 
4020
                 name_to="$name"
 
4021
                 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
 
4022
                 do
 
4023
                   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
 
4024
                 done
 
4025
                 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
 
4026
                 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
 
4027
                 i=`expr $i + 1`
 
4028
                done
 
4029
              done
 
4030
            fi
 
4031
 
 
4032
            reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
 
4033
          done
4262
4034
        fi
4263
4035
      fi
4264
4036
 
4359
4131
        ;;
4360
4132
      esac
4361
4133
 
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
 
 
4391
4134
      compile_command="$compile_command $compile_deplibs"
4392
4135
      finalize_command="$finalize_command $finalize_deplibs"
4393
4136
 
4432
4175
        fi
4433
4176
        case $host in
4434
4177
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
4435
 
          testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4436
4178
          case :$dllsearchpath: in
4437
4179
          *":$libdir:"*) ;;
4438
4180
          *) dllsearchpath="$dllsearchpath:$libdir";;
4439
4181
          esac
4440
 
          case :$dllsearchpath: in
4441
 
          *":$testbindir:"*) ;;
4442
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
4443
 
          esac
4444
4182
          ;;
4445
4183
        esac
4446
4184
      done
4554
4292
 
4555
4293
            # Prepare the list of exported symbols
4556
4294
            if test -z "$export_symbols"; then
4557
 
              export_symbols="$output_objdir/$outputname.exp"
 
4295
              export_symbols="$output_objdir/$output.exp"
4558
4296
              $run $rm $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
 
4297
              $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
4566
4298
            else
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'
 
4299
              $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
 
4300
              $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
4569
4301
              $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
4576
4302
            fi
4577
4303
          fi
4578
4304
 
4623
4349
#endif
4624
4350
 
4625
4351
/* 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" "\
4639
4352
const struct {
4640
 
"
4641
 
              ;;
4642
 
            esac
4643
 
 
4644
 
 
4645
 
          $echo >> "$output_objdir/$dlsyms" "\
4646
4353
  const char *name;
4647
4354
  lt_ptr address;
4648
4355
}
4689
4396
          esac
4690
4397
 
4691
4398
          # Now compile the dynamic symbol file.
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 $?
 
4399
          $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
 
4400
          $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4694
4401
 
4695
4402
          # Clean up the generated files.
4696
4403
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4697
4404
          $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4698
4405
 
4699
4406
          # Transform the symbol file into the correct name.
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
 
4407
          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
4408
          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4715
4409
          ;;
4716
4410
        *)
4717
4411
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4736
4430
        # We have no uninstalled library dependencies, so finalize right now.
4737
4431
        $show "$link_command"
4738
4432
        $run eval "$link_command"
4739
 
        exit_status=$?
 
4433
        status=$?
4740
4434
 
4741
4435
        # Delete the generated files.
4742
4436
        if test -n "$dlsyms"; then
4744
4438
          $run $rm "$output_objdir/${outputname}S.${objext}"
4745
4439
        fi
4746
4440
 
4747
 
        exit $exit_status
 
4441
        exit $status
4748
4442
      fi
4749
4443
 
4750
4444
      if test -n "$shlibpath_var"; then
4884
4578
        esac
4885
4579
        case $host in
4886
4580
          *cygwin* | *mingw* )
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
 
4581
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
 
4582
            cwrapper=`$echo ${output}.exe`
 
4583
            $rm $cwrappersource $cwrapper
 
4584
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4893
4585
 
4894
4586
            cat > $cwrappersource <<EOF
4895
4587
 
4914
4606
#include <malloc.h>
4915
4607
#include <stdarg.h>
4916
4608
#include <assert.h>
4917
 
#include <string.h>
4918
 
#include <ctype.h>
4919
 
#include <sys/stat.h>
4920
4609
 
4921
4610
#if defined(PATH_MAX)
4922
4611
# define LT_PATHMAX PATH_MAX
4927
4616
#endif
4928
4617
 
4929
4618
#ifndef DIR_SEPARATOR
4930
 
# define DIR_SEPARATOR '/'
4931
 
# define PATH_SEPARATOR ':'
 
4619
#define DIR_SEPARATOR '/'
4932
4620
#endif
4933
4621
 
4934
4622
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4935
4623
  defined (__OS2__)
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
 
4624
#define HAVE_DOS_BASED_FILE_SYSTEM
 
4625
#ifndef DIR_SEPARATOR_2
 
4626
#define DIR_SEPARATOR_2 '\\'
 
4627
#endif
4943
4628
#endif
4944
4629
 
4945
4630
#ifndef DIR_SEPARATOR_2
4949
4634
        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4950
4635
#endif /* DIR_SEPARATOR_2 */
4951
4636
 
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
 
 
4958
4637
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
4959
4638
#define XFREE(stale) do { \
4960
4639
  if (stale) { free ((void *) stale); stale = 0; } \
4961
4640
} while (0)
4962
4641
 
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
 
 
4971
4642
const char *program_name = NULL;
4972
4643
 
4973
4644
void * xmalloc (size_t num);
4974
4645
char * xstrdup (const char *string);
4975
 
const char * base_name (const char *name);
4976
 
char * find_executable(const char *wrapper);
4977
 
int    check_executable(const char *path);
 
4646
char * basename (const char *name);
 
4647
char * fnqualify(const char *path);
4978
4648
char * strendzap(char *str, const char *pat);
4979
4649
void lt_fatal (const char *message, ...);
4980
4650
 
4984
4654
  char **newargz;
4985
4655
  int i;
4986
4656
 
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);
 
4657
  program_name = (char *) xstrdup ((char *) basename (argv[0]));
4990
4658
  newargz = XMALLOC(char *, argc+2);
4991
4659
EOF
4992
4660
 
4993
 
            cat >> $cwrappersource <<EOF
4994
 
  newargz[0] = (char *) xstrdup("$SHELL");
 
4661
            cat >> $cwrappersource <<EOF
 
4662
  newargz[0] = "$SHELL";
4995
4663
EOF
4996
4664
 
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]);
 
4665
            cat >> $cwrappersource <<"EOF"
 
4666
  newargz[1] = fnqualify(argv[0]);
5002
4667
  /* we know the script has the same name, without the .exe */
5003
4668
  /* so make sure newargz[1] doesn't end in .exe */
5004
4669
  strendzap(newargz[1],".exe");
5005
4670
  for (i = 1; i < argc; i++)
5006
4671
    newargz[i+1] = xstrdup(argv[i]);
5007
4672
  newargz[argc+1] = NULL;
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
 
4673
EOF
 
4674
 
 
4675
            cat >> $cwrappersource <<EOF
5025
4676
  execv("$SHELL",newargz);
5026
4677
EOF
5027
 
              ;;
5028
 
            esac
5029
4678
 
5030
 
            cat >> $cwrappersource <<"EOF"
5031
 
  return 127;
 
4679
            cat >> $cwrappersource <<"EOF"
5032
4680
}
5033
4681
 
5034
4682
void *
5048
4696
;
5049
4697
}
5050
4698
 
5051
 
const char *
5052
 
base_name (const char *name)
 
4699
char *
 
4700
basename (const char *name)
5053
4701
{
5054
4702
  const char *base;
5055
4703
 
5056
4704
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5057
4705
  /* Skip over the disk name in MSDOS pathnames. */
5058
 
  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
 
4706
  if (isalpha (name[0]) && name[1] == ':')
5059
4707
    name += 2;
5060
4708
#endif
5061
4709
 
5062
4710
  for (base = name; *name; name++)
5063
4711
    if (IS_DIR_SEPARATOR (*name))
5064
4712
      base = name + 1;
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 */
 
4713
  return (char *) base;
 
4714
}
 
4715
 
5095
4716
char *
5096
 
find_executable (const char* wrapper)
 
4717
fnqualify(const char *path)
5097
4718
{
5098
 
  int has_slash = 0;
5099
 
  const char* p;
5100
 
  const char* p_next;
5101
 
  /* static buffer for getcwd */
 
4719
  size_t size;
 
4720
  char *p;
5102
4721
  char tmp[LT_PATHMAX + 1];
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 */
 
4722
 
 
4723
  assert(path != NULL);
 
4724
 
 
4725
  /* Is it qualified already? */
 
4726
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
 
4727
  if (isalpha (path[0]) && path[1] == ':')
 
4728
    return xstrdup (path);
 
4729
#endif
 
4730
  if (IS_DIR_SEPARATOR (path[0]))
 
4731
    return xstrdup (path);
 
4732
 
 
4733
  /* prepend the current directory */
 
4734
  /* doesn't handle '~' */
5181
4735
  if (getcwd (tmp, LT_PATHMAX) == NULL)
5182
4736
    lt_fatal ("getcwd failed");
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;
 
4737
  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
 
4738
  p = XMALLOC(char, size);
 
4739
  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
 
4740
  return p;
5193
4741
}
5194
4742
 
5195
4743
char *
5233
4781
  va_end (ap);
5234
4782
}
5235
4783
EOF
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
 
4784
          # we should really use a build-platform specific compiler
 
4785
          # here, but OTOH, the wrappers (shell script and this C one)
 
4786
          # are only useful if you want to execute the "real" binary.
 
4787
          # Since the "real" binary is built for $host, then this
 
4788
          # wrapper might as well be built for $host, too.
 
4789
          $run $LTCC -s -o $cwrapper $cwrappersource
 
4790
          ;;
 
4791
        esac
 
4792
        $rm $output
 
4793
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
5246
4794
 
5247
4795
        $echo > $output "\
5248
4796
#! $SHELL
5263
4811
 
5264
4812
# The HP-UX ksh and POSIX shell print the target directory to stdout
5265
4813
# if CDPATH is set.
5266
 
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
4814
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
5267
4815
 
5268
4816
relink_command=\"$relink_command\"
5269
4817
 
5392
4940
        # Backslashes separate directories on plain windows
5393
4941
        *-*-mingw | *-*-os2*)
5394
4942
          $echo >> $output "\
5395
 
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
 
4943
      exec \$progdir\\\\\$program \${1+\"\$@\"}
5396
4944
"
5397
4945
          ;;
5398
4946
 
5399
4947
        *)
5400
4948
          $echo >> $output "\
5401
 
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
 
4949
      exec \$progdir/\$program \${1+\"\$@\"}
5402
4950
"
5403
4951
          ;;
5404
4952
        esac
5408
4956
    fi
5409
4957
  else
5410
4958
    # The program doesn't exist.
5411
 
    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
 
4959
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
5412
4960
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
5413
4961
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
5414
4962
    exit $EXIT_FAILURE
5440
4988
 
5441
4989
      if test -n "$addlibs"; then
5442
4990
        gentop="$output_objdir/${outputname}x"
 
4991
        $show "${rm}r $gentop"
 
4992
        $run ${rm}r "$gentop"
 
4993
        $show "$mkdir $gentop"
 
4994
        $run $mkdir "$gentop"
 
4995
        status=$?
 
4996
        if test "$status" -ne 0 && test ! -d "$gentop"; then
 
4997
          exit $status
 
4998
        fi
5443
4999
        generated="$generated $gentop"
5444
5000
 
5445
 
        func_extract_archives $gentop $addlibs
5446
 
        oldobjs="$oldobjs $func_extract_archives_result"
 
5001
        # Add in members from convenience archives.
 
5002
        for xlib in $addlibs; do
 
5003
          # Extract the objects.
 
5004
          case $xlib in
 
5005
          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
 
5006
          *) xabs=`pwd`"/$xlib" ;;
 
5007
          esac
 
5008
          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
 
5009
          xdir="$gentop/$xlib"
 
5010
 
 
5011
          $show "${rm}r $xdir"
 
5012
          $run ${rm}r "$xdir"
 
5013
          $show "$mkdir $xdir"
 
5014
          $run $mkdir "$xdir"
 
5015
          status=$?
 
5016
          if test "$status" -ne 0 && test ! -d "$xdir"; then
 
5017
            exit $status
 
5018
          fi
 
5019
          # We will extract separately just the conflicting names and we will no
 
5020
          # longer touch any unique names. It is faster to leave these extract
 
5021
          # automatically by $AR in one run.
 
5022
          $show "(cd $xdir && $AR x $xabs)"
 
5023
          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
 
5024
          if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
 
5025
            :
 
5026
          else
 
5027
            $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
 
5028
            $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
 
5029
            $AR t "$xabs" | sort | uniq -cd | while read -r count name
 
5030
            do
 
5031
              i=1
 
5032
              while test "$i" -le "$count"
 
5033
              do
 
5034
               # Put our $i before any first dot (extension)
 
5035
               # Never overwrite any file
 
5036
               name_to="$name"
 
5037
               while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
 
5038
               do
 
5039
                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
 
5040
               done
 
5041
               $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
 
5042
               $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
 
5043
               i=`expr $i + 1`
 
5044
              done
 
5045
            done
 
5046
          fi
 
5047
 
 
5048
          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
 
5049
        done
5447
5050
      fi
5448
5051
 
5449
5052
      # Do each command in the archive commands.
5450
5053
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5451
5054
       cmds=$old_archive_from_new_cmds
5452
5055
      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
 
 
5510
5056
        eval cmds=\"$old_archive_cmds\"
5511
5057
 
5512
5058
        if len=`expr "X$cmds" : ".*"` &&
5520
5066
          objlist=
5521
5067
          concat_cmds=
5522
5068
          save_oldobjs=$oldobjs
5523
 
 
 
5069
          # GNU ar 2.10+ was changed to match POSIX; thus no paths are
 
5070
          # encoded into archives.  This makes 'ar r' malfunction in
 
5071
          # this piecewise linking case whenever conflicting object
 
5072
          # names appear in distinct ar calls; check, warn and compensate.
 
5073
            if (for obj in $save_oldobjs
 
5074
            do
 
5075
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
 
5076
            done | sort | sort -uc >/dev/null 2>&1); then
 
5077
            :
 
5078
          else
 
5079
            $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
 
5080
            $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
 
5081
            AR_FLAGS=cq
 
5082
          fi
5524
5083
          # Is there a better way of finding the last object in the list?
5525
5084
          for obj in $save_oldobjs
5526
5085
          do
5531
5090
            oldobjs="$objlist $obj"
5532
5091
            objlist="$objlist $obj"
5533
5092
            eval test_cmds=\"$old_archive_cmds\"
5534
 
            if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
 
5093
            if len=`expr "X$test_cmds" : ".*"` &&
5535
5094
               test "$len" -le "$max_cmd_len"; then
5536
5095
              :
5537
5096
            else
5728
5287
    # install_prog (especially on Windows NT).
5729
5288
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5730
5289
       # Allow the use of GNU shtool's install command.
5731
 
       $echo "X$nonopt" | grep shtool > /dev/null; then
 
5290
       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
5732
5291
      # Aesthetically quote it.
5733
5292
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5734
5293
      case $arg in
5735
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
5294
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
5736
5295
        arg="\"$arg\""
5737
5296
        ;;
5738
5297
      esac
5741
5300
      shift
5742
5301
    else
5743
5302
      install_prog=
5744
 
      arg=$nonopt
 
5303
      arg="$nonopt"
5745
5304
    fi
5746
5305
 
5747
5306
    # The real first argument should be the name of the installation program.
5748
5307
    # Aesthetically quote it.
5749
5308
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5750
5309
    case $arg in
5751
 
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
 
5310
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
5752
5311
      arg="\"$arg\""
5753
5312
      ;;
5754
5313
    esac
5766
5325
    do
5767
5326
      if test -n "$dest"; then
5768
5327
        files="$files $dest"
5769
 
        dest=$arg
 
5328
        dest="$arg"
5770
5329
        continue
5771
5330
      fi
5772
5331
 
5773
5332
      case $arg in
5774
5333
      -d) isdir=yes ;;
5775
 
      -f) 
5776
 
        case " $install_prog " in
5777
 
        *[\\\ /]cp\ *) ;;
5778
 
        *) prev=$arg ;;
5779
 
        esac
5780
 
        ;;
5781
 
      -g | -m | -o) prev=$arg ;;
 
5334
      -f) prev="-f" ;;
 
5335
      -g) prev="-g" ;;
 
5336
      -m) prev="-m" ;;
 
5337
      -o) prev="-o" ;;
5782
5338
      -s)
5783
5339
        stripme=" -s"
5784
5340
        continue
5785
5341
        ;;
5786
 
      -*)
5787
 
        ;;
 
5342
      -*) ;;
 
5343
 
5788
5344
      *)
5789
5345
        # If the previous option needed an argument, then skip it.
5790
5346
        if test -n "$prev"; then
5791
5347
          prev=
5792
5348
        else
5793
 
          dest=$arg
 
5349
          dest="$arg"
5794
5350
          continue
5795
5351
        fi
5796
5352
        ;;
5799
5355
      # Aesthetically quote the argument.
5800
5356
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5801
5357
      case $arg in
5802
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
5358
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
5803
5359
        arg="\"$arg\""
5804
5360
        ;;
5805
5361
      esac
5968
5524
 
5969
5525
          if test "$#" -gt 0; then
5970
5526
            # 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.
5974
5527
            for linkname
5975
5528
            do
5976
5529
              if test "$linkname" != "$realname"; then
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; }; })"
 
5530
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
 
5531
                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5979
5532
              fi
5980
5533
            done
5981
5534
          fi
5988
5541
            IFS="$save_ifs"
5989
5542
            eval cmd=\"$cmd\"
5990
5543
            $show "$cmd"
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
 
            }
 
5544
            $run eval "$cmd" || exit $?
6001
5545
          done
6002
5546
          IFS="$save_ifs"
6003
5547
        fi
6091
5635
          notinst_deplibs=
6092
5636
          relink_command=
6093
5637
 
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
 
          #
 
5638
          # To insure that "foo" is sourced, and not "foo.exe",
 
5639
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
 
5640
          # which disallows the automatic-append-.exe behavior.
 
5641
          case $build in
 
5642
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
 
5643
          *) wrapperdot=${wrapper} ;;
 
5644
          esac
6099
5645
          # If there is no directory component, then add one.
6100
 
          case $wrapper in
6101
 
          */* | *\\*) . ${wrapper} ;;
6102
 
          *) . ./${wrapper} ;;
 
5646
          case $file in
 
5647
          */* | *\\*) . ${wrapperdot} ;;
 
5648
          *) . ./${wrapperdot} ;;
6103
5649
          esac
6104
5650
 
6105
5651
          # Check the variables that should have been set.
6127
5673
          done
6128
5674
 
6129
5675
          relink_command=
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
 
          #
 
5676
          # To insure that "foo" is sourced, and not "foo.exe",
 
5677
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
 
5678
          # which disallows the automatic-append-.exe behavior.
 
5679
          case $build in
 
5680
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
 
5681
          *) wrapperdot=${wrapper} ;;
 
5682
          esac
6135
5683
          # If there is no directory component, then add one.
6136
 
          case $wrapper in
6137
 
          */* | *\\*) . ${wrapper} ;;
6138
 
          *) . ./${wrapper} ;;
 
5684
          case $file in
 
5685
          */* | *\\*) . ${wrapperdot} ;;
 
5686
          *) . ./${wrapperdot} ;;
6139
5687
          esac
6140
5688
 
6141
5689
          outputname=
6142
5690
          if test "$fast_install" = no && test -n "$relink_command"; then
6143
5691
            if test "$finalize" = yes && test -z "$run"; then
6144
 
              tmpdir=`func_mktempdir`
 
5692
              tmpdir="/tmp"
 
5693
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
 
5694
              tmpdir="$tmpdir/libtool-$$"
 
5695
              save_umask=`umask`
 
5696
              umask 0077
 
5697
              if $mkdir "$tmpdir"; then
 
5698
                umask $save_umask
 
5699
              else
 
5700
                umask $save_umask
 
5701
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
 
5702
                continue
 
5703
              fi
6145
5704
              file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
6146
5705
              outputname="$tmpdir/$file"
6147
5706
              # Replace the output file specification.
6165
5724
        fi
6166
5725
 
6167
5726
        # remove .exe since cygwin /usr/bin/install will append another
6168
 
        # one anyway 
 
5727
        # one anyways
6169
5728
        case $install_prog,$host in
6170
5729
        */usr/bin/install*,*cygwin*)
6171
5730
          case $file:$destfile in
6265
5824
    # Exit here if they wanted silent mode.
6266
5825
    test "$show" = : && exit $EXIT_SUCCESS
6267
5826
 
6268
 
    $echo "X----------------------------------------------------------------------" | $Xsed
 
5827
    $echo "----------------------------------------------------------------------"
6269
5828
    $echo "Libraries have been installed in:"
6270
5829
    for libdir in $libdirs; do
6271
5830
      $echo "   $libdir"
6298
5857
    $echo
6299
5858
    $echo "See any operating system documentation about shared libraries for"
6300
5859
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
6301
 
    $echo "X----------------------------------------------------------------------" | $Xsed
 
5860
    $echo "----------------------------------------------------------------------"
6302
5861
    exit $EXIT_SUCCESS
6303
5862
    ;;
6304
5863
 
6515
6074
            rmfiles="$rmfiles $objdir/$n"
6516
6075
          done
6517
6076
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
 
6077
          test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6518
6078
 
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)
 
6079
          if test "$mode" = uninstall; then
6529
6080
            if test -n "$library_names"; then
6530
6081
              # Do each command in the postuninstall commands.
6531
6082
              cmds=$postuninstall_cmds
6558
6109
              IFS="$save_ifs"
6559
6110
            fi
6560
6111
            # FIXME: should reinstall the best remaining shared library.
6561
 
            ;;
6562
 
          esac
 
6112
          fi
6563
6113
        fi
6564
6114
        ;;
6565
6115
 
6844
6394
$echo
6845
6395
$echo "Try \`$modename --help' for more information about other modes."
6846
6396
 
6847
 
exit $?
 
6397
exit $EXIT_SUCCESS
6848
6398
 
6849
6399
# The TAGs below are defined such that we never get into a situation
6850
6400
# in which we disable both kinds of libraries.  Given conflicting
6858
6408
# configuration.  But we'll never go from static-only to shared-only.
6859
6409
 
6860
6410
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6861
 
disable_libs=shared
 
6411
build_libtool_libs=no
 
6412
build_old_libs=yes
6862
6413
# ### END LIBTOOL TAG CONFIG: disable-shared
6863
6414
 
6864
6415
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6865
 
disable_libs=static
 
6416
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
6866
6417
# ### END LIBTOOL TAG CONFIG: disable-static
6867
6418
 
6868
6419
# Local Variables: