~andreserl/ubuntu/lucid/bind9/bind9-apport-533601

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones, LaMont Jones, Internet Software Consortium, Inc, localization folks
  • Date: 2008-08-02 14:20:20 UTC
  • mfrom: (1.2.1 upstream) (6.1.24 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080802142020-l1hon9jy8lbbjxmg
[LaMont Jones]

* default to using resolvconf if it is installed
* fix sonames and dependencies.  Closes: #149259, #492418
* Do not build-depend libcap2-dev on non-linux.  Closes: #493392
* drop unused query-loc manpage.  Closes: #492564
* lwresd: Deliver /etc/bind directory.  Closes: #490027
* fix query-source comment in default install

[Internet Software Consortium, Inc]

* 9.5.0-P2.  Closes: #492949

[localization folks]

* l10n: Spanish debconf translation.  Closes: #492425 (Ignacio Mondino)
* l10n: Swedish debconf templates.  Closes: #491369 (Martin Ågren)
* l10n: Japanese debconf translations.  Closes: #492048 (Hideki Yamane
  (Debian-JP))
* l10n: Finnish translation.  Closes: #490630 (Esko Arajärvi)
* l10n: Italian debconf translations.  Closes: #492587 (Alessandro Vietta)

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
5
 
# Free Software Foundation, Inc.
 
4
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
 
5
# 2007, 2008  Free Software Foundation, Inc.
6
6
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
7
7
#
8
8
# This program is free software; you can redistribute it and/or modify
17
17
#
18
18
# You should have received a copy of the GNU General Public License
19
19
# along with this program; if not, write to the Free Software
20
 
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
21
#
22
22
# As a special exception to the GNU General Public License, if you
23
23
# distribute this file as part of a program that contains a
43
43
 
44
44
PROGRAM=ltmain.sh
45
45
PACKAGE=libtool
46
 
VERSION=1.5.6
47
 
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42) Debian$Rev: 224 $"
 
46
VERSION="1.5.26 Debian 1.5.26-1ubuntu1"
 
47
TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
48
48
 
 
49
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
 
50
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
 
51
  emulate sh
 
52
  NULLCMD=:
 
53
  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
 
54
  # is contrary to our usage.  Disable this feature.
 
55
  alias -g '${1+"$@"}'='"$@"'
 
56
  setopt NO_GLOB_SUBST
 
57
else
 
58
  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
 
59
fi
 
60
BIN_SH=xpg4; export BIN_SH # for Tru64
 
61
DUALCASE=1; export DUALCASE # for MKS sh
49
62
 
50
63
# Check that we have a working $echo.
51
64
if test "X$1" = X--no-reexec; then
83
96
Xsed="${SED}"' -e 1s/^X//'
84
97
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
85
98
# test EBCDIC or ASCII
86
 
case `echo A|tr A '\301'` in
87
 
 A) # EBCDIC based system
88
 
  SP2NL="tr '\100' '\n'"
89
 
  NL2SP="tr '\r\n' '\100\100'"
 
99
case `echo X|tr X '\101'` in
 
100
 A) # ASCII based system
 
101
    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
 
102
  SP2NL='tr \040 \012'
 
103
  NL2SP='tr \015\012 \040\040'
90
104
  ;;
91
 
 *) # Assume ASCII based system
92
 
  SP2NL="tr '\040' '\012'"
93
 
  NL2SP="tr '\015\012' '\040\040'"
 
105
 *) # EBCDIC based system
 
106
  SP2NL='tr \100 \n'
 
107
  NL2SP='tr \r\n \100\100'
94
108
  ;;
95
109
esac
96
110
 
99
113
# These must not be set unconditionally because not all systems understand
100
114
# e.g. LANG=C (notably SCO).
101
115
# We save the old values to restore during execute mode.
102
 
if test "${LC_ALL+set}" = set; then
103
 
  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
104
 
fi
105
 
if test "${LANG+set}" = set; then
106
 
  save_LANG="$LANG"; LANG=C; export LANG
 
116
lt_env=
 
117
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 
118
do
 
119
  eval "if test \"\${$lt_var+set}\" = set; then
 
120
          save_$lt_var=\$$lt_var
 
121
          lt_env=\"$lt_var=\$$lt_var \$lt_env\"
 
122
          $lt_var=C
 
123
          export $lt_var
 
124
        fi"
 
125
done
 
126
 
 
127
if test -n "$lt_env"; then
 
128
  lt_env="env $lt_env"
107
129
fi
108
130
 
109
131
# Make sure IFS has a sensible default
110
 
: ${IFS="       
111
 
"}
 
132
lt_nl='
 
133
'
 
134
IFS="   $lt_nl"
112
135
 
113
136
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
114
137
  $echo "$modename: not configured to build any kind of library" 1>&2
125
148
show="$echo"
126
149
show_help=
127
150
execute_dlfiles=
 
151
duplicate_deps=no
 
152
preserve_args=
128
153
lo2o="s/\\.lo\$/.${objext}/"
129
154
o2lo="s/\\.${objext}\$/.lo/"
 
155
extracted_archives=
 
156
extracted_serial=0
130
157
 
131
158
#####################################
132
159
# Shell function definitions:
133
160
# This seems to be the best place for them
134
161
 
 
162
# func_mktempdir [string]
 
163
# Make a temporary directory that won't clash with other running
 
164
# libtool processes, and avoids race conditions if possible.  If
 
165
# given, STRING is the basename for that directory.
 
166
func_mktempdir ()
 
167
{
 
168
    my_template="${TMPDIR-/tmp}/${1-$progname}"
 
169
 
 
170
    if test "$run" = ":"; then
 
171
      # Return a directory name, but don't create it in dry-run mode
 
172
      my_tmpdir="${my_template}-$$"
 
173
    else
 
174
 
 
175
      # If mktemp works, use that first and foremost
 
176
      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
 
177
 
 
178
      if test ! -d "$my_tmpdir"; then
 
179
        # Failing that, at least try and use $RANDOM to avoid a race
 
180
        my_tmpdir="${my_template}-${RANDOM-0}$$"
 
181
 
 
182
        save_mktempdir_umask=`umask`
 
183
        umask 0077
 
184
        $mkdir "$my_tmpdir"
 
185
        umask $save_mktempdir_umask
 
186
      fi
 
187
 
 
188
      # If we're not in dry-run mode, bomb out on failure
 
189
      test -d "$my_tmpdir" || {
 
190
        $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
 
191
        exit $EXIT_FAILURE
 
192
      }
 
193
    fi
 
194
 
 
195
    $echo "X$my_tmpdir" | $Xsed
 
196
}
 
197
 
 
198
 
135
199
# func_win32_libid arg
136
200
# return the library type of file 'arg'
137
201
#
138
202
# Need a lot of goo to handle *both* DLLs and import libs
139
203
# Has to be a shell function in order to 'eat' the argument
140
204
# that is supplied when $file_magic_command is called.
141
 
func_win32_libid () {
 
205
func_win32_libid ()
 
206
{
142
207
  win32_libid_type="unknown"
143
208
  win32_fileres=`file -L $1 2>/dev/null`
144
209
  case $win32_fileres in
149
214
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
150
215
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
151
216
      win32_nmres=`eval $NM -f posix -A $1 | \
152
 
        sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
153
 
      if test "X$win32_nmres" = "Ximport" ; then
154
 
        win32_libid_type="x86 archive import"
155
 
      else
156
 
        win32_libid_type="x86 archive static"
157
 
      fi
 
217
        $SED -n -e '1,100{
 
218
                / I /{
 
219
                        s,.*,import,
 
220
                        p
 
221
                        q
 
222
                        }
 
223
                }'`
 
224
      case $win32_nmres in
 
225
      import*)  win32_libid_type="x86 archive import";;
 
226
      *)        win32_libid_type="x86 archive static";;
 
227
      esac
158
228
    fi
159
229
    ;;
160
230
  *DLL*)
178
248
# Only attempt this if the compiler in the base compile
179
249
# command doesn't match the default compiler.
180
250
# arg is usually of the form 'gcc ...'
181
 
func_infer_tag () {
 
251
func_infer_tag ()
 
252
{
182
253
    if test -n "$available_tags" && test -z "$tagname"; then
183
254
      CC_quoted=
184
255
      for arg in $CC; do
235
306
      esac
236
307
    fi
237
308
}
 
309
 
 
310
 
 
311
# func_extract_an_archive dir oldlib
 
312
func_extract_an_archive ()
 
313
{
 
314
    f_ex_an_ar_dir="$1"; shift
 
315
    f_ex_an_ar_oldlib="$1"
 
316
 
 
317
    $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
 
318
    $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
 
319
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
 
320
     :
 
321
    else
 
322
      $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
 
323
      exit $EXIT_FAILURE
 
324
    fi
 
325
}
 
326
 
 
327
# func_extract_archives gentop oldlib ...
 
328
func_extract_archives ()
 
329
{
 
330
    my_gentop="$1"; shift
 
331
    my_oldlibs=${1+"$@"}
 
332
    my_oldobjs=""
 
333
    my_xlib=""
 
334
    my_xabs=""
 
335
    my_xdir=""
 
336
    my_status=""
 
337
 
 
338
    $show "${rm}r $my_gentop"
 
339
    $run ${rm}r "$my_gentop"
 
340
    $show "$mkdir $my_gentop"
 
341
    $run $mkdir "$my_gentop"
 
342
    my_status=$?
 
343
    if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
 
344
      exit $my_status
 
345
    fi
 
346
 
 
347
    for my_xlib in $my_oldlibs; do
 
348
      # Extract the objects.
 
349
      case $my_xlib in
 
350
        [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
 
351
        *) my_xabs=`pwd`"/$my_xlib" ;;
 
352
      esac
 
353
      my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
 
354
      my_xlib_u=$my_xlib
 
355
      while :; do
 
356
        case " $extracted_archives " in
 
357
        *" $my_xlib_u "*)
 
358
          extracted_serial=`expr $extracted_serial + 1`
 
359
          my_xlib_u=lt$extracted_serial-$my_xlib ;;
 
360
        *) break ;;
 
361
        esac
 
362
      done
 
363
      extracted_archives="$extracted_archives $my_xlib_u"
 
364
      my_xdir="$my_gentop/$my_xlib_u"
 
365
 
 
366
      $show "${rm}r $my_xdir"
 
367
      $run ${rm}r "$my_xdir"
 
368
      $show "$mkdir $my_xdir"
 
369
      $run $mkdir "$my_xdir"
 
370
      exit_status=$?
 
371
      if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
 
372
        exit $exit_status
 
373
      fi
 
374
      case $host in
 
375
      *-darwin*)
 
376
        $show "Extracting $my_xabs"
 
377
        # Do not bother doing anything if just a dry run
 
378
        if test -z "$run"; then
 
379
          darwin_orig_dir=`pwd`
 
380
          cd $my_xdir || exit $?
 
381
          darwin_archive=$my_xabs
 
382
          darwin_curdir=`pwd`
 
383
          darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
 
384
          darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
 
385
          if test -n "$darwin_arches"; then 
 
386
            darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
 
387
            darwin_arch=
 
388
            $show "$darwin_base_archive has multiple architectures $darwin_arches"
 
389
            for darwin_arch in  $darwin_arches ; do
 
390
              mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
 
391
              lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
 
392
              cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
 
393
              func_extract_an_archive "`pwd`" "${darwin_base_archive}"
 
394
              cd "$darwin_curdir"
 
395
              $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
 
396
            done # $darwin_arches
 
397
      ## Okay now we have a bunch of thin objects, gotta fatten them up :)
 
398
            darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
 
399
            darwin_file=
 
400
            darwin_files=
 
401
            for darwin_file in $darwin_filelist; do
 
402
              darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
 
403
              lipo -create -output "$darwin_file" $darwin_files
 
404
            done # $darwin_filelist
 
405
            ${rm}r unfat-$$
 
406
            cd "$darwin_orig_dir"
 
407
          else
 
408
            cd "$darwin_orig_dir"
 
409
            func_extract_an_archive "$my_xdir" "$my_xabs"
 
410
          fi # $darwin_arches
 
411
        fi # $run
 
412
        ;;
 
413
      *)
 
414
        func_extract_an_archive "$my_xdir" "$my_xabs"
 
415
        ;;
 
416
      esac
 
417
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
 
418
    done
 
419
    func_extract_archives_result="$my_oldobjs"
 
420
}
238
421
# End of Shell function definitions
239
422
#####################################
240
423
 
241
424
# Darwin sucks
242
425
eval std_shrext=\"$shrext_cmds\"
243
426
 
 
427
disable_libs=no
 
428
 
244
429
# Parse our command line options once, thoroughly.
245
430
while test "$#" -gt 0
246
431
do
303
488
    ;;
304
489
 
305
490
  --version)
306
 
    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
307
 
    $echo
308
 
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
309
 
    $echo "This is free software; see the source for copying conditions.  There is NO"
310
 
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
311
 
    exit $EXIT_SUCCESS
 
491
    echo "\
 
492
$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
 
493
 
 
494
Copyright (C) 2008  Free Software Foundation, Inc.
 
495
This is free software; see the source for copying conditions.  There is NO
 
496
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
 
497
    exit $?
312
498
    ;;
313
499
 
314
500
  --config)
317
503
    for tagname in $taglist; do
318
504
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
319
505
    done
320
 
    exit $EXIT_SUCCESS
 
506
    exit $?
321
507
    ;;
322
508
 
323
509
  --debug)
342
528
    else
343
529
      $echo "disable static libraries"
344
530
    fi
345
 
    exit $EXIT_SUCCESS
 
531
    exit $?
346
532
    ;;
347
533
 
348
534
  --finish) mode="finish" ;;
357
543
    preserve_args="$preserve_args $arg"
358
544
    ;;
359
545
 
360
 
  --tag) prevopt="--tag" prev=tag ;;
 
546
  --tag)
 
547
    prevopt="--tag"
 
548
    prev=tag
 
549
    preserve_args="$preserve_args --tag"
 
550
    ;;
361
551
  --tag=*)
362
552
    set tag "$optarg" ${1+"$@"}
363
553
    shift
389
579
  exit $EXIT_FAILURE
390
580
fi
391
581
 
 
582
case $disable_libs in
 
583
no) 
 
584
  ;;
 
585
shared)
 
586
  build_libtool_libs=no
 
587
  build_old_libs=yes
 
588
  ;;
 
589
static)
 
590
  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
 
591
  ;;
 
592
esac
 
593
 
392
594
# If this variable is set in any of the actions, the command in it
393
595
# will be execed at the end.  This prevents here-documents from being
394
596
# left over by shells.
399
601
  # Infer the operation mode.
400
602
  if test -z "$mode"; then
401
603
    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
402
 
    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
 
604
    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
403
605
    case $nonopt in
404
606
    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
405
607
      mode=link
465
667
 
466
668
    for arg
467
669
    do
468
 
      case "$arg_mode" in
 
670
      case $arg_mode in
469
671
      arg  )
470
672
        # do not "continue".  Instead, add this to base_compile
471
673
        lastarg="$arg"
547
749
      case $lastarg in
548
750
      # Double-quote args containing other shell metacharacters.
549
751
      # Many Bourne shells cannot handle close brackets correctly
550
 
      # in scan sets, so we specify it separately.
 
752
      # in scan sets, and some SunOS ksh mistreat backslash-escaping
 
753
      # in scan sets (worked around with variable expansion),
 
754
      # and furthermore cannot handle '|' '&' '(' ')' in scan sets 
 
755
      # at all, so we specify them separately.
551
756
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
552
757
        lastarg="\"$lastarg\""
553
758
        ;;
585
790
    *.class) xform=class ;;
586
791
    *.cpp) xform=cpp ;;
587
792
    *.cxx) xform=cxx ;;
588
 
    *.f90) xform=f90 ;;
 
793
    *.[fF][09]?) xform=[fF][09]. ;;
589
794
    *.for) xform=for ;;
590
795
    *.java) xform=java ;;
 
796
    *.obj) xform=obj ;;
 
797
    *.sx) xform=sx ;;
591
798
    esac
592
799
 
593
800
    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
621
828
      esac
622
829
    done
623
830
 
 
831
    qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
 
832
    case $qlibobj in
 
833
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
834
        qlibobj="\"$qlibobj\"" ;;
 
835
    esac
 
836
    test "X$libobj" != "X$qlibobj" \
 
837
        && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"'  &()|`$[]' \
 
838
        && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
624
839
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
625
840
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
626
841
    if test "X$xdir" = "X$obj"; then
693
908
        $run $rm $removelist
694
909
        exit $EXIT_FAILURE
695
910
      fi
696
 
      $echo $srcfile > "$lockfile"
 
911
      $echo "$srcfile" > "$lockfile"
697
912
    fi
698
913
 
699
914
    if test -n "$fix_srcfile_path"; then
700
915
      eval srcfile=\"$fix_srcfile_path\"
701
916
    fi
 
917
    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
 
918
    case $qsrcfile in
 
919
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
920
      qsrcfile="\"$qsrcfile\"" ;;
 
921
    esac
702
922
 
703
923
    $run $rm "$libobj" "${libobj}T"
704
924
 
720
940
      fbsd_hideous_sh_bug=$base_compile
721
941
 
722
942
      if test "$pic_mode" != no; then
723
 
        command="$base_compile $srcfile $pic_flag"
 
943
        command="$base_compile $qsrcfile $pic_flag"
724
944
      else
725
945
        # Don't build PIC code
726
 
        command="$base_compile $srcfile"
 
946
        command="$base_compile $qsrcfile"
727
947
      fi
728
948
 
729
949
      if test ! -d "${xdir}$objdir"; then
730
950
        $show "$mkdir ${xdir}$objdir"
731
951
        $run $mkdir ${xdir}$objdir
732
 
        status=$?
733
 
        if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
734
 
          exit $status
 
952
        exit_status=$?
 
953
        if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
 
954
          exit $exit_status
735
955
        fi
736
956
      fi
737
957
 
743
963
      $run $rm "$lobj" "$output_obj"
744
964
 
745
965
      $show "$command"
746
 
      if $run eval "$command"; then :
 
966
      if $run eval $lt_env "$command"; then :
747
967
      else
748
968
        test -n "$output_obj" && $run $rm $removelist
749
969
        exit $EXIT_FAILURE
803
1023
    if test "$build_old_libs" = yes; then
804
1024
      if test "$pic_mode" != yes; then
805
1025
        # Don't build PIC code
806
 
        command="$base_compile $srcfile"
 
1026
        command="$base_compile $qsrcfile"
807
1027
      else
808
 
        command="$base_compile $srcfile $pic_flag"
 
1028
        command="$base_compile $qsrcfile $pic_flag"
809
1029
      fi
810
1030
      if test "$compiler_c_o" = yes; then
811
1031
        command="$command -o $obj"
815
1035
      command="$command$suppress_output"
816
1036
      $run $rm "$obj" "$output_obj"
817
1037
      $show "$command"
818
 
      if $run eval "$command"; then :
 
1038
      if $run eval $lt_env "$command"; then :
819
1039
      else
820
1040
        $run $rm $removelist
821
1041
        exit $EXIT_FAILURE
934
1154
    no_install=no
935
1155
    objs=
936
1156
    non_pic_objects=
 
1157
    notinst_path= # paths that contain not-installed libtool libraries
937
1158
    precious_files_regex=
938
1159
    prefer_static_libs=no
939
1160
    preload=no
947
1168
    thread_safe=no
948
1169
    vinfo=
949
1170
    vinfo_number=no
 
1171
    single_module="${wl}-single_module"
950
1172
 
951
1173
    func_infer_tag $base_compile
952
1174
 
954
1176
    for arg
955
1177
    do
956
1178
      case $arg in
957
 
      -all-static | -static)
958
 
        if test "X$arg" = "X-all-static"; then
 
1179
      -all-static | -static | -static-libtool-libs)
 
1180
        case $arg in
 
1181
        -all-static)
959
1182
          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
960
1183
            $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
961
1184
          fi
962
1185
          if test -n "$link_static_flag"; then
963
1186
            dlopen_self=$dlopen_self_static
964
1187
          fi
965
 
        else
966
 
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
967
 
            dlopen_self=$dlopen_self_static
968
 
          fi
969
 
        fi
 
1188
          prefer_static_libs=yes
 
1189
          ;;
 
1190
        -static)
 
1191
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
 
1192
            dlopen_self=$dlopen_self_static
 
1193
          fi
 
1194
          prefer_static_libs=built
 
1195
          ;;
 
1196
        -static-libtool-libs)
 
1197
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
 
1198
            dlopen_self=$dlopen_self_static
 
1199
          fi
 
1200
          prefer_static_libs=yes
 
1201
          ;;
 
1202
        esac
970
1203
        build_libtool_libs=no
971
1204
        build_old_libs=yes
972
 
        prefer_static_libs=yes
973
1205
        break
974
1206
        ;;
975
1207
      esac
1144
1376
                  if test -z "$pic_object" || test "$pic_object" = none ; then
1145
1377
                    arg="$non_pic_object"
1146
1378
                  fi
 
1379
                else
 
1380
                  # If the PIC object exists, use it instead.
 
1381
                  # $xdir was prepended to $pic_object above.
 
1382
                  non_pic_object="$pic_object"
 
1383
                  non_pic_objects="$non_pic_objects $non_pic_object"
1147
1384
                fi
1148
1385
              else
1149
1386
                # Only an error if not doing a dry-run.
1227
1464
          prev=
1228
1465
          continue
1229
1466
          ;;
 
1467
        darwin_framework|darwin_framework_skip)
 
1468
          test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
 
1469
          compile_command="$compile_command $arg"
 
1470
          finalize_command="$finalize_command $arg"
 
1471
          prev=
 
1472
          continue
 
1473
          ;;
1230
1474
        *)
1231
1475
          eval "$prev=\"\$arg\""
1232
1476
          prev=
1285
1529
        continue
1286
1530
        ;;
1287
1531
 
 
1532
      -framework|-arch|-isysroot)
 
1533
        case " $CC " in
 
1534
          *" ${arg} ${1} "* | *" ${arg} ${1} "*) 
 
1535
                prev=darwin_framework_skip ;;
 
1536
          *) compiler_flags="$compiler_flags $arg"
 
1537
             prev=darwin_framework ;;
 
1538
        esac
 
1539
        compile_command="$compile_command $arg"
 
1540
        finalize_command="$finalize_command $arg"
 
1541
        continue
 
1542
        ;;
 
1543
 
1288
1544
      -inst-prefix-dir)
1289
1545
        prev=inst_prefix
1290
1546
        continue
1311
1567
          absdir=`cd "$dir" && pwd`
1312
1568
          if test -z "$absdir"; then
1313
1569
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1314
 
            exit $EXIT_FAILURE
 
1570
            absdir="$dir"
 
1571
            notinst_path="$notinst_path $dir"
1315
1572
          fi
1316
1573
          dir="$absdir"
1317
1574
          ;;
1325
1582
        esac
1326
1583
        case $host in
1327
1584
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
1585
          testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1328
1586
          case :$dllsearchpath: in
1329
1587
          *":$dir:"*) ;;
1330
1588
          *) dllsearchpath="$dllsearchpath:$dir";;
1331
1589
          esac
 
1590
          case :$dllsearchpath: in
 
1591
          *":$testbindir:"*) ;;
 
1592
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
1593
          esac
1332
1594
          ;;
1333
1595
        esac
1334
1596
        continue
1337
1599
      -l*)
1338
1600
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1339
1601
          case $host in
1340
 
          *-*-cygwin* | *-*-pw32* | *-*-beos*)
 
1602
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1341
1603
            # These systems don't actually have a C or math library (as such)
1342
1604
            continue
1343
1605
            ;;
1344
 
          *-*-mingw* | *-*-os2*)
 
1606
          *-*-os2*)
1345
1607
            # These systems don't actually have a C library (as such)
1346
1608
            test "X$arg" = "X-lc" && continue
1347
1609
            ;;
1348
 
          *-*-openbsd* | *-*-freebsd*)
 
1610
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1349
1611
            # Do not include libc due to us having libc/libc_r.
1350
1612
            test "X$arg" = "X-lc" && continue
1351
1613
            ;;
1353
1615
            # Rhapsody C and math libraries are in the System framework
1354
1616
            deplibs="$deplibs -framework System"
1355
1617
            continue
 
1618
            ;;
 
1619
          *-*-sco3.2v5* | *-*-sco5v6*)
 
1620
            # Causes problems with __ctype
 
1621
            test "X$arg" = "X-lc" && continue
 
1622
            ;;
 
1623
          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 
1624
            # Compiler inserts libc in the correct place for threads to work
 
1625
            test "X$arg" = "X-lc" && continue
 
1626
            ;;
1356
1627
          esac
1357
1628
        elif test "X$arg" = "X-lc_r"; then
1358
1629
         case $host in
1359
 
         *-*-openbsd* | *-*-freebsd*)
 
1630
         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1360
1631
           # Do not include libc_r directly, use -pthread flag.
1361
1632
           continue
1362
1633
           ;;
1366
1637
        continue
1367
1638
        ;;
1368
1639
 
1369
 
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1370
 
        deplibs="$deplibs $arg"
 
1640
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
 
1641
      # classes, name mangling, and exception handling.
 
1642
      -model)
 
1643
        compile_command="$compile_command $arg"
 
1644
        compiler_flags="$compiler_flags $arg"
 
1645
        finalize_command="$finalize_command $arg"
 
1646
        prev=xcompiler
 
1647
        continue
 
1648
        ;;
 
1649
 
 
1650
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
 
1651
        compiler_flags="$compiler_flags $arg"
 
1652
        compile_command="$compile_command $arg"
 
1653
        finalize_command="$finalize_command $arg"
 
1654
        continue
 
1655
        ;;
 
1656
 
 
1657
      -multi_module)
 
1658
        single_module="${wl}-multi_module"
1371
1659
        continue
1372
1660
        ;;
1373
1661
 
1376
1664
        continue
1377
1665
        ;;
1378
1666
 
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*)
 
1667
      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
 
1668
      # -r[0-9][0-9]* specifies the processor on the SGI compiler
 
1669
      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
 
1670
      # +DA*, +DD* enable 64-bit mode on the HP compiler
 
1671
      # -q* pass through compiler args for the IBM compiler
 
1672
      # -m* pass through architecture-specific compiler args for GCC
 
1673
      # -m*, -t[45]*, -txscale* pass through architecture-specific
 
1674
      # compiler args for GCC
 
1675
      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
 
1676
      # -F/path gives path to uninstalled frameworks, gcc on darwin
 
1677
      # @file GCC response files
 
1678
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
 
1679
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
 
1680
 
1386
1681
        # Unknown arguments in both finalize_command and compile_command need
1387
1682
        # to be aesthetically quoted because they are evaled later.
1388
1683
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1393
1688
        esac
1394
1689
        compile_command="$compile_command $arg"
1395
1690
        finalize_command="$finalize_command $arg"
1396
 
        if test "$with_gcc" = "yes" ; then
1397
 
          compiler_flags="$compiler_flags $arg"
1398
 
        fi
 
1691
        compiler_flags="$compiler_flags $arg"
1399
1692
        continue
1400
1693
        ;;
1401
1694
 
1411
1704
 
1412
1705
      -no-install)
1413
1706
        case $host in
1414
 
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
1707
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
1415
1708
          # The PATH hackery in wrapper scripts is required on Windows
1416
 
          # in order for the loader to find any dlls it needs.
 
1709
          # and Darwin in order for the loader to find any dlls it needs.
1417
1710
          $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1418
1711
          $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1419
1712
          fast_install=no
1472
1765
        continue
1473
1766
        ;;
1474
1767
 
1475
 
      -static)
 
1768
      -static | -static-libtool-libs)
1476
1769
        # The effects of -static are defined in a previous loop.
1477
1770
        # We used to do the same as -all-static on platforms that
1478
1771
        # didn't have a PIC flag, but the assumption that the effects
1633
1926
            if test -z "$pic_object" || test "$pic_object" = none ; then
1634
1927
              arg="$non_pic_object"
1635
1928
            fi
 
1929
          else
 
1930
            # If the PIC object exists, use it instead.
 
1931
            # $xdir was prepended to $pic_object above.
 
1932
            non_pic_object="$pic_object"
 
1933
            non_pic_objects="$non_pic_objects $non_pic_object"
1636
1934
          fi
1637
1935
        else
1638
1936
          # Only an error if not doing a dry-run.
1738
2036
    if test ! -d "$output_objdir"; then
1739
2037
      $show "$mkdir $output_objdir"
1740
2038
      $run $mkdir $output_objdir
1741
 
      status=$?
1742
 
      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1743
 
        exit $status
 
2039
      exit_status=$?
 
2040
      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
 
2041
        exit $exit_status
1744
2042
      fi
1745
2043
    fi
1746
2044
 
1803
2101
    newlib_search_path=
1804
2102
    need_relink=no # whether we're linking any uninstalled libtool libraries
1805
2103
    notinst_deplibs= # not-installed libtool libraries
1806
 
    notinst_path= # paths that contain not-installed libtool libraries
1807
2104
    case $linkmode in
1808
2105
    lib)
1809
2106
        passes="conv link"
1853
2150
        lib=
1854
2151
        found=no
1855
2152
        case $deplib in
1856
 
        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
 
2153
        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
1857
2154
          if test "$linkmode,$pass" = "prog,link"; then
1858
2155
            compile_deplibs="$deplib $compile_deplibs"
1859
2156
            finalize_deplibs="$deplib $finalize_deplibs"
1860
2157
          else
1861
 
            deplibs="$deplib $deplibs"
 
2158
            compiler_flags="$compiler_flags $deplib"
1862
2159
          fi
1863
2160
          continue
1864
2161
          ;;
1868
2165
            continue
1869
2166
          fi
1870
2167
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1871
 
          for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
 
2168
          if test "$linkmode" = lib; then
 
2169
            searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
 
2170
          else
 
2171
            searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
 
2172
          fi
 
2173
          for searchdir in $searchdirs; do
1872
2174
            for search_ext in .la $std_shrext .so .a; do
1873
2175
              # Search the libtool library
1874
2176
              lib="$searchdir/lib${name}${search_ext}"
1977
2279
          fi
1978
2280
          case $linkmode in
1979
2281
          lib)
1980
 
            if test "$deplibs_check_method" != pass_all; then
 
2282
            valid_a_lib=no
 
2283
            case $deplibs_check_method in
 
2284
              match_pattern*)
 
2285
                set dummy $deplibs_check_method
 
2286
                match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
 
2287
                if eval $echo \"$deplib\" 2>/dev/null \
 
2288
                    | $SED 10q \
 
2289
                    | $EGREP "$match_pattern_regex" > /dev/null; then
 
2290
                  valid_a_lib=yes
 
2291
                fi
 
2292
                ;;
 
2293
              pass_all)
 
2294
                valid_a_lib=yes
 
2295
                ;;
 
2296
            esac
 
2297
            if test "$valid_a_lib" != yes; then
1981
2298
              $echo
1982
2299
              $echo "*** Warning: Trying to link with static lib archive $deplib."
1983
2300
              $echo "*** I have the capability to make that library automatically link in when"
2027
2344
        esac # case $deplib
2028
2345
        if test "$found" = yes || test -f "$lib"; then :
2029
2346
        else
2030
 
          $echo "$modename: cannot find the library \`$lib'" 1>&2
 
2347
          $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2031
2348
          exit $EXIT_FAILURE
2032
2349
        fi
2033
2350
 
2051
2368
        # it will not redefine variables installed, or shouldnotlink
2052
2369
        installed=yes
2053
2370
        shouldnotlink=no
 
2371
        avoidtemprpath=
 
2372
 
2054
2373
 
2055
2374
        # Read the .la file
2056
2375
        case $lib in
2149
2468
            dir="$libdir"
2150
2469
            absdir="$libdir"
2151
2470
          fi
 
2471
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2152
2472
        else
2153
 
          dir="$ladir/$objdir"
2154
 
          absdir="$abs_ladir/$objdir"
2155
 
          # Remove this search path later
2156
 
          notinst_path="$notinst_path $abs_ladir"
 
2473
          if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 
2474
            dir="$ladir"
 
2475
            absdir="$abs_ladir"
 
2476
            # Remove this search path later
 
2477
            notinst_path="$notinst_path $abs_ladir"
 
2478
          else
 
2479
            dir="$ladir/$objdir"
 
2480
            absdir="$abs_ladir/$objdir"
 
2481
            # Remove this search path later
 
2482
            notinst_path="$notinst_path $abs_ladir"
 
2483
          fi
2157
2484
        fi # $installed = yes
2158
2485
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2159
2486
 
2224
2551
 
2225
2552
        if test "$linkmode,$pass" = "prog,link"; then
2226
2553
          if test -n "$library_names" &&
2227
 
             { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
 
2554
             { { test "$prefer_static_libs" = no ||
 
2555
                 test "$prefer_static_libs,$installed" = "built,yes"; } ||
 
2556
               test -z "$old_library"; }; then
2228
2557
            # We need to hardcode the library path
2229
 
            if test -n "$shlibpath_var"; then
 
2558
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2230
2559
              # Make sure the rpath contains only unique directories.
2231
2560
              case "$temp_rpath " in
2232
2561
              *" $dir "*) ;;
2233
2562
              *" $absdir "*) ;;
2234
 
              *) temp_rpath="$temp_rpath $dir" ;;
 
2563
              *) temp_rpath="$temp_rpath $absdir" ;;
2235
2564
              esac
2236
2565
            fi
2237
2566
 
2268
2597
        fi
2269
2598
 
2270
2599
        link_static=no # Whether the deplib will be linked statically
 
2600
        use_static_libs=$prefer_static_libs
 
2601
        if test "$use_static_libs" = built && test "$installed" = yes ; then
 
2602
          use_static_libs=no
 
2603
        fi
2271
2604
        if test -n "$library_names" &&
2272
 
           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
 
2605
           { test "$use_static_libs" = no || test -z "$old_library"; }; then
2273
2606
          if test "$installed" = no; then
2274
2607
            notinst_deplibs="$notinst_deplibs $lib"
2275
2608
            need_relink=yes
2382
2715
              if test "$hardcode_direct" = no; then
2383
2716
                add="$dir/$linklib"
2384
2717
                case $host in
2385
 
                  *-*-sco3.2v5* ) add_dir="-L$dir" ;;
 
2718
                  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
 
2719
                  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
 
2720
                  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
 
2721
                    *-*-unixware7*) add_dir="-L$dir" ;;
2386
2722
                  *-*-darwin* )
2387
2723
                    # if the lib is a module then we can not link against
2388
2724
                    # it, someone is ignoring the new warnings I added
2389
 
                    if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
 
2725
                    if /usr/bin/file -L $add 2> /dev/null |
 
2726
                      $EGREP ": [^:]* bundle" >/dev/null ; then
2390
2727
                      $echo "** Warning, lib $linklib is a module, not a shared library"
2391
2728
                      if test -z "$old_library" ; then
2392
2729
                        $echo
2417
2754
                add_dir="-L$dir"
2418
2755
                # Try looking first in the location we're being installed to.
2419
2756
                if test -n "$inst_prefix_dir"; then
2420
 
                  case "$libdir" in
 
2757
                  case $libdir in
2421
2758
                    [\\/]*)
2422
2759
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
2423
2760
                      ;;
2490
2827
              add_dir="-L$libdir"
2491
2828
              # Try looking first in the location we're being installed to.
2492
2829
              if test -n "$inst_prefix_dir"; then
2493
 
                case "$libdir" in
 
2830
                case $libdir in
2494
2831
                  [\\/]*)
2495
2832
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
2496
2833
                    ;;
2551
2888
              fi
2552
2889
            fi
2553
2890
          else
2554
 
            convenience="$convenience $dir/$old_library"
2555
 
            old_convenience="$old_convenience $dir/$old_library"
2556
2891
            deplibs="$dir/$old_library $deplibs"
2557
2892
            link_static=yes
2558
2893
          fi
2631
2966
                  # we do not want to link against static libs,
2632
2967
                  # but need to link against shared
2633
2968
                  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
 
2969
                  eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2634
2970
                  if test -n "$deplibrary_names" ; then
2635
2971
                    for tmp in $deplibrary_names ; do
2636
2972
                      depdepl=$tmp
2637
2973
                    done
2638
 
                    if test -f "$path/$depdepl" ; then
 
2974
                    if test -f "$deplibdir/$depdepl" ; then
 
2975
                      depdepl="$deplibdir/$depdepl"
 
2976
                    elif test -f "$path/$depdepl" ; then
2639
2977
                      depdepl="$path/$depdepl"
 
2978
                    else
 
2979
                      # Can't find it, oh well...
 
2980
                      depdepl=
2640
2981
                    fi
2641
2982
                    # do not add paths which are already there
2642
2983
                    case " $newlib_search_path " in
2670
3011
              *) continue ;;
2671
3012
              esac
2672
3013
              case " $deplibs " in
 
3014
              *" $path "*) ;;
 
3015
              *) deplibs="$path $deplibs" ;;
 
3016
              esac
 
3017
              case " $deplibs " in
2673
3018
              *" $depdepl "*) ;;
2674
3019
              *) deplibs="$depdepl $deplibs" ;;
2675
3020
              esac
2676
 
              case " $deplibs " in
2677
 
              *" $path "*) ;;
2678
 
              *) deplibs="$deplibs $path" ;;
2679
 
              esac
2680
3021
            done
2681
3022
          fi # link_all_deplibs != no
2682
3023
        fi # linkmode = lib
2784
3125
 
2785
3126
    case $linkmode in
2786
3127
    oldlib)
2787
 
      if test -n "$deplibs"; then
2788
 
        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2789
 
      fi
 
3128
      case " $deplibs" in
 
3129
      *\ -l* | *\ -L*)
 
3130
        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
 
3131
      esac
2790
3132
 
2791
3133
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2792
3134
        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2914
3256
          # which has an extra 1 added just for fun
2915
3257
          #
2916
3258
          case $version_type in
2917
 
          darwin|linux|osf|windows)
 
3259
          darwin|linux|osf|windows|none)
2918
3260
            current=`expr $number_major + $number_minor`
2919
3261
            age="$number_minor"
2920
3262
            revision="$number_revision"
2925
3267
            age="0"
2926
3268
            ;;
2927
3269
          irix|nonstopux)
2928
 
            current=`expr $number_major + $number_minor - 1`
 
3270
            current=`expr $number_major + $number_minor`
2929
3271
            age="$number_minor"
2930
3272
            revision="$number_minor"
 
3273
            lt_irix_increment=no
2931
3274
            ;;
2932
3275
          *)
2933
3276
            $echo "$modename: unknown library version type \`$version_type'" 1>&2
2947
3290
        case $current in
2948
3291
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2949
3292
        *)
2950
 
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
 
3293
          $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2951
3294
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2952
3295
          exit $EXIT_FAILURE
2953
3296
          ;;
2956
3299
        case $revision in
2957
3300
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2958
3301
        *)
2959
 
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
 
3302
          $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2960
3303
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2961
3304
          exit $EXIT_FAILURE
2962
3305
          ;;
2965
3308
        case $age in
2966
3309
        0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
2967
3310
        *)
2968
 
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
 
3311
          $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2969
3312
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2970
3313
          exit $EXIT_FAILURE
2971
3314
          ;;
2991
3334
          versuffix="$major.$age.$revision"
2992
3335
          # Darwin ld doesn't like 0 for these options...
2993
3336
          minor_current=`expr $current + 1`
 
3337
          xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
2994
3338
          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2995
3339
          ;;
2996
3340
 
3005
3349
          ;;
3006
3350
 
3007
3351
        irix | nonstopux)
3008
 
          major=`expr $current - $age + 1`
3009
 
 
 
3352
          if test "X$lt_irix_increment" = "Xno"; then
 
3353
            major=`expr $current - $age`
 
3354
          else
 
3355
            major=`expr $current - $age + 1`
 
3356
          fi
3010
3357
          case $version_type in
3011
3358
            nonstopux) verstring_prefix=nonstopux ;;
3012
3359
            *)         verstring_prefix=sgi ;;
3143
3490
      fi
3144
3491
 
3145
3492
      # Eliminate all temporary directories.
3146
 
      for path in $notinst_path; do
3147
 
        lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3148
 
        deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3149
 
        dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3150
 
      done
 
3493
      #for path in $notinst_path; do
 
3494
      # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
 
3495
      # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
 
3496
      # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
 
3497
      #done
3151
3498
 
3152
3499
      if test -n "$xrpath"; then
3153
3500
        # If the user specified any rpath flags, then add them.
3197
3544
          *-*-netbsd*)
3198
3545
            # Don't link with libc until the a.out ld.so is fixed.
3199
3546
            ;;
3200
 
          *-*-openbsd* | *-*-freebsd*)
 
3547
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3201
3548
            # Do not include libc due to us having libc/libc_r.
3202
 
            test "X$arg" = "X-lc" && continue
 
3549
            ;;
 
3550
          *-*-sco3.2v5* | *-*-sco5v6*)
 
3551
            # Causes problems with __ctype
 
3552
            ;;
 
3553
          *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
 
3554
            # Compiler inserts libc in the correct place for threads to work
3203
3555
            ;;
3204
3556
          *)
3205
3557
            # Add libc to deplibs on all other systems if necessary.
3243
3595
          int main() { return 0; }
3244
3596
EOF
3245
3597
          $rm conftest
3246
 
          $LTCC -o conftest conftest.c $deplibs
3247
 
          if test "$?" -eq 0 ; then
 
3598
          if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3248
3599
            ldd_output=`ldd conftest`
3249
3600
            for i in $deplibs; do
3250
 
              name="`expr $i : '-l\(.*\)'`"
 
3601
              name=`expr $i : '-l\(.*\)'`
3251
3602
              # If $name is empty we are operating on a -L argument.
3252
 
              if test "$name" != "" && test "$name" -ne "0"; then
 
3603
              if test "$name" != "" && test "$name" != "0"; then
3253
3604
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3254
3605
                  case " $predeps $postdeps " in
3255
3606
                  *" $i "*)
3284
3635
            # Error occurred in the first compile.  Let's try to salvage
3285
3636
            # the situation: Compile a separate program for each library.
3286
3637
            for i in $deplibs; do
3287
 
              name="`expr $i : '-l\(.*\)'`"
 
3638
              name=`expr $i : '-l\(.*\)'`
3288
3639
              # If $name is empty we are operating on a -L argument.
3289
3640
              if test "$name" != "" && test "$name" != "0"; then
3290
3641
                $rm conftest
3291
 
                $LTCC -o conftest conftest.c $i
3292
 
                # Did it work?
3293
 
                if test "$?" -eq 0 ; then
 
3642
                if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3294
3643
                  ldd_output=`ldd conftest`
3295
3644
                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3296
3645
                    case " $predeps $postdeps " in
3322
3671
                  droppeddeps=yes
3323
3672
                  $echo
3324
3673
                  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
3325
 
                  $echo "***  make it link in!  You will probably need to install it or some"
 
3674
                  $echo "*** make it link in!  You will probably need to install it or some"
3326
3675
                  $echo "*** library that it depends on before this library will be fully"
3327
3676
                  $echo "*** functional.  Installing it before continuing would be even better."
3328
3677
                fi
3336
3685
          set dummy $deplibs_check_method
3337
3686
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3338
3687
          for a_deplib in $deplibs; do
3339
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3688
            name=`expr $a_deplib : '-l\(.*\)'`
3340
3689
            # If $name is empty we are operating on a -L argument.
3341
3690
            if test "$name" != "" && test  "$name" != "0"; then
3342
3691
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3405
3754
          set dummy $deplibs_check_method
3406
3755
          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3407
3756
          for a_deplib in $deplibs; do
3408
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3757
            name=`expr $a_deplib : '-l\(.*\)'`
3409
3758
            # If $name is empty we are operating on a -L argument.
3410
3759
            if test -n "$name" && test "$name" != "0"; then
3411
3760
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3535
3884
        deplibs=$newdeplibs
3536
3885
      fi
3537
3886
 
 
3887
 
 
3888
      # move library search paths that coincide with paths to not yet
 
3889
      # installed libraries to the beginning of the library search list
 
3890
      new_libs=
 
3891
      for path in $notinst_path; do
 
3892
        case " $new_libs " in
 
3893
        *" -L$path/$objdir "*) ;;
 
3894
        *)
 
3895
          case " $deplibs " in
 
3896
          *" -L$path/$objdir "*)
 
3897
            new_libs="$new_libs -L$path/$objdir" ;;
 
3898
          esac
 
3899
          ;;
 
3900
        esac
 
3901
      done
 
3902
      for deplib in $deplibs; do
 
3903
        case $deplib in
 
3904
        -L*)
 
3905
          case " $new_libs " in
 
3906
          *" $deplib "*) ;;
 
3907
          *) new_libs="$new_libs $deplib" ;;
 
3908
          esac
 
3909
          ;;
 
3910
        *) new_libs="$new_libs $deplib" ;;
 
3911
        esac
 
3912
      done
 
3913
      deplibs="$new_libs"
 
3914
 
 
3915
 
3538
3916
      # All the library-specific variables (install_libdir is set above).
3539
3917
      library_names=
3540
3918
      old_library=
3579
3957
             test -n "$hardcode_libdirs"; then
3580
3958
            libdir="$hardcode_libdirs"
3581
3959
            if test -n "$hardcode_libdir_flag_spec_ld"; then
3582
 
              eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
 
3960
              case $archive_cmds in
 
3961
              *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
 
3962
              *)      eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
 
3963
              esac
3583
3964
            else
3584
3965
              eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3585
3966
            fi
3618
3999
        fi
3619
4000
 
3620
4001
        lib="$output_objdir/$realname"
 
4002
        linknames=
3621
4003
        for link
3622
4004
        do
3623
4005
          linknames="$linknames $link"
3646
4028
                # The command line is too long to execute in one step.
3647
4029
                $show "using reloadable object file for export list..."
3648
4030
                skipped_export=:
 
4031
                # Break out early, otherwise skipped_export may be
 
4032
                # set to false by a later but shorter cmd.
 
4033
                break
3649
4034
              fi
3650
4035
            done
3651
4036
            IFS="$save_ifs"
3679
4064
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3680
4065
          else
3681
4066
            gentop="$output_objdir/${outputname}x"
3682
 
            $show "${rm}r $gentop"
3683
 
            $run ${rm}r "$gentop"
3684
 
            $show "$mkdir $gentop"
3685
 
            $run $mkdir "$gentop"
3686
 
            status=$?
3687
 
            if test "$status" -ne 0 && test ! -d "$gentop"; then
3688
 
              exit $status
3689
 
            fi
3690
4067
            generated="$generated $gentop"
3691
4068
 
3692
 
            for xlib in $convenience; do
3693
 
              # Extract the objects.
3694
 
              case $xlib in
3695
 
              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3696
 
              *) xabs=`pwd`"/$xlib" ;;
3697
 
              esac
3698
 
              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3699
 
              xdir="$gentop/$xlib"
3700
 
 
3701
 
              $show "${rm}r $xdir"
3702
 
              $run ${rm}r "$xdir"
3703
 
              $show "$mkdir $xdir"
3704
 
              $run $mkdir "$xdir"
3705
 
              status=$?
3706
 
              if test "$status" -ne 0 && test ! -d "$xdir"; then
3707
 
                exit $status
3708
 
              fi
3709
 
              # We will extract separately just the conflicting names and we will no
3710
 
              # longer touch any unique names. It is faster to leave these extract
3711
 
              # automatically by $AR in one run.
3712
 
              $show "(cd $xdir && $AR x $xabs)"
3713
 
              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3714
 
              if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3715
 
                :
3716
 
              else
3717
 
                $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3718
 
                $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3719
 
                $AR t "$xabs" | sort | uniq -cd | while read -r count name
3720
 
                do
3721
 
                  i=1
3722
 
                  while test "$i" -le "$count"
3723
 
                  do
3724
 
                   # Put our $i before any first dot (extension)
3725
 
                   # Never overwrite any file
3726
 
                   name_to="$name"
3727
 
                   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3728
 
                   do
3729
 
                     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3730
 
                   done
3731
 
                   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3732
 
                   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3733
 
                   i=`expr $i + 1`
3734
 
                  done
3735
 
                done
3736
 
              fi
3737
 
 
3738
 
              libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3739
 
            done
 
4069
            func_extract_archives $gentop $convenience
 
4070
            libobjs="$libobjs $func_extract_archives_result"
3740
4071
          fi
3741
4072
        fi
3742
 
 
 
4073
        
3743
4074
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3744
4075
          eval flag=\"$thread_safe_flag_spec\"
3745
4076
          linker_flags="$linker_flags $flag"
3769
4100
          fi
3770
4101
        fi
3771
4102
 
3772
 
        if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
 
4103
        if test "X$skipped_export" != "X:" &&
 
4104
           len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3773
4105
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3774
4106
          :
3775
4107
        else
3788
4120
            save_libobjs=$libobjs
3789
4121
          fi
3790
4122
          save_output=$output
 
4123
          output_la=`$echo "X$output" | $Xsed -e "$basename"`
3791
4124
 
3792
4125
          # Clear the reloadable object creation command queue and
3793
4126
          # initialize k to one.
3797
4130
          delfiles=
3798
4131
          last_robj=
3799
4132
          k=1
3800
 
          output=$output_objdir/$save_output-${k}.$objext
 
4133
          output=$output_objdir/$output_la-${k}.$objext
3801
4134
          # Loop over the list of objects to be linked.
3802
4135
          for obj in $save_libobjs
3803
4136
          do
3804
4137
            eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3805
4138
            if test "X$objlist" = X ||
3806
 
               { len=`expr "X$test_cmds" : ".*"` &&
 
4139
               { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3807
4140
                 test "$len" -le "$max_cmd_len"; }; then
3808
4141
              objlist="$objlist $obj"
3809
4142
            else
3817
4150
                # the last one created.
3818
4151
                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3819
4152
              fi
3820
 
              last_robj=$output_objdir/$save_output-${k}.$objext
 
4153
              last_robj=$output_objdir/$output_la-${k}.$objext
3821
4154
              k=`expr $k + 1`
3822
 
              output=$output_objdir/$save_output-${k}.$objext
 
4155
              output=$output_objdir/$output_la-${k}.$objext
3823
4156
              objlist=$obj
3824
4157
              len=1
3825
4158
            fi
3839
4172
            eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3840
4173
          fi
3841
4174
 
3842
 
          # Set up a command to remove the reloadale object files
 
4175
          # Set up a command to remove the reloadable object files
3843
4176
          # after they are used.
3844
4177
          i=0
3845
4178
          while test "$i" -lt "$k"
3846
4179
          do
3847
4180
            i=`expr $i + 1`
3848
 
            delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
 
4181
            delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3849
4182
          done
3850
4183
 
3851
4184
          $echo "creating a temporary reloadable object file: $output"
3893
4226
          IFS="$save_ifs"
3894
4227
          eval cmd=\"$cmd\"
3895
4228
          $show "$cmd"
3896
 
          $run eval "$cmd" || exit $?
 
4229
          $run eval "$cmd" || {
 
4230
            lt_exit=$?
 
4231
 
 
4232
            # Restore the uninstalled library and exit
 
4233
            if test "$mode" = relink; then
 
4234
              $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
 
4235
            fi
 
4236
 
 
4237
            exit $lt_exit
 
4238
          }
3897
4239
        done
3898
4240
        IFS="$save_ifs"
3899
4241
 
3900
4242
        # Restore the uninstalled library and exit
3901
4243
        if test "$mode" = relink; then
3902
4244
          $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
 
4245
 
 
4246
          if test -n "$convenience"; then
 
4247
            if test -z "$whole_archive_flag_spec"; then
 
4248
              $show "${rm}r $gentop"
 
4249
              $run ${rm}r "$gentop"
 
4250
            fi
 
4251
          fi
 
4252
 
3903
4253
          exit $EXIT_SUCCESS
3904
4254
        fi
3905
4255
 
3920
4270
      ;;
3921
4271
 
3922
4272
    obj)
3923
 
      if test -n "$deplibs"; then
3924
 
        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3925
 
      fi
 
4273
      case " $deplibs" in
 
4274
      *\ -l* | *\ -L*)
 
4275
        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
 
4276
      esac
3926
4277
 
3927
4278
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3928
4279
        $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3969
4320
      reload_conv_objs=
3970
4321
      gentop=
3971
4322
      # reload_cmds runs $LD directly, so let us get rid of
3972
 
      # -Wl from whole_archive_flag_spec
 
4323
      # -Wl from whole_archive_flag_spec and hope we can get by with
 
4324
      # turning comma into space..
3973
4325
      wl=
3974
4326
 
3975
4327
      if test -n "$convenience"; then
3976
4328
        if test -n "$whole_archive_flag_spec"; then
3977
 
          eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
 
4329
          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
 
4330
          reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
3978
4331
        else
3979
4332
          gentop="$output_objdir/${obj}x"
3980
 
          $show "${rm}r $gentop"
3981
 
          $run ${rm}r "$gentop"
3982
 
          $show "$mkdir $gentop"
3983
 
          $run $mkdir "$gentop"
3984
 
          status=$?
3985
 
          if test "$status" -ne 0 && test ! -d "$gentop"; then
3986
 
            exit $status
3987
 
          fi
3988
4333
          generated="$generated $gentop"
3989
4334
 
3990
 
          for xlib in $convenience; do
3991
 
            # Extract the objects.
3992
 
            case $xlib in
3993
 
            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3994
 
            *) xabs=`pwd`"/$xlib" ;;
3995
 
            esac
3996
 
            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3997
 
            xdir="$gentop/$xlib"
3998
 
 
3999
 
            $show "${rm}r $xdir"
4000
 
            $run ${rm}r "$xdir"
4001
 
            $show "$mkdir $xdir"
4002
 
            $run $mkdir "$xdir"
4003
 
            status=$?
4004
 
            if test "$status" -ne 0 && test ! -d "$xdir"; then
4005
 
              exit $status
4006
 
            fi
4007
 
            # We will extract separately just the conflicting names and we will no
4008
 
            # longer touch any unique names. It is faster to leave these extract
4009
 
            # automatically by $AR in one run.
4010
 
            $show "(cd $xdir && $AR x $xabs)"
4011
 
            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4012
 
            if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4013
 
              :
4014
 
            else
4015
 
              $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4016
 
              $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4017
 
              $AR t "$xabs" | sort | uniq -cd | while read -r count name
4018
 
              do
4019
 
                i=1
4020
 
                while test "$i" -le "$count"
4021
 
                do
4022
 
                 # Put our $i before any first dot (extension)
4023
 
                 # Never overwrite any file
4024
 
                 name_to="$name"
4025
 
                 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4026
 
                 do
4027
 
                   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4028
 
                 done
4029
 
                 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4030
 
                 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4031
 
                 i=`expr $i + 1`
4032
 
                done
4033
 
              done
4034
 
            fi
4035
 
 
4036
 
            reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4037
 
          done
 
4335
          func_extract_archives $gentop $convenience
 
4336
          reload_conv_objs="$reload_objs $func_extract_archives_result"
4038
4337
        fi
4039
4338
      fi
4040
4339
 
4135
4434
        ;;
4136
4435
      esac
4137
4436
 
 
4437
 
 
4438
      # move library search paths that coincide with paths to not yet
 
4439
      # installed libraries to the beginning of the library search list
 
4440
      new_libs=
 
4441
      for path in $notinst_path; do
 
4442
        case " $new_libs " in
 
4443
        *" -L$path/$objdir "*) ;;
 
4444
        *)
 
4445
          case " $compile_deplibs " in
 
4446
          *" -L$path/$objdir "*)
 
4447
            new_libs="$new_libs -L$path/$objdir" ;;
 
4448
          esac
 
4449
          ;;
 
4450
        esac
 
4451
      done
 
4452
      for deplib in $compile_deplibs; do
 
4453
        case $deplib in
 
4454
        -L*)
 
4455
          case " $new_libs " in
 
4456
          *" $deplib "*) ;;
 
4457
          *) new_libs="$new_libs $deplib" ;;
 
4458
          esac
 
4459
          ;;
 
4460
        *) new_libs="$new_libs $deplib" ;;
 
4461
        esac
 
4462
      done
 
4463
      compile_deplibs="$new_libs"
 
4464
 
 
4465
 
4138
4466
      compile_command="$compile_command $compile_deplibs"
4139
4467
      finalize_command="$finalize_command $finalize_deplibs"
4140
4468
 
4179
4507
        fi
4180
4508
        case $host in
4181
4509
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
4510
          testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4182
4511
          case :$dllsearchpath: in
4183
4512
          *":$libdir:"*) ;;
4184
4513
          *) dllsearchpath="$dllsearchpath:$libdir";;
4185
4514
          esac
 
4515
          case :$dllsearchpath: in
 
4516
          *":$testbindir:"*) ;;
 
4517
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
4518
          esac
4186
4519
          ;;
4187
4520
        esac
4188
4521
      done
4296
4629
 
4297
4630
            # Prepare the list of exported symbols
4298
4631
            if test -z "$export_symbols"; then
4299
 
              export_symbols="$output_objdir/$output.exp"
 
4632
              export_symbols="$output_objdir/$outputname.exp"
4300
4633
              $run $rm $export_symbols
4301
 
              $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 
4634
              $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
 
4635
              case $host in
 
4636
              *cygwin* | *mingw* )
 
4637
                $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
 
4638
                $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
 
4639
                ;;
 
4640
              esac
4302
4641
            else
4303
 
              $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4304
 
              $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
 
4642
              $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
 
4643
              $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
4305
4644
              $run eval 'mv "$nlist"T "$nlist"'
 
4645
              case $host in
 
4646
              *cygwin* | *mingw* )
 
4647
                $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
 
4648
                $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
 
4649
                ;;
 
4650
              esac
4306
4651
            fi
4307
4652
          fi
4308
4653
 
4353
4698
#endif
4354
4699
 
4355
4700
/* The mapping between symbol names and symbols. */
 
4701
"
 
4702
 
 
4703
            case $host in
 
4704
            *cygwin* | *mingw* )
 
4705
          $echo >> "$output_objdir/$dlsyms" "\
 
4706
/* DATA imports from DLLs on WIN32 can't be const, because
 
4707
   runtime relocations are performed -- see ld's documentation
 
4708
   on pseudo-relocs */
 
4709
struct {
 
4710
"
 
4711
              ;;
 
4712
            * )
 
4713
          $echo >> "$output_objdir/$dlsyms" "\
4356
4714
const struct {
 
4715
"
 
4716
              ;;
 
4717
            esac
 
4718
 
 
4719
 
 
4720
          $echo >> "$output_objdir/$dlsyms" "\
4357
4721
  const char *name;
4358
4722
  lt_ptr address;
4359
4723
}
4400
4764
          esac
4401
4765
 
4402
4766
          # Now compile the dynamic symbol file.
4403
 
          $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4404
 
          $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
4767
          $show "(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
 
4768
          $run eval '(cd $output_objdir && $LTCC  $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
4405
4769
 
4406
4770
          # Clean up the generated files.
4407
4771
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4408
4772
          $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4409
4773
 
4410
4774
          # Transform the symbol file into the correct name.
4411
 
          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4412
 
          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
4775
          case $host in
 
4776
          *cygwin* | *mingw* )
 
4777
            if test -f "$output_objdir/${outputname}.def" ; then
 
4778
              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
 
4779
              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
 
4780
            else
 
4781
              compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
 
4782
              finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
 
4783
             fi
 
4784
            ;;
 
4785
          * )
 
4786
            compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
 
4787
            finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
 
4788
            ;;
 
4789
          esac
4413
4790
          ;;
4414
4791
        *)
4415
4792
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4422
4799
        # really was required.
4423
4800
 
4424
4801
        # Nullify the symbol file.
4425
 
        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4426
 
        finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
 
4802
        compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
 
4803
        finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
4427
4804
      fi
4428
4805
 
4429
4806
      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4430
4807
        # Replace the output file specification.
4431
 
        compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 
4808
        compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
4432
4809
        link_command="$compile_command$compile_rpath"
4433
4810
 
4434
4811
        # We have no uninstalled library dependencies, so finalize right now.
4435
4812
        $show "$link_command"
4436
4813
        $run eval "$link_command"
4437
 
        status=$?
 
4814
        exit_status=$?
4438
4815
 
4439
4816
        # Delete the generated files.
4440
4817
        if test -n "$dlsyms"; then
4442
4819
          $run $rm "$output_objdir/${outputname}S.${objext}"
4443
4820
        fi
4444
4821
 
4445
 
        exit $status
 
4822
        exit $exit_status
4446
4823
      fi
4447
4824
 
4448
4825
      if test -n "$shlibpath_var"; then
4515
4892
        if test "$fast_install" != no; then
4516
4893
          link_command="$finalize_var$compile_command$finalize_rpath"
4517
4894
          if test "$fast_install" = yes; then
4518
 
            relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
 
4895
            relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
4519
4896
          else
4520
4897
            # fast_install is set to needless
4521
4898
            relink_command=
4552
4929
          fi
4553
4930
        done
4554
4931
        relink_command="(cd `pwd`; $relink_command)"
4555
 
        relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
 
4932
        relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
4556
4933
      fi
4557
4934
 
4558
4935
      # Quote $echo for shipping.
4582
4959
        esac
4583
4960
        case $host in
4584
4961
          *cygwin* | *mingw* )
4585
 
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
4586
 
            cwrapper=`$echo ${output}.exe`
4587
 
            $rm $cwrappersource $cwrapper
4588
 
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
4962
            output_name=`basename $output`
 
4963
            output_path=`dirname $output`
 
4964
            cwrappersource="$output_path/$objdir/lt-$output_name.c"
 
4965
            cwrapper="$output_path/$output_name.exe"
 
4966
            $rm $cwrappersource $cwrapper
 
4967
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
4589
4968
 
4590
4969
            cat > $cwrappersource <<EOF
4591
4970
 
4610
4989
#include <malloc.h>
4611
4990
#include <stdarg.h>
4612
4991
#include <assert.h>
 
4992
#include <string.h>
 
4993
#include <ctype.h>
 
4994
#include <sys/stat.h>
4613
4995
 
4614
4996
#if defined(PATH_MAX)
4615
4997
# define LT_PATHMAX PATH_MAX
4620
5002
#endif
4621
5003
 
4622
5004
#ifndef DIR_SEPARATOR
4623
 
#define DIR_SEPARATOR '/'
 
5005
# define DIR_SEPARATOR '/'
 
5006
# define PATH_SEPARATOR ':'
4624
5007
#endif
4625
5008
 
4626
5009
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4627
5010
  defined (__OS2__)
4628
 
#define HAVE_DOS_BASED_FILE_SYSTEM
4629
 
#ifndef DIR_SEPARATOR_2
4630
 
#define DIR_SEPARATOR_2 '\\'
4631
 
#endif
 
5011
# define HAVE_DOS_BASED_FILE_SYSTEM
 
5012
# ifndef DIR_SEPARATOR_2
 
5013
#  define DIR_SEPARATOR_2 '\\'
 
5014
# endif
 
5015
# ifndef PATH_SEPARATOR_2
 
5016
#  define PATH_SEPARATOR_2 ';'
 
5017
# endif
4632
5018
#endif
4633
5019
 
4634
5020
#ifndef DIR_SEPARATOR_2
4638
5024
        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4639
5025
#endif /* DIR_SEPARATOR_2 */
4640
5026
 
 
5027
#ifndef PATH_SEPARATOR_2
 
5028
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
 
5029
#else /* PATH_SEPARATOR_2 */
 
5030
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
 
5031
#endif /* PATH_SEPARATOR_2 */
 
5032
 
4641
5033
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
4642
5034
#define XFREE(stale) do { \
4643
5035
  if (stale) { free ((void *) stale); stale = 0; } \
4644
5036
} while (0)
4645
5037
 
 
5038
/* -DDEBUG is fairly common in CFLAGS.  */
 
5039
#undef DEBUG
 
5040
#if defined DEBUGWRAPPER
 
5041
# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
 
5042
#else
 
5043
# define DEBUG(format, ...)
 
5044
#endif
 
5045
 
4646
5046
const char *program_name = NULL;
4647
5047
 
4648
5048
void * xmalloc (size_t num);
4649
5049
char * xstrdup (const char *string);
4650
 
char * basename (const char *name);
4651
 
char * fnqualify(const char *path);
 
5050
const char * base_name (const char *name);
 
5051
char * find_executable(const char *wrapper);
 
5052
int    check_executable(const char *path);
4652
5053
char * strendzap(char *str, const char *pat);
4653
5054
void lt_fatal (const char *message, ...);
4654
5055
 
4658
5059
  char **newargz;
4659
5060
  int i;
4660
5061
 
4661
 
  program_name = (char *) xstrdup ((char *) basename (argv[0]));
 
5062
  program_name = (char *) xstrdup (base_name (argv[0]));
 
5063
  DEBUG("(main) argv[0]      : %s\n",argv[0]);
 
5064
  DEBUG("(main) program_name : %s\n",program_name);
4662
5065
  newargz = XMALLOC(char *, argc+2);
4663
5066
EOF
4664
5067
 
4665
 
            cat >> $cwrappersource <<EOF
4666
 
  newargz[0] = "$SHELL";
 
5068
            cat >> $cwrappersource <<EOF
 
5069
  newargz[0] = (char *) xstrdup("$SHELL");
4667
5070
EOF
4668
5071
 
4669
 
            cat >> $cwrappersource <<"EOF"
4670
 
  newargz[1] = fnqualify(argv[0]);
 
5072
            cat >> $cwrappersource <<"EOF"
 
5073
  newargz[1] = find_executable(argv[0]);
 
5074
  if (newargz[1] == NULL)
 
5075
    lt_fatal("Couldn't find %s", argv[0]);
 
5076
  DEBUG("(main) found exe at : %s\n",newargz[1]);
4671
5077
  /* we know the script has the same name, without the .exe */
4672
5078
  /* so make sure newargz[1] doesn't end in .exe */
4673
5079
  strendzap(newargz[1],".exe");
4674
5080
  for (i = 1; i < argc; i++)
4675
5081
    newargz[i+1] = xstrdup(argv[i]);
4676
5082
  newargz[argc+1] = NULL;
4677
 
EOF
4678
 
 
4679
 
            cat >> $cwrappersource <<EOF
 
5083
 
 
5084
  for (i=0; i<argc+1; i++)
 
5085
  {
 
5086
    DEBUG("(main) newargz[%d]   : %s\n",i,newargz[i]);
 
5087
    ;
 
5088
  }
 
5089
 
 
5090
EOF
 
5091
 
 
5092
            case $host_os in
 
5093
              mingw*)
 
5094
                cat >> $cwrappersource <<EOF
 
5095
  execv("$SHELL",(char const **)newargz);
 
5096
EOF
 
5097
              ;;
 
5098
              *)
 
5099
                cat >> $cwrappersource <<EOF
4680
5100
  execv("$SHELL",newargz);
4681
5101
EOF
 
5102
              ;;
 
5103
            esac
4682
5104
 
4683
 
            cat >> $cwrappersource <<"EOF"
 
5105
            cat >> $cwrappersource <<"EOF"
 
5106
  return 127;
4684
5107
}
4685
5108
 
4686
5109
void *
4700
5123
;
4701
5124
}
4702
5125
 
4703
 
char *
4704
 
basename (const char *name)
 
5126
const char *
 
5127
base_name (const char *name)
4705
5128
{
4706
5129
  const char *base;
4707
5130
 
4708
5131
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4709
5132
  /* Skip over the disk name in MSDOS pathnames. */
4710
 
  if (isalpha (name[0]) && name[1] == ':')
 
5133
  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
4711
5134
    name += 2;
4712
5135
#endif
4713
5136
 
4714
5137
  for (base = name; *name; name++)
4715
5138
    if (IS_DIR_SEPARATOR (*name))
4716
5139
      base = name + 1;
4717
 
  return (char *) base;
4718
 
}
4719
 
 
 
5140
  return base;
 
5141
}
 
5142
 
 
5143
int
 
5144
check_executable(const char * path)
 
5145
{
 
5146
  struct stat st;
 
5147
 
 
5148
  DEBUG("(check_executable)  : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
 
5149
  if ((!path) || (!*path))
 
5150
    return 0;
 
5151
 
 
5152
  if ((stat (path, &st) >= 0) &&
 
5153
      (
 
5154
        /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
 
5155
#if defined (S_IXOTH)
 
5156
       ((st.st_mode & S_IXOTH) == S_IXOTH) ||
 
5157
#endif
 
5158
#if defined (S_IXGRP)
 
5159
       ((st.st_mode & S_IXGRP) == S_IXGRP) ||
 
5160
#endif
 
5161
       ((st.st_mode & S_IXUSR) == S_IXUSR))
 
5162
      )
 
5163
    return 1;
 
5164
  else
 
5165
    return 0;
 
5166
}
 
5167
 
 
5168
/* Searches for the full path of the wrapper.  Returns
 
5169
   newly allocated full path name if found, NULL otherwise */
4720
5170
char *
4721
 
fnqualify(const char *path)
 
5171
find_executable (const char* wrapper)
4722
5172
{
4723
 
  size_t size;
4724
 
  char *p;
 
5173
  int has_slash = 0;
 
5174
  const char* p;
 
5175
  const char* p_next;
 
5176
  /* static buffer for getcwd */
4725
5177
  char tmp[LT_PATHMAX + 1];
4726
 
 
4727
 
  assert(path != NULL);
4728
 
 
4729
 
  /* Is it qualified already? */
4730
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4731
 
  if (isalpha (path[0]) && path[1] == ':')
4732
 
    return xstrdup (path);
4733
 
#endif
4734
 
  if (IS_DIR_SEPARATOR (path[0]))
4735
 
    return xstrdup (path);
4736
 
 
4737
 
  /* prepend the current directory */
4738
 
  /* doesn't handle '~' */
 
5178
  int tmp_len;
 
5179
  char* concat_name;
 
5180
 
 
5181
  DEBUG("(find_executable)  : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
 
5182
 
 
5183
  if ((wrapper == NULL) || (*wrapper == '\0'))
 
5184
    return NULL;
 
5185
 
 
5186
  /* Absolute path? */
 
5187
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
 
5188
  if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
 
5189
  {
 
5190
    concat_name = xstrdup (wrapper);
 
5191
    if (check_executable(concat_name))
 
5192
      return concat_name;
 
5193
    XFREE(concat_name);
 
5194
  }
 
5195
  else
 
5196
  {
 
5197
#endif
 
5198
    if (IS_DIR_SEPARATOR (wrapper[0]))
 
5199
    {
 
5200
      concat_name = xstrdup (wrapper);
 
5201
      if (check_executable(concat_name))
 
5202
        return concat_name;
 
5203
      XFREE(concat_name);
 
5204
    }
 
5205
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
 
5206
  }
 
5207
#endif
 
5208
 
 
5209
  for (p = wrapper; *p; p++)
 
5210
    if (*p == '/')
 
5211
    {
 
5212
      has_slash = 1;
 
5213
      break;
 
5214
    }
 
5215
  if (!has_slash)
 
5216
  {
 
5217
    /* no slashes; search PATH */
 
5218
    const char* path = getenv ("PATH");
 
5219
    if (path != NULL)
 
5220
    {
 
5221
      for (p = path; *p; p = p_next)
 
5222
      {
 
5223
        const char* q;
 
5224
        size_t p_len;
 
5225
        for (q = p; *q; q++)
 
5226
          if (IS_PATH_SEPARATOR(*q))
 
5227
            break;
 
5228
        p_len = q - p;
 
5229
        p_next = (*q == '\0' ? q : q + 1);
 
5230
        if (p_len == 0)
 
5231
        {
 
5232
          /* empty path: current directory */
 
5233
          if (getcwd (tmp, LT_PATHMAX) == NULL)
 
5234
            lt_fatal ("getcwd failed");
 
5235
          tmp_len = strlen(tmp);
 
5236
          concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
 
5237
          memcpy (concat_name, tmp, tmp_len);
 
5238
          concat_name[tmp_len] = '/';
 
5239
          strcpy (concat_name + tmp_len + 1, wrapper);
 
5240
        }
 
5241
        else
 
5242
        {
 
5243
          concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
 
5244
          memcpy (concat_name, p, p_len);
 
5245
          concat_name[p_len] = '/';
 
5246
          strcpy (concat_name + p_len + 1, wrapper);
 
5247
        }
 
5248
        if (check_executable(concat_name))
 
5249
          return concat_name;
 
5250
        XFREE(concat_name);
 
5251
      }
 
5252
    }
 
5253
    /* not found in PATH; assume curdir */
 
5254
  }
 
5255
  /* Relative path | not found in path: prepend cwd */
4739
5256
  if (getcwd (tmp, LT_PATHMAX) == NULL)
4740
5257
    lt_fatal ("getcwd failed");
4741
 
  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4742
 
  p = XMALLOC(char, size);
4743
 
  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4744
 
  return p;
 
5258
  tmp_len = strlen(tmp);
 
5259
  concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
 
5260
  memcpy (concat_name, tmp, tmp_len);
 
5261
  concat_name[tmp_len] = '/';
 
5262
  strcpy (concat_name + tmp_len + 1, wrapper);
 
5263
 
 
5264
  if (check_executable(concat_name))
 
5265
    return concat_name;
 
5266
  XFREE(concat_name);
 
5267
  return NULL;
4745
5268
}
4746
5269
 
4747
5270
char *
4785
5308
  va_end (ap);
4786
5309
}
4787
5310
EOF
4788
 
          # we should really use a build-platform specific compiler
4789
 
          # here, but OTOH, the wrappers (shell script and this C one)
4790
 
          # are only useful if you want to execute the "real" binary.
4791
 
          # Since the "real" binary is built for $host, then this
4792
 
          # wrapper might as well be built for $host, too.
4793
 
          $run $LTCC -s -o $cwrapper $cwrappersource
4794
 
          ;;
4795
 
        esac
4796
 
        $rm $output
4797
 
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
5311
          # we should really use a build-platform specific compiler
 
5312
          # here, but OTOH, the wrappers (shell script and this C one)
 
5313
          # are only useful if you want to execute the "real" binary.
 
5314
          # Since the "real" binary is built for $host, then this
 
5315
          # wrapper might as well be built for $host, too.
 
5316
          $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
 
5317
          ;;
 
5318
        esac
 
5319
        $rm $output
 
5320
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
4798
5321
 
4799
5322
        $echo > $output "\
4800
5323
#! $SHELL
4813
5336
Xsed='${SED} -e 1s/^X//'
4814
5337
sed_quote_subst='$sed_quote_subst'
4815
5338
 
 
5339
# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
 
5340
if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
 
5341
  emulate sh
 
5342
  NULLCMD=:
 
5343
  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
 
5344
  # is contrary to our usage.  Disable this feature.
 
5345
  alias -g '\${1+\"\$@\"}'='\"\$@\"'
 
5346
  setopt NO_GLOB_SUBST
 
5347
else
 
5348
  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
 
5349
fi
 
5350
BIN_SH=xpg4; export BIN_SH # for Tru64
 
5351
DUALCASE=1; export DUALCASE # for MKS sh
 
5352
 
4816
5353
# The HP-UX ksh and POSIX shell print the target directory to stdout
4817
5354
# if CDPATH is set.
4818
 
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
 
5355
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4819
5356
 
4820
5357
relink_command=\"$relink_command\"
4821
5358
 
4944
5481
        # Backslashes separate directories on plain windows
4945
5482
        *-*-mingw | *-*-os2*)
4946
5483
          $echo >> $output "\
4947
 
      exec \$progdir\\\\\$program \${1+\"\$@\"}
 
5484
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4948
5485
"
4949
5486
          ;;
4950
5487
 
4951
5488
        *)
4952
5489
          $echo >> $output "\
4953
 
      exec \$progdir/\$program \${1+\"\$@\"}
 
5490
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
4954
5491
"
4955
5492
          ;;
4956
5493
        esac
4957
5494
        $echo >> $output "\
4958
 
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
 
5495
      \$echo \"\$0: cannot exec \$program \$*\"
4959
5496
      exit $EXIT_FAILURE
4960
5497
    fi
4961
5498
  else
4962
5499
    # The program doesn't exist.
4963
 
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
 
5500
    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4964
5501
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4965
5502
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4966
5503
    exit $EXIT_FAILURE
4992
5529
 
4993
5530
      if test -n "$addlibs"; then
4994
5531
        gentop="$output_objdir/${outputname}x"
4995
 
        $show "${rm}r $gentop"
4996
 
        $run ${rm}r "$gentop"
4997
 
        $show "$mkdir $gentop"
4998
 
        $run $mkdir "$gentop"
4999
 
        status=$?
5000
 
        if test "$status" -ne 0 && test ! -d "$gentop"; then
5001
 
          exit $status
5002
 
        fi
5003
5532
        generated="$generated $gentop"
5004
5533
 
5005
 
        # Add in members from convenience archives.
5006
 
        for xlib in $addlibs; do
5007
 
          # Extract the objects.
5008
 
          case $xlib in
5009
 
          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5010
 
          *) xabs=`pwd`"/$xlib" ;;
5011
 
          esac
5012
 
          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5013
 
          xdir="$gentop/$xlib"
5014
 
 
5015
 
          $show "${rm}r $xdir"
5016
 
          $run ${rm}r "$xdir"
5017
 
          $show "$mkdir $xdir"
5018
 
          $run $mkdir "$xdir"
5019
 
          status=$?
5020
 
          if test "$status" -ne 0 && test ! -d "$xdir"; then
5021
 
            exit $status
5022
 
          fi
5023
 
          # We will extract separately just the conflicting names and we will no
5024
 
          # longer touch any unique names. It is faster to leave these extract
5025
 
          # automatically by $AR in one run.
5026
 
          $show "(cd $xdir && $AR x $xabs)"
5027
 
          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5028
 
          if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5029
 
            :
5030
 
          else
5031
 
            $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5032
 
            $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5033
 
            $AR t "$xabs" | sort | uniq -cd | while read -r count name
5034
 
            do
5035
 
              i=1
5036
 
              while test "$i" -le "$count"
5037
 
              do
5038
 
               # Put our $i before any first dot (extension)
5039
 
               # Never overwrite any file
5040
 
               name_to="$name"
5041
 
               while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5042
 
               do
5043
 
                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5044
 
               done
5045
 
               $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5046
 
               $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5047
 
               i=`expr $i + 1`
5048
 
              done
5049
 
            done
5050
 
          fi
5051
 
 
5052
 
          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5053
 
        done
 
5534
        func_extract_archives $gentop $addlibs
 
5535
        oldobjs="$oldobjs $func_extract_archives_result"
5054
5536
      fi
5055
5537
 
5056
5538
      # Do each command in the archive commands.
5057
5539
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5058
5540
       cmds=$old_archive_from_new_cmds
5059
5541
      else
 
5542
        # POSIX demands no paths to be encoded in archives.  We have
 
5543
        # to avoid creating archives with duplicate basenames if we
 
5544
        # might have to extract them afterwards, e.g., when creating a
 
5545
        # static archive out of a convenience library, or when linking
 
5546
        # the entirety of a libtool archive into another (currently
 
5547
        # not supported by libtool).
 
5548
        if (for obj in $oldobjs
 
5549
            do
 
5550
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
 
5551
            done | sort | sort -uc >/dev/null 2>&1); then
 
5552
          :
 
5553
        else
 
5554
          $echo "copying selected object files to avoid basename conflicts..."
 
5555
 
 
5556
          if test -z "$gentop"; then
 
5557
            gentop="$output_objdir/${outputname}x"
 
5558
            generated="$generated $gentop"
 
5559
 
 
5560
            $show "${rm}r $gentop"
 
5561
            $run ${rm}r "$gentop"
 
5562
            $show "$mkdir $gentop"
 
5563
            $run $mkdir "$gentop"
 
5564
            exit_status=$?
 
5565
            if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
 
5566
              exit $exit_status
 
5567
            fi
 
5568
          fi
 
5569
 
 
5570
          save_oldobjs=$oldobjs
 
5571
          oldobjs=
 
5572
          counter=1
 
5573
          for obj in $save_oldobjs
 
5574
          do
 
5575
            objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
 
5576
            case " $oldobjs " in
 
5577
            " ") oldobjs=$obj ;;
 
5578
            *[\ /]"$objbase "*)
 
5579
              while :; do
 
5580
                # Make sure we don't pick an alternate name that also
 
5581
                # overlaps.
 
5582
                newobj=lt$counter-$objbase
 
5583
                counter=`expr $counter + 1`
 
5584
                case " $oldobjs " in
 
5585
                *[\ /]"$newobj "*) ;;
 
5586
                *) if test ! -f "$gentop/$newobj"; then break; fi ;;
 
5587
                esac
 
5588
              done
 
5589
              $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
 
5590
              $run ln "$obj" "$gentop/$newobj" ||
 
5591
              $run cp "$obj" "$gentop/$newobj"
 
5592
              oldobjs="$oldobjs $gentop/$newobj"
 
5593
              ;;
 
5594
            *) oldobjs="$oldobjs $obj" ;;
 
5595
            esac
 
5596
          done
 
5597
        fi
 
5598
 
5060
5599
        eval cmds=\"$old_archive_cmds\"
5061
5600
 
5062
5601
        if len=`expr "X$cmds" : ".*"` &&
5070
5609
          objlist=
5071
5610
          concat_cmds=
5072
5611
          save_oldobjs=$oldobjs
5073
 
          # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5074
 
          # encoded into archives.  This makes 'ar r' malfunction in
5075
 
          # this piecewise linking case whenever conflicting object
5076
 
          # names appear in distinct ar calls; check, warn and compensate.
5077
 
            if (for obj in $save_oldobjs
5078
 
            do
5079
 
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
5080
 
            done | sort | sort -uc >/dev/null 2>&1); then
5081
 
            :
5082
 
          else
5083
 
            $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5084
 
            $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5085
 
            AR_FLAGS=cq
5086
 
          fi
 
5612
 
5087
5613
          # Is there a better way of finding the last object in the list?
5088
5614
          for obj in $save_oldobjs
5089
5615
          do
5094
5620
            oldobjs="$objlist $obj"
5095
5621
            objlist="$objlist $obj"
5096
5622
            eval test_cmds=\"$old_archive_cmds\"
5097
 
            if len=`expr "X$test_cmds" : ".*"` &&
 
5623
            if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5098
5624
               test "$len" -le "$max_cmd_len"; then
5099
5625
              :
5100
5626
            else
5152
5678
      done
5153
5679
      # Quote the link command for shipping.
5154
5680
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5155
 
      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
 
5681
      relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
5156
5682
      if test "$hardcode_automatic" = yes ; then
5157
5683
        relink_command=
5158
5684
      fi
5291
5817
    # install_prog (especially on Windows NT).
5292
5818
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5293
5819
       # Allow the use of GNU shtool's install command.
5294
 
       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
 
5820
       $echo "X$nonopt" | grep shtool > /dev/null; then
5295
5821
      # Aesthetically quote it.
5296
5822
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5297
5823
      case $arg in
5298
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5824
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5299
5825
        arg="\"$arg\""
5300
5826
        ;;
5301
5827
      esac
5304
5830
      shift
5305
5831
    else
5306
5832
      install_prog=
5307
 
      arg="$nonopt"
 
5833
      arg=$nonopt
5308
5834
    fi
5309
5835
 
5310
5836
    # The real first argument should be the name of the installation program.
5311
5837
    # Aesthetically quote it.
5312
5838
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5313
5839
    case $arg in
5314
 
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
 
5840
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
5315
5841
      arg="\"$arg\""
5316
5842
      ;;
5317
5843
    esac
5329
5855
    do
5330
5856
      if test -n "$dest"; then
5331
5857
        files="$files $dest"
5332
 
        dest="$arg"
 
5858
        dest=$arg
5333
5859
        continue
5334
5860
      fi
5335
5861
 
5336
5862
      case $arg in
5337
5863
      -d) isdir=yes ;;
5338
 
      -f) prev="-f" ;;
5339
 
      -g) prev="-g" ;;
5340
 
      -m) prev="-m" ;;
5341
 
      -o) prev="-o" ;;
 
5864
      -f) 
 
5865
        case " $install_prog " in
 
5866
        *[\\\ /]cp\ *) ;;
 
5867
        *) prev=$arg ;;
 
5868
        esac
 
5869
        ;;
 
5870
      -g | -m | -o) prev=$arg ;;
5342
5871
      -s)
5343
5872
        stripme=" -s"
5344
5873
        continue
5345
5874
        ;;
5346
 
      -*) ;;
5347
 
 
 
5875
      -*)
 
5876
        ;;
5348
5877
      *)
5349
5878
        # If the previous option needed an argument, then skip it.
5350
5879
        if test -n "$prev"; then
5351
5880
          prev=
5352
5881
        else
5353
 
          dest="$arg"
 
5882
          dest=$arg
5354
5883
          continue
5355
5884
        fi
5356
5885
        ;;
5359
5888
      # Aesthetically quote the argument.
5360
5889
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5361
5890
      case $arg in
5362
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5891
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5363
5892
        arg="\"$arg\""
5364
5893
        ;;
5365
5894
      esac
5494
6023
 
5495
6024
          if test -n "$inst_prefix_dir"; then
5496
6025
            # Stick the inst_prefix_dir data into the link command.
5497
 
            relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
 
6026
            relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
5498
6027
          else
5499
 
            relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 
6028
            relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
5500
6029
          fi
5501
6030
 
5502
6031
          $echo "$modename: warning: relinking \`$file'" 1>&2
5528
6057
 
5529
6058
          if test "$#" -gt 0; then
5530
6059
            # Delete the old symlinks, and create new ones.
 
6060
            # Try `ln -sf' first, because the `ln' binary might depend on
 
6061
            # the symlink we replace!  Solaris /bin/ln does not understand -f,
 
6062
            # so we also need to try rm && ln -s.
5531
6063
            for linkname
5532
6064
            do
5533
6065
              if test "$linkname" != "$realname"; then
5534
 
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5535
 
                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
 
6066
                $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
 
6067
                $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
5536
6068
              fi
5537
6069
            done
5538
6070
          fi
5545
6077
            IFS="$save_ifs"
5546
6078
            eval cmd=\"$cmd\"
5547
6079
            $show "$cmd"
5548
 
            $run eval "$cmd" || exit $?
 
6080
            $run eval "$cmd" || {
 
6081
              lt_exit=$?
 
6082
 
 
6083
              # Restore the uninstalled library and exit
 
6084
              if test "$mode" = relink; then
 
6085
                $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
 
6086
              fi
 
6087
 
 
6088
              exit $lt_exit
 
6089
            }
5549
6090
          done
5550
6091
          IFS="$save_ifs"
5551
6092
        fi
5639
6180
          notinst_deplibs=
5640
6181
          relink_command=
5641
6182
 
5642
 
          # To insure that "foo" is sourced, and not "foo.exe",
5643
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5644
 
          # which disallows the automatic-append-.exe behavior.
5645
 
          case $build in
5646
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5647
 
          *) wrapperdot=${wrapper} ;;
5648
 
          esac
 
6183
          # Note that it is not necessary on cygwin/mingw to append a dot to
 
6184
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
 
6185
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
 
6186
          # `FILE.' does not work on cygwin managed mounts.
 
6187
          #
5649
6188
          # If there is no directory component, then add one.
5650
 
          case $file in
5651
 
          */* | *\\*) . ${wrapperdot} ;;
5652
 
          *) . ./${wrapperdot} ;;
 
6189
          case $wrapper in
 
6190
          */* | *\\*) . ${wrapper} ;;
 
6191
          *) . ./${wrapper} ;;
5653
6192
          esac
5654
6193
 
5655
6194
          # Check the variables that should have been set.
5677
6216
          done
5678
6217
 
5679
6218
          relink_command=
5680
 
          # To insure that "foo" is sourced, and not "foo.exe",
5681
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5682
 
          # which disallows the automatic-append-.exe behavior.
5683
 
          case $build in
5684
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5685
 
          *) wrapperdot=${wrapper} ;;
5686
 
          esac
 
6219
          # Note that it is not necessary on cygwin/mingw to append a dot to
 
6220
          # foo even if both foo and FILE.exe exist: automatic-append-.exe
 
6221
          # behavior happens only for exec(3), not for open(2)!  Also, sourcing
 
6222
          # `FILE.' does not work on cygwin managed mounts.
 
6223
          #
5687
6224
          # If there is no directory component, then add one.
5688
 
          case $file in
5689
 
          */* | *\\*) . ${wrapperdot} ;;
5690
 
          *) . ./${wrapperdot} ;;
 
6225
          case $wrapper in
 
6226
          */* | *\\*) . ${wrapper} ;;
 
6227
          *) . ./${wrapper} ;;
5691
6228
          esac
5692
6229
 
5693
6230
          outputname=
5694
6231
          if test "$fast_install" = no && test -n "$relink_command"; then
5695
6232
            if test "$finalize" = yes && test -z "$run"; then
5696
 
              tmpdir="/tmp"
5697
 
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
5698
 
              tmpdir="$tmpdir/libtool-$$"
5699
 
              save_umask=`umask`
5700
 
              umask 0077
5701
 
              if $mkdir "$tmpdir"; then
5702
 
                umask $save_umask
5703
 
              else
5704
 
                umask $save_umask
5705
 
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5706
 
                continue
5707
 
              fi
 
6233
              tmpdir=`func_mktempdir`
5708
6234
              file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5709
6235
              outputname="$tmpdir/$file"
5710
6236
              # Replace the output file specification.
5711
 
              relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
 
6237
              relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
5712
6238
 
5713
6239
              $show "$relink_command"
5714
6240
              if $run eval "$relink_command"; then :
5728
6254
        fi
5729
6255
 
5730
6256
        # remove .exe since cygwin /usr/bin/install will append another
5731
 
        # one anyways
 
6257
        # one anyway 
5732
6258
        case $install_prog,$host in
5733
6259
        */usr/bin/install*,*cygwin*)
5734
6260
          case $file:$destfile in
5828
6354
    # Exit here if they wanted silent mode.
5829
6355
    test "$show" = : && exit $EXIT_SUCCESS
5830
6356
 
5831
 
    $echo "----------------------------------------------------------------------"
 
6357
    $echo "X----------------------------------------------------------------------" | $Xsed
5832
6358
    $echo "Libraries have been installed in:"
5833
6359
    for libdir in $libdirs; do
5834
6360
      $echo "   $libdir"
5861
6387
    $echo
5862
6388
    $echo "See any operating system documentation about shared libraries for"
5863
6389
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5864
 
    $echo "----------------------------------------------------------------------"
 
6390
    $echo "X----------------------------------------------------------------------" | $Xsed
5865
6391
    exit $EXIT_SUCCESS
5866
6392
    ;;
5867
6393
 
5919
6445
        if test -f "$dir/$objdir/$dlname"; then
5920
6446
          dir="$dir/$objdir"
5921
6447
        else
5922
 
          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5923
 
          exit $EXIT_FAILURE
 
6448
          if test ! -f "$dir/$dlname"; then
 
6449
            $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
 
6450
            exit $EXIT_FAILURE
 
6451
          fi
5924
6452
        fi
5925
6453
        ;;
5926
6454
 
5984
6512
      fi
5985
6513
 
5986
6514
      # Restore saved environment variables
5987
 
      if test "${save_LC_ALL+set}" = set; then
5988
 
        LC_ALL="$save_LC_ALL"; export LC_ALL
5989
 
      fi
5990
 
      if test "${save_LANG+set}" = set; then
5991
 
        LANG="$save_LANG"; export LANG
5992
 
      fi
 
6515
      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
 
6516
      do
 
6517
        eval "if test \"\${save_$lt_var+set}\" = set; then
 
6518
                $lt_var=\$save_$lt_var; export $lt_var
 
6519
              fi"
 
6520
      done
5993
6521
 
5994
6522
      # Now prepare to actually exec the command.
5995
6523
      exec_cmd="\$cmd$args"
6078
6606
            rmfiles="$rmfiles $objdir/$n"
6079
6607
          done
6080
6608
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6081
 
          test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6082
6609
 
6083
 
          if test "$mode" = uninstall; then
 
6610
          case "$mode" in
 
6611
          clean)
 
6612
            case "  $library_names " in
 
6613
            # "  " in the beginning catches empty $dlname
 
6614
            *" $dlname "*) ;;
 
6615
            *) rmfiles="$rmfiles $objdir/$dlname" ;;
 
6616
            esac
 
6617
             test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
6618
            ;;
 
6619
          uninstall)
6084
6620
            if test -n "$library_names"; then
6085
6621
              # Do each command in the postuninstall commands.
6086
6622
              cmds=$postuninstall_cmds
6113
6649
              IFS="$save_ifs"
6114
6650
            fi
6115
6651
            # FIXME: should reinstall the best remaining shared library.
6116
 
          fi
 
6652
            ;;
 
6653
          esac
6117
6654
        fi
6118
6655
        ;;
6119
6656
 
6337
6874
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
6338
6875
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6339
6876
  -export-symbols SYMFILE
6340
 
                    try to export only the symbols listed in SYMFILE
 
6877
                    try to export only the symbols listed in SYMFILE
6341
6878
  -export-symbols-regex REGEX
6342
 
                    try to export only the symbols matching REGEX
 
6879
                    try to export only the symbols matching REGEX
6343
6880
  -LLIBDIR          search LIBDIR for required installed libraries
6344
6881
  -lNAME            OUTPUT-FILE requires the installed library libNAME
6345
6882
  -module           build a library that can dlopened
6353
6890
  -release RELEASE  specify package release information
6354
6891
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
6355
6892
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
6356
 
  -static           do not do any dynamic linking of libtool libraries
 
6893
  -static           do not do any dynamic linking of uninstalled libtool libraries
 
6894
  -static-libtool-libs
 
6895
                    do not do any dynamic linking of libtool libraries
6357
6896
  -version-info CURRENT[:REVISION[:AGE]]
6358
 
                    specify library version info [each variable defaults to 0]
 
6897
                    specify library version info [each variable defaults to 0]
6359
6898
 
6360
6899
All other options (arguments beginning with \`-') are ignored.
6361
6900
 
6398
6937
$echo
6399
6938
$echo "Try \`$modename --help' for more information about other modes."
6400
6939
 
6401
 
exit $EXIT_SUCCESS
 
6940
exit $?
6402
6941
 
6403
6942
# The TAGs below are defined such that we never get into a situation
6404
6943
# in which we disable both kinds of libraries.  Given conflicting
6412
6951
# configuration.  But we'll never go from static-only to shared-only.
6413
6952
 
6414
6953
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6415
 
build_libtool_libs=no
6416
 
build_old_libs=yes
 
6954
disable_libs=shared
6417
6955
# ### END LIBTOOL TAG CONFIG: disable-shared
6418
6956
 
6419
6957
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6420
 
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
 
6958
disable_libs=static
6421
6959
# ### END LIBTOOL TAG CONFIG: disable-static
6422
6960
 
6423
6961
# Local Variables: