~ubuntu-branches/ubuntu/wily/libxinerama/wily

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau, Julien Cristau, Andres Salomon
  • Date: 2008-05-18 22:02:34 UTC
  • mfrom: (0.1.8 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080518220234-whnvgas3jlrwaazp
Tags: 2:1.0.3-2
[ Julien Cristau ]
* libxinerama1{,-dbg} don't need to depend on x11-common.
* libxinerama-dev doesn't install any header, remove usr/include/X11/ from
  libxinerama-dev.install.

[ Andres Salomon ]
* Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build;
  idempotency fix.
* Version x11-common pre-dep in -dev package to 1:7.0.0 to match
  the rest of Debian.
* Bump debhelper compat to 5.
* Fix dh_strip call to skip the -dbg package.

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
33
33
# function.
34
34
progpath="$0"
35
35
 
36
 
# RH: define SED for historic ltconfig's generated by Libtool 1.3
37
 
[ -z "$SED" ] && SED=sed
38
 
 
39
36
# The name of this program:
40
37
progname=`echo "$progpath" | $SED $basename`
41
38
modename="$progname"
46
43
 
47
44
PROGRAM=ltmain.sh
48
45
PACKAGE=libtool
49
 
VERSION=1.5.6
50
 
TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
 
46
VERSION="1.5.26 Debian 1.5.26-1"
 
47
TIMESTAMP=" (1.1220.2.493 2008/02/01 16:58:18)"
51
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
52
62
 
53
63
# Check that we have a working $echo.
54
64
if test "X$1" = X--no-reexec; then
86
96
Xsed="${SED}"' -e 1s/^X//'
87
97
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
88
98
# test EBCDIC or ASCII
89
 
case `echo A|tr A '\301'` in
90
 
 A) # EBCDIC based system
91
 
  SP2NL="tr '\100' '\n'"
92
 
  NL2SP="tr '\r\n' '\100\100'"
 
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'
93
104
  ;;
94
 
 *) # Assume ASCII based system
95
 
  SP2NL="tr '\040' '\012'"
96
 
  NL2SP="tr '\015\012' '\040\040'"
 
105
 *) # EBCDIC based system
 
106
  SP2NL='tr \100 \n'
 
107
  NL2SP='tr \r\n \100\100'
97
108
  ;;
98
109
esac
99
110
 
102
113
# These must not be set unconditionally because not all systems understand
103
114
# e.g. LANG=C (notably SCO).
104
115
# We save the old values to restore during execute mode.
105
 
if test "${LC_ALL+set}" = set; then
106
 
  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
107
 
fi
108
 
if test "${LANG+set}" = set; then
109
 
  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"
110
129
fi
111
130
 
112
131
# Make sure IFS has a sensible default
113
 
: ${IFS="       
114
 
"}
 
132
lt_nl='
 
133
'
 
134
IFS="   $lt_nl"
115
135
 
116
136
if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
117
137
  $echo "$modename: not configured to build any kind of library" 1>&2
128
148
show="$echo"
129
149
show_help=
130
150
execute_dlfiles=
 
151
duplicate_deps=no
 
152
preserve_args=
131
153
lo2o="s/\\.lo\$/.${objext}/"
132
154
o2lo="s/\\.${objext}\$/.lo/"
 
155
extracted_archives=
 
156
extracted_serial=0
133
157
 
134
158
#####################################
135
159
# Shell function definitions:
136
160
# This seems to be the best place for them
137
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
 
138
199
# func_win32_libid arg
139
200
# return the library type of file 'arg'
140
201
#
141
202
# Need a lot of goo to handle *both* DLLs and import libs
142
203
# Has to be a shell function in order to 'eat' the argument
143
204
# that is supplied when $file_magic_command is called.
144
 
func_win32_libid () {
 
205
func_win32_libid ()
 
206
{
145
207
  win32_libid_type="unknown"
146
208
  win32_fileres=`file -L $1 2>/dev/null`
147
209
  case $win32_fileres in
152
214
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
153
215
      $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
154
216
      win32_nmres=`eval $NM -f posix -A $1 | \
155
 
        sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
156
 
      if test "X$win32_nmres" = "Ximport" ; then
157
 
        win32_libid_type="x86 archive import"
158
 
      else
159
 
        win32_libid_type="x86 archive static"
160
 
      fi
 
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
161
228
    fi
162
229
    ;;
163
230
  *DLL*)
181
248
# Only attempt this if the compiler in the base compile
182
249
# command doesn't match the default compiler.
183
250
# arg is usually of the form 'gcc ...'
184
 
func_infer_tag () {
 
251
func_infer_tag ()
 
252
{
185
253
    if test -n "$available_tags" && test -z "$tagname"; then
186
254
      CC_quoted=
187
255
      for arg in $CC; do
238
306
      esac
239
307
    fi
240
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
}
241
421
# End of Shell function definitions
242
422
#####################################
243
423
 
244
424
# Darwin sucks
245
425
eval std_shrext=\"$shrext_cmds\"
246
426
 
 
427
disable_libs=no
 
428
 
247
429
# Parse our command line options once, thoroughly.
248
430
while test "$#" -gt 0
249
431
do
306
488
    ;;
307
489
 
308
490
  --version)
309
 
    $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
310
 
    $echo
311
 
    $echo "Copyright (C) 2003  Free Software Foundation, Inc."
312
 
    $echo "This is free software; see the source for copying conditions.  There is NO"
313
 
    $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
314
 
    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 $?
315
498
    ;;
316
499
 
317
500
  --config)
320
503
    for tagname in $taglist; do
321
504
      ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
322
505
    done
323
 
    exit $EXIT_SUCCESS
 
506
    exit $?
324
507
    ;;
325
508
 
326
509
  --debug)
345
528
    else
346
529
      $echo "disable static libraries"
347
530
    fi
348
 
    exit $EXIT_SUCCESS
 
531
    exit $?
349
532
    ;;
350
533
 
351
534
  --finish) mode="finish" ;;
360
543
    preserve_args="$preserve_args $arg"
361
544
    ;;
362
545
 
363
 
  --tag) prevopt="--tag" prev=tag ;;
 
546
  --tag)
 
547
    prevopt="--tag"
 
548
    prev=tag
 
549
    preserve_args="$preserve_args --tag"
 
550
    ;;
364
551
  --tag=*)
365
552
    set tag "$optarg" ${1+"$@"}
366
553
    shift
392
579
  exit $EXIT_FAILURE
393
580
fi
394
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
 
395
594
# If this variable is set in any of the actions, the command in it
396
595
# will be execed at the end.  This prevents here-documents from being
397
596
# left over by shells.
402
601
  # Infer the operation mode.
403
602
  if test -z "$mode"; then
404
603
    $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
405
 
    $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
 
604
    $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
406
605
    case $nonopt in
407
606
    *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
408
607
      mode=link
468
667
 
469
668
    for arg
470
669
    do
471
 
      case "$arg_mode" in
 
670
      case $arg_mode in
472
671
      arg  )
473
672
        # do not "continue".  Instead, add this to base_compile
474
673
        lastarg="$arg"
550
749
      case $lastarg in
551
750
      # Double-quote args containing other shell metacharacters.
552
751
      # Many Bourne shells cannot handle close brackets correctly
553
 
      # 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.
554
756
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
555
757
        lastarg="\"$lastarg\""
556
758
        ;;
588
790
    *.class) xform=class ;;
589
791
    *.cpp) xform=cpp ;;
590
792
    *.cxx) xform=cxx ;;
591
 
    *.f90) xform=f90 ;;
 
793
    *.[fF][09]?) xform=[fF][09]. ;;
592
794
    *.for) xform=for ;;
593
795
    *.java) xform=java ;;
 
796
    *.obj) xform=obj ;;
 
797
    *.sx) xform=sx ;;
594
798
    esac
595
799
 
596
800
    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
624
828
      esac
625
829
    done
626
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."
627
839
    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
628
840
    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
629
841
    if test "X$xdir" = "X$obj"; then
696
908
        $run $rm $removelist
697
909
        exit $EXIT_FAILURE
698
910
      fi
699
 
      $echo $srcfile > "$lockfile"
 
911
      $echo "$srcfile" > "$lockfile"
700
912
    fi
701
913
 
702
914
    if test -n "$fix_srcfile_path"; then
703
915
      eval srcfile=\"$fix_srcfile_path\"
704
916
    fi
 
917
    qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
 
918
    case $qsrcfile in
 
919
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
 
920
      qsrcfile="\"$qsrcfile\"" ;;
 
921
    esac
705
922
 
706
923
    $run $rm "$libobj" "${libobj}T"
707
924
 
723
940
      fbsd_hideous_sh_bug=$base_compile
724
941
 
725
942
      if test "$pic_mode" != no; then
726
 
        command="$base_compile $srcfile $pic_flag"
 
943
        command="$base_compile $qsrcfile $pic_flag"
727
944
      else
728
945
        # Don't build PIC code
729
 
        command="$base_compile $srcfile"
 
946
        command="$base_compile $qsrcfile"
730
947
      fi
731
948
 
732
949
      if test ! -d "${xdir}$objdir"; then
733
950
        $show "$mkdir ${xdir}$objdir"
734
951
        $run $mkdir ${xdir}$objdir
735
 
        status=$?
736
 
        if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
737
 
          exit $status
 
952
        exit_status=$?
 
953
        if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
 
954
          exit $exit_status
738
955
        fi
739
956
      fi
740
957
 
746
963
      $run $rm "$lobj" "$output_obj"
747
964
 
748
965
      $show "$command"
749
 
      if $run eval "$command"; then :
 
966
      if $run eval $lt_env "$command"; then :
750
967
      else
751
968
        test -n "$output_obj" && $run $rm $removelist
752
969
        exit $EXIT_FAILURE
806
1023
    if test "$build_old_libs" = yes; then
807
1024
      if test "$pic_mode" != yes; then
808
1025
        # Don't build PIC code
809
 
        command="$base_compile $srcfile"
 
1026
        command="$base_compile $qsrcfile"
810
1027
      else
811
 
        command="$base_compile $srcfile $pic_flag"
 
1028
        command="$base_compile $qsrcfile $pic_flag"
812
1029
      fi
813
1030
      if test "$compiler_c_o" = yes; then
814
1031
        command="$command -o $obj"
818
1035
      command="$command$suppress_output"
819
1036
      $run $rm "$obj" "$output_obj"
820
1037
      $show "$command"
821
 
      if $run eval "$command"; then :
 
1038
      if $run eval $lt_env "$command"; then :
822
1039
      else
823
1040
        $run $rm $removelist
824
1041
        exit $EXIT_FAILURE
937
1154
    no_install=no
938
1155
    objs=
939
1156
    non_pic_objects=
 
1157
    notinst_path= # paths that contain not-installed libtool libraries
940
1158
    precious_files_regex=
941
1159
    prefer_static_libs=no
942
1160
    preload=no
950
1168
    thread_safe=no
951
1169
    vinfo=
952
1170
    vinfo_number=no
 
1171
    single_module="${wl}-single_module"
953
1172
 
954
1173
    func_infer_tag $base_compile
955
1174
 
957
1176
    for arg
958
1177
    do
959
1178
      case $arg in
960
 
      -all-static | -static)
961
 
        if test "X$arg" = "X-all-static"; then
 
1179
      -all-static | -static | -static-libtool-libs)
 
1180
        case $arg in
 
1181
        -all-static)
962
1182
          if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
963
1183
            $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
964
1184
          fi
965
1185
          if test -n "$link_static_flag"; then
966
1186
            dlopen_self=$dlopen_self_static
967
1187
          fi
968
 
        else
969
 
          if test -z "$pic_flag" && test -n "$link_static_flag"; then
970
 
            dlopen_self=$dlopen_self_static
971
 
          fi
972
 
        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
973
1203
        build_libtool_libs=no
974
1204
        build_old_libs=yes
975
 
        prefer_static_libs=yes
976
1205
        break
977
1206
        ;;
978
1207
      esac
1147
1376
                  if test -z "$pic_object" || test "$pic_object" = none ; then
1148
1377
                    arg="$non_pic_object"
1149
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"
1150
1384
                fi
1151
1385
              else
1152
1386
                # Only an error if not doing a dry-run.
1230
1464
          prev=
1231
1465
          continue
1232
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
          ;;
1233
1474
        *)
1234
1475
          eval "$prev=\"\$arg\""
1235
1476
          prev=
1288
1529
        continue
1289
1530
        ;;
1290
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
 
1291
1544
      -inst-prefix-dir)
1292
1545
        prev=inst_prefix
1293
1546
        continue
1314
1567
          absdir=`cd "$dir" && pwd`
1315
1568
          if test -z "$absdir"; then
1316
1569
            $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
1317
 
            exit $EXIT_FAILURE
 
1570
            absdir="$dir"
 
1571
            notinst_path="$notinst_path $dir"
1318
1572
          fi
1319
1573
          dir="$absdir"
1320
1574
          ;;
1328
1582
        esac
1329
1583
        case $host in
1330
1584
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
1585
          testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
1331
1586
          case :$dllsearchpath: in
1332
1587
          *":$dir:"*) ;;
1333
1588
          *) dllsearchpath="$dllsearchpath:$dir";;
1334
1589
          esac
 
1590
          case :$dllsearchpath: in
 
1591
          *":$testbindir:"*) ;;
 
1592
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
1593
          esac
1335
1594
          ;;
1336
1595
        esac
1337
1596
        continue
1340
1599
      -l*)
1341
1600
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
1342
1601
          case $host in
1343
 
          *-*-cygwin* | *-*-pw32* | *-*-beos*)
 
1602
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
1344
1603
            # These systems don't actually have a C or math library (as such)
1345
1604
            continue
1346
1605
            ;;
1347
 
          *-*-mingw* | *-*-os2*)
 
1606
          *-*-os2*)
1348
1607
            # These systems don't actually have a C library (as such)
1349
1608
            test "X$arg" = "X-lc" && continue
1350
1609
            ;;
1351
 
          *-*-openbsd* | *-*-freebsd*)
 
1610
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1352
1611
            # Do not include libc due to us having libc/libc_r.
1353
1612
            test "X$arg" = "X-lc" && continue
1354
1613
            ;;
1356
1615
            # Rhapsody C and math libraries are in the System framework
1357
1616
            deplibs="$deplibs -framework System"
1358
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
            ;;
1359
1627
          esac
1360
1628
        elif test "X$arg" = "X-lc_r"; then
1361
1629
         case $host in
1362
 
         *-*-openbsd* | *-*-freebsd*)
 
1630
         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
1363
1631
           # Do not include libc_r directly, use -pthread flag.
1364
1632
           continue
1365
1633
           ;;
1369
1637
        continue
1370
1638
        ;;
1371
1639
 
1372
 
     -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
1373
 
        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"
1374
1659
        continue
1375
1660
        ;;
1376
1661
 
1379
1664
        continue
1380
1665
        ;;
1381
1666
 
1382
 
      # gcc -m* arguments should be passed to the linker via $compiler_flags
1383
 
      # in order to pass architecture information to the linker
1384
 
      # (e.g. 32 vs 64-bit).  This may also be accomplished via -Wl,-mfoo
1385
 
      # but this is not reliable with gcc because gcc may use -mfoo to
1386
 
      # select a different linker, different libraries, etc, while
1387
 
      # -Wl,-mfoo simply passes -mfoo to the linker.
1388
 
      -m*)
 
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
 
1389
1681
        # Unknown arguments in both finalize_command and compile_command need
1390
1682
        # to be aesthetically quoted because they are evaled later.
1391
1683
        arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
1396
1688
        esac
1397
1689
        compile_command="$compile_command $arg"
1398
1690
        finalize_command="$finalize_command $arg"
1399
 
        if test "$with_gcc" = "yes" ; then
1400
 
          compiler_flags="$compiler_flags $arg"
1401
 
        fi
 
1691
        compiler_flags="$compiler_flags $arg"
1402
1692
        continue
1403
1693
        ;;
1404
1694
 
1414
1704
 
1415
1705
      -no-install)
1416
1706
        case $host in
1417
 
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
1707
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
1418
1708
          # The PATH hackery in wrapper scripts is required on Windows
1419
 
          # 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.
1420
1710
          $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
1421
1711
          $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
1422
1712
          fast_install=no
1475
1765
        continue
1476
1766
        ;;
1477
1767
 
1478
 
      -static)
 
1768
      -static | -static-libtool-libs)
1479
1769
        # The effects of -static are defined in a previous loop.
1480
1770
        # We used to do the same as -all-static on platforms that
1481
1771
        # didn't have a PIC flag, but the assumption that the effects
1636
1926
            if test -z "$pic_object" || test "$pic_object" = none ; then
1637
1927
              arg="$non_pic_object"
1638
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"
1639
1934
          fi
1640
1935
        else
1641
1936
          # Only an error if not doing a dry-run.
1741
2036
    if test ! -d "$output_objdir"; then
1742
2037
      $show "$mkdir $output_objdir"
1743
2038
      $run $mkdir $output_objdir
1744
 
      status=$?
1745
 
      if test "$status" -ne 0 && test ! -d "$output_objdir"; then
1746
 
        exit $status
 
2039
      exit_status=$?
 
2040
      if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
 
2041
        exit $exit_status
1747
2042
      fi
1748
2043
    fi
1749
2044
 
1806
2101
    newlib_search_path=
1807
2102
    need_relink=no # whether we're linking any uninstalled libtool libraries
1808
2103
    notinst_deplibs= # not-installed libtool libraries
1809
 
    notinst_path= # paths that contain not-installed libtool libraries
1810
2104
    case $linkmode in
1811
2105
    lib)
1812
2106
        passes="conv link"
1841
2135
        case $pass in
1842
2136
        dlopen) libs="$dlfiles" ;;
1843
2137
        dlpreopen) libs="$dlprefiles" ;;
1844
 
        link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
 
2138
        link)
 
2139
          libs="$deplibs %DEPLIBS%"
 
2140
          test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
 
2141
          ;;
1845
2142
        esac
1846
2143
      fi
1847
2144
      if test "$pass" = dlopen; then
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
          ;;
1867
2164
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
1868
2165
            continue
1869
2166
          fi
1870
 
          if test "$pass" = conv; then
1871
 
            deplibs="$deplib $deplibs"
1872
 
            continue
1873
 
          fi
1874
2167
          name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
1875
 
          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
1876
2174
            for search_ext in .la $std_shrext .so .a; do
1877
2175
              # Search the libtool library
1878
2176
              lib="$searchdir/lib${name}${search_ext}"
1981
2279
          fi
1982
2280
          case $linkmode in
1983
2281
          lib)
1984
 
            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
1985
2298
              $echo
1986
2299
              $echo "*** Warning: Trying to link with static lib archive $deplib."
1987
2300
              $echo "*** I have the capability to make that library automatically link in when"
2031
2344
        esac # case $deplib
2032
2345
        if test "$found" = yes || test -f "$lib"; then :
2033
2346
        else
2034
 
          $echo "$modename: cannot find the library \`$lib'" 1>&2
 
2347
          $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
2035
2348
          exit $EXIT_FAILURE
2036
2349
        fi
2037
2350
 
2055
2368
        # it will not redefine variables installed, or shouldnotlink
2056
2369
        installed=yes
2057
2370
        shouldnotlink=no
 
2371
        avoidtemprpath=
 
2372
 
2058
2373
 
2059
2374
        # Read the .la file
2060
2375
        case $lib in
2153
2468
            dir="$libdir"
2154
2469
            absdir="$libdir"
2155
2470
          fi
 
2471
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
2156
2472
        else
2157
 
          dir="$ladir/$objdir"
2158
 
          absdir="$abs_ladir/$objdir"
2159
 
          # Remove this search path later
2160
 
          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
2161
2484
        fi # $installed = yes
2162
2485
        name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
2163
2486
 
2228
2551
 
2229
2552
        if test "$linkmode,$pass" = "prog,link"; then
2230
2553
          if test -n "$library_names" &&
2231
 
             { 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
2232
2557
            # We need to hardcode the library path
2233
 
            if test -n "$shlibpath_var"; then
 
2558
            if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
2234
2559
              # Make sure the rpath contains only unique directories.
2235
2560
              case "$temp_rpath " in
2236
2561
              *" $dir "*) ;;
2237
2562
              *" $absdir "*) ;;
2238
 
              *) temp_rpath="$temp_rpath $dir" ;;
 
2563
              *) temp_rpath="$temp_rpath $absdir" ;;
2239
2564
              esac
2240
2565
            fi
2241
2566
 
2272
2597
        fi
2273
2598
 
2274
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
2275
2604
        if test -n "$library_names" &&
2276
 
           { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
 
2605
           { test "$use_static_libs" = no || test -z "$old_library"; }; then
2277
2606
          if test "$installed" = no; then
2278
2607
            notinst_deplibs="$notinst_deplibs $lib"
2279
2608
            need_relink=yes
2386
2715
              if test "$hardcode_direct" = no; then
2387
2716
                add="$dir/$linklib"
2388
2717
                case $host in
2389
 
                  *-*-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" ;;
2390
2722
                  *-*-darwin* )
2391
2723
                    # if the lib is a module then we can not link against
2392
2724
                    # it, someone is ignoring the new warnings I added
2393
 
                    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
2394
2727
                      $echo "** Warning, lib $linklib is a module, not a shared library"
2395
2728
                      if test -z "$old_library" ; then
2396
2729
                        $echo
2421
2754
                add_dir="-L$dir"
2422
2755
                # Try looking first in the location we're being installed to.
2423
2756
                if test -n "$inst_prefix_dir"; then
2424
 
                  case "$libdir" in
 
2757
                  case $libdir in
2425
2758
                    [\\/]*)
2426
2759
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
2427
2760
                      ;;
2494
2827
              add_dir="-L$libdir"
2495
2828
              # Try looking first in the location we're being installed to.
2496
2829
              if test -n "$inst_prefix_dir"; then
2497
 
                case "$libdir" in
 
2830
                case $libdir in
2498
2831
                  [\\/]*)
2499
2832
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
2500
2833
                    ;;
2555
2888
              fi
2556
2889
            fi
2557
2890
          else
2558
 
            convenience="$convenience $dir/$old_library"
2559
 
            old_convenience="$old_convenience $dir/$old_library"
2560
2891
            deplibs="$dir/$old_library $deplibs"
2561
2892
            link_static=yes
2562
2893
          fi
2635
2966
                  # we do not want to link against static libs,
2636
2967
                  # but need to link against shared
2637
2968
                  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
 
2969
                  eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
2638
2970
                  if test -n "$deplibrary_names" ; then
2639
2971
                    for tmp in $deplibrary_names ; do
2640
2972
                      depdepl=$tmp
2641
2973
                    done
2642
 
                    if test -f "$path/$depdepl" ; then
 
2974
                    if test -f "$deplibdir/$depdepl" ; then
 
2975
                      depdepl="$deplibdir/$depdepl"
 
2976
                    elif test -f "$path/$depdepl" ; then
2643
2977
                      depdepl="$path/$depdepl"
 
2978
                    else
 
2979
                      # Can't find it, oh well...
 
2980
                      depdepl=
2644
2981
                    fi
2645
2982
                    # do not add paths which are already there
2646
2983
                    case " $newlib_search_path " in
2674
3011
              *) continue ;;
2675
3012
              esac
2676
3013
              case " $deplibs " in
 
3014
              *" $path "*) ;;
 
3015
              *) deplibs="$path $deplibs" ;;
 
3016
              esac
 
3017
              case " $deplibs " in
2677
3018
              *" $depdepl "*) ;;
2678
3019
              *) deplibs="$depdepl $deplibs" ;;
2679
3020
              esac
2680
 
              case " $deplibs " in
2681
 
              *" $path "*) ;;
2682
 
              *) deplibs="$deplibs $path" ;;
2683
 
              esac
2684
3021
            done
2685
3022
          fi # link_all_deplibs != no
2686
3023
        fi # linkmode = lib
2788
3125
 
2789
3126
    case $linkmode in
2790
3127
    oldlib)
2791
 
      if test -n "$deplibs"; then
2792
 
        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
2793
 
      fi
 
3128
      case " $deplibs" in
 
3129
      *\ -l* | *\ -L*)
 
3130
        $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
 
3131
      esac
2794
3132
 
2795
3133
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2796
3134
        $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
2918
3256
          # which has an extra 1 added just for fun
2919
3257
          #
2920
3258
          case $version_type in
2921
 
          darwin|linux|osf|windows)
 
3259
          darwin|linux|osf|windows|none)
2922
3260
            current=`expr $number_major + $number_minor`
2923
3261
            age="$number_minor"
2924
3262
            revision="$number_revision"
2929
3267
            age="0"
2930
3268
            ;;
2931
3269
          irix|nonstopux)
2932
 
            current=`expr $number_major + $number_minor - 1`
 
3270
            current=`expr $number_major + $number_minor`
2933
3271
            age="$number_minor"
2934
3272
            revision="$number_minor"
 
3273
            lt_irix_increment=no
 
3274
            ;;
 
3275
          *)
 
3276
            $echo "$modename: unknown library version type \`$version_type'" 1>&2
 
3277
            $echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
 
3278
            exit $EXIT_FAILURE
2935
3279
            ;;
2936
3280
          esac
2937
3281
          ;;
2944
3288
 
2945
3289
        # Check that each of the things are valid numbers.
2946
3290
        case $current in
2947
 
        [0-9]*) ;;
 
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]) ;;
2948
3292
        *)
2949
 
          $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
 
3293
          $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
2950
3294
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2951
3295
          exit $EXIT_FAILURE
2952
3296
          ;;
2953
3297
        esac
2954
3298
 
2955
3299
        case $revision in
2956
 
        [0-9]*) ;;
 
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]) ;;
2957
3301
        *)
2958
 
          $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
 
3302
          $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
2959
3303
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2960
3304
          exit $EXIT_FAILURE
2961
3305
          ;;
2962
3306
        esac
2963
3307
 
2964
3308
        case $age in
2965
 
        [0-9]*) ;;
 
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]) ;;
2966
3310
        *)
2967
 
          $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
 
3311
          $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
2968
3312
          $echo "$modename: \`$vinfo' is not valid version information" 1>&2
2969
3313
          exit $EXIT_FAILURE
2970
3314
          ;;
2990
3334
          versuffix="$major.$age.$revision"
2991
3335
          # Darwin ld doesn't like 0 for these options...
2992
3336
          minor_current=`expr $current + 1`
 
3337
          xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
2993
3338
          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
2994
3339
          ;;
2995
3340
 
3004
3349
          ;;
3005
3350
 
3006
3351
        irix | nonstopux)
3007
 
          major=`expr $current - $age + 1`
3008
 
 
 
3352
          if test "X$lt_irix_increment" = "Xno"; then
 
3353
            major=`expr $current - $age`
 
3354
          else
 
3355
            major=`expr $current - $age + 1`
 
3356
          fi
3009
3357
          case $version_type in
3010
3358
            nonstopux) verstring_prefix=nonstopux ;;
3011
3359
            *)         verstring_prefix=sgi ;;
3142
3490
      fi
3143
3491
 
3144
3492
      # Eliminate all temporary directories.
3145
 
      for path in $notinst_path; do
3146
 
        lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
3147
 
        deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
3148
 
        dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
3149
 
      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
3150
3498
 
3151
3499
      if test -n "$xrpath"; then
3152
3500
        # If the user specified any rpath flags, then add them.
3196
3544
          *-*-netbsd*)
3197
3545
            # Don't link with libc until the a.out ld.so is fixed.
3198
3546
            ;;
3199
 
          *-*-openbsd* | *-*-freebsd*)
 
3547
          *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
3200
3548
            # Do not include libc due to us having libc/libc_r.
3201
 
            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
3202
3555
            ;;
3203
3556
          *)
3204
3557
            # Add libc to deplibs on all other systems if necessary.
3242
3595
          int main() { return 0; }
3243
3596
EOF
3244
3597
          $rm conftest
3245
 
          $LTCC -o conftest conftest.c $deplibs
3246
 
          if test "$?" -eq 0 ; then
 
3598
          if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
3247
3599
            ldd_output=`ldd conftest`
3248
3600
            for i in $deplibs; do
3249
 
              name="`expr $i : '-l\(.*\)'`"
 
3601
              name=`expr $i : '-l\(.*\)'`
3250
3602
              # If $name is empty we are operating on a -L argument.
3251
 
              if test "$name" != "" && test "$name" -ne "0"; then
 
3603
              if test "$name" != "" && test "$name" != "0"; then
3252
3604
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3253
3605
                  case " $predeps $postdeps " in
3254
3606
                  *" $i "*)
3283
3635
            # Error occurred in the first compile.  Let's try to salvage
3284
3636
            # the situation: Compile a separate program for each library.
3285
3637
            for i in $deplibs; do
3286
 
              name="`expr $i : '-l\(.*\)'`"
 
3638
              name=`expr $i : '-l\(.*\)'`
3287
3639
              # If $name is empty we are operating on a -L argument.
3288
3640
              if test "$name" != "" && test "$name" != "0"; then
3289
3641
                $rm conftest
3290
 
                $LTCC -o conftest conftest.c $i
3291
 
                # Did it work?
3292
 
                if test "$?" -eq 0 ; then
 
3642
                if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
3293
3643
                  ldd_output=`ldd conftest`
3294
3644
                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3295
3645
                    case " $predeps $postdeps " in
3321
3671
                  droppeddeps=yes
3322
3672
                  $echo
3323
3673
                  $echo "*** Warning!  Library $i is needed by this library but I was not able to"
3324
 
                  $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"
3325
3675
                  $echo "*** library that it depends on before this library will be fully"
3326
3676
                  $echo "*** functional.  Installing it before continuing would be even better."
3327
3677
                fi
3335
3685
          set dummy $deplibs_check_method
3336
3686
          file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3337
3687
          for a_deplib in $deplibs; do
3338
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3688
            name=`expr $a_deplib : '-l\(.*\)'`
3339
3689
            # If $name is empty we are operating on a -L argument.
3340
3690
            if test "$name" != "" && test  "$name" != "0"; then
3341
3691
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3404
3754
          set dummy $deplibs_check_method
3405
3755
          match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
3406
3756
          for a_deplib in $deplibs; do
3407
 
            name="`expr $a_deplib : '-l\(.*\)'`"
 
3757
            name=`expr $a_deplib : '-l\(.*\)'`
3408
3758
            # If $name is empty we are operating on a -L argument.
3409
3759
            if test -n "$name" && test "$name" != "0"; then
3410
3760
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
3534
3884
        deplibs=$newdeplibs
3535
3885
      fi
3536
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
 
3537
3916
      # All the library-specific variables (install_libdir is set above).
3538
3917
      library_names=
3539
3918
      old_library=
3578
3957
             test -n "$hardcode_libdirs"; then
3579
3958
            libdir="$hardcode_libdirs"
3580
3959
            if test -n "$hardcode_libdir_flag_spec_ld"; then
3581
 
              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
3582
3964
            else
3583
3965
              eval dep_rpath=\"$hardcode_libdir_flag_spec\"
3584
3966
            fi
3617
3999
        fi
3618
4000
 
3619
4001
        lib="$output_objdir/$realname"
 
4002
        linknames=
3620
4003
        for link
3621
4004
        do
3622
4005
          linknames="$linknames $link"
3645
4028
                # The command line is too long to execute in one step.
3646
4029
                $show "using reloadable object file for export list..."
3647
4030
                skipped_export=:
 
4031
                # Break out early, otherwise skipped_export may be
 
4032
                # set to false by a later but shorter cmd.
 
4033
                break
3648
4034
              fi
3649
4035
            done
3650
4036
            IFS="$save_ifs"
3678
4064
            eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
3679
4065
          else
3680
4066
            gentop="$output_objdir/${outputname}x"
3681
 
            $show "${rm}r $gentop"
3682
 
            $run ${rm}r "$gentop"
3683
 
            $show "$mkdir $gentop"
3684
 
            $run $mkdir "$gentop"
3685
 
            status=$?
3686
 
            if test "$status" -ne 0 && test ! -d "$gentop"; then
3687
 
              exit $status
3688
 
            fi
3689
4067
            generated="$generated $gentop"
3690
4068
 
3691
 
            for xlib in $convenience; do
3692
 
              # Extract the objects.
3693
 
              case $xlib in
3694
 
              [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3695
 
              *) xabs=`pwd`"/$xlib" ;;
3696
 
              esac
3697
 
              xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3698
 
              xdir="$gentop/$xlib"
3699
 
 
3700
 
              $show "${rm}r $xdir"
3701
 
              $run ${rm}r "$xdir"
3702
 
              $show "$mkdir $xdir"
3703
 
              $run $mkdir "$xdir"
3704
 
              status=$?
3705
 
              if test "$status" -ne 0 && test ! -d "$xdir"; then
3706
 
                exit $status
3707
 
              fi
3708
 
              # We will extract separately just the conflicting names and we will no
3709
 
              # longer touch any unique names. It is faster to leave these extract
3710
 
              # automatically by $AR in one run.
3711
 
              $show "(cd $xdir && $AR x $xabs)"
3712
 
              $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
3713
 
              if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
3714
 
                :
3715
 
              else
3716
 
                $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
3717
 
                $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
3718
 
                $AR t "$xabs" | sort | uniq -cd | while read -r count name
3719
 
                do
3720
 
                  i=1
3721
 
                  while test "$i" -le "$count"
3722
 
                  do
3723
 
                   # Put our $i before any first dot (extension)
3724
 
                   # Never overwrite any file
3725
 
                   name_to="$name"
3726
 
                   while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
3727
 
                   do
3728
 
                     name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
3729
 
                   done
3730
 
                   $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
3731
 
                   $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
3732
 
                   i=`expr $i + 1`
3733
 
                  done
3734
 
                done
3735
 
              fi
3736
 
 
3737
 
              libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
3738
 
            done
 
4069
            func_extract_archives $gentop $convenience
 
4070
            libobjs="$libobjs $func_extract_archives_result"
3739
4071
          fi
3740
4072
        fi
3741
 
 
 
4073
        
3742
4074
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
3743
4075
          eval flag=\"$thread_safe_flag_spec\"
3744
4076
          linker_flags="$linker_flags $flag"
3768
4100
          fi
3769
4101
        fi
3770
4102
 
3771
 
        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` &&
3772
4105
           test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
3773
4106
          :
3774
4107
        else
3787
4120
            save_libobjs=$libobjs
3788
4121
          fi
3789
4122
          save_output=$output
 
4123
          output_la=`$echo "X$output" | $Xsed -e "$basename"`
3790
4124
 
3791
4125
          # Clear the reloadable object creation command queue and
3792
4126
          # initialize k to one.
3796
4130
          delfiles=
3797
4131
          last_robj=
3798
4132
          k=1
3799
 
          output=$output_objdir/$save_output-${k}.$objext
 
4133
          output=$output_objdir/$output_la-${k}.$objext
3800
4134
          # Loop over the list of objects to be linked.
3801
4135
          for obj in $save_libobjs
3802
4136
          do
3803
4137
            eval test_cmds=\"$reload_cmds $objlist $last_robj\"
3804
4138
            if test "X$objlist" = X ||
3805
 
               { len=`expr "X$test_cmds" : ".*"` &&
 
4139
               { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
3806
4140
                 test "$len" -le "$max_cmd_len"; }; then
3807
4141
              objlist="$objlist $obj"
3808
4142
            else
3816
4150
                # the last one created.
3817
4151
                eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
3818
4152
              fi
3819
 
              last_robj=$output_objdir/$save_output-${k}.$objext
 
4153
              last_robj=$output_objdir/$output_la-${k}.$objext
3820
4154
              k=`expr $k + 1`
3821
 
              output=$output_objdir/$save_output-${k}.$objext
 
4155
              output=$output_objdir/$output_la-${k}.$objext
3822
4156
              objlist=$obj
3823
4157
              len=1
3824
4158
            fi
3838
4172
            eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
3839
4173
          fi
3840
4174
 
3841
 
          # Set up a command to remove the reloadale object files
 
4175
          # Set up a command to remove the reloadable object files
3842
4176
          # after they are used.
3843
4177
          i=0
3844
4178
          while test "$i" -lt "$k"
3845
4179
          do
3846
4180
            i=`expr $i + 1`
3847
 
            delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
 
4181
            delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
3848
4182
          done
3849
4183
 
3850
4184
          $echo "creating a temporary reloadable object file: $output"
3892
4226
          IFS="$save_ifs"
3893
4227
          eval cmd=\"$cmd\"
3894
4228
          $show "$cmd"
3895
 
          $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
          }
3896
4239
        done
3897
4240
        IFS="$save_ifs"
3898
4241
 
3899
4242
        # Restore the uninstalled library and exit
3900
4243
        if test "$mode" = relink; then
3901
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
 
3902
4253
          exit $EXIT_SUCCESS
3903
4254
        fi
3904
4255
 
3919
4270
      ;;
3920
4271
 
3921
4272
    obj)
3922
 
      if test -n "$deplibs"; then
3923
 
        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
3924
 
      fi
 
4273
      case " $deplibs" in
 
4274
      *\ -l* | *\ -L*)
 
4275
        $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
 
4276
      esac
3925
4277
 
3926
4278
      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3927
4279
        $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
3968
4320
      reload_conv_objs=
3969
4321
      gentop=
3970
4322
      # reload_cmds runs $LD directly, so let us get rid of
3971
 
      # -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..
3972
4325
      wl=
3973
4326
 
3974
4327
      if test -n "$convenience"; then
3975
4328
        if test -n "$whole_archive_flag_spec"; then
3976
 
          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'`
3977
4331
        else
3978
4332
          gentop="$output_objdir/${obj}x"
3979
 
          $show "${rm}r $gentop"
3980
 
          $run ${rm}r "$gentop"
3981
 
          $show "$mkdir $gentop"
3982
 
          $run $mkdir "$gentop"
3983
 
          status=$?
3984
 
          if test "$status" -ne 0 && test ! -d "$gentop"; then
3985
 
            exit $status
3986
 
          fi
3987
4333
          generated="$generated $gentop"
3988
4334
 
3989
 
          for xlib in $convenience; do
3990
 
            # Extract the objects.
3991
 
            case $xlib in
3992
 
            [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
3993
 
            *) xabs=`pwd`"/$xlib" ;;
3994
 
            esac
3995
 
            xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
3996
 
            xdir="$gentop/$xlib"
3997
 
 
3998
 
            $show "${rm}r $xdir"
3999
 
            $run ${rm}r "$xdir"
4000
 
            $show "$mkdir $xdir"
4001
 
            $run $mkdir "$xdir"
4002
 
            status=$?
4003
 
            if test "$status" -ne 0 && test ! -d "$xdir"; then
4004
 
              exit $status
4005
 
            fi
4006
 
            # We will extract separately just the conflicting names and we will no
4007
 
            # longer touch any unique names. It is faster to leave these extract
4008
 
            # automatically by $AR in one run.
4009
 
            $show "(cd $xdir && $AR x $xabs)"
4010
 
            $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
4011
 
            if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
4012
 
              :
4013
 
            else
4014
 
              $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
4015
 
              $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
4016
 
              $AR t "$xabs" | sort | uniq -cd | while read -r count name
4017
 
              do
4018
 
                i=1
4019
 
                while test "$i" -le "$count"
4020
 
                do
4021
 
                 # Put our $i before any first dot (extension)
4022
 
                 # Never overwrite any file
4023
 
                 name_to="$name"
4024
 
                 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
4025
 
                 do
4026
 
                   name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
4027
 
                 done
4028
 
                 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
4029
 
                 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
4030
 
                 i=`expr $i + 1`
4031
 
                done
4032
 
              done
4033
 
            fi
4034
 
 
4035
 
            reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
4036
 
          done
 
4335
          func_extract_archives $gentop $convenience
 
4336
          reload_conv_objs="$reload_objs $func_extract_archives_result"
4037
4337
        fi
4038
4338
      fi
4039
4339
 
4134
4434
        ;;
4135
4435
      esac
4136
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
 
4137
4466
      compile_command="$compile_command $compile_deplibs"
4138
4467
      finalize_command="$finalize_command $finalize_deplibs"
4139
4468
 
4178
4507
        fi
4179
4508
        case $host in
4180
4509
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
 
4510
          testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
4181
4511
          case :$dllsearchpath: in
4182
4512
          *":$libdir:"*) ;;
4183
4513
          *) dllsearchpath="$dllsearchpath:$libdir";;
4184
4514
          esac
 
4515
          case :$dllsearchpath: in
 
4516
          *":$testbindir:"*) ;;
 
4517
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
4518
          esac
4185
4519
          ;;
4186
4520
        esac
4187
4521
      done
4295
4629
 
4296
4630
            # Prepare the list of exported symbols
4297
4631
            if test -z "$export_symbols"; then
4298
 
              export_symbols="$output_objdir/$output.exp"
 
4632
              export_symbols="$output_objdir/$outputname.exp"
4299
4633
              $run $rm $export_symbols
4300
 
              $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
4301
4641
            else
4302
 
              $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
4303
 
              $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
 
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'
4304
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
4305
4651
            fi
4306
4652
          fi
4307
4653
 
4352
4698
#endif
4353
4699
 
4354
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" "\
4355
4714
const struct {
 
4715
"
 
4716
              ;;
 
4717
            esac
 
4718
 
 
4719
 
 
4720
          $echo >> "$output_objdir/$dlsyms" "\
4356
4721
  const char *name;
4357
4722
  lt_ptr address;
4358
4723
}
4399
4764
          esac
4400
4765
 
4401
4766
          # Now compile the dynamic symbol file.
4402
 
          $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
4403
 
          $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
 
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 $?
4404
4769
 
4405
4770
          # Clean up the generated files.
4406
4771
          $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
4407
4772
          $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
4408
4773
 
4409
4774
          # Transform the symbol file into the correct name.
4410
 
          compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
4411
 
          finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
 
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
4412
4790
          ;;
4413
4791
        *)
4414
4792
          $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
4421
4799
        # really was required.
4422
4800
 
4423
4801
        # Nullify the symbol file.
4424
 
        compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
4425
 
        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`
4426
4804
      fi
4427
4805
 
4428
4806
      if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
4429
4807
        # Replace the output file specification.
4430
 
        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`
4431
4809
        link_command="$compile_command$compile_rpath"
4432
4810
 
4433
4811
        # We have no uninstalled library dependencies, so finalize right now.
4434
4812
        $show "$link_command"
4435
4813
        $run eval "$link_command"
4436
 
        status=$?
 
4814
        exit_status=$?
4437
4815
 
4438
4816
        # Delete the generated files.
4439
4817
        if test -n "$dlsyms"; then
4441
4819
          $run $rm "$output_objdir/${outputname}S.${objext}"
4442
4820
        fi
4443
4821
 
4444
 
        exit $status
 
4822
        exit $exit_status
4445
4823
      fi
4446
4824
 
4447
4825
      if test -n "$shlibpath_var"; then
4514
4892
        if test "$fast_install" != no; then
4515
4893
          link_command="$finalize_var$compile_command$finalize_rpath"
4516
4894
          if test "$fast_install" = yes; then
4517
 
            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`
4518
4896
          else
4519
4897
            # fast_install is set to needless
4520
4898
            relink_command=
4551
4929
          fi
4552
4930
        done
4553
4931
        relink_command="(cd `pwd`; $relink_command)"
4554
 
        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`
4555
4933
      fi
4556
4934
 
4557
4935
      # Quote $echo for shipping.
4581
4959
        esac
4582
4960
        case $host in
4583
4961
          *cygwin* | *mingw* )
4584
 
            cwrappersource=`$echo ${objdir}/lt-${output}.c`
4585
 
            cwrapper=`$echo ${output}.exe`
4586
 
            $rm $cwrappersource $cwrapper
4587
 
            trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
 
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
4588
4968
 
4589
4969
            cat > $cwrappersource <<EOF
4590
4970
 
4609
4989
#include <malloc.h>
4610
4990
#include <stdarg.h>
4611
4991
#include <assert.h>
 
4992
#include <string.h>
 
4993
#include <ctype.h>
 
4994
#include <sys/stat.h>
4612
4995
 
4613
4996
#if defined(PATH_MAX)
4614
4997
# define LT_PATHMAX PATH_MAX
4619
5002
#endif
4620
5003
 
4621
5004
#ifndef DIR_SEPARATOR
4622
 
#define DIR_SEPARATOR '/'
 
5005
# define DIR_SEPARATOR '/'
 
5006
# define PATH_SEPARATOR ':'
4623
5007
#endif
4624
5008
 
4625
5009
#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4626
5010
  defined (__OS2__)
4627
 
#define HAVE_DOS_BASED_FILE_SYSTEM
4628
 
#ifndef DIR_SEPARATOR_2
4629
 
#define DIR_SEPARATOR_2 '\\'
4630
 
#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
4631
5018
#endif
4632
5019
 
4633
5020
#ifndef DIR_SEPARATOR_2
4637
5024
        (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4638
5025
#endif /* DIR_SEPARATOR_2 */
4639
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
 
4640
5033
#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
4641
5034
#define XFREE(stale) do { \
4642
5035
  if (stale) { free ((void *) stale); stale = 0; } \
4643
5036
} while (0)
4644
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
 
4645
5046
const char *program_name = NULL;
4646
5047
 
4647
5048
void * xmalloc (size_t num);
4648
5049
char * xstrdup (const char *string);
4649
 
char * basename (const char *name);
4650
 
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);
4651
5053
char * strendzap(char *str, const char *pat);
4652
5054
void lt_fatal (const char *message, ...);
4653
5055
 
4657
5059
  char **newargz;
4658
5060
  int i;
4659
5061
 
4660
 
  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);
4661
5065
  newargz = XMALLOC(char *, argc+2);
4662
5066
EOF
4663
5067
 
4664
 
            cat >> $cwrappersource <<EOF
4665
 
  newargz[0] = "$SHELL";
 
5068
            cat >> $cwrappersource <<EOF
 
5069
  newargz[0] = (char *) xstrdup("$SHELL");
4666
5070
EOF
4667
5071
 
4668
 
            cat >> $cwrappersource <<"EOF"
4669
 
  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]);
4670
5077
  /* we know the script has the same name, without the .exe */
4671
5078
  /* so make sure newargz[1] doesn't end in .exe */
4672
5079
  strendzap(newargz[1],".exe");
4673
5080
  for (i = 1; i < argc; i++)
4674
5081
    newargz[i+1] = xstrdup(argv[i]);
4675
5082
  newargz[argc+1] = NULL;
4676
 
EOF
4677
 
 
4678
 
            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
4679
5100
  execv("$SHELL",newargz);
4680
5101
EOF
 
5102
              ;;
 
5103
            esac
4681
5104
 
4682
 
            cat >> $cwrappersource <<"EOF"
 
5105
            cat >> $cwrappersource <<"EOF"
 
5106
  return 127;
4683
5107
}
4684
5108
 
4685
5109
void *
4699
5123
;
4700
5124
}
4701
5125
 
4702
 
char *
4703
 
basename (const char *name)
 
5126
const char *
 
5127
base_name (const char *name)
4704
5128
{
4705
5129
  const char *base;
4706
5130
 
4707
5131
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4708
5132
  /* Skip over the disk name in MSDOS pathnames. */
4709
 
  if (isalpha (name[0]) && name[1] == ':')
 
5133
  if (isalpha ((unsigned char)name[0]) && name[1] == ':')
4710
5134
    name += 2;
4711
5135
#endif
4712
5136
 
4713
5137
  for (base = name; *name; name++)
4714
5138
    if (IS_DIR_SEPARATOR (*name))
4715
5139
      base = name + 1;
4716
 
  return (char *) base;
4717
 
}
4718
 
 
 
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 */
4719
5170
char *
4720
 
fnqualify(const char *path)
 
5171
find_executable (const char* wrapper)
4721
5172
{
4722
 
  size_t size;
4723
 
  char *p;
 
5173
  int has_slash = 0;
 
5174
  const char* p;
 
5175
  const char* p_next;
 
5176
  /* static buffer for getcwd */
4724
5177
  char tmp[LT_PATHMAX + 1];
4725
 
 
4726
 
  assert(path != NULL);
4727
 
 
4728
 
  /* Is it qualified already? */
4729
 
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
4730
 
  if (isalpha (path[0]) && path[1] == ':')
4731
 
    return xstrdup (path);
4732
 
#endif
4733
 
  if (IS_DIR_SEPARATOR (path[0]))
4734
 
    return xstrdup (path);
4735
 
 
4736
 
  /* prepend the current directory */
4737
 
  /* doesn't handle '~' */
 
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 */
4738
5256
  if (getcwd (tmp, LT_PATHMAX) == NULL)
4739
5257
    lt_fatal ("getcwd failed");
4740
 
  size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
4741
 
  p = XMALLOC(char, size);
4742
 
  sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
4743
 
  return p;
 
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;
4744
5268
}
4745
5269
 
4746
5270
char *
4784
5308
  va_end (ap);
4785
5309
}
4786
5310
EOF
4787
 
          # we should really use a build-platform specific compiler
4788
 
          # here, but OTOH, the wrappers (shell script and this C one)
4789
 
          # are only useful if you want to execute the "real" binary.
4790
 
          # Since the "real" binary is built for $host, then this
4791
 
          # wrapper might as well be built for $host, too.
4792
 
          $run $LTCC -s -o $cwrapper $cwrappersource
4793
 
          ;;
4794
 
        esac
4795
 
        $rm $output
4796
 
        trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
 
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
4797
5321
 
4798
5322
        $echo > $output "\
4799
5323
#! $SHELL
4812
5336
Xsed='${SED} -e 1s/^X//'
4813
5337
sed_quote_subst='$sed_quote_subst'
4814
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
 
4815
5353
# The HP-UX ksh and POSIX shell print the target directory to stdout
4816
5354
# if CDPATH is set.
4817
 
if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
 
5355
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4818
5356
 
4819
5357
relink_command=\"$relink_command\"
4820
5358
 
4943
5481
        # Backslashes separate directories on plain windows
4944
5482
        *-*-mingw | *-*-os2*)
4945
5483
          $echo >> $output "\
4946
 
      exec \$progdir\\\\\$program \${1+\"\$@\"}
 
5484
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4947
5485
"
4948
5486
          ;;
4949
5487
 
4950
5488
        *)
4951
5489
          $echo >> $output "\
4952
 
      exec \$progdir/\$program \${1+\"\$@\"}
 
5490
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
4953
5491
"
4954
5492
          ;;
4955
5493
        esac
4956
5494
        $echo >> $output "\
4957
 
      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
 
5495
      \$echo \"\$0: cannot exec \$program \$*\"
4958
5496
      exit $EXIT_FAILURE
4959
5497
    fi
4960
5498
  else
4961
5499
    # The program doesn't exist.
4962
 
    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
 
5500
    \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4963
5501
    \$echo \"This script is just a wrapper for \$program.\" 1>&2
4964
5502
    $echo \"See the $PACKAGE documentation for more information.\" 1>&2
4965
5503
    exit $EXIT_FAILURE
4991
5529
 
4992
5530
      if test -n "$addlibs"; then
4993
5531
        gentop="$output_objdir/${outputname}x"
4994
 
        $show "${rm}r $gentop"
4995
 
        $run ${rm}r "$gentop"
4996
 
        $show "$mkdir $gentop"
4997
 
        $run $mkdir "$gentop"
4998
 
        status=$?
4999
 
        if test "$status" -ne 0 && test ! -d "$gentop"; then
5000
 
          exit $status
5001
 
        fi
5002
5532
        generated="$generated $gentop"
5003
5533
 
5004
 
        # Add in members from convenience archives.
5005
 
        for xlib in $addlibs; do
5006
 
          # Extract the objects.
5007
 
          case $xlib in
5008
 
          [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
5009
 
          *) xabs=`pwd`"/$xlib" ;;
5010
 
          esac
5011
 
          xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
5012
 
          xdir="$gentop/$xlib"
5013
 
 
5014
 
          $show "${rm}r $xdir"
5015
 
          $run ${rm}r "$xdir"
5016
 
          $show "$mkdir $xdir"
5017
 
          $run $mkdir "$xdir"
5018
 
          status=$?
5019
 
          if test "$status" -ne 0 && test ! -d "$xdir"; then
5020
 
            exit $status
5021
 
          fi
5022
 
          # We will extract separately just the conflicting names and we will no
5023
 
          # longer touch any unique names. It is faster to leave these extract
5024
 
          # automatically by $AR in one run.
5025
 
          $show "(cd $xdir && $AR x $xabs)"
5026
 
          $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
5027
 
          if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
5028
 
            :
5029
 
          else
5030
 
            $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
5031
 
            $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
5032
 
            $AR t "$xabs" | sort | uniq -cd | while read -r count name
5033
 
            do
5034
 
              i=1
5035
 
              while test "$i" -le "$count"
5036
 
              do
5037
 
               # Put our $i before any first dot (extension)
5038
 
               # Never overwrite any file
5039
 
               name_to="$name"
5040
 
               while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
5041
 
               do
5042
 
                 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
5043
 
               done
5044
 
               $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
5045
 
               $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
5046
 
               i=`expr $i + 1`
5047
 
              done
5048
 
            done
5049
 
          fi
5050
 
 
5051
 
          oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
5052
 
        done
 
5534
        func_extract_archives $gentop $addlibs
 
5535
        oldobjs="$oldobjs $func_extract_archives_result"
5053
5536
      fi
5054
5537
 
5055
5538
      # Do each command in the archive commands.
5056
5539
      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
5057
5540
       cmds=$old_archive_from_new_cmds
5058
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
 
5059
5599
        eval cmds=\"$old_archive_cmds\"
5060
5600
 
5061
5601
        if len=`expr "X$cmds" : ".*"` &&
5069
5609
          objlist=
5070
5610
          concat_cmds=
5071
5611
          save_oldobjs=$oldobjs
5072
 
          # GNU ar 2.10+ was changed to match POSIX; thus no paths are
5073
 
          # encoded into archives.  This makes 'ar r' malfunction in
5074
 
          # this piecewise linking case whenever conflicting object
5075
 
          # names appear in distinct ar calls; check, warn and compensate.
5076
 
            if (for obj in $save_oldobjs
5077
 
            do
5078
 
              $echo "X$obj" | $Xsed -e 's%^.*/%%'
5079
 
            done | sort | sort -uc >/dev/null 2>&1); then
5080
 
            :
5081
 
          else
5082
 
            $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
5083
 
            $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
5084
 
            AR_FLAGS=cq
5085
 
          fi
 
5612
 
5086
5613
          # Is there a better way of finding the last object in the list?
5087
5614
          for obj in $save_oldobjs
5088
5615
          do
5093
5620
            oldobjs="$objlist $obj"
5094
5621
            objlist="$objlist $obj"
5095
5622
            eval test_cmds=\"$old_archive_cmds\"
5096
 
            if len=`expr "X$test_cmds" : ".*"` &&
 
5623
            if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
5097
5624
               test "$len" -le "$max_cmd_len"; then
5098
5625
              :
5099
5626
            else
5151
5678
      done
5152
5679
      # Quote the link command for shipping.
5153
5680
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
5154
 
      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`
5155
5682
      if test "$hardcode_automatic" = yes ; then
5156
5683
        relink_command=
5157
5684
      fi
5290
5817
    # install_prog (especially on Windows NT).
5291
5818
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
5292
5819
       # Allow the use of GNU shtool's install command.
5293
 
       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
 
5820
       $echo "X$nonopt" | grep shtool > /dev/null; then
5294
5821
      # Aesthetically quote it.
5295
5822
      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
5296
5823
      case $arg in
5297
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5824
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5298
5825
        arg="\"$arg\""
5299
5826
        ;;
5300
5827
      esac
5303
5830
      shift
5304
5831
    else
5305
5832
      install_prog=
5306
 
      arg="$nonopt"
 
5833
      arg=$nonopt
5307
5834
    fi
5308
5835
 
5309
5836
    # The real first argument should be the name of the installation program.
5310
5837
    # Aesthetically quote it.
5311
5838
    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5312
5839
    case $arg in
5313
 
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*)
 
5840
    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \       ]*|*]*|"")
5314
5841
      arg="\"$arg\""
5315
5842
      ;;
5316
5843
    esac
5328
5855
    do
5329
5856
      if test -n "$dest"; then
5330
5857
        files="$files $dest"
5331
 
        dest="$arg"
 
5858
        dest=$arg
5332
5859
        continue
5333
5860
      fi
5334
5861
 
5335
5862
      case $arg in
5336
5863
      -d) isdir=yes ;;
5337
 
      -f) prev="-f" ;;
5338
 
      -g) prev="-g" ;;
5339
 
      -m) prev="-m" ;;
5340
 
      -o) prev="-o" ;;
 
5864
      -f) 
 
5865
        case " $install_prog " in
 
5866
        *[\\\ /]cp\ *) ;;
 
5867
        *) prev=$arg ;;
 
5868
        esac
 
5869
        ;;
 
5870
      -g | -m | -o) prev=$arg ;;
5341
5871
      -s)
5342
5872
        stripme=" -s"
5343
5873
        continue
5344
5874
        ;;
5345
 
      -*) ;;
5346
 
 
 
5875
      -*)
 
5876
        ;;
5347
5877
      *)
5348
5878
        # If the previous option needed an argument, then skip it.
5349
5879
        if test -n "$prev"; then
5350
5880
          prev=
5351
5881
        else
5352
 
          dest="$arg"
 
5882
          dest=$arg
5353
5883
          continue
5354
5884
        fi
5355
5885
        ;;
5358
5888
      # Aesthetically quote the argument.
5359
5889
      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
5360
5890
      case $arg in
5361
 
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*)
 
5891
      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \     ]*|*]*|"")
5362
5892
        arg="\"$arg\""
5363
5893
        ;;
5364
5894
      esac
5493
6023
 
5494
6024
          if test -n "$inst_prefix_dir"; then
5495
6025
            # Stick the inst_prefix_dir data into the link command.
5496
 
            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`
5497
6027
          else
5498
 
            relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
 
6028
            relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
5499
6029
          fi
5500
6030
 
5501
6031
          $echo "$modename: warning: relinking \`$file'" 1>&2
5527
6057
 
5528
6058
          if test "$#" -gt 0; then
5529
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.
5530
6063
            for linkname
5531
6064
            do
5532
6065
              if test "$linkname" != "$realname"; then
5533
 
                $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
5534
 
                $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
 
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; }; })"
5535
6068
              fi
5536
6069
            done
5537
6070
          fi
5544
6077
            IFS="$save_ifs"
5545
6078
            eval cmd=\"$cmd\"
5546
6079
            $show "$cmd"
5547
 
            $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
            }
5548
6090
          done
5549
6091
          IFS="$save_ifs"
5550
6092
        fi
5638
6180
          notinst_deplibs=
5639
6181
          relink_command=
5640
6182
 
5641
 
          # To insure that "foo" is sourced, and not "foo.exe",
5642
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5643
 
          # which disallows the automatic-append-.exe behavior.
5644
 
          case $build in
5645
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5646
 
          *) wrapperdot=${wrapper} ;;
5647
 
          esac
 
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
          #
5648
6188
          # If there is no directory component, then add one.
5649
 
          case $file in
5650
 
          */* | *\\*) . ${wrapperdot} ;;
5651
 
          *) . ./${wrapperdot} ;;
 
6189
          case $wrapper in
 
6190
          */* | *\\*) . ${wrapper} ;;
 
6191
          *) . ./${wrapper} ;;
5652
6192
          esac
5653
6193
 
5654
6194
          # Check the variables that should have been set.
5676
6216
          done
5677
6217
 
5678
6218
          relink_command=
5679
 
          # To insure that "foo" is sourced, and not "foo.exe",
5680
 
          # finese the cygwin/MSYS system by explicitly sourcing "foo."
5681
 
          # which disallows the automatic-append-.exe behavior.
5682
 
          case $build in
5683
 
          *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
5684
 
          *) wrapperdot=${wrapper} ;;
5685
 
          esac
 
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
          #
5686
6224
          # If there is no directory component, then add one.
5687
 
          case $file in
5688
 
          */* | *\\*) . ${wrapperdot} ;;
5689
 
          *) . ./${wrapperdot} ;;
 
6225
          case $wrapper in
 
6226
          */* | *\\*) . ${wrapper} ;;
 
6227
          *) . ./${wrapper} ;;
5690
6228
          esac
5691
6229
 
5692
6230
          outputname=
5693
6231
          if test "$fast_install" = no && test -n "$relink_command"; then
5694
6232
            if test "$finalize" = yes && test -z "$run"; then
5695
 
              tmpdir="/tmp"
5696
 
              test -n "$TMPDIR" && tmpdir="$TMPDIR"
5697
 
              tmpdir="$tmpdir/libtool-$$"
5698
 
              save_umask=`umask`
5699
 
              umask 0077
5700
 
              if $mkdir "$tmpdir"; then
5701
 
                umask $save_umask
5702
 
              else
5703
 
                umask $save_umask
5704
 
                $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
5705
 
                continue
5706
 
              fi
 
6233
              tmpdir=`func_mktempdir`
5707
6234
              file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
5708
6235
              outputname="$tmpdir/$file"
5709
6236
              # Replace the output file specification.
5710
 
              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`
5711
6238
 
5712
6239
              $show "$relink_command"
5713
6240
              if $run eval "$relink_command"; then :
5727
6254
        fi
5728
6255
 
5729
6256
        # remove .exe since cygwin /usr/bin/install will append another
5730
 
        # one anyways
 
6257
        # one anyway 
5731
6258
        case $install_prog,$host in
5732
6259
        */usr/bin/install*,*cygwin*)
5733
6260
          case $file:$destfile in
5827
6354
    # Exit here if they wanted silent mode.
5828
6355
    test "$show" = : && exit $EXIT_SUCCESS
5829
6356
 
5830
 
    $echo "----------------------------------------------------------------------"
 
6357
    $echo "X----------------------------------------------------------------------" | $Xsed
5831
6358
    $echo "Libraries have been installed in:"
5832
6359
    for libdir in $libdirs; do
5833
6360
      $echo "   $libdir"
5860
6387
    $echo
5861
6388
    $echo "See any operating system documentation about shared libraries for"
5862
6389
    $echo "more information, such as the ld(1) and ld.so(8) manual pages."
5863
 
    $echo "----------------------------------------------------------------------"
 
6390
    $echo "X----------------------------------------------------------------------" | $Xsed
5864
6391
    exit $EXIT_SUCCESS
5865
6392
    ;;
5866
6393
 
5918
6445
        if test -f "$dir/$objdir/$dlname"; then
5919
6446
          dir="$dir/$objdir"
5920
6447
        else
5921
 
          $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
5922
 
          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
5923
6452
        fi
5924
6453
        ;;
5925
6454
 
5983
6512
      fi
5984
6513
 
5985
6514
      # Restore saved environment variables
5986
 
      if test "${save_LC_ALL+set}" = set; then
5987
 
        LC_ALL="$save_LC_ALL"; export LC_ALL
5988
 
      fi
5989
 
      if test "${save_LANG+set}" = set; then
5990
 
        LANG="$save_LANG"; export LANG
5991
 
      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
5992
6521
 
5993
6522
      # Now prepare to actually exec the command.
5994
6523
      exec_cmd="\$cmd$args"
6077
6606
            rmfiles="$rmfiles $objdir/$n"
6078
6607
          done
6079
6608
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
6080
 
          test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
6081
6609
 
6082
 
          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)
6083
6620
            if test -n "$library_names"; then
6084
6621
              # Do each command in the postuninstall commands.
6085
6622
              cmds=$postuninstall_cmds
6112
6649
              IFS="$save_ifs"
6113
6650
            fi
6114
6651
            # FIXME: should reinstall the best remaining shared library.
6115
 
          fi
 
6652
            ;;
 
6653
          esac
6116
6654
        fi
6117
6655
        ;;
6118
6656
 
6336
6874
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
6337
6875
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
6338
6876
  -export-symbols SYMFILE
6339
 
                    try to export only the symbols listed in SYMFILE
 
6877
                    try to export only the symbols listed in SYMFILE
6340
6878
  -export-symbols-regex REGEX
6341
 
                    try to export only the symbols matching REGEX
 
6879
                    try to export only the symbols matching REGEX
6342
6880
  -LLIBDIR          search LIBDIR for required installed libraries
6343
6881
  -lNAME            OUTPUT-FILE requires the installed library libNAME
6344
6882
  -module           build a library that can dlopened
6352
6890
  -release RELEASE  specify package release information
6353
6891
  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
6354
6892
  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
6355
 
  -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
6356
6896
  -version-info CURRENT[:REVISION[:AGE]]
6357
 
                    specify library version info [each variable defaults to 0]
 
6897
                    specify library version info [each variable defaults to 0]
6358
6898
 
6359
6899
All other options (arguments beginning with \`-') are ignored.
6360
6900
 
6397
6937
$echo
6398
6938
$echo "Try \`$modename --help' for more information about other modes."
6399
6939
 
6400
 
exit $EXIT_SUCCESS
 
6940
exit $?
6401
6941
 
6402
6942
# The TAGs below are defined such that we never get into a situation
6403
6943
# in which we disable both kinds of libraries.  Given conflicting
6411
6951
# configuration.  But we'll never go from static-only to shared-only.
6412
6952
 
6413
6953
# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
6414
 
build_libtool_libs=no
6415
 
build_old_libs=yes
 
6954
disable_libs=shared
6416
6955
# ### END LIBTOOL TAG CONFIG: disable-shared
6417
6956
 
6418
6957
# ### BEGIN LIBTOOL TAG CONFIG: disable-static
6419
 
build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
 
6958
disable_libs=static
6420
6959
# ### END LIBTOOL TAG CONFIG: disable-static
6421
6960
 
6422
6961
# Local Variables: