Merge lp:~mordred/libdrizzle/pandora-build into lp:~drizzle-trunk/libdrizzle/classic

Proposed by Monty Taylor
Status: Merged
Merged at revision: not available
Proposed branch: lp:~mordred/libdrizzle/pandora-build
Merge into: lp:~drizzle-trunk/libdrizzle/classic
Diff against target: 17768 lines
32 files modified
.bzrignore (+1/-0)
config/autorun.sh (+58/-3)
config/ltmain.sh (+0/-8406)
m4/libtool.m4 (+0/-7373)
m4/ltoptions.m4 (+0/-368)
m4/ltsugar.m4 (+0/-123)
m4/ltversion.m4 (+0/-23)
m4/lt~obsolete.m4 (+0/-92)
m4/pandora_64bit.m4 (+12/-3)
m4/pandora_canonical.m4 (+18/-4)
m4/pandora_enable_dtrace.m4 (+4/-2)
m4/pandora_ensure_gcc_version.m4 (+4/-1)
m4/pandora_extensions.m4 (+16/-94)
m4/pandora_have_better_malloc.m4 (+10/-2)
m4/pandora_have_innodb.m4 (+41/-0)
m4/pandora_have_libmemcached.m4 (+1/-1)
m4/pandora_have_protobuf.m4 (+13/-7)
m4/pandora_platform.m4 (+12/-3)
m4/pandora_plugins.m4 (+41/-0)
m4/pandora_pthread.m4 (+47/-3)
m4/pandora_python3_devel.m4 (+236/-0)
m4/pandora_swig.m4 (+18/-11)
m4/pandora_use_pipe.m4 (+36/-0)
m4/pandora_vc_build.m4 (+25/-0)
m4/pandora_warnings.m4 (+44/-2)
m4/pandora_with_lua.m4 (+15/-5)
m4/pandora_with_perl.m4 (+53/-10)
m4/pandora_with_php.m4 (+1/-1)
m4/pandora_with_python.m4 (+1/-1)
m4/pandora_with_python3.m4 (+22/-13)
m4/pandora_with_r.m4 (+1/-1)
m4/pandora_with_ruby.m4 (+1/-1)
To merge this branch: bzr merge lp:~mordred/libdrizzle/pandora-build
Reviewer Review Type Date Requested Status
Eric Day Pending
Review via email: mp+12961@code.launchpad.net

This proposal supersedes a proposal from 2009-08-10.

To post a comment you must log in.
Revision history for this message
Monty Taylor (mordred) wrote : Posted in a previous version of this proposal

updated to latest pandora-build

Preview Diff

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

Subscribers

People subscribed via source and target branches