Merge lp:~ubuntu-branches/ubuntu/oneiric/gnome-desktop3/oneiric-201109211552 into lp:ubuntu/oneiric/gnome-desktop3

Proposed by Ubuntu Package Importer
Status: Needs review
Proposed branch: lp:~ubuntu-branches/ubuntu/oneiric/gnome-desktop3/oneiric-201109211552
Merge into: lp:ubuntu/oneiric/gnome-desktop3
Diff against target: 8524 lines (+8489/-0) (has conflicts)
5 files modified
.pc/.quilt_patches (+1/-0)
.pc/.quilt_series (+1/-0)
.pc/99_ltmain_as-needed.patch/ltmain.sh (+8406/-0)
.pc/applied-patches (+1/-0)
debian/control (+80/-0)
Conflict adding file .pc/99_ltmain_as-needed.patch.  Moved existing file to .pc/99_ltmain_as-needed.patch.moved.
Conflict adding file .pc/applied-patches.  Moved existing file to .pc/applied-patches.moved.
Text conflict in debian/control
To merge this branch: bzr merge lp:~ubuntu-branches/ubuntu/oneiric/gnome-desktop3/oneiric-201109211552
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+76438@code.launchpad.net

Description of the change

The package importer has detected a possible inconsistency between the package history in the archive and the history in bzr. As the archive is authoritative the importer has made lp:ubuntu/oneiric/gnome-desktop3 reflect what is in the archive and the old bzr branch has been pushed to lp:~ubuntu-branches/ubuntu/oneiric/gnome-desktop3/oneiric-201109211552. This merge proposal was created so that an Ubuntu developer can review the situations and perform a merge/upload if necessary. There are three typical cases where this can happen.
  1. Where someone pushes a change to bzr and someone else uploads the package without that change. This is the reason that this check is done by the importer. If this appears to be the case then a merge/upload should be done if the changes that were in bzr are still desirable.
  2. The importer incorrectly detected the above situation when someone made a change in bzr and then uploaded it.
  3. The importer incorrectly detected the above situation when someone just uploaded a package and didn't touch bzr.

If this case doesn't appear to be the first situation then set the status of the merge proposal to "Rejected" and help avoid the problem in future by filing a bug at https://bugs.launchpad.net/udd linking to this merge proposal.

(this is an automatically generated message)

To post a comment you must log in.

Unmerged revisions

31. By Martin Pitt

releasing version 3.1.92-0ubuntu1

30. By Martin Pitt

new upstream release 3.1.92

29. By Martin Pitt

releasing version 3.1.91-0ubuntu1

28. By Martin Pitt

* New upstream release.
  - Add GnomeWallClock
* debian/libgnome-desktop-3-2.symbols: Updated

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.pc/.quilt_patches'
2--- .pc/.quilt_patches 1970-01-01 00:00:00 +0000
3+++ .pc/.quilt_patches 2011-09-21 16:13:20 +0000
4@@ -0,0 +1,1 @@
5+debian/patches
6
7=== added file '.pc/.quilt_series'
8--- .pc/.quilt_series 1970-01-01 00:00:00 +0000
9+++ .pc/.quilt_series 2011-09-21 16:13:20 +0000
10@@ -0,0 +1,1 @@
11+series
12
13=== added directory '.pc/99_ltmain_as-needed.patch'
14=== renamed directory '.pc/99_ltmain_as-needed.patch' => '.pc/99_ltmain_as-needed.patch.moved'
15=== added file '.pc/99_ltmain_as-needed.patch/.timestamp'
16=== added file '.pc/99_ltmain_as-needed.patch/ltmain.sh'
17--- .pc/99_ltmain_as-needed.patch/ltmain.sh 1970-01-01 00:00:00 +0000
18+++ .pc/99_ltmain_as-needed.patch/ltmain.sh 2011-09-21 16:13:20 +0000
19@@ -0,0 +1,8406 @@
20+# Generated from ltmain.m4sh.
21+
22+# ltmain.sh (GNU libtool) 2.2.6
23+# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
24+
25+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
26+# This is free software; see the source for copying conditions. There is NO
27+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
28+
29+# GNU Libtool is free software; you can redistribute it and/or modify
30+# it under the terms of the GNU General Public License as published by
31+# the Free Software Foundation; either version 2 of the License, or
32+# (at your option) any later version.
33+#
34+# As a special exception to the GNU General Public License,
35+# if you distribute this file as part of a program or library that
36+# is built using GNU Libtool, you may include this file under the
37+# same distribution terms that you use for the rest of that program.
38+#
39+# GNU Libtool is distributed in the hope that it will be useful, but
40+# WITHOUT ANY WARRANTY; without even the implied warranty of
41+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
42+# General Public License for more details.
43+#
44+# You should have received a copy of the GNU General Public License
45+# along with GNU Libtool; see the file COPYING. If not, a copy
46+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
47+# or obtained by writing to the Free Software Foundation, Inc.,
48+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
49+
50+# Usage: $progname [OPTION]... [MODE-ARG]...
51+#
52+# Provide generalized library-building support services.
53+#
54+# --config show all configuration variables
55+# --debug enable verbose shell tracing
56+# -n, --dry-run display commands without modifying any files
57+# --features display basic configuration information and exit
58+# --mode=MODE use operation mode MODE
59+# --preserve-dup-deps don't remove duplicate dependency libraries
60+# --quiet, --silent don't print informational messages
61+# --tag=TAG use configuration variables from tag TAG
62+# -v, --verbose print informational messages (default)
63+# --version print version information
64+# -h, --help print short or long help message
65+#
66+# MODE must be one of the following:
67+#
68+# clean remove files from the build directory
69+# compile compile a source file into a libtool object
70+# execute automatically set library path, then run a program
71+# finish complete the installation of libtool libraries
72+# install install libraries or executables
73+# link create a library or an executable
74+# uninstall remove libraries from an installed directory
75+#
76+# MODE-ARGS vary depending on the MODE.
77+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
78+#
79+# When reporting a bug, please describe a test case to reproduce it and
80+# include the following information:
81+#
82+# host-triplet: $host
83+# shell: $SHELL
84+# compiler: $LTCC
85+# compiler flags: $LTCFLAGS
86+# linker: $LD (gnu? $with_gnu_ld)
87+# $progname: (GNU libtool) 2.2.6
88+# automake: $automake_version
89+# autoconf: $autoconf_version
90+#
91+# Report bugs to <bug-libtool@gnu.org>.
92+
93+PROGRAM=ltmain.sh
94+PACKAGE=libtool
95+VERSION=2.2.6
96+TIMESTAMP=""
97+package_revision=1.3012
98+
99+# Be Bourne compatible
100+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
101+ emulate sh
102+ NULLCMD=:
103+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
104+ # is contrary to our usage. Disable this feature.
105+ alias -g '${1+"$@"}'='"$@"'
106+ setopt NO_GLOB_SUBST
107+else
108+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
109+fi
110+BIN_SH=xpg4; export BIN_SH # for Tru64
111+DUALCASE=1; export DUALCASE # for MKS sh
112+
113+# NLS nuisances: We save the old values to restore during execute mode.
114+# Only set LANG and LC_ALL to C if already set.
115+# These must not be set unconditionally because not all systems understand
116+# e.g. LANG=C (notably SCO).
117+lt_user_locale=
118+lt_safe_locale=
119+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
120+do
121+ eval "if test \"\${$lt_var+set}\" = set; then
122+ save_$lt_var=\$$lt_var
123+ $lt_var=C
124+ export $lt_var
125+ lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
126+ lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
127+ fi"
128+done
129+
130+$lt_unset CDPATH
131+
132+
133+
134+
135+
136+: ${CP="cp -f"}
137+: ${ECHO="echo"}
138+: ${EGREP="/usr/bin/grep -E"}
139+: ${FGREP="/usr/bin/grep -F"}
140+: ${GREP="/usr/bin/grep"}
141+: ${LN_S="ln -s"}
142+: ${MAKE="make"}
143+: ${MKDIR="mkdir"}
144+: ${MV="mv -f"}
145+: ${RM="rm -f"}
146+: ${SED="/opt/local/bin/gsed"}
147+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
148+: ${Xsed="$SED -e 1s/^X//"}
149+
150+# Global variables:
151+EXIT_SUCCESS=0
152+EXIT_FAILURE=1
153+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
154+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
155+
156+exit_status=$EXIT_SUCCESS
157+
158+# Make sure IFS has a sensible default
159+lt_nl='
160+'
161+IFS=" $lt_nl"
162+
163+dirname="s,/[^/]*$,,"
164+basename="s,^.*/,,"
165+
166+# func_dirname_and_basename file append nondir_replacement
167+# perform func_basename and func_dirname in a single function
168+# call:
169+# dirname: Compute the dirname of FILE. If nonempty,
170+# add APPEND to the result, otherwise set result
171+# to NONDIR_REPLACEMENT.
172+# value returned in "$func_dirname_result"
173+# basename: Compute filename of FILE.
174+# value retuned in "$func_basename_result"
175+# Implementation must be kept synchronized with func_dirname
176+# and func_basename. For efficiency, we do not delegate to
177+# those functions but instead duplicate the functionality here.
178+func_dirname_and_basename ()
179+{
180+ # Extract subdirectory from the argument.
181+ func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
182+ if test "X$func_dirname_result" = "X${1}"; then
183+ func_dirname_result="${3}"
184+ else
185+ func_dirname_result="$func_dirname_result${2}"
186+ fi
187+ func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
188+}
189+
190+# Generated shell functions inserted here.
191+
192+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
193+# is ksh but when the shell is invoked as "sh" and the current value of
194+# the _XPG environment variable is not equal to 1 (one), the special
195+# positional parameter $0, within a function call, is the name of the
196+# function.
197+progpath="$0"
198+
199+# The name of this program:
200+# In the unlikely event $progname began with a '-', it would play havoc with
201+# func_echo (imagine progname=-n), so we prepend ./ in that case:
202+func_dirname_and_basename "$progpath"
203+progname=$func_basename_result
204+case $progname in
205+ -*) progname=./$progname ;;
206+esac
207+
208+# Make sure we have an absolute path for reexecution:
209+case $progpath in
210+ [\\/]*|[A-Za-z]:\\*) ;;
211+ *[\\/]*)
212+ progdir=$func_dirname_result
213+ progdir=`cd "$progdir" && pwd`
214+ progpath="$progdir/$progname"
215+ ;;
216+ *)
217+ save_IFS="$IFS"
218+ IFS=:
219+ for progdir in $PATH; do
220+ IFS="$save_IFS"
221+ test -x "$progdir/$progname" && break
222+ done
223+ IFS="$save_IFS"
224+ test -n "$progdir" || progdir=`pwd`
225+ progpath="$progdir/$progname"
226+ ;;
227+esac
228+
229+# Sed substitution that helps us do robust quoting. It backslashifies
230+# metacharacters that are still active within double-quoted strings.
231+Xsed="${SED}"' -e 1s/^X//'
232+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
233+
234+# Same as above, but do not quote variable references.
235+double_quote_subst='s/\(["`\\]\)/\\\1/g'
236+
237+# Re-`\' parameter expansions in output of double_quote_subst that were
238+# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
239+# in input to double_quote_subst, that '$' was protected from expansion.
240+# Since each input `\' is now two `\'s, look for any number of runs of
241+# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
242+bs='\\'
243+bs2='\\\\'
244+bs4='\\\\\\\\'
245+dollar='\$'
246+sed_double_backslash="\
247+ s/$bs4/&\\
248+/g
249+ s/^$bs2$dollar/$bs&/
250+ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
251+ s/\n//g"
252+
253+# Standard options:
254+opt_dry_run=false
255+opt_help=false
256+opt_quiet=false
257+opt_verbose=false
258+opt_warning=:
259+
260+# func_echo arg...
261+# Echo program name prefixed message, along with the current mode
262+# name if it has been set yet.
263+func_echo ()
264+{
265+ $ECHO "$progname${mode+: }$mode: $*"
266+}
267+
268+# func_verbose arg...
269+# Echo program name prefixed message in verbose mode only.
270+func_verbose ()
271+{
272+ $opt_verbose && func_echo ${1+"$@"}
273+
274+ # A bug in bash halts the script if the last line of a function
275+ # fails when set -e is in force, so we need another command to
276+ # work around that:
277+ :
278+}
279+
280+# func_error arg...
281+# Echo program name prefixed message to standard error.
282+func_error ()
283+{
284+ $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
285+}
286+
287+# func_warning arg...
288+# Echo program name prefixed warning message to standard error.
289+func_warning ()
290+{
291+ $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
292+
293+ # bash bug again:
294+ :
295+}
296+
297+# func_fatal_error arg...
298+# Echo program name prefixed message to standard error, and exit.
299+func_fatal_error ()
300+{
301+ func_error ${1+"$@"}
302+ exit $EXIT_FAILURE
303+}
304+
305+# func_fatal_help arg...
306+# Echo program name prefixed message to standard error, followed by
307+# a help hint, and exit.
308+func_fatal_help ()
309+{
310+ func_error ${1+"$@"}
311+ func_fatal_error "$help"
312+}
313+help="Try \`$progname --help' for more information." ## default
314+
315+
316+# func_grep expression filename
317+# Check whether EXPRESSION matches any line of FILENAME, without output.
318+func_grep ()
319+{
320+ $GREP "$1" "$2" >/dev/null 2>&1
321+}
322+
323+
324+# func_mkdir_p directory-path
325+# Make sure the entire path to DIRECTORY-PATH is available.
326+func_mkdir_p ()
327+{
328+ my_directory_path="$1"
329+ my_dir_list=
330+
331+ if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
332+
333+ # Protect directory names starting with `-'
334+ case $my_directory_path in
335+ -*) my_directory_path="./$my_directory_path" ;;
336+ esac
337+
338+ # While some portion of DIR does not yet exist...
339+ while test ! -d "$my_directory_path"; do
340+ # ...make a list in topmost first order. Use a colon delimited
341+ # list incase some portion of path contains whitespace.
342+ my_dir_list="$my_directory_path:$my_dir_list"
343+
344+ # If the last portion added has no slash in it, the list is done
345+ case $my_directory_path in */*) ;; *) break ;; esac
346+
347+ # ...otherwise throw away the child directory and loop
348+ my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
349+ done
350+ my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
351+
352+ save_mkdir_p_IFS="$IFS"; IFS=':'
353+ for my_dir in $my_dir_list; do
354+ IFS="$save_mkdir_p_IFS"
355+ # mkdir can fail with a `File exist' error if two processes
356+ # try to create one of the directories concurrently. Don't
357+ # stop in that case!
358+ $MKDIR "$my_dir" 2>/dev/null || :
359+ done
360+ IFS="$save_mkdir_p_IFS"
361+
362+ # Bail out if we (or some other process) failed to create a directory.
363+ test -d "$my_directory_path" || \
364+ func_fatal_error "Failed to create \`$1'"
365+ fi
366+}
367+
368+
369+# func_mktempdir [string]
370+# Make a temporary directory that won't clash with other running
371+# libtool processes, and avoids race conditions if possible. If
372+# given, STRING is the basename for that directory.
373+func_mktempdir ()
374+{
375+ my_template="${TMPDIR-/tmp}/${1-$progname}"
376+
377+ if test "$opt_dry_run" = ":"; then
378+ # Return a directory name, but don't create it in dry-run mode
379+ my_tmpdir="${my_template}-$$"
380+ else
381+
382+ # If mktemp works, use that first and foremost
383+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
384+
385+ if test ! -d "$my_tmpdir"; then
386+ # Failing that, at least try and use $RANDOM to avoid a race
387+ my_tmpdir="${my_template}-${RANDOM-0}$$"
388+
389+ save_mktempdir_umask=`umask`
390+ umask 0077
391+ $MKDIR "$my_tmpdir"
392+ umask $save_mktempdir_umask
393+ fi
394+
395+ # If we're not in dry-run mode, bomb out on failure
396+ test -d "$my_tmpdir" || \
397+ func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
398+ fi
399+
400+ $ECHO "X$my_tmpdir" | $Xsed
401+}
402+
403+
404+# func_quote_for_eval arg
405+# Aesthetically quote ARG to be evaled later.
406+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
407+# is double-quoted, suitable for a subsequent eval, whereas
408+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
409+# which are still active within double quotes backslashified.
410+func_quote_for_eval ()
411+{
412+ case $1 in
413+ *[\\\`\"\$]*)
414+ func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
415+ *)
416+ func_quote_for_eval_unquoted_result="$1" ;;
417+ esac
418+
419+ case $func_quote_for_eval_unquoted_result in
420+ # Double-quote args containing shell metacharacters to delay
421+ # word splitting, command substitution and and variable
422+ # expansion for a subsequent eval.
423+ # Many Bourne shells cannot handle close brackets correctly
424+ # in scan sets, so we specify it separately.
425+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
426+ func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
427+ ;;
428+ *)
429+ func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
430+ esac
431+}
432+
433+
434+# func_quote_for_expand arg
435+# Aesthetically quote ARG to be evaled later; same as above,
436+# but do not quote variable references.
437+func_quote_for_expand ()
438+{
439+ case $1 in
440+ *[\\\`\"]*)
441+ my_arg=`$ECHO "X$1" | $Xsed \
442+ -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
443+ *)
444+ my_arg="$1" ;;
445+ esac
446+
447+ case $my_arg in
448+ # Double-quote args containing shell metacharacters to delay
449+ # word splitting and command substitution for a subsequent eval.
450+ # Many Bourne shells cannot handle close brackets correctly
451+ # in scan sets, so we specify it separately.
452+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
453+ my_arg="\"$my_arg\""
454+ ;;
455+ esac
456+
457+ func_quote_for_expand_result="$my_arg"
458+}
459+
460+
461+# func_show_eval cmd [fail_exp]
462+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
463+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
464+# is given, then evaluate it.
465+func_show_eval ()
466+{
467+ my_cmd="$1"
468+ my_fail_exp="${2-:}"
469+
470+ ${opt_silent-false} || {
471+ func_quote_for_expand "$my_cmd"
472+ eval "func_echo $func_quote_for_expand_result"
473+ }
474+
475+ if ${opt_dry_run-false}; then :; else
476+ eval "$my_cmd"
477+ my_status=$?
478+ if test "$my_status" -eq 0; then :; else
479+ eval "(exit $my_status); $my_fail_exp"
480+ fi
481+ fi
482+}
483+
484+
485+# func_show_eval_locale cmd [fail_exp]
486+# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
487+# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
488+# is given, then evaluate it. Use the saved locale for evaluation.
489+func_show_eval_locale ()
490+{
491+ my_cmd="$1"
492+ my_fail_exp="${2-:}"
493+
494+ ${opt_silent-false} || {
495+ func_quote_for_expand "$my_cmd"
496+ eval "func_echo $func_quote_for_expand_result"
497+ }
498+
499+ if ${opt_dry_run-false}; then :; else
500+ eval "$lt_user_locale
501+ $my_cmd"
502+ my_status=$?
503+ eval "$lt_safe_locale"
504+ if test "$my_status" -eq 0; then :; else
505+ eval "(exit $my_status); $my_fail_exp"
506+ fi
507+ fi
508+}
509+
510+
511+
512+
513+
514+# func_version
515+# Echo version message to standard output and exit.
516+func_version ()
517+{
518+ $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
519+ s/^# //
520+ s/^# *$//
521+ s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
522+ p
523+ }' < "$progpath"
524+ exit $?
525+}
526+
527+# func_usage
528+# Echo short help message to standard output and exit.
529+func_usage ()
530+{
531+ $SED -n '/^# Usage:/,/# -h/ {
532+ s/^# //
533+ s/^# *$//
534+ s/\$progname/'$progname'/
535+ p
536+ }' < "$progpath"
537+ $ECHO
538+ $ECHO "run \`$progname --help | more' for full usage"
539+ exit $?
540+}
541+
542+# func_help
543+# Echo long help message to standard output and exit.
544+func_help ()
545+{
546+ $SED -n '/^# Usage:/,/# Report bugs to/ {
547+ s/^# //
548+ s/^# *$//
549+ s*\$progname*'$progname'*
550+ s*\$host*'"$host"'*
551+ s*\$SHELL*'"$SHELL"'*
552+ s*\$LTCC*'"$LTCC"'*
553+ s*\$LTCFLAGS*'"$LTCFLAGS"'*
554+ s*\$LD*'"$LD"'*
555+ s/\$with_gnu_ld/'"$with_gnu_ld"'/
556+ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
557+ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
558+ p
559+ }' < "$progpath"
560+ exit $?
561+}
562+
563+# func_missing_arg argname
564+# Echo program name prefixed message to standard error and set global
565+# exit_cmd.
566+func_missing_arg ()
567+{
568+ func_error "missing argument for $1"
569+ exit_cmd=exit
570+}
571+
572+exit_cmd=:
573+
574+
575+
576+
577+
578+# Check that we have a working $ECHO.
579+if test "X$1" = X--no-reexec; then
580+ # Discard the --no-reexec flag, and continue.
581+ shift
582+elif test "X$1" = X--fallback-echo; then
583+ # Avoid inline document here, it may be left over
584+ :
585+elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
586+ # Yippee, $ECHO works!
587+ :
588+else
589+ # Restart under the correct shell, and then maybe $ECHO will work.
590+ exec $SHELL "$progpath" --no-reexec ${1+"$@"}
591+fi
592+
593+if test "X$1" = X--fallback-echo; then
594+ # used as fallback echo
595+ shift
596+ cat <<EOF
597+$*
598+EOF
599+ exit $EXIT_SUCCESS
600+fi
601+
602+magic="%%%MAGIC variable%%%"
603+magic_exe="%%%MAGIC EXE variable%%%"
604+
605+# Global variables.
606+# $mode is unset
607+nonopt=
608+execute_dlfiles=
609+preserve_args=
610+lo2o="s/\\.lo\$/.${objext}/"
611+o2lo="s/\\.${objext}\$/.lo/"
612+extracted_archives=
613+extracted_serial=0
614+
615+opt_dry_run=false
616+opt_duplicate_deps=false
617+opt_silent=false
618+opt_debug=:
619+
620+# If this variable is set in any of the actions, the command in it
621+# will be execed at the end. This prevents here-documents from being
622+# left over by shells.
623+exec_cmd=
624+
625+# func_fatal_configuration arg...
626+# Echo program name prefixed message to standard error, followed by
627+# a configuration failure hint, and exit.
628+func_fatal_configuration ()
629+{
630+ func_error ${1+"$@"}
631+ func_error "See the $PACKAGE documentation for more information."
632+ func_fatal_error "Fatal configuration error."
633+}
634+
635+
636+# func_config
637+# Display the configuration for all the tags in this script.
638+func_config ()
639+{
640+ re_begincf='^# ### BEGIN LIBTOOL'
641+ re_endcf='^# ### END LIBTOOL'
642+
643+ # Default configuration.
644+ $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
645+
646+ # Now print the configurations for the tags.
647+ for tagname in $taglist; do
648+ $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
649+ done
650+
651+ exit $?
652+}
653+
654+# func_features
655+# Display the features supported by this script.
656+func_features ()
657+{
658+ $ECHO "host: $host"
659+ if test "$build_libtool_libs" = yes; then
660+ $ECHO "enable shared libraries"
661+ else
662+ $ECHO "disable shared libraries"
663+ fi
664+ if test "$build_old_libs" = yes; then
665+ $ECHO "enable static libraries"
666+ else
667+ $ECHO "disable static libraries"
668+ fi
669+
670+ exit $?
671+}
672+
673+# func_enable_tag tagname
674+# Verify that TAGNAME is valid, and either flag an error and exit, or
675+# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
676+# variable here.
677+func_enable_tag ()
678+{
679+ # Global variable:
680+ tagname="$1"
681+
682+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
683+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
684+ sed_extractcf="/$re_begincf/,/$re_endcf/p"
685+
686+ # Validate tagname.
687+ case $tagname in
688+ *[!-_A-Za-z0-9,/]*)
689+ func_fatal_error "invalid tag name: $tagname"
690+ ;;
691+ esac
692+
693+ # Don't test for the "default" C tag, as we know it's
694+ # there but not specially marked.
695+ case $tagname in
696+ CC) ;;
697+ *)
698+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
699+ taglist="$taglist $tagname"
700+
701+ # Evaluate the configuration. Be careful to quote the path
702+ # and the sed script, to avoid splitting on whitespace, but
703+ # also don't use non-portable quotes within backquotes within
704+ # quotes we have to do it in 2 steps:
705+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
706+ eval "$extractedcf"
707+ else
708+ func_error "ignoring unknown tag $tagname"
709+ fi
710+ ;;
711+ esac
712+}
713+
714+# Parse options once, thoroughly. This comes as soon as possible in
715+# the script to make things like `libtool --version' happen quickly.
716+{
717+
718+ # Shorthand for --mode=foo, only valid as the first argument
719+ case $1 in
720+ clean|clea|cle|cl)
721+ shift; set dummy --mode clean ${1+"$@"}; shift
722+ ;;
723+ compile|compil|compi|comp|com|co|c)
724+ shift; set dummy --mode compile ${1+"$@"}; shift
725+ ;;
726+ execute|execut|execu|exec|exe|ex|e)
727+ shift; set dummy --mode execute ${1+"$@"}; shift
728+ ;;
729+ finish|finis|fini|fin|fi|f)
730+ shift; set dummy --mode finish ${1+"$@"}; shift
731+ ;;
732+ install|instal|insta|inst|ins|in|i)
733+ shift; set dummy --mode install ${1+"$@"}; shift
734+ ;;
735+ link|lin|li|l)
736+ shift; set dummy --mode link ${1+"$@"}; shift
737+ ;;
738+ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
739+ shift; set dummy --mode uninstall ${1+"$@"}; shift
740+ ;;
741+ esac
742+
743+ # Parse non-mode specific arguments:
744+ while test "$#" -gt 0; do
745+ opt="$1"
746+ shift
747+
748+ case $opt in
749+ --config) func_config ;;
750+
751+ --debug) preserve_args="$preserve_args $opt"
752+ func_echo "enabling shell trace mode"
753+ opt_debug='set -x'
754+ $opt_debug
755+ ;;
756+
757+ -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
758+ execute_dlfiles="$execute_dlfiles $1"
759+ shift
760+ ;;
761+
762+ --dry-run | -n) opt_dry_run=: ;;
763+ --features) func_features ;;
764+ --finish) mode="finish" ;;
765+
766+ --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
767+ case $1 in
768+ # Valid mode arguments:
769+ clean) ;;
770+ compile) ;;
771+ execute) ;;
772+ finish) ;;
773+ install) ;;
774+ link) ;;
775+ relink) ;;
776+ uninstall) ;;
777+
778+ # Catch anything else as an error
779+ *) func_error "invalid argument for $opt"
780+ exit_cmd=exit
781+ break
782+ ;;
783+ esac
784+
785+ mode="$1"
786+ shift
787+ ;;
788+
789+ --preserve-dup-deps)
790+ opt_duplicate_deps=: ;;
791+
792+ --quiet|--silent) preserve_args="$preserve_args $opt"
793+ opt_silent=:
794+ ;;
795+
796+ --verbose| -v) preserve_args="$preserve_args $opt"
797+ opt_silent=false
798+ ;;
799+
800+ --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
801+ preserve_args="$preserve_args $opt $1"
802+ func_enable_tag "$1" # tagname is set here
803+ shift
804+ ;;
805+
806+ # Separate optargs to long options:
807+ -dlopen=*|--mode=*|--tag=*)
808+ func_opt_split "$opt"
809+ set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
810+ shift
811+ ;;
812+
813+ -\?|-h) func_usage ;;
814+ --help) opt_help=: ;;
815+ --version) func_version ;;
816+
817+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
818+
819+ *) nonopt="$opt"
820+ break
821+ ;;
822+ esac
823+ done
824+
825+
826+ case $host in
827+ *cygwin* | *mingw* | *pw32* | *cegcc*)
828+ # don't eliminate duplications in $postdeps and $predeps
829+ opt_duplicate_compiler_generated_deps=:
830+ ;;
831+ *)
832+ opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
833+ ;;
834+ esac
835+
836+ # Having warned about all mis-specified options, bail out if
837+ # anything was wrong.
838+ $exit_cmd $EXIT_FAILURE
839+}
840+
841+# func_check_version_match
842+# Ensure that we are using m4 macros, and libtool script from the same
843+# release of libtool.
844+func_check_version_match ()
845+{
846+ if test "$package_revision" != "$macro_revision"; then
847+ if test "$VERSION" != "$macro_version"; then
848+ if test -z "$macro_version"; then
849+ cat >&2 <<_LT_EOF
850+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
851+$progname: definition of this LT_INIT comes from an older release.
852+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
853+$progname: and run autoconf again.
854+_LT_EOF
855+ else
856+ cat >&2 <<_LT_EOF
857+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
858+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
859+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
860+$progname: and run autoconf again.
861+_LT_EOF
862+ fi
863+ else
864+ cat >&2 <<_LT_EOF
865+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
866+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
867+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
868+$progname: of $PACKAGE $VERSION and run autoconf again.
869+_LT_EOF
870+ fi
871+
872+ exit $EXIT_MISMATCH
873+ fi
874+}
875+
876+
877+## ----------- ##
878+## Main. ##
879+## ----------- ##
880+
881+$opt_help || {
882+ # Sanity checks first:
883+ func_check_version_match
884+
885+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
886+ func_fatal_configuration "not configured to build any kind of library"
887+ fi
888+
889+ test -z "$mode" && func_fatal_error "error: you must specify a MODE."
890+
891+
892+ # Darwin sucks
893+ eval std_shrext=\"$shrext_cmds\"
894+
895+
896+ # Only execute mode is allowed to have -dlopen flags.
897+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
898+ func_error "unrecognized option \`-dlopen'"
899+ $ECHO "$help" 1>&2
900+ exit $EXIT_FAILURE
901+ fi
902+
903+ # Change the help message to a mode-specific one.
904+ generic_help="$help"
905+ help="Try \`$progname --help --mode=$mode' for more information."
906+}
907+
908+
909+# func_lalib_p file
910+# True iff FILE is a libtool `.la' library or `.lo' object file.
911+# This function is only a basic sanity check; it will hardly flush out
912+# determined imposters.
913+func_lalib_p ()
914+{
915+ test -f "$1" &&
916+ $SED -e 4q "$1" 2>/dev/null \
917+ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
918+}
919+
920+# func_lalib_unsafe_p file
921+# True iff FILE is a libtool `.la' library or `.lo' object file.
922+# This function implements the same check as func_lalib_p without
923+# resorting to external programs. To this end, it redirects stdin and
924+# closes it afterwards, without saving the original file descriptor.
925+# As a safety measure, use it only where a negative result would be
926+# fatal anyway. Works if `file' does not exist.
927+func_lalib_unsafe_p ()
928+{
929+ lalib_p=no
930+ if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
931+ for lalib_p_l in 1 2 3 4
932+ do
933+ read lalib_p_line
934+ case "$lalib_p_line" in
935+ \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
936+ esac
937+ done
938+ exec 0<&5 5<&-
939+ fi
940+ test "$lalib_p" = yes
941+}
942+
943+# func_ltwrapper_script_p file
944+# True iff FILE is a libtool wrapper script
945+# This function is only a basic sanity check; it will hardly flush out
946+# determined imposters.
947+func_ltwrapper_script_p ()
948+{
949+ func_lalib_p "$1"
950+}
951+
952+# func_ltwrapper_executable_p file
953+# True iff FILE is a libtool wrapper executable
954+# This function is only a basic sanity check; it will hardly flush out
955+# determined imposters.
956+func_ltwrapper_executable_p ()
957+{
958+ func_ltwrapper_exec_suffix=
959+ case $1 in
960+ *.exe) ;;
961+ *) func_ltwrapper_exec_suffix=.exe ;;
962+ esac
963+ $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
964+}
965+
966+# func_ltwrapper_scriptname file
967+# Assumes file is an ltwrapper_executable
968+# uses $file to determine the appropriate filename for a
969+# temporary ltwrapper_script.
970+func_ltwrapper_scriptname ()
971+{
972+ func_ltwrapper_scriptname_result=""
973+ if func_ltwrapper_executable_p "$1"; then
974+ func_dirname_and_basename "$1" "" "."
975+ func_stripname '' '.exe' "$func_basename_result"
976+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
977+ fi
978+}
979+
980+# func_ltwrapper_p file
981+# True iff FILE is a libtool wrapper script or wrapper executable
982+# This function is only a basic sanity check; it will hardly flush out
983+# determined imposters.
984+func_ltwrapper_p ()
985+{
986+ func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
987+}
988+
989+
990+# func_execute_cmds commands fail_cmd
991+# Execute tilde-delimited COMMANDS.
992+# If FAIL_CMD is given, eval that upon failure.
993+# FAIL_CMD may read-access the current command in variable CMD!
994+func_execute_cmds ()
995+{
996+ $opt_debug
997+ save_ifs=$IFS; IFS='~'
998+ for cmd in $1; do
999+ IFS=$save_ifs
1000+ eval cmd=\"$cmd\"
1001+ func_show_eval "$cmd" "${2-:}"
1002+ done
1003+ IFS=$save_ifs
1004+}
1005+
1006+
1007+# func_source file
1008+# Source FILE, adding directory component if necessary.
1009+# Note that it is not necessary on cygwin/mingw to append a dot to
1010+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1011+# behavior happens only for exec(3), not for open(2)! Also, sourcing
1012+# `FILE.' does not work on cygwin managed mounts.
1013+func_source ()
1014+{
1015+ $opt_debug
1016+ case $1 in
1017+ */* | *\\*) . "$1" ;;
1018+ *) . "./$1" ;;
1019+ esac
1020+}
1021+
1022+
1023+# func_infer_tag arg
1024+# Infer tagged configuration to use if any are available and
1025+# if one wasn't chosen via the "--tag" command line option.
1026+# Only attempt this if the compiler in the base compile
1027+# command doesn't match the default compiler.
1028+# arg is usually of the form 'gcc ...'
1029+func_infer_tag ()
1030+{
1031+ $opt_debug
1032+ if test -n "$available_tags" && test -z "$tagname"; then
1033+ CC_quoted=
1034+ for arg in $CC; do
1035+ func_quote_for_eval "$arg"
1036+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
1037+ done
1038+ case $@ in
1039+ # Blanks in the command may have been stripped by the calling shell,
1040+ # but not from the CC environment variable when configure was run.
1041+ " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
1042+ # Blanks at the start of $base_compile will cause this to fail
1043+ # if we don't check for them as well.
1044+ *)
1045+ for z in $available_tags; do
1046+ if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1047+ # Evaluate the configuration.
1048+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1049+ CC_quoted=
1050+ for arg in $CC; do
1051+ # Double-quote args containing other shell metacharacters.
1052+ func_quote_for_eval "$arg"
1053+ CC_quoted="$CC_quoted $func_quote_for_eval_result"
1054+ done
1055+ case "$@ " in
1056+ " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
1057+ # The compiler in the base compile command matches
1058+ # the one in the tagged configuration.
1059+ # Assume this is the tagged configuration we want.
1060+ tagname=$z
1061+ break
1062+ ;;
1063+ esac
1064+ fi
1065+ done
1066+ # If $tagname still isn't set, then no tagged configuration
1067+ # was found and let the user know that the "--tag" command
1068+ # line option must be used.
1069+ if test -z "$tagname"; then
1070+ func_echo "unable to infer tagged configuration"
1071+ func_fatal_error "specify a tag with \`--tag'"
1072+# else
1073+# func_verbose "using $tagname tagged configuration"
1074+ fi
1075+ ;;
1076+ esac
1077+ fi
1078+}
1079+
1080+
1081+
1082+# func_write_libtool_object output_name pic_name nonpic_name
1083+# Create a libtool object file (analogous to a ".la" file),
1084+# but don't create it if we're doing a dry run.
1085+func_write_libtool_object ()
1086+{
1087+ write_libobj=${1}
1088+ if test "$build_libtool_libs" = yes; then
1089+ write_lobj=\'${2}\'
1090+ else
1091+ write_lobj=none
1092+ fi
1093+
1094+ if test "$build_old_libs" = yes; then
1095+ write_oldobj=\'${3}\'
1096+ else
1097+ write_oldobj=none
1098+ fi
1099+
1100+ $opt_dry_run || {
1101+ cat >${write_libobj}T <<EOF
1102+# $write_libobj - a libtool object file
1103+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1104+#
1105+# Please DO NOT delete this file!
1106+# It is necessary for linking the library.
1107+
1108+# Name of the PIC object.
1109+pic_object=$write_lobj
1110+
1111+# Name of the non-PIC object
1112+non_pic_object=$write_oldobj
1113+
1114+EOF
1115+ $MV "${write_libobj}T" "${write_libobj}"
1116+ }
1117+}
1118+
1119+# func_mode_compile arg...
1120+func_mode_compile ()
1121+{
1122+ $opt_debug
1123+ # Get the compilation command and the source file.
1124+ base_compile=
1125+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
1126+ suppress_opt=yes
1127+ suppress_output=
1128+ arg_mode=normal
1129+ libobj=
1130+ later=
1131+ pie_flag=
1132+
1133+ for arg
1134+ do
1135+ case $arg_mode in
1136+ arg )
1137+ # do not "continue". Instead, add this to base_compile
1138+ lastarg="$arg"
1139+ arg_mode=normal
1140+ ;;
1141+
1142+ target )
1143+ libobj="$arg"
1144+ arg_mode=normal
1145+ continue
1146+ ;;
1147+
1148+ normal )
1149+ # Accept any command-line options.
1150+ case $arg in
1151+ -o)
1152+ test -n "$libobj" && \
1153+ func_fatal_error "you cannot specify \`-o' more than once"
1154+ arg_mode=target
1155+ continue
1156+ ;;
1157+
1158+ -pie | -fpie | -fPIE)
1159+ pie_flag="$pie_flag $arg"
1160+ continue
1161+ ;;
1162+
1163+ -shared | -static | -prefer-pic | -prefer-non-pic)
1164+ later="$later $arg"
1165+ continue
1166+ ;;
1167+
1168+ -no-suppress)
1169+ suppress_opt=no
1170+ continue
1171+ ;;
1172+
1173+ -Xcompiler)
1174+ arg_mode=arg # the next one goes into the "base_compile" arg list
1175+ continue # The current "srcfile" will either be retained or
1176+ ;; # replaced later. I would guess that would be a bug.
1177+
1178+ -Wc,*)
1179+ func_stripname '-Wc,' '' "$arg"
1180+ args=$func_stripname_result
1181+ lastarg=
1182+ save_ifs="$IFS"; IFS=','
1183+ for arg in $args; do
1184+ IFS="$save_ifs"
1185+ func_quote_for_eval "$arg"
1186+ lastarg="$lastarg $func_quote_for_eval_result"
1187+ done
1188+ IFS="$save_ifs"
1189+ func_stripname ' ' '' "$lastarg"
1190+ lastarg=$func_stripname_result
1191+
1192+ # Add the arguments to base_compile.
1193+ base_compile="$base_compile $lastarg"
1194+ continue
1195+ ;;
1196+
1197+ *)
1198+ # Accept the current argument as the source file.
1199+ # The previous "srcfile" becomes the current argument.
1200+ #
1201+ lastarg="$srcfile"
1202+ srcfile="$arg"
1203+ ;;
1204+ esac # case $arg
1205+ ;;
1206+ esac # case $arg_mode
1207+
1208+ # Aesthetically quote the previous argument.
1209+ func_quote_for_eval "$lastarg"
1210+ base_compile="$base_compile $func_quote_for_eval_result"
1211+ done # for arg
1212+
1213+ case $arg_mode in
1214+ arg)
1215+ func_fatal_error "you must specify an argument for -Xcompile"
1216+ ;;
1217+ target)
1218+ func_fatal_error "you must specify a target with \`-o'"
1219+ ;;
1220+ *)
1221+ # Get the name of the library object.
1222+ test -z "$libobj" && {
1223+ func_basename "$srcfile"
1224+ libobj="$func_basename_result"
1225+ }
1226+ ;;
1227+ esac
1228+
1229+ # Recognize several different file suffixes.
1230+ # If the user specifies -o file.o, it is replaced with file.lo
1231+ case $libobj in
1232+ *.[cCFSifmso] | \
1233+ *.ada | *.adb | *.ads | *.asm | \
1234+ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
1235+ *.[fF][09]? | *.for | *.java | *.obj | *.sx)
1236+ func_xform "$libobj"
1237+ libobj=$func_xform_result
1238+ ;;
1239+ esac
1240+
1241+ case $libobj in
1242+ *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
1243+ *)
1244+ func_fatal_error "cannot determine name of library object from \`$libobj'"
1245+ ;;
1246+ esac
1247+
1248+ func_infer_tag $base_compile
1249+
1250+ for arg in $later; do
1251+ case $arg in
1252+ -shared)
1253+ test "$build_libtool_libs" != yes && \
1254+ func_fatal_configuration "can not build a shared library"
1255+ build_old_libs=no
1256+ continue
1257+ ;;
1258+
1259+ -static)
1260+ build_libtool_libs=no
1261+ build_old_libs=yes
1262+ continue
1263+ ;;
1264+
1265+ -prefer-pic)
1266+ pic_mode=yes
1267+ continue
1268+ ;;
1269+
1270+ -prefer-non-pic)
1271+ pic_mode=no
1272+ continue
1273+ ;;
1274+ esac
1275+ done
1276+
1277+ func_quote_for_eval "$libobj"
1278+ test "X$libobj" != "X$func_quote_for_eval_result" \
1279+ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
1280+ && func_warning "libobj name \`$libobj' may not contain shell special characters."
1281+ func_dirname_and_basename "$obj" "/" ""
1282+ objname="$func_basename_result"
1283+ xdir="$func_dirname_result"
1284+ lobj=${xdir}$objdir/$objname
1285+
1286+ test -z "$base_compile" && \
1287+ func_fatal_help "you must specify a compilation command"
1288+
1289+ # Delete any leftover library objects.
1290+ if test "$build_old_libs" = yes; then
1291+ removelist="$obj $lobj $libobj ${libobj}T"
1292+ else
1293+ removelist="$lobj $libobj ${libobj}T"
1294+ fi
1295+
1296+ # On Cygwin there's no "real" PIC flag so we must build both object types
1297+ case $host_os in
1298+ cygwin* | mingw* | pw32* | os2* | cegcc*)
1299+ pic_mode=default
1300+ ;;
1301+ esac
1302+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
1303+ # non-PIC code in shared libraries is not supported
1304+ pic_mode=default
1305+ fi
1306+
1307+ # Calculate the filename of the output object if compiler does
1308+ # not support -o with -c
1309+ if test "$compiler_c_o" = no; then
1310+ output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
1311+ lockfile="$output_obj.lock"
1312+ else
1313+ output_obj=
1314+ need_locks=no
1315+ lockfile=
1316+ fi
1317+
1318+ # Lock this critical section if it is needed
1319+ # We use this script file to make the link, it avoids creating a new file
1320+ if test "$need_locks" = yes; then
1321+ until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
1322+ func_echo "Waiting for $lockfile to be removed"
1323+ sleep 2
1324+ done
1325+ elif test "$need_locks" = warn; then
1326+ if test -f "$lockfile"; then
1327+ $ECHO "\
1328+*** ERROR, $lockfile exists and contains:
1329+`cat $lockfile 2>/dev/null`
1330+
1331+This indicates that another process is trying to use the same
1332+temporary object file, and libtool could not work around it because
1333+your compiler does not support \`-c' and \`-o' together. If you
1334+repeat this compilation, it may succeed, by chance, but you had better
1335+avoid parallel builds (make -j) in this platform, or get a better
1336+compiler."
1337+
1338+ $opt_dry_run || $RM $removelist
1339+ exit $EXIT_FAILURE
1340+ fi
1341+ removelist="$removelist $output_obj"
1342+ $ECHO "$srcfile" > "$lockfile"
1343+ fi
1344+
1345+ $opt_dry_run || $RM $removelist
1346+ removelist="$removelist $lockfile"
1347+ trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
1348+
1349+ if test -n "$fix_srcfile_path"; then
1350+ eval srcfile=\"$fix_srcfile_path\"
1351+ fi
1352+ func_quote_for_eval "$srcfile"
1353+ qsrcfile=$func_quote_for_eval_result
1354+
1355+ # Only build a PIC object if we are building libtool libraries.
1356+ if test "$build_libtool_libs" = yes; then
1357+ # Without this assignment, base_compile gets emptied.
1358+ fbsd_hideous_sh_bug=$base_compile
1359+
1360+ if test "$pic_mode" != no; then
1361+ command="$base_compile $qsrcfile $pic_flag"
1362+ else
1363+ # Don't build PIC code
1364+ command="$base_compile $qsrcfile"
1365+ fi
1366+
1367+ func_mkdir_p "$xdir$objdir"
1368+
1369+ if test -z "$output_obj"; then
1370+ # Place PIC objects in $objdir
1371+ command="$command -o $lobj"
1372+ fi
1373+
1374+ func_show_eval_locale "$command" \
1375+ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
1376+
1377+ if test "$need_locks" = warn &&
1378+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1379+ $ECHO "\
1380+*** ERROR, $lockfile contains:
1381+`cat $lockfile 2>/dev/null`
1382+
1383+but it should contain:
1384+$srcfile
1385+
1386+This indicates that another process is trying to use the same
1387+temporary object file, and libtool could not work around it because
1388+your compiler does not support \`-c' and \`-o' together. If you
1389+repeat this compilation, it may succeed, by chance, but you had better
1390+avoid parallel builds (make -j) in this platform, or get a better
1391+compiler."
1392+
1393+ $opt_dry_run || $RM $removelist
1394+ exit $EXIT_FAILURE
1395+ fi
1396+
1397+ # Just move the object if needed, then go on to compile the next one
1398+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
1399+ func_show_eval '$MV "$output_obj" "$lobj"' \
1400+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1401+ fi
1402+
1403+ # Allow error messages only from the first compilation.
1404+ if test "$suppress_opt" = yes; then
1405+ suppress_output=' >/dev/null 2>&1'
1406+ fi
1407+ fi
1408+
1409+ # Only build a position-dependent object if we build old libraries.
1410+ if test "$build_old_libs" = yes; then
1411+ if test "$pic_mode" != yes; then
1412+ # Don't build PIC code
1413+ command="$base_compile $qsrcfile$pie_flag"
1414+ else
1415+ command="$base_compile $qsrcfile $pic_flag"
1416+ fi
1417+ if test "$compiler_c_o" = yes; then
1418+ command="$command -o $obj"
1419+ fi
1420+
1421+ # Suppress compiler output if we already did a PIC compilation.
1422+ command="$command$suppress_output"
1423+ func_show_eval_locale "$command" \
1424+ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
1425+
1426+ if test "$need_locks" = warn &&
1427+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
1428+ $ECHO "\
1429+*** ERROR, $lockfile contains:
1430+`cat $lockfile 2>/dev/null`
1431+
1432+but it should contain:
1433+$srcfile
1434+
1435+This indicates that another process is trying to use the same
1436+temporary object file, and libtool could not work around it because
1437+your compiler does not support \`-c' and \`-o' together. If you
1438+repeat this compilation, it may succeed, by chance, but you had better
1439+avoid parallel builds (make -j) in this platform, or get a better
1440+compiler."
1441+
1442+ $opt_dry_run || $RM $removelist
1443+ exit $EXIT_FAILURE
1444+ fi
1445+
1446+ # Just move the object if needed
1447+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
1448+ func_show_eval '$MV "$output_obj" "$obj"' \
1449+ 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
1450+ fi
1451+ fi
1452+
1453+ $opt_dry_run || {
1454+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
1455+
1456+ # Unlock the critical section if it was locked
1457+ if test "$need_locks" != no; then
1458+ removelist=$lockfile
1459+ $RM "$lockfile"
1460+ fi
1461+ }
1462+
1463+ exit $EXIT_SUCCESS
1464+}
1465+
1466+$opt_help || {
1467+test "$mode" = compile && func_mode_compile ${1+"$@"}
1468+}
1469+
1470+func_mode_help ()
1471+{
1472+ # We need to display help for each of the modes.
1473+ case $mode in
1474+ "")
1475+ # Generic help is extracted from the usage comments
1476+ # at the start of this file.
1477+ func_help
1478+ ;;
1479+
1480+ clean)
1481+ $ECHO \
1482+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
1483+
1484+Remove files from the build directory.
1485+
1486+RM is the name of the program to use to delete files associated with each FILE
1487+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1488+to RM.
1489+
1490+If FILE is a libtool library, object or program, all the files associated
1491+with it are deleted. Otherwise, only FILE itself is deleted using RM."
1492+ ;;
1493+
1494+ compile)
1495+ $ECHO \
1496+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
1497+
1498+Compile a source file into a libtool library object.
1499+
1500+This mode accepts the following additional options:
1501+
1502+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
1503+ -no-suppress do not suppress compiler output for multiple passes
1504+ -prefer-pic try to building PIC objects only
1505+ -prefer-non-pic try to building non-PIC objects only
1506+ -shared do not build a \`.o' file suitable for static linking
1507+ -static only build a \`.o' file suitable for static linking
1508+
1509+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
1510+from the given SOURCEFILE.
1511+
1512+The output file name is determined by removing the directory component from
1513+SOURCEFILE, then substituting the C source code suffix \`.c' with the
1514+library object suffix, \`.lo'."
1515+ ;;
1516+
1517+ execute)
1518+ $ECHO \
1519+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
1520+
1521+Automatically set library path, then run a program.
1522+
1523+This mode accepts the following additional options:
1524+
1525+ -dlopen FILE add the directory containing FILE to the library path
1526+
1527+This mode sets the library path environment variable according to \`-dlopen'
1528+flags.
1529+
1530+If any of the ARGS are libtool executable wrappers, then they are translated
1531+into their corresponding uninstalled binary, and any of their required library
1532+directories are added to the library path.
1533+
1534+Then, COMMAND is executed, with ARGS as arguments."
1535+ ;;
1536+
1537+ finish)
1538+ $ECHO \
1539+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
1540+
1541+Complete the installation of libtool libraries.
1542+
1543+Each LIBDIR is a directory that contains libtool libraries.
1544+
1545+The commands that this mode executes may require superuser privileges. Use
1546+the \`--dry-run' option if you just want to see what would be executed."
1547+ ;;
1548+
1549+ install)
1550+ $ECHO \
1551+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
1552+
1553+Install executables or libraries.
1554+
1555+INSTALL-COMMAND is the installation command. The first component should be
1556+either the \`install' or \`cp' program.
1557+
1558+The following components of INSTALL-COMMAND are treated specially:
1559+
1560+ -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
1561+
1562+The rest of the components are interpreted as arguments to that command (only
1563+BSD-compatible install options are recognized)."
1564+ ;;
1565+
1566+ link)
1567+ $ECHO \
1568+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
1569+
1570+Link object files or libraries together to form another library, or to
1571+create an executable program.
1572+
1573+LINK-COMMAND is a command using the C compiler that you would use to create
1574+a program from several object files.
1575+
1576+The following components of LINK-COMMAND are treated specially:
1577+
1578+ -all-static do not do any dynamic linking at all
1579+ -avoid-version do not add a version suffix if possible
1580+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
1581+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
1582+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
1583+ -export-symbols SYMFILE
1584+ try to export only the symbols listed in SYMFILE
1585+ -export-symbols-regex REGEX
1586+ try to export only the symbols matching REGEX
1587+ -LLIBDIR search LIBDIR for required installed libraries
1588+ -lNAME OUTPUT-FILE requires the installed library libNAME
1589+ -module build a library that can dlopened
1590+ -no-fast-install disable the fast-install mode
1591+ -no-install link a not-installable executable
1592+ -no-undefined declare that a library does not refer to external symbols
1593+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
1594+ -objectlist FILE Use a list of object files found in FILE to specify objects
1595+ -precious-files-regex REGEX
1596+ don't remove output files matching REGEX
1597+ -release RELEASE specify package release information
1598+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
1599+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
1600+ -shared only do dynamic linking of libtool libraries
1601+ -shrext SUFFIX override the standard shared library file extension
1602+ -static do not do any dynamic linking of uninstalled libtool libraries
1603+ -static-libtool-libs
1604+ do not do any dynamic linking of libtool libraries
1605+ -version-info CURRENT[:REVISION[:AGE]]
1606+ specify library version info [each variable defaults to 0]
1607+ -weak LIBNAME declare that the target provides the LIBNAME interface
1608+
1609+All other options (arguments beginning with \`-') are ignored.
1610+
1611+Every other argument is treated as a filename. Files ending in \`.la' are
1612+treated as uninstalled libtool libraries, other files are standard or library
1613+object files.
1614+
1615+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
1616+only library objects (\`.lo' files) may be specified, and \`-rpath' is
1617+required, except when creating a convenience library.
1618+
1619+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
1620+using \`ar' and \`ranlib', or on Windows using \`lib'.
1621+
1622+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
1623+is created, otherwise an executable program is created."
1624+ ;;
1625+
1626+ uninstall)
1627+ $ECHO \
1628+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
1629+
1630+Remove libraries from an installation directory.
1631+
1632+RM is the name of the program to use to delete files associated with each FILE
1633+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
1634+to RM.
1635+
1636+If FILE is a libtool library, all the files associated with it are deleted.
1637+Otherwise, only FILE itself is deleted using RM."
1638+ ;;
1639+
1640+ *)
1641+ func_fatal_help "invalid operation mode \`$mode'"
1642+ ;;
1643+ esac
1644+
1645+ $ECHO
1646+ $ECHO "Try \`$progname --help' for more information about other modes."
1647+
1648+ exit $?
1649+}
1650+
1651+ # Now that we've collected a possible --mode arg, show help if necessary
1652+ $opt_help && func_mode_help
1653+
1654+
1655+# func_mode_execute arg...
1656+func_mode_execute ()
1657+{
1658+ $opt_debug
1659+ # The first argument is the command name.
1660+ cmd="$nonopt"
1661+ test -z "$cmd" && \
1662+ func_fatal_help "you must specify a COMMAND"
1663+
1664+ # Handle -dlopen flags immediately.
1665+ for file in $execute_dlfiles; do
1666+ test -f "$file" \
1667+ || func_fatal_help "\`$file' is not a file"
1668+
1669+ dir=
1670+ case $file in
1671+ *.la)
1672+ # Check to see that this really is a libtool archive.
1673+ func_lalib_unsafe_p "$file" \
1674+ || func_fatal_help "\`$lib' is not a valid libtool archive"
1675+
1676+ # Read the libtool library.
1677+ dlname=
1678+ library_names=
1679+ func_source "$file"
1680+
1681+ # Skip this library if it cannot be dlopened.
1682+ if test -z "$dlname"; then
1683+ # Warn if it was a shared library.
1684+ test -n "$library_names" && \
1685+ func_warning "\`$file' was not linked with \`-export-dynamic'"
1686+ continue
1687+ fi
1688+
1689+ func_dirname "$file" "" "."
1690+ dir="$func_dirname_result"
1691+
1692+ if test -f "$dir/$objdir/$dlname"; then
1693+ dir="$dir/$objdir"
1694+ else
1695+ if test ! -f "$dir/$dlname"; then
1696+ func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
1697+ fi
1698+ fi
1699+ ;;
1700+
1701+ *.lo)
1702+ # Just add the directory containing the .lo file.
1703+ func_dirname "$file" "" "."
1704+ dir="$func_dirname_result"
1705+ ;;
1706+
1707+ *)
1708+ func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
1709+ continue
1710+ ;;
1711+ esac
1712+
1713+ # Get the absolute pathname.
1714+ absdir=`cd "$dir" && pwd`
1715+ test -n "$absdir" && dir="$absdir"
1716+
1717+ # Now add the directory to shlibpath_var.
1718+ if eval "test -z \"\$$shlibpath_var\""; then
1719+ eval "$shlibpath_var=\"\$dir\""
1720+ else
1721+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
1722+ fi
1723+ done
1724+
1725+ # This variable tells wrapper scripts just to set shlibpath_var
1726+ # rather than running their programs.
1727+ libtool_execute_magic="$magic"
1728+
1729+ # Check if any of the arguments is a wrapper script.
1730+ args=
1731+ for file
1732+ do
1733+ case $file in
1734+ -*) ;;
1735+ *)
1736+ # Do a test to see if this is really a libtool program.
1737+ if func_ltwrapper_script_p "$file"; then
1738+ func_source "$file"
1739+ # Transform arg to wrapped name.
1740+ file="$progdir/$program"
1741+ elif func_ltwrapper_executable_p "$file"; then
1742+ func_ltwrapper_scriptname "$file"
1743+ func_source "$func_ltwrapper_scriptname_result"
1744+ # Transform arg to wrapped name.
1745+ file="$progdir/$program"
1746+ fi
1747+ ;;
1748+ esac
1749+ # Quote arguments (to preserve shell metacharacters).
1750+ func_quote_for_eval "$file"
1751+ args="$args $func_quote_for_eval_result"
1752+ done
1753+
1754+ if test "X$opt_dry_run" = Xfalse; then
1755+ if test -n "$shlibpath_var"; then
1756+ # Export the shlibpath_var.
1757+ eval "export $shlibpath_var"
1758+ fi
1759+
1760+ # Restore saved environment variables
1761+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
1762+ do
1763+ eval "if test \"\${save_$lt_var+set}\" = set; then
1764+ $lt_var=\$save_$lt_var; export $lt_var
1765+ else
1766+ $lt_unset $lt_var
1767+ fi"
1768+ done
1769+
1770+ # Now prepare to actually exec the command.
1771+ exec_cmd="\$cmd$args"
1772+ else
1773+ # Display what would be done.
1774+ if test -n "$shlibpath_var"; then
1775+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
1776+ $ECHO "export $shlibpath_var"
1777+ fi
1778+ $ECHO "$cmd$args"
1779+ exit $EXIT_SUCCESS
1780+ fi
1781+}
1782+
1783+test "$mode" = execute && func_mode_execute ${1+"$@"}
1784+
1785+
1786+# func_mode_finish arg...
1787+func_mode_finish ()
1788+{
1789+ $opt_debug
1790+ libdirs="$nonopt"
1791+ admincmds=
1792+
1793+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
1794+ for dir
1795+ do
1796+ libdirs="$libdirs $dir"
1797+ done
1798+
1799+ for libdir in $libdirs; do
1800+ if test -n "$finish_cmds"; then
1801+ # Do each command in the finish commands.
1802+ func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
1803+'"$cmd"'"'
1804+ fi
1805+ if test -n "$finish_eval"; then
1806+ # Do the single finish_eval.
1807+ eval cmds=\"$finish_eval\"
1808+ $opt_dry_run || eval "$cmds" || admincmds="$admincmds
1809+ $cmds"
1810+ fi
1811+ done
1812+ fi
1813+
1814+ # Exit here if they wanted silent mode.
1815+ $opt_silent && exit $EXIT_SUCCESS
1816+
1817+ $ECHO "X----------------------------------------------------------------------" | $Xsed
1818+ $ECHO "Libraries have been installed in:"
1819+ for libdir in $libdirs; do
1820+ $ECHO " $libdir"
1821+ done
1822+ $ECHO
1823+ $ECHO "If you ever happen to want to link against installed libraries"
1824+ $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
1825+ $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
1826+ $ECHO "flag during linking and do at least one of the following:"
1827+ if test -n "$shlibpath_var"; then
1828+ $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
1829+ $ECHO " during execution"
1830+ fi
1831+ if test -n "$runpath_var"; then
1832+ $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
1833+ $ECHO " during linking"
1834+ fi
1835+ if test -n "$hardcode_libdir_flag_spec"; then
1836+ libdir=LIBDIR
1837+ eval flag=\"$hardcode_libdir_flag_spec\"
1838+
1839+ $ECHO " - use the \`$flag' linker flag"
1840+ fi
1841+ if test -n "$admincmds"; then
1842+ $ECHO " - have your system administrator run these commands:$admincmds"
1843+ fi
1844+ if test -f /etc/ld.so.conf; then
1845+ $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
1846+ fi
1847+ $ECHO
1848+
1849+ $ECHO "See any operating system documentation about shared libraries for"
1850+ case $host in
1851+ solaris2.[6789]|solaris2.1[0-9])
1852+ $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
1853+ $ECHO "pages."
1854+ ;;
1855+ *)
1856+ $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
1857+ ;;
1858+ esac
1859+ $ECHO "X----------------------------------------------------------------------" | $Xsed
1860+ exit $EXIT_SUCCESS
1861+}
1862+
1863+test "$mode" = finish && func_mode_finish ${1+"$@"}
1864+
1865+
1866+# func_mode_install arg...
1867+func_mode_install ()
1868+{
1869+ $opt_debug
1870+ # There may be an optional sh(1) argument at the beginning of
1871+ # install_prog (especially on Windows NT).
1872+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
1873+ # Allow the use of GNU shtool's install command.
1874+ $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
1875+ # Aesthetically quote it.
1876+ func_quote_for_eval "$nonopt"
1877+ install_prog="$func_quote_for_eval_result "
1878+ arg=$1
1879+ shift
1880+ else
1881+ install_prog=
1882+ arg=$nonopt
1883+ fi
1884+
1885+ # The real first argument should be the name of the installation program.
1886+ # Aesthetically quote it.
1887+ func_quote_for_eval "$arg"
1888+ install_prog="$install_prog$func_quote_for_eval_result"
1889+
1890+ # We need to accept at least all the BSD install flags.
1891+ dest=
1892+ files=
1893+ opts=
1894+ prev=
1895+ install_type=
1896+ isdir=no
1897+ stripme=
1898+ for arg
1899+ do
1900+ if test -n "$dest"; then
1901+ files="$files $dest"
1902+ dest=$arg
1903+ continue
1904+ fi
1905+
1906+ case $arg in
1907+ -d) isdir=yes ;;
1908+ -f)
1909+ case " $install_prog " in
1910+ *[\\\ /]cp\ *) ;;
1911+ *) prev=$arg ;;
1912+ esac
1913+ ;;
1914+ -g | -m | -o)
1915+ prev=$arg
1916+ ;;
1917+ -s)
1918+ stripme=" -s"
1919+ continue
1920+ ;;
1921+ -*)
1922+ ;;
1923+ *)
1924+ # If the previous option needed an argument, then skip it.
1925+ if test -n "$prev"; then
1926+ prev=
1927+ else
1928+ dest=$arg
1929+ continue
1930+ fi
1931+ ;;
1932+ esac
1933+
1934+ # Aesthetically quote the argument.
1935+ func_quote_for_eval "$arg"
1936+ install_prog="$install_prog $func_quote_for_eval_result"
1937+ done
1938+
1939+ test -z "$install_prog" && \
1940+ func_fatal_help "you must specify an install program"
1941+
1942+ test -n "$prev" && \
1943+ func_fatal_help "the \`$prev' option requires an argument"
1944+
1945+ if test -z "$files"; then
1946+ if test -z "$dest"; then
1947+ func_fatal_help "no file or destination specified"
1948+ else
1949+ func_fatal_help "you must specify a destination"
1950+ fi
1951+ fi
1952+
1953+ # Strip any trailing slash from the destination.
1954+ func_stripname '' '/' "$dest"
1955+ dest=$func_stripname_result
1956+
1957+ # Check to see that the destination is a directory.
1958+ test -d "$dest" && isdir=yes
1959+ if test "$isdir" = yes; then
1960+ destdir="$dest"
1961+ destname=
1962+ else
1963+ func_dirname_and_basename "$dest" "" "."
1964+ destdir="$func_dirname_result"
1965+ destname="$func_basename_result"
1966+
1967+ # Not a directory, so check to see that there is only one file specified.
1968+ set dummy $files; shift
1969+ test "$#" -gt 1 && \
1970+ func_fatal_help "\`$dest' is not a directory"
1971+ fi
1972+ case $destdir in
1973+ [\\/]* | [A-Za-z]:[\\/]*) ;;
1974+ *)
1975+ for file in $files; do
1976+ case $file in
1977+ *.lo) ;;
1978+ *)
1979+ func_fatal_help "\`$destdir' must be an absolute directory name"
1980+ ;;
1981+ esac
1982+ done
1983+ ;;
1984+ esac
1985+
1986+ # This variable tells wrapper scripts just to set variables rather
1987+ # than running their programs.
1988+ libtool_install_magic="$magic"
1989+
1990+ staticlibs=
1991+ future_libdirs=
1992+ current_libdirs=
1993+ for file in $files; do
1994+
1995+ # Do each installation.
1996+ case $file in
1997+ *.$libext)
1998+ # Do the static libraries later.
1999+ staticlibs="$staticlibs $file"
2000+ ;;
2001+
2002+ *.la)
2003+ # Check to see that this really is a libtool archive.
2004+ func_lalib_unsafe_p "$file" \
2005+ || func_fatal_help "\`$file' is not a valid libtool archive"
2006+
2007+ library_names=
2008+ old_library=
2009+ relink_command=
2010+ func_source "$file"
2011+
2012+ # Add the libdir to current_libdirs if it is the destination.
2013+ if test "X$destdir" = "X$libdir"; then
2014+ case "$current_libdirs " in
2015+ *" $libdir "*) ;;
2016+ *) current_libdirs="$current_libdirs $libdir" ;;
2017+ esac
2018+ else
2019+ # Note the libdir as a future libdir.
2020+ case "$future_libdirs " in
2021+ *" $libdir "*) ;;
2022+ *) future_libdirs="$future_libdirs $libdir" ;;
2023+ esac
2024+ fi
2025+
2026+ func_dirname "$file" "/" ""
2027+ dir="$func_dirname_result"
2028+ dir="$dir$objdir"
2029+
2030+ if test -n "$relink_command"; then
2031+ # Determine the prefix the user has applied to our future dir.
2032+ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
2033+
2034+ # Don't allow the user to place us outside of our expected
2035+ # location b/c this prevents finding dependent libraries that
2036+ # are installed to the same prefix.
2037+ # At present, this check doesn't affect windows .dll's that
2038+ # are installed into $libdir/../bin (currently, that works fine)
2039+ # but it's something to keep an eye on.
2040+ test "$inst_prefix_dir" = "$destdir" && \
2041+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
2042+
2043+ if test -n "$inst_prefix_dir"; then
2044+ # Stick the inst_prefix_dir data into the link command.
2045+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
2046+ else
2047+ relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
2048+ fi
2049+
2050+ func_warning "relinking \`$file'"
2051+ func_show_eval "$relink_command" \
2052+ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
2053+ fi
2054+
2055+ # See the names of the shared library.
2056+ set dummy $library_names; shift
2057+ if test -n "$1"; then
2058+ realname="$1"
2059+ shift
2060+
2061+ srcname="$realname"
2062+ test -n "$relink_command" && srcname="$realname"T
2063+
2064+ # Install the shared library and build the symlinks.
2065+ func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
2066+ 'exit $?'
2067+ tstripme="$stripme"
2068+ case $host_os in
2069+ cygwin* | mingw* | pw32* | cegcc*)
2070+ case $realname in
2071+ *.dll.a)
2072+ tstripme=""
2073+ ;;
2074+ esac
2075+ ;;
2076+ esac
2077+ if test -n "$tstripme" && test -n "$striplib"; then
2078+ func_show_eval "$striplib $destdir/$realname" 'exit $?'
2079+ fi
2080+
2081+ if test "$#" -gt 0; then
2082+ # Delete the old symlinks, and create new ones.
2083+ # Try `ln -sf' first, because the `ln' binary might depend on
2084+ # the symlink we replace! Solaris /bin/ln does not understand -f,
2085+ # so we also need to try rm && ln -s.
2086+ for linkname
2087+ do
2088+ test "$linkname" != "$realname" \
2089+ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
2090+ done
2091+ fi
2092+
2093+ # Do each command in the postinstall commands.
2094+ lib="$destdir/$realname"
2095+ func_execute_cmds "$postinstall_cmds" 'exit $?'
2096+ fi
2097+
2098+ # Install the pseudo-library for information purposes.
2099+ func_basename "$file"
2100+ name="$func_basename_result"
2101+ instname="$dir/$name"i
2102+ func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
2103+
2104+ # Maybe install the static library, too.
2105+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
2106+ ;;
2107+
2108+ *.lo)
2109+ # Install (i.e. copy) a libtool object.
2110+
2111+ # Figure out destination file name, if it wasn't already specified.
2112+ if test -n "$destname"; then
2113+ destfile="$destdir/$destname"
2114+ else
2115+ func_basename "$file"
2116+ destfile="$func_basename_result"
2117+ destfile="$destdir/$destfile"
2118+ fi
2119+
2120+ # Deduce the name of the destination old-style object file.
2121+ case $destfile in
2122+ *.lo)
2123+ func_lo2o "$destfile"
2124+ staticdest=$func_lo2o_result
2125+ ;;
2126+ *.$objext)
2127+ staticdest="$destfile"
2128+ destfile=
2129+ ;;
2130+ *)
2131+ func_fatal_help "cannot copy a libtool object to \`$destfile'"
2132+ ;;
2133+ esac
2134+
2135+ # Install the libtool object if requested.
2136+ test -n "$destfile" && \
2137+ func_show_eval "$install_prog $file $destfile" 'exit $?'
2138+
2139+ # Install the old object if enabled.
2140+ if test "$build_old_libs" = yes; then
2141+ # Deduce the name of the old-style object file.
2142+ func_lo2o "$file"
2143+ staticobj=$func_lo2o_result
2144+ func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
2145+ fi
2146+ exit $EXIT_SUCCESS
2147+ ;;
2148+
2149+ *)
2150+ # Figure out destination file name, if it wasn't already specified.
2151+ if test -n "$destname"; then
2152+ destfile="$destdir/$destname"
2153+ else
2154+ func_basename "$file"
2155+ destfile="$func_basename_result"
2156+ destfile="$destdir/$destfile"
2157+ fi
2158+
2159+ # If the file is missing, and there is a .exe on the end, strip it
2160+ # because it is most likely a libtool script we actually want to
2161+ # install
2162+ stripped_ext=""
2163+ case $file in
2164+ *.exe)
2165+ if test ! -f "$file"; then
2166+ func_stripname '' '.exe' "$file"
2167+ file=$func_stripname_result
2168+ stripped_ext=".exe"
2169+ fi
2170+ ;;
2171+ esac
2172+
2173+ # Do a test to see if this is really a libtool program.
2174+ case $host in
2175+ *cygwin* | *mingw*)
2176+ if func_ltwrapper_executable_p "$file"; then
2177+ func_ltwrapper_scriptname "$file"
2178+ wrapper=$func_ltwrapper_scriptname_result
2179+ else
2180+ func_stripname '' '.exe' "$file"
2181+ wrapper=$func_stripname_result
2182+ fi
2183+ ;;
2184+ *)
2185+ wrapper=$file
2186+ ;;
2187+ esac
2188+ if func_ltwrapper_script_p "$wrapper"; then
2189+ notinst_deplibs=
2190+ relink_command=
2191+
2192+ func_source "$wrapper"
2193+
2194+ # Check the variables that should have been set.
2195+ test -z "$generated_by_libtool_version" && \
2196+ func_fatal_error "invalid libtool wrapper script \`$wrapper'"
2197+
2198+ finalize=yes
2199+ for lib in $notinst_deplibs; do
2200+ # Check to see that each library is installed.
2201+ libdir=
2202+ if test -f "$lib"; then
2203+ func_source "$lib"
2204+ fi
2205+ libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
2206+ if test -n "$libdir" && test ! -f "$libfile"; then
2207+ func_warning "\`$lib' has not been installed in \`$libdir'"
2208+ finalize=no
2209+ fi
2210+ done
2211+
2212+ relink_command=
2213+ func_source "$wrapper"
2214+
2215+ outputname=
2216+ if test "$fast_install" = no && test -n "$relink_command"; then
2217+ $opt_dry_run || {
2218+ if test "$finalize" = yes; then
2219+ tmpdir=`func_mktempdir`
2220+ func_basename "$file$stripped_ext"
2221+ file="$func_basename_result"
2222+ outputname="$tmpdir/$file"
2223+ # Replace the output file specification.
2224+ relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
2225+
2226+ $opt_silent || {
2227+ func_quote_for_expand "$relink_command"
2228+ eval "func_echo $func_quote_for_expand_result"
2229+ }
2230+ if eval "$relink_command"; then :
2231+ else
2232+ func_error "error: relink \`$file' with the above command before installing it"
2233+ $opt_dry_run || ${RM}r "$tmpdir"
2234+ continue
2235+ fi
2236+ file="$outputname"
2237+ else
2238+ func_warning "cannot relink \`$file'"
2239+ fi
2240+ }
2241+ else
2242+ # Install the binary that we compiled earlier.
2243+ file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
2244+ fi
2245+ fi
2246+
2247+ # remove .exe since cygwin /usr/bin/install will append another
2248+ # one anyway
2249+ case $install_prog,$host in
2250+ */usr/bin/install*,*cygwin*)
2251+ case $file:$destfile in
2252+ *.exe:*.exe)
2253+ # this is ok
2254+ ;;
2255+ *.exe:*)
2256+ destfile=$destfile.exe
2257+ ;;
2258+ *:*.exe)
2259+ func_stripname '' '.exe' "$destfile"
2260+ destfile=$func_stripname_result
2261+ ;;
2262+ esac
2263+ ;;
2264+ esac
2265+ func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
2266+ $opt_dry_run || if test -n "$outputname"; then
2267+ ${RM}r "$tmpdir"
2268+ fi
2269+ ;;
2270+ esac
2271+ done
2272+
2273+ for file in $staticlibs; do
2274+ func_basename "$file"
2275+ name="$func_basename_result"
2276+
2277+ # Set up the ranlib parameters.
2278+ oldlib="$destdir/$name"
2279+
2280+ func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
2281+
2282+ if test -n "$stripme" && test -n "$old_striplib"; then
2283+ func_show_eval "$old_striplib $oldlib" 'exit $?'
2284+ fi
2285+
2286+ # Do each command in the postinstall commands.
2287+ func_execute_cmds "$old_postinstall_cmds" 'exit $?'
2288+ done
2289+
2290+ test -n "$future_libdirs" && \
2291+ func_warning "remember to run \`$progname --finish$future_libdirs'"
2292+
2293+ if test -n "$current_libdirs"; then
2294+ # Maybe just do a dry run.
2295+ $opt_dry_run && current_libdirs=" -n$current_libdirs"
2296+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
2297+ else
2298+ exit $EXIT_SUCCESS
2299+ fi
2300+}
2301+
2302+test "$mode" = install && func_mode_install ${1+"$@"}
2303+
2304+
2305+# func_generate_dlsyms outputname originator pic_p
2306+# Extract symbols from dlprefiles and create ${outputname}S.o with
2307+# a dlpreopen symbol table.
2308+func_generate_dlsyms ()
2309+{
2310+ $opt_debug
2311+ my_outputname="$1"
2312+ my_originator="$2"
2313+ my_pic_p="${3-no}"
2314+ my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
2315+ my_dlsyms=
2316+
2317+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
2318+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
2319+ my_dlsyms="${my_outputname}S.c"
2320+ else
2321+ func_error "not configured to extract global symbols from dlpreopened files"
2322+ fi
2323+ fi
2324+
2325+ if test -n "$my_dlsyms"; then
2326+ case $my_dlsyms in
2327+ "") ;;
2328+ *.c)
2329+ # Discover the nlist of each of the dlfiles.
2330+ nlist="$output_objdir/${my_outputname}.nm"
2331+
2332+ func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
2333+
2334+ # Parse the name list into a source file.
2335+ func_verbose "creating $output_objdir/$my_dlsyms"
2336+
2337+ $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
2338+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
2339+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
2340+
2341+#ifdef __cplusplus
2342+extern \"C\" {
2343+#endif
2344+
2345+/* External symbol declarations for the compiler. */\
2346+"
2347+
2348+ if test "$dlself" = yes; then
2349+ func_verbose "generating symbol list for \`$output'"
2350+
2351+ $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
2352+
2353+ # Add our own program objects to the symbol list.
2354+ progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
2355+ for progfile in $progfiles; do
2356+ func_verbose "extracting global C symbols from \`$progfile'"
2357+ $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
2358+ done
2359+
2360+ if test -n "$exclude_expsyms"; then
2361+ $opt_dry_run || {
2362+ eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
2363+ eval '$MV "$nlist"T "$nlist"'
2364+ }
2365+ fi
2366+
2367+ if test -n "$export_symbols_regex"; then
2368+ $opt_dry_run || {
2369+ eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
2370+ eval '$MV "$nlist"T "$nlist"'
2371+ }
2372+ fi
2373+
2374+ # Prepare the list of exported symbols
2375+ if test -z "$export_symbols"; then
2376+ export_symbols="$output_objdir/$outputname.exp"
2377+ $opt_dry_run || {
2378+ $RM $export_symbols
2379+ eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
2380+ case $host in
2381+ *cygwin* | *mingw* | *cegcc* )
2382+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2383+ eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
2384+ ;;
2385+ esac
2386+ }
2387+ else
2388+ $opt_dry_run || {
2389+ eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
2390+ eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
2391+ eval '$MV "$nlist"T "$nlist"'
2392+ case $host in
2393+ *cygwin | *mingw* | *cegcc* )
2394+ eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
2395+ eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
2396+ ;;
2397+ esac
2398+ }
2399+ fi
2400+ fi
2401+
2402+ for dlprefile in $dlprefiles; do
2403+ func_verbose "extracting global C symbols from \`$dlprefile'"
2404+ func_basename "$dlprefile"
2405+ name="$func_basename_result"
2406+ $opt_dry_run || {
2407+ eval '$ECHO ": $name " >> "$nlist"'
2408+ eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
2409+ }
2410+ done
2411+
2412+ $opt_dry_run || {
2413+ # Make sure we have at least an empty file.
2414+ test -f "$nlist" || : > "$nlist"
2415+
2416+ if test -n "$exclude_expsyms"; then
2417+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
2418+ $MV "$nlist"T "$nlist"
2419+ fi
2420+
2421+ # Try sorting and uniquifying the output.
2422+ if $GREP -v "^: " < "$nlist" |
2423+ if sort -k 3 </dev/null >/dev/null 2>&1; then
2424+ sort -k 3
2425+ else
2426+ sort +2
2427+ fi |
2428+ uniq > "$nlist"S; then
2429+ :
2430+ else
2431+ $GREP -v "^: " < "$nlist" > "$nlist"S
2432+ fi
2433+
2434+ if test -f "$nlist"S; then
2435+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
2436+ else
2437+ $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
2438+ fi
2439+
2440+ $ECHO >> "$output_objdir/$my_dlsyms" "\
2441+
2442+/* The mapping between symbol names and symbols. */
2443+typedef struct {
2444+ const char *name;
2445+ void *address;
2446+} lt_dlsymlist;
2447+"
2448+ case $host in
2449+ *cygwin* | *mingw* | *cegcc* )
2450+ $ECHO >> "$output_objdir/$my_dlsyms" "\
2451+/* DATA imports from DLLs on WIN32 con't be const, because
2452+ runtime relocations are performed -- see ld's documentation
2453+ on pseudo-relocs. */"
2454+ lt_dlsym_const= ;;
2455+ *osf5*)
2456+ echo >> "$output_objdir/$my_dlsyms" "\
2457+/* This system does not cope well with relocations in const data */"
2458+ lt_dlsym_const= ;;
2459+ *)
2460+ lt_dlsym_const=const ;;
2461+ esac
2462+
2463+ $ECHO >> "$output_objdir/$my_dlsyms" "\
2464+extern $lt_dlsym_const lt_dlsymlist
2465+lt_${my_prefix}_LTX_preloaded_symbols[];
2466+$lt_dlsym_const lt_dlsymlist
2467+lt_${my_prefix}_LTX_preloaded_symbols[] =
2468+{\
2469+ { \"$my_originator\", (void *) 0 },"
2470+
2471+ case $need_lib_prefix in
2472+ no)
2473+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
2474+ ;;
2475+ *)
2476+ eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
2477+ ;;
2478+ esac
2479+ $ECHO >> "$output_objdir/$my_dlsyms" "\
2480+ {0, (void *) 0}
2481+};
2482+
2483+/* This works around a problem in FreeBSD linker */
2484+#ifdef FREEBSD_WORKAROUND
2485+static const void *lt_preloaded_setup() {
2486+ return lt_${my_prefix}_LTX_preloaded_symbols;
2487+}
2488+#endif
2489+
2490+#ifdef __cplusplus
2491+}
2492+#endif\
2493+"
2494+ } # !$opt_dry_run
2495+
2496+ pic_flag_for_symtable=
2497+ case "$compile_command " in
2498+ *" -static "*) ;;
2499+ *)
2500+ case $host in
2501+ # compiling the symbol table file with pic_flag works around
2502+ # a FreeBSD bug that causes programs to crash when -lm is
2503+ # linked before any other PIC object. But we must not use
2504+ # pic_flag when linking with -static. The problem exists in
2505+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
2506+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
2507+ pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
2508+ *-*-hpux*)
2509+ pic_flag_for_symtable=" $pic_flag" ;;
2510+ *)
2511+ if test "X$my_pic_p" != Xno; then
2512+ pic_flag_for_symtable=" $pic_flag"
2513+ fi
2514+ ;;
2515+ esac
2516+ ;;
2517+ esac
2518+ symtab_cflags=
2519+ for arg in $LTCFLAGS; do
2520+ case $arg in
2521+ -pie | -fpie | -fPIE) ;;
2522+ *) symtab_cflags="$symtab_cflags $arg" ;;
2523+ esac
2524+ done
2525+
2526+ # Now compile the dynamic symbol file.
2527+ func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
2528+
2529+ # Clean up the generated files.
2530+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
2531+
2532+ # Transform the symbol file into the correct name.
2533+ symfileobj="$output_objdir/${my_outputname}S.$objext"
2534+ case $host in
2535+ *cygwin* | *mingw* | *cegcc* )
2536+ if test -f "$output_objdir/$my_outputname.def"; then
2537+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2538+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
2539+ else
2540+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2541+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2542+ fi
2543+ ;;
2544+ *)
2545+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2546+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
2547+ ;;
2548+ esac
2549+ ;;
2550+ *)
2551+ func_fatal_error "unknown suffix for \`$my_dlsyms'"
2552+ ;;
2553+ esac
2554+ else
2555+ # We keep going just in case the user didn't refer to
2556+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
2557+ # really was required.
2558+
2559+ # Nullify the symbol file.
2560+ compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
2561+ finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
2562+ fi
2563+}
2564+
2565+# func_win32_libid arg
2566+# return the library type of file 'arg'
2567+#
2568+# Need a lot of goo to handle *both* DLLs and import libs
2569+# Has to be a shell function in order to 'eat' the argument
2570+# that is supplied when $file_magic_command is called.
2571+func_win32_libid ()
2572+{
2573+ $opt_debug
2574+ win32_libid_type="unknown"
2575+ win32_fileres=`file -L $1 2>/dev/null`
2576+ case $win32_fileres in
2577+ *ar\ archive\ import\ library*) # definitely import
2578+ win32_libid_type="x86 archive import"
2579+ ;;
2580+ *ar\ archive*) # could be an import, or static
2581+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
2582+ $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
2583+ win32_nmres=`eval $NM -f posix -A $1 |
2584+ $SED -n -e '
2585+ 1,100{
2586+ / I /{
2587+ s,.*,import,
2588+ p
2589+ q
2590+ }
2591+ }'`
2592+ case $win32_nmres in
2593+ import*) win32_libid_type="x86 archive import";;
2594+ *) win32_libid_type="x86 archive static";;
2595+ esac
2596+ fi
2597+ ;;
2598+ *DLL*)
2599+ win32_libid_type="x86 DLL"
2600+ ;;
2601+ *executable*) # but shell scripts are "executable" too...
2602+ case $win32_fileres in
2603+ *MS\ Windows\ PE\ Intel*)
2604+ win32_libid_type="x86 DLL"
2605+ ;;
2606+ esac
2607+ ;;
2608+ esac
2609+ $ECHO "$win32_libid_type"
2610+}
2611+
2612+
2613+
2614+# func_extract_an_archive dir oldlib
2615+func_extract_an_archive ()
2616+{
2617+ $opt_debug
2618+ f_ex_an_ar_dir="$1"; shift
2619+ f_ex_an_ar_oldlib="$1"
2620+ func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
2621+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
2622+ :
2623+ else
2624+ func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
2625+ fi
2626+}
2627+
2628+
2629+# func_extract_archives gentop oldlib ...
2630+func_extract_archives ()
2631+{
2632+ $opt_debug
2633+ my_gentop="$1"; shift
2634+ my_oldlibs=${1+"$@"}
2635+ my_oldobjs=""
2636+ my_xlib=""
2637+ my_xabs=""
2638+ my_xdir=""
2639+
2640+ for my_xlib in $my_oldlibs; do
2641+ # Extract the objects.
2642+ case $my_xlib in
2643+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
2644+ *) my_xabs=`pwd`"/$my_xlib" ;;
2645+ esac
2646+ func_basename "$my_xlib"
2647+ my_xlib="$func_basename_result"
2648+ my_xlib_u=$my_xlib
2649+ while :; do
2650+ case " $extracted_archives " in
2651+ *" $my_xlib_u "*)
2652+ func_arith $extracted_serial + 1
2653+ extracted_serial=$func_arith_result
2654+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
2655+ *) break ;;
2656+ esac
2657+ done
2658+ extracted_archives="$extracted_archives $my_xlib_u"
2659+ my_xdir="$my_gentop/$my_xlib_u"
2660+
2661+ func_mkdir_p "$my_xdir"
2662+
2663+ case $host in
2664+ *-darwin*)
2665+ func_verbose "Extracting $my_xabs"
2666+ # Do not bother doing anything if just a dry run
2667+ $opt_dry_run || {
2668+ darwin_orig_dir=`pwd`
2669+ cd $my_xdir || exit $?
2670+ darwin_archive=$my_xabs
2671+ darwin_curdir=`pwd`
2672+ darwin_base_archive=`basename "$darwin_archive"`
2673+ darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
2674+ if test -n "$darwin_arches"; then
2675+ darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
2676+ darwin_arch=
2677+ func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
2678+ for darwin_arch in $darwin_arches ; do
2679+ func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2680+ $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
2681+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
2682+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
2683+ cd "$darwin_curdir"
2684+ $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
2685+ done # $darwin_arches
2686+ ## Okay now we've a bunch of thin objects, gotta fatten them up :)
2687+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
2688+ darwin_file=
2689+ darwin_files=
2690+ for darwin_file in $darwin_filelist; do
2691+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
2692+ $LIPO -create -output "$darwin_file" $darwin_files
2693+ done # $darwin_filelist
2694+ $RM -rf unfat-$$
2695+ cd "$darwin_orig_dir"
2696+ else
2697+ cd $darwin_orig_dir
2698+ func_extract_an_archive "$my_xdir" "$my_xabs"
2699+ fi # $darwin_arches
2700+ } # !$opt_dry_run
2701+ ;;
2702+ *)
2703+ func_extract_an_archive "$my_xdir" "$my_xabs"
2704+ ;;
2705+ esac
2706+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
2707+ done
2708+
2709+ func_extract_archives_result="$my_oldobjs"
2710+}
2711+
2712+
2713+
2714+# func_emit_wrapper_part1 [arg=no]
2715+#
2716+# Emit the first part of a libtool wrapper script on stdout.
2717+# For more information, see the description associated with
2718+# func_emit_wrapper(), below.
2719+func_emit_wrapper_part1 ()
2720+{
2721+ func_emit_wrapper_part1_arg1=no
2722+ if test -n "$1" ; then
2723+ func_emit_wrapper_part1_arg1=$1
2724+ fi
2725+
2726+ $ECHO "\
2727+#! $SHELL
2728+
2729+# $output - temporary wrapper script for $objdir/$outputname
2730+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
2731+#
2732+# The $output program cannot be directly executed until all the libtool
2733+# libraries that it depends on are installed.
2734+#
2735+# This wrapper script should never be moved out of the build directory.
2736+# If it is, it will not operate correctly.
2737+
2738+# Sed substitution that helps us do robust quoting. It backslashifies
2739+# metacharacters that are still active within double-quoted strings.
2740+Xsed='${SED} -e 1s/^X//'
2741+sed_quote_subst='$sed_quote_subst'
2742+
2743+# Be Bourne compatible
2744+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
2745+ emulate sh
2746+ NULLCMD=:
2747+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
2748+ # is contrary to our usage. Disable this feature.
2749+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
2750+ setopt NO_GLOB_SUBST
2751+else
2752+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
2753+fi
2754+BIN_SH=xpg4; export BIN_SH # for Tru64
2755+DUALCASE=1; export DUALCASE # for MKS sh
2756+
2757+# The HP-UX ksh and POSIX shell print the target directory to stdout
2758+# if CDPATH is set.
2759+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
2760+
2761+relink_command=\"$relink_command\"
2762+
2763+# This environment variable determines our operation mode.
2764+if test \"\$libtool_install_magic\" = \"$magic\"; then
2765+ # install mode needs the following variables:
2766+ generated_by_libtool_version='$macro_version'
2767+ notinst_deplibs='$notinst_deplibs'
2768+else
2769+ # When we are sourced in execute mode, \$file and \$ECHO are already set.
2770+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
2771+ ECHO=\"$qecho\"
2772+ file=\"\$0\"
2773+ # Make sure echo works.
2774+ if test \"X\$1\" = X--no-reexec; then
2775+ # Discard the --no-reexec flag, and continue.
2776+ shift
2777+ elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
2778+ # Yippee, \$ECHO works!
2779+ :
2780+ else
2781+ # Restart under the correct shell, and then maybe \$ECHO will work.
2782+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
2783+ fi
2784+ fi\
2785+"
2786+ $ECHO "\
2787+
2788+ # Find the directory that this script lives in.
2789+ thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
2790+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
2791+
2792+ # Follow symbolic links until we get to the real thisdir.
2793+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
2794+ while test -n \"\$file\"; do
2795+ destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
2796+
2797+ # If there was a directory component, then change thisdir.
2798+ if test \"x\$destdir\" != \"x\$file\"; then
2799+ case \"\$destdir\" in
2800+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
2801+ *) thisdir=\"\$thisdir/\$destdir\" ;;
2802+ esac
2803+ fi
2804+
2805+ file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
2806+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
2807+ done
2808+"
2809+}
2810+# end: func_emit_wrapper_part1
2811+
2812+# func_emit_wrapper_part2 [arg=no]
2813+#
2814+# Emit the second part of a libtool wrapper script on stdout.
2815+# For more information, see the description associated with
2816+# func_emit_wrapper(), below.
2817+func_emit_wrapper_part2 ()
2818+{
2819+ func_emit_wrapper_part2_arg1=no
2820+ if test -n "$1" ; then
2821+ func_emit_wrapper_part2_arg1=$1
2822+ fi
2823+
2824+ $ECHO "\
2825+
2826+ # Usually 'no', except on cygwin/mingw when embedded into
2827+ # the cwrapper.
2828+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
2829+ if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
2830+ # special case for '.'
2831+ if test \"\$thisdir\" = \".\"; then
2832+ thisdir=\`pwd\`
2833+ fi
2834+ # remove .libs from thisdir
2835+ case \"\$thisdir\" in
2836+ *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
2837+ $objdir ) thisdir=. ;;
2838+ esac
2839+ fi
2840+
2841+ # Try to get the absolute directory name.
2842+ absdir=\`cd \"\$thisdir\" && pwd\`
2843+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
2844+"
2845+
2846+ if test "$fast_install" = yes; then
2847+ $ECHO "\
2848+ program=lt-'$outputname'$exeext
2849+ progdir=\"\$thisdir/$objdir\"
2850+
2851+ if test ! -f \"\$progdir/\$program\" ||
2852+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
2853+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
2854+
2855+ file=\"\$\$-\$program\"
2856+
2857+ if test ! -d \"\$progdir\"; then
2858+ $MKDIR \"\$progdir\"
2859+ else
2860+ $RM \"\$progdir/\$file\"
2861+ fi"
2862+
2863+ $ECHO "\
2864+
2865+ # relink executable if necessary
2866+ if test -n \"\$relink_command\"; then
2867+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
2868+ else
2869+ $ECHO \"\$relink_command_output\" >&2
2870+ $RM \"\$progdir/\$file\"
2871+ exit 1
2872+ fi
2873+ fi
2874+
2875+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
2876+ { $RM \"\$progdir/\$program\";
2877+ $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
2878+ $RM \"\$progdir/\$file\"
2879+ fi"
2880+ else
2881+ $ECHO "\
2882+ program='$outputname'
2883+ progdir=\"\$thisdir/$objdir\"
2884+"
2885+ fi
2886+
2887+ $ECHO "\
2888+
2889+ if test -f \"\$progdir/\$program\"; then"
2890+
2891+ # Export our shlibpath_var if we have one.
2892+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
2893+ $ECHO "\
2894+ # Add our own library path to $shlibpath_var
2895+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
2896+
2897+ # Some systems cannot cope with colon-terminated $shlibpath_var
2898+ # The second colon is a workaround for a bug in BeOS R4 sed
2899+ $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
2900+
2901+ export $shlibpath_var
2902+"
2903+ fi
2904+
2905+ # fixup the dll searchpath if we need to.
2906+ if test -n "$dllsearchpath"; then
2907+ $ECHO "\
2908+ # Add the dll search path components to the executable PATH
2909+ PATH=$dllsearchpath:\$PATH
2910+"
2911+ fi
2912+
2913+ $ECHO "\
2914+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
2915+ # Run the actual program with our arguments.
2916+"
2917+ case $host in
2918+ # Backslashes separate directories on plain windows
2919+ *-*-mingw | *-*-os2* | *-cegcc*)
2920+ $ECHO "\
2921+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
2922+"
2923+ ;;
2924+
2925+ *)
2926+ $ECHO "\
2927+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
2928+"
2929+ ;;
2930+ esac
2931+ $ECHO "\
2932+ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
2933+ exit 1
2934+ fi
2935+ else
2936+ # The program doesn't exist.
2937+ \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
2938+ \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
2939+ $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
2940+ exit 1
2941+ fi
2942+fi\
2943+"
2944+}
2945+# end: func_emit_wrapper_part2
2946+
2947+
2948+# func_emit_wrapper [arg=no]
2949+#
2950+# Emit a libtool wrapper script on stdout.
2951+# Don't directly open a file because we may want to
2952+# incorporate the script contents within a cygwin/mingw
2953+# wrapper executable. Must ONLY be called from within
2954+# func_mode_link because it depends on a number of variables
2955+# set therein.
2956+#
2957+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
2958+# variable will take. If 'yes', then the emitted script
2959+# will assume that the directory in which it is stored is
2960+# the $objdir directory. This is a cygwin/mingw-specific
2961+# behavior.
2962+func_emit_wrapper ()
2963+{
2964+ func_emit_wrapper_arg1=no
2965+ if test -n "$1" ; then
2966+ func_emit_wrapper_arg1=$1
2967+ fi
2968+
2969+ # split this up so that func_emit_cwrapperexe_src
2970+ # can call each part independently.
2971+ func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
2972+ func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
2973+}
2974+
2975+
2976+# func_to_host_path arg
2977+#
2978+# Convert paths to host format when used with build tools.
2979+# Intended for use with "native" mingw (where libtool itself
2980+# is running under the msys shell), or in the following cross-
2981+# build environments:
2982+# $build $host
2983+# mingw (msys) mingw [e.g. native]
2984+# cygwin mingw
2985+# *nix + wine mingw
2986+# where wine is equipped with the `winepath' executable.
2987+# In the native mingw case, the (msys) shell automatically
2988+# converts paths for any non-msys applications it launches,
2989+# but that facility isn't available from inside the cwrapper.
2990+# Similar accommodations are necessary for $host mingw and
2991+# $build cygwin. Calling this function does no harm for other
2992+# $host/$build combinations not listed above.
2993+#
2994+# ARG is the path (on $build) that should be converted to
2995+# the proper representation for $host. The result is stored
2996+# in $func_to_host_path_result.
2997+func_to_host_path ()
2998+{
2999+ func_to_host_path_result="$1"
3000+ if test -n "$1" ; then
3001+ case $host in
3002+ *mingw* )
3003+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3004+ case $build in
3005+ *mingw* ) # actually, msys
3006+ # awkward: cmd appends spaces to result
3007+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3008+ func_to_host_path_tmp1=`( cmd //c echo "$1" |\
3009+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3010+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3011+ $SED -e "$lt_sed_naive_backslashify"`
3012+ ;;
3013+ *cygwin* )
3014+ func_to_host_path_tmp1=`cygpath -w "$1"`
3015+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3016+ $SED -e "$lt_sed_naive_backslashify"`
3017+ ;;
3018+ * )
3019+ # Unfortunately, winepath does not exit with a non-zero
3020+ # error code, so we are forced to check the contents of
3021+ # stdout. On the other hand, if the command is not
3022+ # found, the shell will set an exit code of 127 and print
3023+ # *an error message* to stdout. So we must check for both
3024+ # error code of zero AND non-empty stdout, which explains
3025+ # the odd construction:
3026+ func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
3027+ if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
3028+ func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
3029+ $SED -e "$lt_sed_naive_backslashify"`
3030+ else
3031+ # Allow warning below.
3032+ func_to_host_path_result=""
3033+ fi
3034+ ;;
3035+ esac
3036+ if test -z "$func_to_host_path_result" ; then
3037+ func_error "Could not determine host path corresponding to"
3038+ func_error " '$1'"
3039+ func_error "Continuing, but uninstalled executables may not work."
3040+ # Fallback:
3041+ func_to_host_path_result="$1"
3042+ fi
3043+ ;;
3044+ esac
3045+ fi
3046+}
3047+# end: func_to_host_path
3048+
3049+# func_to_host_pathlist arg
3050+#
3051+# Convert pathlists to host format when used with build tools.
3052+# See func_to_host_path(), above. This function supports the
3053+# following $build/$host combinations (but does no harm for
3054+# combinations not listed here):
3055+# $build $host
3056+# mingw (msys) mingw [e.g. native]
3057+# cygwin mingw
3058+# *nix + wine mingw
3059+#
3060+# Path separators are also converted from $build format to
3061+# $host format. If ARG begins or ends with a path separator
3062+# character, it is preserved (but converted to $host format)
3063+# on output.
3064+#
3065+# ARG is a pathlist (on $build) that should be converted to
3066+# the proper representation on $host. The result is stored
3067+# in $func_to_host_pathlist_result.
3068+func_to_host_pathlist ()
3069+{
3070+ func_to_host_pathlist_result="$1"
3071+ if test -n "$1" ; then
3072+ case $host in
3073+ *mingw* )
3074+ lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
3075+ # Remove leading and trailing path separator characters from
3076+ # ARG. msys behavior is inconsistent here, cygpath turns them
3077+ # into '.;' and ';.', and winepath ignores them completely.
3078+ func_to_host_pathlist_tmp2="$1"
3079+ # Once set for this call, this variable should not be
3080+ # reassigned. It is used in tha fallback case.
3081+ func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
3082+ $SED -e 's|^:*||' -e 's|:*$||'`
3083+ case $build in
3084+ *mingw* ) # Actually, msys.
3085+ # Awkward: cmd appends spaces to result.
3086+ lt_sed_strip_trailing_spaces="s/[ ]*\$//"
3087+ func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
3088+ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
3089+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3090+ $SED -e "$lt_sed_naive_backslashify"`
3091+ ;;
3092+ *cygwin* )
3093+ func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
3094+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
3095+ $SED -e "$lt_sed_naive_backslashify"`
3096+ ;;
3097+ * )
3098+ # unfortunately, winepath doesn't convert pathlists
3099+ func_to_host_pathlist_result=""
3100+ func_to_host_pathlist_oldIFS=$IFS
3101+ IFS=:
3102+ for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
3103+ IFS=$func_to_host_pathlist_oldIFS
3104+ if test -n "$func_to_host_pathlist_f" ; then
3105+ func_to_host_path "$func_to_host_pathlist_f"
3106+ if test -n "$func_to_host_path_result" ; then
3107+ if test -z "$func_to_host_pathlist_result" ; then
3108+ func_to_host_pathlist_result="$func_to_host_path_result"
3109+ else
3110+ func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
3111+ fi
3112+ fi
3113+ fi
3114+ IFS=:
3115+ done
3116+ IFS=$func_to_host_pathlist_oldIFS
3117+ ;;
3118+ esac
3119+ if test -z "$func_to_host_pathlist_result" ; then
3120+ func_error "Could not determine the host path(s) corresponding to"
3121+ func_error " '$1'"
3122+ func_error "Continuing, but uninstalled executables may not work."
3123+ # Fallback. This may break if $1 contains DOS-style drive
3124+ # specifications. The fix is not to complicate the expression
3125+ # below, but for the user to provide a working wine installation
3126+ # with winepath so that path translation in the cross-to-mingw
3127+ # case works properly.
3128+ lt_replace_pathsep_nix_to_dos="s|:|;|g"
3129+ func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
3130+ $SED -e "$lt_replace_pathsep_nix_to_dos"`
3131+ fi
3132+ # Now, add the leading and trailing path separators back
3133+ case "$1" in
3134+ :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
3135+ ;;
3136+ esac
3137+ case "$1" in
3138+ *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
3139+ ;;
3140+ esac
3141+ ;;
3142+ esac
3143+ fi
3144+}
3145+# end: func_to_host_pathlist
3146+
3147+# func_emit_cwrapperexe_src
3148+# emit the source code for a wrapper executable on stdout
3149+# Must ONLY be called from within func_mode_link because
3150+# it depends on a number of variable set therein.
3151+func_emit_cwrapperexe_src ()
3152+{
3153+ cat <<EOF
3154+
3155+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
3156+ Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
3157+
3158+ The $output program cannot be directly executed until all the libtool
3159+ libraries that it depends on are installed.
3160+
3161+ This wrapper executable should never be moved out of the build directory.
3162+ If it is, it will not operate correctly.
3163+
3164+ Currently, it simply execs the wrapper *script* "$SHELL $output",
3165+ but could eventually absorb all of the scripts functionality and
3166+ exec $objdir/$outputname directly.
3167+*/
3168+EOF
3169+ cat <<"EOF"
3170+#include <stdio.h>
3171+#include <stdlib.h>
3172+#ifdef _MSC_VER
3173+# include <direct.h>
3174+# include <process.h>
3175+# include <io.h>
3176+# define setmode _setmode
3177+#else
3178+# include <unistd.h>
3179+# include <stdint.h>
3180+# ifdef __CYGWIN__
3181+# include <io.h>
3182+# define HAVE_SETENV
3183+# ifdef __STRICT_ANSI__
3184+char *realpath (const char *, char *);
3185+int putenv (char *);
3186+int setenv (const char *, const char *, int);
3187+# endif
3188+# endif
3189+#endif
3190+#include <malloc.h>
3191+#include <stdarg.h>
3192+#include <assert.h>
3193+#include <string.h>
3194+#include <ctype.h>
3195+#include <errno.h>
3196+#include <fcntl.h>
3197+#include <sys/stat.h>
3198+
3199+#if defined(PATH_MAX)
3200+# define LT_PATHMAX PATH_MAX
3201+#elif defined(MAXPATHLEN)
3202+# define LT_PATHMAX MAXPATHLEN
3203+#else
3204+# define LT_PATHMAX 1024
3205+#endif
3206+
3207+#ifndef S_IXOTH
3208+# define S_IXOTH 0
3209+#endif
3210+#ifndef S_IXGRP
3211+# define S_IXGRP 0
3212+#endif
3213+
3214+#ifdef _MSC_VER
3215+# define S_IXUSR _S_IEXEC
3216+# define stat _stat
3217+# ifndef _INTPTR_T_DEFINED
3218+# define intptr_t int
3219+# endif
3220+#endif
3221+
3222+#ifndef DIR_SEPARATOR
3223+# define DIR_SEPARATOR '/'
3224+# define PATH_SEPARATOR ':'
3225+#endif
3226+
3227+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
3228+ defined (__OS2__)
3229+# define HAVE_DOS_BASED_FILE_SYSTEM
3230+# define FOPEN_WB "wb"
3231+# ifndef DIR_SEPARATOR_2
3232+# define DIR_SEPARATOR_2 '\\'
3233+# endif
3234+# ifndef PATH_SEPARATOR_2
3235+# define PATH_SEPARATOR_2 ';'
3236+# endif
3237+#endif
3238+
3239+#ifndef DIR_SEPARATOR_2
3240+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
3241+#else /* DIR_SEPARATOR_2 */
3242+# define IS_DIR_SEPARATOR(ch) \
3243+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
3244+#endif /* DIR_SEPARATOR_2 */
3245+
3246+#ifndef PATH_SEPARATOR_2
3247+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
3248+#else /* PATH_SEPARATOR_2 */
3249+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
3250+#endif /* PATH_SEPARATOR_2 */
3251+
3252+#ifdef __CYGWIN__
3253+# define FOPEN_WB "wb"
3254+#endif
3255+
3256+#ifndef FOPEN_WB
3257+# define FOPEN_WB "w"
3258+#endif
3259+#ifndef _O_BINARY
3260+# define _O_BINARY 0
3261+#endif
3262+
3263+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
3264+#define XFREE(stale) do { \
3265+ if (stale) { free ((void *) stale); stale = 0; } \
3266+} while (0)
3267+
3268+#undef LTWRAPPER_DEBUGPRINTF
3269+#if defined DEBUGWRAPPER
3270+# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
3271+static void
3272+ltwrapper_debugprintf (const char *fmt, ...)
3273+{
3274+ va_list args;
3275+ va_start (args, fmt);
3276+ (void) vfprintf (stderr, fmt, args);
3277+ va_end (args);
3278+}
3279+#else
3280+# define LTWRAPPER_DEBUGPRINTF(args)
3281+#endif
3282+
3283+const char *program_name = NULL;
3284+
3285+void *xmalloc (size_t num);
3286+char *xstrdup (const char *string);
3287+const char *base_name (const char *name);
3288+char *find_executable (const char *wrapper);
3289+char *chase_symlinks (const char *pathspec);
3290+int make_executable (const char *path);
3291+int check_executable (const char *path);
3292+char *strendzap (char *str, const char *pat);
3293+void lt_fatal (const char *message, ...);
3294+void lt_setenv (const char *name, const char *value);
3295+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
3296+void lt_opt_process_env_set (const char *arg);
3297+void lt_opt_process_env_prepend (const char *arg);
3298+void lt_opt_process_env_append (const char *arg);
3299+int lt_split_name_value (const char *arg, char** name, char** value);
3300+void lt_update_exe_path (const char *name, const char *value);
3301+void lt_update_lib_path (const char *name, const char *value);
3302+
3303+static const char *script_text_part1 =
3304+EOF
3305+
3306+ func_emit_wrapper_part1 yes |
3307+ $SED -e 's/\([\\"]\)/\\\1/g' \
3308+ -e 's/^/ "/' -e 's/$/\\n"/'
3309+ echo ";"
3310+ cat <<EOF
3311+
3312+static const char *script_text_part2 =
3313+EOF
3314+ func_emit_wrapper_part2 yes |
3315+ $SED -e 's/\([\\"]\)/\\\1/g' \
3316+ -e 's/^/ "/' -e 's/$/\\n"/'
3317+ echo ";"
3318+
3319+ cat <<EOF
3320+const char * MAGIC_EXE = "$magic_exe";
3321+const char * LIB_PATH_VARNAME = "$shlibpath_var";
3322+EOF
3323+
3324+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
3325+ func_to_host_pathlist "$temp_rpath"
3326+ cat <<EOF
3327+const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
3328+EOF
3329+ else
3330+ cat <<"EOF"
3331+const char * LIB_PATH_VALUE = "";
3332+EOF
3333+ fi
3334+
3335+ if test -n "$dllsearchpath"; then
3336+ func_to_host_pathlist "$dllsearchpath:"
3337+ cat <<EOF
3338+const char * EXE_PATH_VARNAME = "PATH";
3339+const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
3340+EOF
3341+ else
3342+ cat <<"EOF"
3343+const char * EXE_PATH_VARNAME = "";
3344+const char * EXE_PATH_VALUE = "";
3345+EOF
3346+ fi
3347+
3348+ if test "$fast_install" = yes; then
3349+ cat <<EOF
3350+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
3351+EOF
3352+ else
3353+ cat <<EOF
3354+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
3355+EOF
3356+ fi
3357+
3358+
3359+ cat <<"EOF"
3360+
3361+#define LTWRAPPER_OPTION_PREFIX "--lt-"
3362+#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
3363+
3364+static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
3365+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
3366+
3367+static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
3368+
3369+static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
3370+static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
3371+ /* argument is putenv-style "foo=bar", value of foo is set to bar */
3372+
3373+static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
3374+static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
3375+ /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
3376+
3377+static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
3378+static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
3379+ /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
3380+
3381+int
3382+main (int argc, char *argv[])
3383+{
3384+ char **newargz;
3385+ int newargc;
3386+ char *tmp_pathspec;
3387+ char *actual_cwrapper_path;
3388+ char *actual_cwrapper_name;
3389+ char *target_name;
3390+ char *lt_argv_zero;
3391+ intptr_t rval = 127;
3392+
3393+ int i;
3394+
3395+ program_name = (char *) xstrdup (base_name (argv[0]));
3396+ LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
3397+ LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
3398+
3399+ /* very simple arg parsing; don't want to rely on getopt */
3400+ for (i = 1; i < argc; i++)
3401+ {
3402+ if (strcmp (argv[i], dumpscript_opt) == 0)
3403+ {
3404+EOF
3405+ case "$host" in
3406+ *mingw* | *cygwin* )
3407+ # make stdout use "unix" line endings
3408+ echo " setmode(1,_O_BINARY);"
3409+ ;;
3410+ esac
3411+
3412+ cat <<"EOF"
3413+ printf ("%s", script_text_part1);
3414+ printf ("%s", script_text_part2);
3415+ return 0;
3416+ }
3417+ }
3418+
3419+ newargz = XMALLOC (char *, argc + 1);
3420+ tmp_pathspec = find_executable (argv[0]);
3421+ if (tmp_pathspec == NULL)
3422+ lt_fatal ("Couldn't find %s", argv[0]);
3423+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
3424+ tmp_pathspec));
3425+
3426+ actual_cwrapper_path = chase_symlinks (tmp_pathspec);
3427+ LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
3428+ actual_cwrapper_path));
3429+ XFREE (tmp_pathspec);
3430+
3431+ actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
3432+ strendzap (actual_cwrapper_path, actual_cwrapper_name);
3433+
3434+ /* wrapper name transforms */
3435+ strendzap (actual_cwrapper_name, ".exe");
3436+ tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
3437+ XFREE (actual_cwrapper_name);
3438+ actual_cwrapper_name = tmp_pathspec;
3439+ tmp_pathspec = 0;
3440+
3441+ /* target_name transforms -- use actual target program name; might have lt- prefix */
3442+ target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
3443+ strendzap (target_name, ".exe");
3444+ tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
3445+ XFREE (target_name);
3446+ target_name = tmp_pathspec;
3447+ tmp_pathspec = 0;
3448+
3449+ LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
3450+ target_name));
3451+EOF
3452+
3453+ cat <<EOF
3454+ newargz[0] =
3455+ XMALLOC (char, (strlen (actual_cwrapper_path) +
3456+ strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
3457+ strcpy (newargz[0], actual_cwrapper_path);
3458+ strcat (newargz[0], "$objdir");
3459+ strcat (newargz[0], "/");
3460+EOF
3461+
3462+ cat <<"EOF"
3463+ /* stop here, and copy so we don't have to do this twice */
3464+ tmp_pathspec = xstrdup (newargz[0]);
3465+
3466+ /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
3467+ strcat (newargz[0], actual_cwrapper_name);
3468+
3469+ /* DO want the lt- prefix here if it exists, so use target_name */
3470+ lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
3471+ XFREE (tmp_pathspec);
3472+ tmp_pathspec = NULL;
3473+EOF
3474+
3475+ case $host_os in
3476+ mingw*)
3477+ cat <<"EOF"
3478+ {
3479+ char* p;
3480+ while ((p = strchr (newargz[0], '\\')) != NULL)
3481+ {
3482+ *p = '/';
3483+ }
3484+ while ((p = strchr (lt_argv_zero, '\\')) != NULL)
3485+ {
3486+ *p = '/';
3487+ }
3488+ }
3489+EOF
3490+ ;;
3491+ esac
3492+
3493+ cat <<"EOF"
3494+ XFREE (target_name);
3495+ XFREE (actual_cwrapper_path);
3496+ XFREE (actual_cwrapper_name);
3497+
3498+ lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
3499+ lt_setenv ("DUALCASE", "1"); /* for MSK sh */
3500+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
3501+ lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
3502+
3503+ newargc=0;
3504+ for (i = 1; i < argc; i++)
3505+ {
3506+ if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
3507+ {
3508+ if (argv[i][env_set_opt_len] == '=')
3509+ {
3510+ const char *p = argv[i] + env_set_opt_len + 1;
3511+ lt_opt_process_env_set (p);
3512+ }
3513+ else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
3514+ {
3515+ lt_opt_process_env_set (argv[++i]); /* don't copy */
3516+ }
3517+ else
3518+ lt_fatal ("%s missing required argument", env_set_opt);
3519+ continue;
3520+ }
3521+ if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
3522+ {
3523+ if (argv[i][env_prepend_opt_len] == '=')
3524+ {
3525+ const char *p = argv[i] + env_prepend_opt_len + 1;
3526+ lt_opt_process_env_prepend (p);
3527+ }
3528+ else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
3529+ {
3530+ lt_opt_process_env_prepend (argv[++i]); /* don't copy */
3531+ }
3532+ else
3533+ lt_fatal ("%s missing required argument", env_prepend_opt);
3534+ continue;
3535+ }
3536+ if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
3537+ {
3538+ if (argv[i][env_append_opt_len] == '=')
3539+ {
3540+ const char *p = argv[i] + env_append_opt_len + 1;
3541+ lt_opt_process_env_append (p);
3542+ }
3543+ else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
3544+ {
3545+ lt_opt_process_env_append (argv[++i]); /* don't copy */
3546+ }
3547+ else
3548+ lt_fatal ("%s missing required argument", env_append_opt);
3549+ continue;
3550+ }
3551+ if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
3552+ {
3553+ /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
3554+ namespace, but it is not one of the ones we know about and
3555+ have already dealt with, above (inluding dump-script), then
3556+ report an error. Otherwise, targets might begin to believe
3557+ they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
3558+ namespace. The first time any user complains about this, we'll
3559+ need to make LTWRAPPER_OPTION_PREFIX a configure-time option
3560+ or a configure.ac-settable value.
3561+ */
3562+ lt_fatal ("Unrecognized option in %s namespace: '%s'",
3563+ ltwrapper_option_prefix, argv[i]);
3564+ }
3565+ /* otherwise ... */
3566+ newargz[++newargc] = xstrdup (argv[i]);
3567+ }
3568+ newargz[++newargc] = NULL;
3569+
3570+ LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
3571+ for (i = 0; i < newargc; i++)
3572+ {
3573+ LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
3574+ }
3575+
3576+EOF
3577+
3578+ case $host_os in
3579+ mingw*)
3580+ cat <<"EOF"
3581+ /* execv doesn't actually work on mingw as expected on unix */
3582+ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
3583+ if (rval == -1)
3584+ {
3585+ /* failed to start process */
3586+ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
3587+ return 127;
3588+ }
3589+ return rval;
3590+EOF
3591+ ;;
3592+ *)
3593+ cat <<"EOF"
3594+ execv (lt_argv_zero, newargz);
3595+ return rval; /* =127, but avoids unused variable warning */
3596+EOF
3597+ ;;
3598+ esac
3599+
3600+ cat <<"EOF"
3601+}
3602+
3603+void *
3604+xmalloc (size_t num)
3605+{
3606+ void *p = (void *) malloc (num);
3607+ if (!p)
3608+ lt_fatal ("Memory exhausted");
3609+
3610+ return p;
3611+}
3612+
3613+char *
3614+xstrdup (const char *string)
3615+{
3616+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
3617+ string) : NULL;
3618+}
3619+
3620+const char *
3621+base_name (const char *name)
3622+{
3623+ const char *base;
3624+
3625+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3626+ /* Skip over the disk name in MSDOS pathnames. */
3627+ if (isalpha ((unsigned char) name[0]) && name[1] == ':')
3628+ name += 2;
3629+#endif
3630+
3631+ for (base = name; *name; name++)
3632+ if (IS_DIR_SEPARATOR (*name))
3633+ base = name + 1;
3634+ return base;
3635+}
3636+
3637+int
3638+check_executable (const char *path)
3639+{
3640+ struct stat st;
3641+
3642+ LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
3643+ path ? (*path ? path : "EMPTY!") : "NULL!"));
3644+ if ((!path) || (!*path))
3645+ return 0;
3646+
3647+ if ((stat (path, &st) >= 0)
3648+ && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
3649+ return 1;
3650+ else
3651+ return 0;
3652+}
3653+
3654+int
3655+make_executable (const char *path)
3656+{
3657+ int rval = 0;
3658+ struct stat st;
3659+
3660+ LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
3661+ path ? (*path ? path : "EMPTY!") : "NULL!"));
3662+ if ((!path) || (!*path))
3663+ return 0;
3664+
3665+ if (stat (path, &st) >= 0)
3666+ {
3667+ rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
3668+ }
3669+ return rval;
3670+}
3671+
3672+/* Searches for the full path of the wrapper. Returns
3673+ newly allocated full path name if found, NULL otherwise
3674+ Does not chase symlinks, even on platforms that support them.
3675+*/
3676+char *
3677+find_executable (const char *wrapper)
3678+{
3679+ int has_slash = 0;
3680+ const char *p;
3681+ const char *p_next;
3682+ /* static buffer for getcwd */
3683+ char tmp[LT_PATHMAX + 1];
3684+ int tmp_len;
3685+ char *concat_name;
3686+
3687+ LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
3688+ wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
3689+
3690+ if ((wrapper == NULL) || (*wrapper == '\0'))
3691+ return NULL;
3692+
3693+ /* Absolute path? */
3694+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3695+ if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
3696+ {
3697+ concat_name = xstrdup (wrapper);
3698+ if (check_executable (concat_name))
3699+ return concat_name;
3700+ XFREE (concat_name);
3701+ }
3702+ else
3703+ {
3704+#endif
3705+ if (IS_DIR_SEPARATOR (wrapper[0]))
3706+ {
3707+ concat_name = xstrdup (wrapper);
3708+ if (check_executable (concat_name))
3709+ return concat_name;
3710+ XFREE (concat_name);
3711+ }
3712+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
3713+ }
3714+#endif
3715+
3716+ for (p = wrapper; *p; p++)
3717+ if (*p == '/')
3718+ {
3719+ has_slash = 1;
3720+ break;
3721+ }
3722+ if (!has_slash)
3723+ {
3724+ /* no slashes; search PATH */
3725+ const char *path = getenv ("PATH");
3726+ if (path != NULL)
3727+ {
3728+ for (p = path; *p; p = p_next)
3729+ {
3730+ const char *q;
3731+ size_t p_len;
3732+ for (q = p; *q; q++)
3733+ if (IS_PATH_SEPARATOR (*q))
3734+ break;
3735+ p_len = q - p;
3736+ p_next = (*q == '\0' ? q : q + 1);
3737+ if (p_len == 0)
3738+ {
3739+ /* empty path: current directory */
3740+ if (getcwd (tmp, LT_PATHMAX) == NULL)
3741+ lt_fatal ("getcwd failed");
3742+ tmp_len = strlen (tmp);
3743+ concat_name =
3744+ XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3745+ memcpy (concat_name, tmp, tmp_len);
3746+ concat_name[tmp_len] = '/';
3747+ strcpy (concat_name + tmp_len + 1, wrapper);
3748+ }
3749+ else
3750+ {
3751+ concat_name =
3752+ XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
3753+ memcpy (concat_name, p, p_len);
3754+ concat_name[p_len] = '/';
3755+ strcpy (concat_name + p_len + 1, wrapper);
3756+ }
3757+ if (check_executable (concat_name))
3758+ return concat_name;
3759+ XFREE (concat_name);
3760+ }
3761+ }
3762+ /* not found in PATH; assume curdir */
3763+ }
3764+ /* Relative path | not found in path: prepend cwd */
3765+ if (getcwd (tmp, LT_PATHMAX) == NULL)
3766+ lt_fatal ("getcwd failed");
3767+ tmp_len = strlen (tmp);
3768+ concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
3769+ memcpy (concat_name, tmp, tmp_len);
3770+ concat_name[tmp_len] = '/';
3771+ strcpy (concat_name + tmp_len + 1, wrapper);
3772+
3773+ if (check_executable (concat_name))
3774+ return concat_name;
3775+ XFREE (concat_name);
3776+ return NULL;
3777+}
3778+
3779+char *
3780+chase_symlinks (const char *pathspec)
3781+{
3782+#ifndef S_ISLNK
3783+ return xstrdup (pathspec);
3784+#else
3785+ char buf[LT_PATHMAX];
3786+ struct stat s;
3787+ char *tmp_pathspec = xstrdup (pathspec);
3788+ char *p;
3789+ int has_symlinks = 0;
3790+ while (strlen (tmp_pathspec) && !has_symlinks)
3791+ {
3792+ LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
3793+ tmp_pathspec));
3794+ if (lstat (tmp_pathspec, &s) == 0)
3795+ {
3796+ if (S_ISLNK (s.st_mode) != 0)
3797+ {
3798+ has_symlinks = 1;
3799+ break;
3800+ }
3801+
3802+ /* search backwards for last DIR_SEPARATOR */
3803+ p = tmp_pathspec + strlen (tmp_pathspec) - 1;
3804+ while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3805+ p--;
3806+ if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
3807+ {
3808+ /* no more DIR_SEPARATORS left */
3809+ break;
3810+ }
3811+ *p = '\0';
3812+ }
3813+ else
3814+ {
3815+ char *errstr = strerror (errno);
3816+ lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
3817+ }
3818+ }
3819+ XFREE (tmp_pathspec);
3820+
3821+ if (!has_symlinks)
3822+ {
3823+ return xstrdup (pathspec);
3824+ }
3825+
3826+ tmp_pathspec = realpath (pathspec, buf);
3827+ if (tmp_pathspec == 0)
3828+ {
3829+ lt_fatal ("Could not follow symlinks for %s", pathspec);
3830+ }
3831+ return xstrdup (tmp_pathspec);
3832+#endif
3833+}
3834+
3835+char *
3836+strendzap (char *str, const char *pat)
3837+{
3838+ size_t len, patlen;
3839+
3840+ assert (str != NULL);
3841+ assert (pat != NULL);
3842+
3843+ len = strlen (str);
3844+ patlen = strlen (pat);
3845+
3846+ if (patlen <= len)
3847+ {
3848+ str += len - patlen;
3849+ if (strcmp (str, pat) == 0)
3850+ *str = '\0';
3851+ }
3852+ return str;
3853+}
3854+
3855+static void
3856+lt_error_core (int exit_status, const char *mode,
3857+ const char *message, va_list ap)
3858+{
3859+ fprintf (stderr, "%s: %s: ", program_name, mode);
3860+ vfprintf (stderr, message, ap);
3861+ fprintf (stderr, ".\n");
3862+
3863+ if (exit_status >= 0)
3864+ exit (exit_status);
3865+}
3866+
3867+void
3868+lt_fatal (const char *message, ...)
3869+{
3870+ va_list ap;
3871+ va_start (ap, message);
3872+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
3873+ va_end (ap);
3874+}
3875+
3876+void
3877+lt_setenv (const char *name, const char *value)
3878+{
3879+ LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
3880+ (name ? name : "<NULL>"),
3881+ (value ? value : "<NULL>")));
3882+ {
3883+#ifdef HAVE_SETENV
3884+ /* always make a copy, for consistency with !HAVE_SETENV */
3885+ char *str = xstrdup (value);
3886+ setenv (name, str, 1);
3887+#else
3888+ int len = strlen (name) + 1 + strlen (value) + 1;
3889+ char *str = XMALLOC (char, len);
3890+ sprintf (str, "%s=%s", name, value);
3891+ if (putenv (str) != EXIT_SUCCESS)
3892+ {
3893+ XFREE (str);
3894+ }
3895+#endif
3896+ }
3897+}
3898+
3899+char *
3900+lt_extend_str (const char *orig_value, const char *add, int to_end)
3901+{
3902+ char *new_value;
3903+ if (orig_value && *orig_value)
3904+ {
3905+ int orig_value_len = strlen (orig_value);
3906+ int add_len = strlen (add);
3907+ new_value = XMALLOC (char, add_len + orig_value_len + 1);
3908+ if (to_end)
3909+ {
3910+ strcpy (new_value, orig_value);
3911+ strcpy (new_value + orig_value_len, add);
3912+ }
3913+ else
3914+ {
3915+ strcpy (new_value, add);
3916+ strcpy (new_value + add_len, orig_value);
3917+ }
3918+ }
3919+ else
3920+ {
3921+ new_value = xstrdup (add);
3922+ }
3923+ return new_value;
3924+}
3925+
3926+int
3927+lt_split_name_value (const char *arg, char** name, char** value)
3928+{
3929+ const char *p;
3930+ int len;
3931+ if (!arg || !*arg)
3932+ return 1;
3933+
3934+ p = strchr (arg, (int)'=');
3935+
3936+ if (!p)
3937+ return 1;
3938+
3939+ *value = xstrdup (++p);
3940+
3941+ len = strlen (arg) - strlen (*value);
3942+ *name = XMALLOC (char, len);
3943+ strncpy (*name, arg, len-1);
3944+ (*name)[len - 1] = '\0';
3945+
3946+ return 0;
3947+}
3948+
3949+void
3950+lt_opt_process_env_set (const char *arg)
3951+{
3952+ char *name = NULL;
3953+ char *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_set_opt, arg);
3960+ }
3961+
3962+ lt_setenv (name, value);
3963+ XFREE (name);
3964+ XFREE (value);
3965+}
3966+
3967+void
3968+lt_opt_process_env_prepend (const char *arg)
3969+{
3970+ char *name = NULL;
3971+ char *value = NULL;
3972+ char *new_value = NULL;
3973+
3974+ if (lt_split_name_value (arg, &name, &value) != 0)
3975+ {
3976+ XFREE (name);
3977+ XFREE (value);
3978+ lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
3979+ }
3980+
3981+ new_value = lt_extend_str (getenv (name), value, 0);
3982+ lt_setenv (name, new_value);
3983+ XFREE (new_value);
3984+ XFREE (name);
3985+ XFREE (value);
3986+}
3987+
3988+void
3989+lt_opt_process_env_append (const char *arg)
3990+{
3991+ char *name = NULL;
3992+ char *value = NULL;
3993+ char *new_value = NULL;
3994+
3995+ if (lt_split_name_value (arg, &name, &value) != 0)
3996+ {
3997+ XFREE (name);
3998+ XFREE (value);
3999+ lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
4000+ }
4001+
4002+ new_value = lt_extend_str (getenv (name), value, 1);
4003+ lt_setenv (name, new_value);
4004+ XFREE (new_value);
4005+ XFREE (name);
4006+ XFREE (value);
4007+}
4008+
4009+void
4010+lt_update_exe_path (const char *name, const char *value)
4011+{
4012+ LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
4013+ (name ? name : "<NULL>"),
4014+ (value ? value : "<NULL>")));
4015+
4016+ if (name && *name && value && *value)
4017+ {
4018+ char *new_value = lt_extend_str (getenv (name), value, 0);
4019+ /* some systems can't cope with a ':'-terminated path #' */
4020+ int len = strlen (new_value);
4021+ while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
4022+ {
4023+ new_value[len-1] = '\0';
4024+ }
4025+ lt_setenv (name, new_value);
4026+ XFREE (new_value);
4027+ }
4028+}
4029+
4030+void
4031+lt_update_lib_path (const char *name, const char *value)
4032+{
4033+ LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
4034+ (name ? name : "<NULL>"),
4035+ (value ? value : "<NULL>")));
4036+
4037+ if (name && *name && value && *value)
4038+ {
4039+ char *new_value = lt_extend_str (getenv (name), value, 0);
4040+ lt_setenv (name, new_value);
4041+ XFREE (new_value);
4042+ }
4043+}
4044+
4045+
4046+EOF
4047+}
4048+# end: func_emit_cwrapperexe_src
4049+
4050+# func_mode_link arg...
4051+func_mode_link ()
4052+{
4053+ $opt_debug
4054+ case $host in
4055+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4056+ # It is impossible to link a dll without this setting, and
4057+ # we shouldn't force the makefile maintainer to figure out
4058+ # which system we are compiling for in order to pass an extra
4059+ # flag for every libtool invocation.
4060+ # allow_undefined=no
4061+
4062+ # FIXME: Unfortunately, there are problems with the above when trying
4063+ # to make a dll which has undefined symbols, in which case not
4064+ # even a static library is built. For now, we need to specify
4065+ # -no-undefined on the libtool link line when we can be certain
4066+ # that all symbols are satisfied, otherwise we get a static library.
4067+ allow_undefined=yes
4068+ ;;
4069+ *)
4070+ allow_undefined=yes
4071+ ;;
4072+ esac
4073+ libtool_args=$nonopt
4074+ base_compile="$nonopt $@"
4075+ compile_command=$nonopt
4076+ finalize_command=$nonopt
4077+
4078+ compile_rpath=
4079+ finalize_rpath=
4080+ compile_shlibpath=
4081+ finalize_shlibpath=
4082+ convenience=
4083+ old_convenience=
4084+ deplibs=
4085+ old_deplibs=
4086+ compiler_flags=
4087+ linker_flags=
4088+ dllsearchpath=
4089+ lib_search_path=`pwd`
4090+ inst_prefix_dir=
4091+ new_inherited_linker_flags=
4092+
4093+ avoid_version=no
4094+ dlfiles=
4095+ dlprefiles=
4096+ dlself=no
4097+ export_dynamic=no
4098+ export_symbols=
4099+ export_symbols_regex=
4100+ generated=
4101+ libobjs=
4102+ ltlibs=
4103+ module=no
4104+ no_install=no
4105+ objs=
4106+ non_pic_objects=
4107+ precious_files_regex=
4108+ prefer_static_libs=no
4109+ preload=no
4110+ prev=
4111+ prevarg=
4112+ release=
4113+ rpath=
4114+ xrpath=
4115+ perm_rpath=
4116+ temp_rpath=
4117+ thread_safe=no
4118+ vinfo=
4119+ vinfo_number=no
4120+ weak_libs=
4121+ single_module="${wl}-single_module"
4122+ func_infer_tag $base_compile
4123+
4124+ # We need to know -static, to get the right output filenames.
4125+ for arg
4126+ do
4127+ case $arg in
4128+ -shared)
4129+ test "$build_libtool_libs" != yes && \
4130+ func_fatal_configuration "can not build a shared library"
4131+ build_old_libs=no
4132+ break
4133+ ;;
4134+ -all-static | -static | -static-libtool-libs)
4135+ case $arg in
4136+ -all-static)
4137+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
4138+ func_warning "complete static linking is impossible in this configuration"
4139+ fi
4140+ if test -n "$link_static_flag"; then
4141+ dlopen_self=$dlopen_self_static
4142+ fi
4143+ prefer_static_libs=yes
4144+ ;;
4145+ -static)
4146+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
4147+ dlopen_self=$dlopen_self_static
4148+ fi
4149+ prefer_static_libs=built
4150+ ;;
4151+ -static-libtool-libs)
4152+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
4153+ dlopen_self=$dlopen_self_static
4154+ fi
4155+ prefer_static_libs=yes
4156+ ;;
4157+ esac
4158+ build_libtool_libs=no
4159+ build_old_libs=yes
4160+ break
4161+ ;;
4162+ esac
4163+ done
4164+
4165+ # See if our shared archives depend on static archives.
4166+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
4167+
4168+ # Go through the arguments, transforming them on the way.
4169+ while test "$#" -gt 0; do
4170+ arg="$1"
4171+ shift
4172+ func_quote_for_eval "$arg"
4173+ qarg=$func_quote_for_eval_unquoted_result
4174+ func_append libtool_args " $func_quote_for_eval_result"
4175+
4176+ # If the previous option needs an argument, assign it.
4177+ if test -n "$prev"; then
4178+ case $prev in
4179+ output)
4180+ func_append compile_command " @OUTPUT@"
4181+ func_append finalize_command " @OUTPUT@"
4182+ ;;
4183+ esac
4184+
4185+ case $prev in
4186+ dlfiles|dlprefiles)
4187+ if test "$preload" = no; then
4188+ # Add the symbol object into the linking commands.
4189+ func_append compile_command " @SYMFILE@"
4190+ func_append finalize_command " @SYMFILE@"
4191+ preload=yes
4192+ fi
4193+ case $arg in
4194+ *.la | *.lo) ;; # We handle these cases below.
4195+ force)
4196+ if test "$dlself" = no; then
4197+ dlself=needless
4198+ export_dynamic=yes
4199+ fi
4200+ prev=
4201+ continue
4202+ ;;
4203+ self)
4204+ if test "$prev" = dlprefiles; then
4205+ dlself=yes
4206+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
4207+ dlself=yes
4208+ else
4209+ dlself=needless
4210+ export_dynamic=yes
4211+ fi
4212+ prev=
4213+ continue
4214+ ;;
4215+ *)
4216+ if test "$prev" = dlfiles; then
4217+ dlfiles="$dlfiles $arg"
4218+ else
4219+ dlprefiles="$dlprefiles $arg"
4220+ fi
4221+ prev=
4222+ continue
4223+ ;;
4224+ esac
4225+ ;;
4226+ expsyms)
4227+ export_symbols="$arg"
4228+ test -f "$arg" \
4229+ || func_fatal_error "symbol file \`$arg' does not exist"
4230+ prev=
4231+ continue
4232+ ;;
4233+ expsyms_regex)
4234+ export_symbols_regex="$arg"
4235+ prev=
4236+ continue
4237+ ;;
4238+ framework)
4239+ case $host in
4240+ *-*-darwin*)
4241+ case "$deplibs " in
4242+ *" $qarg.ltframework "*) ;;
4243+ *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
4244+ ;;
4245+ esac
4246+ ;;
4247+ esac
4248+ prev=
4249+ continue
4250+ ;;
4251+ inst_prefix)
4252+ inst_prefix_dir="$arg"
4253+ prev=
4254+ continue
4255+ ;;
4256+ objectlist)
4257+ if test -f "$arg"; then
4258+ save_arg=$arg
4259+ moreargs=
4260+ for fil in `cat "$save_arg"`
4261+ do
4262+# moreargs="$moreargs $fil"
4263+ arg=$fil
4264+ # A libtool-controlled object.
4265+
4266+ # Check to see that this really is a libtool object.
4267+ if func_lalib_unsafe_p "$arg"; then
4268+ pic_object=
4269+ non_pic_object=
4270+
4271+ # Read the .lo file
4272+ func_source "$arg"
4273+
4274+ if test -z "$pic_object" ||
4275+ test -z "$non_pic_object" ||
4276+ test "$pic_object" = none &&
4277+ test "$non_pic_object" = none; then
4278+ func_fatal_error "cannot find name of object for \`$arg'"
4279+ fi
4280+
4281+ # Extract subdirectory from the argument.
4282+ func_dirname "$arg" "/" ""
4283+ xdir="$func_dirname_result"
4284+
4285+ if test "$pic_object" != none; then
4286+ # Prepend the subdirectory the object is found in.
4287+ pic_object="$xdir$pic_object"
4288+
4289+ if test "$prev" = dlfiles; then
4290+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4291+ dlfiles="$dlfiles $pic_object"
4292+ prev=
4293+ continue
4294+ else
4295+ # If libtool objects are unsupported, then we need to preload.
4296+ prev=dlprefiles
4297+ fi
4298+ fi
4299+
4300+ # CHECK ME: I think I busted this. -Ossama
4301+ if test "$prev" = dlprefiles; then
4302+ # Preload the old-style object.
4303+ dlprefiles="$dlprefiles $pic_object"
4304+ prev=
4305+ fi
4306+
4307+ # A PIC object.
4308+ func_append libobjs " $pic_object"
4309+ arg="$pic_object"
4310+ fi
4311+
4312+ # Non-PIC object.
4313+ if test "$non_pic_object" != none; then
4314+ # Prepend the subdirectory the object is found in.
4315+ non_pic_object="$xdir$non_pic_object"
4316+
4317+ # A standard non-PIC object
4318+ func_append non_pic_objects " $non_pic_object"
4319+ if test -z "$pic_object" || test "$pic_object" = none ; then
4320+ arg="$non_pic_object"
4321+ fi
4322+ else
4323+ # If the PIC object exists, use it instead.
4324+ # $xdir was prepended to $pic_object above.
4325+ non_pic_object="$pic_object"
4326+ func_append non_pic_objects " $non_pic_object"
4327+ fi
4328+ else
4329+ # Only an error if not doing a dry-run.
4330+ if $opt_dry_run; then
4331+ # Extract subdirectory from the argument.
4332+ func_dirname "$arg" "/" ""
4333+ xdir="$func_dirname_result"
4334+
4335+ func_lo2o "$arg"
4336+ pic_object=$xdir$objdir/$func_lo2o_result
4337+ non_pic_object=$xdir$func_lo2o_result
4338+ func_append libobjs " $pic_object"
4339+ func_append non_pic_objects " $non_pic_object"
4340+ else
4341+ func_fatal_error "\`$arg' is not a valid libtool object"
4342+ fi
4343+ fi
4344+ done
4345+ else
4346+ func_fatal_error "link input file \`$arg' does not exist"
4347+ fi
4348+ arg=$save_arg
4349+ prev=
4350+ continue
4351+ ;;
4352+ precious_regex)
4353+ precious_files_regex="$arg"
4354+ prev=
4355+ continue
4356+ ;;
4357+ release)
4358+ release="-$arg"
4359+ prev=
4360+ continue
4361+ ;;
4362+ rpath | xrpath)
4363+ # We need an absolute path.
4364+ case $arg in
4365+ [\\/]* | [A-Za-z]:[\\/]*) ;;
4366+ *)
4367+ func_fatal_error "only absolute run-paths are allowed"
4368+ ;;
4369+ esac
4370+ if test "$prev" = rpath; then
4371+ case "$rpath " in
4372+ *" $arg "*) ;;
4373+ *) rpath="$rpath $arg" ;;
4374+ esac
4375+ else
4376+ case "$xrpath " in
4377+ *" $arg "*) ;;
4378+ *) xrpath="$xrpath $arg" ;;
4379+ esac
4380+ fi
4381+ prev=
4382+ continue
4383+ ;;
4384+ shrext)
4385+ shrext_cmds="$arg"
4386+ prev=
4387+ continue
4388+ ;;
4389+ weak)
4390+ weak_libs="$weak_libs $arg"
4391+ prev=
4392+ continue
4393+ ;;
4394+ xcclinker)
4395+ linker_flags="$linker_flags $qarg"
4396+ compiler_flags="$compiler_flags $qarg"
4397+ prev=
4398+ func_append compile_command " $qarg"
4399+ func_append finalize_command " $qarg"
4400+ continue
4401+ ;;
4402+ xcompiler)
4403+ compiler_flags="$compiler_flags $qarg"
4404+ prev=
4405+ func_append compile_command " $qarg"
4406+ func_append finalize_command " $qarg"
4407+ continue
4408+ ;;
4409+ xlinker)
4410+ linker_flags="$linker_flags $qarg"
4411+ compiler_flags="$compiler_flags $wl$qarg"
4412+ prev=
4413+ func_append compile_command " $wl$qarg"
4414+ func_append finalize_command " $wl$qarg"
4415+ continue
4416+ ;;
4417+ *)
4418+ eval "$prev=\"\$arg\""
4419+ prev=
4420+ continue
4421+ ;;
4422+ esac
4423+ fi # test -n "$prev"
4424+
4425+ prevarg="$arg"
4426+
4427+ case $arg in
4428+ -all-static)
4429+ if test -n "$link_static_flag"; then
4430+ # See comment for -static flag below, for more details.
4431+ func_append compile_command " $link_static_flag"
4432+ func_append finalize_command " $link_static_flag"
4433+ fi
4434+ continue
4435+ ;;
4436+
4437+ -allow-undefined)
4438+ # FIXME: remove this flag sometime in the future.
4439+ func_fatal_error "\`-allow-undefined' must not be used because it is the default"
4440+ ;;
4441+
4442+ -avoid-version)
4443+ avoid_version=yes
4444+ continue
4445+ ;;
4446+
4447+ -dlopen)
4448+ prev=dlfiles
4449+ continue
4450+ ;;
4451+
4452+ -dlpreopen)
4453+ prev=dlprefiles
4454+ continue
4455+ ;;
4456+
4457+ -export-dynamic)
4458+ export_dynamic=yes
4459+ continue
4460+ ;;
4461+
4462+ -export-symbols | -export-symbols-regex)
4463+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
4464+ func_fatal_error "more than one -exported-symbols argument is not allowed"
4465+ fi
4466+ if test "X$arg" = "X-export-symbols"; then
4467+ prev=expsyms
4468+ else
4469+ prev=expsyms_regex
4470+ fi
4471+ continue
4472+ ;;
4473+
4474+ -framework)
4475+ prev=framework
4476+ continue
4477+ ;;
4478+
4479+ -inst-prefix-dir)
4480+ prev=inst_prefix
4481+ continue
4482+ ;;
4483+
4484+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
4485+ # so, if we see these flags be careful not to treat them like -L
4486+ -L[A-Z][A-Z]*:*)
4487+ case $with_gcc/$host in
4488+ no/*-*-irix* | /*-*-irix*)
4489+ func_append compile_command " $arg"
4490+ func_append finalize_command " $arg"
4491+ ;;
4492+ esac
4493+ continue
4494+ ;;
4495+
4496+ -L*)
4497+ func_stripname '-L' '' "$arg"
4498+ dir=$func_stripname_result
4499+ if test -z "$dir"; then
4500+ if test "$#" -gt 0; then
4501+ func_fatal_error "require no space between \`-L' and \`$1'"
4502+ else
4503+ func_fatal_error "need path for \`-L' option"
4504+ fi
4505+ fi
4506+ # We need an absolute path.
4507+ case $dir in
4508+ [\\/]* | [A-Za-z]:[\\/]*) ;;
4509+ *)
4510+ absdir=`cd "$dir" && pwd`
4511+ test -z "$absdir" && \
4512+ func_fatal_error "cannot determine absolute directory name of \`$dir'"
4513+ dir="$absdir"
4514+ ;;
4515+ esac
4516+ case "$deplibs " in
4517+ *" -L$dir "*) ;;
4518+ *)
4519+ deplibs="$deplibs -L$dir"
4520+ lib_search_path="$lib_search_path $dir"
4521+ ;;
4522+ esac
4523+ case $host in
4524+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
4525+ testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
4526+ case :$dllsearchpath: in
4527+ *":$dir:"*) ;;
4528+ ::) dllsearchpath=$dir;;
4529+ *) dllsearchpath="$dllsearchpath:$dir";;
4530+ esac
4531+ case :$dllsearchpath: in
4532+ *":$testbindir:"*) ;;
4533+ ::) dllsearchpath=$testbindir;;
4534+ *) dllsearchpath="$dllsearchpath:$testbindir";;
4535+ esac
4536+ ;;
4537+ esac
4538+ continue
4539+ ;;
4540+
4541+ -l*)
4542+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
4543+ case $host in
4544+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
4545+ # These systems don't actually have a C or math library (as such)
4546+ continue
4547+ ;;
4548+ *-*-os2*)
4549+ # These systems don't actually have a C library (as such)
4550+ test "X$arg" = "X-lc" && continue
4551+ ;;
4552+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4553+ # Do not include libc due to us having libc/libc_r.
4554+ test "X$arg" = "X-lc" && continue
4555+ ;;
4556+ *-*-rhapsody* | *-*-darwin1.[012])
4557+ # Rhapsody C and math libraries are in the System framework
4558+ deplibs="$deplibs System.ltframework"
4559+ continue
4560+ ;;
4561+ *-*-sco3.2v5* | *-*-sco5v6*)
4562+ # Causes problems with __ctype
4563+ test "X$arg" = "X-lc" && continue
4564+ ;;
4565+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
4566+ # Compiler inserts libc in the correct place for threads to work
4567+ test "X$arg" = "X-lc" && continue
4568+ ;;
4569+ esac
4570+ elif test "X$arg" = "X-lc_r"; then
4571+ case $host in
4572+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
4573+ # Do not include libc_r directly, use -pthread flag.
4574+ continue
4575+ ;;
4576+ esac
4577+ fi
4578+ deplibs="$deplibs $arg"
4579+ continue
4580+ ;;
4581+
4582+ -module)
4583+ module=yes
4584+ continue
4585+ ;;
4586+
4587+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
4588+ # classes, name mangling, and exception handling.
4589+ # Darwin uses the -arch flag to determine output architecture.
4590+ -model|-arch|-isysroot)
4591+ compiler_flags="$compiler_flags $arg"
4592+ func_append compile_command " $arg"
4593+ func_append finalize_command " $arg"
4594+ prev=xcompiler
4595+ continue
4596+ ;;
4597+
4598+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
4599+ compiler_flags="$compiler_flags $arg"
4600+ func_append compile_command " $arg"
4601+ func_append finalize_command " $arg"
4602+ case "$new_inherited_linker_flags " in
4603+ *" $arg "*) ;;
4604+ * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
4605+ esac
4606+ continue
4607+ ;;
4608+
4609+ -multi_module)
4610+ single_module="${wl}-multi_module"
4611+ continue
4612+ ;;
4613+
4614+ -no-fast-install)
4615+ fast_install=no
4616+ continue
4617+ ;;
4618+
4619+ -no-install)
4620+ case $host in
4621+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
4622+ # The PATH hackery in wrapper scripts is required on Windows
4623+ # and Darwin in order for the loader to find any dlls it needs.
4624+ func_warning "\`-no-install' is ignored for $host"
4625+ func_warning "assuming \`-no-fast-install' instead"
4626+ fast_install=no
4627+ ;;
4628+ *) no_install=yes ;;
4629+ esac
4630+ continue
4631+ ;;
4632+
4633+ -no-undefined)
4634+ allow_undefined=no
4635+ continue
4636+ ;;
4637+
4638+ -objectlist)
4639+ prev=objectlist
4640+ continue
4641+ ;;
4642+
4643+ -o) prev=output ;;
4644+
4645+ -precious-files-regex)
4646+ prev=precious_regex
4647+ continue
4648+ ;;
4649+
4650+ -release)
4651+ prev=release
4652+ continue
4653+ ;;
4654+
4655+ -rpath)
4656+ prev=rpath
4657+ continue
4658+ ;;
4659+
4660+ -R)
4661+ prev=xrpath
4662+ continue
4663+ ;;
4664+
4665+ -R*)
4666+ func_stripname '-R' '' "$arg"
4667+ dir=$func_stripname_result
4668+ # We need an absolute path.
4669+ case $dir in
4670+ [\\/]* | [A-Za-z]:[\\/]*) ;;
4671+ *)
4672+ func_fatal_error "only absolute run-paths are allowed"
4673+ ;;
4674+ esac
4675+ case "$xrpath " in
4676+ *" $dir "*) ;;
4677+ *) xrpath="$xrpath $dir" ;;
4678+ esac
4679+ continue
4680+ ;;
4681+
4682+ -shared)
4683+ # The effects of -shared are defined in a previous loop.
4684+ continue
4685+ ;;
4686+
4687+ -shrext)
4688+ prev=shrext
4689+ continue
4690+ ;;
4691+
4692+ -static | -static-libtool-libs)
4693+ # The effects of -static are defined in a previous loop.
4694+ # We used to do the same as -all-static on platforms that
4695+ # didn't have a PIC flag, but the assumption that the effects
4696+ # would be equivalent was wrong. It would break on at least
4697+ # Digital Unix and AIX.
4698+ continue
4699+ ;;
4700+
4701+ -thread-safe)
4702+ thread_safe=yes
4703+ continue
4704+ ;;
4705+
4706+ -version-info)
4707+ prev=vinfo
4708+ continue
4709+ ;;
4710+
4711+ -version-number)
4712+ prev=vinfo
4713+ vinfo_number=yes
4714+ continue
4715+ ;;
4716+
4717+ -weak)
4718+ prev=weak
4719+ continue
4720+ ;;
4721+
4722+ -Wc,*)
4723+ func_stripname '-Wc,' '' "$arg"
4724+ args=$func_stripname_result
4725+ arg=
4726+ save_ifs="$IFS"; IFS=','
4727+ for flag in $args; do
4728+ IFS="$save_ifs"
4729+ func_quote_for_eval "$flag"
4730+ arg="$arg $wl$func_quote_for_eval_result"
4731+ compiler_flags="$compiler_flags $func_quote_for_eval_result"
4732+ done
4733+ IFS="$save_ifs"
4734+ func_stripname ' ' '' "$arg"
4735+ arg=$func_stripname_result
4736+ ;;
4737+
4738+ -Wl,*)
4739+ func_stripname '-Wl,' '' "$arg"
4740+ args=$func_stripname_result
4741+ arg=
4742+ save_ifs="$IFS"; IFS=','
4743+ for flag in $args; do
4744+ IFS="$save_ifs"
4745+ func_quote_for_eval "$flag"
4746+ arg="$arg $wl$func_quote_for_eval_result"
4747+ compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
4748+ linker_flags="$linker_flags $func_quote_for_eval_result"
4749+ done
4750+ IFS="$save_ifs"
4751+ func_stripname ' ' '' "$arg"
4752+ arg=$func_stripname_result
4753+ ;;
4754+
4755+ -Xcompiler)
4756+ prev=xcompiler
4757+ continue
4758+ ;;
4759+
4760+ -Xlinker)
4761+ prev=xlinker
4762+ continue
4763+ ;;
4764+
4765+ -XCClinker)
4766+ prev=xcclinker
4767+ continue
4768+ ;;
4769+
4770+ # -msg_* for osf cc
4771+ -msg_*)
4772+ func_quote_for_eval "$arg"
4773+ arg="$func_quote_for_eval_result"
4774+ ;;
4775+
4776+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
4777+ # -r[0-9][0-9]* specifies the processor on the SGI compiler
4778+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
4779+ # +DA*, +DD* enable 64-bit mode on the HP compiler
4780+ # -q* pass through compiler args for the IBM compiler
4781+ # -m*, -t[45]*, -txscale* pass through architecture-specific
4782+ # compiler args for GCC
4783+ # -F/path gives path to uninstalled frameworks, gcc on darwin
4784+ # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
4785+ # @file GCC response files
4786+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
4787+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
4788+ func_quote_for_eval "$arg"
4789+ arg="$func_quote_for_eval_result"
4790+ func_append compile_command " $arg"
4791+ func_append finalize_command " $arg"
4792+ compiler_flags="$compiler_flags $arg"
4793+ continue
4794+ ;;
4795+
4796+ # Some other compiler flag.
4797+ -* | +*)
4798+ func_quote_for_eval "$arg"
4799+ arg="$func_quote_for_eval_result"
4800+ ;;
4801+
4802+ *.$objext)
4803+ # A standard object.
4804+ objs="$objs $arg"
4805+ ;;
4806+
4807+ *.lo)
4808+ # A libtool-controlled object.
4809+
4810+ # Check to see that this really is a libtool object.
4811+ if func_lalib_unsafe_p "$arg"; then
4812+ pic_object=
4813+ non_pic_object=
4814+
4815+ # Read the .lo file
4816+ func_source "$arg"
4817+
4818+ if test -z "$pic_object" ||
4819+ test -z "$non_pic_object" ||
4820+ test "$pic_object" = none &&
4821+ test "$non_pic_object" = none; then
4822+ func_fatal_error "cannot find name of object for \`$arg'"
4823+ fi
4824+
4825+ # Extract subdirectory from the argument.
4826+ func_dirname "$arg" "/" ""
4827+ xdir="$func_dirname_result"
4828+
4829+ if test "$pic_object" != none; then
4830+ # Prepend the subdirectory the object is found in.
4831+ pic_object="$xdir$pic_object"
4832+
4833+ if test "$prev" = dlfiles; then
4834+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
4835+ dlfiles="$dlfiles $pic_object"
4836+ prev=
4837+ continue
4838+ else
4839+ # If libtool objects are unsupported, then we need to preload.
4840+ prev=dlprefiles
4841+ fi
4842+ fi
4843+
4844+ # CHECK ME: I think I busted this. -Ossama
4845+ if test "$prev" = dlprefiles; then
4846+ # Preload the old-style object.
4847+ dlprefiles="$dlprefiles $pic_object"
4848+ prev=
4849+ fi
4850+
4851+ # A PIC object.
4852+ func_append libobjs " $pic_object"
4853+ arg="$pic_object"
4854+ fi
4855+
4856+ # Non-PIC object.
4857+ if test "$non_pic_object" != none; then
4858+ # Prepend the subdirectory the object is found in.
4859+ non_pic_object="$xdir$non_pic_object"
4860+
4861+ # A standard non-PIC object
4862+ func_append non_pic_objects " $non_pic_object"
4863+ if test -z "$pic_object" || test "$pic_object" = none ; then
4864+ arg="$non_pic_object"
4865+ fi
4866+ else
4867+ # If the PIC object exists, use it instead.
4868+ # $xdir was prepended to $pic_object above.
4869+ non_pic_object="$pic_object"
4870+ func_append non_pic_objects " $non_pic_object"
4871+ fi
4872+ else
4873+ # Only an error if not doing a dry-run.
4874+ if $opt_dry_run; then
4875+ # Extract subdirectory from the argument.
4876+ func_dirname "$arg" "/" ""
4877+ xdir="$func_dirname_result"
4878+
4879+ func_lo2o "$arg"
4880+ pic_object=$xdir$objdir/$func_lo2o_result
4881+ non_pic_object=$xdir$func_lo2o_result
4882+ func_append libobjs " $pic_object"
4883+ func_append non_pic_objects " $non_pic_object"
4884+ else
4885+ func_fatal_error "\`$arg' is not a valid libtool object"
4886+ fi
4887+ fi
4888+ ;;
4889+
4890+ *.$libext)
4891+ # An archive.
4892+ deplibs="$deplibs $arg"
4893+ old_deplibs="$old_deplibs $arg"
4894+ continue
4895+ ;;
4896+
4897+ *.la)
4898+ # A libtool-controlled library.
4899+
4900+ if test "$prev" = dlfiles; then
4901+ # This library was specified with -dlopen.
4902+ dlfiles="$dlfiles $arg"
4903+ prev=
4904+ elif test "$prev" = dlprefiles; then
4905+ # The library was specified with -dlpreopen.
4906+ dlprefiles="$dlprefiles $arg"
4907+ prev=
4908+ else
4909+ deplibs="$deplibs $arg"
4910+ fi
4911+ continue
4912+ ;;
4913+
4914+ # Some other compiler argument.
4915+ *)
4916+ # Unknown arguments in both finalize_command and compile_command need
4917+ # to be aesthetically quoted because they are evaled later.
4918+ func_quote_for_eval "$arg"
4919+ arg="$func_quote_for_eval_result"
4920+ ;;
4921+ esac # arg
4922+
4923+ # Now actually substitute the argument into the commands.
4924+ if test -n "$arg"; then
4925+ func_append compile_command " $arg"
4926+ func_append finalize_command " $arg"
4927+ fi
4928+ done # argument parsing loop
4929+
4930+ test -n "$prev" && \
4931+ func_fatal_help "the \`$prevarg' option requires an argument"
4932+
4933+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
4934+ eval arg=\"$export_dynamic_flag_spec\"
4935+ func_append compile_command " $arg"
4936+ func_append finalize_command " $arg"
4937+ fi
4938+
4939+ oldlibs=
4940+ # calculate the name of the file, without its directory
4941+ func_basename "$output"
4942+ outputname="$func_basename_result"
4943+ libobjs_save="$libobjs"
4944+
4945+ if test -n "$shlibpath_var"; then
4946+ # get the directories listed in $shlibpath_var
4947+ eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
4948+ else
4949+ shlib_search_path=
4950+ fi
4951+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
4952+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
4953+
4954+ func_dirname "$output" "/" ""
4955+ output_objdir="$func_dirname_result$objdir"
4956+ # Create the object directory.
4957+ func_mkdir_p "$output_objdir"
4958+
4959+ # Determine the type of output
4960+ case $output in
4961+ "")
4962+ func_fatal_help "you must specify an output file"
4963+ ;;
4964+ *.$libext) linkmode=oldlib ;;
4965+ *.lo | *.$objext) linkmode=obj ;;
4966+ *.la) linkmode=lib ;;
4967+ *) linkmode=prog ;; # Anything else should be a program.
4968+ esac
4969+
4970+ specialdeplibs=
4971+
4972+ libs=
4973+ # Find all interdependent deplibs by searching for libraries
4974+ # that are linked more than once (e.g. -la -lb -la)
4975+ for deplib in $deplibs; do
4976+ if $opt_duplicate_deps ; then
4977+ case "$libs " in
4978+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
4979+ esac
4980+ fi
4981+ libs="$libs $deplib"
4982+ done
4983+
4984+ if test "$linkmode" = lib; then
4985+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
4986+
4987+ # Compute libraries that are listed more than once in $predeps
4988+ # $postdeps and mark them as special (i.e., whose duplicates are
4989+ # not to be eliminated).
4990+ pre_post_deps=
4991+ if $opt_duplicate_compiler_generated_deps; then
4992+ for pre_post_dep in $predeps $postdeps; do
4993+ case "$pre_post_deps " in
4994+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
4995+ esac
4996+ pre_post_deps="$pre_post_deps $pre_post_dep"
4997+ done
4998+ fi
4999+ pre_post_deps=
5000+ fi
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: