~ubuntu-branches/ubuntu/gutsy/libwpd/gutsy

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Rene Engelhard
  • Date: 2007-01-11 15:15:57 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20070111151557-rn1kysabqbccx3as
Tags: 0.8.8-2
run make check for stream check; build-depend on libcppunit-dev 

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