~ubuntu-branches/ubuntu/vivid/gnome-desktop3/vivid-proposed

« back to all changes in this revision

Viewing changes to ltmain.sh

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2013-05-28 09:10:46 UTC
  • mfrom: (1.6.1) (21.1.10 experimental)
  • Revision ID: package-import@ubuntu.com-20130528091046-b0oc28za9l97fgq1
Tags: 3.8.2-0ubuntu1
* New upstream release
* Sync with Debian (LP: #1184812) Remaining changes:
  - debian/patches:
    + 04_compute_average_color.patch: Compute the avergage color in
      gnome-desktop itself, not in unity to fix some races (LP #963140)
    + tweak_color_computation.patch, Patch from Gord, no patch header,
      no bug link.
    + git_revert_draw_background.patch
    + ubuntu_language.patch, Ported relevant bits from g-c-c 
      52_region_language.patch, as required for gnome 3.8 region panel
    + ubuntu_language_list_from_SUPPORTED.patch,
      adds api to get list of available languages from SUPPORTED file.
      To be used by gnome 3.8 region panel language installation.
  - debian/control.in:
    + Don't break gnome-shell << 3.7.90
    + Use source:Version for gnome-desktop3-data Depend
    + Add epoch to gnome-desktop3-data's Breaks/Replaces, as our old
      gnome-desktop source package introduced an epoch. This needs to be
      kept until after 14.04 LTS.
 - Install helper tools into a versioned directory (by overriding
   libexecdir). They could alternatively be installed in a separate package
* Dropped changes:
  - 02_refuse_to_break_GL_compositors.patch:
    + Doesn't appear to be needed any more
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Generated from ltmain.m4sh.
2
1
 
3
 
# ltmain.sh (GNU libtool) 2.2.6
 
2
# libtool (GNU libtool) 2.4.2
4
3
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
5
4
 
6
 
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
 
5
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
 
6
# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
7
7
# This is free software; see the source for copying conditions.  There is NO
8
8
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
9
 
32
32
#
33
33
# Provide generalized library-building support services.
34
34
#
35
 
#     --config             show all configuration variables
36
 
#     --debug              enable verbose shell tracing
37
 
# -n, --dry-run            display commands without modifying any files
38
 
#     --features           display basic configuration information and exit
39
 
#     --mode=MODE          use operation mode MODE
40
 
#     --preserve-dup-deps  don't remove duplicate dependency libraries
41
 
#     --quiet, --silent    don't print informational messages
42
 
#     --tag=TAG            use configuration variables from tag TAG
43
 
# -v, --verbose            print informational messages (default)
44
 
#     --version            print version information
45
 
# -h, --help               print short or long help message
 
35
#       --config             show all configuration variables
 
36
#       --debug              enable verbose shell tracing
 
37
#   -n, --dry-run            display commands without modifying any files
 
38
#       --features           display basic configuration information and exit
 
39
#       --mode=MODE          use operation mode MODE
 
40
#       --preserve-dup-deps  don't remove duplicate dependency libraries
 
41
#       --quiet, --silent    don't print informational messages
 
42
#       --no-quiet, --no-silent
 
43
#                            print informational messages (default)
 
44
#       --no-warn            don't display warning messages
 
45
#       --tag=TAG            use configuration variables from tag TAG
 
46
#   -v, --verbose            print more informational messages than default
 
47
#       --no-verbose         don't print the extra informational messages
 
48
#       --version            print version information
 
49
#   -h, --help, --help-all   print short, long, or detailed help message
46
50
#
47
51
# MODE must be one of the following:
48
52
#
49
 
#       clean              remove files from the build directory
50
 
#       compile            compile a source file into a libtool object
51
 
#       execute            automatically set library path, then run a program
52
 
#       finish             complete the installation of libtool libraries
53
 
#       install            install libraries or executables
54
 
#       link               create a library or an executable
55
 
#       uninstall          remove libraries from an installed directory
 
53
#         clean              remove files from the build directory
 
54
#         compile            compile a source file into a libtool object
 
55
#         execute            automatically set library path, then run a program
 
56
#         finish             complete the installation of libtool libraries
 
57
#         install            install libraries or executables
 
58
#         link               create a library or an executable
 
59
#         uninstall          remove libraries from an installed directory
56
60
#
57
 
# MODE-ARGS vary depending on the MODE.
 
61
# MODE-ARGS vary depending on the MODE.  When passed as first option,
 
62
# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
58
63
# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
59
64
#
60
65
# When reporting a bug, please describe a test case to reproduce it and
61
66
# include the following information:
62
67
#
63
 
#       host-triplet:   $host
64
 
#       shell:          $SHELL
65
 
#       compiler:               $LTCC
66
 
#       compiler flags:         $LTCFLAGS
67
 
#       linker:         $LD (gnu? $with_gnu_ld)
68
 
#       $progname:              (GNU libtool) 2.2.6
69
 
#       automake:               $automake_version
70
 
#       autoconf:               $autoconf_version
 
68
#         host-triplet: $host
 
69
#         shell:                $SHELL
 
70
#         compiler:             $LTCC
 
71
#         compiler flags:               $LTCFLAGS
 
72
#         linker:               $LD (gnu? $with_gnu_ld)
 
73
#         $progname:    (GNU libtool) 2.4.2
 
74
#         automake:     $automake_version
 
75
#         autoconf:     $autoconf_version
71
76
#
72
77
# Report bugs to <bug-libtool@gnu.org>.
 
78
# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
 
79
# General help using GNU software: <http://www.gnu.org/gethelp/>.
73
80
 
74
 
PROGRAM=ltmain.sh
 
81
PROGRAM=libtool
75
82
PACKAGE=libtool
76
 
VERSION=2.2.6
 
83
VERSION=2.4.2
77
84
TIMESTAMP=""
78
 
package_revision=1.3012
 
85
: ${DD=dd}
 
86
package_revision=1.3337
79
87
 
80
88
# Be Bourne compatible
81
89
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
91
99
BIN_SH=xpg4; export BIN_SH # for Tru64
92
100
DUALCASE=1; export DUALCASE # for MKS sh
93
101
 
 
102
# A function that is used when there is no print builtin or printf.
 
103
func_fallback_echo ()
 
104
{
 
105
  eval 'cat <<_LTECHO_EOF
 
106
$1
 
107
_LTECHO_EOF'
 
108
}
 
109
 
94
110
# NLS nuisances: We save the old values to restore during execute mode.
95
 
# Only set LANG and LC_ALL to C if already set.
96
 
# These must not be set unconditionally because not all systems understand
97
 
# e.g. LANG=C (notably SCO).
98
111
lt_user_locale=
99
112
lt_safe_locale=
100
113
for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
107
120
          lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
108
121
        fi"
109
122
done
 
123
LC_ALL=C
 
124
LANGUAGE=C
 
125
export LANGUAGE LC_ALL
110
126
 
111
127
$lt_unset CDPATH
112
128
 
113
129
 
 
130
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
 
131
# is ksh but when the shell is invoked as "sh" and the current value of
 
132
# the _XPG environment variable is not equal to 1 (one), the special
 
133
# positional parameter $0, within a function call, is the name of the
 
134
# function.
 
135
progpath="$0"
114
136
 
115
137
 
116
138
 
117
139
: ${CP="cp -f"}
118
 
: ${ECHO="echo"}
119
 
: ${EGREP="/usr/bin/grep -E"}
120
 
: ${FGREP="/usr/bin/grep -F"}
121
 
: ${GREP="/usr/bin/grep"}
122
 
: ${LN_S="ln -s"}
 
140
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
123
141
: ${MAKE="make"}
124
142
: ${MKDIR="mkdir"}
125
143
: ${MV="mv -f"}
126
144
: ${RM="rm -f"}
127
 
: ${SED="/opt/local/bin/gsed"}
128
145
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
129
146
: ${Xsed="$SED -e 1s/^X//"}
130
147
 
144
161
dirname="s,/[^/]*$,,"
145
162
basename="s,^.*/,,"
146
163
 
 
164
# func_dirname file append nondir_replacement
 
165
# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
 
166
# otherwise set result to NONDIR_REPLACEMENT.
 
167
func_dirname ()
 
168
{
 
169
    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
 
170
    if test "X$func_dirname_result" = "X${1}"; then
 
171
      func_dirname_result="${3}"
 
172
    else
 
173
      func_dirname_result="$func_dirname_result${2}"
 
174
    fi
 
175
} # func_dirname may be replaced by extended shell implementation
 
176
 
 
177
 
 
178
# func_basename file
 
179
func_basename ()
 
180
{
 
181
    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
 
182
} # func_basename may be replaced by extended shell implementation
 
183
 
 
184
 
147
185
# func_dirname_and_basename file append nondir_replacement
148
186
# perform func_basename and func_dirname in a single function
149
187
# call:
158
196
# those functions but instead duplicate the functionality here.
159
197
func_dirname_and_basename ()
160
198
{
161
 
  # Extract subdirectory from the argument.
162
 
  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
163
 
  if test "X$func_dirname_result" = "X${1}"; then
164
 
    func_dirname_result="${3}"
165
 
  else
166
 
    func_dirname_result="$func_dirname_result${2}"
167
 
  fi
168
 
  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
169
 
}
170
 
 
171
 
# Generated shell functions inserted here.
172
 
 
173
 
# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
174
 
# is ksh but when the shell is invoked as "sh" and the current value of
175
 
# the _XPG environment variable is not equal to 1 (one), the special
176
 
# positional parameter $0, within a function call, is the name of the
177
 
# function.
178
 
progpath="$0"
 
199
    # Extract subdirectory from the argument.
 
200
    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
 
201
    if test "X$func_dirname_result" = "X${1}"; then
 
202
      func_dirname_result="${3}"
 
203
    else
 
204
      func_dirname_result="$func_dirname_result${2}"
 
205
    fi
 
206
    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
 
207
} # func_dirname_and_basename may be replaced by extended shell implementation
 
208
 
 
209
 
 
210
# func_stripname prefix suffix name
 
211
# strip PREFIX and SUFFIX off of NAME.
 
212
# PREFIX and SUFFIX must not contain globbing or regex special
 
213
# characters, hashes, percent signs, but SUFFIX may contain a leading
 
214
# dot (in which case that matches only a dot).
 
215
# func_strip_suffix prefix name
 
216
func_stripname ()
 
217
{
 
218
    case ${2} in
 
219
      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
 
220
      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
 
221
    esac
 
222
} # func_stripname may be replaced by extended shell implementation
 
223
 
 
224
 
 
225
# These SED scripts presuppose an absolute path with a trailing slash.
 
226
pathcar='s,^/\([^/]*\).*$,\1,'
 
227
pathcdr='s,^/[^/]*,,'
 
228
removedotparts=':dotsl
 
229
                s@/\./@/@g
 
230
                t dotsl
 
231
                s,/\.$,/,'
 
232
collapseslashes='s@/\{1,\}@/@g'
 
233
finalslash='s,/*$,/,'
 
234
 
 
235
# func_normal_abspath PATH
 
236
# Remove doubled-up and trailing slashes, "." path components,
 
237
# and cancel out any ".." path components in PATH after making
 
238
# it an absolute path.
 
239
#             value returned in "$func_normal_abspath_result"
 
240
func_normal_abspath ()
 
241
{
 
242
  # Start from root dir and reassemble the path.
 
243
  func_normal_abspath_result=
 
244
  func_normal_abspath_tpath=$1
 
245
  func_normal_abspath_altnamespace=
 
246
  case $func_normal_abspath_tpath in
 
247
    "")
 
248
      # Empty path, that just means $cwd.
 
249
      func_stripname '' '/' "`pwd`"
 
250
      func_normal_abspath_result=$func_stripname_result
 
251
      return
 
252
    ;;
 
253
    # The next three entries are used to spot a run of precisely
 
254
    # two leading slashes without using negated character classes;
 
255
    # we take advantage of case's first-match behaviour.
 
256
    ///*)
 
257
      # Unusual form of absolute path, do nothing.
 
258
    ;;
 
259
    //*)
 
260
      # Not necessarily an ordinary path; POSIX reserves leading '//'
 
261
      # and for example Cygwin uses it to access remote file shares
 
262
      # over CIFS/SMB, so we conserve a leading double slash if found.
 
263
      func_normal_abspath_altnamespace=/
 
264
    ;;
 
265
    /*)
 
266
      # Absolute path, do nothing.
 
267
    ;;
 
268
    *)
 
269
      # Relative path, prepend $cwd.
 
270
      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
 
271
    ;;
 
272
  esac
 
273
  # Cancel out all the simple stuff to save iterations.  We also want
 
274
  # the path to end with a slash for ease of parsing, so make sure
 
275
  # there is one (and only one) here.
 
276
  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
 
277
        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
 
278
  while :; do
 
279
    # Processed it all yet?
 
280
    if test "$func_normal_abspath_tpath" = / ; then
 
281
      # If we ascended to the root using ".." the result may be empty now.
 
282
      if test -z "$func_normal_abspath_result" ; then
 
283
        func_normal_abspath_result=/
 
284
      fi
 
285
      break
 
286
    fi
 
287
    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
 
288
        -e "$pathcar"`
 
289
    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
 
290
        -e "$pathcdr"`
 
291
    # Figure out what to do with it
 
292
    case $func_normal_abspath_tcomponent in
 
293
      "")
 
294
        # Trailing empty path component, ignore it.
 
295
      ;;
 
296
      ..)
 
297
        # Parent dir; strip last assembled component from result.
 
298
        func_dirname "$func_normal_abspath_result"
 
299
        func_normal_abspath_result=$func_dirname_result
 
300
      ;;
 
301
      *)
 
302
        # Actual path component, append it.
 
303
        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
 
304
      ;;
 
305
    esac
 
306
  done
 
307
  # Restore leading double-slash if one was found on entry.
 
308
  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
 
309
}
 
310
 
 
311
# func_relative_path SRCDIR DSTDIR
 
312
# generates a relative path from SRCDIR to DSTDIR, with a trailing
 
313
# slash if non-empty, suitable for immediately appending a filename
 
314
# without needing to append a separator.
 
315
#             value returned in "$func_relative_path_result"
 
316
func_relative_path ()
 
317
{
 
318
  func_relative_path_result=
 
319
  func_normal_abspath "$1"
 
320
  func_relative_path_tlibdir=$func_normal_abspath_result
 
321
  func_normal_abspath "$2"
 
322
  func_relative_path_tbindir=$func_normal_abspath_result
 
323
 
 
324
  # Ascend the tree starting from libdir
 
325
  while :; do
 
326
    # check if we have found a prefix of bindir
 
327
    case $func_relative_path_tbindir in
 
328
      $func_relative_path_tlibdir)
 
329
        # found an exact match
 
330
        func_relative_path_tcancelled=
 
331
        break
 
332
        ;;
 
333
      $func_relative_path_tlibdir*)
 
334
        # found a matching prefix
 
335
        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
 
336
        func_relative_path_tcancelled=$func_stripname_result
 
337
        if test -z "$func_relative_path_result"; then
 
338
          func_relative_path_result=.
 
339
        fi
 
340
        break
 
341
        ;;
 
342
      *)
 
343
        func_dirname $func_relative_path_tlibdir
 
344
        func_relative_path_tlibdir=${func_dirname_result}
 
345
        if test "x$func_relative_path_tlibdir" = x ; then
 
346
          # Have to descend all the way to the root!
 
347
          func_relative_path_result=../$func_relative_path_result
 
348
          func_relative_path_tcancelled=$func_relative_path_tbindir
 
349
          break
 
350
        fi
 
351
        func_relative_path_result=../$func_relative_path_result
 
352
        ;;
 
353
    esac
 
354
  done
 
355
 
 
356
  # Now calculate path; take care to avoid doubling-up slashes.
 
357
  func_stripname '' '/' "$func_relative_path_result"
 
358
  func_relative_path_result=$func_stripname_result
 
359
  func_stripname '/' '/' "$func_relative_path_tcancelled"
 
360
  if test "x$func_stripname_result" != x ; then
 
361
    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
 
362
  fi
 
363
 
 
364
  # Normalisation. If bindir is libdir, return empty string,
 
365
  # else relative path ending with a slash; either way, target
 
366
  # file name can be directly appended.
 
367
  if test ! -z "$func_relative_path_result"; then
 
368
    func_stripname './' '' "$func_relative_path_result/"
 
369
    func_relative_path_result=$func_stripname_result
 
370
  fi
 
371
}
179
372
 
180
373
# The name of this program:
181
 
# In the unlikely event $progname began with a '-', it would play havoc with
182
 
# func_echo (imagine progname=-n), so we prepend ./ in that case:
183
374
func_dirname_and_basename "$progpath"
184
375
progname=$func_basename_result
185
 
case $progname in
186
 
  -*) progname=./$progname ;;
187
 
esac
188
376
 
189
377
# Make sure we have an absolute path for reexecution:
190
378
case $progpath in
196
384
     ;;
197
385
  *)
198
386
     save_IFS="$IFS"
199
 
     IFS=:
 
387
     IFS=${PATH_SEPARATOR-:}
200
388
     for progdir in $PATH; do
201
389
       IFS="$save_IFS"
202
390
       test -x "$progdir/$progname" && break
215
403
# Same as above, but do not quote variable references.
216
404
double_quote_subst='s/\(["`\\]\)/\\\1/g'
217
405
 
 
406
# Sed substitution that turns a string into a regex matching for the
 
407
# string literally.
 
408
sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
 
409
 
 
410
# Sed substitution that converts a w32 file name or path
 
411
# which contains forward slashes, into one that contains
 
412
# (escaped) backslashes.  A very naive implementation.
 
413
lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
 
414
 
218
415
# Re-`\' parameter expansions in output of double_quote_subst that were
219
416
# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
220
417
# in input to double_quote_subst, that '$' was protected from expansion.
243
440
# name if it has been set yet.
244
441
func_echo ()
245
442
{
246
 
    $ECHO "$progname${mode+: }$mode: $*"
 
443
    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
247
444
}
248
445
 
249
446
# func_verbose arg...
258
455
    :
259
456
}
260
457
 
 
458
# func_echo_all arg...
 
459
# Invoke $ECHO with all args, space-separated.
 
460
func_echo_all ()
 
461
{
 
462
    $ECHO "$*"
 
463
}
 
464
 
261
465
# func_error arg...
262
466
# Echo program name prefixed message to standard error.
263
467
func_error ()
264
468
{
265
 
    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
 
469
    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
266
470
}
267
471
 
268
472
# func_warning arg...
269
473
# Echo program name prefixed warning message to standard error.
270
474
func_warning ()
271
475
{
272
 
    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
 
476
    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
273
477
 
274
478
    # bash bug again:
275
479
    :
326
530
        case $my_directory_path in */*) ;; *) break ;; esac
327
531
 
328
532
        # ...otherwise throw away the child directory and loop
329
 
        my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
 
533
        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
330
534
      done
331
 
      my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
 
535
      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
332
536
 
333
537
      save_mkdir_p_IFS="$IFS"; IFS=':'
334
538
      for my_dir in $my_dir_list; do
378
582
        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
379
583
    fi
380
584
 
381
 
    $ECHO "X$my_tmpdir" | $Xsed
 
585
    $ECHO "$my_tmpdir"
382
586
}
383
587
 
384
588
 
392
596
{
393
597
    case $1 in
394
598
      *[\\\`\"\$]*)
395
 
        func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
 
599
        func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
396
600
      *)
397
601
        func_quote_for_eval_unquoted_result="$1" ;;
398
602
    esac
419
623
{
420
624
    case $1 in
421
625
      *[\\\`\"]*)
422
 
        my_arg=`$ECHO "X$1" | $Xsed \
 
626
        my_arg=`$ECHO "$1" | $SED \
423
627
            -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
424
628
      *)
425
629
        my_arg="$1" ;;
488
692
    fi
489
693
}
490
694
 
491
 
 
492
 
 
 
695
# func_tr_sh
 
696
# Turn $1 into a string suitable for a shell variable name.
 
697
# Result is stored in $func_tr_sh_result.  All characters
 
698
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
 
699
# if $1 begins with a digit, a '_' is prepended as well.
 
700
func_tr_sh ()
 
701
{
 
702
  case $1 in
 
703
  [0-9]* | *[!a-zA-Z0-9_]*)
 
704
    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
 
705
    ;;
 
706
  * )
 
707
    func_tr_sh_result=$1
 
708
    ;;
 
709
  esac
 
710
}
493
711
 
494
712
 
495
713
# func_version
496
714
# Echo version message to standard output and exit.
497
715
func_version ()
498
716
{
499
 
    $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
 
717
    $opt_debug
 
718
 
 
719
    $SED -n '/(C)/!b go
 
720
        :more
 
721
        /\./!{
 
722
          N
 
723
          s/\n# / /
 
724
          b more
 
725
        }
 
726
        :go
 
727
        /^# '$PROGRAM' (GNU /,/# warranty; / {
500
728
        s/^# //
501
729
        s/^# *$//
502
730
        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
509
737
# Echo short help message to standard output and exit.
510
738
func_usage ()
511
739
{
512
 
    $SED -n '/^# Usage:/,/# -h/ {
 
740
    $opt_debug
 
741
 
 
742
    $SED -n '/^# Usage:/,/^#  *.*--help/ {
513
743
        s/^# //
514
744
        s/^# *$//
515
745
        s/\$progname/'$progname'/
516
746
        p
517
747
    }' < "$progpath"
518
 
    $ECHO
 
748
    echo
519
749
    $ECHO "run \`$progname --help | more' for full usage"
520
750
    exit $?
521
751
}
522
752
 
523
 
# func_help
524
 
# Echo long help message to standard output and exit.
 
753
# func_help [NOEXIT]
 
754
# Echo long help message to standard output and exit,
 
755
# unless 'noexit' is passed as argument.
525
756
func_help ()
526
757
{
 
758
    $opt_debug
 
759
 
527
760
    $SED -n '/^# Usage:/,/# Report bugs to/ {
 
761
        :print
528
762
        s/^# //
529
763
        s/^# *$//
530
764
        s*\$progname*'$progname'*
534
768
        s*\$LTCFLAGS*'"$LTCFLAGS"'*
535
769
        s*\$LD*'"$LD"'*
536
770
        s/\$with_gnu_ld/'"$with_gnu_ld"'/
537
 
        s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
538
 
        s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
 
771
        s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
 
772
        s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
539
773
        p
540
 
     }' < "$progpath"
541
 
    exit $?
 
774
        d
 
775
     }
 
776
     /^# .* home page:/b print
 
777
     /^# General help using/b print
 
778
     ' < "$progpath"
 
779
    ret=$?
 
780
    if test -z "$1"; then
 
781
      exit $ret
 
782
    fi
542
783
}
543
784
 
544
785
# func_missing_arg argname
546
787
# exit_cmd.
547
788
func_missing_arg ()
548
789
{
549
 
    func_error "missing argument for $1"
 
790
    $opt_debug
 
791
 
 
792
    func_error "missing argument for $1."
550
793
    exit_cmd=exit
551
794
}
552
795
 
 
796
 
 
797
# func_split_short_opt shortopt
 
798
# Set func_split_short_opt_name and func_split_short_opt_arg shell
 
799
# variables after splitting SHORTOPT after the 2nd character.
 
800
func_split_short_opt ()
 
801
{
 
802
    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
 
803
    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
 
804
 
 
805
    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
 
806
    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
 
807
} # func_split_short_opt may be replaced by extended shell implementation
 
808
 
 
809
 
 
810
# func_split_long_opt longopt
 
811
# Set func_split_long_opt_name and func_split_long_opt_arg shell
 
812
# variables after splitting LONGOPT at the `=' sign.
 
813
func_split_long_opt ()
 
814
{
 
815
    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
 
816
    my_sed_long_arg='1s/^--[^=]*=//'
 
817
 
 
818
    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
 
819
    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
 
820
} # func_split_long_opt may be replaced by extended shell implementation
 
821
 
553
822
exit_cmd=:
554
823
 
555
824
 
556
825
 
557
826
 
558
827
 
559
 
# Check that we have a working $ECHO.
560
 
if test "X$1" = X--no-reexec; then
561
 
  # Discard the --no-reexec flag, and continue.
562
 
  shift
563
 
elif test "X$1" = X--fallback-echo; then
564
 
  # Avoid inline document here, it may be left over
565
 
  :
566
 
elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
567
 
  # Yippee, $ECHO works!
568
 
  :
569
 
else
570
 
  # Restart under the correct shell, and then maybe $ECHO will work.
571
 
  exec $SHELL "$progpath" --no-reexec ${1+"$@"}
572
 
fi
573
 
 
574
 
if test "X$1" = X--fallback-echo; then
575
 
  # used as fallback echo
576
 
  shift
577
 
  cat <<EOF
578
 
$*
579
 
EOF
580
 
  exit $EXIT_SUCCESS
581
 
fi
582
 
 
583
828
magic="%%%MAGIC variable%%%"
584
829
magic_exe="%%%MAGIC EXE variable%%%"
585
830
 
586
831
# Global variables.
587
 
# $mode is unset
588
832
nonopt=
589
 
execute_dlfiles=
590
833
preserve_args=
591
834
lo2o="s/\\.lo\$/.${objext}/"
592
835
o2lo="s/\\.${objext}\$/.lo/"
593
836
extracted_archives=
594
837
extracted_serial=0
595
838
 
596
 
opt_dry_run=false
597
 
opt_duplicate_deps=false
598
 
opt_silent=false
599
 
opt_debug=:
600
 
 
601
839
# If this variable is set in any of the actions, the command in it
602
840
# will be execed at the end.  This prevents here-documents from being
603
841
# left over by shells.
604
842
exec_cmd=
605
843
 
 
844
# func_append var value
 
845
# Append VALUE to the end of shell variable VAR.
 
846
func_append ()
 
847
{
 
848
    eval "${1}=\$${1}\${2}"
 
849
} # func_append may be replaced by extended shell implementation
 
850
 
 
851
# func_append_quoted var value
 
852
# Quote VALUE and append to the end of shell variable VAR, separated
 
853
# by a space.
 
854
func_append_quoted ()
 
855
{
 
856
    func_quote_for_eval "${2}"
 
857
    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
 
858
} # func_append_quoted may be replaced by extended shell implementation
 
859
 
 
860
 
 
861
# func_arith arithmetic-term...
 
862
func_arith ()
 
863
{
 
864
    func_arith_result=`expr "${@}"`
 
865
} # func_arith may be replaced by extended shell implementation
 
866
 
 
867
 
 
868
# func_len string
 
869
# STRING may not start with a hyphen.
 
870
func_len ()
 
871
{
 
872
    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
 
873
} # func_len may be replaced by extended shell implementation
 
874
 
 
875
 
 
876
# func_lo2o object
 
877
func_lo2o ()
 
878
{
 
879
    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
 
880
} # func_lo2o may be replaced by extended shell implementation
 
881
 
 
882
 
 
883
# func_xform libobj-or-source
 
884
func_xform ()
 
885
{
 
886
    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
 
887
} # func_xform may be replaced by extended shell implementation
 
888
 
 
889
 
606
890
# func_fatal_configuration arg...
607
891
# Echo program name prefixed message to standard error, followed by
608
892
# a configuration failure hint, and exit.
636
920
# Display the features supported by this script.
637
921
func_features ()
638
922
{
639
 
    $ECHO "host: $host"
 
923
    echo "host: $host"
640
924
    if test "$build_libtool_libs" = yes; then
641
 
      $ECHO "enable shared libraries"
 
925
      echo "enable shared libraries"
642
926
    else
643
 
      $ECHO "disable shared libraries"
 
927
      echo "disable shared libraries"
644
928
    fi
645
929
    if test "$build_old_libs" = yes; then
646
 
      $ECHO "enable static libraries"
 
930
      echo "enable static libraries"
647
931
    else
648
 
      $ECHO "disable static libraries"
 
932
      echo "disable static libraries"
649
933
    fi
650
934
 
651
935
    exit $?
692
976
  esac
693
977
}
694
978
 
695
 
# Parse options once, thoroughly.  This comes as soon as possible in
696
 
# the script to make things like `libtool --version' happen quickly.
697
 
{
698
 
 
699
 
  # Shorthand for --mode=foo, only valid as the first argument
700
 
  case $1 in
701
 
  clean|clea|cle|cl)
702
 
    shift; set dummy --mode clean ${1+"$@"}; shift
703
 
    ;;
704
 
  compile|compil|compi|comp|com|co|c)
705
 
    shift; set dummy --mode compile ${1+"$@"}; shift
706
 
    ;;
707
 
  execute|execut|execu|exec|exe|ex|e)
708
 
    shift; set dummy --mode execute ${1+"$@"}; shift
709
 
    ;;
710
 
  finish|finis|fini|fin|fi|f)
711
 
    shift; set dummy --mode finish ${1+"$@"}; shift
712
 
    ;;
713
 
  install|instal|insta|inst|ins|in|i)
714
 
    shift; set dummy --mode install ${1+"$@"}; shift
715
 
    ;;
716
 
  link|lin|li|l)
717
 
    shift; set dummy --mode link ${1+"$@"}; shift
718
 
    ;;
719
 
  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
720
 
    shift; set dummy --mode uninstall ${1+"$@"}; shift
721
 
    ;;
722
 
  esac
723
 
 
724
 
  # Parse non-mode specific arguments:
725
 
  while test "$#" -gt 0; do
726
 
    opt="$1"
727
 
    shift
728
 
 
729
 
    case $opt in
730
 
      --config)         func_config                                     ;;
731
 
 
732
 
      --debug)          preserve_args="$preserve_args $opt"
733
 
                        func_echo "enabling shell trace mode"
734
 
                        opt_debug='set -x'
735
 
                        $opt_debug
736
 
                        ;;
737
 
 
738
 
      -dlopen)          test "$#" -eq 0 && func_missing_arg "$opt" && break
739
 
                        execute_dlfiles="$execute_dlfiles $1"
740
 
                        shift
741
 
                        ;;
742
 
 
743
 
      --dry-run | -n)   opt_dry_run=:                                   ;;
744
 
      --features)       func_features                                   ;;
745
 
      --finish)         mode="finish"                                   ;;
746
 
 
747
 
      --mode)           test "$#" -eq 0 && func_missing_arg "$opt" && break
748
 
                        case $1 in
749
 
                          # Valid mode arguments:
750
 
                          clean)        ;;
751
 
                          compile)      ;;
752
 
                          execute)      ;;
753
 
                          finish)       ;;
754
 
                          install)      ;;
755
 
                          link)         ;;
756
 
                          relink)       ;;
757
 
                          uninstall)    ;;
758
 
 
759
 
                          # Catch anything else as an error
760
 
                          *) func_error "invalid argument for $opt"
761
 
                             exit_cmd=exit
762
 
                             break
763
 
                             ;;
764
 
                        esac
765
 
 
766
 
                        mode="$1"
767
 
                        shift
768
 
                        ;;
769
 
 
770
 
      --preserve-dup-deps)
771
 
                        opt_duplicate_deps=:                            ;;
772
 
 
773
 
      --quiet|--silent) preserve_args="$preserve_args $opt"
774
 
                        opt_silent=:
775
 
                        ;;
776
 
 
777
 
      --verbose| -v)    preserve_args="$preserve_args $opt"
778
 
                        opt_silent=false
779
 
                        ;;
780
 
 
781
 
      --tag)            test "$#" -eq 0 && func_missing_arg "$opt" && break
782
 
                        preserve_args="$preserve_args $opt $1"
783
 
                        func_enable_tag "$1"    # tagname is set here
784
 
                        shift
785
 
                        ;;
786
 
 
787
 
      # Separate optargs to long options:
788
 
      -dlopen=*|--mode=*|--tag=*)
789
 
                        func_opt_split "$opt"
790
 
                        set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
791
 
                        shift
792
 
                        ;;
793
 
 
794
 
      -\?|-h)           func_usage                                      ;;
795
 
      --help)           opt_help=:                                      ;;
796
 
      --version)        func_version                                    ;;
797
 
 
798
 
      -*)               func_fatal_help "unrecognized option \`$opt'"   ;;
799
 
 
800
 
      *)                nonopt="$opt"
801
 
                        break
802
 
                        ;;
803
 
    esac
804
 
  done
805
 
 
806
 
 
807
 
  case $host in
808
 
    *cygwin* | *mingw* | *pw32* | *cegcc*)
809
 
      # don't eliminate duplications in $postdeps and $predeps
810
 
      opt_duplicate_compiler_generated_deps=:
811
 
      ;;
812
 
    *)
813
 
      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
814
 
      ;;
815
 
  esac
816
 
 
817
 
  # Having warned about all mis-specified options, bail out if
818
 
  # anything was wrong.
819
 
  $exit_cmd $EXIT_FAILURE
820
 
}
821
 
 
822
979
# func_check_version_match
823
980
# Ensure that we are using m4 macros, and libtool script from the same
824
981
# release of libtool.
855
1012
}
856
1013
 
857
1014
 
 
1015
# Shorthand for --mode=foo, only valid as the first argument
 
1016
case $1 in
 
1017
clean|clea|cle|cl)
 
1018
  shift; set dummy --mode clean ${1+"$@"}; shift
 
1019
  ;;
 
1020
compile|compil|compi|comp|com|co|c)
 
1021
  shift; set dummy --mode compile ${1+"$@"}; shift
 
1022
  ;;
 
1023
execute|execut|execu|exec|exe|ex|e)
 
1024
  shift; set dummy --mode execute ${1+"$@"}; shift
 
1025
  ;;
 
1026
finish|finis|fini|fin|fi|f)
 
1027
  shift; set dummy --mode finish ${1+"$@"}; shift
 
1028
  ;;
 
1029
install|instal|insta|inst|ins|in|i)
 
1030
  shift; set dummy --mode install ${1+"$@"}; shift
 
1031
  ;;
 
1032
link|lin|li|l)
 
1033
  shift; set dummy --mode link ${1+"$@"}; shift
 
1034
  ;;
 
1035
uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
 
1036
  shift; set dummy --mode uninstall ${1+"$@"}; shift
 
1037
  ;;
 
1038
esac
 
1039
 
 
1040
 
 
1041
 
 
1042
# Option defaults:
 
1043
opt_debug=:
 
1044
opt_dry_run=false
 
1045
opt_config=false
 
1046
opt_preserve_dup_deps=false
 
1047
opt_features=false
 
1048
opt_finish=false
 
1049
opt_help=false
 
1050
opt_help_all=false
 
1051
opt_silent=:
 
1052
opt_warning=:
 
1053
opt_verbose=:
 
1054
opt_silent=false
 
1055
opt_verbose=false
 
1056
 
 
1057
 
 
1058
# Parse options once, thoroughly.  This comes as soon as possible in the
 
1059
# script to make things like `--version' happen as quickly as we can.
 
1060
{
 
1061
  # this just eases exit handling
 
1062
  while test $# -gt 0; do
 
1063
    opt="$1"
 
1064
    shift
 
1065
    case $opt in
 
1066
      --debug|-x)       opt_debug='set -x'
 
1067
                        func_echo "enabling shell trace mode"
 
1068
                        $opt_debug
 
1069
                        ;;
 
1070
      --dry-run|--dryrun|-n)
 
1071
                        opt_dry_run=:
 
1072
                        ;;
 
1073
      --config)
 
1074
                        opt_config=:
 
1075
func_config
 
1076
                        ;;
 
1077
      --dlopen|-dlopen)
 
1078
                        optarg="$1"
 
1079
                        opt_dlopen="${opt_dlopen+$opt_dlopen
 
1080
}$optarg"
 
1081
                        shift
 
1082
                        ;;
 
1083
      --preserve-dup-deps)
 
1084
                        opt_preserve_dup_deps=:
 
1085
                        ;;
 
1086
      --features)
 
1087
                        opt_features=:
 
1088
func_features
 
1089
                        ;;
 
1090
      --finish)
 
1091
                        opt_finish=:
 
1092
set dummy --mode finish ${1+"$@"}; shift
 
1093
                        ;;
 
1094
      --help)
 
1095
                        opt_help=:
 
1096
                        ;;
 
1097
      --help-all)
 
1098
                        opt_help_all=:
 
1099
opt_help=': help-all'
 
1100
                        ;;
 
1101
      --mode)
 
1102
                        test $# = 0 && func_missing_arg $opt && break
 
1103
                        optarg="$1"
 
1104
                        opt_mode="$optarg"
 
1105
case $optarg in
 
1106
  # Valid mode arguments:
 
1107
  clean|compile|execute|finish|install|link|relink|uninstall) ;;
 
1108
 
 
1109
  # Catch anything else as an error
 
1110
  *) func_error "invalid argument for $opt"
 
1111
     exit_cmd=exit
 
1112
     break
 
1113
     ;;
 
1114
esac
 
1115
                        shift
 
1116
                        ;;
 
1117
      --no-silent|--no-quiet)
 
1118
                        opt_silent=false
 
1119
func_append preserve_args " $opt"
 
1120
                        ;;
 
1121
      --no-warning|--no-warn)
 
1122
                        opt_warning=false
 
1123
func_append preserve_args " $opt"
 
1124
                        ;;
 
1125
      --no-verbose)
 
1126
                        opt_verbose=false
 
1127
func_append preserve_args " $opt"
 
1128
                        ;;
 
1129
      --silent|--quiet)
 
1130
                        opt_silent=:
 
1131
func_append preserve_args " $opt"
 
1132
        opt_verbose=false
 
1133
                        ;;
 
1134
      --verbose|-v)
 
1135
                        opt_verbose=:
 
1136
func_append preserve_args " $opt"
 
1137
opt_silent=false
 
1138
                        ;;
 
1139
      --tag)
 
1140
                        test $# = 0 && func_missing_arg $opt && break
 
1141
                        optarg="$1"
 
1142
                        opt_tag="$optarg"
 
1143
func_append preserve_args " $opt $optarg"
 
1144
func_enable_tag "$optarg"
 
1145
                        shift
 
1146
                        ;;
 
1147
 
 
1148
      -\?|-h)           func_usage                              ;;
 
1149
      --help)           func_help                               ;;
 
1150
      --version)        func_version                            ;;
 
1151
 
 
1152
      # Separate optargs to long options:
 
1153
      --*=*)
 
1154
                        func_split_long_opt "$opt"
 
1155
                        set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
 
1156
                        shift
 
1157
                        ;;
 
1158
 
 
1159
      # Separate non-argument short options:
 
1160
      -\?*|-h*|-n*|-v*)
 
1161
                        func_split_short_opt "$opt"
 
1162
                        set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
 
1163
                        shift
 
1164
                        ;;
 
1165
 
 
1166
      --)               break                                   ;;
 
1167
      -*)               func_fatal_help "unrecognized option \`$opt'" ;;
 
1168
      *)                set dummy "$opt" ${1+"$@"};     shift; break  ;;
 
1169
    esac
 
1170
  done
 
1171
 
 
1172
  # Validate options:
 
1173
 
 
1174
  # save first non-option argument
 
1175
  if test "$#" -gt 0; then
 
1176
    nonopt="$opt"
 
1177
    shift
 
1178
  fi
 
1179
 
 
1180
  # preserve --debug
 
1181
  test "$opt_debug" = : || func_append preserve_args " --debug"
 
1182
 
 
1183
  case $host in
 
1184
    *cygwin* | *mingw* | *pw32* | *cegcc*)
 
1185
      # don't eliminate duplications in $postdeps and $predeps
 
1186
      opt_duplicate_compiler_generated_deps=:
 
1187
      ;;
 
1188
    *)
 
1189
      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
 
1190
      ;;
 
1191
  esac
 
1192
 
 
1193
  $opt_help || {
 
1194
    # Sanity checks first:
 
1195
    func_check_version_match
 
1196
 
 
1197
    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
 
1198
      func_fatal_configuration "not configured to build any kind of library"
 
1199
    fi
 
1200
 
 
1201
    # Darwin sucks
 
1202
    eval std_shrext=\"$shrext_cmds\"
 
1203
 
 
1204
    # Only execute mode is allowed to have -dlopen flags.
 
1205
    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
 
1206
      func_error "unrecognized option \`-dlopen'"
 
1207
      $ECHO "$help" 1>&2
 
1208
      exit $EXIT_FAILURE
 
1209
    fi
 
1210
 
 
1211
    # Change the help message to a mode-specific one.
 
1212
    generic_help="$help"
 
1213
    help="Try \`$progname --help --mode=$opt_mode' for more information."
 
1214
  }
 
1215
 
 
1216
 
 
1217
  # Bail if the options were screwed
 
1218
  $exit_cmd $EXIT_FAILURE
 
1219
}
 
1220
 
 
1221
 
 
1222
 
 
1223
 
858
1224
## ----------- ##
859
1225
##    Main.    ##
860
1226
## ----------- ##
861
1227
 
862
 
$opt_help || {
863
 
  # Sanity checks first:
864
 
  func_check_version_match
865
 
 
866
 
  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
867
 
    func_fatal_configuration "not configured to build any kind of library"
868
 
  fi
869
 
 
870
 
  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
871
 
 
872
 
 
873
 
  # Darwin sucks
874
 
  eval std_shrext=\"$shrext_cmds\"
875
 
 
876
 
 
877
 
  # Only execute mode is allowed to have -dlopen flags.
878
 
  if test -n "$execute_dlfiles" && test "$mode" != execute; then
879
 
    func_error "unrecognized option \`-dlopen'"
880
 
    $ECHO "$help" 1>&2
881
 
    exit $EXIT_FAILURE
882
 
  fi
883
 
 
884
 
  # Change the help message to a mode-specific one.
885
 
  generic_help="$help"
886
 
  help="Try \`$progname --help --mode=$mode' for more information."
 
1228
# func_try_sizelim file n
 
1229
# try to write at most the first N bytes from FILE to the standard output when
 
1230
# possible, otherwise put whole file
 
1231
func_try_sizelim ()
 
1232
{
 
1233
  if test -n "$DD"; then
 
1234
    $DD if="$1" bs=$2 count=1 2>/dev/null
 
1235
    if test $? -eq 127; then
 
1236
      cat "$1" 2>/dev/null
 
1237
    fi
 
1238
  else
 
1239
    cat "$1" 2>/dev/null
 
1240
  fi
887
1241
}
888
1242
 
889
 
 
890
1243
# func_lalib_p file
891
1244
# True iff FILE is a libtool `.la' library or `.lo' object file.
892
1245
# This function is only a basic sanity check; it will hardly flush out
894
1247
func_lalib_p ()
895
1248
{
896
1249
    test -f "$1" &&
897
 
      $SED -e 4q "$1" 2>/dev/null \
 
1250
      func_try_sizelim "$1" 4096 | $SED -e 4q 2>/dev/null \
898
1251
        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
899
1252
}
900
1253
 
950
1303
# temporary ltwrapper_script.
951
1304
func_ltwrapper_scriptname ()
952
1305
{
953
 
    func_ltwrapper_scriptname_result=""
954
 
    if func_ltwrapper_executable_p "$1"; then
955
 
        func_dirname_and_basename "$1" "" "."
956
 
        func_stripname '' '.exe' "$func_basename_result"
957
 
        func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
958
 
    fi
 
1306
    func_dirname_and_basename "$1" "" "."
 
1307
    func_stripname '' '.exe' "$func_basename_result"
 
1308
    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
959
1309
}
960
1310
 
961
1311
# func_ltwrapper_p file
1001
1351
}
1002
1352
 
1003
1353
 
 
1354
# func_resolve_sysroot PATH
 
1355
# Replace a leading = in PATH with a sysroot.  Store the result into
 
1356
# func_resolve_sysroot_result
 
1357
func_resolve_sysroot ()
 
1358
{
 
1359
  func_resolve_sysroot_result=$1
 
1360
  case $func_resolve_sysroot_result in
 
1361
  =*)
 
1362
    func_stripname '=' '' "$func_resolve_sysroot_result"
 
1363
    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
 
1364
    ;;
 
1365
  esac
 
1366
}
 
1367
 
 
1368
# func_replace_sysroot PATH
 
1369
# If PATH begins with the sysroot, replace it with = and
 
1370
# store the result into func_replace_sysroot_result.
 
1371
func_replace_sysroot ()
 
1372
{
 
1373
  case "$lt_sysroot:$1" in
 
1374
  ?*:"$lt_sysroot"*)
 
1375
    func_stripname "$lt_sysroot" '' "$1"
 
1376
    func_replace_sysroot_result="=$func_stripname_result"
 
1377
    ;;
 
1378
  *)
 
1379
    # Including no sysroot.
 
1380
    func_replace_sysroot_result=$1
 
1381
    ;;
 
1382
  esac
 
1383
}
 
1384
 
1004
1385
# func_infer_tag arg
1005
1386
# Infer tagged configuration to use if any are available and
1006
1387
# if one wasn't chosen via the "--tag" command line option.
1013
1394
    if test -n "$available_tags" && test -z "$tagname"; then
1014
1395
      CC_quoted=
1015
1396
      for arg in $CC; do
1016
 
        func_quote_for_eval "$arg"
1017
 
        CC_quoted="$CC_quoted $func_quote_for_eval_result"
 
1397
        func_append_quoted CC_quoted "$arg"
1018
1398
      done
 
1399
      CC_expanded=`func_echo_all $CC`
 
1400
      CC_quoted_expanded=`func_echo_all $CC_quoted`
1019
1401
      case $@ in
1020
1402
      # Blanks in the command may have been stripped by the calling shell,
1021
1403
      # but not from the CC environment variable when configure was run.
1022
 
      " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
 
1404
      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
 
1405
      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1023
1406
      # Blanks at the start of $base_compile will cause this to fail
1024
1407
      # if we don't check for them as well.
1025
1408
      *)
1030
1413
            CC_quoted=
1031
1414
            for arg in $CC; do
1032
1415
              # Double-quote args containing other shell metacharacters.
1033
 
              func_quote_for_eval "$arg"
1034
 
              CC_quoted="$CC_quoted $func_quote_for_eval_result"
 
1416
              func_append_quoted CC_quoted "$arg"
1035
1417
            done
 
1418
            CC_expanded=`func_echo_all $CC`
 
1419
            CC_quoted_expanded=`func_echo_all $CC_quoted`
1036
1420
            case "$@ " in
1037
 
              " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
 
1421
            " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
 
1422
            " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1038
1423
              # The compiler in the base compile command matches
1039
1424
              # the one in the tagged configuration.
1040
1425
              # Assume this is the tagged configuration we want.
1097
1482
    }
1098
1483
}
1099
1484
 
 
1485
 
 
1486
##################################################
 
1487
# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
 
1488
##################################################
 
1489
 
 
1490
# func_convert_core_file_wine_to_w32 ARG
 
1491
# Helper function used by file name conversion functions when $build is *nix,
 
1492
# and $host is mingw, cygwin, or some other w32 environment. Relies on a
 
1493
# correctly configured wine environment available, with the winepath program
 
1494
# in $build's $PATH.
 
1495
#
 
1496
# ARG is the $build file name to be converted to w32 format.
 
1497
# Result is available in $func_convert_core_file_wine_to_w32_result, and will
 
1498
# be empty on error (or when ARG is empty)
 
1499
func_convert_core_file_wine_to_w32 ()
 
1500
{
 
1501
  $opt_debug
 
1502
  func_convert_core_file_wine_to_w32_result="$1"
 
1503
  if test -n "$1"; then
 
1504
    # Unfortunately, winepath does not exit with a non-zero error code, so we
 
1505
    # are forced to check the contents of stdout. On the other hand, if the
 
1506
    # command is not found, the shell will set an exit code of 127 and print
 
1507
    # *an error message* to stdout. So we must check for both error code of
 
1508
    # zero AND non-empty stdout, which explains the odd construction:
 
1509
    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
 
1510
    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
 
1511
      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
 
1512
        $SED -e "$lt_sed_naive_backslashify"`
 
1513
    else
 
1514
      func_convert_core_file_wine_to_w32_result=
 
1515
    fi
 
1516
  fi
 
1517
}
 
1518
# end: func_convert_core_file_wine_to_w32
 
1519
 
 
1520
 
 
1521
# func_convert_core_path_wine_to_w32 ARG
 
1522
# Helper function used by path conversion functions when $build is *nix, and
 
1523
# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
 
1524
# configured wine environment available, with the winepath program in $build's
 
1525
# $PATH. Assumes ARG has no leading or trailing path separator characters.
 
1526
#
 
1527
# ARG is path to be converted from $build format to win32.
 
1528
# Result is available in $func_convert_core_path_wine_to_w32_result.
 
1529
# Unconvertible file (directory) names in ARG are skipped; if no directory names
 
1530
# are convertible, then the result may be empty.
 
1531
func_convert_core_path_wine_to_w32 ()
 
1532
{
 
1533
  $opt_debug
 
1534
  # unfortunately, winepath doesn't convert paths, only file names
 
1535
  func_convert_core_path_wine_to_w32_result=""
 
1536
  if test -n "$1"; then
 
1537
    oldIFS=$IFS
 
1538
    IFS=:
 
1539
    for func_convert_core_path_wine_to_w32_f in $1; do
 
1540
      IFS=$oldIFS
 
1541
      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
 
1542
      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
 
1543
        if test -z "$func_convert_core_path_wine_to_w32_result"; then
 
1544
          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
 
1545
        else
 
1546
          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
 
1547
        fi
 
1548
      fi
 
1549
    done
 
1550
    IFS=$oldIFS
 
1551
  fi
 
1552
}
 
1553
# end: func_convert_core_path_wine_to_w32
 
1554
 
 
1555
 
 
1556
# func_cygpath ARGS...
 
1557
# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
 
1558
# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
 
1559
# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
 
1560
# (2), returns the Cygwin file name or path in func_cygpath_result (input
 
1561
# file name or path is assumed to be in w32 format, as previously converted
 
1562
# from $build's *nix or MSYS format). In case (3), returns the w32 file name
 
1563
# or path in func_cygpath_result (input file name or path is assumed to be in
 
1564
# Cygwin format). Returns an empty string on error.
 
1565
#
 
1566
# ARGS are passed to cygpath, with the last one being the file name or path to
 
1567
# be converted.
 
1568
#
 
1569
# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
 
1570
# environment variable; do not put it in $PATH.
 
1571
func_cygpath ()
 
1572
{
 
1573
  $opt_debug
 
1574
  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
 
1575
    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
 
1576
    if test "$?" -ne 0; then
 
1577
      # on failure, ensure result is empty
 
1578
      func_cygpath_result=
 
1579
    fi
 
1580
  else
 
1581
    func_cygpath_result=
 
1582
    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
 
1583
  fi
 
1584
}
 
1585
#end: func_cygpath
 
1586
 
 
1587
 
 
1588
# func_convert_core_msys_to_w32 ARG
 
1589
# Convert file name or path ARG from MSYS format to w32 format.  Return
 
1590
# result in func_convert_core_msys_to_w32_result.
 
1591
func_convert_core_msys_to_w32 ()
 
1592
{
 
1593
  $opt_debug
 
1594
  # awkward: cmd appends spaces to result
 
1595
  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
 
1596
    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
 
1597
}
 
1598
#end: func_convert_core_msys_to_w32
 
1599
 
 
1600
 
 
1601
# func_convert_file_check ARG1 ARG2
 
1602
# Verify that ARG1 (a file name in $build format) was converted to $host
 
1603
# format in ARG2. Otherwise, emit an error message, but continue (resetting
 
1604
# func_to_host_file_result to ARG1).
 
1605
func_convert_file_check ()
 
1606
{
 
1607
  $opt_debug
 
1608
  if test -z "$2" && test -n "$1" ; then
 
1609
    func_error "Could not determine host file name corresponding to"
 
1610
    func_error "  \`$1'"
 
1611
    func_error "Continuing, but uninstalled executables may not work."
 
1612
    # Fallback:
 
1613
    func_to_host_file_result="$1"
 
1614
  fi
 
1615
}
 
1616
# end func_convert_file_check
 
1617
 
 
1618
 
 
1619
# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
 
1620
# Verify that FROM_PATH (a path in $build format) was converted to $host
 
1621
# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
 
1622
# func_to_host_file_result to a simplistic fallback value (see below).
 
1623
func_convert_path_check ()
 
1624
{
 
1625
  $opt_debug
 
1626
  if test -z "$4" && test -n "$3"; then
 
1627
    func_error "Could not determine the host path corresponding to"
 
1628
    func_error "  \`$3'"
 
1629
    func_error "Continuing, but uninstalled executables may not work."
 
1630
    # Fallback.  This is a deliberately simplistic "conversion" and
 
1631
    # should not be "improved".  See libtool.info.
 
1632
    if test "x$1" != "x$2"; then
 
1633
      lt_replace_pathsep_chars="s|$1|$2|g"
 
1634
      func_to_host_path_result=`echo "$3" |
 
1635
        $SED -e "$lt_replace_pathsep_chars"`
 
1636
    else
 
1637
      func_to_host_path_result="$3"
 
1638
    fi
 
1639
  fi
 
1640
}
 
1641
# end func_convert_path_check
 
1642
 
 
1643
 
 
1644
# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
 
1645
# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
 
1646
# and appending REPL if ORIG matches BACKPAT.
 
1647
func_convert_path_front_back_pathsep ()
 
1648
{
 
1649
  $opt_debug
 
1650
  case $4 in
 
1651
  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
 
1652
    ;;
 
1653
  esac
 
1654
  case $4 in
 
1655
  $2 ) func_append func_to_host_path_result "$3"
 
1656
    ;;
 
1657
  esac
 
1658
}
 
1659
# end func_convert_path_front_back_pathsep
 
1660
 
 
1661
 
 
1662
##################################################
 
1663
# $build to $host FILE NAME CONVERSION FUNCTIONS #
 
1664
##################################################
 
1665
# invoked via `$to_host_file_cmd ARG'
 
1666
#
 
1667
# In each case, ARG is the path to be converted from $build to $host format.
 
1668
# Result will be available in $func_to_host_file_result.
 
1669
 
 
1670
 
 
1671
# func_to_host_file ARG
 
1672
# Converts the file name ARG from $build format to $host format. Return result
 
1673
# in func_to_host_file_result.
 
1674
func_to_host_file ()
 
1675
{
 
1676
  $opt_debug
 
1677
  $to_host_file_cmd "$1"
 
1678
}
 
1679
# end func_to_host_file
 
1680
 
 
1681
 
 
1682
# func_to_tool_file ARG LAZY
 
1683
# converts the file name ARG from $build format to toolchain format. Return
 
1684
# result in func_to_tool_file_result.  If the conversion in use is listed
 
1685
# in (the comma separated) LAZY, no conversion takes place.
 
1686
func_to_tool_file ()
 
1687
{
 
1688
  $opt_debug
 
1689
  case ,$2, in
 
1690
    *,"$to_tool_file_cmd",*)
 
1691
      func_to_tool_file_result=$1
 
1692
      ;;
 
1693
    *)
 
1694
      $to_tool_file_cmd "$1"
 
1695
      func_to_tool_file_result=$func_to_host_file_result
 
1696
      ;;
 
1697
  esac
 
1698
}
 
1699
# end func_to_tool_file
 
1700
 
 
1701
 
 
1702
# func_convert_file_noop ARG
 
1703
# Copy ARG to func_to_host_file_result.
 
1704
func_convert_file_noop ()
 
1705
{
 
1706
  func_to_host_file_result="$1"
 
1707
}
 
1708
# end func_convert_file_noop
 
1709
 
 
1710
 
 
1711
# func_convert_file_msys_to_w32 ARG
 
1712
# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
 
1713
# conversion to w32 is not available inside the cwrapper.  Returns result in
 
1714
# func_to_host_file_result.
 
1715
func_convert_file_msys_to_w32 ()
 
1716
{
 
1717
  $opt_debug
 
1718
  func_to_host_file_result="$1"
 
1719
  if test -n "$1"; then
 
1720
    func_convert_core_msys_to_w32 "$1"
 
1721
    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
 
1722
  fi
 
1723
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1724
}
 
1725
# end func_convert_file_msys_to_w32
 
1726
 
 
1727
 
 
1728
# func_convert_file_cygwin_to_w32 ARG
 
1729
# Convert file name ARG from Cygwin to w32 format.  Returns result in
 
1730
# func_to_host_file_result.
 
1731
func_convert_file_cygwin_to_w32 ()
 
1732
{
 
1733
  $opt_debug
 
1734
  func_to_host_file_result="$1"
 
1735
  if test -n "$1"; then
 
1736
    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
 
1737
    # LT_CYGPATH in this case.
 
1738
    func_to_host_file_result=`cygpath -m "$1"`
 
1739
  fi
 
1740
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1741
}
 
1742
# end func_convert_file_cygwin_to_w32
 
1743
 
 
1744
 
 
1745
# func_convert_file_nix_to_w32 ARG
 
1746
# Convert file name ARG from *nix to w32 format.  Requires a wine environment
 
1747
# and a working winepath. Returns result in func_to_host_file_result.
 
1748
func_convert_file_nix_to_w32 ()
 
1749
{
 
1750
  $opt_debug
 
1751
  func_to_host_file_result="$1"
 
1752
  if test -n "$1"; then
 
1753
    func_convert_core_file_wine_to_w32 "$1"
 
1754
    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
 
1755
  fi
 
1756
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1757
}
 
1758
# end func_convert_file_nix_to_w32
 
1759
 
 
1760
 
 
1761
# func_convert_file_msys_to_cygwin ARG
 
1762
# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
 
1763
# Returns result in func_to_host_file_result.
 
1764
func_convert_file_msys_to_cygwin ()
 
1765
{
 
1766
  $opt_debug
 
1767
  func_to_host_file_result="$1"
 
1768
  if test -n "$1"; then
 
1769
    func_convert_core_msys_to_w32 "$1"
 
1770
    func_cygpath -u "$func_convert_core_msys_to_w32_result"
 
1771
    func_to_host_file_result="$func_cygpath_result"
 
1772
  fi
 
1773
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1774
}
 
1775
# end func_convert_file_msys_to_cygwin
 
1776
 
 
1777
 
 
1778
# func_convert_file_nix_to_cygwin ARG
 
1779
# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
 
1780
# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
 
1781
# in func_to_host_file_result.
 
1782
func_convert_file_nix_to_cygwin ()
 
1783
{
 
1784
  $opt_debug
 
1785
  func_to_host_file_result="$1"
 
1786
  if test -n "$1"; then
 
1787
    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
 
1788
    func_convert_core_file_wine_to_w32 "$1"
 
1789
    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
 
1790
    func_to_host_file_result="$func_cygpath_result"
 
1791
  fi
 
1792
  func_convert_file_check "$1" "$func_to_host_file_result"
 
1793
}
 
1794
# end func_convert_file_nix_to_cygwin
 
1795
 
 
1796
 
 
1797
#############################################
 
1798
# $build to $host PATH CONVERSION FUNCTIONS #
 
1799
#############################################
 
1800
# invoked via `$to_host_path_cmd ARG'
 
1801
#
 
1802
# In each case, ARG is the path to be converted from $build to $host format.
 
1803
# The result will be available in $func_to_host_path_result.
 
1804
#
 
1805
# Path separators are also converted from $build format to $host format.  If
 
1806
# ARG begins or ends with a path separator character, it is preserved (but
 
1807
# converted to $host format) on output.
 
1808
#
 
1809
# All path conversion functions are named using the following convention:
 
1810
#   file name conversion function    : func_convert_file_X_to_Y ()
 
1811
#   path conversion function         : func_convert_path_X_to_Y ()
 
1812
# where, for any given $build/$host combination the 'X_to_Y' value is the
 
1813
# same.  If conversion functions are added for new $build/$host combinations,
 
1814
# the two new functions must follow this pattern, or func_init_to_host_path_cmd
 
1815
# will break.
 
1816
 
 
1817
 
 
1818
# func_init_to_host_path_cmd
 
1819
# Ensures that function "pointer" variable $to_host_path_cmd is set to the
 
1820
# appropriate value, based on the value of $to_host_file_cmd.
 
1821
to_host_path_cmd=
 
1822
func_init_to_host_path_cmd ()
 
1823
{
 
1824
  $opt_debug
 
1825
  if test -z "$to_host_path_cmd"; then
 
1826
    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
 
1827
    to_host_path_cmd="func_convert_path_${func_stripname_result}"
 
1828
  fi
 
1829
}
 
1830
 
 
1831
 
 
1832
# func_to_host_path ARG
 
1833
# Converts the path ARG from $build format to $host format. Return result
 
1834
# in func_to_host_path_result.
 
1835
func_to_host_path ()
 
1836
{
 
1837
  $opt_debug
 
1838
  func_init_to_host_path_cmd
 
1839
  $to_host_path_cmd "$1"
 
1840
}
 
1841
# end func_to_host_path
 
1842
 
 
1843
 
 
1844
# func_convert_path_noop ARG
 
1845
# Copy ARG to func_to_host_path_result.
 
1846
func_convert_path_noop ()
 
1847
{
 
1848
  func_to_host_path_result="$1"
 
1849
}
 
1850
# end func_convert_path_noop
 
1851
 
 
1852
 
 
1853
# func_convert_path_msys_to_w32 ARG
 
1854
# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
 
1855
# conversion to w32 is not available inside the cwrapper.  Returns result in
 
1856
# func_to_host_path_result.
 
1857
func_convert_path_msys_to_w32 ()
 
1858
{
 
1859
  $opt_debug
 
1860
  func_to_host_path_result="$1"
 
1861
  if test -n "$1"; then
 
1862
    # Remove leading and trailing path separator characters from ARG.  MSYS
 
1863
    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
 
1864
    # and winepath ignores them completely.
 
1865
    func_stripname : : "$1"
 
1866
    func_to_host_path_tmp1=$func_stripname_result
 
1867
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
 
1868
    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
 
1869
    func_convert_path_check : ";" \
 
1870
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1871
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
 
1872
  fi
 
1873
}
 
1874
# end func_convert_path_msys_to_w32
 
1875
 
 
1876
 
 
1877
# func_convert_path_cygwin_to_w32 ARG
 
1878
# Convert path ARG from Cygwin to w32 format.  Returns result in
 
1879
# func_to_host_file_result.
 
1880
func_convert_path_cygwin_to_w32 ()
 
1881
{
 
1882
  $opt_debug
 
1883
  func_to_host_path_result="$1"
 
1884
  if test -n "$1"; then
 
1885
    # See func_convert_path_msys_to_w32:
 
1886
    func_stripname : : "$1"
 
1887
    func_to_host_path_tmp1=$func_stripname_result
 
1888
    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
 
1889
    func_convert_path_check : ";" \
 
1890
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1891
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
 
1892
  fi
 
1893
}
 
1894
# end func_convert_path_cygwin_to_w32
 
1895
 
 
1896
 
 
1897
# func_convert_path_nix_to_w32 ARG
 
1898
# Convert path ARG from *nix to w32 format.  Requires a wine environment and
 
1899
# a working winepath.  Returns result in func_to_host_file_result.
 
1900
func_convert_path_nix_to_w32 ()
 
1901
{
 
1902
  $opt_debug
 
1903
  func_to_host_path_result="$1"
 
1904
  if test -n "$1"; then
 
1905
    # See func_convert_path_msys_to_w32:
 
1906
    func_stripname : : "$1"
 
1907
    func_to_host_path_tmp1=$func_stripname_result
 
1908
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
 
1909
    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
 
1910
    func_convert_path_check : ";" \
 
1911
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1912
    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
 
1913
  fi
 
1914
}
 
1915
# end func_convert_path_nix_to_w32
 
1916
 
 
1917
 
 
1918
# func_convert_path_msys_to_cygwin ARG
 
1919
# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
 
1920
# Returns result in func_to_host_file_result.
 
1921
func_convert_path_msys_to_cygwin ()
 
1922
{
 
1923
  $opt_debug
 
1924
  func_to_host_path_result="$1"
 
1925
  if test -n "$1"; then
 
1926
    # See func_convert_path_msys_to_w32:
 
1927
    func_stripname : : "$1"
 
1928
    func_to_host_path_tmp1=$func_stripname_result
 
1929
    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
 
1930
    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
 
1931
    func_to_host_path_result="$func_cygpath_result"
 
1932
    func_convert_path_check : : \
 
1933
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1934
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
 
1935
  fi
 
1936
}
 
1937
# end func_convert_path_msys_to_cygwin
 
1938
 
 
1939
 
 
1940
# func_convert_path_nix_to_cygwin ARG
 
1941
# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
 
1942
# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
 
1943
# func_to_host_file_result.
 
1944
func_convert_path_nix_to_cygwin ()
 
1945
{
 
1946
  $opt_debug
 
1947
  func_to_host_path_result="$1"
 
1948
  if test -n "$1"; then
 
1949
    # Remove leading and trailing path separator characters from
 
1950
    # ARG. msys behavior is inconsistent here, cygpath turns them
 
1951
    # into '.;' and ';.', and winepath ignores them completely.
 
1952
    func_stripname : : "$1"
 
1953
    func_to_host_path_tmp1=$func_stripname_result
 
1954
    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
 
1955
    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
 
1956
    func_to_host_path_result="$func_cygpath_result"
 
1957
    func_convert_path_check : : \
 
1958
      "$func_to_host_path_tmp1" "$func_to_host_path_result"
 
1959
    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
 
1960
  fi
 
1961
}
 
1962
# end func_convert_path_nix_to_cygwin
 
1963
 
 
1964
 
1100
1965
# func_mode_compile arg...
1101
1966
func_mode_compile ()
1102
1967
{
1137
2002
          ;;
1138
2003
 
1139
2004
        -pie | -fpie | -fPIE)
1140
 
          pie_flag="$pie_flag $arg"
 
2005
          func_append pie_flag " $arg"
1141
2006
          continue
1142
2007
          ;;
1143
2008
 
1144
2009
        -shared | -static | -prefer-pic | -prefer-non-pic)
1145
 
          later="$later $arg"
 
2010
          func_append later " $arg"
1146
2011
          continue
1147
2012
          ;;
1148
2013
 
1163
2028
          save_ifs="$IFS"; IFS=','
1164
2029
          for arg in $args; do
1165
2030
            IFS="$save_ifs"
1166
 
            func_quote_for_eval "$arg"
1167
 
            lastarg="$lastarg $func_quote_for_eval_result"
 
2031
            func_append_quoted lastarg "$arg"
1168
2032
          done
1169
2033
          IFS="$save_ifs"
1170
2034
          func_stripname ' ' '' "$lastarg"
1171
2035
          lastarg=$func_stripname_result
1172
2036
 
1173
2037
          # Add the arguments to base_compile.
1174
 
          base_compile="$base_compile $lastarg"
 
2038
          func_append base_compile " $lastarg"
1175
2039
          continue
1176
2040
          ;;
1177
2041
 
1187
2051
      esac    #  case $arg_mode
1188
2052
 
1189
2053
      # Aesthetically quote the previous argument.
1190
 
      func_quote_for_eval "$lastarg"
1191
 
      base_compile="$base_compile $func_quote_for_eval_result"
 
2054
      func_append_quoted base_compile "$lastarg"
1192
2055
    done # for arg
1193
2056
 
1194
2057
    case $arg_mode in
1213
2076
    *.[cCFSifmso] | \
1214
2077
    *.ada | *.adb | *.ads | *.asm | \
1215
2078
    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1216
 
    *.[fF][09]? | *.for | *.java | *.obj | *.sx)
 
2079
    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
1217
2080
      func_xform "$libobj"
1218
2081
      libobj=$func_xform_result
1219
2082
      ;;
1288
2151
    # Calculate the filename of the output object if compiler does
1289
2152
    # not support -o with -c
1290
2153
    if test "$compiler_c_o" = no; then
1291
 
      output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
 
2154
      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
1292
2155
      lockfile="$output_obj.lock"
1293
2156
    else
1294
2157
      output_obj=
1319
2182
        $opt_dry_run || $RM $removelist
1320
2183
        exit $EXIT_FAILURE
1321
2184
      fi
1322
 
      removelist="$removelist $output_obj"
 
2185
      func_append removelist " $output_obj"
1323
2186
      $ECHO "$srcfile" > "$lockfile"
1324
2187
    fi
1325
2188
 
1326
2189
    $opt_dry_run || $RM $removelist
1327
 
    removelist="$removelist $lockfile"
 
2190
    func_append removelist " $lockfile"
1328
2191
    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1329
2192
 
1330
 
    if test -n "$fix_srcfile_path"; then
1331
 
      eval srcfile=\"$fix_srcfile_path\"
1332
 
    fi
 
2193
    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
 
2194
    srcfile=$func_to_tool_file_result
1333
2195
    func_quote_for_eval "$srcfile"
1334
2196
    qsrcfile=$func_quote_for_eval_result
1335
2197
 
1349
2211
 
1350
2212
      if test -z "$output_obj"; then
1351
2213
        # Place PIC objects in $objdir
1352
 
        command="$command -o $lobj"
 
2214
        func_append command " -o $lobj"
1353
2215
      fi
1354
2216
 
1355
2217
      func_show_eval_locale "$command"  \
1396
2258
        command="$base_compile $qsrcfile $pic_flag"
1397
2259
      fi
1398
2260
      if test "$compiler_c_o" = yes; then
1399
 
        command="$command -o $obj"
 
2261
        func_append command " -o $obj"
1400
2262
      fi
1401
2263
 
1402
2264
      # Suppress compiler output if we already did a PIC compilation.
1403
 
      command="$command$suppress_output"
 
2265
      func_append command "$suppress_output"
1404
2266
      func_show_eval_locale "$command" \
1405
2267
        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1406
2268
 
1445
2307
}
1446
2308
 
1447
2309
$opt_help || {
1448
 
test "$mode" = compile && func_mode_compile ${1+"$@"}
 
2310
  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
1449
2311
}
1450
2312
 
1451
2313
func_mode_help ()
1452
2314
{
1453
2315
    # We need to display help for each of the modes.
1454
 
    case $mode in
 
2316
    case $opt_mode in
1455
2317
      "")
1456
2318
        # Generic help is extracted from the usage comments
1457
2319
        # at the start of this file.
1482
2344
 
1483
2345
  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
1484
2346
  -no-suppress      do not suppress compiler output for multiple passes
1485
 
  -prefer-pic       try to building PIC objects only
1486
 
  -prefer-non-pic   try to building non-PIC objects only
 
2347
  -prefer-pic       try to build PIC objects only
 
2348
  -prefer-non-pic   try to build non-PIC objects only
1487
2349
  -shared           do not build a \`.o' file suitable for static linking
1488
2350
  -static           only build a \`.o' file suitable for static linking
 
2351
  -Wc,FLAG          pass FLAG directly to the compiler
1489
2352
 
1490
2353
COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1491
2354
from the given SOURCEFILE.
1538
2401
 
1539
2402
The following components of INSTALL-COMMAND are treated specially:
1540
2403
 
1541
 
  -inst-prefix PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
 
2404
  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
1542
2405
 
1543
2406
The rest of the components are interpreted as arguments to that command (only
1544
2407
BSD-compatible install options are recognized)."
1558
2421
 
1559
2422
  -all-static       do not do any dynamic linking at all
1560
2423
  -avoid-version    do not add a version suffix if possible
 
2424
  -bindir BINDIR    specify path to binaries directory (for systems where
 
2425
                    libraries must be found in the PATH setting at runtime)
1561
2426
  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
1562
2427
  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
1563
2428
  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1586
2451
  -version-info CURRENT[:REVISION[:AGE]]
1587
2452
                    specify library version info [each variable defaults to 0]
1588
2453
  -weak LIBNAME     declare that the target provides the LIBNAME interface
 
2454
  -Wc,FLAG
 
2455
  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
 
2456
  -Wl,FLAG
 
2457
  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
 
2458
  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
1589
2459
 
1590
2460
All other options (arguments beginning with \`-') are ignored.
1591
2461
 
1619
2489
        ;;
1620
2490
 
1621
2491
      *)
1622
 
        func_fatal_help "invalid operation mode \`$mode'"
 
2492
        func_fatal_help "invalid operation mode \`$opt_mode'"
1623
2493
        ;;
1624
2494
    esac
1625
2495
 
1626
 
    $ECHO
 
2496
    echo
1627
2497
    $ECHO "Try \`$progname --help' for more information about other modes."
1628
 
 
1629
 
    exit $?
1630
2498
}
1631
2499
 
1632
 
  # Now that we've collected a possible --mode arg, show help if necessary
1633
 
  $opt_help && func_mode_help
 
2500
# Now that we've collected a possible --mode arg, show help if necessary
 
2501
if $opt_help; then
 
2502
  if test "$opt_help" = :; then
 
2503
    func_mode_help
 
2504
  else
 
2505
    {
 
2506
      func_help noexit
 
2507
      for opt_mode in compile link execute install finish uninstall clean; do
 
2508
        func_mode_help
 
2509
      done
 
2510
    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
 
2511
    {
 
2512
      func_help noexit
 
2513
      for opt_mode in compile link execute install finish uninstall clean; do
 
2514
        echo
 
2515
        func_mode_help
 
2516
      done
 
2517
    } |
 
2518
    sed '1d
 
2519
      /^When reporting/,/^Report/{
 
2520
        H
 
2521
        d
 
2522
      }
 
2523
      $x
 
2524
      /information about other modes/d
 
2525
      /more detailed .*MODE/d
 
2526
      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
 
2527
  fi
 
2528
  exit $?
 
2529
fi
1634
2530
 
1635
2531
 
1636
2532
# func_mode_execute arg...
1643
2539
      func_fatal_help "you must specify a COMMAND"
1644
2540
 
1645
2541
    # Handle -dlopen flags immediately.
1646
 
    for file in $execute_dlfiles; do
 
2542
    for file in $opt_dlopen; do
1647
2543
      test -f "$file" \
1648
2544
        || func_fatal_help "\`$file' is not a file"
1649
2545
 
1650
2546
      dir=
1651
2547
      case $file in
1652
2548
      *.la)
 
2549
        func_resolve_sysroot "$file"
 
2550
        file=$func_resolve_sysroot_result
 
2551
 
1653
2552
        # Check to see that this really is a libtool archive.
1654
2553
        func_lalib_unsafe_p "$file" \
1655
2554
          || func_fatal_help "\`$lib' is not a valid libtool archive"
1671
2570
        dir="$func_dirname_result"
1672
2571
 
1673
2572
        if test -f "$dir/$objdir/$dlname"; then
1674
 
          dir="$dir/$objdir"
 
2573
          func_append dir "/$objdir"
1675
2574
        else
1676
2575
          if test ! -f "$dir/$dlname"; then
1677
2576
            func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1712
2611
    for file
1713
2612
    do
1714
2613
      case $file in
1715
 
      -*) ;;
 
2614
      -* | *.la | *.lo ) ;;
1716
2615
      *)
1717
2616
        # Do a test to see if this is really a libtool program.
1718
2617
        if func_ltwrapper_script_p "$file"; then
1728
2627
        ;;
1729
2628
      esac
1730
2629
      # Quote arguments (to preserve shell metacharacters).
1731
 
      func_quote_for_eval "$file"
1732
 
      args="$args $func_quote_for_eval_result"
 
2630
      func_append_quoted args "$file"
1733
2631
    done
1734
2632
 
1735
2633
    if test "X$opt_dry_run" = Xfalse; then
1754
2652
      # Display what would be done.
1755
2653
      if test -n "$shlibpath_var"; then
1756
2654
        eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1757
 
        $ECHO "export $shlibpath_var"
 
2655
        echo "export $shlibpath_var"
1758
2656
      fi
1759
2657
      $ECHO "$cmd$args"
1760
2658
      exit $EXIT_SUCCESS
1761
2659
    fi
1762
2660
}
1763
2661
 
1764
 
test "$mode" = execute && func_mode_execute ${1+"$@"}
 
2662
test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
1765
2663
 
1766
2664
 
1767
2665
# func_mode_finish arg...
1768
2666
func_mode_finish ()
1769
2667
{
1770
2668
    $opt_debug
1771
 
    libdirs="$nonopt"
 
2669
    libs=
 
2670
    libdirs=
1772
2671
    admincmds=
1773
2672
 
 
2673
    for opt in "$nonopt" ${1+"$@"}
 
2674
    do
 
2675
      if test -d "$opt"; then
 
2676
        func_append libdirs " $opt"
 
2677
 
 
2678
      elif test -f "$opt"; then
 
2679
        if func_lalib_unsafe_p "$opt"; then
 
2680
          func_append libs " $opt"
 
2681
        else
 
2682
          func_warning "\`$opt' is not a valid libtool archive"
 
2683
        fi
 
2684
 
 
2685
      else
 
2686
        func_fatal_error "invalid argument \`$opt'"
 
2687
      fi
 
2688
    done
 
2689
 
 
2690
    if test -n "$libs"; then
 
2691
      if test -n "$lt_sysroot"; then
 
2692
        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
 
2693
        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
 
2694
      else
 
2695
        sysroot_cmd=
 
2696
      fi
 
2697
 
 
2698
      # Remove sysroot references
 
2699
      if $opt_dry_run; then
 
2700
        for lib in $libs; do
 
2701
          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
 
2702
        done
 
2703
      else
 
2704
        tmpdir=`func_mktempdir`
 
2705
        for lib in $libs; do
 
2706
          sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
 
2707
            > $tmpdir/tmp-la
 
2708
          mv -f $tmpdir/tmp-la $lib
 
2709
        done
 
2710
        ${RM}r "$tmpdir"
 
2711
      fi
 
2712
    fi
 
2713
 
1774
2714
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1775
 
      for dir
1776
 
      do
1777
 
        libdirs="$libdirs $dir"
1778
 
      done
1779
 
 
1780
2715
      for libdir in $libdirs; do
1781
2716
        if test -n "$finish_cmds"; then
1782
2717
          # Do each command in the finish commands.
1786
2721
        if test -n "$finish_eval"; then
1787
2722
          # Do the single finish_eval.
1788
2723
          eval cmds=\"$finish_eval\"
1789
 
          $opt_dry_run || eval "$cmds" || admincmds="$admincmds
 
2724
          $opt_dry_run || eval "$cmds" || func_append admincmds "
1790
2725
       $cmds"
1791
2726
        fi
1792
2727
      done
1795
2730
    # Exit here if they wanted silent mode.
1796
2731
    $opt_silent && exit $EXIT_SUCCESS
1797
2732
 
1798
 
    $ECHO "X----------------------------------------------------------------------" | $Xsed
1799
 
    $ECHO "Libraries have been installed in:"
1800
 
    for libdir in $libdirs; do
1801
 
      $ECHO "   $libdir"
1802
 
    done
1803
 
    $ECHO
1804
 
    $ECHO "If you ever happen to want to link against installed libraries"
1805
 
    $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
1806
 
    $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
1807
 
    $ECHO "flag during linking and do at least one of the following:"
1808
 
    if test -n "$shlibpath_var"; then
1809
 
      $ECHO "   - add LIBDIR to the \`$shlibpath_var' environment variable"
1810
 
      $ECHO "     during execution"
1811
 
    fi
1812
 
    if test -n "$runpath_var"; then
1813
 
      $ECHO "   - add LIBDIR to the \`$runpath_var' environment variable"
1814
 
      $ECHO "     during linking"
1815
 
    fi
1816
 
    if test -n "$hardcode_libdir_flag_spec"; then
1817
 
      libdir=LIBDIR
1818
 
      eval flag=\"$hardcode_libdir_flag_spec\"
1819
 
 
1820
 
      $ECHO "   - use the \`$flag' linker flag"
1821
 
    fi
1822
 
    if test -n "$admincmds"; then
1823
 
      $ECHO "   - have your system administrator run these commands:$admincmds"
1824
 
    fi
1825
 
    if test -f /etc/ld.so.conf; then
1826
 
      $ECHO "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1827
 
    fi
1828
 
    $ECHO
1829
 
 
1830
 
    $ECHO "See any operating system documentation about shared libraries for"
1831
 
    case $host in
1832
 
      solaris2.[6789]|solaris2.1[0-9])
1833
 
        $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1834
 
        $ECHO "pages."
1835
 
        ;;
1836
 
      *)
1837
 
        $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
1838
 
        ;;
1839
 
    esac
1840
 
    $ECHO "X----------------------------------------------------------------------" | $Xsed
 
2733
    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
 
2734
      echo "----------------------------------------------------------------------"
 
2735
      echo "Libraries have been installed in:"
 
2736
      for libdir in $libdirs; do
 
2737
        $ECHO "   $libdir"
 
2738
      done
 
2739
      echo
 
2740
      echo "If you ever happen to want to link against installed libraries"
 
2741
      echo "in a given directory, LIBDIR, you must either use libtool, and"
 
2742
      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
 
2743
      echo "flag during linking and do at least one of the following:"
 
2744
      if test -n "$shlibpath_var"; then
 
2745
        echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
 
2746
        echo "     during execution"
 
2747
      fi
 
2748
      if test -n "$runpath_var"; then
 
2749
        echo "   - add LIBDIR to the \`$runpath_var' environment variable"
 
2750
        echo "     during linking"
 
2751
      fi
 
2752
      if test -n "$hardcode_libdir_flag_spec"; then
 
2753
        libdir=LIBDIR
 
2754
        eval flag=\"$hardcode_libdir_flag_spec\"
 
2755
 
 
2756
        $ECHO "   - use the \`$flag' linker flag"
 
2757
      fi
 
2758
      if test -n "$admincmds"; then
 
2759
        $ECHO "   - have your system administrator run these commands:$admincmds"
 
2760
      fi
 
2761
      if test -f /etc/ld.so.conf; then
 
2762
        echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
 
2763
      fi
 
2764
      echo
 
2765
 
 
2766
      echo "See any operating system documentation about shared libraries for"
 
2767
      case $host in
 
2768
        solaris2.[6789]|solaris2.1[0-9])
 
2769
          echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
 
2770
          echo "pages."
 
2771
          ;;
 
2772
        *)
 
2773
          echo "more information, such as the ld(1) and ld.so(8) manual pages."
 
2774
          ;;
 
2775
      esac
 
2776
      echo "----------------------------------------------------------------------"
 
2777
    fi
1841
2778
    exit $EXIT_SUCCESS
1842
2779
}
1843
2780
 
1844
 
test "$mode" = finish && func_mode_finish ${1+"$@"}
 
2781
test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
1845
2782
 
1846
2783
 
1847
2784
# func_mode_install arg...
1852
2789
    # install_prog (especially on Windows NT).
1853
2790
    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
1854
2791
       # Allow the use of GNU shtool's install command.
1855
 
       $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
 
2792
       case $nonopt in *shtool*) :;; *) false;; esac; then
1856
2793
      # Aesthetically quote it.
1857
2794
      func_quote_for_eval "$nonopt"
1858
2795
      install_prog="$func_quote_for_eval_result "
1866
2803
    # The real first argument should be the name of the installation program.
1867
2804
    # Aesthetically quote it.
1868
2805
    func_quote_for_eval "$arg"
1869
 
    install_prog="$install_prog$func_quote_for_eval_result"
 
2806
    func_append install_prog "$func_quote_for_eval_result"
 
2807
    install_shared_prog=$install_prog
 
2808
    case " $install_prog " in
 
2809
      *[\\\ /]cp\ *) install_cp=: ;;
 
2810
      *) install_cp=false ;;
 
2811
    esac
1870
2812
 
1871
2813
    # We need to accept at least all the BSD install flags.
1872
2814
    dest=
1876
2818
    install_type=
1877
2819
    isdir=no
1878
2820
    stripme=
 
2821
    no_mode=:
1879
2822
    for arg
1880
2823
    do
 
2824
      arg2=
1881
2825
      if test -n "$dest"; then
1882
 
        files="$files $dest"
 
2826
        func_append files " $dest"
1883
2827
        dest=$arg
1884
2828
        continue
1885
2829
      fi
1887
2831
      case $arg in
1888
2832
      -d) isdir=yes ;;
1889
2833
      -f)
1890
 
        case " $install_prog " in
1891
 
        *[\\\ /]cp\ *) ;;
1892
 
        *) prev=$arg ;;
1893
 
        esac
 
2834
        if $install_cp; then :; else
 
2835
          prev=$arg
 
2836
        fi
1894
2837
        ;;
1895
2838
      -g | -m | -o)
1896
2839
        prev=$arg
1904
2847
      *)
1905
2848
        # If the previous option needed an argument, then skip it.
1906
2849
        if test -n "$prev"; then
 
2850
          if test "x$prev" = x-m && test -n "$install_override_mode"; then
 
2851
            arg2=$install_override_mode
 
2852
            no_mode=false
 
2853
          fi
1907
2854
          prev=
1908
2855
        else
1909
2856
          dest=$arg
1914
2861
 
1915
2862
      # Aesthetically quote the argument.
1916
2863
      func_quote_for_eval "$arg"
1917
 
      install_prog="$install_prog $func_quote_for_eval_result"
 
2864
      func_append install_prog " $func_quote_for_eval_result"
 
2865
      if test -n "$arg2"; then
 
2866
        func_quote_for_eval "$arg2"
 
2867
      fi
 
2868
      func_append install_shared_prog " $func_quote_for_eval_result"
1918
2869
    done
1919
2870
 
1920
2871
    test -z "$install_prog" && \
1923
2874
    test -n "$prev" && \
1924
2875
      func_fatal_help "the \`$prev' option requires an argument"
1925
2876
 
 
2877
    if test -n "$install_override_mode" && $no_mode; then
 
2878
      if $install_cp; then :; else
 
2879
        func_quote_for_eval "$install_override_mode"
 
2880
        func_append install_shared_prog " -m $func_quote_for_eval_result"
 
2881
      fi
 
2882
    fi
 
2883
 
1926
2884
    if test -z "$files"; then
1927
2885
      if test -z "$dest"; then
1928
2886
        func_fatal_help "no file or destination specified"
1977
2935
      case $file in
1978
2936
      *.$libext)
1979
2937
        # Do the static libraries later.
1980
 
        staticlibs="$staticlibs $file"
 
2938
        func_append staticlibs " $file"
1981
2939
        ;;
1982
2940
 
1983
2941
      *.la)
 
2942
        func_resolve_sysroot "$file"
 
2943
        file=$func_resolve_sysroot_result
 
2944
 
1984
2945
        # Check to see that this really is a libtool archive.
1985
2946
        func_lalib_unsafe_p "$file" \
1986
2947
          || func_fatal_help "\`$file' is not a valid libtool archive"
1994
2955
        if test "X$destdir" = "X$libdir"; then
1995
2956
          case "$current_libdirs " in
1996
2957
          *" $libdir "*) ;;
1997
 
          *) current_libdirs="$current_libdirs $libdir" ;;
 
2958
          *) func_append current_libdirs " $libdir" ;;
1998
2959
          esac
1999
2960
        else
2000
2961
          # Note the libdir as a future libdir.
2001
2962
          case "$future_libdirs " in
2002
2963
          *" $libdir "*) ;;
2003
 
          *) future_libdirs="$future_libdirs $libdir" ;;
 
2964
          *) func_append future_libdirs " $libdir" ;;
2004
2965
          esac
2005
2966
        fi
2006
2967
 
2007
2968
        func_dirname "$file" "/" ""
2008
2969
        dir="$func_dirname_result"
2009
 
        dir="$dir$objdir"
 
2970
        func_append dir "$objdir"
2010
2971
 
2011
2972
        if test -n "$relink_command"; then
2012
2973
          # Determine the prefix the user has applied to our future dir.
2013
 
          inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
 
2974
          inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
2014
2975
 
2015
2976
          # Don't allow the user to place us outside of our expected
2016
2977
          # location b/c this prevents finding dependent libraries that
2023
2984
 
2024
2985
          if test -n "$inst_prefix_dir"; then
2025
2986
            # Stick the inst_prefix_dir data into the link command.
2026
 
            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
 
2987
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2027
2988
          else
2028
 
            relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
 
2989
            relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
2029
2990
          fi
2030
2991
 
2031
2992
          func_warning "relinking \`$file'"
2043
3004
          test -n "$relink_command" && srcname="$realname"T
2044
3005
 
2045
3006
          # Install the shared library and build the symlinks.
2046
 
          func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
 
3007
          func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
2047
3008
              'exit $?'
2048
3009
          tstripme="$stripme"
2049
3010
          case $host_os in
2083
3044
        func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2084
3045
 
2085
3046
        # Maybe install the static library, too.
2086
 
        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
 
3047
        test -n "$old_library" && func_append staticlibs " $dir/$old_library"
2087
3048
        ;;
2088
3049
 
2089
3050
      *.lo)
2183
3144
            if test -f "$lib"; then
2184
3145
              func_source "$lib"
2185
3146
            fi
2186
 
            libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
 
3147
            libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
2187
3148
            if test -n "$libdir" && test ! -f "$libfile"; then
2188
3149
              func_warning "\`$lib' has not been installed in \`$libdir'"
2189
3150
              finalize=no
2202
3163
                file="$func_basename_result"
2203
3164
                outputname="$tmpdir/$file"
2204
3165
                # Replace the output file specification.
2205
 
                relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
 
3166
                relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
2206
3167
 
2207
3168
                $opt_silent || {
2208
3169
                  func_quote_for_expand "$relink_command"
2221
3182
            }
2222
3183
          else
2223
3184
            # Install the binary that we compiled earlier.
2224
 
            file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
 
3185
            file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
2225
3186
          fi
2226
3187
        fi
2227
3188
 
2257
3218
 
2258
3219
      # Set up the ranlib parameters.
2259
3220
      oldlib="$destdir/$name"
 
3221
      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
 
3222
      tool_oldlib=$func_to_tool_file_result
2260
3223
 
2261
3224
      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2262
3225
 
2263
3226
      if test -n "$stripme" && test -n "$old_striplib"; then
2264
 
        func_show_eval "$old_striplib $oldlib" 'exit $?'
 
3227
        func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
2265
3228
      fi
2266
3229
 
2267
3230
      # Do each command in the postinstall commands.
2280
3243
    fi
2281
3244
}
2282
3245
 
2283
 
test "$mode" = install && func_mode_install ${1+"$@"}
 
3246
test "$opt_mode" = install && func_mode_install ${1+"$@"}
2284
3247
 
2285
3248
 
2286
3249
# func_generate_dlsyms outputname originator pic_p
2323
3286
extern \"C\" {
2324
3287
#endif
2325
3288
 
 
3289
#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
 
3290
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
 
3291
#endif
 
3292
 
 
3293
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
 
3294
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
 
3295
/* DATA imports from DLLs on WIN32 con't be const, because runtime
 
3296
   relocations are performed -- see ld's documentation on pseudo-relocs.  */
 
3297
# define LT_DLSYM_CONST
 
3298
#elif defined(__osf__)
 
3299
/* This system does not cope well with relocations in const data.  */
 
3300
# define LT_DLSYM_CONST
 
3301
#else
 
3302
# define LT_DLSYM_CONST const
 
3303
#endif
 
3304
 
2326
3305
/* External symbol declarations for the compiler. */\
2327
3306
"
2328
3307
 
2332
3311
          $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2333
3312
 
2334
3313
          # Add our own program objects to the symbol list.
2335
 
          progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
3314
          progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
2336
3315
          for progfile in $progfiles; do
2337
 
            func_verbose "extracting global C symbols from \`$progfile'"
2338
 
            $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
 
3316
            func_to_tool_file "$progfile" func_convert_file_msys_to_w32
 
3317
            func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
 
3318
            $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
2339
3319
          done
2340
3320
 
2341
3321
          if test -n "$exclude_expsyms"; then
2371
3351
              eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2372
3352
              eval '$MV "$nlist"T "$nlist"'
2373
3353
              case $host in
2374
 
                *cygwin | *mingw* | *cegcc* )
 
3354
                *cygwin* | *mingw* | *cegcc* )
2375
3355
                  eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2376
3356
                  eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2377
3357
                  ;;
2384
3364
          func_verbose "extracting global C symbols from \`$dlprefile'"
2385
3365
          func_basename "$dlprefile"
2386
3366
          name="$func_basename_result"
2387
 
          $opt_dry_run || {
2388
 
            eval '$ECHO ": $name " >> "$nlist"'
2389
 
            eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2390
 
          }
 
3367
          case $host in
 
3368
            *cygwin* | *mingw* | *cegcc* )
 
3369
              # if an import library, we need to obtain dlname
 
3370
              if func_win32_import_lib_p "$dlprefile"; then
 
3371
                func_tr_sh "$dlprefile"
 
3372
                eval "curr_lafile=\$libfile_$func_tr_sh_result"
 
3373
                dlprefile_dlbasename=""
 
3374
                if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
 
3375
                  # Use subshell, to avoid clobbering current variable values
 
3376
                  dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
 
3377
                  if test -n "$dlprefile_dlname" ; then
 
3378
                    func_basename "$dlprefile_dlname"
 
3379
                    dlprefile_dlbasename="$func_basename_result"
 
3380
                  else
 
3381
                    # no lafile. user explicitly requested -dlpreopen <import library>.
 
3382
                    $sharedlib_from_linklib_cmd "$dlprefile"
 
3383
                    dlprefile_dlbasename=$sharedlib_from_linklib_result
 
3384
                  fi
 
3385
                fi
 
3386
                $opt_dry_run || {
 
3387
                  if test -n "$dlprefile_dlbasename" ; then
 
3388
                    eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
 
3389
                  else
 
3390
                    func_warning "Could not compute DLL name from $name"
 
3391
                    eval '$ECHO ": $name " >> "$nlist"'
 
3392
                  fi
 
3393
                  func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
 
3394
                  eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
 
3395
                    $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
 
3396
                }
 
3397
              else # not an import lib
 
3398
                $opt_dry_run || {
 
3399
                  eval '$ECHO ": $name " >> "$nlist"'
 
3400
                  func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
 
3401
                  eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
 
3402
                }
 
3403
              fi
 
3404
            ;;
 
3405
            *)
 
3406
              $opt_dry_run || {
 
3407
                eval '$ECHO ": $name " >> "$nlist"'
 
3408
                func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
 
3409
                eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
 
3410
              }
 
3411
            ;;
 
3412
          esac
2391
3413
        done
2392
3414
 
2393
3415
        $opt_dry_run || {
2415
3437
          if test -f "$nlist"S; then
2416
3438
            eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2417
3439
          else
2418
 
            $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
 
3440
            echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
2419
3441
          fi
2420
3442
 
2421
 
          $ECHO >> "$output_objdir/$my_dlsyms" "\
 
3443
          echo >> "$output_objdir/$my_dlsyms" "\
2422
3444
 
2423
3445
/* The mapping between symbol names and symbols.  */
2424
3446
typedef struct {
2425
3447
  const char *name;
2426
3448
  void *address;
2427
3449
} lt_dlsymlist;
2428
 
"
2429
 
          case $host in
2430
 
          *cygwin* | *mingw* | *cegcc* )
2431
 
            $ECHO >> "$output_objdir/$my_dlsyms" "\
2432
 
/* DATA imports from DLLs on WIN32 con't be const, because
2433
 
   runtime relocations are performed -- see ld's documentation
2434
 
   on pseudo-relocs.  */"
2435
 
            lt_dlsym_const= ;;
2436
 
          *osf5*)
2437
 
            echo >> "$output_objdir/$my_dlsyms" "\
2438
 
/* This system does not cope well with relocations in const data */"
2439
 
            lt_dlsym_const= ;;
2440
 
          *)
2441
 
            lt_dlsym_const=const ;;
2442
 
          esac
2443
 
 
2444
 
          $ECHO >> "$output_objdir/$my_dlsyms" "\
2445
 
extern $lt_dlsym_const lt_dlsymlist
 
3450
extern LT_DLSYM_CONST lt_dlsymlist
2446
3451
lt_${my_prefix}_LTX_preloaded_symbols[];
2447
 
$lt_dlsym_const lt_dlsymlist
 
3452
LT_DLSYM_CONST lt_dlsymlist
2448
3453
lt_${my_prefix}_LTX_preloaded_symbols[] =
2449
3454
{\
2450
3455
  { \"$my_originator\", (void *) 0 },"
2457
3462
            eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2458
3463
            ;;
2459
3464
          esac
2460
 
          $ECHO >> "$output_objdir/$my_dlsyms" "\
 
3465
          echo >> "$output_objdir/$my_dlsyms" "\
2461
3466
  {0, (void *) 0}
2462
3467
};
2463
3468
 
2484
3489
          # linked before any other PIC object.  But we must not use
2485
3490
          # pic_flag when linking with -static.  The problem exists in
2486
3491
          # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2487
 
          *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
 
3492
          *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2488
3493
            pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2489
3494
          *-*-hpux*)
2490
3495
            pic_flag_for_symtable=" $pic_flag"  ;;
2500
3505
        for arg in $LTCFLAGS; do
2501
3506
          case $arg in
2502
3507
          -pie | -fpie | -fPIE) ;;
2503
 
          *) symtab_cflags="$symtab_cflags $arg" ;;
 
3508
          *) func_append symtab_cflags " $arg" ;;
2504
3509
          esac
2505
3510
        done
2506
3511
 
2515
3520
        case $host in
2516
3521
        *cygwin* | *mingw* | *cegcc* )
2517
3522
          if test -f "$output_objdir/$my_outputname.def"; then
2518
 
            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2519
 
            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 
3523
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
 
3524
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2520
3525
          else
2521
 
            compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2522
 
            finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
 
3526
            compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 
3527
            finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2523
3528
          fi
2524
3529
          ;;
2525
3530
        *)
2526
 
          compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2527
 
          finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
 
3531
          compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
 
3532
          finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
2528
3533
          ;;
2529
3534
        esac
2530
3535
        ;;
2538
3543
      # really was required.
2539
3544
 
2540
3545
      # Nullify the symbol file.
2541
 
      compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2542
 
      finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
 
3546
      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
 
3547
      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
2543
3548
    fi
2544
3549
}
2545
3550
 
2549
3554
# Need a lot of goo to handle *both* DLLs and import libs
2550
3555
# Has to be a shell function in order to 'eat' the argument
2551
3556
# that is supplied when $file_magic_command is called.
 
3557
# Despite the name, also deal with 64 bit binaries.
2552
3558
func_win32_libid ()
2553
3559
{
2554
3560
  $opt_debug
2559
3565
    win32_libid_type="x86 archive import"
2560
3566
    ;;
2561
3567
  *ar\ archive*) # could be an import, or static
 
3568
    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
2562
3569
    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2563
 
       $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
2564
 
      win32_nmres=`eval $NM -f posix -A $1 |
 
3570
       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
 
3571
      func_to_tool_file "$1" func_convert_file_msys_to_w32
 
3572
      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
2565
3573
        $SED -n -e '
2566
3574
            1,100{
2567
3575
                / I /{
2590
3598
  $ECHO "$win32_libid_type"
2591
3599
}
2592
3600
 
 
3601
# func_cygming_dll_for_implib ARG
 
3602
#
 
3603
# Platform-specific function to extract the
 
3604
# name of the DLL associated with the specified
 
3605
# import library ARG.
 
3606
# Invoked by eval'ing the libtool variable
 
3607
#    $sharedlib_from_linklib_cmd
 
3608
# Result is available in the variable
 
3609
#    $sharedlib_from_linklib_result
 
3610
func_cygming_dll_for_implib ()
 
3611
{
 
3612
  $opt_debug
 
3613
  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
 
3614
}
 
3615
 
 
3616
# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
 
3617
#
 
3618
# The is the core of a fallback implementation of a
 
3619
# platform-specific function to extract the name of the
 
3620
# DLL associated with the specified import library LIBNAME.
 
3621
#
 
3622
# SECTION_NAME is either .idata$6 or .idata$7, depending
 
3623
# on the platform and compiler that created the implib.
 
3624
#
 
3625
# Echos the name of the DLL associated with the
 
3626
# specified import library.
 
3627
func_cygming_dll_for_implib_fallback_core ()
 
3628
{
 
3629
  $opt_debug
 
3630
  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
 
3631
  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
 
3632
    $SED '/^Contents of section '"$match_literal"':/{
 
3633
      # Place marker at beginning of archive member dllname section
 
3634
      s/.*/====MARK====/
 
3635
      p
 
3636
      d
 
3637
    }
 
3638
    # These lines can sometimes be longer than 43 characters, but
 
3639
    # are always uninteresting
 
3640
    /:[  ]*file format pe[i]\{,1\}-/d
 
3641
    /^In archive [^:]*:/d
 
3642
    # Ensure marker is printed
 
3643
    /^====MARK====/p
 
3644
    # Remove all lines with less than 43 characters
 
3645
    /^.\{43\}/!d
 
3646
    # From remaining lines, remove first 43 characters
 
3647
    s/^.\{43\}//' |
 
3648
    $SED -n '
 
3649
      # Join marker and all lines until next marker into a single line
 
3650
      /^====MARK====/ b para
 
3651
      H
 
3652
      $ b para
 
3653
      b
 
3654
      :para
 
3655
      x
 
3656
      s/\n//g
 
3657
      # Remove the marker
 
3658
      s/^====MARK====//
 
3659
      # Remove trailing dots and whitespace
 
3660
      s/[\. \t]*$//
 
3661
      # Print
 
3662
      /./p' |
 
3663
    # we now have a list, one entry per line, of the stringified
 
3664
    # contents of the appropriate section of all members of the
 
3665
    # archive which possess that section. Heuristic: eliminate
 
3666
    # all those which have a first or second character that is
 
3667
    # a '.' (that is, objdump's representation of an unprintable
 
3668
    # character.) This should work for all archives with less than
 
3669
    # 0x302f exports -- but will fail for DLLs whose name actually
 
3670
    # begins with a literal '.' or a single character followed by
 
3671
    # a '.'.
 
3672
    #
 
3673
    # Of those that remain, print the first one.
 
3674
    $SED -e '/^\./d;/^.\./d;q'
 
3675
}
 
3676
 
 
3677
# func_cygming_gnu_implib_p ARG
 
3678
# This predicate returns with zero status (TRUE) if
 
3679
# ARG is a GNU/binutils-style import library. Returns
 
3680
# with nonzero status (FALSE) otherwise.
 
3681
func_cygming_gnu_implib_p ()
 
3682
{
 
3683
  $opt_debug
 
3684
  func_to_tool_file "$1" func_convert_file_msys_to_w32
 
3685
  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
 
3686
  test -n "$func_cygming_gnu_implib_tmp"
 
3687
}
 
3688
 
 
3689
# func_cygming_ms_implib_p ARG
 
3690
# This predicate returns with zero status (TRUE) if
 
3691
# ARG is an MS-style import library. Returns
 
3692
# with nonzero status (FALSE) otherwise.
 
3693
func_cygming_ms_implib_p ()
 
3694
{
 
3695
  $opt_debug
 
3696
  func_to_tool_file "$1" func_convert_file_msys_to_w32
 
3697
  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
 
3698
  test -n "$func_cygming_ms_implib_tmp"
 
3699
}
 
3700
 
 
3701
# func_cygming_dll_for_implib_fallback ARG
 
3702
# Platform-specific function to extract the
 
3703
# name of the DLL associated with the specified
 
3704
# import library ARG.
 
3705
#
 
3706
# This fallback implementation is for use when $DLLTOOL
 
3707
# does not support the --identify-strict option.
 
3708
# Invoked by eval'ing the libtool variable
 
3709
#    $sharedlib_from_linklib_cmd
 
3710
# Result is available in the variable
 
3711
#    $sharedlib_from_linklib_result
 
3712
func_cygming_dll_for_implib_fallback ()
 
3713
{
 
3714
  $opt_debug
 
3715
  if func_cygming_gnu_implib_p "$1" ; then
 
3716
    # binutils import library
 
3717
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
 
3718
  elif func_cygming_ms_implib_p "$1" ; then
 
3719
    # ms-generated import library
 
3720
    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
 
3721
  else
 
3722
    # unknown
 
3723
    sharedlib_from_linklib_result=""
 
3724
  fi
 
3725
}
2593
3726
 
2594
3727
 
2595
3728
# func_extract_an_archive dir oldlib
2598
3731
    $opt_debug
2599
3732
    f_ex_an_ar_dir="$1"; shift
2600
3733
    f_ex_an_ar_oldlib="$1"
2601
 
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
 
3734
    if test "$lock_old_archive_extraction" = yes; then
 
3735
      lockfile=$f_ex_an_ar_oldlib.lock
 
3736
      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
 
3737
        func_echo "Waiting for $lockfile to be removed"
 
3738
        sleep 2
 
3739
      done
 
3740
    fi
 
3741
    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
 
3742
                   'stat=$?; rm -f "$lockfile"; exit $stat'
 
3743
    if test "$lock_old_archive_extraction" = yes; then
 
3744
      $opt_dry_run || rm -f "$lockfile"
 
3745
    fi
2602
3746
    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2603
3747
     :
2604
3748
    else
2669
3813
            darwin_file=
2670
3814
            darwin_files=
2671
3815
            for darwin_file in $darwin_filelist; do
2672
 
              darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
 
3816
              darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
2673
3817
              $LIPO -create -output "$darwin_file" $darwin_files
2674
3818
            done # $darwin_filelist
2675
3819
            $RM -rf unfat-$$
2684
3828
        func_extract_an_archive "$my_xdir" "$my_xabs"
2685
3829
        ;;
2686
3830
      esac
2687
 
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
 
3831
      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
2688
3832
    done
2689
3833
 
2690
3834
    func_extract_archives_result="$my_oldobjs"
2691
3835
}
2692
3836
 
2693
3837
 
2694
 
 
2695
 
# func_emit_wrapper_part1 [arg=no]
2696
 
#
2697
 
# Emit the first part of a libtool wrapper script on stdout.
2698
 
# For more information, see the description associated with
2699
 
# func_emit_wrapper(), below.
2700
 
func_emit_wrapper_part1 ()
 
3838
# func_emit_wrapper [arg=no]
 
3839
#
 
3840
# Emit a libtool wrapper script on stdout.
 
3841
# Don't directly open a file because we may want to
 
3842
# incorporate the script contents within a cygwin/mingw
 
3843
# wrapper executable.  Must ONLY be called from within
 
3844
# func_mode_link because it depends on a number of variables
 
3845
# set therein.
 
3846
#
 
3847
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
 
3848
# variable will take.  If 'yes', then the emitted script
 
3849
# will assume that the directory in which it is stored is
 
3850
# the $objdir directory.  This is a cygwin/mingw-specific
 
3851
# behavior.
 
3852
func_emit_wrapper ()
2701
3853
{
2702
 
        func_emit_wrapper_part1_arg1=no
2703
 
        if test -n "$1" ; then
2704
 
          func_emit_wrapper_part1_arg1=$1
2705
 
        fi
 
3854
        func_emit_wrapper_arg1=${1-no}
2706
3855
 
2707
3856
        $ECHO "\
2708
3857
#! $SHELL
2718
3867
 
2719
3868
# Sed substitution that helps us do robust quoting.  It backslashifies
2720
3869
# metacharacters that are still active within double-quoted strings.
2721
 
Xsed='${SED} -e 1s/^X//'
2722
3870
sed_quote_subst='$sed_quote_subst'
2723
3871
 
2724
3872
# Be Bourne compatible
2749
3897
else
2750
3898
  # When we are sourced in execute mode, \$file and \$ECHO are already set.
2751
3899
  if test \"\$libtool_execute_magic\" != \"$magic\"; then
2752
 
    ECHO=\"$qecho\"
2753
 
    file=\"\$0\"
2754
 
    # Make sure echo works.
2755
 
    if test \"X\$1\" = X--no-reexec; then
2756
 
      # Discard the --no-reexec flag, and continue.
 
3900
    file=\"\$0\""
 
3901
 
 
3902
    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
 
3903
    $ECHO "\
 
3904
 
 
3905
# A function that is used when there is no print builtin or printf.
 
3906
func_fallback_echo ()
 
3907
{
 
3908
  eval 'cat <<_LTECHO_EOF
 
3909
\$1
 
3910
_LTECHO_EOF'
 
3911
}
 
3912
    ECHO=\"$qECHO\"
 
3913
  fi
 
3914
 
 
3915
# Very basic option parsing. These options are (a) specific to
 
3916
# the libtool wrapper, (b) are identical between the wrapper
 
3917
# /script/ and the wrapper /executable/ which is used only on
 
3918
# windows platforms, and (c) all begin with the string "--lt-"
 
3919
# (application programs are unlikely to have options which match
 
3920
# this pattern).
 
3921
#
 
3922
# There are only two supported options: --lt-debug and
 
3923
# --lt-dump-script. There is, deliberately, no --lt-help.
 
3924
#
 
3925
# The first argument to this parsing function should be the
 
3926
# script's $0 value, followed by "$@".
 
3927
lt_option_debug=
 
3928
func_parse_lt_options ()
 
3929
{
 
3930
  lt_script_arg0=\$0
 
3931
  shift
 
3932
  for lt_opt
 
3933
  do
 
3934
    case \"\$lt_opt\" in
 
3935
    --lt-debug) lt_option_debug=1 ;;
 
3936
    --lt-dump-script)
 
3937
        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
 
3938
        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
 
3939
        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
 
3940
        cat \"\$lt_dump_D/\$lt_dump_F\"
 
3941
        exit 0
 
3942
      ;;
 
3943
    --lt-*)
 
3944
        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
 
3945
        exit 1
 
3946
      ;;
 
3947
    esac
 
3948
  done
 
3949
 
 
3950
  # Print the debug banner immediately:
 
3951
  if test -n \"\$lt_option_debug\"; then
 
3952
    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
 
3953
  fi
 
3954
}
 
3955
 
 
3956
# Used when --lt-debug. Prints its arguments to stdout
 
3957
# (redirection is the responsibility of the caller)
 
3958
func_lt_dump_args ()
 
3959
{
 
3960
  lt_dump_args_N=1;
 
3961
  for lt_arg
 
3962
  do
 
3963
    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
 
3964
    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
 
3965
  done
 
3966
}
 
3967
 
 
3968
# Core function for launching the target application
 
3969
func_exec_program_core ()
 
3970
{
 
3971
"
 
3972
  case $host in
 
3973
  # Backslashes separate directories on plain windows
 
3974
  *-*-mingw | *-*-os2* | *-cegcc*)
 
3975
    $ECHO "\
 
3976
      if test -n \"\$lt_option_debug\"; then
 
3977
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
 
3978
        func_lt_dump_args \${1+\"\$@\"} 1>&2
 
3979
      fi
 
3980
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
 
3981
"
 
3982
    ;;
 
3983
 
 
3984
  *)
 
3985
    $ECHO "\
 
3986
      if test -n \"\$lt_option_debug\"; then
 
3987
        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
 
3988
        func_lt_dump_args \${1+\"\$@\"} 1>&2
 
3989
      fi
 
3990
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
 
3991
"
 
3992
    ;;
 
3993
  esac
 
3994
  $ECHO "\
 
3995
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
 
3996
      exit 1
 
3997
}
 
3998
 
 
3999
# A function to encapsulate launching the target application
 
4000
# Strips options in the --lt-* namespace from \$@ and
 
4001
# launches target application with the remaining arguments.
 
4002
func_exec_program ()
 
4003
{
 
4004
  case \" \$* \" in
 
4005
  *\\ --lt-*)
 
4006
    for lt_wr_arg
 
4007
    do
 
4008
      case \$lt_wr_arg in
 
4009
      --lt-*) ;;
 
4010
      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
 
4011
      esac
2757
4012
      shift
2758
 
    elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2759
 
      # Yippee, \$ECHO works!
2760
 
      :
2761
 
    else
2762
 
      # Restart under the correct shell, and then maybe \$ECHO will work.
2763
 
      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2764
 
    fi
2765
 
  fi\
2766
 
"
2767
 
        $ECHO "\
 
4013
    done ;;
 
4014
  esac
 
4015
  func_exec_program_core \${1+\"\$@\"}
 
4016
}
 
4017
 
 
4018
  # Parse options
 
4019
  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
2768
4020
 
2769
4021
  # Find the directory that this script lives in.
2770
 
  thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
 
4022
  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
2771
4023
  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2772
4024
 
2773
4025
  # Follow symbolic links until we get to the real thisdir.
2774
 
  file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
 
4026
  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
2775
4027
  while test -n \"\$file\"; do
2776
 
    destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
 
4028
    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
2777
4029
 
2778
4030
    # If there was a directory component, then change thisdir.
2779
4031
    if test \"x\$destdir\" != \"x\$file\"; then
2783
4035
      esac
2784
4036
    fi
2785
4037
 
2786
 
    file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2787
 
    file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
 
4038
    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
 
4039
    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
2788
4040
  done
2789
 
"
2790
 
}
2791
 
# end: func_emit_wrapper_part1
2792
 
 
2793
 
# func_emit_wrapper_part2 [arg=no]
2794
 
#
2795
 
# Emit the second part of a libtool wrapper script on stdout.
2796
 
# For more information, see the description associated with
2797
 
# func_emit_wrapper(), below.
2798
 
func_emit_wrapper_part2 ()
2799
 
{
2800
 
        func_emit_wrapper_part2_arg1=no
2801
 
        if test -n "$1" ; then
2802
 
          func_emit_wrapper_part2_arg1=$1
2803
 
        fi
2804
 
 
2805
 
        $ECHO "\
2806
4041
 
2807
4042
  # Usually 'no', except on cygwin/mingw when embedded into
2808
4043
  # the cwrapper.
2809
 
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
 
4044
  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
2810
4045
  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2811
4046
    # special case for '.'
2812
4047
    if test \"\$thisdir\" = \".\"; then
2814
4049
    fi
2815
4050
    # remove .libs from thisdir
2816
4051
    case \"\$thisdir\" in
2817
 
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
 
4052
    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
2818
4053
    $objdir )   thisdir=. ;;
2819
4054
    esac
2820
4055
  fi
2869
4104
 
2870
4105
  if test -f \"\$progdir/\$program\"; then"
2871
4106
 
 
4107
        # fixup the dll searchpath if we need to.
 
4108
        #
 
4109
        # Fix the DLL searchpath if we need to.  Do this before prepending
 
4110
        # to shlibpath, because on Windows, both are PATH and uninstalled
 
4111
        # libraries must come first.
 
4112
        if test -n "$dllsearchpath"; then
 
4113
          $ECHO "\
 
4114
    # Add the dll search path components to the executable PATH
 
4115
    PATH=$dllsearchpath:\$PATH
 
4116
"
 
4117
        fi
 
4118
 
2872
4119
        # Export our shlibpath_var if we have one.
2873
4120
        if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2874
4121
          $ECHO "\
2877
4124
 
2878
4125
    # Some systems cannot cope with colon-terminated $shlibpath_var
2879
4126
    # The second colon is a workaround for a bug in BeOS R4 sed
2880
 
    $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
 
4127
    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
2881
4128
 
2882
4129
    export $shlibpath_var
2883
4130
"
2884
4131
        fi
2885
4132
 
2886
 
        # fixup the dll searchpath if we need to.
2887
 
        if test -n "$dllsearchpath"; then
2888
 
          $ECHO "\
2889
 
    # Add the dll search path components to the executable PATH
2890
 
    PATH=$dllsearchpath:\$PATH
2891
 
"
2892
 
        fi
2893
 
 
2894
4133
        $ECHO "\
2895
4134
    if test \"\$libtool_execute_magic\" != \"$magic\"; then
2896
4135
      # Run the actual program with our arguments.
2897
 
"
2898
 
        case $host in
2899
 
        # Backslashes separate directories on plain windows
2900
 
        *-*-mingw | *-*-os2* | *-cegcc*)
2901
 
          $ECHO "\
2902
 
      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2903
 
"
2904
 
          ;;
2905
 
 
2906
 
        *)
2907
 
          $ECHO "\
2908
 
      exec \"\$progdir/\$program\" \${1+\"\$@\"}
2909
 
"
2910
 
          ;;
2911
 
        esac
2912
 
        $ECHO "\
2913
 
      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
2914
 
      exit 1
 
4136
      func_exec_program \${1+\"\$@\"}
2915
4137
    fi
2916
4138
  else
2917
4139
    # The program doesn't exist.
2918
4140
    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2919
4141
    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2920
 
    $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
 
4142
    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2921
4143
    exit 1
2922
4144
  fi
2923
4145
fi\
2924
4146
"
2925
4147
}
2926
 
# end: func_emit_wrapper_part2
2927
 
 
2928
 
 
2929
 
# func_emit_wrapper [arg=no]
2930
 
#
2931
 
# Emit a libtool wrapper script on stdout.
2932
 
# Don't directly open a file because we may want to
2933
 
# incorporate the script contents within a cygwin/mingw
2934
 
# wrapper executable.  Must ONLY be called from within
2935
 
# func_mode_link because it depends on a number of variables
2936
 
# set therein.
2937
 
#
2938
 
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2939
 
# variable will take.  If 'yes', then the emitted script
2940
 
# will assume that the directory in which it is stored is
2941
 
# the $objdir directory.  This is a cygwin/mingw-specific
2942
 
# behavior.
2943
 
func_emit_wrapper ()
2944
 
{
2945
 
        func_emit_wrapper_arg1=no
2946
 
        if test -n "$1" ; then
2947
 
          func_emit_wrapper_arg1=$1
2948
 
        fi
2949
 
 
2950
 
        # split this up so that func_emit_cwrapperexe_src
2951
 
        # can call each part independently.
2952
 
        func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
2953
 
        func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
2954
 
}
2955
 
 
2956
 
 
2957
 
# func_to_host_path arg
2958
 
#
2959
 
# Convert paths to host format when used with build tools.
2960
 
# Intended for use with "native" mingw (where libtool itself
2961
 
# is running under the msys shell), or in the following cross-
2962
 
# build environments:
2963
 
#    $build          $host
2964
 
#    mingw (msys)    mingw  [e.g. native]
2965
 
#    cygwin          mingw
2966
 
#    *nix + wine     mingw
2967
 
# where wine is equipped with the `winepath' executable.
2968
 
# In the native mingw case, the (msys) shell automatically
2969
 
# converts paths for any non-msys applications it launches,
2970
 
# but that facility isn't available from inside the cwrapper.
2971
 
# Similar accommodations are necessary for $host mingw and
2972
 
# $build cygwin.  Calling this function does no harm for other
2973
 
# $host/$build combinations not listed above.
2974
 
#
2975
 
# ARG is the path (on $build) that should be converted to
2976
 
# the proper representation for $host. The result is stored
2977
 
# in $func_to_host_path_result.
2978
 
func_to_host_path ()
2979
 
{
2980
 
  func_to_host_path_result="$1"
2981
 
  if test -n "$1" ; then
2982
 
    case $host in
2983
 
      *mingw* )
2984
 
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
2985
 
        case $build in
2986
 
          *mingw* ) # actually, msys
2987
 
            # awkward: cmd appends spaces to result
2988
 
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
2989
 
            func_to_host_path_tmp1=`( cmd //c echo "$1" |\
2990
 
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
2991
 
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2992
 
              $SED -e "$lt_sed_naive_backslashify"`
2993
 
            ;;
2994
 
          *cygwin* )
2995
 
            func_to_host_path_tmp1=`cygpath -w "$1"`
2996
 
            func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
2997
 
              $SED -e "$lt_sed_naive_backslashify"`
2998
 
            ;;
2999
 
          * )
3000
 
            # Unfortunately, winepath does not exit with a non-zero
3001
 
            # error code, so we are forced to check the contents of
3002
 
            # stdout. On the other hand, if the command is not
3003
 
            # found, the shell will set an exit code of 127 and print
3004
 
            # *an error message* to stdout. So we must check for both
3005
 
            # error code of zero AND non-empty stdout, which explains
3006
 
            # the odd construction:
3007
 
            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3008
 
            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3009
 
              func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3010
 
                $SED -e "$lt_sed_naive_backslashify"`
3011
 
            else
3012
 
              # Allow warning below.
3013
 
              func_to_host_path_result=""
3014
 
            fi
3015
 
            ;;
3016
 
        esac
3017
 
        if test -z "$func_to_host_path_result" ; then
3018
 
          func_error "Could not determine host path corresponding to"
3019
 
          func_error "  '$1'"
3020
 
          func_error "Continuing, but uninstalled executables may not work."
3021
 
          # Fallback:
3022
 
          func_to_host_path_result="$1"
3023
 
        fi
3024
 
        ;;
3025
 
    esac
3026
 
  fi
3027
 
}
3028
 
# end: func_to_host_path
3029
 
 
3030
 
# func_to_host_pathlist arg
3031
 
#
3032
 
# Convert pathlists to host format when used with build tools.
3033
 
# See func_to_host_path(), above. This function supports the
3034
 
# following $build/$host combinations (but does no harm for
3035
 
# combinations not listed here):
3036
 
#    $build          $host
3037
 
#    mingw (msys)    mingw  [e.g. native]
3038
 
#    cygwin          mingw
3039
 
#    *nix + wine     mingw
3040
 
#
3041
 
# Path separators are also converted from $build format to
3042
 
# $host format. If ARG begins or ends with a path separator
3043
 
# character, it is preserved (but converted to $host format)
3044
 
# on output.
3045
 
#
3046
 
# ARG is a pathlist (on $build) that should be converted to
3047
 
# the proper representation on $host. The result is stored
3048
 
# in $func_to_host_pathlist_result.
3049
 
func_to_host_pathlist ()
3050
 
{
3051
 
  func_to_host_pathlist_result="$1"
3052
 
  if test -n "$1" ; then
3053
 
    case $host in
3054
 
      *mingw* )
3055
 
        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3056
 
        # Remove leading and trailing path separator characters from
3057
 
        # ARG. msys behavior is inconsistent here, cygpath turns them
3058
 
        # into '.;' and ';.', and winepath ignores them completely.
3059
 
        func_to_host_pathlist_tmp2="$1"
3060
 
        # Once set for this call, this variable should not be
3061
 
        # reassigned. It is used in tha fallback case.
3062
 
        func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3063
 
          $SED -e 's|^:*||' -e 's|:*$||'`
3064
 
        case $build in
3065
 
          *mingw* ) # Actually, msys.
3066
 
            # Awkward: cmd appends spaces to result.
3067
 
            lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3068
 
            func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3069
 
              $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3070
 
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3071
 
              $SED -e "$lt_sed_naive_backslashify"`
3072
 
            ;;
3073
 
          *cygwin* )
3074
 
            func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3075
 
            func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3076
 
              $SED -e "$lt_sed_naive_backslashify"`
3077
 
            ;;
3078
 
          * )
3079
 
            # unfortunately, winepath doesn't convert pathlists
3080
 
            func_to_host_pathlist_result=""
3081
 
            func_to_host_pathlist_oldIFS=$IFS
3082
 
            IFS=:
3083
 
            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
3084
 
              IFS=$func_to_host_pathlist_oldIFS
3085
 
              if test -n "$func_to_host_pathlist_f" ; then
3086
 
                func_to_host_path "$func_to_host_pathlist_f"
3087
 
                if test -n "$func_to_host_path_result" ; then
3088
 
                  if test -z "$func_to_host_pathlist_result" ; then
3089
 
                    func_to_host_pathlist_result="$func_to_host_path_result"
3090
 
                  else
3091
 
                    func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
3092
 
                  fi
3093
 
                fi
3094
 
              fi
3095
 
              IFS=:
3096
 
            done
3097
 
            IFS=$func_to_host_pathlist_oldIFS
3098
 
            ;;
3099
 
        esac
3100
 
        if test -z "$func_to_host_pathlist_result" ; then
3101
 
          func_error "Could not determine the host path(s) corresponding to"
3102
 
          func_error "  '$1'"
3103
 
          func_error "Continuing, but uninstalled executables may not work."
3104
 
          # Fallback. This may break if $1 contains DOS-style drive
3105
 
          # specifications. The fix is not to complicate the expression
3106
 
          # below, but for the user to provide a working wine installation
3107
 
          # with winepath so that path translation in the cross-to-mingw
3108
 
          # case works properly.
3109
 
          lt_replace_pathsep_nix_to_dos="s|:|;|g"
3110
 
          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
3111
 
            $SED -e "$lt_replace_pathsep_nix_to_dos"`
3112
 
        fi
3113
 
        # Now, add the leading and trailing path separators back
3114
 
        case "$1" in
3115
 
          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3116
 
            ;;
3117
 
        esac
3118
 
        case "$1" in
3119
 
          *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
3120
 
            ;;
3121
 
        esac
3122
 
        ;;
3123
 
    esac
3124
 
  fi
3125
 
}
3126
 
# end: func_to_host_pathlist
 
4148
 
3127
4149
 
3128
4150
# func_emit_cwrapperexe_src
3129
4151
# emit the source code for a wrapper executable on stdout
3141
4163
 
3142
4164
   This wrapper executable should never be moved out of the build directory.
3143
4165
   If it is, it will not operate correctly.
3144
 
 
3145
 
   Currently, it simply execs the wrapper *script* "$SHELL $output",
3146
 
   but could eventually absorb all of the scripts functionality and
3147
 
   exec $objdir/$outputname directly.
3148
4166
*/
3149
4167
EOF
3150
4168
            cat <<"EOF"
 
4169
#ifdef _MSC_VER
 
4170
# define _CRT_SECURE_NO_DEPRECATE 1
 
4171
#endif
3151
4172
#include <stdio.h>
3152
4173
#include <stdlib.h>
3153
4174
#ifdef _MSC_VER
3154
4175
# include <direct.h>
3155
4176
# include <process.h>
3156
4177
# include <io.h>
3157
 
# define setmode _setmode
3158
4178
#else
3159
4179
# include <unistd.h>
3160
4180
# include <stdint.h>
3161
4181
# ifdef __CYGWIN__
3162
4182
#  include <io.h>
3163
 
#  define HAVE_SETENV
3164
 
#  ifdef __STRICT_ANSI__
3165
 
char *realpath (const char *, char *);
3166
 
int putenv (char *);
3167
 
int setenv (const char *, const char *, int);
3168
 
#  endif
3169
4183
# endif
3170
4184
#endif
3171
4185
#include <malloc.h>
3177
4191
#include <fcntl.h>
3178
4192
#include <sys/stat.h>
3179
4193
 
 
4194
/* declarations of non-ANSI functions */
 
4195
#if defined(__MINGW32__)
 
4196
# ifdef __STRICT_ANSI__
 
4197
int _putenv (const char *);
 
4198
# endif
 
4199
#elif defined(__CYGWIN__)
 
4200
# ifdef __STRICT_ANSI__
 
4201
char *realpath (const char *, char *);
 
4202
int putenv (char *);
 
4203
int setenv (const char *, const char *, int);
 
4204
# endif
 
4205
/* #elif defined (other platforms) ... */
 
4206
#endif
 
4207
 
 
4208
/* portability defines, excluding path handling macros */
 
4209
#if defined(_MSC_VER)
 
4210
# define setmode _setmode
 
4211
# define stat    _stat
 
4212
# define chmod   _chmod
 
4213
# define getcwd  _getcwd
 
4214
# define putenv  _putenv
 
4215
# define S_IXUSR _S_IEXEC
 
4216
# ifndef _INTPTR_T_DEFINED
 
4217
#  define _INTPTR_T_DEFINED
 
4218
#  define intptr_t int
 
4219
# endif
 
4220
#elif defined(__MINGW32__)
 
4221
# define setmode _setmode
 
4222
# define stat    _stat
 
4223
# define chmod   _chmod
 
4224
# define getcwd  _getcwd
 
4225
# define putenv  _putenv
 
4226
#elif defined(__CYGWIN__)
 
4227
# define HAVE_SETENV
 
4228
# define FOPEN_WB "wb"
 
4229
/* #elif defined (other platforms) ... */
 
4230
#endif
 
4231
 
3180
4232
#if defined(PATH_MAX)
3181
4233
# define LT_PATHMAX PATH_MAX
3182
4234
#elif defined(MAXPATHLEN)
3192
4244
# define S_IXGRP 0
3193
4245
#endif
3194
4246
 
3195
 
#ifdef _MSC_VER
3196
 
# define S_IXUSR _S_IEXEC
3197
 
# define stat _stat
3198
 
# ifndef _INTPTR_T_DEFINED
3199
 
#  define intptr_t int
3200
 
# endif
3201
 
#endif
3202
 
 
 
4247
/* path handling portability macros */
3203
4248
#ifndef DIR_SEPARATOR
3204
4249
# define DIR_SEPARATOR '/'
3205
4250
# define PATH_SEPARATOR ':'
3230
4275
# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3231
4276
#endif /* PATH_SEPARATOR_2 */
3232
4277
 
3233
 
#ifdef __CYGWIN__
3234
 
# define FOPEN_WB "wb"
3235
 
#endif
3236
 
 
3237
4278
#ifndef FOPEN_WB
3238
4279
# define FOPEN_WB "w"
3239
4280
#endif
3246
4287
  if (stale) { free ((void *) stale); stale = 0; } \
3247
4288
} while (0)
3248
4289
 
3249
 
#undef LTWRAPPER_DEBUGPRINTF
3250
 
#if defined DEBUGWRAPPER
3251
 
# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3252
 
static void
3253
 
ltwrapper_debugprintf (const char *fmt, ...)
3254
 
{
3255
 
    va_list args;
3256
 
    va_start (args, fmt);
3257
 
    (void) vfprintf (stderr, fmt, args);
3258
 
    va_end (args);
3259
 
}
 
4290
#if defined(LT_DEBUGWRAPPER)
 
4291
static int lt_debug = 1;
3260
4292
#else
3261
 
# define LTWRAPPER_DEBUGPRINTF(args)
 
4293
static int lt_debug = 0;
3262
4294
#endif
3263
4295
 
3264
 
const char *program_name = NULL;
 
4296
const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
3265
4297
 
3266
4298
void *xmalloc (size_t num);
3267
4299
char *xstrdup (const char *string);
3271
4303
int make_executable (const char *path);
3272
4304
int check_executable (const char *path);
3273
4305
char *strendzap (char *str, const char *pat);
3274
 
void lt_fatal (const char *message, ...);
 
4306
void lt_debugprintf (const char *file, int line, const char *fmt, ...);
 
4307
void lt_fatal (const char *file, int line, const char *message, ...);
 
4308
static const char *nonnull (const char *s);
 
4309
static const char *nonempty (const char *s);
3275
4310
void lt_setenv (const char *name, const char *value);
3276
4311
char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3277
 
void lt_opt_process_env_set (const char *arg);
3278
 
void lt_opt_process_env_prepend (const char *arg);
3279
 
void lt_opt_process_env_append (const char *arg);
3280
 
int lt_split_name_value (const char *arg, char** name, char** value);
3281
4312
void lt_update_exe_path (const char *name, const char *value);
3282
4313
void lt_update_lib_path (const char *name, const char *value);
3283
 
 
3284
 
static const char *script_text_part1 =
3285
 
EOF
3286
 
 
3287
 
            func_emit_wrapper_part1 yes |
3288
 
                $SED -e 's/\([\\"]\)/\\\1/g' \
3289
 
                     -e 's/^/  "/' -e 's/$/\\n"/'
3290
 
            echo ";"
3291
 
            cat <<EOF
3292
 
 
3293
 
static const char *script_text_part2 =
3294
 
EOF
3295
 
            func_emit_wrapper_part2 yes |
3296
 
                $SED -e 's/\([\\"]\)/\\\1/g' \
3297
 
                     -e 's/^/  "/' -e 's/$/\\n"/'
3298
 
            echo ";"
3299
 
 
3300
 
            cat <<EOF
3301
 
const char * MAGIC_EXE = "$magic_exe";
 
4314
char **prepare_spawn (char **argv);
 
4315
void lt_dump_script (FILE *f);
 
4316
EOF
 
4317
 
 
4318
            cat <<EOF
 
4319
volatile const char * MAGIC_EXE = "$magic_exe";
3302
4320
const char * LIB_PATH_VARNAME = "$shlibpath_var";
3303
4321
EOF
3304
4322
 
3305
4323
            if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3306
 
              func_to_host_pathlist "$temp_rpath"
 
4324
              func_to_host_path "$temp_rpath"
3307
4325
              cat <<EOF
3308
 
const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
 
4326
const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
3309
4327
EOF
3310
4328
            else
3311
4329
              cat <<"EOF"
3314
4332
            fi
3315
4333
 
3316
4334
            if test -n "$dllsearchpath"; then
3317
 
              func_to_host_pathlist "$dllsearchpath:"
 
4335
              func_to_host_path "$dllsearchpath:"
3318
4336
              cat <<EOF
3319
4337
const char * EXE_PATH_VARNAME = "PATH";
3320
 
const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
 
4338
const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
3321
4339
EOF
3322
4340
            else
3323
4341
              cat <<"EOF"
3340
4358
            cat <<"EOF"
3341
4359
 
3342
4360
#define LTWRAPPER_OPTION_PREFIX         "--lt-"
3343
 
#define LTWRAPPER_OPTION_PREFIX_LENGTH  5
3344
4361
 
3345
 
static const size_t opt_prefix_len         = LTWRAPPER_OPTION_PREFIX_LENGTH;
3346
4362
static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3347
 
 
3348
4363
static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
3349
 
 
3350
 
static const size_t env_set_opt_len     = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3351
 
static const char *env_set_opt          = LTWRAPPER_OPTION_PREFIX "env-set";
3352
 
  /* argument is putenv-style "foo=bar", value of foo is set to bar */
3353
 
 
3354
 
static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3355
 
static const char *env_prepend_opt      = LTWRAPPER_OPTION_PREFIX "env-prepend";
3356
 
  /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3357
 
 
3358
 
static const size_t env_append_opt_len  = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3359
 
static const char *env_append_opt       = LTWRAPPER_OPTION_PREFIX "env-append";
3360
 
  /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
 
4364
static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
3361
4365
 
3362
4366
int
3363
4367
main (int argc, char *argv[])
3374
4378
  int i;
3375
4379
 
3376
4380
  program_name = (char *) xstrdup (base_name (argv[0]));
3377
 
  LTWRAPPER_DEBUGPRINTF (("(main) argv[0]      : %s\n", argv[0]));
3378
 
  LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
 
4381
  newargz = XMALLOC (char *, argc + 1);
3379
4382
 
3380
 
  /* very simple arg parsing; don't want to rely on getopt */
 
4383
  /* very simple arg parsing; don't want to rely on getopt
 
4384
   * also, copy all non cwrapper options to newargz, except
 
4385
   * argz[0], which is handled differently
 
4386
   */
 
4387
  newargc=0;
3381
4388
  for (i = 1; i < argc; i++)
3382
4389
    {
3383
4390
      if (strcmp (argv[i], dumpscript_opt) == 0)
3391
4398
              esac
3392
4399
 
3393
4400
            cat <<"EOF"
3394
 
          printf ("%s", script_text_part1);
3395
 
          printf ("%s", script_text_part2);
 
4401
          lt_dump_script (stdout);
3396
4402
          return 0;
3397
4403
        }
 
4404
      if (strcmp (argv[i], debug_opt) == 0)
 
4405
        {
 
4406
          lt_debug = 1;
 
4407
          continue;
 
4408
        }
 
4409
      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
 
4410
        {
 
4411
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
 
4412
             namespace, but it is not one of the ones we know about and
 
4413
             have already dealt with, above (inluding dump-script), then
 
4414
             report an error. Otherwise, targets might begin to believe
 
4415
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
 
4416
             namespace. The first time any user complains about this, we'll
 
4417
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
 
4418
             or a configure.ac-settable value.
 
4419
           */
 
4420
          lt_fatal (__FILE__, __LINE__,
 
4421
                    "unrecognized %s option: '%s'",
 
4422
                    ltwrapper_option_prefix, argv[i]);
 
4423
        }
 
4424
      /* otherwise ... */
 
4425
      newargz[++newargc] = xstrdup (argv[i]);
3398
4426
    }
3399
 
 
3400
 
  newargz = XMALLOC (char *, argc + 1);
 
4427
  newargz[++newargc] = NULL;
 
4428
 
 
4429
EOF
 
4430
            cat <<EOF
 
4431
  /* The GNU banner must be the first non-error debug message */
 
4432
  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
 
4433
EOF
 
4434
            cat <<"EOF"
 
4435
  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
 
4436
  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
 
4437
 
3401
4438
  tmp_pathspec = find_executable (argv[0]);
3402
4439
  if (tmp_pathspec == NULL)
3403
 
    lt_fatal ("Couldn't find %s", argv[0]);
3404
 
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3405
 
                          tmp_pathspec));
 
4440
    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
 
4441
  lt_debugprintf (__FILE__, __LINE__,
 
4442
                  "(main) found exe (before symlink chase) at: %s\n",
 
4443
                  tmp_pathspec);
3406
4444
 
3407
4445
  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3408
 
  LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3409
 
                          actual_cwrapper_path));
 
4446
  lt_debugprintf (__FILE__, __LINE__,
 
4447
                  "(main) found exe (after symlink chase) at: %s\n",
 
4448
                  actual_cwrapper_path);
3410
4449
  XFREE (tmp_pathspec);
3411
4450
 
3412
 
  actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
 
4451
  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
3413
4452
  strendzap (actual_cwrapper_path, actual_cwrapper_name);
3414
4453
 
3415
4454
  /* wrapper name transforms */
3427
4466
  target_name = tmp_pathspec;
3428
4467
  tmp_pathspec = 0;
3429
4468
 
3430
 
  LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
3431
 
                          target_name));
 
4469
  lt_debugprintf (__FILE__, __LINE__,
 
4470
                  "(main) libtool target name: %s\n",
 
4471
                  target_name);
3432
4472
EOF
3433
4473
 
3434
4474
            cat <<EOF
3478
4518
 
3479
4519
  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3480
4520
  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
 
4521
  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
 
4522
     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
 
4523
     because on Windows, both *_VARNAMEs are PATH but uninstalled
 
4524
     libraries must come first. */
 
4525
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3481
4526
  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3482
 
  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3483
 
 
3484
 
  newargc=0;
3485
 
  for (i = 1; i < argc; i++)
3486
 
    {
3487
 
      if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3488
 
        {
3489
 
          if (argv[i][env_set_opt_len] == '=')
3490
 
            {
3491
 
              const char *p = argv[i] + env_set_opt_len + 1;
3492
 
              lt_opt_process_env_set (p);
3493
 
            }
3494
 
          else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
3495
 
            {
3496
 
              lt_opt_process_env_set (argv[++i]); /* don't copy */
3497
 
            }
3498
 
          else
3499
 
            lt_fatal ("%s missing required argument", env_set_opt);
3500
 
          continue;
3501
 
        }
3502
 
      if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
3503
 
        {
3504
 
          if (argv[i][env_prepend_opt_len] == '=')
3505
 
            {
3506
 
              const char *p = argv[i] + env_prepend_opt_len + 1;
3507
 
              lt_opt_process_env_prepend (p);
3508
 
            }
3509
 
          else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
3510
 
            {
3511
 
              lt_opt_process_env_prepend (argv[++i]); /* don't copy */
3512
 
            }
3513
 
          else
3514
 
            lt_fatal ("%s missing required argument", env_prepend_opt);
3515
 
          continue;
3516
 
        }
3517
 
      if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
3518
 
        {
3519
 
          if (argv[i][env_append_opt_len] == '=')
3520
 
            {
3521
 
              const char *p = argv[i] + env_append_opt_len + 1;
3522
 
              lt_opt_process_env_append (p);
3523
 
            }
3524
 
          else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
3525
 
            {
3526
 
              lt_opt_process_env_append (argv[++i]); /* don't copy */
3527
 
            }
3528
 
          else
3529
 
            lt_fatal ("%s missing required argument", env_append_opt);
3530
 
          continue;
3531
 
        }
3532
 
      if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
3533
 
        {
3534
 
          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3535
 
             namespace, but it is not one of the ones we know about and
3536
 
             have already dealt with, above (inluding dump-script), then
3537
 
             report an error. Otherwise, targets might begin to believe
3538
 
             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3539
 
             namespace. The first time any user complains about this, we'll
3540
 
             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
3541
 
             or a configure.ac-settable value.
3542
 
           */
3543
 
          lt_fatal ("Unrecognized option in %s namespace: '%s'",
3544
 
                    ltwrapper_option_prefix, argv[i]);
3545
 
        }
3546
 
      /* otherwise ... */
3547
 
      newargz[++newargc] = xstrdup (argv[i]);
3548
 
    }
3549
 
  newargz[++newargc] = NULL;
3550
 
 
3551
 
  LTWRAPPER_DEBUGPRINTF     (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
 
4527
 
 
4528
  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
 
4529
                  nonnull (lt_argv_zero));
3552
4530
  for (i = 0; i < newargc; i++)
3553
4531
    {
3554
 
      LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d]   : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
 
4532
      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
 
4533
                      i, nonnull (newargz[i]));
3555
4534
    }
3556
4535
 
3557
4536
EOF
3560
4539
              mingw*)
3561
4540
                cat <<"EOF"
3562
4541
  /* execv doesn't actually work on mingw as expected on unix */
 
4542
  newargz = prepare_spawn (newargz);
3563
4543
  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3564
4544
  if (rval == -1)
3565
4545
    {
3566
4546
      /* failed to start process */
3567
 
      LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
 
4547
      lt_debugprintf (__FILE__, __LINE__,
 
4548
                      "(main) failed to launch target \"%s\": %s\n",
 
4549
                      lt_argv_zero, nonnull (strerror (errno)));
3568
4550
      return 127;
3569
4551
    }
3570
4552
  return rval;
3586
4568
{
3587
4569
  void *p = (void *) malloc (num);
3588
4570
  if (!p)
3589
 
    lt_fatal ("Memory exhausted");
 
4571
    lt_fatal (__FILE__, __LINE__, "memory exhausted");
3590
4572
 
3591
4573
  return p;
3592
4574
}
3620
4602
{
3621
4603
  struct stat st;
3622
4604
 
3623
 
  LTWRAPPER_DEBUGPRINTF (("(check_executable)  : %s\n",
3624
 
                          path ? (*path ? path : "EMPTY!") : "NULL!"));
 
4605
  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
 
4606
                  nonempty (path));
3625
4607
  if ((!path) || (!*path))
3626
4608
    return 0;
3627
4609
 
3638
4620
  int rval = 0;
3639
4621
  struct stat st;
3640
4622
 
3641
 
  LTWRAPPER_DEBUGPRINTF (("(make_executable)   : %s\n",
3642
 
                          path ? (*path ? path : "EMPTY!") : "NULL!"));
 
4623
  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
 
4624
                  nonempty (path));
3643
4625
  if ((!path) || (!*path))
3644
4626
    return 0;
3645
4627
 
3665
4647
  int tmp_len;
3666
4648
  char *concat_name;
3667
4649
 
3668
 
  LTWRAPPER_DEBUGPRINTF (("(find_executable)   : %s\n",
3669
 
                          wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
 
4650
  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
 
4651
                  nonempty (wrapper));
3670
4652
 
3671
4653
  if ((wrapper == NULL) || (*wrapper == '\0'))
3672
4654
    return NULL;
3719
4701
                {
3720
4702
                  /* empty path: current directory */
3721
4703
                  if (getcwd (tmp, LT_PATHMAX) == NULL)
3722
 
                    lt_fatal ("getcwd failed");
 
4704
                    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
 
4705
                              nonnull (strerror (errno)));
3723
4706
                  tmp_len = strlen (tmp);
3724
4707
                  concat_name =
3725
4708
                    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3744
4727
    }
3745
4728
  /* Relative path | not found in path: prepend cwd */
3746
4729
  if (getcwd (tmp, LT_PATHMAX) == NULL)
3747
 
    lt_fatal ("getcwd failed");
 
4730
    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
 
4731
              nonnull (strerror (errno)));
3748
4732
  tmp_len = strlen (tmp);
3749
4733
  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3750
4734
  memcpy (concat_name, tmp, tmp_len);
3770
4754
  int has_symlinks = 0;
3771
4755
  while (strlen (tmp_pathspec) && !has_symlinks)
3772
4756
    {
3773
 
      LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
3774
 
                              tmp_pathspec));
 
4757
      lt_debugprintf (__FILE__, __LINE__,
 
4758
                      "checking path component for symlinks: %s\n",
 
4759
                      tmp_pathspec);
3775
4760
      if (lstat (tmp_pathspec, &s) == 0)
3776
4761
        {
3777
4762
          if (S_ISLNK (s.st_mode) != 0)
3793
4778
        }
3794
4779
      else
3795
4780
        {
3796
 
          char *errstr = strerror (errno);
3797
 
          lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
 
4781
          lt_fatal (__FILE__, __LINE__,
 
4782
                    "error accessing file \"%s\": %s",
 
4783
                    tmp_pathspec, nonnull (strerror (errno)));
3798
4784
        }
3799
4785
    }
3800
4786
  XFREE (tmp_pathspec);
3807
4793
  tmp_pathspec = realpath (pathspec, buf);
3808
4794
  if (tmp_pathspec == 0)
3809
4795
    {
3810
 
      lt_fatal ("Could not follow symlinks for %s", pathspec);
 
4796
      lt_fatal (__FILE__, __LINE__,
 
4797
                "could not follow symlinks for %s", pathspec);
3811
4798
    }
3812
4799
  return xstrdup (tmp_pathspec);
3813
4800
#endif
3833
4820
  return str;
3834
4821
}
3835
4822
 
 
4823
void
 
4824
lt_debugprintf (const char *file, int line, const char *fmt, ...)
 
4825
{
 
4826
  va_list args;
 
4827
  if (lt_debug)
 
4828
    {
 
4829
      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
 
4830
      va_start (args, fmt);
 
4831
      (void) vfprintf (stderr, fmt, args);
 
4832
      va_end (args);
 
4833
    }
 
4834
}
 
4835
 
3836
4836
static void
3837
 
lt_error_core (int exit_status, const char *mode,
 
4837
lt_error_core (int exit_status, const char *file,
 
4838
               int line, const char *mode,
3838
4839
               const char *message, va_list ap)
3839
4840
{
3840
 
  fprintf (stderr, "%s: %s: ", program_name, mode);
 
4841
  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
3841
4842
  vfprintf (stderr, message, ap);
3842
4843
  fprintf (stderr, ".\n");
3843
4844
 
3846
4847
}
3847
4848
 
3848
4849
void
3849
 
lt_fatal (const char *message, ...)
 
4850
lt_fatal (const char *file, int line, const char *message, ...)
3850
4851
{
3851
4852
  va_list ap;
3852
4853
  va_start (ap, message);
3853
 
  lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
 
4854
  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
3854
4855
  va_end (ap);
3855
4856
}
3856
4857
 
 
4858
static const char *
 
4859
nonnull (const char *s)
 
4860
{
 
4861
  return s ? s : "(null)";
 
4862
}
 
4863
 
 
4864
static const char *
 
4865
nonempty (const char *s)
 
4866
{
 
4867
  return (s && !*s) ? "(empty)" : nonnull (s);
 
4868
}
 
4869
 
3857
4870
void
3858
4871
lt_setenv (const char *name, const char *value)
3859
4872
{
3860
 
  LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
3861
 
                          (name ? name : "<NULL>"),
3862
 
                          (value ? value : "<NULL>")));
 
4873
  lt_debugprintf (__FILE__, __LINE__,
 
4874
                  "(lt_setenv) setting '%s' to '%s'\n",
 
4875
                  nonnull (name), nonnull (value));
3863
4876
  {
3864
4877
#ifdef HAVE_SETENV
3865
4878
    /* always make a copy, for consistency with !HAVE_SETENV */
3904
4917
  return new_value;
3905
4918
}
3906
4919
 
3907
 
int
3908
 
lt_split_name_value (const char *arg, char** name, char** value)
3909
 
{
3910
 
  const char *p;
3911
 
  int len;
3912
 
  if (!arg || !*arg)
3913
 
    return 1;
3914
 
 
3915
 
  p = strchr (arg, (int)'=');
3916
 
 
3917
 
  if (!p)
3918
 
    return 1;
3919
 
 
3920
 
  *value = xstrdup (++p);
3921
 
 
3922
 
  len = strlen (arg) - strlen (*value);
3923
 
  *name = XMALLOC (char, len);
3924
 
  strncpy (*name, arg, len-1);
3925
 
  (*name)[len - 1] = '\0';
3926
 
 
3927
 
  return 0;
3928
 
}
3929
 
 
3930
 
void
3931
 
lt_opt_process_env_set (const char *arg)
3932
 
{
3933
 
  char *name = NULL;
3934
 
  char *value = NULL;
3935
 
 
3936
 
  if (lt_split_name_value (arg, &name, &value) != 0)
3937
 
    {
3938
 
      XFREE (name);
3939
 
      XFREE (value);
3940
 
      lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
3941
 
    }
3942
 
 
3943
 
  lt_setenv (name, value);
3944
 
  XFREE (name);
3945
 
  XFREE (value);
3946
 
}
3947
 
 
3948
 
void
3949
 
lt_opt_process_env_prepend (const char *arg)
3950
 
{
3951
 
  char *name = NULL;
3952
 
  char *value = NULL;
3953
 
  char *new_value = NULL;
3954
 
 
3955
 
  if (lt_split_name_value (arg, &name, &value) != 0)
3956
 
    {
3957
 
      XFREE (name);
3958
 
      XFREE (value);
3959
 
      lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
3960
 
    }
3961
 
 
3962
 
  new_value = lt_extend_str (getenv (name), value, 0);
3963
 
  lt_setenv (name, new_value);
3964
 
  XFREE (new_value);
3965
 
  XFREE (name);
3966
 
  XFREE (value);
3967
 
}
3968
 
 
3969
 
void
3970
 
lt_opt_process_env_append (const char *arg)
3971
 
{
3972
 
  char *name = NULL;
3973
 
  char *value = NULL;
3974
 
  char *new_value = NULL;
3975
 
 
3976
 
  if (lt_split_name_value (arg, &name, &value) != 0)
3977
 
    {
3978
 
      XFREE (name);
3979
 
      XFREE (value);
3980
 
      lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
3981
 
    }
3982
 
 
3983
 
  new_value = lt_extend_str (getenv (name), value, 1);
3984
 
  lt_setenv (name, new_value);
3985
 
  XFREE (new_value);
3986
 
  XFREE (name);
3987
 
  XFREE (value);
3988
 
}
3989
 
 
3990
4920
void
3991
4921
lt_update_exe_path (const char *name, const char *value)
3992
4922
{
3993
 
  LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
3994
 
                          (name ? name : "<NULL>"),
3995
 
                          (value ? value : "<NULL>")));
 
4923
  lt_debugprintf (__FILE__, __LINE__,
 
4924
                  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
 
4925
                  nonnull (name), nonnull (value));
3996
4926
 
3997
4927
  if (name && *name && value && *value)
3998
4928
    {
4011
4941
void
4012
4942
lt_update_lib_path (const char *name, const char *value)
4013
4943
{
4014
 
  LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4015
 
                          (name ? name : "<NULL>"),
4016
 
                          (value ? value : "<NULL>")));
 
4944
  lt_debugprintf (__FILE__, __LINE__,
 
4945
                  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
 
4946
                  nonnull (name), nonnull (value));
4017
4947
 
4018
4948
  if (name && *name && value && *value)
4019
4949
    {
4023
4953
    }
4024
4954
}
4025
4955
 
4026
 
 
 
4956
EOF
 
4957
            case $host_os in
 
4958
              mingw*)
 
4959
                cat <<"EOF"
 
4960
 
 
4961
/* Prepares an argument vector before calling spawn().
 
4962
   Note that spawn() does not by itself call the command interpreter
 
4963
     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
 
4964
      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
 
4965
         GetVersionEx(&v);
 
4966
         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
 
4967
      }) ? "cmd.exe" : "command.com").
 
4968
   Instead it simply concatenates the arguments, separated by ' ', and calls
 
4969
   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
 
4970
   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
 
4971
   special way:
 
4972
   - Space and tab are interpreted as delimiters. They are not treated as
 
4973
     delimiters if they are surrounded by double quotes: "...".
 
4974
   - Unescaped double quotes are removed from the input. Their only effect is
 
4975
     that within double quotes, space and tab are treated like normal
 
4976
     characters.
 
4977
   - Backslashes not followed by double quotes are not special.
 
4978
   - But 2*n+1 backslashes followed by a double quote become
 
4979
     n backslashes followed by a double quote (n >= 0):
 
4980
       \" -> "
 
4981
       \\\" -> \"
 
4982
       \\\\\" -> \\"
 
4983
 */
 
4984
#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
 
4985
#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
 
4986
char **
 
4987
prepare_spawn (char **argv)
 
4988
{
 
4989
  size_t argc;
 
4990
  char **new_argv;
 
4991
  size_t i;
 
4992
 
 
4993
  /* Count number of arguments.  */
 
4994
  for (argc = 0; argv[argc] != NULL; argc++)
 
4995
    ;
 
4996
 
 
4997
  /* Allocate new argument vector.  */
 
4998
  new_argv = XMALLOC (char *, argc + 1);
 
4999
 
 
5000
  /* Put quoted arguments into the new argument vector.  */
 
5001
  for (i = 0; i < argc; i++)
 
5002
    {
 
5003
      const char *string = argv[i];
 
5004
 
 
5005
      if (string[0] == '\0')
 
5006
        new_argv[i] = xstrdup ("\"\"");
 
5007
      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
 
5008
        {
 
5009
          int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
 
5010
          size_t length;
 
5011
          unsigned int backslashes;
 
5012
          const char *s;
 
5013
          char *quoted_string;
 
5014
          char *p;
 
5015
 
 
5016
          length = 0;
 
5017
          backslashes = 0;
 
5018
          if (quote_around)
 
5019
            length++;
 
5020
          for (s = string; *s != '\0'; s++)
 
5021
            {
 
5022
              char c = *s;
 
5023
              if (c == '"')
 
5024
                length += backslashes + 1;
 
5025
              length++;
 
5026
              if (c == '\\')
 
5027
                backslashes++;
 
5028
              else
 
5029
                backslashes = 0;
 
5030
            }
 
5031
          if (quote_around)
 
5032
            length += backslashes + 1;
 
5033
 
 
5034
          quoted_string = XMALLOC (char, length + 1);
 
5035
 
 
5036
          p = quoted_string;
 
5037
          backslashes = 0;
 
5038
          if (quote_around)
 
5039
            *p++ = '"';
 
5040
          for (s = string; *s != '\0'; s++)
 
5041
            {
 
5042
              char c = *s;
 
5043
              if (c == '"')
 
5044
                {
 
5045
                  unsigned int j;
 
5046
                  for (j = backslashes + 1; j > 0; j--)
 
5047
                    *p++ = '\\';
 
5048
                }
 
5049
              *p++ = c;
 
5050
              if (c == '\\')
 
5051
                backslashes++;
 
5052
              else
 
5053
                backslashes = 0;
 
5054
            }
 
5055
          if (quote_around)
 
5056
            {
 
5057
              unsigned int j;
 
5058
              for (j = backslashes; j > 0; j--)
 
5059
                *p++ = '\\';
 
5060
              *p++ = '"';
 
5061
            }
 
5062
          *p = '\0';
 
5063
 
 
5064
          new_argv[i] = quoted_string;
 
5065
        }
 
5066
      else
 
5067
        new_argv[i] = (char *) string;
 
5068
    }
 
5069
  new_argv[argc] = NULL;
 
5070
 
 
5071
  return new_argv;
 
5072
}
 
5073
EOF
 
5074
                ;;
 
5075
            esac
 
5076
 
 
5077
            cat <<"EOF"
 
5078
void lt_dump_script (FILE* f)
 
5079
{
 
5080
EOF
 
5081
            func_emit_wrapper yes |
 
5082
              $SED -n -e '
 
5083
s/^\(.\{79\}\)\(..*\)/\1\
 
5084
\2/
 
5085
h
 
5086
s/\([\\"]\)/\\\1/g
 
5087
s/$/\\n/
 
5088
s/\([^\n]*\).*/  fputs ("\1", f);/p
 
5089
g
 
5090
D'
 
5091
            cat <<"EOF"
 
5092
}
4027
5093
EOF
4028
5094
}
4029
5095
# end: func_emit_cwrapperexe_src
4030
5096
 
 
5097
# func_win32_import_lib_p ARG
 
5098
# True if ARG is an import lib, as indicated by $file_magic_cmd
 
5099
func_win32_import_lib_p ()
 
5100
{
 
5101
    $opt_debug
 
5102
    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
 
5103
    *import*) : ;;
 
5104
    *) false ;;
 
5105
    esac
 
5106
}
 
5107
 
4031
5108
# func_mode_link arg...
4032
5109
func_mode_link ()
4033
5110
{
4072
5149
    new_inherited_linker_flags=
4073
5150
 
4074
5151
    avoid_version=no
 
5152
    bindir=
4075
5153
    dlfiles=
4076
5154
    dlprefiles=
4077
5155
    dlself=no
4164
5242
        esac
4165
5243
 
4166
5244
        case $prev in
 
5245
        bindir)
 
5246
          bindir="$arg"
 
5247
          prev=
 
5248
          continue
 
5249
          ;;
4167
5250
        dlfiles|dlprefiles)
4168
5251
          if test "$preload" = no; then
4169
5252
            # Add the symbol object into the linking commands.
4195
5278
            ;;
4196
5279
          *)
4197
5280
            if test "$prev" = dlfiles; then
4198
 
              dlfiles="$dlfiles $arg"
 
5281
              func_append dlfiles " $arg"
4199
5282
            else
4200
 
              dlprefiles="$dlprefiles $arg"
 
5283
              func_append dlprefiles " $arg"
4201
5284
            fi
4202
5285
            prev=
4203
5286
            continue
4221
5304
            *-*-darwin*)
4222
5305
              case "$deplibs " in
4223
5306
                *" $qarg.ltframework "*) ;;
4224
 
                *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
 
5307
                *) func_append deplibs " $qarg.ltframework" # this is fixed later
4225
5308
                   ;;
4226
5309
              esac
4227
5310
              ;;
4240
5323
            moreargs=
4241
5324
            for fil in `cat "$save_arg"`
4242
5325
            do
4243
 
#             moreargs="$moreargs $fil"
 
5326
#             func_append moreargs " $fil"
4244
5327
              arg=$fil
4245
5328
              # A libtool-controlled object.
4246
5329
 
4269
5352
 
4270
5353
                  if test "$prev" = dlfiles; then
4271
5354
                    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4272
 
                      dlfiles="$dlfiles $pic_object"
 
5355
                      func_append dlfiles " $pic_object"
4273
5356
                      prev=
4274
5357
                      continue
4275
5358
                    else
4281
5364
                  # CHECK ME:  I think I busted this.  -Ossama
4282
5365
                  if test "$prev" = dlprefiles; then
4283
5366
                    # Preload the old-style object.
4284
 
                    dlprefiles="$dlprefiles $pic_object"
 
5367
                    func_append dlprefiles " $pic_object"
4285
5368
                    prev=
4286
5369
                  fi
4287
5370
 
4351
5434
          if test "$prev" = rpath; then
4352
5435
            case "$rpath " in
4353
5436
            *" $arg "*) ;;
4354
 
            *) rpath="$rpath $arg" ;;
 
5437
            *) func_append rpath " $arg" ;;
4355
5438
            esac
4356
5439
          else
4357
5440
            case "$xrpath " in
4358
5441
            *" $arg "*) ;;
4359
 
            *) xrpath="$xrpath $arg" ;;
 
5442
            *) func_append xrpath " $arg" ;;
4360
5443
            esac
4361
5444
          fi
4362
5445
          prev=
4368
5451
          continue
4369
5452
          ;;
4370
5453
        weak)
4371
 
          weak_libs="$weak_libs $arg"
 
5454
          func_append weak_libs " $arg"
4372
5455
          prev=
4373
5456
          continue
4374
5457
          ;;
4375
5458
        xcclinker)
4376
 
          linker_flags="$linker_flags $qarg"
4377
 
          compiler_flags="$compiler_flags $qarg"
 
5459
          func_append linker_flags " $qarg"
 
5460
          func_append compiler_flags " $qarg"
4378
5461
          prev=
4379
5462
          func_append compile_command " $qarg"
4380
5463
          func_append finalize_command " $qarg"
4381
5464
          continue
4382
5465
          ;;
4383
5466
        xcompiler)
4384
 
          compiler_flags="$compiler_flags $qarg"
 
5467
          func_append compiler_flags " $qarg"
4385
5468
          prev=
4386
5469
          func_append compile_command " $qarg"
4387
5470
          func_append finalize_command " $qarg"
4388
5471
          continue
4389
5472
          ;;
4390
5473
        xlinker)
4391
 
          linker_flags="$linker_flags $qarg"
4392
 
          compiler_flags="$compiler_flags $wl$qarg"
 
5474
          func_append linker_flags " $qarg"
 
5475
          func_append compiler_flags " $wl$qarg"
4393
5476
          prev=
4394
5477
          func_append compile_command " $wl$qarg"
4395
5478
          func_append finalize_command " $wl$qarg"
4425
5508
        continue
4426
5509
        ;;
4427
5510
 
 
5511
      -bindir)
 
5512
        prev=bindir
 
5513
        continue
 
5514
        ;;
 
5515
 
4428
5516
      -dlopen)
4429
5517
        prev=dlfiles
4430
5518
        continue
4475
5563
        ;;
4476
5564
 
4477
5565
      -L*)
4478
 
        func_stripname '-L' '' "$arg"
4479
 
        dir=$func_stripname_result
4480
 
        if test -z "$dir"; then
 
5566
        func_stripname "-L" '' "$arg"
 
5567
        if test -z "$func_stripname_result"; then
4481
5568
          if test "$#" -gt 0; then
4482
5569
            func_fatal_error "require no space between \`-L' and \`$1'"
4483
5570
          else
4484
5571
            func_fatal_error "need path for \`-L' option"
4485
5572
          fi
4486
5573
        fi
 
5574
        func_resolve_sysroot "$func_stripname_result"
 
5575
        dir=$func_resolve_sysroot_result
4487
5576
        # We need an absolute path.
4488
5577
        case $dir in
4489
5578
        [\\/]* | [A-Za-z]:[\\/]*) ;;
4495
5584
          ;;
4496
5585
        esac
4497
5586
        case "$deplibs " in
4498
 
        *" -L$dir "*) ;;
 
5587
        *" -L$dir "* | *" $arg "*)
 
5588
          # Will only happen for absolute or sysroot arguments
 
5589
          ;;
4499
5590
        *)
4500
 
          deplibs="$deplibs -L$dir"
4501
 
          lib_search_path="$lib_search_path $dir"
 
5591
          # Preserve sysroot, but never include relative directories
 
5592
          case $dir in
 
5593
            [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
 
5594
            *) func_append deplibs " -L$dir" ;;
 
5595
          esac
 
5596
          func_append lib_search_path " $dir"
4502
5597
          ;;
4503
5598
        esac
4504
5599
        case $host in
4505
5600
        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4506
 
          testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
 
5601
          testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
4507
5602
          case :$dllsearchpath: in
4508
5603
          *":$dir:"*) ;;
4509
5604
          ::) dllsearchpath=$dir;;
4510
 
          *) dllsearchpath="$dllsearchpath:$dir";;
 
5605
          *) func_append dllsearchpath ":$dir";;
4511
5606
          esac
4512
5607
          case :$dllsearchpath: in
4513
5608
          *":$testbindir:"*) ;;
4514
5609
          ::) dllsearchpath=$testbindir;;
4515
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
5610
          *) func_append dllsearchpath ":$testbindir";;
4516
5611
          esac
4517
5612
          ;;
4518
5613
        esac
4522
5617
      -l*)
4523
5618
        if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4524
5619
          case $host in
4525
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
 
5620
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
4526
5621
            # These systems don't actually have a C or math library (as such)
4527
5622
            continue
4528
5623
            ;;
4536
5631
            ;;
4537
5632
          *-*-rhapsody* | *-*-darwin1.[012])
4538
5633
            # Rhapsody C and math libraries are in the System framework
4539
 
            deplibs="$deplibs System.ltframework"
 
5634
            func_append deplibs " System.ltframework"
4540
5635
            continue
4541
5636
            ;;
4542
5637
          *-*-sco3.2v5* | *-*-sco5v6*)
4556
5651
           ;;
4557
5652
         esac
4558
5653
        fi
4559
 
        deplibs="$deplibs $arg"
 
5654
        func_append deplibs " $arg"
4560
5655
        continue
4561
5656
        ;;
4562
5657
 
4568
5663
      # Tru64 UNIX uses -model [arg] to determine the layout of C++
4569
5664
      # classes, name mangling, and exception handling.
4570
5665
      # Darwin uses the -arch flag to determine output architecture.
4571
 
      -model|-arch|-isysroot)
4572
 
        compiler_flags="$compiler_flags $arg"
 
5666
      -model|-arch|-isysroot|--sysroot)
 
5667
        func_append compiler_flags " $arg"
4573
5668
        func_append compile_command " $arg"
4574
5669
        func_append finalize_command " $arg"
4575
5670
        prev=xcompiler
4576
5671
        continue
4577
5672
        ;;
4578
5673
 
4579
 
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4580
 
        compiler_flags="$compiler_flags $arg"
 
5674
      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
 
5675
      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
 
5676
        func_append compiler_flags " $arg"
4581
5677
        func_append compile_command " $arg"
4582
5678
        func_append finalize_command " $arg"
4583
5679
        case "$new_inherited_linker_flags " in
4584
5680
            *" $arg "*) ;;
4585
 
            * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
 
5681
            * ) func_append new_inherited_linker_flags " $arg" ;;
4586
5682
        esac
4587
5683
        continue
4588
5684
        ;;
4649
5745
        # We need an absolute path.
4650
5746
        case $dir in
4651
5747
        [\\/]* | [A-Za-z]:[\\/]*) ;;
 
5748
        =*)
 
5749
          func_stripname '=' '' "$dir"
 
5750
          dir=$lt_sysroot$func_stripname_result
 
5751
          ;;
4652
5752
        *)
4653
5753
          func_fatal_error "only absolute run-paths are allowed"
4654
5754
          ;;
4655
5755
        esac
4656
5756
        case "$xrpath " in
4657
5757
        *" $dir "*) ;;
4658
 
        *) xrpath="$xrpath $dir" ;;
 
5758
        *) func_append xrpath " $dir" ;;
4659
5759
        esac
4660
5760
        continue
4661
5761
        ;;
4708
5808
        for flag in $args; do
4709
5809
          IFS="$save_ifs"
4710
5810
          func_quote_for_eval "$flag"
4711
 
          arg="$arg $wl$func_quote_for_eval_result"
4712
 
          compiler_flags="$compiler_flags $func_quote_for_eval_result"
 
5811
          func_append arg " $func_quote_for_eval_result"
 
5812
          func_append compiler_flags " $func_quote_for_eval_result"
4713
5813
        done
4714
5814
        IFS="$save_ifs"
4715
5815
        func_stripname ' ' '' "$arg"
4724
5824
        for flag in $args; do
4725
5825
          IFS="$save_ifs"
4726
5826
          func_quote_for_eval "$flag"
4727
 
          arg="$arg $wl$func_quote_for_eval_result"
4728
 
          compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
4729
 
          linker_flags="$linker_flags $func_quote_for_eval_result"
 
5827
          func_append arg " $wl$func_quote_for_eval_result"
 
5828
          func_append compiler_flags " $wl$func_quote_for_eval_result"
 
5829
          func_append linker_flags " $func_quote_for_eval_result"
4730
5830
        done
4731
5831
        IFS="$save_ifs"
4732
5832
        func_stripname ' ' '' "$arg"
4754
5854
        arg="$func_quote_for_eval_result"
4755
5855
        ;;
4756
5856
 
4757
 
      # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4758
 
      # -r[0-9][0-9]* specifies the processor on the SGI compiler
4759
 
      # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4760
 
      # +DA*, +DD* enable 64-bit mode on the HP compiler
4761
 
      # -q* pass through compiler args for the IBM compiler
4762
 
      # -m*, -t[45]*, -txscale* pass through architecture-specific
4763
 
      # compiler args for GCC
4764
 
      # -F/path gives path to uninstalled frameworks, gcc on darwin
4765
 
      # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4766
 
      # @file GCC response files
 
5857
      # Flags to be passed through unchanged, with rationale:
 
5858
      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
 
5859
      # -r[0-9][0-9]*        specify processor for the SGI compiler
 
5860
      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
 
5861
      # +DA*, +DD*           enable 64-bit mode for the HP compiler
 
5862
      # -q*                  compiler args for the IBM compiler
 
5863
      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
 
5864
      # -F/path              path to uninstalled frameworks, gcc on darwin
 
5865
      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
 
5866
      # @file                GCC response files
 
5867
      # -tp=*                Portland pgcc target processor selection
 
5868
      # --sysroot=*          for sysroot support
 
5869
      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
4767
5870
      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4768
 
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
 
5871
      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
 
5872
      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
4769
5873
        func_quote_for_eval "$arg"
4770
5874
        arg="$func_quote_for_eval_result"
4771
5875
        func_append compile_command " $arg"
4772
5876
        func_append finalize_command " $arg"
4773
 
        compiler_flags="$compiler_flags $arg"
 
5877
        func_append compiler_flags " $arg"
4774
5878
        continue
4775
5879
        ;;
4776
5880
 
4782
5886
 
4783
5887
      *.$objext)
4784
5888
        # A standard object.
4785
 
        objs="$objs $arg"
 
5889
        func_append objs " $arg"
4786
5890
        ;;
4787
5891
 
4788
5892
      *.lo)
4813
5917
 
4814
5918
            if test "$prev" = dlfiles; then
4815
5919
              if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4816
 
                dlfiles="$dlfiles $pic_object"
 
5920
                func_append dlfiles " $pic_object"
4817
5921
                prev=
4818
5922
                continue
4819
5923
              else
4825
5929
            # CHECK ME:  I think I busted this.  -Ossama
4826
5930
            if test "$prev" = dlprefiles; then
4827
5931
              # Preload the old-style object.
4828
 
              dlprefiles="$dlprefiles $pic_object"
 
5932
              func_append dlprefiles " $pic_object"
4829
5933
              prev=
4830
5934
            fi
4831
5935
 
4870
5974
 
4871
5975
      *.$libext)
4872
5976
        # An archive.
4873
 
        deplibs="$deplibs $arg"
4874
 
        old_deplibs="$old_deplibs $arg"
 
5977
        func_append deplibs " $arg"
 
5978
        func_append old_deplibs " $arg"
4875
5979
        continue
4876
5980
        ;;
4877
5981
 
4878
5982
      *.la)
4879
5983
        # A libtool-controlled library.
4880
5984
 
 
5985
        func_resolve_sysroot "$arg"
4881
5986
        if test "$prev" = dlfiles; then
4882
5987
          # This library was specified with -dlopen.
4883
 
          dlfiles="$dlfiles $arg"
 
5988
          func_append dlfiles " $func_resolve_sysroot_result"
4884
5989
          prev=
4885
5990
        elif test "$prev" = dlprefiles; then
4886
5991
          # The library was specified with -dlpreopen.
4887
 
          dlprefiles="$dlprefiles $arg"
 
5992
          func_append dlprefiles " $func_resolve_sysroot_result"
4888
5993
          prev=
4889
5994
        else
4890
 
          deplibs="$deplibs $arg"
 
5995
          func_append deplibs " $func_resolve_sysroot_result"
4891
5996
        fi
4892
5997
        continue
4893
5998
        ;;
4925
6030
 
4926
6031
    if test -n "$shlibpath_var"; then
4927
6032
      # get the directories listed in $shlibpath_var
4928
 
      eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
 
6033
      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
4929
6034
    else
4930
6035
      shlib_search_path=
4931
6036
    fi
4934
6039
 
4935
6040
    func_dirname "$output" "/" ""
4936
6041
    output_objdir="$func_dirname_result$objdir"
 
6042
    func_to_tool_file "$output_objdir/"
 
6043
    tool_output_objdir=$func_to_tool_file_result
4937
6044
    # Create the object directory.
4938
6045
    func_mkdir_p "$output_objdir"
4939
6046
 
4954
6061
    # Find all interdependent deplibs by searching for libraries
4955
6062
    # that are linked more than once (e.g. -la -lb -la)
4956
6063
    for deplib in $deplibs; do
4957
 
      if $opt_duplicate_deps ; then
 
6064
      if $opt_preserve_dup_deps ; then
4958
6065
        case "$libs " in
4959
 
        *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
6066
        *" $deplib "*) func_append specialdeplibs " $deplib" ;;
4960
6067
        esac
4961
6068
      fi
4962
 
      libs="$libs $deplib"
 
6069
      func_append libs " $deplib"
4963
6070
    done
4964
6071
 
4965
6072
    if test "$linkmode" = lib; then
4972
6079
      if $opt_duplicate_compiler_generated_deps; then
4973
6080
        for pre_post_dep in $predeps $postdeps; do
4974
6081
          case "$pre_post_deps " in
4975
 
          *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
 
6082
          *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
4976
6083
          esac
4977
 
          pre_post_deps="$pre_post_deps $pre_post_dep"
 
6084
          func_append pre_post_deps " $pre_post_dep"
4978
6085
        done
4979
6086
      fi
4980
6087
      pre_post_deps=
5041
6148
        for lib in $dlprefiles; do
5042
6149
          # Ignore non-libtool-libs
5043
6150
          dependency_libs=
 
6151
          func_resolve_sysroot "$lib"
5044
6152
          case $lib in
5045
 
          *.la) func_source "$lib" ;;
 
6153
          *.la) func_source "$func_resolve_sysroot_result" ;;
5046
6154
          esac
5047
6155
 
5048
6156
          # Collect preopened libtool deplibs, except any this library
5049
6157
          # has declared as weak libs
5050
6158
          for deplib in $dependency_libs; do
5051
 
            deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
 
6159
            func_basename "$deplib"
 
6160
            deplib_base=$func_basename_result
5052
6161
            case " $weak_libs " in
5053
6162
            *" $deplib_base "*) ;;
5054
 
            *) deplibs="$deplibs $deplib" ;;
 
6163
            *) func_append deplibs " $deplib" ;;
5055
6164
            esac
5056
6165
          done
5057
6166
        done
5067
6176
        lib=
5068
6177
        found=no
5069
6178
        case $deplib in
5070
 
        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
 
6179
        -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
 
6180
        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
5071
6181
          if test "$linkmode,$pass" = "prog,link"; then
5072
6182
            compile_deplibs="$deplib $compile_deplibs"
5073
6183
            finalize_deplibs="$deplib $finalize_deplibs"
5074
6184
          else
5075
 
            compiler_flags="$compiler_flags $deplib"
 
6185
            func_append compiler_flags " $deplib"
5076
6186
            if test "$linkmode" = lib ; then
5077
6187
                case "$new_inherited_linker_flags " in
5078
6188
                    *" $deplib "*) ;;
5079
 
                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
 
6189
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
5080
6190
                esac
5081
6191
            fi
5082
6192
          fi
5161
6271
            if test "$linkmode" = lib ; then
5162
6272
                case "$new_inherited_linker_flags " in
5163
6273
                    *" $deplib "*) ;;
5164
 
                    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
 
6274
                    * ) func_append new_inherited_linker_flags " $deplib" ;;
5165
6275
                esac
5166
6276
            fi
5167
6277
          fi
5174
6284
            test "$pass" = conv && continue
5175
6285
            newdependency_libs="$deplib $newdependency_libs"
5176
6286
            func_stripname '-L' '' "$deplib"
5177
 
            newlib_search_path="$newlib_search_path $func_stripname_result"
 
6287
            func_resolve_sysroot "$func_stripname_result"
 
6288
            func_append newlib_search_path " $func_resolve_sysroot_result"
5178
6289
            ;;
5179
6290
          prog)
5180
6291
            if test "$pass" = conv; then
5188
6299
              finalize_deplibs="$deplib $finalize_deplibs"
5189
6300
            fi
5190
6301
            func_stripname '-L' '' "$deplib"
5191
 
            newlib_search_path="$newlib_search_path $func_stripname_result"
 
6302
            func_resolve_sysroot "$func_stripname_result"
 
6303
            func_append newlib_search_path " $func_resolve_sysroot_result"
5192
6304
            ;;
5193
6305
          *)
5194
6306
            func_warning "\`-L' is ignored for archives/objects"
5199
6311
        -R*)
5200
6312
          if test "$pass" = link; then
5201
6313
            func_stripname '-R' '' "$deplib"
5202
 
            dir=$func_stripname_result
 
6314
            func_resolve_sysroot "$func_stripname_result"
 
6315
            dir=$func_resolve_sysroot_result
5203
6316
            # Make sure the xrpath contains only unique directories.
5204
6317
            case "$xrpath " in
5205
6318
            *" $dir "*) ;;
5206
 
            *) xrpath="$xrpath $dir" ;;
 
6319
            *) func_append xrpath " $dir" ;;
5207
6320
            esac
5208
6321
          fi
5209
6322
          deplibs="$deplib $deplibs"
5210
6323
          continue
5211
6324
          ;;
5212
 
        *.la) lib="$deplib" ;;
 
6325
        *.la)
 
6326
          func_resolve_sysroot "$deplib"
 
6327
          lib=$func_resolve_sysroot_result
 
6328
          ;;
5213
6329
        *.$libext)
5214
6330
          if test "$pass" = conv; then
5215
6331
            deplibs="$deplib $deplibs"
5227
6343
                match_pattern*)
5228
6344
                  set dummy $deplibs_check_method; shift
5229
6345
                  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
5230
 
                  if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
 
6346
                  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
5231
6347
                    | $EGREP "$match_pattern_regex" > /dev/null; then
5232
6348
                    valid_a_lib=yes
5233
6349
                  fi
5237
6353
                ;;
5238
6354
              esac
5239
6355
              if test "$valid_a_lib" != yes; then
5240
 
                $ECHO
 
6356
                echo
5241
6357
                $ECHO "*** Warning: Trying to link with static lib archive $deplib."
5242
 
                $ECHO "*** I have the capability to make that library automatically link in when"
5243
 
                $ECHO "*** you link to this library.  But I can only do this if you have a"
5244
 
                $ECHO "*** shared version of the library, which you do not appear to have"
5245
 
                $ECHO "*** because the file extensions .$libext of this argument makes me believe"
5246
 
                $ECHO "*** that it is just a static archive that I should not use here."
 
6358
                echo "*** I have the capability to make that library automatically link in when"
 
6359
                echo "*** you link to this library.  But I can only do this if you have a"
 
6360
                echo "*** shared version of the library, which you do not appear to have"
 
6361
                echo "*** because the file extensions .$libext of this argument makes me believe"
 
6362
                echo "*** that it is just a static archive that I should not use here."
5247
6363
              else
5248
 
                $ECHO
 
6364
                echo
5249
6365
                $ECHO "*** Warning: Linking the shared library $output against the"
5250
6366
                $ECHO "*** static library $deplib is not portable!"
5251
6367
                deplibs="$deplib $deplibs"
5272
6388
            if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
5273
6389
              # If there is no dlopen support or we're linking statically,
5274
6390
              # we need to preload.
5275
 
              newdlprefiles="$newdlprefiles $deplib"
 
6391
              func_append newdlprefiles " $deplib"
5276
6392
              compile_deplibs="$deplib $compile_deplibs"
5277
6393
              finalize_deplibs="$deplib $finalize_deplibs"
5278
6394
            else
5279
 
              newdlfiles="$newdlfiles $deplib"
 
6395
              func_append newdlfiles " $deplib"
5280
6396
            fi
5281
6397
          fi
5282
6398
          continue
5318
6434
 
5319
6435
        # Convert "-framework foo" to "foo.ltframework"
5320
6436
        if test -n "$inherited_linker_flags"; then
5321
 
          tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
 
6437
          tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
5322
6438
          for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
5323
6439
            case " $new_inherited_linker_flags " in
5324
6440
              *" $tmp_inherited_linker_flag "*) ;;
5325
 
              *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
 
6441
              *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
5326
6442
            esac
5327
6443
          done
5328
6444
        fi
5329
 
        dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
6445
        dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
5330
6446
        if test "$linkmode,$pass" = "lib,link" ||
5331
6447
           test "$linkmode,$pass" = "prog,scan" ||
5332
6448
           { test "$linkmode" != prog && test "$linkmode" != lib; }; then
5333
 
          test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
5334
 
          test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
 
6449
          test -n "$dlopen" && func_append dlfiles " $dlopen"
 
6450
          test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
5335
6451
        fi
5336
6452
 
5337
6453
        if test "$pass" = conv; then
5342
6458
              func_fatal_error "cannot find name of link library for \`$lib'"
5343
6459
            fi
5344
6460
            # It is a libtool convenience library, so add in its objects.
5345
 
            convenience="$convenience $ladir/$objdir/$old_library"
5346
 
            old_convenience="$old_convenience $ladir/$objdir/$old_library"
 
6461
            func_append convenience " $ladir/$objdir/$old_library"
 
6462
            func_append old_convenience " $ladir/$objdir/$old_library"
5347
6463
          elif test "$linkmode" != prog && test "$linkmode" != lib; then
5348
6464
            func_fatal_error "\`$lib' is not a convenience library"
5349
6465
          fi
5350
6466
          tmp_libs=
5351
6467
          for deplib in $dependency_libs; do
5352
6468
            deplibs="$deplib $deplibs"
5353
 
            if $opt_duplicate_deps ; then
 
6469
            if $opt_preserve_dup_deps ; then
5354
6470
              case "$tmp_libs " in
5355
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
6471
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5356
6472
              esac
5357
6473
            fi
5358
 
            tmp_libs="$tmp_libs $deplib"
 
6474
            func_append tmp_libs " $deplib"
5359
6475
          done
5360
6476
          continue
5361
6477
        fi # $pass = conv
5363
6479
 
5364
6480
        # Get the name of the library we link against.
5365
6481
        linklib=
5366
 
        for l in $old_library $library_names; do
5367
 
          linklib="$l"
5368
 
        done
 
6482
        if test -n "$old_library" &&
 
6483
           { test "$prefer_static_libs" = yes ||
 
6484
             test "$prefer_static_libs,$installed" = "built,no"; }; then
 
6485
          linklib=$old_library
 
6486
        else
 
6487
          for l in $old_library $library_names; do
 
6488
            linklib="$l"
 
6489
          done
 
6490
        fi
5369
6491
        if test -z "$linklib"; then
5370
6492
          func_fatal_error "cannot find name of link library for \`$lib'"
5371
6493
        fi
5382
6504
            # statically, we need to preload.  We also need to preload any
5383
6505
            # dependent libraries so libltdl's deplib preloader doesn't
5384
6506
            # bomb out in the load deplibs phase.
5385
 
            dlprefiles="$dlprefiles $lib $dependency_libs"
 
6507
            func_append dlprefiles " $lib $dependency_libs"
5386
6508
          else
5387
 
            newdlfiles="$newdlfiles $lib"
 
6509
            func_append newdlfiles " $lib"
5388
6510
          fi
5389
6511
          continue
5390
6512
        fi # $pass = dlopen
5406
6528
 
5407
6529
        # Find the relevant object directory and library name.
5408
6530
        if test "X$installed" = Xyes; then
5409
 
          if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
 
6531
          if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
5410
6532
            func_warning "library \`$lib' was moved."
5411
6533
            dir="$ladir"
5412
6534
            absdir="$abs_ladir"
5413
6535
            libdir="$abs_ladir"
5414
6536
          else
5415
 
            dir="$libdir"
5416
 
            absdir="$libdir"
 
6537
            dir="$lt_sysroot$libdir"
 
6538
            absdir="$lt_sysroot$libdir"
5417
6539
          fi
5418
6540
          test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
5419
6541
        else
5421
6543
            dir="$ladir"
5422
6544
            absdir="$abs_ladir"
5423
6545
            # Remove this search path later
5424
 
            notinst_path="$notinst_path $abs_ladir"
 
6546
            func_append notinst_path " $abs_ladir"
5425
6547
          else
5426
6548
            dir="$ladir/$objdir"
5427
6549
            absdir="$abs_ladir/$objdir"
5428
6550
            # Remove this search path later
5429
 
            notinst_path="$notinst_path $abs_ladir"
 
6551
            func_append notinst_path " $abs_ladir"
5430
6552
          fi
5431
6553
        fi # $installed = yes
5432
6554
        func_stripname 'lib' '.la' "$laname"
5437
6559
          if test -z "$libdir" && test "$linkmode" = prog; then
5438
6560
            func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
5439
6561
          fi
5440
 
          # Prefer using a static library (so that no silly _DYNAMIC symbols
5441
 
          # are required to link).
5442
 
          if test -n "$old_library"; then
5443
 
            newdlprefiles="$newdlprefiles $dir/$old_library"
5444
 
            # Keep a list of preopened convenience libraries to check
5445
 
            # that they are being used correctly in the link pass.
5446
 
            test -z "$libdir" && \
5447
 
                dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
5448
 
          # Otherwise, use the dlname, so that lt_dlopen finds it.
5449
 
          elif test -n "$dlname"; then
5450
 
            newdlprefiles="$newdlprefiles $dir/$dlname"
5451
 
          else
5452
 
            newdlprefiles="$newdlprefiles $dir/$linklib"
5453
 
          fi
 
6562
          case "$host" in
 
6563
            # special handling for platforms with PE-DLLs.
 
6564
            *cygwin* | *mingw* | *cegcc* )
 
6565
              # Linker will automatically link against shared library if both
 
6566
              # static and shared are present.  Therefore, ensure we extract
 
6567
              # symbols from the import library if a shared library is present
 
6568
              # (otherwise, the dlopen module name will be incorrect).  We do
 
6569
              # this by putting the import library name into $newdlprefiles.
 
6570
              # We recover the dlopen module name by 'saving' the la file
 
6571
              # name in a special purpose variable, and (later) extracting the
 
6572
              # dlname from the la file.
 
6573
              if test -n "$dlname"; then
 
6574
                func_tr_sh "$dir/$linklib"
 
6575
                eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
 
6576
                func_append newdlprefiles " $dir/$linklib"
 
6577
              else
 
6578
                func_append newdlprefiles " $dir/$old_library"
 
6579
                # Keep a list of preopened convenience libraries to check
 
6580
                # that they are being used correctly in the link pass.
 
6581
                test -z "$libdir" && \
 
6582
                  func_append dlpreconveniencelibs " $dir/$old_library"
 
6583
              fi
 
6584
            ;;
 
6585
            * )
 
6586
              # Prefer using a static library (so that no silly _DYNAMIC symbols
 
6587
              # are required to link).
 
6588
              if test -n "$old_library"; then
 
6589
                func_append newdlprefiles " $dir/$old_library"
 
6590
                # Keep a list of preopened convenience libraries to check
 
6591
                # that they are being used correctly in the link pass.
 
6592
                test -z "$libdir" && \
 
6593
                  func_append dlpreconveniencelibs " $dir/$old_library"
 
6594
              # Otherwise, use the dlname, so that lt_dlopen finds it.
 
6595
              elif test -n "$dlname"; then
 
6596
                func_append newdlprefiles " $dir/$dlname"
 
6597
              else
 
6598
                func_append newdlprefiles " $dir/$linklib"
 
6599
              fi
 
6600
            ;;
 
6601
          esac
5454
6602
        fi # $pass = dlpreopen
5455
6603
 
5456
6604
        if test -z "$libdir"; then
5468
6616
 
5469
6617
 
5470
6618
        if test "$linkmode" = prog && test "$pass" != link; then
5471
 
          newlib_search_path="$newlib_search_path $ladir"
 
6619
          func_append newlib_search_path " $ladir"
5472
6620
          deplibs="$lib $deplibs"
5473
6621
 
5474
6622
          linkalldeplibs=no
5481
6629
          for deplib in $dependency_libs; do
5482
6630
            case $deplib in
5483
6631
            -L*) func_stripname '-L' '' "$deplib"
5484
 
                 newlib_search_path="$newlib_search_path $func_stripname_result"
 
6632
                 func_resolve_sysroot "$func_stripname_result"
 
6633
                 func_append newlib_search_path " $func_resolve_sysroot_result"
5485
6634
                 ;;
5486
6635
            esac
5487
6636
            # Need to link against all dependency_libs?
5492
6641
              # or/and link against static libraries
5493
6642
              newdependency_libs="$deplib $newdependency_libs"
5494
6643
            fi
5495
 
            if $opt_duplicate_deps ; then
 
6644
            if $opt_preserve_dup_deps ; then
5496
6645
              case "$tmp_libs " in
5497
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
6646
              *" $deplib "*) func_append specialdeplibs " $deplib" ;;
5498
6647
              esac
5499
6648
            fi
5500
 
            tmp_libs="$tmp_libs $deplib"
 
6649
            func_append tmp_libs " $deplib"
5501
6650
          done # for deplib
5502
6651
          continue
5503
6652
        fi # $linkmode = prog...
5512
6661
              # Make sure the rpath contains only unique directories.
5513
6662
              case "$temp_rpath:" in
5514
6663
              *"$absdir:"*) ;;
5515
 
              *) temp_rpath="$temp_rpath$absdir:" ;;
 
6664
              *) func_append temp_rpath "$absdir:" ;;
5516
6665
              esac
5517
6666
            fi
5518
6667
 
5524
6673
            *)
5525
6674
              case "$compile_rpath " in
5526
6675
              *" $absdir "*) ;;
5527
 
              *) compile_rpath="$compile_rpath $absdir"
 
6676
              *) func_append compile_rpath " $absdir" ;;
5528
6677
              esac
5529
6678
              ;;
5530
6679
            esac
5533
6682
            *)
5534
6683
              case "$finalize_rpath " in
5535
6684
              *" $libdir "*) ;;
5536
 
              *) finalize_rpath="$finalize_rpath $libdir"
 
6685
              *) func_append finalize_rpath " $libdir" ;;
5537
6686
              esac
5538
6687
              ;;
5539
6688
            esac
5558
6707
          case $host in
5559
6708
          *cygwin* | *mingw* | *cegcc*)
5560
6709
              # No point in relinking DLLs because paths are not encoded
5561
 
              notinst_deplibs="$notinst_deplibs $lib"
 
6710
              func_append notinst_deplibs " $lib"
5562
6711
              need_relink=no
5563
6712
            ;;
5564
6713
          *)
5565
6714
            if test "$installed" = no; then
5566
 
              notinst_deplibs="$notinst_deplibs $lib"
 
6715
              func_append notinst_deplibs " $lib"
5567
6716
              need_relink=yes
5568
6717
            fi
5569
6718
            ;;
5580
6729
            fi
5581
6730
          done
5582
6731
          if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
5583
 
            $ECHO
 
6732
            echo
5584
6733
            if test "$linkmode" = prog; then
5585
6734
              $ECHO "*** Warning: Linking the executable $output against the loadable module"
5586
6735
            else
5598
6747
            *)
5599
6748
              case "$compile_rpath " in
5600
6749
              *" $absdir "*) ;;
5601
 
              *) compile_rpath="$compile_rpath $absdir"
 
6750
              *) func_append compile_rpath " $absdir" ;;
5602
6751
              esac
5603
6752
              ;;
5604
6753
            esac
5607
6756
            *)
5608
6757
              case "$finalize_rpath " in
5609
6758
              *" $libdir "*) ;;
5610
 
              *) finalize_rpath="$finalize_rpath $libdir"
 
6759
              *) func_append finalize_rpath " $libdir" ;;
5611
6760
              esac
5612
6761
              ;;
5613
6762
            esac
5661
6810
            linklib=$newlib
5662
6811
          fi # test -n "$old_archive_from_expsyms_cmds"
5663
6812
 
5664
 
          if test "$linkmode" = prog || test "$mode" != relink; then
 
6813
          if test "$linkmode" = prog || test "$opt_mode" != relink; then
5665
6814
            add_shlibpath=
5666
6815
            add_dir=
5667
6816
            add=
5683
6832
                      if test "X$dlopenmodule" != "X$lib"; then
5684
6833
                        $ECHO "*** Warning: lib $linklib is a module, not a shared library"
5685
6834
                        if test -z "$old_library" ; then
5686
 
                          $ECHO
5687
 
                          $ECHO "*** And there doesn't seem to be a static archive available"
5688
 
                          $ECHO "*** The link will probably fail, sorry"
 
6835
                          echo
 
6836
                          echo "*** And there doesn't seem to be a static archive available"
 
6837
                          echo "*** The link will probably fail, sorry"
5689
6838
                        else
5690
6839
                          add="$dir/$old_library"
5691
6840
                        fi
5712
6861
                 test "$hardcode_direct_absolute" = no; then
5713
6862
                add="$dir/$linklib"
5714
6863
              elif test "$hardcode_minus_L" = yes; then
5715
 
                add_dir="-L$dir"
 
6864
                add_dir="-L$absdir"
5716
6865
                # Try looking first in the location we're being installed to.
5717
6866
                if test -n "$inst_prefix_dir"; then
5718
6867
                  case $libdir in
5719
6868
                    [\\/]*)
5720
 
                      add_dir="$add_dir -L$inst_prefix_dir$libdir"
 
6869
                      func_append add_dir " -L$inst_prefix_dir$libdir"
5721
6870
                      ;;
5722
6871
                  esac
5723
6872
                fi
5739
6888
            if test -n "$add_shlibpath"; then
5740
6889
              case :$compile_shlibpath: in
5741
6890
              *":$add_shlibpath:"*) ;;
5742
 
              *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
 
6891
              *) func_append compile_shlibpath "$add_shlibpath:" ;;
5743
6892
              esac
5744
6893
            fi
5745
6894
            if test "$linkmode" = prog; then
5753
6902
                 test "$hardcode_shlibpath_var" = yes; then
5754
6903
                case :$finalize_shlibpath: in
5755
6904
                *":$libdir:"*) ;;
5756
 
                *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
 
6905
                *) func_append finalize_shlibpath "$libdir:" ;;
5757
6906
                esac
5758
6907
              fi
5759
6908
            fi
5760
6909
          fi
5761
6910
 
5762
 
          if test "$linkmode" = prog || test "$mode" = relink; then
 
6911
          if test "$linkmode" = prog || test "$opt_mode" = relink; then
5763
6912
            add_shlibpath=
5764
6913
            add_dir=
5765
6914
            add=
5773
6922
            elif test "$hardcode_shlibpath_var" = yes; then
5774
6923
              case :$finalize_shlibpath: in
5775
6924
              *":$libdir:"*) ;;
5776
 
              *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
 
6925
              *) func_append finalize_shlibpath "$libdir:" ;;
5777
6926
              esac
5778
6927
              add="-l$name"
5779
6928
            elif test "$hardcode_automatic" = yes; then
5790
6939
              if test -n "$inst_prefix_dir"; then
5791
6940
                case $libdir in
5792
6941
                  [\\/]*)
5793
 
                    add_dir="$add_dir -L$inst_prefix_dir$libdir"
 
6942
                    func_append add_dir " -L$inst_prefix_dir$libdir"
5794
6943
                    ;;
5795
6944
                esac
5796
6945
              fi
5825
6974
 
5826
6975
            # Just print a warning and add the library to dependency_libs so
5827
6976
            # that the program can be linked against the static library.
5828
 
            $ECHO
 
6977
            echo
5829
6978
            $ECHO "*** Warning: This system can not link to static lib archive $lib."
5830
 
            $ECHO "*** I have the capability to make that library automatically link in when"
5831
 
            $ECHO "*** you link to this library.  But I can only do this if you have a"
5832
 
            $ECHO "*** shared version of the library, which you do not appear to have."
 
6979
            echo "*** I have the capability to make that library automatically link in when"
 
6980
            echo "*** you link to this library.  But I can only do this if you have a"
 
6981
            echo "*** shared version of the library, which you do not appear to have."
5833
6982
            if test "$module" = yes; then
5834
 
              $ECHO "*** But as you try to build a module library, libtool will still create "
5835
 
              $ECHO "*** a static module, that should work as long as the dlopening application"
5836
 
              $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
 
6983
              echo "*** But as you try to build a module library, libtool will still create "
 
6984
              echo "*** a static module, that should work as long as the dlopening application"
 
6985
              echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
5837
6986
              if test -z "$global_symbol_pipe"; then
5838
 
                $ECHO
5839
 
                $ECHO "*** However, this would only work if libtool was able to extract symbol"
5840
 
                $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
5841
 
                $ECHO "*** not find such a program.  So, this module is probably useless."
5842
 
                $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 
6987
                echo
 
6988
                echo "*** However, this would only work if libtool was able to extract symbol"
 
6989
                echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
6990
                echo "*** not find such a program.  So, this module is probably useless."
 
6991
                echo "*** \`nm' from GNU binutils and a full rebuild may help."
5843
6992
              fi
5844
6993
              if test "$build_old_libs" = no; then
5845
6994
                build_libtool_libs=module
5867
7016
                   temp_xrpath=$func_stripname_result
5868
7017
                   case " $xrpath " in
5869
7018
                   *" $temp_xrpath "*) ;;
5870
 
                   *) xrpath="$xrpath $temp_xrpath";;
 
7019
                   *) func_append xrpath " $temp_xrpath";;
5871
7020
                   esac;;
5872
 
              *) temp_deplibs="$temp_deplibs $libdir";;
 
7021
              *) func_append temp_deplibs " $libdir";;
5873
7022
              esac
5874
7023
            done
5875
7024
            dependency_libs="$temp_deplibs"
5876
7025
          fi
5877
7026
 
5878
 
          newlib_search_path="$newlib_search_path $absdir"
 
7027
          func_append newlib_search_path " $absdir"
5879
7028
          # Link against this library
5880
7029
          test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
5881
7030
          # ... and its dependency_libs
5882
7031
          tmp_libs=
5883
7032
          for deplib in $dependency_libs; do
5884
7033
            newdependency_libs="$deplib $newdependency_libs"
5885
 
            if $opt_duplicate_deps ; then
 
7034
            case $deplib in
 
7035
              -L*) func_stripname '-L' '' "$deplib"
 
7036
                   func_resolve_sysroot "$func_stripname_result";;
 
7037
              *) func_resolve_sysroot "$deplib" ;;
 
7038
            esac
 
7039
            if $opt_preserve_dup_deps ; then
5886
7040
              case "$tmp_libs " in
5887
 
              *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
 
7041
              *" $func_resolve_sysroot_result "*)
 
7042
                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
5888
7043
              esac
5889
7044
            fi
5890
 
            tmp_libs="$tmp_libs $deplib"
 
7045
            func_append tmp_libs " $func_resolve_sysroot_result"
5891
7046
          done
5892
7047
 
5893
7048
          if test "$link_all_deplibs" != no; then
5894
7049
            # Add the search paths of all dependency libraries
5895
7050
            for deplib in $dependency_libs; do
 
7051
              path=
5896
7052
              case $deplib in
5897
7053
              -L*) path="$deplib" ;;
5898
7054
              *.la)
 
7055
                func_resolve_sysroot "$deplib"
 
7056
                deplib=$func_resolve_sysroot_result
5899
7057
                func_dirname "$deplib" "" "."
5900
 
                dir="$func_dirname_result"
 
7058
                dir=$func_dirname_result
5901
7059
                # We need an absolute path.
5902
7060
                case $dir in
5903
7061
                [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
5924
7082
                      if test -z "$darwin_install_name"; then
5925
7083
                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
5926
7084
                      fi
5927
 
                      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
5928
 
                      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
 
7085
                      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
 
7086
                      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
5929
7087
                      path=
5930
7088
                    fi
5931
7089
                  fi
5958
7116
          compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
5959
7117
          finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
5960
7118
        else
5961
 
          compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
7119
          compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
5962
7120
        fi
5963
7121
      fi
5964
7122
      dependency_libs="$newdependency_libs"
5975
7133
          for dir in $newlib_search_path; do
5976
7134
            case "$lib_search_path " in
5977
7135
            *" $dir "*) ;;
5978
 
            *) lib_search_path="$lib_search_path $dir" ;;
 
7136
            *) func_append lib_search_path " $dir" ;;
5979
7137
            esac
5980
7138
          done
5981
7139
          newlib_search_path=
6033
7191
            -L*)
6034
7192
              case " $tmp_libs " in
6035
7193
              *" $deplib "*) ;;
6036
 
              *) tmp_libs="$tmp_libs $deplib" ;;
 
7194
              *) func_append tmp_libs " $deplib" ;;
6037
7195
              esac
6038
7196
              ;;
6039
 
            *) tmp_libs="$tmp_libs $deplib" ;;
 
7197
            *) func_append tmp_libs " $deplib" ;;
6040
7198
            esac
6041
7199
          done
6042
7200
          eval $var=\"$tmp_libs\"
6052
7210
          ;;
6053
7211
        esac
6054
7212
        if test -n "$i" ; then
6055
 
          tmp_libs="$tmp_libs $i"
 
7213
          func_append tmp_libs " $i"
6056
7214
        fi
6057
7215
      done
6058
7216
      dependency_libs=$tmp_libs
6093
7251
      # Now set the variables for building old libraries.
6094
7252
      build_libtool_libs=no
6095
7253
      oldlibs="$output"
6096
 
      objs="$objs$old_deplibs"
 
7254
      func_append objs "$old_deplibs"
6097
7255
      ;;
6098
7256
 
6099
7257
    lib)
6126
7284
        if test "$deplibs_check_method" != pass_all; then
6127
7285
          func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
6128
7286
        else
6129
 
          $ECHO
 
7287
          echo
6130
7288
          $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
6131
7289
          $ECHO "*** objects $objs is not portable!"
6132
 
          libobjs="$libobjs $objs"
 
7290
          func_append libobjs " $objs"
6133
7291
        fi
6134
7292
      fi
6135
7293
 
6188
7346
          # which has an extra 1 added just for fun
6189
7347
          #
6190
7348
          case $version_type in
 
7349
          # correct linux to gnu/linux during the next big refactor
6191
7350
          darwin|linux|osf|windows|none)
6192
7351
            func_arith $number_major + $number_minor
6193
7352
            current=$func_arith_result
6194
7353
            age="$number_minor"
6195
7354
            revision="$number_revision"
6196
7355
            ;;
6197
 
          freebsd-aout|freebsd-elf|sunos)
 
7356
          freebsd-aout|freebsd-elf|qnx|sunos)
6198
7357
            current="$number_major"
6199
7358
            revision="$number_minor"
6200
7359
            age="0"
6304
7463
          versuffix="$major.$revision"
6305
7464
          ;;
6306
7465
 
6307
 
        linux)
 
7466
        linux) # correct to gnu/linux during the next big refactor
6308
7467
          func_arith $current - $age
6309
7468
          major=.$func_arith_result
6310
7469
          versuffix="$major.$age.$revision"
6327
7486
          done
6328
7487
 
6329
7488
          # Make executables depend on our current version.
6330
 
          verstring="$verstring:${current}.0"
 
7489
          func_append verstring ":${current}.0"
6331
7490
          ;;
6332
7491
 
6333
7492
        qnx)
6395
7554
      fi
6396
7555
 
6397
7556
      func_generate_dlsyms "$libname" "$libname" "yes"
6398
 
      libobjs="$libobjs $symfileobj"
 
7557
      func_append libobjs " $symfileobj"
6399
7558
      test "X$libobjs" = "X " && libobjs=
6400
7559
 
6401
 
      if test "$mode" != relink; then
 
7560
      if test "$opt_mode" != relink; then
6402
7561
        # Remove our outputs, but don't remove object files since they
6403
7562
        # may have been created when compiling PIC objects.
6404
7563
        removelist=
6414
7573
                   continue
6415
7574
                 fi
6416
7575
               fi
6417
 
               removelist="$removelist $p"
 
7576
               func_append removelist " $p"
6418
7577
               ;;
6419
7578
            *) ;;
6420
7579
          esac
6425
7584
 
6426
7585
      # Now set the variables for building old libraries.
6427
7586
      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
6428
 
        oldlibs="$oldlibs $output_objdir/$libname.$libext"
 
7587
        func_append oldlibs " $output_objdir/$libname.$libext"
6429
7588
 
6430
7589
        # Transform .lo files to .o files.
6431
 
        oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
 
7590
        oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
6432
7591
      fi
6433
7592
 
6434
7593
      # Eliminate all temporary directories.
6435
7594
      #for path in $notinst_path; do
6436
 
      # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
6437
 
      # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
6438
 
      # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
 
7595
      # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
 
7596
      # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
 
7597
      # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
6439
7598
      #done
6440
7599
 
6441
7600
      if test -n "$xrpath"; then
6442
7601
        # If the user specified any rpath flags, then add them.
6443
7602
        temp_xrpath=
6444
7603
        for libdir in $xrpath; do
6445
 
          temp_xrpath="$temp_xrpath -R$libdir"
 
7604
          func_replace_sysroot "$libdir"
 
7605
          func_append temp_xrpath " -R$func_replace_sysroot_result"
6446
7606
          case "$finalize_rpath " in
6447
7607
          *" $libdir "*) ;;
6448
 
          *) finalize_rpath="$finalize_rpath $libdir" ;;
 
7608
          *) func_append finalize_rpath " $libdir" ;;
6449
7609
          esac
6450
7610
        done
6451
7611
        if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
6459
7619
      for lib in $old_dlfiles; do
6460
7620
        case " $dlprefiles $dlfiles " in
6461
7621
        *" $lib "*) ;;
6462
 
        *) dlfiles="$dlfiles $lib" ;;
 
7622
        *) func_append dlfiles " $lib" ;;
6463
7623
        esac
6464
7624
      done
6465
7625
 
6469
7629
      for lib in $old_dlprefiles; do
6470
7630
        case "$dlprefiles " in
6471
7631
        *" $lib "*) ;;
6472
 
        *) dlprefiles="$dlprefiles $lib" ;;
 
7632
        *) func_append dlprefiles " $lib" ;;
6473
7633
        esac
6474
7634
      done
6475
7635
 
6476
7636
      if test "$build_libtool_libs" = yes; then
6477
7637
        if test -n "$rpath"; then
6478
7638
          case $host in
6479
 
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
 
7639
          *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
6480
7640
            # these systems don't actually have a c library (as such)!
6481
7641
            ;;
6482
7642
          *-*-rhapsody* | *-*-darwin1.[012])
6483
7643
            # Rhapsody C library is in the System framework
6484
 
            deplibs="$deplibs System.ltframework"
 
7644
            func_append deplibs " System.ltframework"
6485
7645
            ;;
6486
7646
          *-*-netbsd*)
6487
7647
            # Don't link with libc until the a.out ld.so is fixed.
6498
7658
          *)
6499
7659
            # Add libc to deplibs on all other systems if necessary.
6500
7660
            if test "$build_libtool_need_lc" = "yes"; then
6501
 
              deplibs="$deplibs -lc"
 
7661
              func_append deplibs " -lc"
6502
7662
            fi
6503
7663
            ;;
6504
7664
          esac
6547
7707
                if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6548
7708
                  case " $predeps $postdeps " in
6549
7709
                  *" $i "*)
6550
 
                    newdeplibs="$newdeplibs $i"
 
7710
                    func_append newdeplibs " $i"
6551
7711
                    i=""
6552
7712
                    ;;
6553
7713
                  esac
6558
7718
                  set dummy $deplib_matches; shift
6559
7719
                  deplib_match=$1
6560
7720
                  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6561
 
                    newdeplibs="$newdeplibs $i"
 
7721
                    func_append newdeplibs " $i"
6562
7722
                  else
6563
7723
                    droppeddeps=yes
6564
 
                    $ECHO
 
7724
                    echo
6565
7725
                    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6566
 
                    $ECHO "*** I have the capability to make that library automatically link in when"
6567
 
                    $ECHO "*** you link to this library.  But I can only do this if you have a"
6568
 
                    $ECHO "*** shared version of the library, which I believe you do not have"
6569
 
                    $ECHO "*** because a test_compile did reveal that the linker did not use it for"
6570
 
                    $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
 
7726
                    echo "*** I have the capability to make that library automatically link in when"
 
7727
                    echo "*** you link to this library.  But I can only do this if you have a"
 
7728
                    echo "*** shared version of the library, which I believe you do not have"
 
7729
                    echo "*** because a test_compile did reveal that the linker did not use it for"
 
7730
                    echo "*** its dynamic dependency list that programs get resolved with at runtime."
6571
7731
                  fi
6572
7732
                fi
6573
7733
                ;;
6574
7734
              *)
6575
 
                newdeplibs="$newdeplibs $i"
 
7735
                func_append newdeplibs " $i"
6576
7736
                ;;
6577
7737
              esac
6578
7738
            done
6590
7750
                  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6591
7751
                    case " $predeps $postdeps " in
6592
7752
                    *" $i "*)
6593
 
                      newdeplibs="$newdeplibs $i"
 
7753
                      func_append newdeplibs " $i"
6594
7754
                      i=""
6595
7755
                      ;;
6596
7756
                    esac
6601
7761
                    set dummy $deplib_matches; shift
6602
7762
                    deplib_match=$1
6603
7763
                    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
6604
 
                      newdeplibs="$newdeplibs $i"
 
7764
                      func_append newdeplibs " $i"
6605
7765
                    else
6606
7766
                      droppeddeps=yes
6607
 
                      $ECHO
 
7767
                      echo
6608
7768
                      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
6609
 
                      $ECHO "*** I have the capability to make that library automatically link in when"
6610
 
                      $ECHO "*** you link to this library.  But I can only do this if you have a"
6611
 
                      $ECHO "*** shared version of the library, which you do not appear to have"
6612
 
                      $ECHO "*** because a test_compile did reveal that the linker did not use this one"
6613
 
                      $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
 
7769
                      echo "*** I have the capability to make that library automatically link in when"
 
7770
                      echo "*** you link to this library.  But I can only do this if you have a"
 
7771
                      echo "*** shared version of the library, which you do not appear to have"
 
7772
                      echo "*** because a test_compile did reveal that the linker did not use this one"
 
7773
                      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
6614
7774
                    fi
6615
7775
                  fi
6616
7776
                else
6617
7777
                  droppeddeps=yes
6618
 
                  $ECHO
 
7778
                  echo
6619
7779
                  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
6620
 
                  $ECHO "*** make it link in!  You will probably need to install it or some"
6621
 
                  $ECHO "*** library that it depends on before this library will be fully"
6622
 
                  $ECHO "*** functional.  Installing it before continuing would be even better."
 
7780
                  echo "*** make it link in!  You will probably need to install it or some"
 
7781
                  echo "*** library that it depends on before this library will be fully"
 
7782
                  echo "*** functional.  Installing it before continuing would be even better."
6623
7783
                fi
6624
7784
                ;;
6625
7785
              *)
6626
 
                newdeplibs="$newdeplibs $i"
 
7786
                func_append newdeplibs " $i"
6627
7787
                ;;
6628
7788
              esac
6629
7789
            done
6640
7800
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6641
7801
                case " $predeps $postdeps " in
6642
7802
                *" $a_deplib "*)
6643
 
                  newdeplibs="$newdeplibs $a_deplib"
 
7803
                  func_append newdeplibs " $a_deplib"
6644
7804
                  a_deplib=""
6645
7805
                  ;;
6646
7806
                esac
6647
7807
              fi
6648
7808
              if test -n "$a_deplib" ; then
6649
7809
                libname=`eval "\\$ECHO \"$libname_spec\""`
 
7810
                if test -n "$file_magic_glob"; then
 
7811
                  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
 
7812
                else
 
7813
                  libnameglob=$libname
 
7814
                fi
 
7815
                test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
6650
7816
                for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
6651
 
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
 
7817
                  if test "$want_nocaseglob" = yes; then
 
7818
                    shopt -s nocaseglob
 
7819
                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 
7820
                    $nocaseglob
 
7821
                  else
 
7822
                    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
 
7823
                  fi
6652
7824
                  for potent_lib in $potential_libs; do
6653
7825
                      # Follow soft links.
6654
7826
                      if ls -lLd "$potent_lib" 2>/dev/null |
6665
7837
                        potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
6666
7838
                        case $potliblink in
6667
7839
                        [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
6668
 
                        *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
 
7840
                        *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
6669
7841
                        esac
6670
7842
                      done
6671
7843
                      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
6672
7844
                         $SED -e 10q |
6673
7845
                         $EGREP "$file_magic_regex" > /dev/null; then
6674
 
                        newdeplibs="$newdeplibs $a_deplib"
 
7846
                        func_append newdeplibs " $a_deplib"
6675
7847
                        a_deplib=""
6676
7848
                        break 2
6677
7849
                      fi
6680
7852
              fi
6681
7853
              if test -n "$a_deplib" ; then
6682
7854
                droppeddeps=yes
6683
 
                $ECHO
 
7855
                echo
6684
7856
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6685
 
                $ECHO "*** I have the capability to make that library automatically link in when"
6686
 
                $ECHO "*** you link to this library.  But I can only do this if you have a"
6687
 
                $ECHO "*** shared version of the library, which you do not appear to have"
6688
 
                $ECHO "*** because I did check the linker path looking for a file starting"
 
7857
                echo "*** I have the capability to make that library automatically link in when"
 
7858
                echo "*** you link to this library.  But I can only do this if you have a"
 
7859
                echo "*** shared version of the library, which you do not appear to have"
 
7860
                echo "*** because I did check the linker path looking for a file starting"
6689
7861
                if test -z "$potlib" ; then
6690
7862
                  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
6691
7863
                else
6696
7868
              ;;
6697
7869
            *)
6698
7870
              # Add a -L argument.
6699
 
              newdeplibs="$newdeplibs $a_deplib"
 
7871
              func_append newdeplibs " $a_deplib"
6700
7872
              ;;
6701
7873
            esac
6702
7874
          done # Gone through all deplibs.
6712
7884
              if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6713
7885
                case " $predeps $postdeps " in
6714
7886
                *" $a_deplib "*)
6715
 
                  newdeplibs="$newdeplibs $a_deplib"
 
7887
                  func_append newdeplibs " $a_deplib"
6716
7888
                  a_deplib=""
6717
7889
                  ;;
6718
7890
                esac
6723
7895
                  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
6724
7896
                  for potent_lib in $potential_libs; do
6725
7897
                    potlib="$potent_lib" # see symlink-check above in file_magic test
6726
 
                    if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
 
7898
                    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
6727
7899
                       $EGREP "$match_pattern_regex" > /dev/null; then
6728
 
                      newdeplibs="$newdeplibs $a_deplib"
 
7900
                      func_append newdeplibs " $a_deplib"
6729
7901
                      a_deplib=""
6730
7902
                      break 2
6731
7903
                    fi
6734
7906
              fi
6735
7907
              if test -n "$a_deplib" ; then
6736
7908
                droppeddeps=yes
6737
 
                $ECHO
 
7909
                echo
6738
7910
                $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
6739
 
                $ECHO "*** I have the capability to make that library automatically link in when"
6740
 
                $ECHO "*** you link to this library.  But I can only do this if you have a"
6741
 
                $ECHO "*** shared version of the library, which you do not appear to have"
6742
 
                $ECHO "*** because I did check the linker path looking for a file starting"
 
7911
                echo "*** I have the capability to make that library automatically link in when"
 
7912
                echo "*** you link to this library.  But I can only do this if you have a"
 
7913
                echo "*** shared version of the library, which you do not appear to have"
 
7914
                echo "*** because I did check the linker path looking for a file starting"
6743
7915
                if test -z "$potlib" ; then
6744
7916
                  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
6745
7917
                else
6750
7922
              ;;
6751
7923
            *)
6752
7924
              # Add a -L argument.
6753
 
              newdeplibs="$newdeplibs $a_deplib"
 
7925
              func_append newdeplibs " $a_deplib"
6754
7926
              ;;
6755
7927
            esac
6756
7928
          done # Gone through all deplibs.
6757
7929
          ;;
6758
7930
        none | unknown | *)
6759
7931
          newdeplibs=""
6760
 
          tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
6761
 
              -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
 
7932
          tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
6762
7933
          if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6763
7934
            for i in $predeps $postdeps ; do
6764
7935
              # can't use Xsed below, because $i might contain '/'
6765
 
              tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
 
7936
              tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
6766
7937
            done
6767
7938
          fi
6768
 
          if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[      ]//g' |
6769
 
             $GREP . >/dev/null; then
6770
 
            $ECHO
 
7939
          case $tmp_deplibs in
 
7940
          *[!\  \ ]*)
 
7941
            echo
6771
7942
            if test "X$deplibs_check_method" = "Xnone"; then
6772
 
              $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
 
7943
              echo "*** Warning: inter-library dependencies are not supported in this platform."
6773
7944
            else
6774
 
              $ECHO "*** Warning: inter-library dependencies are not known to be supported."
 
7945
              echo "*** Warning: inter-library dependencies are not known to be supported."
6775
7946
            fi
6776
 
            $ECHO "*** All declared inter-library dependencies are being dropped."
 
7947
            echo "*** All declared inter-library dependencies are being dropped."
6777
7948
            droppeddeps=yes
6778
 
          fi
 
7949
            ;;
 
7950
          esac
6779
7951
          ;;
6780
7952
        esac
6781
7953
        versuffix=$versuffix_save
6787
7959
        case $host in
6788
7960
        *-*-rhapsody* | *-*-darwin1.[012])
6789
7961
          # On Rhapsody replace the C library with the System framework
6790
 
          newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 
7962
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
6791
7963
          ;;
6792
7964
        esac
6793
7965
 
6794
7966
        if test "$droppeddeps" = yes; then
6795
7967
          if test "$module" = yes; then
6796
 
            $ECHO
6797
 
            $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
 
7968
            echo
 
7969
            echo "*** Warning: libtool could not satisfy all declared inter-library"
6798
7970
            $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
6799
 
            $ECHO "*** a static module, that should work as long as the dlopening"
6800
 
            $ECHO "*** application is linked with the -dlopen flag."
 
7971
            echo "*** a static module, that should work as long as the dlopening"
 
7972
            echo "*** application is linked with the -dlopen flag."
6801
7973
            if test -z "$global_symbol_pipe"; then
6802
 
              $ECHO
6803
 
              $ECHO "*** However, this would only work if libtool was able to extract symbol"
6804
 
              $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
6805
 
              $ECHO "*** not find such a program.  So, this module is probably useless."
6806
 
              $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
 
7974
              echo
 
7975
              echo "*** However, this would only work if libtool was able to extract symbol"
 
7976
              echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
 
7977
              echo "*** not find such a program.  So, this module is probably useless."
 
7978
              echo "*** \`nm' from GNU binutils and a full rebuild may help."
6807
7979
            fi
6808
7980
            if test "$build_old_libs" = no; then
6809
7981
              oldlibs="$output_objdir/$libname.$libext"
6813
7985
              build_libtool_libs=no
6814
7986
            fi
6815
7987
          else
6816
 
            $ECHO "*** The inter-library dependencies that have been dropped here will be"
6817
 
            $ECHO "*** automatically added whenever a program is linked with this library"
6818
 
            $ECHO "*** or is declared to -dlopen it."
 
7988
            echo "*** The inter-library dependencies that have been dropped here will be"
 
7989
            echo "*** automatically added whenever a program is linked with this library"
 
7990
            echo "*** or is declared to -dlopen it."
6819
7991
 
6820
7992
            if test "$allow_undefined" = no; then
6821
 
              $ECHO
6822
 
              $ECHO "*** Since this library must not contain undefined symbols,"
6823
 
              $ECHO "*** because either the platform does not support them or"
6824
 
              $ECHO "*** it was explicitly requested with -no-undefined,"
6825
 
              $ECHO "*** libtool will only create a static version of it."
 
7993
              echo
 
7994
              echo "*** Since this library must not contain undefined symbols,"
 
7995
              echo "*** because either the platform does not support them or"
 
7996
              echo "*** it was explicitly requested with -no-undefined,"
 
7997
              echo "*** libtool will only create a static version of it."
6826
7998
              if test "$build_old_libs" = no; then
6827
7999
                oldlibs="$output_objdir/$libname.$libext"
6828
8000
                build_libtool_libs=module
6839
8011
      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
6840
8012
      case $host in
6841
8013
        *-*-darwin*)
6842
 
          newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6843
 
          new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
6844
 
          deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
8014
          newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
8015
          new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
8016
          deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6845
8017
          ;;
6846
8018
      esac
6847
8019
 
6854
8026
        *)
6855
8027
          case " $deplibs " in
6856
8028
          *" -L$path/$objdir "*)
6857
 
            new_libs="$new_libs -L$path/$objdir" ;;
 
8029
            func_append new_libs " -L$path/$objdir" ;;
6858
8030
          esac
6859
8031
          ;;
6860
8032
        esac
6864
8036
        -L*)
6865
8037
          case " $new_libs " in
6866
8038
          *" $deplib "*) ;;
6867
 
          *) new_libs="$new_libs $deplib" ;;
 
8039
          *) func_append new_libs " $deplib" ;;
6868
8040
          esac
6869
8041
          ;;
6870
 
        *) new_libs="$new_libs $deplib" ;;
 
8042
        *) func_append new_libs " $deplib" ;;
6871
8043
        esac
6872
8044
      done
6873
8045
      deplibs="$new_libs"
6879
8051
 
6880
8052
      # Test again, we may have decided not to build it any more
6881
8053
      if test "$build_libtool_libs" = yes; then
 
8054
        # Remove ${wl} instances when linking with ld.
 
8055
        # FIXME: should test the right _cmds variable.
 
8056
        case $archive_cmds in
 
8057
          *\$LD\ *) wl= ;;
 
8058
        esac
6882
8059
        if test "$hardcode_into_libs" = yes; then
6883
8060
          # Hardcode the library paths
6884
8061
          hardcode_libdirs=
6885
8062
          dep_rpath=
6886
8063
          rpath="$finalize_rpath"
6887
 
          test "$mode" != relink && rpath="$compile_rpath$rpath"
 
8064
          test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
6888
8065
          for libdir in $rpath; do
6889
8066
            if test -n "$hardcode_libdir_flag_spec"; then
6890
8067
              if test -n "$hardcode_libdir_separator"; then
 
8068
                func_replace_sysroot "$libdir"
 
8069
                libdir=$func_replace_sysroot_result
6891
8070
                if test -z "$hardcode_libdirs"; then
6892
8071
                  hardcode_libdirs="$libdir"
6893
8072
                else
6896
8075
                  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
6897
8076
                    ;;
6898
8077
                  *)
6899
 
                    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
8078
                    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
6900
8079
                    ;;
6901
8080
                  esac
6902
8081
                fi
6903
8082
              else
6904
8083
                eval flag=\"$hardcode_libdir_flag_spec\"
6905
 
                dep_rpath="$dep_rpath $flag"
 
8084
                func_append dep_rpath " $flag"
6906
8085
              fi
6907
8086
            elif test -n "$runpath_var"; then
6908
8087
              case "$perm_rpath " in
6909
8088
              *" $libdir "*) ;;
6910
 
              *) perm_rpath="$perm_rpath $libdir" ;;
 
8089
              *) func_append perm_rpath " $libdir" ;;
6911
8090
              esac
6912
8091
            fi
6913
8092
          done
6915
8094
          if test -n "$hardcode_libdir_separator" &&
6916
8095
             test -n "$hardcode_libdirs"; then
6917
8096
            libdir="$hardcode_libdirs"
6918
 
            if test -n "$hardcode_libdir_flag_spec_ld"; then
6919
 
              eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
6920
 
            else
6921
 
              eval dep_rpath=\"$hardcode_libdir_flag_spec\"
6922
 
            fi
 
8097
            eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
6923
8098
          fi
6924
8099
          if test -n "$runpath_var" && test -n "$perm_rpath"; then
6925
8100
            # We should set the runpath_var.
6926
8101
            rpath=
6927
8102
            for dir in $perm_rpath; do
6928
 
              rpath="$rpath$dir:"
 
8103
              func_append rpath "$dir:"
6929
8104
            done
6930
8105
            eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
6931
8106
          fi
6933
8108
        fi
6934
8109
 
6935
8110
        shlibpath="$finalize_shlibpath"
6936
 
        test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
 
8111
        test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
6937
8112
        if test -n "$shlibpath"; then
6938
8113
          eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
6939
8114
        fi
6959
8134
        linknames=
6960
8135
        for link
6961
8136
        do
6962
 
          linknames="$linknames $link"
 
8137
          func_append linknames " $link"
6963
8138
        done
6964
8139
 
6965
8140
        # Use standard objects if they are pic
6966
 
        test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
8141
        test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
6967
8142
        test "X$libobjs" = "X " && libobjs=
6968
8143
 
6969
8144
        delfiles=
6970
8145
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
6971
8146
          $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
6972
8147
          export_symbols="$output_objdir/$libname.uexp"
6973
 
          delfiles="$delfiles $export_symbols"
 
8148
          func_append delfiles " $export_symbols"
6974
8149
        fi
6975
8150
 
6976
8151
        orig_export_symbols=
7001
8176
            $opt_dry_run || $RM $export_symbols
7002
8177
            cmds=$export_symbols_cmds
7003
8178
            save_ifs="$IFS"; IFS='~'
7004
 
            for cmd in $cmds; do
 
8179
            for cmd1 in $cmds; do
7005
8180
              IFS="$save_ifs"
7006
 
              eval cmd=\"$cmd\"
7007
 
              func_len " $cmd"
7008
 
              len=$func_len_result
7009
 
              if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7010
 
                func_show_eval "$cmd" 'exit $?'
 
8181
              # Take the normal branch if the nm_file_list_spec branch
 
8182
              # doesn't work or if tool conversion is not needed.
 
8183
              case $nm_file_list_spec~$to_tool_file_cmd in
 
8184
                *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
 
8185
                  try_normal_branch=yes
 
8186
                  eval cmd=\"$cmd1\"
 
8187
                  func_len " $cmd"
 
8188
                  len=$func_len_result
 
8189
                  ;;
 
8190
                *)
 
8191
                  try_normal_branch=no
 
8192
                  ;;
 
8193
              esac
 
8194
              if test "$try_normal_branch" = yes \
 
8195
                 && { test "$len" -lt "$max_cmd_len" \
 
8196
                      || test "$max_cmd_len" -le -1; }
 
8197
              then
 
8198
                func_show_eval "$cmd" 'exit $?'
 
8199
                skipped_export=false
 
8200
              elif test -n "$nm_file_list_spec"; then
 
8201
                func_basename "$output"
 
8202
                output_la=$func_basename_result
 
8203
                save_libobjs=$libobjs
 
8204
                save_output=$output
 
8205
                output=${output_objdir}/${output_la}.nm
 
8206
                func_to_tool_file "$output"
 
8207
                libobjs=$nm_file_list_spec$func_to_tool_file_result
 
8208
                func_append delfiles " $output"
 
8209
                func_verbose "creating $NM input file list: $output"
 
8210
                for obj in $save_libobjs; do
 
8211
                  func_to_tool_file "$obj"
 
8212
                  $ECHO "$func_to_tool_file_result"
 
8213
                done > "$output"
 
8214
                eval cmd=\"$cmd1\"
 
8215
                func_show_eval "$cmd" 'exit $?'
 
8216
                output=$save_output
 
8217
                libobjs=$save_libobjs
7011
8218
                skipped_export=false
7012
8219
              else
7013
8220
                # The command line is too long to execute in one step.
7029
8236
        if test -n "$export_symbols" && test -n "$include_expsyms"; then
7030
8237
          tmp_export_symbols="$export_symbols"
7031
8238
          test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7032
 
          $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
 
8239
          $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
7033
8240
        fi
7034
8241
 
7035
8242
        if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
7041
8248
          # global variables. join(1) would be nice here, but unfortunately
7042
8249
          # isn't a blessed tool.
7043
8250
          $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7044
 
          delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
 
8251
          func_append delfiles " $export_symbols $output_objdir/$libname.filter"
7045
8252
          export_symbols=$output_objdir/$libname.def
7046
8253
          $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7047
8254
        fi
7051
8258
          case " $convenience " in
7052
8259
          *" $test_deplib "*) ;;
7053
8260
          *)
7054
 
            tmp_deplibs="$tmp_deplibs $test_deplib"
 
8261
            func_append tmp_deplibs " $test_deplib"
7055
8262
            ;;
7056
8263
          esac
7057
8264
        done
7071
8278
            test "X$libobjs" = "X " && libobjs=
7072
8279
          else
7073
8280
            gentop="$output_objdir/${outputname}x"
7074
 
            generated="$generated $gentop"
 
8281
            func_append generated " $gentop"
7075
8282
 
7076
8283
            func_extract_archives $gentop $convenience
7077
 
            libobjs="$libobjs $func_extract_archives_result"
 
8284
            func_append libobjs " $func_extract_archives_result"
7078
8285
            test "X$libobjs" = "X " && libobjs=
7079
8286
          fi
7080
8287
        fi
7081
8288
 
7082
8289
        if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
7083
8290
          eval flag=\"$thread_safe_flag_spec\"
7084
 
          linker_flags="$linker_flags $flag"
 
8291
          func_append linker_flags " $flag"
7085
8292
        fi
7086
8293
 
7087
8294
        # Make a backup of the uninstalled library when relinking
7088
 
        if test "$mode" = relink; then
 
8295
        if test "$opt_mode" = relink; then
7089
8296
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
7090
8297
        fi
7091
8298
 
7130
8337
            save_libobjs=$libobjs
7131
8338
          fi
7132
8339
          save_output=$output
7133
 
          output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
 
8340
          func_basename "$output"
 
8341
          output_la=$func_basename_result
7134
8342
 
7135
8343
          # Clear the reloadable object creation command queue and
7136
8344
          # initialize k to one.
7143
8351
          if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
7144
8352
            output=${output_objdir}/${output_la}.lnkscript
7145
8353
            func_verbose "creating GNU ld script: $output"
7146
 
            $ECHO 'INPUT (' > $output
 
8354
            echo 'INPUT (' > $output
7147
8355
            for obj in $save_libobjs
7148
8356
            do
7149
 
              $ECHO "$obj" >> $output
 
8357
              func_to_tool_file "$obj"
 
8358
              $ECHO "$func_to_tool_file_result" >> $output
7150
8359
            done
7151
 
            $ECHO ')' >> $output
7152
 
            delfiles="$delfiles $output"
 
8360
            echo ')' >> $output
 
8361
            func_append delfiles " $output"
 
8362
            func_to_tool_file "$output"
 
8363
            output=$func_to_tool_file_result
7153
8364
          elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
7154
8365
            output=${output_objdir}/${output_la}.lnk
7155
8366
            func_verbose "creating linker input file list: $output"
7163
8374
            fi
7164
8375
            for obj
7165
8376
            do
7166
 
              $ECHO "$obj" >> $output
 
8377
              func_to_tool_file "$obj"
 
8378
              $ECHO "$func_to_tool_file_result" >> $output
7167
8379
            done
7168
 
            delfiles="$delfiles $output"
7169
 
            output=$firstobj\"$file_list_spec$output\"
 
8380
            func_append delfiles " $output"
 
8381
            func_to_tool_file "$output"
 
8382
            output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
7170
8383
          else
7171
8384
            if test -n "$save_libobjs"; then
7172
8385
              func_verbose "creating reloadable object files..."
7190
8403
                  # command to the queue.
7191
8404
                  if test "$k" -eq 1 ; then
7192
8405
                    # The first file doesn't have a previous command to add.
7193
 
                    eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
 
8406
                    reload_objs=$objlist
 
8407
                    eval concat_cmds=\"$reload_cmds\"
7194
8408
                  else
7195
8409
                    # All subsequent reloadable object files will link in
7196
8410
                    # the last one created.
7197
 
                    eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
 
8411
                    reload_objs="$objlist $last_robj"
 
8412
                    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
7198
8413
                  fi
7199
8414
                  last_robj=$output_objdir/$output_la-${k}.$objext
7200
8415
                  func_arith $k + 1
7201
8416
                  k=$func_arith_result
7202
8417
                  output=$output_objdir/$output_la-${k}.$objext
7203
 
                  objlist=$obj
 
8418
                  objlist=" $obj"
7204
8419
                  func_len " $last_robj"
7205
8420
                  func_arith $len0 + $func_len_result
7206
8421
                  len=$func_arith_result
7210
8425
              # reloadable object file.  All subsequent reloadable object
7211
8426
              # files will link in the last one created.
7212
8427
              test -z "$concat_cmds" || concat_cmds=$concat_cmds~
7213
 
              eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
 
8428
              reload_objs="$objlist $last_robj"
 
8429
              eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
7214
8430
              if test -n "$last_robj"; then
7215
8431
                eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
7216
8432
              fi
7217
 
              delfiles="$delfiles $output"
 
8433
              func_append delfiles " $output"
7218
8434
 
7219
8435
            else
7220
8436
              output=
7248
8464
                lt_exit=$?
7249
8465
 
7250
8466
                # Restore the uninstalled library and exit
7251
 
                if test "$mode" = relink; then
 
8467
                if test "$opt_mode" = relink; then
7252
8468
                  ( cd "$output_objdir" && \
7253
8469
                    $RM "${realname}T" && \
7254
8470
                    $MV "${realname}U" "$realname" )
7269
8485
            if test -n "$export_symbols" && test -n "$include_expsyms"; then
7270
8486
              tmp_export_symbols="$export_symbols"
7271
8487
              test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
7272
 
              $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
 
8488
              $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
7273
8489
            fi
7274
8490
 
7275
8491
            if test -n "$orig_export_symbols"; then
7281
8497
              # global variables. join(1) would be nice here, but unfortunately
7282
8498
              # isn't a blessed tool.
7283
8499
              $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
7284
 
              delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
 
8500
              func_append delfiles " $export_symbols $output_objdir/$libname.filter"
7285
8501
              export_symbols=$output_objdir/$libname.def
7286
8502
              $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
7287
8503
            fi
7322
8538
        # Add any objects from preloaded convenience libraries
7323
8539
        if test -n "$dlprefiles"; then
7324
8540
          gentop="$output_objdir/${outputname}x"
7325
 
          generated="$generated $gentop"
 
8541
          func_append generated " $gentop"
7326
8542
 
7327
8543
          func_extract_archives $gentop $dlprefiles
7328
 
          libobjs="$libobjs $func_extract_archives_result"
 
8544
          func_append libobjs " $func_extract_archives_result"
7329
8545
          test "X$libobjs" = "X " && libobjs=
7330
8546
        fi
7331
8547
 
7341
8557
            lt_exit=$?
7342
8558
 
7343
8559
            # Restore the uninstalled library and exit
7344
 
            if test "$mode" = relink; then
 
8560
            if test "$opt_mode" = relink; then
7345
8561
              ( cd "$output_objdir" && \
7346
8562
                $RM "${realname}T" && \
7347
8563
                $MV "${realname}U" "$realname" )
7353
8569
        IFS="$save_ifs"
7354
8570
 
7355
8571
        # Restore the uninstalled library and exit
7356
 
        if test "$mode" = relink; then
 
8572
        if test "$opt_mode" = relink; then
7357
8573
          $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
7358
8574
 
7359
8575
          if test -n "$convenience"; then
7434
8650
      if test -n "$convenience"; then
7435
8651
        if test -n "$whole_archive_flag_spec"; then
7436
8652
          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
7437
 
          reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
 
8653
          reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
7438
8654
        else
7439
8655
          gentop="$output_objdir/${obj}x"
7440
 
          generated="$generated $gentop"
 
8656
          func_append generated " $gentop"
7441
8657
 
7442
8658
          func_extract_archives $gentop $convenience
7443
8659
          reload_conv_objs="$reload_objs $func_extract_archives_result"
7444
8660
        fi
7445
8661
      fi
7446
8662
 
 
8663
      # If we're not building shared, we need to use non_pic_objs
 
8664
      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
 
8665
 
7447
8666
      # Create the old-style object.
7448
 
      reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
 
8667
      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
7449
8668
 
7450
8669
      output="$obj"
7451
8670
      func_execute_cmds "$reload_cmds" 'exit $?'
7505
8724
      case $host in
7506
8725
      *-*-rhapsody* | *-*-darwin1.[012])
7507
8726
        # On Rhapsody replace the C library is the System framework
7508
 
        compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
7509
 
        finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
 
8727
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
 
8728
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
7510
8729
        ;;
7511
8730
      esac
7512
8731
 
7517
8736
        if test "$tagname" = CXX ; then
7518
8737
          case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
7519
8738
            10.[0123])
7520
 
              compile_command="$compile_command ${wl}-bind_at_load"
7521
 
              finalize_command="$finalize_command ${wl}-bind_at_load"
 
8739
              func_append compile_command " ${wl}-bind_at_load"
 
8740
              func_append finalize_command " ${wl}-bind_at_load"
7522
8741
            ;;
7523
8742
          esac
7524
8743
        fi
7525
8744
        # Time to change all our "foo.ltframework" stuff back to "-framework foo"
7526
 
        compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
7527
 
        finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
 
8745
        compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
 
8746
        finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7528
8747
        ;;
7529
8748
      esac
7530
8749
 
7538
8757
        *)
7539
8758
          case " $compile_deplibs " in
7540
8759
          *" -L$path/$objdir "*)
7541
 
            new_libs="$new_libs -L$path/$objdir" ;;
 
8760
            func_append new_libs " -L$path/$objdir" ;;
7542
8761
          esac
7543
8762
          ;;
7544
8763
        esac
7548
8767
        -L*)
7549
8768
          case " $new_libs " in
7550
8769
          *" $deplib "*) ;;
7551
 
          *) new_libs="$new_libs $deplib" ;;
 
8770
          *) func_append new_libs " $deplib" ;;
7552
8771
          esac
7553
8772
          ;;
7554
 
        *) new_libs="$new_libs $deplib" ;;
 
8773
        *) func_append new_libs " $deplib" ;;
7555
8774
        esac
7556
8775
      done
7557
8776
      compile_deplibs="$new_libs"
7558
8777
 
7559
8778
 
7560
 
      compile_command="$compile_command $compile_deplibs"
7561
 
      finalize_command="$finalize_command $finalize_deplibs"
 
8779
      func_append compile_command " $compile_deplibs"
 
8780
      func_append finalize_command " $finalize_deplibs"
7562
8781
 
7563
8782
      if test -n "$rpath$xrpath"; then
7564
8783
        # If the user specified any rpath flags, then add them.
7566
8785
          # This is the magic to use -rpath.
7567
8786
          case "$finalize_rpath " in
7568
8787
          *" $libdir "*) ;;
7569
 
          *) finalize_rpath="$finalize_rpath $libdir" ;;
 
8788
          *) func_append finalize_rpath " $libdir" ;;
7570
8789
          esac
7571
8790
        done
7572
8791
      fi
7585
8804
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7586
8805
                ;;
7587
8806
              *)
7588
 
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
8807
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7589
8808
                ;;
7590
8809
              esac
7591
8810
            fi
7592
8811
          else
7593
8812
            eval flag=\"$hardcode_libdir_flag_spec\"
7594
 
            rpath="$rpath $flag"
 
8813
            func_append rpath " $flag"
7595
8814
          fi
7596
8815
        elif test -n "$runpath_var"; then
7597
8816
          case "$perm_rpath " in
7598
8817
          *" $libdir "*) ;;
7599
 
          *) perm_rpath="$perm_rpath $libdir" ;;
 
8818
          *) func_append perm_rpath " $libdir" ;;
7600
8819
          esac
7601
8820
        fi
7602
8821
        case $host in
7605
8824
          case :$dllsearchpath: in
7606
8825
          *":$libdir:"*) ;;
7607
8826
          ::) dllsearchpath=$libdir;;
7608
 
          *) dllsearchpath="$dllsearchpath:$libdir";;
 
8827
          *) func_append dllsearchpath ":$libdir";;
7609
8828
          esac
7610
8829
          case :$dllsearchpath: in
7611
8830
          *":$testbindir:"*) ;;
7612
8831
          ::) dllsearchpath=$testbindir;;
7613
 
          *) dllsearchpath="$dllsearchpath:$testbindir";;
 
8832
          *) func_append dllsearchpath ":$testbindir";;
7614
8833
          esac
7615
8834
          ;;
7616
8835
        esac
7636
8855
              *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
7637
8856
                ;;
7638
8857
              *)
7639
 
                hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
 
8858
                func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
7640
8859
                ;;
7641
8860
              esac
7642
8861
            fi
7643
8862
          else
7644
8863
            eval flag=\"$hardcode_libdir_flag_spec\"
7645
 
            rpath="$rpath $flag"
 
8864
            func_append rpath " $flag"
7646
8865
          fi
7647
8866
        elif test -n "$runpath_var"; then
7648
8867
          case "$finalize_perm_rpath " in
7649
8868
          *" $libdir "*) ;;
7650
 
          *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
 
8869
          *) func_append finalize_perm_rpath " $libdir" ;;
7651
8870
          esac
7652
8871
        fi
7653
8872
      done
7661
8880
 
7662
8881
      if test -n "$libobjs" && test "$build_old_libs" = yes; then
7663
8882
        # Transform all the library objects into standard objects.
7664
 
        compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
7665
 
        finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
 
8883
        compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
 
8884
        finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
7666
8885
      fi
7667
8886
 
7668
8887
      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
7674
8893
 
7675
8894
      wrappers_required=yes
7676
8895
      case $host in
 
8896
      *cegcc* | *mingw32ce*)
 
8897
        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
 
8898
        wrappers_required=no
 
8899
        ;;
7677
8900
      *cygwin* | *mingw* )
7678
8901
        if test "$build_libtool_libs" != yes; then
7679
8902
          wrappers_required=no
7680
8903
        fi
7681
8904
        ;;
7682
 
      *cegcc)
7683
 
        # Disable wrappers for cegcc, we are cross compiling anyway.
7684
 
        wrappers_required=no
7685
 
        ;;
7686
8905
      *)
7687
8906
        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
7688
8907
          wrappers_required=no
7691
8910
      esac
7692
8911
      if test "$wrappers_required" = no; then
7693
8912
        # Replace the output file specification.
7694
 
        compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 
8913
        compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7695
8914
        link_command="$compile_command$compile_rpath"
7696
8915
 
7697
8916
        # We have no uninstalled library dependencies, so finalize right now.
7698
8917
        exit_status=0
7699
8918
        func_show_eval "$link_command" 'exit_status=$?'
7700
8919
 
 
8920
        if test -n "$postlink_cmds"; then
 
8921
          func_to_tool_file "$output"
 
8922
          postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
 
8923
          func_execute_cmds "$postlink_cmds" 'exit $?'
 
8924
        fi
 
8925
 
7701
8926
        # Delete the generated files.
7702
8927
        if test -f "$output_objdir/${outputname}S.${objext}"; then
7703
8928
          func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
7720
8945
          # We should set the runpath_var.
7721
8946
          rpath=
7722
8947
          for dir in $perm_rpath; do
7723
 
            rpath="$rpath$dir:"
 
8948
            func_append rpath "$dir:"
7724
8949
          done
7725
8950
          compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
7726
8951
        fi
7728
8953
          # We should set the runpath_var.
7729
8954
          rpath=
7730
8955
          for dir in $finalize_perm_rpath; do
7731
 
            rpath="$rpath$dir:"
 
8956
            func_append rpath "$dir:"
7732
8957
          done
7733
8958
          finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
7734
8959
        fi
7738
8963
        # We don't need to create a wrapper script.
7739
8964
        link_command="$compile_var$compile_command$compile_rpath"
7740
8965
        # Replace the output file specification.
7741
 
        link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
 
8966
        link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
7742
8967
        # Delete the old output file.
7743
8968
        $opt_dry_run || $RM $output
7744
8969
        # Link the executable and exit
7745
8970
        func_show_eval "$link_command" 'exit $?'
 
8971
 
 
8972
        if test -n "$postlink_cmds"; then
 
8973
          func_to_tool_file "$output"
 
8974
          postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
 
8975
          func_execute_cmds "$postlink_cmds" 'exit $?'
 
8976
        fi
 
8977
 
7746
8978
        exit $EXIT_SUCCESS
7747
8979
      fi
7748
8980
 
7757
8989
        if test "$fast_install" != no; then
7758
8990
          link_command="$finalize_var$compile_command$finalize_rpath"
7759
8991
          if test "$fast_install" = yes; then
7760
 
            relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
 
8992
            relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
7761
8993
          else
7762
8994
            # fast_install is set to needless
7763
8995
            relink_command=
7769
9001
      fi
7770
9002
 
7771
9003
      # Replace the output file specification.
7772
 
      link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
 
9004
      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
7773
9005
 
7774
9006
      # Delete the old output files.
7775
9007
      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
7776
9008
 
7777
9009
      func_show_eval "$link_command" 'exit $?'
7778
9010
 
 
9011
      if test -n "$postlink_cmds"; then
 
9012
        func_to_tool_file "$output_objdir/$outputname"
 
9013
        postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
 
9014
        func_execute_cmds "$postlink_cmds" 'exit $?'
 
9015
      fi
 
9016
 
7779
9017
      # Now create the wrapper script.
7780
9018
      func_verbose "creating $output"
7781
9019
 
7793
9031
          fi
7794
9032
        done
7795
9033
        relink_command="(cd `pwd`; $relink_command)"
7796
 
        relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
7797
 
      fi
7798
 
 
7799
 
      # Quote $ECHO for shipping.
7800
 
      if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
7801
 
        case $progpath in
7802
 
        [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
7803
 
        *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
7804
 
        esac
7805
 
        qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
7806
 
      else
7807
 
        qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
 
9034
        relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
7808
9035
      fi
7809
9036
 
7810
9037
      # Only actually do things if not in dry run mode.
7884
9111
        else
7885
9112
          oldobjs="$old_deplibs $non_pic_objects"
7886
9113
          if test "$preload" = yes && test -f "$symfileobj"; then
7887
 
            oldobjs="$oldobjs $symfileobj"
 
9114
            func_append oldobjs " $symfileobj"
7888
9115
          fi
7889
9116
        fi
7890
9117
        addlibs="$old_convenience"
7892
9119
 
7893
9120
      if test -n "$addlibs"; then
7894
9121
        gentop="$output_objdir/${outputname}x"
7895
 
        generated="$generated $gentop"
 
9122
        func_append generated " $gentop"
7896
9123
 
7897
9124
        func_extract_archives $gentop $addlibs
7898
 
        oldobjs="$oldobjs $func_extract_archives_result"
 
9125
        func_append oldobjs " $func_extract_archives_result"
7899
9126
      fi
7900
9127
 
7901
9128
      # Do each command in the archive commands.
7906
9133
        # Add any objects from preloaded convenience libraries
7907
9134
        if test -n "$dlprefiles"; then
7908
9135
          gentop="$output_objdir/${outputname}x"
7909
 
          generated="$generated $gentop"
 
9136
          func_append generated " $gentop"
7910
9137
 
7911
9138
          func_extract_archives $gentop $dlprefiles
7912
 
          oldobjs="$oldobjs $func_extract_archives_result"
 
9139
          func_append oldobjs " $func_extract_archives_result"
7913
9140
        fi
7914
9141
 
7915
9142
        # POSIX demands no paths to be encoded in archives.  We have
7925
9152
            done | sort | sort -uc >/dev/null 2>&1); then
7926
9153
          :
7927
9154
        else
7928
 
          $ECHO "copying selected object files to avoid basename conflicts..."
 
9155
          echo "copying selected object files to avoid basename conflicts..."
7929
9156
          gentop="$output_objdir/${outputname}x"
7930
 
          generated="$generated $gentop"
 
9157
          func_append generated " $gentop"
7931
9158
          func_mkdir_p "$gentop"
7932
9159
          save_oldobjs=$oldobjs
7933
9160
          oldobjs=
7951
9178
                esac
7952
9179
              done
7953
9180
              func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
7954
 
              oldobjs="$oldobjs $gentop/$newobj"
 
9181
              func_append oldobjs " $gentop/$newobj"
7955
9182
              ;;
7956
 
            *) oldobjs="$oldobjs $obj" ;;
 
9183
            *) func_append oldobjs " $obj" ;;
7957
9184
            esac
7958
9185
          done
7959
9186
        fi
 
9187
        func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
 
9188
        tool_oldlib=$func_to_tool_file_result
7960
9189
        eval cmds=\"$old_archive_cmds\"
7961
9190
 
7962
9191
        func_len " $cmds"
7963
9192
        len=$func_len_result
7964
9193
        if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
7965
9194
          cmds=$old_archive_cmds
 
9195
        elif test -n "$archiver_list_spec"; then
 
9196
          func_verbose "using command file archive linking..."
 
9197
          for obj in $oldobjs
 
9198
          do
 
9199
            func_to_tool_file "$obj"
 
9200
            $ECHO "$func_to_tool_file_result"
 
9201
          done > $output_objdir/$libname.libcmd
 
9202
          func_to_tool_file "$output_objdir/$libname.libcmd"
 
9203
          oldobjs=" $archiver_list_spec$func_to_tool_file_result"
 
9204
          cmds=$old_archive_cmds
7966
9205
        else
7967
9206
          # the command line is too long to link in one step, link in parts
7968
9207
          func_verbose "using piecewise archive linking..."
8036
9275
      done
8037
9276
      # Quote the link command for shipping.
8038
9277
      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
8039
 
      relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
 
9278
      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
8040
9279
      if test "$hardcode_automatic" = yes ; then
8041
9280
        relink_command=
8042
9281
      fi
8056
9295
              *.la)
8057
9296
                func_basename "$deplib"
8058
9297
                name="$func_basename_result"
8059
 
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
 
9298
                func_resolve_sysroot "$deplib"
 
9299
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
8060
9300
                test -z "$libdir" && \
8061
9301
                  func_fatal_error "\`$deplib' is not a valid libtool archive"
8062
 
                newdependency_libs="$newdependency_libs $libdir/$name"
8063
 
                ;;
8064
 
              *) newdependency_libs="$newdependency_libs $deplib" ;;
 
9302
                func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
 
9303
                ;;
 
9304
              -L*)
 
9305
                func_stripname -L '' "$deplib"
 
9306
                func_replace_sysroot "$func_stripname_result"
 
9307
                func_append newdependency_libs " -L$func_replace_sysroot_result"
 
9308
                ;;
 
9309
              -R*)
 
9310
                func_stripname -R '' "$deplib"
 
9311
                func_replace_sysroot "$func_stripname_result"
 
9312
                func_append newdependency_libs " -R$func_replace_sysroot_result"
 
9313
                ;;
 
9314
              *) func_append newdependency_libs " $deplib" ;;
8065
9315
              esac
8066
9316
            done
8067
9317
            dependency_libs="$newdependency_libs"
8075
9325
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8076
9326
                test -z "$libdir" && \
8077
9327
                  func_fatal_error "\`$lib' is not a valid libtool archive"
8078
 
                newdlfiles="$newdlfiles $libdir/$name"
 
9328
                func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
8079
9329
                ;;
8080
 
              *) newdlfiles="$newdlfiles $lib" ;;
 
9330
              *) func_append newdlfiles " $lib" ;;
8081
9331
              esac
8082
9332
            done
8083
9333
            dlfiles="$newdlfiles"
8094
9344
                eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
8095
9345
                test -z "$libdir" && \
8096
9346
                  func_fatal_error "\`$lib' is not a valid libtool archive"
8097
 
                newdlprefiles="$newdlprefiles $libdir/$name"
 
9347
                func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
8098
9348
                ;;
8099
9349
              esac
8100
9350
            done
8106
9356
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8107
9357
                *) abs=`pwd`"/$lib" ;;
8108
9358
              esac
8109
 
              newdlfiles="$newdlfiles $abs"
 
9359
              func_append newdlfiles " $abs"
8110
9360
            done
8111
9361
            dlfiles="$newdlfiles"
8112
9362
            newdlprefiles=
8115
9365
                [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
8116
9366
                *) abs=`pwd`"/$lib" ;;
8117
9367
              esac
8118
 
              newdlprefiles="$newdlprefiles $abs"
 
9368
              func_append newdlprefiles " $abs"
8119
9369
            done
8120
9370
            dlprefiles="$newdlprefiles"
8121
9371
          fi
8122
9372
          $RM $output
8123
9373
          # place dlname in correct position for cygwin
 
9374
          # In fact, it would be nice if we could use this code for all target
 
9375
          # systems that can't hard-code library paths into their executables
 
9376
          # and that have no shared library path variable independent of PATH,
 
9377
          # but it turns out we can't easily determine that from inspecting
 
9378
          # libtool variables, so we have to hard-code the OSs to which it
 
9379
          # applies here; at the moment, that means platforms that use the PE
 
9380
          # object format with DLL files.  See the long comment at the top of
 
9381
          # tests/bindir.at for full details.
8124
9382
          tdlname=$dlname
8125
9383
          case $host,$output,$installed,$module,$dlname in
8126
 
            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
 
9384
            *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
 
9385
              # If a -bindir argument was supplied, place the dll there.
 
9386
              if test "x$bindir" != x ;
 
9387
              then
 
9388
                func_relative_path "$install_libdir" "$bindir"
 
9389
                tdlname=$func_relative_path_result$dlname
 
9390
              else
 
9391
                # Otherwise fall back on heuristic.
 
9392
                tdlname=../bin/$dlname
 
9393
              fi
 
9394
              ;;
8127
9395
          esac
8128
9396
          $ECHO > $output "\
8129
9397
# $outputname - a libtool library file
8182
9450
    exit $EXIT_SUCCESS
8183
9451
}
8184
9452
 
8185
 
{ test "$mode" = link || test "$mode" = relink; } &&
 
9453
{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
8186
9454
    func_mode_link ${1+"$@"}
8187
9455
 
8188
9456
 
8202
9470
    for arg
8203
9471
    do
8204
9472
      case $arg in
8205
 
      -f) RM="$RM $arg"; rmforce=yes ;;
8206
 
      -*) RM="$RM $arg" ;;
8207
 
      *) files="$files $arg" ;;
 
9473
      -f) func_append RM " $arg"; rmforce=yes ;;
 
9474
      -*) func_append RM " $arg" ;;
 
9475
      *) func_append files " $arg" ;;
8208
9476
      esac
8209
9477
    done
8210
9478
 
8213
9481
 
8214
9482
    rmdirs=
8215
9483
 
8216
 
    origobjdir="$objdir"
8217
9484
    for file in $files; do
8218
9485
      func_dirname "$file" "" "."
8219
9486
      dir="$func_dirname_result"
8220
9487
      if test "X$dir" = X.; then
8221
 
        objdir="$origobjdir"
 
9488
        odir="$objdir"
8222
9489
      else
8223
 
        objdir="$dir/$origobjdir"
 
9490
        odir="$dir/$objdir"
8224
9491
      fi
8225
9492
      func_basename "$file"
8226
9493
      name="$func_basename_result"
8227
 
      test "$mode" = uninstall && objdir="$dir"
 
9494
      test "$opt_mode" = uninstall && odir="$dir"
8228
9495
 
8229
 
      # Remember objdir for removal later, being careful to avoid duplicates
8230
 
      if test "$mode" = clean; then
 
9496
      # Remember odir for removal later, being careful to avoid duplicates
 
9497
      if test "$opt_mode" = clean; then
8231
9498
        case " $rmdirs " in
8232
 
          *" $objdir "*) ;;
8233
 
          *) rmdirs="$rmdirs $objdir" ;;
 
9499
          *" $odir "*) ;;
 
9500
          *) func_append rmdirs " $odir" ;;
8234
9501
        esac
8235
9502
      fi
8236
9503
 
8256
9523
 
8257
9524
          # Delete the libtool libraries and symlinks.
8258
9525
          for n in $library_names; do
8259
 
            rmfiles="$rmfiles $objdir/$n"
 
9526
            func_append rmfiles " $odir/$n"
8260
9527
          done
8261
 
          test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
 
9528
          test -n "$old_library" && func_append rmfiles " $odir/$old_library"
8262
9529
 
8263
 
          case "$mode" in
 
9530
          case "$opt_mode" in
8264
9531
          clean)
8265
 
            case "  $library_names " in
8266
 
            # "  " in the beginning catches empty $dlname
 
9532
            case " $library_names " in
8267
9533
            *" $dlname "*) ;;
8268
 
            *) rmfiles="$rmfiles $objdir/$dlname" ;;
 
9534
            *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
8269
9535
            esac
8270
 
            test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
 
9536
            test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
8271
9537
            ;;
8272
9538
          uninstall)
8273
9539
            if test -n "$library_names"; then
8295
9561
          # Add PIC object to the list of files to remove.
8296
9562
          if test -n "$pic_object" &&
8297
9563
             test "$pic_object" != none; then
8298
 
            rmfiles="$rmfiles $dir/$pic_object"
 
9564
            func_append rmfiles " $dir/$pic_object"
8299
9565
          fi
8300
9566
 
8301
9567
          # Add non-PIC object to the list of files to remove.
8302
9568
          if test -n "$non_pic_object" &&
8303
9569
             test "$non_pic_object" != none; then
8304
 
            rmfiles="$rmfiles $dir/$non_pic_object"
 
9570
            func_append rmfiles " $dir/$non_pic_object"
8305
9571
          fi
8306
9572
        fi
8307
9573
        ;;
8308
9574
 
8309
9575
      *)
8310
 
        if test "$mode" = clean ; then
 
9576
        if test "$opt_mode" = clean ; then
8311
9577
          noexename=$name
8312
9578
          case $file in
8313
9579
          *.exe)
8317
9583
            noexename=$func_stripname_result
8318
9584
            # $file with .exe has already been added to rmfiles,
8319
9585
            # add $file without .exe
8320
 
            rmfiles="$rmfiles $file"
 
9586
            func_append rmfiles " $file"
8321
9587
            ;;
8322
9588
          esac
8323
9589
          # Do a test to see if this is a libtool program.
8326
9592
              func_ltwrapper_scriptname "$file"
8327
9593
              relink_command=
8328
9594
              func_source $func_ltwrapper_scriptname_result
8329
 
              rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
 
9595
              func_append rmfiles " $func_ltwrapper_scriptname_result"
8330
9596
            else
8331
9597
              relink_command=
8332
9598
              func_source $dir/$noexename
8334
9600
 
8335
9601
            # note $name still contains .exe if it was in $file originally
8336
9602
            # as does the version of $file that was added into $rmfiles
8337
 
            rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
 
9603
            func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
8338
9604
            if test "$fast_install" = yes && test -n "$relink_command"; then
8339
 
              rmfiles="$rmfiles $objdir/lt-$name"
 
9605
              func_append rmfiles " $odir/lt-$name"
8340
9606
            fi
8341
9607
            if test "X$noexename" != "X$name" ; then
8342
 
              rmfiles="$rmfiles $objdir/lt-${noexename}.c"
 
9608
              func_append rmfiles " $odir/lt-${noexename}.c"
8343
9609
            fi
8344
9610
          fi
8345
9611
        fi
8347
9613
      esac
8348
9614
      func_show_eval "$RM $rmfiles" 'exit_status=1'
8349
9615
    done
8350
 
    objdir="$origobjdir"
8351
9616
 
8352
9617
    # Try to remove the ${objdir}s in the directories where we deleted files
8353
9618
    for dir in $rmdirs; do
8359
9624
    exit $exit_status
8360
9625
}
8361
9626
 
8362
 
{ test "$mode" = uninstall || test "$mode" = clean; } &&
 
9627
{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
8363
9628
    func_mode_uninstall ${1+"$@"}
8364
9629
 
8365
 
test -z "$mode" && {
 
9630
test -z "$opt_mode" && {
8366
9631
  help="$generic_help"
8367
9632
  func_fatal_help "you must specify a MODE"
8368
9633
}
8369
9634
 
8370
9635
test -z "$exec_cmd" && \
8371
 
  func_fatal_help "invalid operation mode \`$mode'"
 
9636
  func_fatal_help "invalid operation mode \`$opt_mode'"
8372
9637
 
8373
9638
if test -n "$exec_cmd"; then
8374
9639
  eval exec "$exec_cmd"