diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch')
-rw-r--r-- | meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch | 7115 |
1 files changed, 7115 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch b/meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch new file mode 100644 index 0000000000..c71e19ecb4 --- /dev/null +++ b/meta/recipes-devtools/binutils/binutils/0007-Use-libtool-2.4.patch | |||
@@ -0,0 +1,7115 @@ | |||
1 | From 3a2e7ec956568c503a678385ebee17098337feab Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sun, 14 Feb 2016 17:04:07 +0000 | ||
4 | Subject: [PATCH] Use libtool 2.4 | ||
5 | |||
6 | get libtool sysroot support | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | bfd/configure.ac | 2 +- | ||
13 | libtool.m4 | 1080 +++++++++++------ | ||
14 | ltmain.sh | 2925 +++++++++++++++++++++++++++++++--------------- | ||
15 | ltoptions.m4 | 2 +- | ||
16 | ltversion.m4 | 12 +- | ||
17 | lt~obsolete.m4 | 2 +- | ||
18 | 6 files changed, 2717 insertions(+), 1306 deletions(-) | ||
19 | |||
20 | diff --git a/bfd/configure.ac b/bfd/configure.ac | ||
21 | index af4d4b8c13..a521738244 100644 | ||
22 | --- a/bfd/configure.ac | ||
23 | +++ b/bfd/configure.ac | ||
24 | @@ -296,7 +296,7 @@ changequote(,)dnl | ||
25 | x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` | ||
26 | changequote([,])dnl | ||
27 | if test -n "$x"; then | ||
28 | - SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty" | ||
29 | + SHARED_LIBADD="`pwd`/../libiberty/pic/libiberty.a" | ||
30 | fi | ||
31 | |||
32 | case "${host}" in | ||
33 | diff --git a/libtool.m4 b/libtool.m4 | ||
34 | index 434530059f..e45fdc6998 100644 | ||
35 | --- a/libtool.m4 | ||
36 | +++ b/libtool.m4 | ||
37 | @@ -1,7 +1,8 @@ | ||
38 | # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- | ||
39 | # | ||
40 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, | ||
41 | -# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. | ||
42 | +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, | ||
43 | +# Inc. | ||
44 | # Written by Gordon Matzigkeit, 1996 | ||
45 | # | ||
46 | # This file is free software; the Free Software Foundation gives | ||
47 | @@ -10,7 +11,8 @@ | ||
48 | |||
49 | m4_define([_LT_COPYING], [dnl | ||
50 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, | ||
51 | -# 2006, 2007, 2008, 2009 Free Software Foundation, Inc. | ||
52 | +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, | ||
53 | +# Inc. | ||
54 | # Written by Gordon Matzigkeit, 1996 | ||
55 | # | ||
56 | # This file is part of GNU Libtool. | ||
57 | @@ -37,7 +39,7 @@ m4_define([_LT_COPYING], [dnl | ||
58 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
59 | ]) | ||
60 | |||
61 | -# serial 56 LT_INIT | ||
62 | +# serial 57 LT_INIT | ||
63 | |||
64 | |||
65 | # LT_PREREQ(VERSION) | ||
66 | @@ -92,7 +94,8 @@ _LT_SET_OPTIONS([$0], [$1]) | ||
67 | LIBTOOL_DEPS="$ltmain" | ||
68 | |||
69 | # Always use our own libtool. | ||
70 | -LIBTOOL='$(SHELL) $(top_builddir)/libtool' | ||
71 | +LIBTOOL='$(SHELL) $(top_builddir)' | ||
72 | +LIBTOOL="$LIBTOOL/${host_alias}-libtool" | ||
73 | AC_SUBST(LIBTOOL)dnl | ||
74 | |||
75 | _LT_SETUP | ||
76 | @@ -166,10 +169,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl | ||
77 | dnl | ||
78 | m4_require([_LT_FILEUTILS_DEFAULTS])dnl | ||
79 | m4_require([_LT_CHECK_SHELL_FEATURES])dnl | ||
80 | +m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl | ||
81 | m4_require([_LT_CMD_RELOAD])dnl | ||
82 | m4_require([_LT_CHECK_MAGIC_METHOD])dnl | ||
83 | +m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl | ||
84 | m4_require([_LT_CMD_OLD_ARCHIVE])dnl | ||
85 | m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl | ||
86 | +m4_require([_LT_WITH_SYSROOT])dnl | ||
87 | |||
88 | _LT_CONFIG_LIBTOOL_INIT([ | ||
89 | # See if we are running on zsh, and set the options which allow our | ||
90 | @@ -199,7 +205,7 @@ aix3*) | ||
91 | esac | ||
92 | |||
93 | # Global variables: | ||
94 | -ofile=libtool | ||
95 | +ofile=${host_alias}-libtool | ||
96 | can_build_shared=yes | ||
97 | |||
98 | # All known linkers require a `.a' archive for static linking (except MSVC, | ||
99 | @@ -632,7 +638,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl | ||
100 | m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) | ||
101 | configured by $[0], generated by m4_PACKAGE_STRING. | ||
102 | |||
103 | -Copyright (C) 2009 Free Software Foundation, Inc. | ||
104 | +Copyright (C) 2010 Free Software Foundation, Inc. | ||
105 | This config.lt script is free software; the Free Software Foundation | ||
106 | gives unlimited permision to copy, distribute and modify it." | ||
107 | |||
108 | @@ -746,15 +752,12 @@ _LT_EOF | ||
109 | # if finds mixed CR/LF and LF-only lines. Since sed operates in | ||
110 | # text mode, it properly converts lines to CR/LF. This bash problem | ||
111 | # is reportedly fixed, but why not run on old versions too? | ||
112 | - sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ | ||
113 | - || (rm -f "$cfgfile"; exit 1) | ||
114 | + sed '$q' "$ltmain" >> "$cfgfile" \ | ||
115 | + || (rm -f "$cfgfile"; exit 1) | ||
116 | |||
117 | - _LT_PROG_XSI_SHELLFNS | ||
118 | + _LT_PROG_REPLACE_SHELLFNS | ||
119 | |||
120 | - sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ | ||
121 | - || (rm -f "$cfgfile"; exit 1) | ||
122 | - | ||
123 | - mv -f "$cfgfile" "$ofile" || | ||
124 | + mv -f "$cfgfile" "$ofile" || | ||
125 | (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") | ||
126 | chmod +x "$ofile" | ||
127 | ], | ||
128 | @@ -980,6 +983,8 @@ _LT_EOF | ||
129 | $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD | ||
130 | echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD | ||
131 | $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD | ||
132 | + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD | ||
133 | + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD | ||
134 | cat > conftest.c << _LT_EOF | ||
135 | int main() { return 0;} | ||
136 | _LT_EOF | ||
137 | @@ -1069,30 +1074,41 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES], | ||
138 | fi | ||
139 | ]) | ||
140 | |||
141 | -# _LT_SYS_MODULE_PATH_AIX | ||
142 | -# ----------------------- | ||
143 | +# _LT_SYS_MODULE_PATH_AIX([TAGNAME]) | ||
144 | +# ---------------------------------- | ||
145 | # Links a minimal program and checks the executable | ||
146 | # for the system default hardcoded library path. In most cases, | ||
147 | # this is /usr/lib:/lib, but when the MPI compilers are used | ||
148 | # the location of the communication and MPI libs are included too. | ||
149 | # If we don't find anything, use the default library path according | ||
150 | # to the aix ld manual. | ||
151 | +# Store the results from the different compilers for each TAGNAME. | ||
152 | +# Allow to override them for all tags through lt_cv_aix_libpath. | ||
153 | m4_defun([_LT_SYS_MODULE_PATH_AIX], | ||
154 | [m4_require([_LT_DECL_SED])dnl | ||
155 | -AC_LINK_IFELSE([AC_LANG_SOURCE([AC_LANG_PROGRAM])],[ | ||
156 | -lt_aix_libpath_sed=' | ||
157 | - /Import File Strings/,/^$/ { | ||
158 | - /^0/ { | ||
159 | - s/^0 *\(.*\)$/\1/ | ||
160 | - p | ||
161 | - } | ||
162 | - }' | ||
163 | -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` | ||
164 | -# Check for a 64-bit object if we didn't find anything. | ||
165 | -if test -z "$aix_libpath"; then | ||
166 | - aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` | ||
167 | -fi],[]) | ||
168 | -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi | ||
169 | +if test "${lt_cv_aix_libpath+set}" = set; then | ||
170 | + aix_libpath=$lt_cv_aix_libpath | ||
171 | +else | ||
172 | + AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], | ||
173 | + [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ | ||
174 | + lt_aix_libpath_sed='[ | ||
175 | + /Import File Strings/,/^$/ { | ||
176 | + /^0/ { | ||
177 | + s/^0 *\([^ ]*\) *$/\1/ | ||
178 | + p | ||
179 | + } | ||
180 | + }]' | ||
181 | + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` | ||
182 | + # Check for a 64-bit object if we didn't find anything. | ||
183 | + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then | ||
184 | + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` | ||
185 | + fi],[]) | ||
186 | + if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then | ||
187 | + _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" | ||
188 | + fi | ||
189 | + ]) | ||
190 | + aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) | ||
191 | +fi | ||
192 | ])# _LT_SYS_MODULE_PATH_AIX | ||
193 | |||
194 | |||
195 | @@ -1117,7 +1133,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO | ||
196 | |||
197 | AC_MSG_CHECKING([how to print strings]) | ||
198 | # Test print first, because it will be a builtin if present. | ||
199 | -if test "X`print -r -- -n 2>/dev/null`" = X-n && \ | ||
200 | +if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ | ||
201 | test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then | ||
202 | ECHO='print -r --' | ||
203 | elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then | ||
204 | @@ -1161,6 +1177,39 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) | ||
205 | ])# _LT_PROG_ECHO_BACKSLASH | ||
206 | |||
207 | |||
208 | +# _LT_WITH_SYSROOT | ||
209 | +# ---------------- | ||
210 | +AC_DEFUN([_LT_WITH_SYSROOT], | ||
211 | +[AC_MSG_CHECKING([for sysroot]) | ||
212 | +AC_ARG_WITH([libtool-sysroot], | ||
213 | +[ --with-libtool-sysroot[=DIR] Search for dependent libraries within DIR | ||
214 | + (or the compiler's sysroot if not specified).], | ||
215 | +[], [with_libtool_sysroot=no]) | ||
216 | + | ||
217 | +dnl lt_sysroot will always be passed unquoted. We quote it here | ||
218 | +dnl in case the user passed a directory name. | ||
219 | +lt_sysroot= | ||
220 | +case ${with_libtool_sysroot} in #( | ||
221 | + yes) | ||
222 | + if test "$GCC" = yes; then | ||
223 | + lt_sysroot=`$CC --print-sysroot 2>/dev/null` | ||
224 | + fi | ||
225 | + ;; #( | ||
226 | + /*) | ||
227 | + lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"` | ||
228 | + ;; #( | ||
229 | + no|'') | ||
230 | + ;; #( | ||
231 | + *) | ||
232 | + AC_MSG_RESULT([${with_libtool_sysroot}]) | ||
233 | + AC_MSG_ERROR([The sysroot must be an absolute path.]) | ||
234 | + ;; | ||
235 | +esac | ||
236 | + | ||
237 | + AC_MSG_RESULT([${lt_sysroot:-no}]) | ||
238 | +_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl | ||
239 | +[dependent libraries, and in which our libraries should be installed.])]) | ||
240 | + | ||
241 | # _LT_ENABLE_LOCK | ||
242 | # --------------- | ||
243 | m4_defun([_LT_ENABLE_LOCK], | ||
244 | @@ -1320,14 +1369,47 @@ need_locks="$enable_libtool_lock" | ||
245 | ])# _LT_ENABLE_LOCK | ||
246 | |||
247 | |||
248 | +# _LT_PROG_AR | ||
249 | +# ----------- | ||
250 | +m4_defun([_LT_PROG_AR], | ||
251 | +[AC_CHECK_TOOLS(AR, [ar], false) | ||
252 | +: ${AR=ar} | ||
253 | +: ${AR_FLAGS=cru} | ||
254 | +_LT_DECL([], [AR], [1], [The archiver]) | ||
255 | +_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) | ||
256 | + | ||
257 | +AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], | ||
258 | + [lt_cv_ar_at_file=no | ||
259 | + AC_COMPILE_IFELSE([AC_LANG_PROGRAM], | ||
260 | + [echo conftest.$ac_objext > conftest.lst | ||
261 | + lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' | ||
262 | + AC_TRY_EVAL([lt_ar_try]) | ||
263 | + if test "$ac_status" -eq 0; then | ||
264 | + # Ensure the archiver fails upon bogus file names. | ||
265 | + rm -f conftest.$ac_objext libconftest.a | ||
266 | + AC_TRY_EVAL([lt_ar_try]) | ||
267 | + if test "$ac_status" -ne 0; then | ||
268 | + lt_cv_ar_at_file=@ | ||
269 | + fi | ||
270 | + fi | ||
271 | + rm -f conftest.* libconftest.a | ||
272 | + ]) | ||
273 | + ]) | ||
274 | + | ||
275 | +if test "x$lt_cv_ar_at_file" = xno; then | ||
276 | + archiver_list_spec= | ||
277 | +else | ||
278 | + archiver_list_spec=$lt_cv_ar_at_file | ||
279 | +fi | ||
280 | +_LT_DECL([], [archiver_list_spec], [1], | ||
281 | + [How to feed a file listing to the archiver]) | ||
282 | +])# _LT_PROG_AR | ||
283 | + | ||
284 | + | ||
285 | # _LT_CMD_OLD_ARCHIVE | ||
286 | # ------------------- | ||
287 | m4_defun([_LT_CMD_OLD_ARCHIVE], | ||
288 | -[AC_CHECK_TOOL(AR, ar, false) | ||
289 | -test -z "$AR" && AR=ar | ||
290 | -test -z "$AR_FLAGS" && AR_FLAGS=cru | ||
291 | -_LT_DECL([], [AR], [1], [The archiver]) | ||
292 | -_LT_DECL([], [AR_FLAGS], [1]) | ||
293 | +[_LT_PROG_AR | ||
294 | |||
295 | AC_CHECK_TOOL(STRIP, strip, :) | ||
296 | test -z "$STRIP" && STRIP=: | ||
297 | @@ -1623,7 +1705,7 @@ else | ||
298 | lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 | ||
299 | lt_status=$lt_dlunknown | ||
300 | cat > conftest.$ac_ext <<_LT_EOF | ||
301 | -[#line __oline__ "configure" | ||
302 | +[#line $LINENO "configure" | ||
303 | #include "confdefs.h" | ||
304 | |||
305 | #if HAVE_DLFCN_H | ||
306 | @@ -1667,10 +1749,10 @@ else | ||
307 | /* When -fvisbility=hidden is used, assume the code has been annotated | ||
308 | correspondingly for the symbols needed. */ | ||
309 | #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) | ||
310 | -void fnord () __attribute__((visibility("default"))); | ||
311 | +int fnord () __attribute__((visibility("default"))); | ||
312 | #endif | ||
313 | |||
314 | -void fnord () { int i=42; } | ||
315 | +int fnord () { return 42; } | ||
316 | int main () | ||
317 | { | ||
318 | void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); | ||
319 | @@ -2210,8 +2292,9 @@ cygwin* | mingw* | pw32* | cegcc*) | ||
320 | need_version=no | ||
321 | need_lib_prefix=no | ||
322 | |||
323 | - case $GCC,$host_os in | ||
324 | - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) | ||
325 | + case $GCC,$cc_basename in | ||
326 | + yes,*) | ||
327 | + # gcc | ||
328 | library_names_spec='$libname.dll.a' | ||
329 | # DLL is installed to $(libdir)/../bin by postinstall_cmds | ||
330 | postinstall_cmds='base_file=`basename \${file}`~ | ||
331 | @@ -2244,13 +2327,71 @@ m4_if([$1], [],[ | ||
332 | library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' | ||
333 | ;; | ||
334 | esac | ||
335 | + dynamic_linker='Win32 ld.exe' | ||
336 | + ;; | ||
337 | + | ||
338 | + *,cl*) | ||
339 | + # Native MSVC | ||
340 | + libname_spec='$name' | ||
341 | + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' | ||
342 | + library_names_spec='${libname}.dll.lib' | ||
343 | + | ||
344 | + case $build_os in | ||
345 | + mingw*) | ||
346 | + sys_lib_search_path_spec= | ||
347 | + lt_save_ifs=$IFS | ||
348 | + IFS=';' | ||
349 | + for lt_path in $LIB | ||
350 | + do | ||
351 | + IFS=$lt_save_ifs | ||
352 | + # Let DOS variable expansion print the short 8.3 style file name. | ||
353 | + lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` | ||
354 | + sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" | ||
355 | + done | ||
356 | + IFS=$lt_save_ifs | ||
357 | + # Convert to MSYS style. | ||
358 | + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` | ||
359 | + ;; | ||
360 | + cygwin*) | ||
361 | + # Convert to unix form, then to dos form, then back to unix form | ||
362 | + # but this time dos style (no spaces!) so that the unix form looks | ||
363 | + # like /cygdrive/c/PROGRA~1:/cygdr... | ||
364 | + sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` | ||
365 | + sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` | ||
366 | + sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` | ||
367 | + ;; | ||
368 | + *) | ||
369 | + sys_lib_search_path_spec="$LIB" | ||
370 | + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then | ||
371 | + # It is most probably a Windows format PATH. | ||
372 | + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` | ||
373 | + else | ||
374 | + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` | ||
375 | + fi | ||
376 | + # FIXME: find the short name or the path components, as spaces are | ||
377 | + # common. (e.g. "Program Files" -> "PROGRA~1") | ||
378 | + ;; | ||
379 | + esac | ||
380 | + | ||
381 | + # DLL is installed to $(libdir)/../bin by postinstall_cmds | ||
382 | + postinstall_cmds='base_file=`basename \${file}`~ | ||
383 | + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ | ||
384 | + dldir=$destdir/`dirname \$dlpath`~ | ||
385 | + test -d \$dldir || mkdir -p \$dldir~ | ||
386 | + $install_prog $dir/$dlname \$dldir/$dlname' | ||
387 | + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ | ||
388 | + dlpath=$dir/\$dldll~ | ||
389 | + $RM \$dlpath' | ||
390 | + shlibpath_overrides_runpath=yes | ||
391 | + dynamic_linker='Win32 link.exe' | ||
392 | ;; | ||
393 | |||
394 | *) | ||
395 | + # Assume MSVC wrapper | ||
396 | library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' | ||
397 | + dynamic_linker='Win32 ld.exe' | ||
398 | ;; | ||
399 | esac | ||
400 | - dynamic_linker='Win32 ld.exe' | ||
401 | # FIXME: first we should search . and the directory the executable is in | ||
402 | shlibpath_var=PATH | ||
403 | ;; | ||
404 | @@ -2342,7 +2483,7 @@ haiku*) | ||
405 | soname_spec='${libname}${release}${shared_ext}$major' | ||
406 | shlibpath_var=LIBRARY_PATH | ||
407 | shlibpath_overrides_runpath=yes | ||
408 | - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib' | ||
409 | + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' | ||
410 | hardcode_into_libs=yes | ||
411 | ;; | ||
412 | |||
413 | @@ -2950,6 +3091,11 @@ case $reload_flag in | ||
414 | esac | ||
415 | reload_cmds='$LD$reload_flag -o $output$reload_objs' | ||
416 | case $host_os in | ||
417 | + cygwin* | mingw* | pw32* | cegcc*) | ||
418 | + if test "$GCC" != yes; then | ||
419 | + reload_cmds=false | ||
420 | + fi | ||
421 | + ;; | ||
422 | darwin*) | ||
423 | if test "$GCC" = yes; then | ||
424 | reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' | ||
425 | @@ -3016,7 +3162,8 @@ mingw* | pw32*) | ||
426 | lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' | ||
427 | lt_cv_file_magic_cmd='func_win32_libid' | ||
428 | else | ||
429 | - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' | ||
430 | + # Keep this pattern in sync with the one in func_win32_libid. | ||
431 | + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' | ||
432 | lt_cv_file_magic_cmd='$OBJDUMP -f' | ||
433 | fi | ||
434 | ;; | ||
435 | @@ -3167,6 +3314,21 @@ tpf*) | ||
436 | ;; | ||
437 | esac | ||
438 | ]) | ||
439 | + | ||
440 | +file_magic_glob= | ||
441 | +want_nocaseglob=no | ||
442 | +if test "$build" = "$host"; then | ||
443 | + case $host_os in | ||
444 | + mingw* | pw32*) | ||
445 | + if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then | ||
446 | + want_nocaseglob=yes | ||
447 | + else | ||
448 | + file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` | ||
449 | + fi | ||
450 | + ;; | ||
451 | + esac | ||
452 | +fi | ||
453 | + | ||
454 | file_magic_cmd=$lt_cv_file_magic_cmd | ||
455 | deplibs_check_method=$lt_cv_deplibs_check_method | ||
456 | test -z "$deplibs_check_method" && deplibs_check_method=unknown | ||
457 | @@ -3174,7 +3336,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown | ||
458 | _LT_DECL([], [deplibs_check_method], [1], | ||
459 | [Method to check whether dependent libraries are shared objects]) | ||
460 | _LT_DECL([], [file_magic_cmd], [1], | ||
461 | - [Command to use when deplibs_check_method == "file_magic"]) | ||
462 | + [Command to use when deplibs_check_method = "file_magic"]) | ||
463 | +_LT_DECL([], [file_magic_glob], [1], | ||
464 | + [How to find potential files when deplibs_check_method = "file_magic"]) | ||
465 | +_LT_DECL([], [want_nocaseglob], [1], | ||
466 | + [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) | ||
467 | ])# _LT_CHECK_MAGIC_METHOD | ||
468 | |||
469 | |||
470 | @@ -3277,6 +3443,67 @@ dnl aclocal-1.4 backwards compatibility: | ||
471 | dnl AC_DEFUN([AM_PROG_NM], []) | ||
472 | dnl AC_DEFUN([AC_PROG_NM], []) | ||
473 | |||
474 | +# _LT_CHECK_SHAREDLIB_FROM_LINKLIB | ||
475 | +# -------------------------------- | ||
476 | +# how to determine the name of the shared library | ||
477 | +# associated with a specific link library. | ||
478 | +# -- PORTME fill in with the dynamic library characteristics | ||
479 | +m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], | ||
480 | +[m4_require([_LT_DECL_EGREP]) | ||
481 | +m4_require([_LT_DECL_OBJDUMP]) | ||
482 | +m4_require([_LT_DECL_DLLTOOL]) | ||
483 | +AC_CACHE_CHECK([how to associate runtime and link libraries], | ||
484 | +lt_cv_sharedlib_from_linklib_cmd, | ||
485 | +[lt_cv_sharedlib_from_linklib_cmd='unknown' | ||
486 | + | ||
487 | +case $host_os in | ||
488 | +cygwin* | mingw* | pw32* | cegcc*) | ||
489 | + # two different shell functions defined in ltmain.sh | ||
490 | + # decide which to use based on capabilities of $DLLTOOL | ||
491 | + case `$DLLTOOL --help 2>&1` in | ||
492 | + *--identify-strict*) | ||
493 | + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib | ||
494 | + ;; | ||
495 | + *) | ||
496 | + lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback | ||
497 | + ;; | ||
498 | + esac | ||
499 | + ;; | ||
500 | +*) | ||
501 | + # fallback: assume linklib IS sharedlib | ||
502 | + lt_cv_sharedlib_from_linklib_cmd="$ECHO" | ||
503 | + ;; | ||
504 | +esac | ||
505 | +]) | ||
506 | +sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd | ||
507 | +test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO | ||
508 | + | ||
509 | +_LT_DECL([], [sharedlib_from_linklib_cmd], [1], | ||
510 | + [Command to associate shared and link libraries]) | ||
511 | +])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB | ||
512 | + | ||
513 | + | ||
514 | +# _LT_PATH_MANIFEST_TOOL | ||
515 | +# ---------------------- | ||
516 | +# locate the manifest tool | ||
517 | +m4_defun([_LT_PATH_MANIFEST_TOOL], | ||
518 | +[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) | ||
519 | +test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt | ||
520 | +AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], | ||
521 | + [lt_cv_path_mainfest_tool=no | ||
522 | + echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD | ||
523 | + $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out | ||
524 | + cat conftest.err >&AS_MESSAGE_LOG_FD | ||
525 | + if $GREP 'Manifest Tool' conftest.out > /dev/null; then | ||
526 | + lt_cv_path_mainfest_tool=yes | ||
527 | + fi | ||
528 | + rm -f conftest*]) | ||
529 | +if test "x$lt_cv_path_mainfest_tool" != xyes; then | ||
530 | + MANIFEST_TOOL=: | ||
531 | +fi | ||
532 | +_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl | ||
533 | +])# _LT_PATH_MANIFEST_TOOL | ||
534 | + | ||
535 | |||
536 | # LT_LIB_M | ||
537 | # -------- | ||
538 | @@ -3403,8 +3630,8 @@ esac | ||
539 | lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" | ||
540 | |||
541 | # Transform an extracted symbol line into symbol name and symbol address | ||
542 | -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" | ||
543 | -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" | ||
544 | +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" | ||
545 | +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" | ||
546 | |||
547 | # Handle CRLF in mingw tool chain | ||
548 | opt_cr= | ||
549 | @@ -3440,6 +3667,7 @@ for ac_symprfx in "" "_"; do | ||
550 | else | ||
551 | lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" | ||
552 | fi | ||
553 | + lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" | ||
554 | |||
555 | # Check to see that the pipe works correctly. | ||
556 | pipe_works=no | ||
557 | @@ -3473,6 +3701,18 @@ _LT_EOF | ||
558 | if $GREP ' nm_test_var$' "$nlist" >/dev/null; then | ||
559 | if $GREP ' nm_test_func$' "$nlist" >/dev/null; then | ||
560 | cat <<_LT_EOF > conftest.$ac_ext | ||
561 | +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ | ||
562 | +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) | ||
563 | +/* DATA imports from DLLs on WIN32 con't be const, because runtime | ||
564 | + relocations are performed -- see ld's documentation on pseudo-relocs. */ | ||
565 | +# define LT@&t@_DLSYM_CONST | ||
566 | +#elif defined(__osf__) | ||
567 | +/* This system does not cope well with relocations in const data. */ | ||
568 | +# define LT@&t@_DLSYM_CONST | ||
569 | +#else | ||
570 | +# define LT@&t@_DLSYM_CONST const | ||
571 | +#endif | ||
572 | + | ||
573 | #ifdef __cplusplus | ||
574 | extern "C" { | ||
575 | #endif | ||
576 | @@ -3484,7 +3724,7 @@ _LT_EOF | ||
577 | cat <<_LT_EOF >> conftest.$ac_ext | ||
578 | |||
579 | /* The mapping between symbol names and symbols. */ | ||
580 | -const struct { | ||
581 | +LT@&t@_DLSYM_CONST struct { | ||
582 | const char *name; | ||
583 | void *address; | ||
584 | } | ||
585 | @@ -3510,15 +3750,15 @@ static const void *lt_preloaded_setup() { | ||
586 | _LT_EOF | ||
587 | # Now try linking the two files. | ||
588 | mv conftest.$ac_objext conftstm.$ac_objext | ||
589 | - lt_save_LIBS="$LIBS" | ||
590 | - lt_save_CFLAGS="$CFLAGS" | ||
591 | + lt_globsym_save_LIBS=$LIBS | ||
592 | + lt_globsym_save_CFLAGS=$CFLAGS | ||
593 | LIBS="conftstm.$ac_objext" | ||
594 | CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" | ||
595 | if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then | ||
596 | pipe_works=yes | ||
597 | fi | ||
598 | - LIBS="$lt_save_LIBS" | ||
599 | - CFLAGS="$lt_save_CFLAGS" | ||
600 | + LIBS=$lt_globsym_save_LIBS | ||
601 | + CFLAGS=$lt_globsym_save_CFLAGS | ||
602 | else | ||
603 | echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD | ||
604 | fi | ||
605 | @@ -3551,6 +3791,13 @@ else | ||
606 | AC_MSG_RESULT(ok) | ||
607 | fi | ||
608 | |||
609 | +# Response file support. | ||
610 | +if test "$lt_cv_nm_interface" = "MS dumpbin"; then | ||
611 | + nm_file_list_spec='@' | ||
612 | +elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then | ||
613 | + nm_file_list_spec='@' | ||
614 | +fi | ||
615 | + | ||
616 | _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], | ||
617 | [Take the output of nm and produce a listing of raw symbols and C names]) | ||
618 | _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], | ||
619 | @@ -3561,6 +3808,8 @@ _LT_DECL([global_symbol_to_c_name_address], | ||
620 | _LT_DECL([global_symbol_to_c_name_address_lib_prefix], | ||
621 | [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], | ||
622 | [Transform the output of nm in a C name address pair when lib prefix is needed]) | ||
623 | +_LT_DECL([], [nm_file_list_spec], [1], | ||
624 | + [Specify filename containing input files for $NM]) | ||
625 | ]) # _LT_CMD_GLOBAL_SYMBOLS | ||
626 | |||
627 | |||
628 | @@ -3572,7 +3821,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)= | ||
629 | _LT_TAGVAR(lt_prog_compiler_pic, $1)= | ||
630 | _LT_TAGVAR(lt_prog_compiler_static, $1)= | ||
631 | |||
632 | -AC_MSG_CHECKING([for $compiler option to produce PIC]) | ||
633 | m4_if([$1], [CXX], [ | ||
634 | # C++ specific cases for pic, static, wl, etc. | ||
635 | if test "$GXX" = yes; then | ||
636 | @@ -3678,6 +3926,12 @@ m4_if([$1], [CXX], [ | ||
637 | ;; | ||
638 | esac | ||
639 | ;; | ||
640 | + mingw* | cygwin* | os2* | pw32* | cegcc*) | ||
641 | + # This hack is so that the source file can tell whether it is being | ||
642 | + # built for inclusion in a dll (and should export symbols for example). | ||
643 | + m4_if([$1], [GCJ], [], | ||
644 | + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) | ||
645 | + ;; | ||
646 | dgux*) | ||
647 | case $cc_basename in | ||
648 | ec++*) | ||
649 | @@ -3830,7 +4084,7 @@ m4_if([$1], [CXX], [ | ||
650 | ;; | ||
651 | solaris*) | ||
652 | case $cc_basename in | ||
653 | - CC*) | ||
654 | + CC* | sunCC*) | ||
655 | # Sun C++ 4.2, 5.x and Centerline C++ | ||
656 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' | ||
657 | _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' | ||
658 | @@ -4053,6 +4307,12 @@ m4_if([$1], [CXX], [ | ||
659 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' | ||
660 | _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' | ||
661 | ;; | ||
662 | + nagfor*) | ||
663 | + # NAG Fortran compiler | ||
664 | + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' | ||
665 | + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' | ||
666 | + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' | ||
667 | + ;; | ||
668 | pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) | ||
669 | # Portland Group compilers (*not* the Pentium gcc compiler, | ||
670 | # which looks to be a dead project) | ||
671 | @@ -4115,7 +4375,7 @@ m4_if([$1], [CXX], [ | ||
672 | _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' | ||
673 | _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' | ||
674 | case $cc_basename in | ||
675 | - f77* | f90* | f95*) | ||
676 | + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) | ||
677 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; | ||
678 | *) | ||
679 | _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; | ||
680 | @@ -4172,9 +4432,11 @@ case $host_os in | ||
681 | _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" | ||
682 | ;; | ||
683 | esac | ||
684 | -AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) | ||
685 | -_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], | ||
686 | - [How to pass a linker flag through the compiler]) | ||
687 | + | ||
688 | +AC_CACHE_CHECK([for $compiler option to produce PIC], | ||
689 | + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], | ||
690 | + [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) | ||
691 | +_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) | ||
692 | |||
693 | # | ||
694 | # Check to make sure the PIC flag actually works. | ||
695 | @@ -4193,6 +4455,8 @@ fi | ||
696 | _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], | ||
697 | [Additional compiler flags for building library objects]) | ||
698 | |||
699 | +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], | ||
700 | + [How to pass a linker flag through the compiler]) | ||
701 | # | ||
702 | # Check to make sure the static flag actually works. | ||
703 | # | ||
704 | @@ -4213,6 +4477,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], | ||
705 | m4_defun([_LT_LINKER_SHLIBS], | ||
706 | [AC_REQUIRE([LT_PATH_LD])dnl | ||
707 | AC_REQUIRE([LT_PATH_NM])dnl | ||
708 | +m4_require([_LT_PATH_MANIFEST_TOOL])dnl | ||
709 | m4_require([_LT_FILEUTILS_DEFAULTS])dnl | ||
710 | m4_require([_LT_DECL_EGREP])dnl | ||
711 | m4_require([_LT_DECL_SED])dnl | ||
712 | @@ -4221,6 +4486,7 @@ m4_require([_LT_TAG_COMPILER])dnl | ||
713 | AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) | ||
714 | m4_if([$1], [CXX], [ | ||
715 | _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' | ||
716 | + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] | ||
717 | case $host_os in | ||
718 | aix[[4-9]]*) | ||
719 | # If we're using GNU nm, then we don't want the "-C" option. | ||
720 | @@ -4235,15 +4501,20 @@ m4_if([$1], [CXX], [ | ||
721 | ;; | ||
722 | pw32*) | ||
723 | _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" | ||
724 | - ;; | ||
725 | + ;; | ||
726 | cygwin* | mingw* | cegcc*) | ||
727 | - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' | ||
728 | - ;; | ||
729 | + case $cc_basename in | ||
730 | + cl*) ;; | ||
731 | + *) | ||
732 | + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' | ||
733 | + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] | ||
734 | + ;; | ||
735 | + esac | ||
736 | + ;; | ||
737 | *) | ||
738 | _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' | ||
739 | - ;; | ||
740 | + ;; | ||
741 | esac | ||
742 | - _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] | ||
743 | ], [ | ||
744 | runpath_var= | ||
745 | _LT_TAGVAR(allow_undefined_flag, $1)= | ||
746 | @@ -4411,7 +4682,8 @@ _LT_EOF | ||
747 | _LT_TAGVAR(allow_undefined_flag, $1)=unsupported | ||
748 | _LT_TAGVAR(always_export_symbols, $1)=no | ||
749 | _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes | ||
750 | - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' | ||
751 | + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' | ||
752 | + _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] | ||
753 | |||
754 | if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then | ||
755 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' | ||
756 | @@ -4510,12 +4782,12 @@ _LT_EOF | ||
757 | _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' | ||
758 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= | ||
759 | _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' | ||
760 | - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' | ||
761 | + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' | ||
762 | if test "x$supports_anon_versioning" = xyes; then | ||
763 | _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ | ||
764 | cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ | ||
765 | echo "local: *; };" >> $output_objdir/$libname.ver~ | ||
766 | - $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' | ||
767 | + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' | ||
768 | fi | ||
769 | ;; | ||
770 | esac | ||
771 | @@ -4529,8 +4801,8 @@ _LT_EOF | ||
772 | _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' | ||
773 | wlarc= | ||
774 | else | ||
775 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' | ||
776 | - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' | ||
777 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' | ||
778 | + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' | ||
779 | fi | ||
780 | ;; | ||
781 | |||
782 | @@ -4548,8 +4820,8 @@ _LT_EOF | ||
783 | |||
784 | _LT_EOF | ||
785 | elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then | ||
786 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' | ||
787 | - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' | ||
788 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' | ||
789 | + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' | ||
790 | else | ||
791 | _LT_TAGVAR(ld_shlibs, $1)=no | ||
792 | fi | ||
793 | @@ -4595,8 +4867,8 @@ _LT_EOF | ||
794 | |||
795 | *) | ||
796 | if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then | ||
797 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' | ||
798 | - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' | ||
799 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' | ||
800 | + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' | ||
801 | else | ||
802 | _LT_TAGVAR(ld_shlibs, $1)=no | ||
803 | fi | ||
804 | @@ -4726,7 +4998,7 @@ _LT_EOF | ||
805 | _LT_TAGVAR(allow_undefined_flag, $1)='-berok' | ||
806 | # Determine the default libpath from the value encoded in an | ||
807 | # empty executable. | ||
808 | - _LT_SYS_MODULE_PATH_AIX | ||
809 | + _LT_SYS_MODULE_PATH_AIX([$1]) | ||
810 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" | ||
811 | _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" | ||
812 | else | ||
813 | @@ -4737,7 +5009,7 @@ _LT_EOF | ||
814 | else | ||
815 | # Determine the default libpath from the value encoded in an | ||
816 | # empty executable. | ||
817 | - _LT_SYS_MODULE_PATH_AIX | ||
818 | + _LT_SYS_MODULE_PATH_AIX([$1]) | ||
819 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" | ||
820 | # Warning - without using the other run time loading flags, | ||
821 | # -berok will link without error, but may produce a broken library. | ||
822 | @@ -4781,20 +5053,63 @@ _LT_EOF | ||
823 | # Microsoft Visual C++. | ||
824 | # hardcode_libdir_flag_spec is actually meaningless, as there is | ||
825 | # no search path for DLLs. | ||
826 | - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' | ||
827 | - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported | ||
828 | - # Tell ltmain to make .lib files, not .a files. | ||
829 | - libext=lib | ||
830 | - # Tell ltmain to make .dll files, not .so files. | ||
831 | - shrext_cmds=".dll" | ||
832 | - # FIXME: Setting linknames here is a bad hack. | ||
833 | - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' | ||
834 | - # The linker will automatically build a .lib file if we build a DLL. | ||
835 | - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' | ||
836 | - # FIXME: Should let the user specify the lib program. | ||
837 | - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' | ||
838 | - _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' | ||
839 | - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes | ||
840 | + case $cc_basename in | ||
841 | + cl*) | ||
842 | + # Native MSVC | ||
843 | + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' | ||
844 | + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported | ||
845 | + _LT_TAGVAR(always_export_symbols, $1)=yes | ||
846 | + _LT_TAGVAR(file_list_spec, $1)='@' | ||
847 | + # Tell ltmain to make .lib files, not .a files. | ||
848 | + libext=lib | ||
849 | + # Tell ltmain to make .dll files, not .so files. | ||
850 | + shrext_cmds=".dll" | ||
851 | + # FIXME: Setting linknames here is a bad hack. | ||
852 | + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' | ||
853 | + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then | ||
854 | + sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; | ||
855 | + else | ||
856 | + sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; | ||
857 | + fi~ | ||
858 | + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ | ||
859 | + linknames=' | ||
860 | + # The linker will not automatically build a static lib if we build a DLL. | ||
861 | + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' | ||
862 | + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes | ||
863 | + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' | ||
864 | + # Don't use ranlib | ||
865 | + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' | ||
866 | + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ | ||
867 | + lt_tool_outputfile="@TOOL_OUTPUT@"~ | ||
868 | + case $lt_outputfile in | ||
869 | + *.exe|*.EXE) ;; | ||
870 | + *) | ||
871 | + lt_outputfile="$lt_outputfile.exe" | ||
872 | + lt_tool_outputfile="$lt_tool_outputfile.exe" | ||
873 | + ;; | ||
874 | + esac~ | ||
875 | + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then | ||
876 | + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; | ||
877 | + $RM "$lt_outputfile.manifest"; | ||
878 | + fi' | ||
879 | + ;; | ||
880 | + *) | ||
881 | + # Assume MSVC wrapper | ||
882 | + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' | ||
883 | + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported | ||
884 | + # Tell ltmain to make .lib files, not .a files. | ||
885 | + libext=lib | ||
886 | + # Tell ltmain to make .dll files, not .so files. | ||
887 | + shrext_cmds=".dll" | ||
888 | + # FIXME: Setting linknames here is a bad hack. | ||
889 | + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' | ||
890 | + # The linker will automatically build a .lib file if we build a DLL. | ||
891 | + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' | ||
892 | + # FIXME: Should let the user specify the lib program. | ||
893 | + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' | ||
894 | + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes | ||
895 | + ;; | ||
896 | + esac | ||
897 | ;; | ||
898 | |||
899 | darwin* | rhapsody*) | ||
900 | @@ -4828,7 +5143,7 @@ _LT_EOF | ||
901 | |||
902 | # FreeBSD 3 and greater uses gcc -shared to do shared libraries. | ||
903 | freebsd* | dragonfly*) | ||
904 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' | ||
905 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' | ||
906 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' | ||
907 | _LT_TAGVAR(hardcode_direct, $1)=yes | ||
908 | _LT_TAGVAR(hardcode_shlibpath_var, $1)=no | ||
909 | @@ -4836,7 +5151,7 @@ _LT_EOF | ||
910 | |||
911 | hpux9*) | ||
912 | if test "$GCC" = yes; then | ||
913 | - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' | ||
914 | + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' | ||
915 | else | ||
916 | _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' | ||
917 | fi | ||
918 | @@ -4852,7 +5167,7 @@ _LT_EOF | ||
919 | |||
920 | hpux10*) | ||
921 | if test "$GCC" = yes && test "$with_gnu_ld" = no; then | ||
922 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' | ||
923 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' | ||
924 | else | ||
925 | _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' | ||
926 | fi | ||
927 | @@ -4876,10 +5191,10 @@ _LT_EOF | ||
928 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' | ||
929 | ;; | ||
930 | ia64*) | ||
931 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' | ||
932 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' | ||
933 | ;; | ||
934 | *) | ||
935 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' | ||
936 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' | ||
937 | ;; | ||
938 | esac | ||
939 | else | ||
940 | @@ -4926,16 +5241,31 @@ _LT_EOF | ||
941 | |||
942 | irix5* | irix6* | nonstopux*) | ||
943 | if test "$GCC" = yes; then | ||
944 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' | ||
945 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' | ||
946 | # Try to use the -exported_symbol ld option, if it does not | ||
947 | # work, assume that -exports_file does not work either and | ||
948 | # implicitly export all symbols. | ||
949 | - save_LDFLAGS="$LDFLAGS" | ||
950 | - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" | ||
951 | - AC_LINK_IFELSE([AC_LANG_SOURCE([int foo(void) {}])], | ||
952 | - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' | ||
953 | - ) | ||
954 | - LDFLAGS="$save_LDFLAGS" | ||
955 | + # This should be the same for all languages, so no per-tag cache variable. | ||
956 | + AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], | ||
957 | + [lt_cv_irix_exported_symbol], | ||
958 | + [save_LDFLAGS="$LDFLAGS" | ||
959 | + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" | ||
960 | + AC_LINK_IFELSE( | ||
961 | + [AC_LANG_SOURCE( | ||
962 | + [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], | ||
963 | + [C++], [[int foo (void) { return 0; }]], | ||
964 | + [Fortran 77], [[ | ||
965 | + subroutine foo | ||
966 | + end]], | ||
967 | + [Fortran], [[ | ||
968 | + subroutine foo | ||
969 | + end]])])], | ||
970 | + [lt_cv_irix_exported_symbol=yes], | ||
971 | + [lt_cv_irix_exported_symbol=no]) | ||
972 | + LDFLAGS="$save_LDFLAGS"]) | ||
973 | + if test "$lt_cv_irix_exported_symbol" = yes; then | ||
974 | + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' | ||
975 | + fi | ||
976 | else | ||
977 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' | ||
978 | _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' | ||
979 | @@ -5020,7 +5350,7 @@ _LT_EOF | ||
980 | osf4* | osf5*) # as osf3* with the addition of -msym flag | ||
981 | if test "$GCC" = yes; then | ||
982 | _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' | ||
983 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' | ||
984 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' | ||
985 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' | ||
986 | else | ||
987 | _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' | ||
988 | @@ -5039,9 +5369,9 @@ _LT_EOF | ||
989 | _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' | ||
990 | if test "$GCC" = yes; then | ||
991 | wlarc='${wl}' | ||
992 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' | ||
993 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' | ||
994 | _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ | ||
995 | - $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' | ||
996 | + $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' | ||
997 | else | ||
998 | case `$CC -V 2>&1` in | ||
999 | *"Compilers 5.0"*) | ||
1000 | @@ -5313,8 +5643,6 @@ _LT_TAGDECL([], [inherit_rpath], [0], | ||
1001 | to runtime path list]) | ||
1002 | _LT_TAGDECL([], [link_all_deplibs], [0], | ||
1003 | [Whether libtool must link a program against all its dependency libraries]) | ||
1004 | -_LT_TAGDECL([], [fix_srcfile_path], [1], | ||
1005 | - [Fix the shell variable $srcfile for the compiler]) | ||
1006 | _LT_TAGDECL([], [always_export_symbols], [0], | ||
1007 | [Set to "yes" if exported symbols are required]) | ||
1008 | _LT_TAGDECL([], [export_symbols_cmds], [2], | ||
1009 | @@ -5325,6 +5653,8 @@ _LT_TAGDECL([], [include_expsyms], [1], | ||
1010 | [Symbols that must always be exported]) | ||
1011 | _LT_TAGDECL([], [prelink_cmds], [2], | ||
1012 | [Commands necessary for linking programs (against libraries) with templates]) | ||
1013 | +_LT_TAGDECL([], [postlink_cmds], [2], | ||
1014 | + [Commands necessary for finishing linking programs]) | ||
1015 | _LT_TAGDECL([], [file_list_spec], [1], | ||
1016 | [Specify filename containing input files]) | ||
1017 | dnl FIXME: Not yet implemented | ||
1018 | @@ -5426,6 +5756,7 @@ CC="$lt_save_CC" | ||
1019 | m4_defun([_LT_LANG_CXX_CONFIG], | ||
1020 | [m4_require([_LT_FILEUTILS_DEFAULTS])dnl | ||
1021 | m4_require([_LT_DECL_EGREP])dnl | ||
1022 | +m4_require([_LT_PATH_MANIFEST_TOOL])dnl | ||
1023 | if test -n "$CXX" && ( test "X$CXX" != "Xno" && | ||
1024 | ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || | ||
1025 | (test "X$CXX" != "Xg++"))) ; then | ||
1026 | @@ -5487,6 +5818,7 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1027 | |||
1028 | # Allow CC to be a program name with arguments. | ||
1029 | lt_save_CC=$CC | ||
1030 | + lt_save_CFLAGS=$CFLAGS | ||
1031 | lt_save_LD=$LD | ||
1032 | lt_save_GCC=$GCC | ||
1033 | GCC=$GXX | ||
1034 | @@ -5504,6 +5836,7 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1035 | fi | ||
1036 | test -z "${LDCXX+set}" || LD=$LDCXX | ||
1037 | CC=${CXX-"c++"} | ||
1038 | + CFLAGS=$CXXFLAGS | ||
1039 | compiler=$CC | ||
1040 | _LT_TAGVAR(compiler, $1)=$CC | ||
1041 | _LT_CC_BASENAME([$compiler]) | ||
1042 | @@ -5667,7 +6000,7 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1043 | _LT_TAGVAR(allow_undefined_flag, $1)='-berok' | ||
1044 | # Determine the default libpath from the value encoded in an empty | ||
1045 | # executable. | ||
1046 | - _LT_SYS_MODULE_PATH_AIX | ||
1047 | + _LT_SYS_MODULE_PATH_AIX([$1]) | ||
1048 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" | ||
1049 | |||
1050 | _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" | ||
1051 | @@ -5679,7 +6012,7 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1052 | else | ||
1053 | # Determine the default libpath from the value encoded in an | ||
1054 | # empty executable. | ||
1055 | - _LT_SYS_MODULE_PATH_AIX | ||
1056 | + _LT_SYS_MODULE_PATH_AIX([$1]) | ||
1057 | _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" | ||
1058 | # Warning - without using the other run time loading flags, | ||
1059 | # -berok will link without error, but may produce a broken library. | ||
1060 | @@ -5721,29 +6054,75 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1061 | ;; | ||
1062 | |||
1063 | cygwin* | mingw* | pw32* | cegcc*) | ||
1064 | - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, | ||
1065 | - # as there is no search path for DLLs. | ||
1066 | - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' | ||
1067 | - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' | ||
1068 | - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported | ||
1069 | - _LT_TAGVAR(always_export_symbols, $1)=no | ||
1070 | - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes | ||
1071 | - | ||
1072 | - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then | ||
1073 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' | ||
1074 | - # If the export-symbols file already is a .def file (1st line | ||
1075 | - # is EXPORTS), use it as is; otherwise, prepend... | ||
1076 | - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then | ||
1077 | - cp $export_symbols $output_objdir/$soname.def; | ||
1078 | - else | ||
1079 | - echo EXPORTS > $output_objdir/$soname.def; | ||
1080 | - cat $export_symbols >> $output_objdir/$soname.def; | ||
1081 | - fi~ | ||
1082 | - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' | ||
1083 | - else | ||
1084 | - _LT_TAGVAR(ld_shlibs, $1)=no | ||
1085 | - fi | ||
1086 | - ;; | ||
1087 | + case $GXX,$cc_basename in | ||
1088 | + ,cl* | no,cl*) | ||
1089 | + # Native MSVC | ||
1090 | + # hardcode_libdir_flag_spec is actually meaningless, as there is | ||
1091 | + # no search path for DLLs. | ||
1092 | + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' | ||
1093 | + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported | ||
1094 | + _LT_TAGVAR(always_export_symbols, $1)=yes | ||
1095 | + _LT_TAGVAR(file_list_spec, $1)='@' | ||
1096 | + # Tell ltmain to make .lib files, not .a files. | ||
1097 | + libext=lib | ||
1098 | + # Tell ltmain to make .dll files, not .so files. | ||
1099 | + shrext_cmds=".dll" | ||
1100 | + # FIXME: Setting linknames here is a bad hack. | ||
1101 | + _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' | ||
1102 | + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then | ||
1103 | + $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; | ||
1104 | + else | ||
1105 | + $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; | ||
1106 | + fi~ | ||
1107 | + $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ | ||
1108 | + linknames=' | ||
1109 | + # The linker will not automatically build a static lib if we build a DLL. | ||
1110 | + # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' | ||
1111 | + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes | ||
1112 | + # Don't use ranlib | ||
1113 | + _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' | ||
1114 | + _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ | ||
1115 | + lt_tool_outputfile="@TOOL_OUTPUT@"~ | ||
1116 | + case $lt_outputfile in | ||
1117 | + *.exe|*.EXE) ;; | ||
1118 | + *) | ||
1119 | + lt_outputfile="$lt_outputfile.exe" | ||
1120 | + lt_tool_outputfile="$lt_tool_outputfile.exe" | ||
1121 | + ;; | ||
1122 | + esac~ | ||
1123 | + func_to_tool_file "$lt_outputfile"~ | ||
1124 | + if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then | ||
1125 | + $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; | ||
1126 | + $RM "$lt_outputfile.manifest"; | ||
1127 | + fi' | ||
1128 | + ;; | ||
1129 | + *) | ||
1130 | + # g++ | ||
1131 | + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, | ||
1132 | + # as there is no search path for DLLs. | ||
1133 | + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' | ||
1134 | + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' | ||
1135 | + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported | ||
1136 | + _LT_TAGVAR(always_export_symbols, $1)=no | ||
1137 | + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes | ||
1138 | + | ||
1139 | + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then | ||
1140 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' | ||
1141 | + # If the export-symbols file already is a .def file (1st line | ||
1142 | + # is EXPORTS), use it as is; otherwise, prepend... | ||
1143 | + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then | ||
1144 | + cp $export_symbols $output_objdir/$soname.def; | ||
1145 | + else | ||
1146 | + echo EXPORTS > $output_objdir/$soname.def; | ||
1147 | + cat $export_symbols >> $output_objdir/$soname.def; | ||
1148 | + fi~ | ||
1149 | + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' | ||
1150 | + else | ||
1151 | + _LT_TAGVAR(ld_shlibs, $1)=no | ||
1152 | + fi | ||
1153 | + ;; | ||
1154 | + esac | ||
1155 | + ;; | ||
1156 | darwin* | rhapsody*) | ||
1157 | _LT_DARWIN_LINKER_FEATURES($1) | ||
1158 | ;; | ||
1159 | @@ -5818,7 +6197,7 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1160 | ;; | ||
1161 | *) | ||
1162 | if test "$GXX" = yes; then | ||
1163 | - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' | ||
1164 | + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' | ||
1165 | else | ||
1166 | # FIXME: insert proper C++ library support | ||
1167 | _LT_TAGVAR(ld_shlibs, $1)=no | ||
1168 | @@ -5889,10 +6268,10 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1169 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' | ||
1170 | ;; | ||
1171 | ia64*) | ||
1172 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' | ||
1173 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' | ||
1174 | ;; | ||
1175 | *) | ||
1176 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' | ||
1177 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' | ||
1178 | ;; | ||
1179 | esac | ||
1180 | fi | ||
1181 | @@ -5933,9 +6312,9 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1182 | *) | ||
1183 | if test "$GXX" = yes; then | ||
1184 | if test "$with_gnu_ld" = no; then | ||
1185 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' | ||
1186 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' | ||
1187 | else | ||
1188 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' | ||
1189 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' | ||
1190 | fi | ||
1191 | fi | ||
1192 | _LT_TAGVAR(link_all_deplibs, $1)=yes | ||
1193 | @@ -6005,20 +6384,20 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1194 | _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ | ||
1195 | rm -rf $tpldir~ | ||
1196 | $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ | ||
1197 | - compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' | ||
1198 | + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' | ||
1199 | _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ | ||
1200 | rm -rf $tpldir~ | ||
1201 | $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ | ||
1202 | - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ | ||
1203 | + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ | ||
1204 | $RANLIB $oldlib' | ||
1205 | _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ | ||
1206 | rm -rf $tpldir~ | ||
1207 | $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ | ||
1208 | - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' | ||
1209 | + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' | ||
1210 | _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ | ||
1211 | rm -rf $tpldir~ | ||
1212 | $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ | ||
1213 | - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' | ||
1214 | + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' | ||
1215 | ;; | ||
1216 | *) # Version 6 and above use weak symbols | ||
1217 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' | ||
1218 | @@ -6213,7 +6592,7 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1219 | _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' | ||
1220 | ;; | ||
1221 | *) | ||
1222 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' | ||
1223 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' | ||
1224 | ;; | ||
1225 | esac | ||
1226 | |||
1227 | @@ -6259,7 +6638,7 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1228 | |||
1229 | solaris*) | ||
1230 | case $cc_basename in | ||
1231 | - CC*) | ||
1232 | + CC* | sunCC*) | ||
1233 | # Sun C++ 4.2, 5.x and Centerline C++ | ||
1234 | _LT_TAGVAR(archive_cmds_need_lc,$1)=yes | ||
1235 | _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' | ||
1236 | @@ -6300,9 +6679,9 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1237 | if test "$GXX" = yes && test "$with_gnu_ld" = no; then | ||
1238 | _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' | ||
1239 | if $CC --version | $GREP -v '^2\.7' > /dev/null; then | ||
1240 | - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' | ||
1241 | + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' | ||
1242 | _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ | ||
1243 | - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' | ||
1244 | + $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' | ||
1245 | |||
1246 | # Commands to make compiler produce verbose output that lists | ||
1247 | # what "hidden" libraries, object files and flags are used when | ||
1248 | @@ -6431,6 +6810,7 @@ if test "$_lt_caught_CXX_error" != yes; then | ||
1249 | fi # test -n "$compiler" | ||
1250 | |||
1251 | CC=$lt_save_CC | ||
1252 | + CFLAGS=$lt_save_CFLAGS | ||
1253 | LDCXX=$LD | ||
1254 | LD=$lt_save_LD | ||
1255 | GCC=$lt_save_GCC | ||
1256 | @@ -6445,6 +6825,29 @@ AC_LANG_POP | ||
1257 | ])# _LT_LANG_CXX_CONFIG | ||
1258 | |||
1259 | |||
1260 | +# _LT_FUNC_STRIPNAME_CNF | ||
1261 | +# ---------------------- | ||
1262 | +# func_stripname_cnf prefix suffix name | ||
1263 | +# strip PREFIX and SUFFIX off of NAME. | ||
1264 | +# PREFIX and SUFFIX must not contain globbing or regex special | ||
1265 | +# characters, hashes, percent signs, but SUFFIX may contain a leading | ||
1266 | +# dot (in which case that matches only a dot). | ||
1267 | +# | ||
1268 | +# This function is identical to the (non-XSI) version of func_stripname, | ||
1269 | +# except this one can be used by m4 code that may be executed by configure, | ||
1270 | +# rather than the libtool script. | ||
1271 | +m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl | ||
1272 | +AC_REQUIRE([_LT_DECL_SED]) | ||
1273 | +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) | ||
1274 | +func_stripname_cnf () | ||
1275 | +{ | ||
1276 | + case ${2} in | ||
1277 | + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; | ||
1278 | + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; | ||
1279 | + esac | ||
1280 | +} # func_stripname_cnf | ||
1281 | +])# _LT_FUNC_STRIPNAME_CNF | ||
1282 | + | ||
1283 | # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) | ||
1284 | # --------------------------------- | ||
1285 | # Figure out "hidden" library dependencies from verbose | ||
1286 | @@ -6453,6 +6856,7 @@ AC_LANG_POP | ||
1287 | # objects, libraries and library flags. | ||
1288 | m4_defun([_LT_SYS_HIDDEN_LIBDEPS], | ||
1289 | [m4_require([_LT_FILEUTILS_DEFAULTS])dnl | ||
1290 | +AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl | ||
1291 | # Dependencies to place before and after the object being linked: | ||
1292 | _LT_TAGVAR(predep_objects, $1)= | ||
1293 | _LT_TAGVAR(postdep_objects, $1)= | ||
1294 | @@ -6503,6 +6907,13 @@ public class foo { | ||
1295 | }; | ||
1296 | _LT_EOF | ||
1297 | ]) | ||
1298 | + | ||
1299 | +_lt_libdeps_save_CFLAGS=$CFLAGS | ||
1300 | +case "$CC $CFLAGS " in #( | ||
1301 | +*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; | ||
1302 | +*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; | ||
1303 | +esac | ||
1304 | + | ||
1305 | dnl Parse the compiler output and extract the necessary | ||
1306 | dnl objects, libraries and library flags. | ||
1307 | if AC_TRY_EVAL(ac_compile); then | ||
1308 | @@ -6514,7 +6925,7 @@ if AC_TRY_EVAL(ac_compile); then | ||
1309 | pre_test_object_deps_done=no | ||
1310 | |||
1311 | for p in `eval "$output_verbose_link_cmd"`; do | ||
1312 | - case $p in | ||
1313 | + case ${prev}${p} in | ||
1314 | |||
1315 | -L* | -R* | -l*) | ||
1316 | # Some compilers place space between "-{L,R}" and the path. | ||
1317 | @@ -6523,13 +6934,22 @@ if AC_TRY_EVAL(ac_compile); then | ||
1318 | test $p = "-R"; then | ||
1319 | prev=$p | ||
1320 | continue | ||
1321 | - else | ||
1322 | - prev= | ||
1323 | fi | ||
1324 | |||
1325 | + # Expand the sysroot to ease extracting the directories later. | ||
1326 | + if test -z "$prev"; then | ||
1327 | + case $p in | ||
1328 | + -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; | ||
1329 | + -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; | ||
1330 | + -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; | ||
1331 | + esac | ||
1332 | + fi | ||
1333 | + case $p in | ||
1334 | + =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; | ||
1335 | + esac | ||
1336 | if test "$pre_test_object_deps_done" = no; then | ||
1337 | - case $p in | ||
1338 | - -L* | -R*) | ||
1339 | + case ${prev} in | ||
1340 | + -L | -R) | ||
1341 | # Internal compiler library paths should come after those | ||
1342 | # provided the user. The postdeps already come after the | ||
1343 | # user supplied libs so there is no need to process them. | ||
1344 | @@ -6549,8 +6969,10 @@ if AC_TRY_EVAL(ac_compile); then | ||
1345 | _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" | ||
1346 | fi | ||
1347 | fi | ||
1348 | + prev= | ||
1349 | ;; | ||
1350 | |||
1351 | + *.lto.$objext) ;; # Ignore GCC LTO objects | ||
1352 | *.$objext) | ||
1353 | # This assumes that the test object file only shows up | ||
1354 | # once in the compiler output. | ||
1355 | @@ -6586,6 +7008,7 @@ else | ||
1356 | fi | ||
1357 | |||
1358 | $RM -f confest.$objext | ||
1359 | +CFLAGS=$_lt_libdeps_save_CFLAGS | ||
1360 | |||
1361 | # PORTME: override above test on systems where it is broken | ||
1362 | m4_if([$1], [CXX], | ||
1363 | @@ -6622,7 +7045,7 @@ linux*) | ||
1364 | |||
1365 | solaris*) | ||
1366 | case $cc_basename in | ||
1367 | - CC*) | ||
1368 | + CC* | sunCC*) | ||
1369 | # The more standards-conforming stlport4 library is | ||
1370 | # incompatible with the Cstd library. Avoid specifying | ||
1371 | # it if it's in CXXFLAGS. Ignore libCrun as | ||
1372 | @@ -6735,7 +7158,9 @@ if test "$_lt_disable_F77" != yes; then | ||
1373 | # Allow CC to be a program name with arguments. | ||
1374 | lt_save_CC="$CC" | ||
1375 | lt_save_GCC=$GCC | ||
1376 | + lt_save_CFLAGS=$CFLAGS | ||
1377 | CC=${F77-"f77"} | ||
1378 | + CFLAGS=$FFLAGS | ||
1379 | compiler=$CC | ||
1380 | _LT_TAGVAR(compiler, $1)=$CC | ||
1381 | _LT_CC_BASENAME([$compiler]) | ||
1382 | @@ -6789,6 +7214,7 @@ if test "$_lt_disable_F77" != yes; then | ||
1383 | |||
1384 | GCC=$lt_save_GCC | ||
1385 | CC="$lt_save_CC" | ||
1386 | + CFLAGS="$lt_save_CFLAGS" | ||
1387 | fi # test "$_lt_disable_F77" != yes | ||
1388 | |||
1389 | AC_LANG_POP | ||
1390 | @@ -6865,7 +7291,9 @@ if test "$_lt_disable_FC" != yes; then | ||
1391 | # Allow CC to be a program name with arguments. | ||
1392 | lt_save_CC="$CC" | ||
1393 | lt_save_GCC=$GCC | ||
1394 | + lt_save_CFLAGS=$CFLAGS | ||
1395 | CC=${FC-"f95"} | ||
1396 | + CFLAGS=$FCFLAGS | ||
1397 | compiler=$CC | ||
1398 | GCC=$ac_cv_fc_compiler_gnu | ||
1399 | |||
1400 | @@ -6921,7 +7349,8 @@ if test "$_lt_disable_FC" != yes; then | ||
1401 | fi # test -n "$compiler" | ||
1402 | |||
1403 | GCC=$lt_save_GCC | ||
1404 | - CC="$lt_save_CC" | ||
1405 | + CC=$lt_save_CC | ||
1406 | + CFLAGS=$lt_save_CFLAGS | ||
1407 | fi # test "$_lt_disable_FC" != yes | ||
1408 | |||
1409 | AC_LANG_POP | ||
1410 | @@ -6958,10 +7387,12 @@ _LT_COMPILER_BOILERPLATE | ||
1411 | _LT_LINKER_BOILERPLATE | ||
1412 | |||
1413 | # Allow CC to be a program name with arguments. | ||
1414 | -lt_save_CC="$CC" | ||
1415 | +lt_save_CC=$CC | ||
1416 | +lt_save_CFLAGS=$CFLAGS | ||
1417 | lt_save_GCC=$GCC | ||
1418 | GCC=yes | ||
1419 | CC=${GCJ-"gcj"} | ||
1420 | +CFLAGS=$GCJFLAGS | ||
1421 | compiler=$CC | ||
1422 | _LT_TAGVAR(compiler, $1)=$CC | ||
1423 | _LT_TAGVAR(LD, $1)="$LD" | ||
1424 | @@ -6992,7 +7423,8 @@ fi | ||
1425 | AC_LANG_RESTORE | ||
1426 | |||
1427 | GCC=$lt_save_GCC | ||
1428 | -CC="$lt_save_CC" | ||
1429 | +CC=$lt_save_CC | ||
1430 | +CFLAGS=$lt_save_CFLAGS | ||
1431 | ])# _LT_LANG_GCJ_CONFIG | ||
1432 | |||
1433 | |||
1434 | @@ -7027,9 +7459,11 @@ _LT_LINKER_BOILERPLATE | ||
1435 | |||
1436 | # Allow CC to be a program name with arguments. | ||
1437 | lt_save_CC="$CC" | ||
1438 | +lt_save_CFLAGS=$CFLAGS | ||
1439 | lt_save_GCC=$GCC | ||
1440 | GCC= | ||
1441 | CC=${RC-"windres"} | ||
1442 | +CFLAGS= | ||
1443 | compiler=$CC | ||
1444 | _LT_TAGVAR(compiler, $1)=$CC | ||
1445 | _LT_CC_BASENAME([$compiler]) | ||
1446 | @@ -7042,7 +7476,8 @@ fi | ||
1447 | |||
1448 | GCC=$lt_save_GCC | ||
1449 | AC_LANG_RESTORE | ||
1450 | -CC="$lt_save_CC" | ||
1451 | +CC=$lt_save_CC | ||
1452 | +CFLAGS=$lt_save_CFLAGS | ||
1453 | ])# _LT_LANG_RC_CONFIG | ||
1454 | |||
1455 | |||
1456 | @@ -7101,6 +7536,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) | ||
1457 | AC_SUBST([OBJDUMP]) | ||
1458 | ]) | ||
1459 | |||
1460 | +# _LT_DECL_DLLTOOL | ||
1461 | +# ---------------- | ||
1462 | +# Ensure DLLTOOL variable is set. | ||
1463 | +m4_defun([_LT_DECL_DLLTOOL], | ||
1464 | +[AC_CHECK_TOOL(DLLTOOL, dlltool, false) | ||
1465 | +test -z "$DLLTOOL" && DLLTOOL=dlltool | ||
1466 | +_LT_DECL([], [DLLTOOL], [1], [DLL creation program]) | ||
1467 | +AC_SUBST([DLLTOOL]) | ||
1468 | +]) | ||
1469 | |||
1470 | # _LT_DECL_SED | ||
1471 | # ------------ | ||
1472 | @@ -7194,8 +7638,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES], | ||
1473 | # Try some XSI features | ||
1474 | xsi_shell=no | ||
1475 | ( _lt_dummy="a/b/c" | ||
1476 | - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ | ||
1477 | - = c,a/b,, \ | ||
1478 | + test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ | ||
1479 | + = c,a/b,b/c, \ | ||
1480 | && eval 'test $(( 1 + 1 )) -eq 2 \ | ||
1481 | && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ | ||
1482 | && xsi_shell=yes | ||
1483 | @@ -7234,206 +7678,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl | ||
1484 | ])# _LT_CHECK_SHELL_FEATURES | ||
1485 | |||
1486 | |||
1487 | -# _LT_PROG_XSI_SHELLFNS | ||
1488 | -# --------------------- | ||
1489 | -# Bourne and XSI compatible variants of some useful shell functions. | ||
1490 | -m4_defun([_LT_PROG_XSI_SHELLFNS], | ||
1491 | -[case $xsi_shell in | ||
1492 | - yes) | ||
1493 | - cat << \_LT_EOF >> "$cfgfile" | ||
1494 | - | ||
1495 | -# func_dirname file append nondir_replacement | ||
1496 | -# Compute the dirname of FILE. If nonempty, add APPEND to the result, | ||
1497 | -# otherwise set result to NONDIR_REPLACEMENT. | ||
1498 | -func_dirname () | ||
1499 | -{ | ||
1500 | - case ${1} in | ||
1501 | - */*) func_dirname_result="${1%/*}${2}" ;; | ||
1502 | - * ) func_dirname_result="${3}" ;; | ||
1503 | - esac | ||
1504 | -} | ||
1505 | - | ||
1506 | -# func_basename file | ||
1507 | -func_basename () | ||
1508 | -{ | ||
1509 | - func_basename_result="${1##*/}" | ||
1510 | -} | ||
1511 | - | ||
1512 | -# func_dirname_and_basename file append nondir_replacement | ||
1513 | -# perform func_basename and func_dirname in a single function | ||
1514 | -# call: | ||
1515 | -# dirname: Compute the dirname of FILE. If nonempty, | ||
1516 | -# add APPEND to the result, otherwise set result | ||
1517 | -# to NONDIR_REPLACEMENT. | ||
1518 | -# value returned in "$func_dirname_result" | ||
1519 | -# basename: Compute filename of FILE. | ||
1520 | -# value retuned in "$func_basename_result" | ||
1521 | -# Implementation must be kept synchronized with func_dirname | ||
1522 | -# and func_basename. For efficiency, we do not delegate to | ||
1523 | -# those functions but instead duplicate the functionality here. | ||
1524 | -func_dirname_and_basename () | ||
1525 | -{ | ||
1526 | - case ${1} in | ||
1527 | - */*) func_dirname_result="${1%/*}${2}" ;; | ||
1528 | - * ) func_dirname_result="${3}" ;; | ||
1529 | - esac | ||
1530 | - func_basename_result="${1##*/}" | ||
1531 | -} | ||
1532 | - | ||
1533 | -# func_stripname prefix suffix name | ||
1534 | -# strip PREFIX and SUFFIX off of NAME. | ||
1535 | -# PREFIX and SUFFIX must not contain globbing or regex special | ||
1536 | -# characters, hashes, percent signs, but SUFFIX may contain a leading | ||
1537 | -# dot (in which case that matches only a dot). | ||
1538 | -func_stripname () | ||
1539 | -{ | ||
1540 | - # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are | ||
1541 | - # positional parameters, so assign one to ordinary parameter first. | ||
1542 | - func_stripname_result=${3} | ||
1543 | - func_stripname_result=${func_stripname_result#"${1}"} | ||
1544 | - func_stripname_result=${func_stripname_result%"${2}"} | ||
1545 | -} | ||
1546 | - | ||
1547 | -# func_opt_split | ||
1548 | -func_opt_split () | ||
1549 | -{ | ||
1550 | - func_opt_split_opt=${1%%=*} | ||
1551 | - func_opt_split_arg=${1#*=} | ||
1552 | -} | ||
1553 | - | ||
1554 | -# func_lo2o object | ||
1555 | -func_lo2o () | ||
1556 | -{ | ||
1557 | - case ${1} in | ||
1558 | - *.lo) func_lo2o_result=${1%.lo}.${objext} ;; | ||
1559 | - *) func_lo2o_result=${1} ;; | ||
1560 | - esac | ||
1561 | -} | ||
1562 | - | ||
1563 | -# func_xform libobj-or-source | ||
1564 | -func_xform () | ||
1565 | -{ | ||
1566 | - func_xform_result=${1%.*}.lo | ||
1567 | -} | ||
1568 | - | ||
1569 | -# func_arith arithmetic-term... | ||
1570 | -func_arith () | ||
1571 | -{ | ||
1572 | - func_arith_result=$(( $[*] )) | ||
1573 | -} | ||
1574 | - | ||
1575 | -# func_len string | ||
1576 | -# STRING may not start with a hyphen. | ||
1577 | -func_len () | ||
1578 | -{ | ||
1579 | - func_len_result=${#1} | ||
1580 | -} | ||
1581 | +# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) | ||
1582 | +# ------------------------------------------------------ | ||
1583 | +# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and | ||
1584 | +# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. | ||
1585 | +m4_defun([_LT_PROG_FUNCTION_REPLACE], | ||
1586 | +[dnl { | ||
1587 | +sed -e '/^$1 ()$/,/^} # $1 /c\ | ||
1588 | +$1 ()\ | ||
1589 | +{\ | ||
1590 | +m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) | ||
1591 | +} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ | ||
1592 | + && mv -f "$cfgfile.tmp" "$cfgfile" \ | ||
1593 | + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") | ||
1594 | +test 0 -eq $? || _lt_function_replace_fail=: | ||
1595 | +]) | ||
1596 | |||
1597 | -_LT_EOF | ||
1598 | - ;; | ||
1599 | - *) # Bourne compatible functions. | ||
1600 | - cat << \_LT_EOF >> "$cfgfile" | ||
1601 | |||
1602 | -# func_dirname file append nondir_replacement | ||
1603 | -# Compute the dirname of FILE. If nonempty, add APPEND to the result, | ||
1604 | -# otherwise set result to NONDIR_REPLACEMENT. | ||
1605 | -func_dirname () | ||
1606 | -{ | ||
1607 | - # Extract subdirectory from the argument. | ||
1608 | - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` | ||
1609 | - if test "X$func_dirname_result" = "X${1}"; then | ||
1610 | - func_dirname_result="${3}" | ||
1611 | - else | ||
1612 | - func_dirname_result="$func_dirname_result${2}" | ||
1613 | - fi | ||
1614 | -} | ||
1615 | +# _LT_PROG_REPLACE_SHELLFNS | ||
1616 | +# ------------------------- | ||
1617 | +# Replace existing portable implementations of several shell functions with | ||
1618 | +# equivalent extended shell implementations where those features are available.. | ||
1619 | +m4_defun([_LT_PROG_REPLACE_SHELLFNS], | ||
1620 | +[if test x"$xsi_shell" = xyes; then | ||
1621 | + _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl | ||
1622 | + case ${1} in | ||
1623 | + */*) func_dirname_result="${1%/*}${2}" ;; | ||
1624 | + * ) func_dirname_result="${3}" ;; | ||
1625 | + esac]) | ||
1626 | + | ||
1627 | + _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl | ||
1628 | + func_basename_result="${1##*/}"]) | ||
1629 | + | ||
1630 | + _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl | ||
1631 | + case ${1} in | ||
1632 | + */*) func_dirname_result="${1%/*}${2}" ;; | ||
1633 | + * ) func_dirname_result="${3}" ;; | ||
1634 | + esac | ||
1635 | + func_basename_result="${1##*/}"]) | ||
1636 | |||
1637 | -# func_basename file | ||
1638 | -func_basename () | ||
1639 | -{ | ||
1640 | - func_basename_result=`$ECHO "${1}" | $SED "$basename"` | ||
1641 | -} | ||
1642 | + _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl | ||
1643 | + # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are | ||
1644 | + # positional parameters, so assign one to ordinary parameter first. | ||
1645 | + func_stripname_result=${3} | ||
1646 | + func_stripname_result=${func_stripname_result#"${1}"} | ||
1647 | + func_stripname_result=${func_stripname_result%"${2}"}]) | ||
1648 | |||
1649 | -dnl func_dirname_and_basename | ||
1650 | -dnl A portable version of this function is already defined in general.m4sh | ||
1651 | -dnl so there is no need for it here. | ||
1652 | + _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl | ||
1653 | + func_split_long_opt_name=${1%%=*} | ||
1654 | + func_split_long_opt_arg=${1#*=}]) | ||
1655 | |||
1656 | -# func_stripname prefix suffix name | ||
1657 | -# strip PREFIX and SUFFIX off of NAME. | ||
1658 | -# PREFIX and SUFFIX must not contain globbing or regex special | ||
1659 | -# characters, hashes, percent signs, but SUFFIX may contain a leading | ||
1660 | -# dot (in which case that matches only a dot). | ||
1661 | -# func_strip_suffix prefix name | ||
1662 | -func_stripname () | ||
1663 | -{ | ||
1664 | - case ${2} in | ||
1665 | - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; | ||
1666 | - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; | ||
1667 | - esac | ||
1668 | -} | ||
1669 | + _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl | ||
1670 | + func_split_short_opt_arg=${1#??} | ||
1671 | + func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) | ||
1672 | |||
1673 | -# sed scripts: | ||
1674 | -my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' | ||
1675 | -my_sed_long_arg='1s/^-[[^=]]*=//' | ||
1676 | + _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl | ||
1677 | + case ${1} in | ||
1678 | + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; | ||
1679 | + *) func_lo2o_result=${1} ;; | ||
1680 | + esac]) | ||
1681 | |||
1682 | -# func_opt_split | ||
1683 | -func_opt_split () | ||
1684 | -{ | ||
1685 | - func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"` | ||
1686 | - func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` | ||
1687 | -} | ||
1688 | + _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) | ||
1689 | |||
1690 | -# func_lo2o object | ||
1691 | -func_lo2o () | ||
1692 | -{ | ||
1693 | - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` | ||
1694 | -} | ||
1695 | + _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) | ||
1696 | |||
1697 | -# func_xform libobj-or-source | ||
1698 | -func_xform () | ||
1699 | -{ | ||
1700 | - func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'` | ||
1701 | -} | ||
1702 | + _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) | ||
1703 | +fi | ||
1704 | |||
1705 | -# func_arith arithmetic-term... | ||
1706 | -func_arith () | ||
1707 | -{ | ||
1708 | - func_arith_result=`expr "$[@]"` | ||
1709 | -} | ||
1710 | +if test x"$lt_shell_append" = xyes; then | ||
1711 | + _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) | ||
1712 | |||
1713 | -# func_len string | ||
1714 | -# STRING may not start with a hyphen. | ||
1715 | -func_len () | ||
1716 | -{ | ||
1717 | - func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` | ||
1718 | -} | ||
1719 | + _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl | ||
1720 | + func_quote_for_eval "${2}" | ||
1721 | +dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ | ||
1722 | + eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) | ||
1723 | |||
1724 | -_LT_EOF | ||
1725 | -esac | ||
1726 | + # Save a `func_append' function call where possible by direct use of '+=' | ||
1727 | + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ | ||
1728 | + && mv -f "$cfgfile.tmp" "$cfgfile" \ | ||
1729 | + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") | ||
1730 | + test 0 -eq $? || _lt_function_replace_fail=: | ||
1731 | +else | ||
1732 | + # Save a `func_append' function call even when '+=' is not available | ||
1733 | + sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ | ||
1734 | + && mv -f "$cfgfile.tmp" "$cfgfile" \ | ||
1735 | + || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") | ||
1736 | + test 0 -eq $? || _lt_function_replace_fail=: | ||
1737 | +fi | ||
1738 | |||
1739 | -case $lt_shell_append in | ||
1740 | - yes) | ||
1741 | - cat << \_LT_EOF >> "$cfgfile" | ||
1742 | +if test x"$_lt_function_replace_fail" = x":"; then | ||
1743 | + AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) | ||
1744 | +fi | ||
1745 | +]) | ||
1746 | |||
1747 | -# func_append var value | ||
1748 | -# Append VALUE to the end of shell variable VAR. | ||
1749 | -func_append () | ||
1750 | -{ | ||
1751 | - eval "$[1]+=\$[2]" | ||
1752 | -} | ||
1753 | -_LT_EOF | ||
1754 | +# _LT_PATH_CONVERSION_FUNCTIONS | ||
1755 | +# ----------------------------- | ||
1756 | +# Determine which file name conversion functions should be used by | ||
1757 | +# func_to_host_file (and, implicitly, by func_to_host_path). These are needed | ||
1758 | +# for certain cross-compile configurations and native mingw. | ||
1759 | +m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], | ||
1760 | +[AC_REQUIRE([AC_CANONICAL_HOST])dnl | ||
1761 | +AC_REQUIRE([AC_CANONICAL_BUILD])dnl | ||
1762 | +AC_MSG_CHECKING([how to convert $build file names to $host format]) | ||
1763 | +AC_CACHE_VAL(lt_cv_to_host_file_cmd, | ||
1764 | +[case $host in | ||
1765 | + *-*-mingw* ) | ||
1766 | + case $build in | ||
1767 | + *-*-mingw* ) # actually msys | ||
1768 | + lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 | ||
1769 | + ;; | ||
1770 | + *-*-cygwin* ) | ||
1771 | + lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 | ||
1772 | + ;; | ||
1773 | + * ) # otherwise, assume *nix | ||
1774 | + lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 | ||
1775 | + ;; | ||
1776 | + esac | ||
1777 | ;; | ||
1778 | - *) | ||
1779 | - cat << \_LT_EOF >> "$cfgfile" | ||
1780 | - | ||
1781 | -# func_append var value | ||
1782 | -# Append VALUE to the end of shell variable VAR. | ||
1783 | -func_append () | ||
1784 | -{ | ||
1785 | - eval "$[1]=\$$[1]\$[2]" | ||
1786 | -} | ||
1787 | - | ||
1788 | -_LT_EOF | ||
1789 | + *-*-cygwin* ) | ||
1790 | + case $build in | ||
1791 | + *-*-mingw* ) # actually msys | ||
1792 | + lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin | ||
1793 | + ;; | ||
1794 | + *-*-cygwin* ) | ||
1795 | + lt_cv_to_host_file_cmd=func_convert_file_noop | ||
1796 | + ;; | ||
1797 | + * ) # otherwise, assume *nix | ||
1798 | + lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin | ||
1799 | + ;; | ||
1800 | + esac | ||
1801 | ;; | ||
1802 | - esac | ||
1803 | + * ) # unhandled hosts (and "normal" native builds) | ||
1804 | + lt_cv_to_host_file_cmd=func_convert_file_noop | ||
1805 | + ;; | ||
1806 | +esac | ||
1807 | +]) | ||
1808 | +to_host_file_cmd=$lt_cv_to_host_file_cmd | ||
1809 | +AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) | ||
1810 | +_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], | ||
1811 | + [0], [convert $build file names to $host format])dnl | ||
1812 | + | ||
1813 | +AC_MSG_CHECKING([how to convert $build file names to toolchain format]) | ||
1814 | +AC_CACHE_VAL(lt_cv_to_tool_file_cmd, | ||
1815 | +[#assume ordinary cross tools, or native build. | ||
1816 | +lt_cv_to_tool_file_cmd=func_convert_file_noop | ||
1817 | +case $host in | ||
1818 | + *-*-mingw* ) | ||
1819 | + case $build in | ||
1820 | + *-*-mingw* ) # actually msys | ||
1821 | + lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 | ||
1822 | + ;; | ||
1823 | + esac | ||
1824 | + ;; | ||
1825 | +esac | ||
1826 | ]) | ||
1827 | +to_tool_file_cmd=$lt_cv_to_tool_file_cmd | ||
1828 | +AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) | ||
1829 | +_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], | ||
1830 | + [0], [convert $build files to toolchain format])dnl | ||
1831 | +])# _LT_PATH_CONVERSION_FUNCTIONS | ||
1832 | diff --git a/ltmain.sh b/ltmain.sh | ||
1833 | index 9503ec85d7..70e856e065 100644 | ||
1834 | --- a/ltmain.sh | ||
1835 | +++ b/ltmain.sh | ||
1836 | @@ -1,10 +1,9 @@ | ||
1837 | -# Generated from ltmain.m4sh. | ||
1838 | |||
1839 | -# libtool (GNU libtool 1.3134 2009-11-29) 2.2.7a | ||
1840 | +# libtool (GNU libtool) 2.4 | ||
1841 | # Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 | ||
1842 | |||
1843 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, | ||
1844 | -# 2007, 2008, 2009 Free Software Foundation, Inc. | ||
1845 | +# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. | ||
1846 | # This is free software; see the source for copying conditions. There is NO | ||
1847 | # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
1848 | |||
1849 | @@ -38,7 +37,6 @@ | ||
1850 | # -n, --dry-run display commands without modifying any files | ||
1851 | # --features display basic configuration information and exit | ||
1852 | # --mode=MODE use operation mode MODE | ||
1853 | -# --no-finish let install mode avoid finish commands | ||
1854 | # --preserve-dup-deps don't remove duplicate dependency libraries | ||
1855 | # --quiet, --silent don't print informational messages | ||
1856 | # --no-quiet, --no-silent | ||
1857 | @@ -71,17 +69,19 @@ | ||
1858 | # compiler: $LTCC | ||
1859 | # compiler flags: $LTCFLAGS | ||
1860 | # linker: $LD (gnu? $with_gnu_ld) | ||
1861 | -# $progname: (GNU libtool 1.3134 2009-11-29) 2.2.7a | ||
1862 | +# $progname: (GNU libtool) 2.4 | ||
1863 | # automake: $automake_version | ||
1864 | # autoconf: $autoconf_version | ||
1865 | # | ||
1866 | # Report bugs to <bug-libtool@gnu.org>. | ||
1867 | +# GNU libtool home page: <http://www.gnu.org/software/libtool/>. | ||
1868 | +# General help using GNU software: <http://www.gnu.org/gethelp/>. | ||
1869 | |||
1870 | PROGRAM=libtool | ||
1871 | PACKAGE=libtool | ||
1872 | -VERSION=2.2.7a | ||
1873 | -TIMESTAMP=" 1.3134 2009-11-29" | ||
1874 | -package_revision=1.3134 | ||
1875 | +VERSION=2.4 | ||
1876 | +TIMESTAMP="" | ||
1877 | +package_revision=1.3293 | ||
1878 | |||
1879 | # Be Bourne compatible | ||
1880 | if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then | ||
1881 | @@ -106,9 +106,6 @@ _LTECHO_EOF' | ||
1882 | } | ||
1883 | |||
1884 | # NLS nuisances: We save the old values to restore during execute mode. | ||
1885 | -# Only set LANG and LC_ALL to C if already set. | ||
1886 | -# These must not be set unconditionally because not all systems understand | ||
1887 | -# e.g. LANG=C (notably SCO). | ||
1888 | lt_user_locale= | ||
1889 | lt_safe_locale= | ||
1890 | for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES | ||
1891 | @@ -121,15 +118,13 @@ do | ||
1892 | lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" | ||
1893 | fi" | ||
1894 | done | ||
1895 | +LC_ALL=C | ||
1896 | +LANGUAGE=C | ||
1897 | +export LANGUAGE LC_ALL | ||
1898 | |||
1899 | $lt_unset CDPATH | ||
1900 | |||
1901 | |||
1902 | - | ||
1903 | - | ||
1904 | - | ||
1905 | - | ||
1906 | - | ||
1907 | # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh | ||
1908 | # is ksh but when the shell is invoked as "sh" and the current value of | ||
1909 | # the _XPG environment variable is not equal to 1 (one), the special | ||
1910 | @@ -140,7 +135,7 @@ progpath="$0" | ||
1911 | |||
1912 | |||
1913 | : ${CP="cp -f"} | ||
1914 | -: ${ECHO=$as_echo} | ||
1915 | +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} | ||
1916 | : ${EGREP="/bin/grep -E"} | ||
1917 | : ${FGREP="/bin/grep -F"} | ||
1918 | : ${GREP="/bin/grep"} | ||
1919 | @@ -149,7 +144,7 @@ progpath="$0" | ||
1920 | : ${MKDIR="mkdir"} | ||
1921 | : ${MV="mv -f"} | ||
1922 | : ${RM="rm -f"} | ||
1923 | -: ${SED="/mount/endor/wildenhu/local-x86_64/bin/sed"} | ||
1924 | +: ${SED="/bin/sed"} | ||
1925 | : ${SHELL="${CONFIG_SHELL-/bin/sh}"} | ||
1926 | : ${Xsed="$SED -e 1s/^X//"} | ||
1927 | |||
1928 | @@ -169,6 +164,27 @@ IFS=" $lt_nl" | ||
1929 | dirname="s,/[^/]*$,," | ||
1930 | basename="s,^.*/,," | ||
1931 | |||
1932 | +# func_dirname file append nondir_replacement | ||
1933 | +# Compute the dirname of FILE. If nonempty, add APPEND to the result, | ||
1934 | +# otherwise set result to NONDIR_REPLACEMENT. | ||
1935 | +func_dirname () | ||
1936 | +{ | ||
1937 | + func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` | ||
1938 | + if test "X$func_dirname_result" = "X${1}"; then | ||
1939 | + func_dirname_result="${3}" | ||
1940 | + else | ||
1941 | + func_dirname_result="$func_dirname_result${2}" | ||
1942 | + fi | ||
1943 | +} # func_dirname may be replaced by extended shell implementation | ||
1944 | + | ||
1945 | + | ||
1946 | +# func_basename file | ||
1947 | +func_basename () | ||
1948 | +{ | ||
1949 | + func_basename_result=`$ECHO "${1}" | $SED "$basename"` | ||
1950 | +} # func_basename may be replaced by extended shell implementation | ||
1951 | + | ||
1952 | + | ||
1953 | # func_dirname_and_basename file append nondir_replacement | ||
1954 | # perform func_basename and func_dirname in a single function | ||
1955 | # call: | ||
1956 | @@ -183,17 +199,31 @@ basename="s,^.*/,," | ||
1957 | # those functions but instead duplicate the functionality here. | ||
1958 | func_dirname_and_basename () | ||
1959 | { | ||
1960 | - # Extract subdirectory from the argument. | ||
1961 | - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` | ||
1962 | - if test "X$func_dirname_result" = "X${1}"; then | ||
1963 | - func_dirname_result="${3}" | ||
1964 | - else | ||
1965 | - func_dirname_result="$func_dirname_result${2}" | ||
1966 | - fi | ||
1967 | - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` | ||
1968 | -} | ||
1969 | + # Extract subdirectory from the argument. | ||
1970 | + func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` | ||
1971 | + if test "X$func_dirname_result" = "X${1}"; then | ||
1972 | + func_dirname_result="${3}" | ||
1973 | + else | ||
1974 | + func_dirname_result="$func_dirname_result${2}" | ||
1975 | + fi | ||
1976 | + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` | ||
1977 | +} # func_dirname_and_basename may be replaced by extended shell implementation | ||
1978 | + | ||
1979 | + | ||
1980 | +# func_stripname prefix suffix name | ||
1981 | +# strip PREFIX and SUFFIX off of NAME. | ||
1982 | +# PREFIX and SUFFIX must not contain globbing or regex special | ||
1983 | +# characters, hashes, percent signs, but SUFFIX may contain a leading | ||
1984 | +# dot (in which case that matches only a dot). | ||
1985 | +# func_strip_suffix prefix name | ||
1986 | +func_stripname () | ||
1987 | +{ | ||
1988 | + case ${2} in | ||
1989 | + .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; | ||
1990 | + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; | ||
1991 | + esac | ||
1992 | +} # func_stripname may be replaced by extended shell implementation | ||
1993 | |||
1994 | -# Generated shell functions inserted here. | ||
1995 | |||
1996 | # These SED scripts presuppose an absolute path with a trailing slash. | ||
1997 | pathcar='s,^/\([^/]*\).*$,\1,' | ||
1998 | @@ -376,6 +406,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g' | ||
1999 | # Same as above, but do not quote variable references. | ||
2000 | double_quote_subst='s/\(["`\\]\)/\\\1/g' | ||
2001 | |||
2002 | +# Sed substitution that turns a string into a regex matching for the | ||
2003 | +# string literally. | ||
2004 | +sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' | ||
2005 | + | ||
2006 | +# Sed substitution that converts a w32 file name or path | ||
2007 | +# which contains forward slashes, into one that contains | ||
2008 | +# (escaped) backslashes. A very naive implementation. | ||
2009 | +lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' | ||
2010 | + | ||
2011 | # Re-`\' parameter expansions in output of double_quote_subst that were | ||
2012 | # `\'-ed in input to the same. If an odd number of `\' preceded a '$' | ||
2013 | # in input to double_quote_subst, that '$' was protected from expansion. | ||
2014 | @@ -404,7 +443,7 @@ opt_warning=: | ||
2015 | # name if it has been set yet. | ||
2016 | func_echo () | ||
2017 | { | ||
2018 | - $ECHO "$progname${mode+: }$mode: $*" | ||
2019 | + $ECHO "$progname: ${opt_mode+$opt_mode: }$*" | ||
2020 | } | ||
2021 | |||
2022 | # func_verbose arg... | ||
2023 | @@ -430,14 +469,14 @@ func_echo_all () | ||
2024 | # Echo program name prefixed message to standard error. | ||
2025 | func_error () | ||
2026 | { | ||
2027 | - $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 | ||
2028 | + $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 | ||
2029 | } | ||
2030 | |||
2031 | # func_warning arg... | ||
2032 | # Echo program name prefixed warning message to standard error. | ||
2033 | func_warning () | ||
2034 | { | ||
2035 | - $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 | ||
2036 | + $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 | ||
2037 | |||
2038 | # bash bug again: | ||
2039 | : | ||
2040 | @@ -656,19 +695,35 @@ func_show_eval_locale () | ||
2041 | fi | ||
2042 | } | ||
2043 | |||
2044 | - | ||
2045 | - | ||
2046 | +# func_tr_sh | ||
2047 | +# Turn $1 into a string suitable for a shell variable name. | ||
2048 | +# Result is stored in $func_tr_sh_result. All characters | ||
2049 | +# not in the set a-zA-Z0-9_ are replaced with '_'. Further, | ||
2050 | +# if $1 begins with a digit, a '_' is prepended as well. | ||
2051 | +func_tr_sh () | ||
2052 | +{ | ||
2053 | + case $1 in | ||
2054 | + [0-9]* | *[!a-zA-Z0-9_]*) | ||
2055 | + func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` | ||
2056 | + ;; | ||
2057 | + * ) | ||
2058 | + func_tr_sh_result=$1 | ||
2059 | + ;; | ||
2060 | + esac | ||
2061 | +} | ||
2062 | |||
2063 | |||
2064 | # func_version | ||
2065 | # Echo version message to standard output and exit. | ||
2066 | func_version () | ||
2067 | { | ||
2068 | + $opt_debug | ||
2069 | + | ||
2070 | $SED -n '/(C)/!b go | ||
2071 | :more | ||
2072 | /\./!{ | ||
2073 | N | ||
2074 | - s/\n# // | ||
2075 | + s/\n# / / | ||
2076 | b more | ||
2077 | } | ||
2078 | :go | ||
2079 | @@ -685,7 +740,9 @@ func_version () | ||
2080 | # Echo short help message to standard output and exit. | ||
2081 | func_usage () | ||
2082 | { | ||
2083 | - $SED -n '/^# Usage:/,/^# *-h/ { | ||
2084 | + $opt_debug | ||
2085 | + | ||
2086 | + $SED -n '/^# Usage:/,/^# *.*--help/ { | ||
2087 | s/^# // | ||
2088 | s/^# *$// | ||
2089 | s/\$progname/'$progname'/ | ||
2090 | @@ -701,7 +758,10 @@ func_usage () | ||
2091 | # unless 'noexit' is passed as argument. | ||
2092 | func_help () | ||
2093 | { | ||
2094 | + $opt_debug | ||
2095 | + | ||
2096 | $SED -n '/^# Usage:/,/# Report bugs to/ { | ||
2097 | |||
2098 | s/^# // | ||
2099 | s/^# *$// | ||
2100 | s*\$progname*'$progname'* | ||
2101 | @@ -714,7 +774,11 @@ func_help () | ||
2102 | s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ | ||
2103 | s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ | ||
2104 | p | ||
2105 | - }' < "$progpath" | ||
2106 | + d | ||
2107 | + } | ||
2108 | + /^# .* home page:/b print | ||
2109 | + /^# General help using/b print | ||
2110 | + ' < "$progpath" | ||
2111 | ret=$? | ||
2112 | if test -z "$1"; then | ||
2113 | exit $ret | ||
2114 | @@ -726,12 +790,39 @@ func_help () | ||
2115 | # exit_cmd. | ||
2116 | func_missing_arg () | ||
2117 | { | ||
2118 | - func_error "missing argument for $1" | ||
2119 | + $opt_debug | ||
2120 | + | ||
2121 | + func_error "missing argument for $1." | ||
2122 | exit_cmd=exit | ||
2123 | } | ||
2124 | |||
2125 | -exit_cmd=: | ||
2126 | |||
2127 | +# func_split_short_opt shortopt | ||
2128 | +# Set func_split_short_opt_name and func_split_short_opt_arg shell | ||
2129 | +# variables after splitting SHORTOPT after the 2nd character. | ||
2130 | +func_split_short_opt () | ||
2131 | +{ | ||
2132 | + my_sed_short_opt='1s/^\(..\).*$/\1/;q' | ||
2133 | + my_sed_short_rest='1s/^..\(.*\)$/\1/;q' | ||
2134 | + | ||
2135 | + func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` | ||
2136 | + func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` | ||
2137 | +} # func_split_short_opt may be replaced by extended shell implementation | ||
2138 | + | ||
2139 | + | ||
2140 | +# func_split_long_opt longopt | ||
2141 | +# Set func_split_long_opt_name and func_split_long_opt_arg shell | ||
2142 | +# variables after splitting LONGOPT at the `=' sign. | ||
2143 | +func_split_long_opt () | ||
2144 | +{ | ||
2145 | + my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' | ||
2146 | + my_sed_long_arg='1s/^--[^=]*=//' | ||
2147 | + | ||
2148 | + func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` | ||
2149 | + func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` | ||
2150 | +} # func_split_long_opt may be replaced by extended shell implementation | ||
2151 | + | ||
2152 | +exit_cmd=: | ||
2153 | |||
2154 | |||
2155 | |||
2156 | @@ -741,26 +832,64 @@ magic="%%%MAGIC variable%%%" | ||
2157 | magic_exe="%%%MAGIC EXE variable%%%" | ||
2158 | |||
2159 | # Global variables. | ||
2160 | -# $mode is unset | ||
2161 | nonopt= | ||
2162 | -execute_dlfiles= | ||
2163 | preserve_args= | ||
2164 | lo2o="s/\\.lo\$/.${objext}/" | ||
2165 | o2lo="s/\\.${objext}\$/.lo/" | ||
2166 | extracted_archives= | ||
2167 | extracted_serial=0 | ||
2168 | |||
2169 | -opt_dry_run=false | ||
2170 | -opt_finish=: | ||
2171 | -opt_duplicate_deps=false | ||
2172 | -opt_silent=false | ||
2173 | -opt_debug=: | ||
2174 | - | ||
2175 | # If this variable is set in any of the actions, the command in it | ||
2176 | # will be execed at the end. This prevents here-documents from being | ||
2177 | # left over by shells. | ||
2178 | exec_cmd= | ||
2179 | |||
2180 | +# func_append var value | ||
2181 | +# Append VALUE to the end of shell variable VAR. | ||
2182 | +func_append () | ||
2183 | +{ | ||
2184 | + eval "${1}=\$${1}\${2}" | ||
2185 | +} # func_append may be replaced by extended shell implementation | ||
2186 | + | ||
2187 | +# func_append_quoted var value | ||
2188 | +# Quote VALUE and append to the end of shell variable VAR, separated | ||
2189 | +# by a space. | ||
2190 | +func_append_quoted () | ||
2191 | +{ | ||
2192 | + func_quote_for_eval "${2}" | ||
2193 | + eval "${1}=\$${1}\\ \$func_quote_for_eval_result" | ||
2194 | +} # func_append_quoted may be replaced by extended shell implementation | ||
2195 | + | ||
2196 | + | ||
2197 | +# func_arith arithmetic-term... | ||
2198 | +func_arith () | ||
2199 | +{ | ||
2200 | + func_arith_result=`expr "${@}"` | ||
2201 | +} # func_arith may be replaced by extended shell implementation | ||
2202 | + | ||
2203 | + | ||
2204 | +# func_len string | ||
2205 | +# STRING may not start with a hyphen. | ||
2206 | +func_len () | ||
2207 | +{ | ||
2208 | + func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` | ||
2209 | +} # func_len may be replaced by extended shell implementation | ||
2210 | + | ||
2211 | + | ||
2212 | +# func_lo2o object | ||
2213 | +func_lo2o () | ||
2214 | +{ | ||
2215 | + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` | ||
2216 | +} # func_lo2o may be replaced by extended shell implementation | ||
2217 | + | ||
2218 | + | ||
2219 | +# func_xform libobj-or-source | ||
2220 | +func_xform () | ||
2221 | +{ | ||
2222 | + func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` | ||
2223 | +} # func_xform may be replaced by extended shell implementation | ||
2224 | + | ||
2225 | + | ||
2226 | # func_fatal_configuration arg... | ||
2227 | # Echo program name prefixed message to standard error, followed by | ||
2228 | # a configuration failure hint, and exit. | ||
2229 | @@ -850,130 +979,204 @@ func_enable_tag () | ||
2230 | esac | ||
2231 | } | ||
2232 | |||
2233 | -# Parse options once, thoroughly. This comes as soon as possible in | ||
2234 | -# the script to make things like `libtool --version' happen quickly. | ||
2235 | +# func_check_version_match | ||
2236 | +# Ensure that we are using m4 macros, and libtool script from the same | ||
2237 | +# release of libtool. | ||
2238 | +func_check_version_match () | ||
2239 | { | ||
2240 | + if test "$package_revision" != "$macro_revision"; then | ||
2241 | + if test "$VERSION" != "$macro_version"; then | ||
2242 | + if test -z "$macro_version"; then | ||
2243 | + cat >&2 <<_LT_EOF | ||
2244 | +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the | ||
2245 | +$progname: definition of this LT_INIT comes from an older release. | ||
2246 | +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION | ||
2247 | +$progname: and run autoconf again. | ||
2248 | +_LT_EOF | ||
2249 | + else | ||
2250 | + cat >&2 <<_LT_EOF | ||
2251 | +$progname: Version mismatch error. This is $PACKAGE $VERSION, but the | ||
2252 | +$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. | ||
2253 | +$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION | ||
2254 | +$progname: and run autoconf again. | ||
2255 | +_LT_EOF | ||
2256 | + fi | ||
2257 | + else | ||
2258 | + cat >&2 <<_LT_EOF | ||
2259 | +$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, | ||
2260 | +$progname: but the definition of this LT_INIT comes from revision $macro_revision. | ||
2261 | +$progname: You should recreate aclocal.m4 with macros from revision $package_revision | ||
2262 | +$progname: of $PACKAGE $VERSION and run autoconf again. | ||
2263 | +_LT_EOF | ||
2264 | + fi | ||
2265 | |||
2266 | - # Shorthand for --mode=foo, only valid as the first argument | ||
2267 | - case $1 in | ||
2268 | - clean|clea|cle|cl) | ||
2269 | - shift; set dummy --mode clean ${1+"$@"}; shift | ||
2270 | - ;; | ||
2271 | - compile|compil|compi|comp|com|co|c) | ||
2272 | - shift; set dummy --mode compile ${1+"$@"}; shift | ||
2273 | - ;; | ||
2274 | - execute|execut|execu|exec|exe|ex|e) | ||
2275 | - shift; set dummy --mode execute ${1+"$@"}; shift | ||
2276 | - ;; | ||
2277 | - finish|finis|fini|fin|fi|f) | ||
2278 | - shift; set dummy --mode finish ${1+"$@"}; shift | ||
2279 | - ;; | ||
2280 | - install|instal|insta|inst|ins|in|i) | ||
2281 | - shift; set dummy --mode install ${1+"$@"}; shift | ||
2282 | - ;; | ||
2283 | - link|lin|li|l) | ||
2284 | - shift; set dummy --mode link ${1+"$@"}; shift | ||
2285 | - ;; | ||
2286 | - uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) | ||
2287 | - shift; set dummy --mode uninstall ${1+"$@"}; shift | ||
2288 | - ;; | ||
2289 | - esac | ||
2290 | + exit $EXIT_MISMATCH | ||
2291 | + fi | ||
2292 | +} | ||
2293 | + | ||
2294 | + | ||
2295 | +# Shorthand for --mode=foo, only valid as the first argument | ||
2296 | +case $1 in | ||
2297 | +clean|clea|cle|cl) | ||
2298 | + shift; set dummy --mode clean ${1+"$@"}; shift | ||
2299 | + ;; | ||
2300 | +compile|compil|compi|comp|com|co|c) | ||
2301 | + shift; set dummy --mode compile ${1+"$@"}; shift | ||
2302 | + ;; | ||
2303 | +execute|execut|execu|exec|exe|ex|e) | ||
2304 | + shift; set dummy --mode execute ${1+"$@"}; shift | ||
2305 | + ;; | ||
2306 | +finish|finis|fini|fin|fi|f) | ||
2307 | + shift; set dummy --mode finish ${1+"$@"}; shift | ||
2308 | + ;; | ||
2309 | +install|instal|insta|inst|ins|in|i) | ||
2310 | + shift; set dummy --mode install ${1+"$@"}; shift | ||
2311 | + ;; | ||
2312 | +link|lin|li|l) | ||
2313 | + shift; set dummy --mode link ${1+"$@"}; shift | ||
2314 | + ;; | ||
2315 | +uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) | ||
2316 | + shift; set dummy --mode uninstall ${1+"$@"}; shift | ||
2317 | + ;; | ||
2318 | +esac | ||
2319 | |||
2320 | - # Parse non-mode specific arguments: | ||
2321 | - while test "$#" -gt 0; do | ||
2322 | + | ||
2323 | + | ||
2324 | +# Option defaults: | ||
2325 | +opt_debug=: | ||
2326 | +opt_dry_run=false | ||
2327 | +opt_config=false | ||
2328 | +opt_preserve_dup_deps=false | ||
2329 | +opt_features=false | ||
2330 | +opt_finish=false | ||
2331 | +opt_help=false | ||
2332 | +opt_help_all=false | ||
2333 | +opt_silent=: | ||
2334 | +opt_verbose=: | ||
2335 | +opt_silent=false | ||
2336 | +opt_verbose=false | ||
2337 | + | ||
2338 | + | ||
2339 | +# Parse options once, thoroughly. This comes as soon as possible in the | ||
2340 | +# script to make things like `--version' happen as quickly as we can. | ||
2341 | +{ | ||
2342 | + # this just eases exit handling | ||
2343 | + while test $# -gt 0; do | ||
2344 | opt="$1" | ||
2345 | shift | ||
2346 | - | ||
2347 | case $opt in | ||
2348 | - --config) func_config ;; | ||
2349 | - | ||
2350 | - --debug) preserve_args="$preserve_args $opt" | ||
2351 | + --debug|-x) opt_debug='set -x' | ||
2352 | func_echo "enabling shell trace mode" | ||
2353 | - opt_debug='set -x' | ||
2354 | $opt_debug | ||
2355 | ;; | ||
2356 | - | ||
2357 | - -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break | ||
2358 | - execute_dlfiles="$execute_dlfiles $1" | ||
2359 | - shift | ||
2360 | + --dry-run|--dryrun|-n) | ||
2361 | + opt_dry_run=: | ||
2362 | ;; | ||
2363 | - | ||
2364 | - --dry-run | -n) opt_dry_run=: ;; | ||
2365 | - --features) func_features ;; | ||
2366 | - --finish) mode="finish" ;; | ||
2367 | - --no-finish) opt_finish=false ;; | ||
2368 | - | ||
2369 | - --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break | ||
2370 | - case $1 in | ||
2371 | - # Valid mode arguments: | ||
2372 | - clean) ;; | ||
2373 | - compile) ;; | ||
2374 | - execute) ;; | ||
2375 | - finish) ;; | ||
2376 | - install) ;; | ||
2377 | - link) ;; | ||
2378 | - relink) ;; | ||
2379 | - uninstall) ;; | ||
2380 | - | ||
2381 | - # Catch anything else as an error | ||
2382 | - *) func_error "invalid argument for $opt" | ||
2383 | - exit_cmd=exit | ||
2384 | - break | ||
2385 | - ;; | ||
2386 | - esac | ||
2387 | - | ||
2388 | - mode="$1" | ||
2389 | + --config) | ||
2390 | + opt_config=: | ||
2391 | +func_config | ||
2392 | + ;; | ||
2393 | + --dlopen|-dlopen) | ||
2394 | + optarg="$1" | ||
2395 | + opt_dlopen="${opt_dlopen+$opt_dlopen | ||
2396 | +}$optarg" | ||
2397 | shift | ||
2398 | ;; | ||
2399 | - | ||
2400 | --preserve-dup-deps) | ||
2401 | - opt_duplicate_deps=: ;; | ||
2402 | - | ||
2403 | - --quiet|--silent) preserve_args="$preserve_args $opt" | ||
2404 | - opt_silent=: | ||
2405 | - opt_verbose=false | ||
2406 | + opt_preserve_dup_deps=: | ||
2407 | ;; | ||
2408 | - | ||
2409 | - --no-quiet|--no-silent) | ||
2410 | - preserve_args="$preserve_args $opt" | ||
2411 | - opt_silent=false | ||
2412 | + --features) | ||
2413 | + opt_features=: | ||
2414 | +func_features | ||
2415 | ;; | ||
2416 | - | ||
2417 | - --verbose| -v) preserve_args="$preserve_args $opt" | ||
2418 | + --finish) | ||
2419 | + opt_finish=: | ||
2420 | +set dummy --mode finish ${1+"$@"}; shift | ||
2421 | + ;; | ||
2422 | + --help) | ||
2423 | + opt_help=: | ||
2424 | + ;; | ||
2425 | + --help-all) | ||
2426 | + opt_help_all=: | ||
2427 | +opt_help=': help-all' | ||
2428 | + ;; | ||
2429 | + --mode) | ||
2430 | + test $# = 0 && func_missing_arg $opt && break | ||
2431 | + optarg="$1" | ||
2432 | + opt_mode="$optarg" | ||
2433 | +case $optarg in | ||
2434 | + # Valid mode arguments: | ||
2435 | + clean|compile|execute|finish|install|link|relink|uninstall) ;; | ||
2436 | + | ||
2437 | + # Catch anything else as an error | ||
2438 | + *) func_error "invalid argument for $opt" | ||
2439 | + exit_cmd=exit | ||
2440 | + break | ||
2441 | + ;; | ||
2442 | +esac | ||
2443 | + shift | ||
2444 | + ;; | ||
2445 | + --no-silent|--no-quiet) | ||
2446 | opt_silent=false | ||
2447 | - opt_verbose=: | ||
2448 | +func_append preserve_args " $opt" | ||
2449 | ;; | ||
2450 | - | ||
2451 | - --no-verbose) preserve_args="$preserve_args $opt" | ||
2452 | + --no-verbose) | ||
2453 | opt_verbose=false | ||
2454 | +func_append preserve_args " $opt" | ||
2455 | ;; | ||
2456 | - | ||
2457 | - --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break | ||
2458 | - preserve_args="$preserve_args $opt $1" | ||
2459 | - func_enable_tag "$1" # tagname is set here | ||
2460 | + --silent|--quiet) | ||
2461 | + opt_silent=: | ||
2462 | +func_append preserve_args " $opt" | ||
2463 | + opt_verbose=false | ||
2464 | + ;; | ||
2465 | + --verbose|-v) | ||
2466 | + opt_verbose=: | ||
2467 | +func_append preserve_args " $opt" | ||
2468 | +opt_silent=false | ||
2469 | + ;; | ||
2470 | + --tag) | ||
2471 | + test $# = 0 && func_missing_arg $opt && break | ||
2472 | + optarg="$1" | ||
2473 | + opt_tag="$optarg" | ||
2474 | +func_append preserve_args " $opt $optarg" | ||
2475 | +func_enable_tag "$optarg" | ||
2476 | shift | ||
2477 | ;; | ||
2478 | |||
2479 | + -\?|-h) func_usage ;; | ||
2480 | + --help) func_help ;; | ||
2481 | + --version) func_version ;; | ||
2482 | + | ||
2483 | # Separate optargs to long options: | ||
2484 | - -dlopen=*|--mode=*|--tag=*) | ||
2485 | - func_opt_split "$opt" | ||
2486 | - set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} | ||
2487 | + --*=*) | ||
2488 | + func_split_long_opt "$opt" | ||
2489 | + set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} | ||
2490 | shift | ||
2491 | ;; | ||
2492 | |||
2493 | - -\?|-h) func_usage ;; | ||
2494 | - --help) opt_help=: ;; | ||
2495 | - --help-all) opt_help=': help-all' ;; | ||
2496 | - --version) func_version ;; | ||
2497 | - | ||
2498 | - -*) func_fatal_help "unrecognized option \`$opt'" ;; | ||
2499 | - | ||
2500 | - *) nonopt="$opt" | ||
2501 | - break | ||
2502 | + # Separate non-argument short options: | ||
2503 | + -\?*|-h*|-n*|-v*) | ||
2504 | + func_split_short_opt "$opt" | ||
2505 | + set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} | ||
2506 | + shift | ||
2507 | ;; | ||
2508 | + | ||
2509 | + --) break ;; | ||
2510 | + -*) func_fatal_help "unrecognized option \`$opt'" ;; | ||
2511 | + *) set dummy "$opt" ${1+"$@"}; shift; break ;; | ||
2512 | esac | ||
2513 | done | ||
2514 | |||
2515 | + # Validate options: | ||
2516 | + | ||
2517 | + # save first non-option argument | ||
2518 | + if test "$#" -gt 0; then | ||
2519 | + nonopt="$opt" | ||
2520 | + shift | ||
2521 | + fi | ||
2522 | + | ||
2523 | + # preserve --debug | ||
2524 | + test "$opt_debug" = : || func_append preserve_args " --debug" | ||
2525 | |||
2526 | case $host in | ||
2527 | *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* ) | ||
2528 | @@ -981,82 +1184,44 @@ func_enable_tag () | ||
2529 | opt_duplicate_compiler_generated_deps=: | ||
2530 | ;; | ||
2531 | *) | ||
2532 | - opt_duplicate_compiler_generated_deps=$opt_duplicate_deps | ||
2533 | + opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps | ||
2534 | ;; | ||
2535 | esac | ||
2536 | |||
2537 | - # Having warned about all mis-specified options, bail out if | ||
2538 | - # anything was wrong. | ||
2539 | - $exit_cmd $EXIT_FAILURE | ||
2540 | -} | ||
2541 | + $opt_help || { | ||
2542 | + # Sanity checks first: | ||
2543 | + func_check_version_match | ||
2544 | |||
2545 | -# func_check_version_match | ||
2546 | -# Ensure that we are using m4 macros, and libtool script from the same | ||
2547 | -# release of libtool. | ||
2548 | -func_check_version_match () | ||
2549 | -{ | ||
2550 | - if test "$package_revision" != "$macro_revision"; then | ||
2551 | - if test "$VERSION" != "$macro_version"; then | ||
2552 | - if test -z "$macro_version"; then | ||
2553 | - cat >&2 <<_LT_EOF | ||
2554 | -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the | ||
2555 | -$progname: definition of this LT_INIT comes from an older release. | ||
2556 | -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION | ||
2557 | -$progname: and run autoconf again. | ||
2558 | -_LT_EOF | ||
2559 | - else | ||
2560 | - cat >&2 <<_LT_EOF | ||
2561 | -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the | ||
2562 | -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. | ||
2563 | -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION | ||
2564 | -$progname: and run autoconf again. | ||
2565 | -_LT_EOF | ||
2566 | - fi | ||
2567 | - else | ||
2568 | - cat >&2 <<_LT_EOF | ||
2569 | -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, | ||
2570 | -$progname: but the definition of this LT_INIT comes from revision $macro_revision. | ||
2571 | -$progname: You should recreate aclocal.m4 with macros from revision $package_revision | ||
2572 | -$progname: of $PACKAGE $VERSION and run autoconf again. | ||
2573 | -_LT_EOF | ||
2574 | + if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then | ||
2575 | + func_fatal_configuration "not configured to build any kind of library" | ||
2576 | fi | ||
2577 | |||
2578 | - exit $EXIT_MISMATCH | ||
2579 | - fi | ||
2580 | -} | ||
2581 | - | ||
2582 | + # Darwin sucks | ||
2583 | + eval std_shrext=\"$shrext_cmds\" | ||
2584 | |||
2585 | -## ----------- ## | ||
2586 | -## Main. ## | ||
2587 | -## ----------- ## | ||
2588 | - | ||
2589 | -$opt_help || { | ||
2590 | - # Sanity checks first: | ||
2591 | - func_check_version_match | ||
2592 | - | ||
2593 | - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then | ||
2594 | - func_fatal_configuration "not configured to build any kind of library" | ||
2595 | - fi | ||
2596 | + # Only execute mode is allowed to have -dlopen flags. | ||
2597 | + if test -n "$opt_dlopen" && test "$opt_mode" != execute; then | ||
2598 | + func_error "unrecognized option \`-dlopen'" | ||
2599 | + $ECHO "$help" 1>&2 | ||
2600 | + exit $EXIT_FAILURE | ||
2601 | + fi | ||
2602 | |||
2603 | - test -z "$mode" && func_fatal_error "error: you must specify a MODE." | ||
2604 | + # Change the help message to a mode-specific one. | ||
2605 | + generic_help="$help" | ||
2606 | + help="Try \`$progname --help --mode=$opt_mode' for more information." | ||
2607 | + } | ||
2608 | |||
2609 | |||
2610 | - # Darwin sucks | ||
2611 | - eval "std_shrext=\"$shrext_cmds\"" | ||
2612 | + # Bail if the options were screwed | ||
2613 | + $exit_cmd $EXIT_FAILURE | ||
2614 | +} | ||
2615 | |||
2616 | |||
2617 | - # Only execute mode is allowed to have -dlopen flags. | ||
2618 | - if test -n "$execute_dlfiles" && test "$mode" != execute; then | ||
2619 | - func_error "unrecognized option \`-dlopen'" | ||
2620 | - $ECHO "$help" 1>&2 | ||
2621 | - exit $EXIT_FAILURE | ||
2622 | - fi | ||
2623 | |||
2624 | - # Change the help message to a mode-specific one. | ||
2625 | - generic_help="$help" | ||
2626 | - help="Try \`$progname --help --mode=$mode' for more information." | ||
2627 | -} | ||
2628 | |||
2629 | +## ----------- ## | ||
2630 | +## Main. ## | ||
2631 | +## ----------- ## | ||
2632 | |||
2633 | # func_lalib_p file | ||
2634 | # True iff FILE is a libtool `.la' library or `.lo' object file. | ||
2635 | @@ -1121,12 +1286,9 @@ func_ltwrapper_executable_p () | ||
2636 | # temporary ltwrapper_script. | ||
2637 | func_ltwrapper_scriptname () | ||
2638 | { | ||
2639 | - func_ltwrapper_scriptname_result="" | ||
2640 | - if func_ltwrapper_executable_p "$1"; then | ||
2641 | - func_dirname_and_basename "$1" "" "." | ||
2642 | - func_stripname '' '.exe' "$func_basename_result" | ||
2643 | - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" | ||
2644 | - fi | ||
2645 | + func_dirname_and_basename "$1" "" "." | ||
2646 | + func_stripname '' '.exe' "$func_basename_result" | ||
2647 | + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" | ||
2648 | } | ||
2649 | |||
2650 | # func_ltwrapper_p file | ||
2651 | @@ -1149,7 +1311,7 @@ func_execute_cmds () | ||
2652 | save_ifs=$IFS; IFS='~' | ||
2653 | for cmd in $1; do | ||
2654 | IFS=$save_ifs | ||
2655 | - eval "cmd=\"$cmd\"" | ||
2656 | + eval cmd=\"$cmd\" | ||
2657 | func_show_eval "$cmd" "${2-:}" | ||
2658 | done | ||
2659 | IFS=$save_ifs | ||
2660 | @@ -1172,6 +1334,37 @@ func_source () | ||
2661 | } | ||
2662 | |||
2663 | |||
2664 | +# func_resolve_sysroot PATH | ||
2665 | +# Replace a leading = in PATH with a sysroot. Store the result into | ||
2666 | +# func_resolve_sysroot_result | ||
2667 | +func_resolve_sysroot () | ||
2668 | +{ | ||
2669 | + func_resolve_sysroot_result=$1 | ||
2670 | + case $func_resolve_sysroot_result in | ||
2671 | + =*) | ||
2672 | + func_stripname '=' '' "$func_resolve_sysroot_result" | ||
2673 | + func_resolve_sysroot_result=$lt_sysroot$func_stripname_result | ||
2674 | + ;; | ||
2675 | + esac | ||
2676 | +} | ||
2677 | + | ||
2678 | +# func_replace_sysroot PATH | ||
2679 | +# If PATH begins with the sysroot, replace it with = and | ||
2680 | +# store the result into func_replace_sysroot_result. | ||
2681 | +func_replace_sysroot () | ||
2682 | +{ | ||
2683 | + case "$lt_sysroot:$1" in | ||
2684 | + ?*:"$lt_sysroot"*) | ||
2685 | + func_stripname "$lt_sysroot" '' "$1" | ||
2686 | + func_replace_sysroot_result="=$func_stripname_result" | ||
2687 | + ;; | ||
2688 | + *) | ||
2689 | + # Including no sysroot. | ||
2690 | + func_replace_sysroot_result=$1 | ||
2691 | + ;; | ||
2692 | + esac | ||
2693 | +} | ||
2694 | + | ||
2695 | # func_infer_tag arg | ||
2696 | # Infer tagged configuration to use if any are available and | ||
2697 | # if one wasn't chosen via the "--tag" command line option. | ||
2698 | @@ -1184,8 +1377,7 @@ func_infer_tag () | ||
2699 | if test -n "$available_tags" && test -z "$tagname"; then | ||
2700 | CC_quoted= | ||
2701 | for arg in $CC; do | ||
2702 | - func_quote_for_eval "$arg" | ||
2703 | - CC_quoted="$CC_quoted $func_quote_for_eval_result" | ||
2704 | + func_append_quoted CC_quoted "$arg" | ||
2705 | done | ||
2706 | CC_expanded=`func_echo_all $CC` | ||
2707 | CC_quoted_expanded=`func_echo_all $CC_quoted` | ||
2708 | @@ -1204,8 +1396,7 @@ func_infer_tag () | ||
2709 | CC_quoted= | ||
2710 | for arg in $CC; do | ||
2711 | # Double-quote args containing other shell metacharacters. | ||
2712 | - func_quote_for_eval "$arg" | ||
2713 | - CC_quoted="$CC_quoted $func_quote_for_eval_result" | ||
2714 | + func_append_quoted CC_quoted "$arg" | ||
2715 | done | ||
2716 | CC_expanded=`func_echo_all $CC` | ||
2717 | CC_quoted_expanded=`func_echo_all $CC_quoted` | ||
2718 | @@ -1274,6 +1465,486 @@ EOF | ||
2719 | } | ||
2720 | } | ||
2721 | |||
2722 | + | ||
2723 | +################################################## | ||
2724 | +# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS # | ||
2725 | +################################################## | ||
2726 | + | ||
2727 | +# func_convert_core_file_wine_to_w32 ARG | ||
2728 | +# Helper function used by file name conversion functions when $build is *nix, | ||
2729 | +# and $host is mingw, cygwin, or some other w32 environment. Relies on a | ||
2730 | +# correctly configured wine environment available, with the winepath program | ||
2731 | +# in $build's $PATH. | ||
2732 | +# | ||
2733 | +# ARG is the $build file name to be converted to w32 format. | ||
2734 | +# Result is available in $func_convert_core_file_wine_to_w32_result, and will | ||
2735 | +# be empty on error (or when ARG is empty) | ||
2736 | +func_convert_core_file_wine_to_w32 () | ||
2737 | +{ | ||
2738 | + $opt_debug | ||
2739 | + func_convert_core_file_wine_to_w32_result="$1" | ||
2740 | + if test -n "$1"; then | ||
2741 | + # Unfortunately, winepath does not exit with a non-zero error code, so we | ||
2742 | + # are forced to check the contents of stdout. On the other hand, if the | ||
2743 | + # command is not found, the shell will set an exit code of 127 and print | ||
2744 | + # *an error message* to stdout. So we must check for both error code of | ||
2745 | + # zero AND non-empty stdout, which explains the odd construction: | ||
2746 | + func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null` | ||
2747 | + if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then | ||
2748 | + func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | | ||
2749 | + $SED -e "$lt_sed_naive_backslashify"` | ||
2750 | + else | ||
2751 | + func_convert_core_file_wine_to_w32_result= | ||
2752 | + fi | ||
2753 | + fi | ||
2754 | +} | ||
2755 | +# end: func_convert_core_file_wine_to_w32 | ||
2756 | + | ||
2757 | + | ||
2758 | +# func_convert_core_path_wine_to_w32 ARG | ||
2759 | +# Helper function used by path conversion functions when $build is *nix, and | ||
2760 | +# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly | ||
2761 | +# configured wine environment available, with the winepath program in $build's | ||
2762 | +# $PATH. Assumes ARG has no leading or trailing path separator characters. | ||
2763 | +# | ||
2764 | +# ARG is path to be converted from $build format to win32. | ||
2765 | +# Result is available in $func_convert_core_path_wine_to_w32_result. | ||
2766 | +# Unconvertible file (directory) names in ARG are skipped; if no directory names | ||
2767 | +# are convertible, then the result may be empty. | ||
2768 | +func_convert_core_path_wine_to_w32 () | ||
2769 | +{ | ||
2770 | + $opt_debug | ||
2771 | + # unfortunately, winepath doesn't convert paths, only file names | ||
2772 | + func_convert_core_path_wine_to_w32_result="" | ||
2773 | + if test -n "$1"; then | ||
2774 | + oldIFS=$IFS | ||
2775 | + IFS=: | ||
2776 | + for func_convert_core_path_wine_to_w32_f in $1; do | ||
2777 | + IFS=$oldIFS | ||
2778 | + func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" | ||
2779 | + if test -n "$func_convert_core_file_wine_to_w32_result" ; then | ||
2780 | + if test -z "$func_convert_core_path_wine_to_w32_result"; then | ||
2781 | + func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" | ||
2782 | + else | ||
2783 | + func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" | ||
2784 | + fi | ||
2785 | + fi | ||
2786 | + done | ||
2787 | + IFS=$oldIFS | ||
2788 | + fi | ||
2789 | +} | ||
2790 | +# end: func_convert_core_path_wine_to_w32 | ||
2791 | + | ||
2792 | + | ||
2793 | +# func_cygpath ARGS... | ||
2794 | +# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when | ||
2795 | +# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) | ||
2796 | +# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or | ||
2797 | +# (2), returns the Cygwin file name or path in func_cygpath_result (input | ||
2798 | +# file name or path is assumed to be in w32 format, as previously converted | ||
2799 | +# from $build's *nix or MSYS format). In case (3), returns the w32 file name | ||
2800 | +# or path in func_cygpath_result (input file name or path is assumed to be in | ||
2801 | +# Cygwin format). Returns an empty string on error. | ||
2802 | +# | ||
2803 | +# ARGS are passed to cygpath, with the last one being the file name or path to | ||
2804 | +# be converted. | ||
2805 | +# | ||
2806 | +# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH | ||
2807 | +# environment variable; do not put it in $PATH. | ||
2808 | +func_cygpath () | ||
2809 | +{ | ||
2810 | + $opt_debug | ||
2811 | + if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then | ||
2812 | + func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` | ||
2813 | + if test "$?" -ne 0; then | ||
2814 | + # on failure, ensure result is empty | ||
2815 | + func_cygpath_result= | ||
2816 | + fi | ||
2817 | + else | ||
2818 | + func_cygpath_result= | ||
2819 | + func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" | ||
2820 | + fi | ||
2821 | +} | ||
2822 | +#end: func_cygpath | ||
2823 | + | ||
2824 | + | ||
2825 | +# func_convert_core_msys_to_w32 ARG | ||
2826 | +# Convert file name or path ARG from MSYS format to w32 format. Return | ||
2827 | +# result in func_convert_core_msys_to_w32_result. | ||
2828 | +func_convert_core_msys_to_w32 () | ||
2829 | +{ | ||
2830 | + $opt_debug | ||
2831 | + # awkward: cmd appends spaces to result | ||
2832 | + func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | | ||
2833 | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` | ||
2834 | +} | ||
2835 | +#end: func_convert_core_msys_to_w32 | ||
2836 | + | ||
2837 | + | ||
2838 | +# func_convert_file_check ARG1 ARG2 | ||
2839 | +# Verify that ARG1 (a file name in $build format) was converted to $host | ||
2840 | +# format in ARG2. Otherwise, emit an error message, but continue (resetting | ||
2841 | +# func_to_host_file_result to ARG1). | ||
2842 | +func_convert_file_check () | ||
2843 | +{ | ||
2844 | + $opt_debug | ||
2845 | + if test -z "$2" && test -n "$1" ; then | ||
2846 | + func_error "Could not determine host file name corresponding to" | ||
2847 | + func_error " \`$1'" | ||
2848 | + func_error "Continuing, but uninstalled executables may not work." | ||
2849 | + # Fallback: | ||
2850 | + func_to_host_file_result="$1" | ||
2851 | + fi | ||
2852 | +} | ||
2853 | +# end func_convert_file_check | ||
2854 | + | ||
2855 | + | ||
2856 | +# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH | ||
2857 | +# Verify that FROM_PATH (a path in $build format) was converted to $host | ||
2858 | +# format in TO_PATH. Otherwise, emit an error message, but continue, resetting | ||
2859 | +# func_to_host_file_result to a simplistic fallback value (see below). | ||
2860 | +func_convert_path_check () | ||
2861 | +{ | ||
2862 | + $opt_debug | ||
2863 | + if test -z "$4" && test -n "$3"; then | ||
2864 | + func_error "Could not determine the host path corresponding to" | ||
2865 | + func_error " \`$3'" | ||
2866 | + func_error "Continuing, but uninstalled executables may not work." | ||
2867 | + # Fallback. This is a deliberately simplistic "conversion" and | ||
2868 | + # should not be "improved". See libtool.info. | ||
2869 | + if test "x$1" != "x$2"; then | ||
2870 | + lt_replace_pathsep_chars="s|$1|$2|g" | ||
2871 | + func_to_host_path_result=`echo "$3" | | ||
2872 | + $SED -e "$lt_replace_pathsep_chars"` | ||
2873 | + else | ||
2874 | + func_to_host_path_result="$3" | ||
2875 | + fi | ||
2876 | + fi | ||
2877 | +} | ||
2878 | +# end func_convert_path_check | ||
2879 | + | ||
2880 | + | ||
2881 | +# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG | ||
2882 | +# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT | ||
2883 | +# and appending REPL if ORIG matches BACKPAT. | ||
2884 | +func_convert_path_front_back_pathsep () | ||
2885 | +{ | ||
2886 | + $opt_debug | ||
2887 | + case $4 in | ||
2888 | + $1 ) func_to_host_path_result="$3$func_to_host_path_result" | ||
2889 | + ;; | ||
2890 | + esac | ||
2891 | + case $4 in | ||
2892 | + $2 ) func_append func_to_host_path_result "$3" | ||
2893 | + ;; | ||
2894 | + esac | ||
2895 | +} | ||
2896 | +# end func_convert_path_front_back_pathsep | ||
2897 | + | ||
2898 | + | ||
2899 | +################################################## | ||
2900 | +# $build to $host FILE NAME CONVERSION FUNCTIONS # | ||
2901 | +################################################## | ||
2902 | +# invoked via `$to_host_file_cmd ARG' | ||
2903 | +# | ||
2904 | +# In each case, ARG is the path to be converted from $build to $host format. | ||
2905 | +# Result will be available in $func_to_host_file_result. | ||
2906 | + | ||
2907 | + | ||
2908 | +# func_to_host_file ARG | ||
2909 | +# Converts the file name ARG from $build format to $host format. Return result | ||
2910 | +# in func_to_host_file_result. | ||
2911 | +func_to_host_file () | ||
2912 | +{ | ||
2913 | + $opt_debug | ||
2914 | + $to_host_file_cmd "$1" | ||
2915 | +} | ||
2916 | +# end func_to_host_file | ||
2917 | + | ||
2918 | + | ||
2919 | +# func_to_tool_file ARG LAZY | ||
2920 | +# converts the file name ARG from $build format to toolchain format. Return | ||
2921 | +# result in func_to_tool_file_result. If the conversion in use is listed | ||
2922 | +# in (the comma separated) LAZY, no conversion takes place. | ||
2923 | +func_to_tool_file () | ||
2924 | +{ | ||
2925 | + $opt_debug | ||
2926 | + case ,$2, in | ||
2927 | + *,"$to_tool_file_cmd",*) | ||
2928 | + func_to_tool_file_result=$1 | ||
2929 | + ;; | ||
2930 | + *) | ||
2931 | + $to_tool_file_cmd "$1" | ||
2932 | + func_to_tool_file_result=$func_to_host_file_result | ||
2933 | + ;; | ||
2934 | + esac | ||
2935 | +} | ||
2936 | +# end func_to_tool_file | ||
2937 | + | ||
2938 | + | ||
2939 | +# func_convert_file_noop ARG | ||
2940 | +# Copy ARG to func_to_host_file_result. | ||
2941 | +func_convert_file_noop () | ||
2942 | +{ | ||
2943 | + func_to_host_file_result="$1" | ||
2944 | +} | ||
2945 | +# end func_convert_file_noop | ||
2946 | + | ||
2947 | + | ||
2948 | +# func_convert_file_msys_to_w32 ARG | ||
2949 | +# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic | ||
2950 | +# conversion to w32 is not available inside the cwrapper. Returns result in | ||
2951 | +# func_to_host_file_result. | ||
2952 | +func_convert_file_msys_to_w32 () | ||
2953 | +{ | ||
2954 | + $opt_debug | ||
2955 | + func_to_host_file_result="$1" | ||
2956 | + if test -n "$1"; then | ||
2957 | + func_convert_core_msys_to_w32 "$1" | ||
2958 | + func_to_host_file_result="$func_convert_core_msys_to_w32_result" | ||
2959 | + fi | ||
2960 | + func_convert_file_check "$1" "$func_to_host_file_result" | ||
2961 | +} | ||
2962 | +# end func_convert_file_msys_to_w32 | ||
2963 | + | ||
2964 | + | ||
2965 | +# func_convert_file_cygwin_to_w32 ARG | ||
2966 | +# Convert file name ARG from Cygwin to w32 format. Returns result in | ||
2967 | +# func_to_host_file_result. | ||
2968 | +func_convert_file_cygwin_to_w32 () | ||
2969 | +{ | ||
2970 | + $opt_debug | ||
2971 | + func_to_host_file_result="$1" | ||
2972 | + if test -n "$1"; then | ||
2973 | + # because $build is cygwin, we call "the" cygpath in $PATH; no need to use | ||
2974 | + # LT_CYGPATH in this case. | ||
2975 | + func_to_host_file_result=`cygpath -m "$1"` | ||
2976 | + fi | ||
2977 | + func_convert_file_check "$1" "$func_to_host_file_result" | ||
2978 | +} | ||
2979 | +# end func_convert_file_cygwin_to_w32 | ||
2980 | + | ||
2981 | + | ||
2982 | +# func_convert_file_nix_to_w32 ARG | ||
2983 | +# Convert file name ARG from *nix to w32 format. Requires a wine environment | ||
2984 | +# and a working winepath. Returns result in func_to_host_file_result. | ||
2985 | +func_convert_file_nix_to_w32 () | ||
2986 | +{ | ||
2987 | + $opt_debug | ||
2988 | + func_to_host_file_result="$1" | ||
2989 | + if test -n "$1"; then | ||
2990 | + func_convert_core_file_wine_to_w32 "$1" | ||
2991 | + func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" | ||
2992 | + fi | ||
2993 | + func_convert_file_check "$1" "$func_to_host_file_result" | ||
2994 | +} | ||
2995 | +# end func_convert_file_nix_to_w32 | ||
2996 | + | ||
2997 | + | ||
2998 | +# func_convert_file_msys_to_cygwin ARG | ||
2999 | +# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. | ||
3000 | +# Returns result in func_to_host_file_result. | ||
3001 | +func_convert_file_msys_to_cygwin () | ||
3002 | +{ | ||
3003 | + $opt_debug | ||
3004 | + func_to_host_file_result="$1" | ||
3005 | + if test -n "$1"; then | ||
3006 | + func_convert_core_msys_to_w32 "$1" | ||
3007 | + func_cygpath -u "$func_convert_core_msys_to_w32_result" | ||
3008 | + func_to_host_file_result="$func_cygpath_result" | ||
3009 | + fi | ||
3010 | + func_convert_file_check "$1" "$func_to_host_file_result" | ||
3011 | +} | ||
3012 | +# end func_convert_file_msys_to_cygwin | ||
3013 | + | ||
3014 | + | ||
3015 | +# func_convert_file_nix_to_cygwin ARG | ||
3016 | +# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed | ||
3017 | +# in a wine environment, working winepath, and LT_CYGPATH set. Returns result | ||
3018 | +# in func_to_host_file_result. | ||
3019 | +func_convert_file_nix_to_cygwin () | ||
3020 | +{ | ||
3021 | + $opt_debug | ||
3022 | + func_to_host_file_result="$1" | ||
3023 | + if test -n "$1"; then | ||
3024 | + # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. | ||
3025 | + func_convert_core_file_wine_to_w32 "$1" | ||
3026 | + func_cygpath -u "$func_convert_core_file_wine_to_w32_result" | ||
3027 | + func_to_host_file_result="$func_cygpath_result" | ||
3028 | + fi | ||
3029 | + func_convert_file_check "$1" "$func_to_host_file_result" | ||
3030 | +} | ||
3031 | +# end func_convert_file_nix_to_cygwin | ||
3032 | + | ||
3033 | + | ||
3034 | +############################################# | ||
3035 | +# $build to $host PATH CONVERSION FUNCTIONS # | ||
3036 | +############################################# | ||
3037 | +# invoked via `$to_host_path_cmd ARG' | ||
3038 | +# | ||
3039 | +# In each case, ARG is the path to be converted from $build to $host format. | ||
3040 | +# The result will be available in $func_to_host_path_result. | ||
3041 | +# | ||
3042 | +# Path separators are also converted from $build format to $host format. If | ||
3043 | +# ARG begins or ends with a path separator character, it is preserved (but | ||
3044 | +# converted to $host format) on output. | ||
3045 | +# | ||
3046 | +# All path conversion functions are named using the following convention: | ||
3047 | +# file name conversion function : func_convert_file_X_to_Y () | ||
3048 | +# path conversion function : func_convert_path_X_to_Y () | ||
3049 | +# where, for any given $build/$host combination the 'X_to_Y' value is the | ||
3050 | +# same. If conversion functions are added for new $build/$host combinations, | ||
3051 | +# the two new functions must follow this pattern, or func_init_to_host_path_cmd | ||
3052 | +# will break. | ||
3053 | + | ||
3054 | + | ||
3055 | +# func_init_to_host_path_cmd | ||
3056 | +# Ensures that function "pointer" variable $to_host_path_cmd is set to the | ||
3057 | +# appropriate value, based on the value of $to_host_file_cmd. | ||
3058 | +to_host_path_cmd= | ||
3059 | +func_init_to_host_path_cmd () | ||
3060 | +{ | ||
3061 | + $opt_debug | ||
3062 | + if test -z "$to_host_path_cmd"; then | ||
3063 | + func_stripname 'func_convert_file_' '' "$to_host_file_cmd" | ||
3064 | + to_host_path_cmd="func_convert_path_${func_stripname_result}" | ||
3065 | + fi | ||
3066 | +} | ||
3067 | + | ||
3068 | + | ||
3069 | +# func_to_host_path ARG | ||
3070 | +# Converts the path ARG from $build format to $host format. Return result | ||
3071 | +# in func_to_host_path_result. | ||
3072 | +func_to_host_path () | ||
3073 | +{ | ||
3074 | + $opt_debug | ||
3075 | + func_init_to_host_path_cmd | ||
3076 | + $to_host_path_cmd "$1" | ||
3077 | +} | ||
3078 | +# end func_to_host_path | ||
3079 | + | ||
3080 | + | ||
3081 | +# func_convert_path_noop ARG | ||
3082 | +# Copy ARG to func_to_host_path_result. | ||
3083 | +func_convert_path_noop () | ||
3084 | +{ | ||
3085 | + func_to_host_path_result="$1" | ||
3086 | +} | ||
3087 | +# end func_convert_path_noop | ||
3088 | + | ||
3089 | + | ||
3090 | +# func_convert_path_msys_to_w32 ARG | ||
3091 | +# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic | ||
3092 | +# conversion to w32 is not available inside the cwrapper. Returns result in | ||
3093 | +# func_to_host_path_result. | ||
3094 | +func_convert_path_msys_to_w32 () | ||
3095 | +{ | ||
3096 | + $opt_debug | ||
3097 | + func_to_host_path_result="$1" | ||
3098 | + if test -n "$1"; then | ||
3099 | + # Remove leading and trailing path separator characters from ARG. MSYS | ||
3100 | + # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; | ||
3101 | + # and winepath ignores them completely. | ||
3102 | + func_stripname : : "$1" | ||
3103 | + func_to_host_path_tmp1=$func_stripname_result | ||
3104 | + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" | ||
3105 | + func_to_host_path_result="$func_convert_core_msys_to_w32_result" | ||
3106 | + func_convert_path_check : ";" \ | ||
3107 | + "$func_to_host_path_tmp1" "$func_to_host_path_result" | ||
3108 | + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" | ||
3109 | + fi | ||
3110 | +} | ||
3111 | +# end func_convert_path_msys_to_w32 | ||
3112 | + | ||
3113 | + | ||
3114 | +# func_convert_path_cygwin_to_w32 ARG | ||
3115 | +# Convert path ARG from Cygwin to w32 format. Returns result in | ||
3116 | +# func_to_host_file_result. | ||
3117 | +func_convert_path_cygwin_to_w32 () | ||
3118 | +{ | ||
3119 | + $opt_debug | ||
3120 | + func_to_host_path_result="$1" | ||
3121 | + if test -n "$1"; then | ||
3122 | + # See func_convert_path_msys_to_w32: | ||
3123 | + func_stripname : : "$1" | ||
3124 | + func_to_host_path_tmp1=$func_stripname_result | ||
3125 | + func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` | ||
3126 | + func_convert_path_check : ";" \ | ||
3127 | + "$func_to_host_path_tmp1" "$func_to_host_path_result" | ||
3128 | + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" | ||
3129 | + fi | ||
3130 | +} | ||
3131 | +# end func_convert_path_cygwin_to_w32 | ||
3132 | + | ||
3133 | + | ||
3134 | +# func_convert_path_nix_to_w32 ARG | ||
3135 | +# Convert path ARG from *nix to w32 format. Requires a wine environment and | ||
3136 | +# a working winepath. Returns result in func_to_host_file_result. | ||
3137 | +func_convert_path_nix_to_w32 () | ||
3138 | +{ | ||
3139 | + $opt_debug | ||
3140 | + func_to_host_path_result="$1" | ||
3141 | + if test -n "$1"; then | ||
3142 | + # See func_convert_path_msys_to_w32: | ||
3143 | + func_stripname : : "$1" | ||
3144 | + func_to_host_path_tmp1=$func_stripname_result | ||
3145 | + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" | ||
3146 | + func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" | ||
3147 | + func_convert_path_check : ";" \ | ||
3148 | + "$func_to_host_path_tmp1" "$func_to_host_path_result" | ||
3149 | + func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" | ||
3150 | + fi | ||
3151 | +} | ||
3152 | +# end func_convert_path_nix_to_w32 | ||
3153 | + | ||
3154 | + | ||
3155 | +# func_convert_path_msys_to_cygwin ARG | ||
3156 | +# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. | ||
3157 | +# Returns result in func_to_host_file_result. | ||
3158 | +func_convert_path_msys_to_cygwin () | ||
3159 | +{ | ||
3160 | + $opt_debug | ||
3161 | + func_to_host_path_result="$1" | ||
3162 | + if test -n "$1"; then | ||
3163 | + # See func_convert_path_msys_to_w32: | ||
3164 | + func_stripname : : "$1" | ||
3165 | + func_to_host_path_tmp1=$func_stripname_result | ||
3166 | + func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" | ||
3167 | + func_cygpath -u -p "$func_convert_core_msys_to_w32_result" | ||
3168 | + func_to_host_path_result="$func_cygpath_result" | ||
3169 | + func_convert_path_check : : \ | ||
3170 | + "$func_to_host_path_tmp1" "$func_to_host_path_result" | ||
3171 | + func_convert_path_front_back_pathsep ":*" "*:" : "$1" | ||
3172 | + fi | ||
3173 | +} | ||
3174 | +# end func_convert_path_msys_to_cygwin | ||
3175 | + | ||
3176 | + | ||
3177 | +# func_convert_path_nix_to_cygwin ARG | ||
3178 | +# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a | ||
3179 | +# a wine environment, working winepath, and LT_CYGPATH set. Returns result in | ||
3180 | +# func_to_host_file_result. | ||
3181 | +func_convert_path_nix_to_cygwin () | ||
3182 | +{ | ||
3183 | + $opt_debug | ||
3184 | + func_to_host_path_result="$1" | ||
3185 | + if test -n "$1"; then | ||
3186 | + # Remove leading and trailing path separator characters from | ||
3187 | + # ARG. msys behavior is inconsistent here, cygpath turns them | ||
3188 | + # into '.;' and ';.', and winepath ignores them completely. | ||
3189 | + func_stripname : : "$1" | ||
3190 | + func_to_host_path_tmp1=$func_stripname_result | ||
3191 | + func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" | ||
3192 | + func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" | ||
3193 | + func_to_host_path_result="$func_cygpath_result" | ||
3194 | + func_convert_path_check : : \ | ||
3195 | + "$func_to_host_path_tmp1" "$func_to_host_path_result" | ||
3196 | + func_convert_path_front_back_pathsep ":*" "*:" : "$1" | ||
3197 | + fi | ||
3198 | +} | ||
3199 | +# end func_convert_path_nix_to_cygwin | ||
3200 | + | ||
3201 | + | ||
3202 | # func_mode_compile arg... | ||
3203 | func_mode_compile () | ||
3204 | { | ||
3205 | @@ -1314,12 +1985,12 @@ func_mode_compile () | ||
3206 | ;; | ||
3207 | |||
3208 | -pie | -fpie | -fPIE) | ||
3209 | - pie_flag="$pie_flag $arg" | ||
3210 | + func_append pie_flag " $arg" | ||
3211 | continue | ||
3212 | ;; | ||
3213 | |||
3214 | -shared | -static | -prefer-pic | -prefer-non-pic) | ||
3215 | - later="$later $arg" | ||
3216 | + func_append later " $arg" | ||
3217 | continue | ||
3218 | ;; | ||
3219 | |||
3220 | @@ -1340,15 +2011,14 @@ func_mode_compile () | ||
3221 | save_ifs="$IFS"; IFS=',' | ||
3222 | for arg in $args; do | ||
3223 | IFS="$save_ifs" | ||
3224 | - func_quote_for_eval "$arg" | ||
3225 | - lastarg="$lastarg $func_quote_for_eval_result" | ||
3226 | + func_append_quoted lastarg "$arg" | ||
3227 | done | ||
3228 | IFS="$save_ifs" | ||
3229 | func_stripname ' ' '' "$lastarg" | ||
3230 | lastarg=$func_stripname_result | ||
3231 | |||
3232 | # Add the arguments to base_compile. | ||
3233 | - base_compile="$base_compile $lastarg" | ||
3234 | + func_append base_compile " $lastarg" | ||
3235 | continue | ||
3236 | ;; | ||
3237 | |||
3238 | @@ -1364,8 +2034,7 @@ func_mode_compile () | ||
3239 | esac # case $arg_mode | ||
3240 | |||
3241 | # Aesthetically quote the previous argument. | ||
3242 | - func_quote_for_eval "$lastarg" | ||
3243 | - base_compile="$base_compile $func_quote_for_eval_result" | ||
3244 | + func_append_quoted base_compile "$lastarg" | ||
3245 | done # for arg | ||
3246 | |||
3247 | case $arg_mode in | ||
3248 | @@ -1496,17 +2165,16 @@ compiler." | ||
3249 | $opt_dry_run || $RM $removelist | ||
3250 | exit $EXIT_FAILURE | ||
3251 | fi | ||
3252 | - removelist="$removelist $output_obj" | ||
3253 | + func_append removelist " $output_obj" | ||
3254 | $ECHO "$srcfile" > "$lockfile" | ||
3255 | fi | ||
3256 | |||
3257 | $opt_dry_run || $RM $removelist | ||
3258 | - removelist="$removelist $lockfile" | ||
3259 | + func_append removelist " $lockfile" | ||
3260 | trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 | ||
3261 | |||
3262 | - if test -n "$fix_srcfile_path"; then | ||
3263 | - eval "srcfile=\"$fix_srcfile_path\"" | ||
3264 | - fi | ||
3265 | + func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 | ||
3266 | + srcfile=$func_to_tool_file_result | ||
3267 | func_quote_for_eval "$srcfile" | ||
3268 | qsrcfile=$func_quote_for_eval_result | ||
3269 | |||
3270 | @@ -1526,7 +2194,7 @@ compiler." | ||
3271 | |||
3272 | if test -z "$output_obj"; then | ||
3273 | # Place PIC objects in $objdir | ||
3274 | - command="$command -o $lobj" | ||
3275 | + func_append command " -o $lobj" | ||
3276 | fi | ||
3277 | |||
3278 | func_show_eval_locale "$command" \ | ||
3279 | @@ -1573,11 +2241,11 @@ compiler." | ||
3280 | command="$base_compile $qsrcfile $pic_flag" | ||
3281 | fi | ||
3282 | if test "$compiler_c_o" = yes; then | ||
3283 | - command="$command -o $obj" | ||
3284 | + func_append command " -o $obj" | ||
3285 | fi | ||
3286 | |||
3287 | # Suppress compiler output if we already did a PIC compilation. | ||
3288 | - command="$command$suppress_output" | ||
3289 | + func_append command "$suppress_output" | ||
3290 | func_show_eval_locale "$command" \ | ||
3291 | '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' | ||
3292 | |||
3293 | @@ -1622,13 +2290,13 @@ compiler." | ||
3294 | } | ||
3295 | |||
3296 | $opt_help || { | ||
3297 | - test "$mode" = compile && func_mode_compile ${1+"$@"} | ||
3298 | + test "$opt_mode" = compile && func_mode_compile ${1+"$@"} | ||
3299 | } | ||
3300 | |||
3301 | func_mode_help () | ||
3302 | { | ||
3303 | # We need to display help for each of the modes. | ||
3304 | - case $mode in | ||
3305 | + case $opt_mode in | ||
3306 | "") | ||
3307 | # Generic help is extracted from the usage comments | ||
3308 | # at the start of this file. | ||
3309 | @@ -1659,8 +2327,8 @@ This mode accepts the following additional options: | ||
3310 | |||
3311 | -o OUTPUT-FILE set the output file name to OUTPUT-FILE | ||
3312 | -no-suppress do not suppress compiler output for multiple passes | ||
3313 | - -prefer-pic try to building PIC objects only | ||
3314 | - -prefer-non-pic try to building non-PIC objects only | ||
3315 | + -prefer-pic try to build PIC objects only | ||
3316 | + -prefer-non-pic try to build non-PIC objects only | ||
3317 | -shared do not build a \`.o' file suitable for static linking | ||
3318 | -static only build a \`.o' file suitable for static linking | ||
3319 | -Wc,FLAG pass FLAG directly to the compiler | ||
3320 | @@ -1804,7 +2472,7 @@ Otherwise, only FILE itself is deleted using RM." | ||
3321 | ;; | ||
3322 | |||
3323 | *) | ||
3324 | - func_fatal_help "invalid operation mode \`$mode'" | ||
3325 | + func_fatal_help "invalid operation mode \`$opt_mode'" | ||
3326 | ;; | ||
3327 | esac | ||
3328 | |||
3329 | @@ -1819,13 +2487,13 @@ if $opt_help; then | ||
3330 | else | ||
3331 | { | ||
3332 | func_help noexit | ||
3333 | - for mode in compile link execute install finish uninstall clean; do | ||
3334 | + for opt_mode in compile link execute install finish uninstall clean; do | ||
3335 | func_mode_help | ||
3336 | done | ||
3337 | } | sed -n '1p; 2,$s/^Usage:/ or: /p' | ||
3338 | { | ||
3339 | func_help noexit | ||
3340 | - for mode in compile link execute install finish uninstall clean; do | ||
3341 | + for opt_mode in compile link execute install finish uninstall clean; do | ||
3342 | echo | ||
3343 | func_mode_help | ||
3344 | done | ||
3345 | @@ -1854,13 +2522,16 @@ func_mode_execute () | ||
3346 | func_fatal_help "you must specify a COMMAND" | ||
3347 | |||
3348 | # Handle -dlopen flags immediately. | ||
3349 | - for file in $execute_dlfiles; do | ||
3350 | + for file in $opt_dlopen; do | ||
3351 | test -f "$file" \ | ||
3352 | || func_fatal_help "\`$file' is not a file" | ||
3353 | |||
3354 | dir= | ||
3355 | case $file in | ||
3356 | *.la) | ||
3357 | + func_resolve_sysroot "$file" | ||
3358 | + file=$func_resolve_sysroot_result | ||
3359 | + | ||
3360 | # Check to see that this really is a libtool archive. | ||
3361 | func_lalib_unsafe_p "$file" \ | ||
3362 | || func_fatal_help "\`$lib' is not a valid libtool archive" | ||
3363 | @@ -1882,7 +2553,7 @@ func_mode_execute () | ||
3364 | dir="$func_dirname_result" | ||
3365 | |||
3366 | if test -f "$dir/$objdir/$dlname"; then | ||
3367 | - dir="$dir/$objdir" | ||
3368 | + func_append dir "/$objdir" | ||
3369 | else | ||
3370 | if test ! -f "$dir/$dlname"; then | ||
3371 | func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" | ||
3372 | @@ -1907,10 +2578,10 @@ func_mode_execute () | ||
3373 | test -n "$absdir" && dir="$absdir" | ||
3374 | |||
3375 | # Now add the directory to shlibpath_var. | ||
3376 | - if eval test -z \"\$$shlibpath_var\"; then | ||
3377 | - eval $shlibpath_var=\$dir | ||
3378 | + if eval "test -z \"\$$shlibpath_var\""; then | ||
3379 | + eval "$shlibpath_var=\"\$dir\"" | ||
3380 | else | ||
3381 | - eval $shlibpath_var=\$dir:\$$shlibpath_var | ||
3382 | + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" | ||
3383 | fi | ||
3384 | done | ||
3385 | |||
3386 | @@ -1939,8 +2610,7 @@ func_mode_execute () | ||
3387 | ;; | ||
3388 | esac | ||
3389 | # Quote arguments (to preserve shell metacharacters). | ||
3390 | - func_quote_for_eval "$file" | ||
3391 | - args="$args $func_quote_for_eval_result" | ||
3392 | + func_append_quoted args "$file" | ||
3393 | done | ||
3394 | |||
3395 | if test "X$opt_dry_run" = Xfalse; then | ||
3396 | @@ -1972,22 +2642,59 @@ func_mode_execute () | ||
3397 | fi | ||
3398 | } | ||
3399 | |||
3400 | -test "$mode" = execute && func_mode_execute ${1+"$@"} | ||
3401 | +test "$opt_mode" = execute && func_mode_execute ${1+"$@"} | ||
3402 | |||
3403 | |||
3404 | # func_mode_finish arg... | ||
3405 | func_mode_finish () | ||
3406 | { | ||
3407 | $opt_debug | ||
3408 | - libdirs="$nonopt" | ||
3409 | + libs= | ||
3410 | + libdirs= | ||
3411 | admincmds= | ||
3412 | |||
3413 | - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then | ||
3414 | - for dir | ||
3415 | - do | ||
3416 | - libdirs="$libdirs $dir" | ||
3417 | - done | ||
3418 | + for opt in "$nonopt" ${1+"$@"} | ||
3419 | + do | ||
3420 | + if test -d "$opt"; then | ||
3421 | + func_append libdirs " $opt" | ||
3422 | |||
3423 | + elif test -f "$opt"; then | ||
3424 | + if func_lalib_unsafe_p "$opt"; then | ||
3425 | + func_append libs " $opt" | ||
3426 | + else | ||
3427 | + func_warning "\`$opt' is not a valid libtool archive" | ||
3428 | + fi | ||
3429 | + | ||
3430 | + else | ||
3431 | + func_fatal_error "invalid argument \`$opt'" | ||
3432 | + fi | ||
3433 | + done | ||
3434 | + | ||
3435 | + if test -n "$libs"; then | ||
3436 | + if test -n "$lt_sysroot"; then | ||
3437 | + sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` | ||
3438 | + sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" | ||
3439 | + else | ||
3440 | + sysroot_cmd= | ||
3441 | + fi | ||
3442 | + | ||
3443 | + # Remove sysroot references | ||
3444 | + if $opt_dry_run; then | ||
3445 | + for lib in $libs; do | ||
3446 | + echo "removing references to $lt_sysroot and \`=' prefixes from $lib" | ||
3447 | + done | ||
3448 | + else | ||
3449 | + tmpdir=`func_mktempdir` | ||
3450 | + for lib in $libs; do | ||
3451 | + sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ | ||
3452 | + > $tmpdir/tmp-la | ||
3453 | + mv -f $tmpdir/tmp-la $lib | ||
3454 | + done | ||
3455 | + ${RM}r "$tmpdir" | ||
3456 | + fi | ||
3457 | + fi | ||
3458 | + | ||
3459 | + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then | ||
3460 | for libdir in $libdirs; do | ||
3461 | if test -n "$finish_cmds"; then | ||
3462 | # Do each command in the finish commands. | ||
3463 | @@ -1997,7 +2704,7 @@ func_mode_finish () | ||
3464 | if test -n "$finish_eval"; then | ||
3465 | # Do the single finish_eval. | ||
3466 | eval cmds=\"$finish_eval\" | ||
3467 | - $opt_dry_run || eval "$cmds" || admincmds="$admincmds | ||
3468 | + $opt_dry_run || eval "$cmds" || func_append admincmds " | ||
3469 | $cmds" | ||
3470 | fi | ||
3471 | done | ||
3472 | @@ -2006,53 +2713,55 @@ func_mode_finish () | ||
3473 | # Exit here if they wanted silent mode. | ||
3474 | $opt_silent && exit $EXIT_SUCCESS | ||
3475 | |||
3476 | - echo "----------------------------------------------------------------------" | ||
3477 | - echo "Libraries have been installed in:" | ||
3478 | - for libdir in $libdirs; do | ||
3479 | - $ECHO " $libdir" | ||
3480 | - done | ||
3481 | - echo | ||
3482 | - echo "If you ever happen to want to link against installed libraries" | ||
3483 | - echo "in a given directory, LIBDIR, you must either use libtool, and" | ||
3484 | - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" | ||
3485 | - echo "flag during linking and do at least one of the following:" | ||
3486 | - if test -n "$shlibpath_var"; then | ||
3487 | - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" | ||
3488 | - echo " during execution" | ||
3489 | - fi | ||
3490 | - if test -n "$runpath_var"; then | ||
3491 | - echo " - add LIBDIR to the \`$runpath_var' environment variable" | ||
3492 | - echo " during linking" | ||
3493 | - fi | ||
3494 | - if test -n "$hardcode_libdir_flag_spec"; then | ||
3495 | - libdir=LIBDIR | ||
3496 | - eval "flag=\"$hardcode_libdir_flag_spec\"" | ||
3497 | + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then | ||
3498 | + echo "----------------------------------------------------------------------" | ||
3499 | + echo "Libraries have been installed in:" | ||
3500 | + for libdir in $libdirs; do | ||
3501 | + $ECHO " $libdir" | ||
3502 | + done | ||
3503 | + echo | ||
3504 | + echo "If you ever happen to want to link against installed libraries" | ||
3505 | + echo "in a given directory, LIBDIR, you must either use libtool, and" | ||
3506 | + echo "specify the full pathname of the library, or use the \`-LLIBDIR'" | ||
3507 | + echo "flag during linking and do at least one of the following:" | ||
3508 | + if test -n "$shlibpath_var"; then | ||
3509 | + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" | ||
3510 | + echo " during execution" | ||
3511 | + fi | ||
3512 | + if test -n "$runpath_var"; then | ||
3513 | + echo " - add LIBDIR to the \`$runpath_var' environment variable" | ||
3514 | + echo " during linking" | ||
3515 | + fi | ||
3516 | + if test -n "$hardcode_libdir_flag_spec"; then | ||
3517 | + libdir=LIBDIR | ||
3518 | + eval flag=\"$hardcode_libdir_flag_spec\" | ||
3519 | |||
3520 | - $ECHO " - use the \`$flag' linker flag" | ||
3521 | - fi | ||
3522 | - if test -n "$admincmds"; then | ||
3523 | - $ECHO " - have your system administrator run these commands:$admincmds" | ||
3524 | - fi | ||
3525 | - if test -f /etc/ld.so.conf; then | ||
3526 | - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" | ||
3527 | - fi | ||
3528 | - echo | ||
3529 | + $ECHO " - use the \`$flag' linker flag" | ||
3530 | + fi | ||
3531 | + if test -n "$admincmds"; then | ||
3532 | + $ECHO " - have your system administrator run these commands:$admincmds" | ||
3533 | + fi | ||
3534 | + if test -f /etc/ld.so.conf; then | ||
3535 | + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" | ||
3536 | + fi | ||
3537 | + echo | ||
3538 | |||
3539 | - echo "See any operating system documentation about shared libraries for" | ||
3540 | - case $host in | ||
3541 | - solaris2.[6789]|solaris2.1[0-9]) | ||
3542 | - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" | ||
3543 | - echo "pages." | ||
3544 | - ;; | ||
3545 | - *) | ||
3546 | - echo "more information, such as the ld(1) and ld.so(8) manual pages." | ||
3547 | - ;; | ||
3548 | - esac | ||
3549 | - echo "----------------------------------------------------------------------" | ||
3550 | + echo "See any operating system documentation about shared libraries for" | ||
3551 | + case $host in | ||
3552 | + solaris2.[6789]|solaris2.1[0-9]) | ||
3553 | + echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" | ||
3554 | + echo "pages." | ||
3555 | + ;; | ||
3556 | + *) | ||
3557 | + echo "more information, such as the ld(1) and ld.so(8) manual pages." | ||
3558 | + ;; | ||
3559 | + esac | ||
3560 | + echo "----------------------------------------------------------------------" | ||
3561 | + fi | ||
3562 | exit $EXIT_SUCCESS | ||
3563 | } | ||
3564 | |||
3565 | -test "$mode" = finish && func_mode_finish ${1+"$@"} | ||
3566 | +test "$opt_mode" = finish && func_mode_finish ${1+"$@"} | ||
3567 | |||
3568 | |||
3569 | # func_mode_install arg... | ||
3570 | @@ -2077,7 +2786,7 @@ func_mode_install () | ||
3571 | # The real first argument should be the name of the installation program. | ||
3572 | # Aesthetically quote it. | ||
3573 | func_quote_for_eval "$arg" | ||
3574 | - install_prog="$install_prog$func_quote_for_eval_result" | ||
3575 | + func_append install_prog "$func_quote_for_eval_result" | ||
3576 | install_shared_prog=$install_prog | ||
3577 | case " $install_prog " in | ||
3578 | *[\\\ /]cp\ *) install_cp=: ;; | ||
3579 | @@ -2097,7 +2806,7 @@ func_mode_install () | ||
3580 | do | ||
3581 | arg2= | ||
3582 | if test -n "$dest"; then | ||
3583 | - files="$files $dest" | ||
3584 | + func_append files " $dest" | ||
3585 | dest=$arg | ||
3586 | continue | ||
3587 | fi | ||
3588 | @@ -2135,11 +2844,11 @@ func_mode_install () | ||
3589 | |||
3590 | # Aesthetically quote the argument. | ||
3591 | func_quote_for_eval "$arg" | ||
3592 | - install_prog="$install_prog $func_quote_for_eval_result" | ||
3593 | + func_append install_prog " $func_quote_for_eval_result" | ||
3594 | if test -n "$arg2"; then | ||
3595 | func_quote_for_eval "$arg2" | ||
3596 | fi | ||
3597 | - install_shared_prog="$install_shared_prog $func_quote_for_eval_result" | ||
3598 | + func_append install_shared_prog " $func_quote_for_eval_result" | ||
3599 | done | ||
3600 | |||
3601 | test -z "$install_prog" && \ | ||
3602 | @@ -2151,7 +2860,7 @@ func_mode_install () | ||
3603 | if test -n "$install_override_mode" && $no_mode; then | ||
3604 | if $install_cp; then :; else | ||
3605 | func_quote_for_eval "$install_override_mode" | ||
3606 | - install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" | ||
3607 | + func_append install_shared_prog " -m $func_quote_for_eval_result" | ||
3608 | fi | ||
3609 | fi | ||
3610 | |||
3611 | @@ -2209,10 +2918,13 @@ func_mode_install () | ||
3612 | case $file in | ||
3613 | *.$libext) | ||
3614 | # Do the static libraries later. | ||
3615 | - staticlibs="$staticlibs $file" | ||
3616 | + func_append staticlibs " $file" | ||
3617 | ;; | ||
3618 | |||
3619 | *.la) | ||
3620 | + func_resolve_sysroot "$file" | ||
3621 | + file=$func_resolve_sysroot_result | ||
3622 | + | ||
3623 | # Check to see that this really is a libtool archive. | ||
3624 | func_lalib_unsafe_p "$file" \ | ||
3625 | || func_fatal_help "\`$file' is not a valid libtool archive" | ||
3626 | @@ -2226,23 +2938,30 @@ func_mode_install () | ||
3627 | if test "X$destdir" = "X$libdir"; then | ||
3628 | case "$current_libdirs " in | ||
3629 | *" $libdir "*) ;; | ||
3630 | - *) current_libdirs="$current_libdirs $libdir" ;; | ||
3631 | + *) func_append current_libdirs " $libdir" ;; | ||
3632 | esac | ||
3633 | else | ||
3634 | # Note the libdir as a future libdir. | ||
3635 | case "$future_libdirs " in | ||
3636 | *" $libdir "*) ;; | ||
3637 | - *) future_libdirs="$future_libdirs $libdir" ;; | ||
3638 | + *) func_append future_libdirs " $libdir" ;; | ||
3639 | esac | ||
3640 | fi | ||
3641 | |||
3642 | func_dirname "$file" "/" "" | ||
3643 | dir="$func_dirname_result" | ||
3644 | - dir="$dir$objdir" | ||
3645 | + func_append dir "$objdir" | ||
3646 | |||
3647 | if test -n "$relink_command"; then | ||
3648 | + # Strip any trailing slash from the destination. | ||
3649 | + func_stripname '' '/' "$libdir" | ||
3650 | + destlibdir=$func_stripname_result | ||
3651 | + | ||
3652 | + func_stripname '' '/' "$destdir" | ||
3653 | + s_destdir=$func_stripname_result | ||
3654 | + | ||
3655 | # Determine the prefix the user has applied to our future dir. | ||
3656 | - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` | ||
3657 | + inst_prefix_dir=`$ECHO "X$s_destdir" | $Xsed -e "s%$destlibdir\$%%"` | ||
3658 | |||
3659 | # Don't allow the user to place us outside of our expected | ||
3660 | # location b/c this prevents finding dependent libraries that | ||
3661 | @@ -2315,7 +3034,7 @@ func_mode_install () | ||
3662 | func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' | ||
3663 | |||
3664 | # Maybe install the static library, too. | ||
3665 | - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" | ||
3666 | + test -n "$old_library" && func_append staticlibs " $dir/$old_library" | ||
3667 | ;; | ||
3668 | |||
3669 | *.lo) | ||
3670 | @@ -2503,7 +3222,7 @@ func_mode_install () | ||
3671 | test -n "$future_libdirs" && \ | ||
3672 | func_warning "remember to run \`$progname --finish$future_libdirs'" | ||
3673 | |||
3674 | - if test -n "$current_libdirs" && $opt_finish; then | ||
3675 | + if test -n "$current_libdirs"; then | ||
3676 | # Maybe just do a dry run. | ||
3677 | $opt_dry_run && current_libdirs=" -n$current_libdirs" | ||
3678 | exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' | ||
3679 | @@ -2512,7 +3231,7 @@ func_mode_install () | ||
3680 | fi | ||
3681 | } | ||
3682 | |||
3683 | -test "$mode" = install && func_mode_install ${1+"$@"} | ||
3684 | +test "$opt_mode" = install && func_mode_install ${1+"$@"} | ||
3685 | |||
3686 | |||
3687 | # func_generate_dlsyms outputname originator pic_p | ||
3688 | @@ -2559,6 +3278,18 @@ extern \"C\" { | ||
3689 | #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" | ||
3690 | #endif | ||
3691 | |||
3692 | +/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ | ||
3693 | +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) | ||
3694 | +/* DATA imports from DLLs on WIN32 con't be const, because runtime | ||
3695 | + relocations are performed -- see ld's documentation on pseudo-relocs. */ | ||
3696 | +# define LT_DLSYM_CONST | ||
3697 | +#elif defined(__osf__) | ||
3698 | +/* This system does not cope well with relocations in const data. */ | ||
3699 | +# define LT_DLSYM_CONST | ||
3700 | +#else | ||
3701 | +# define LT_DLSYM_CONST const | ||
3702 | +#endif | ||
3703 | + | ||
3704 | /* External symbol declarations for the compiler. */\ | ||
3705 | " | ||
3706 | |||
3707 | @@ -2570,21 +3301,22 @@ extern \"C\" { | ||
3708 | # Add our own program objects to the symbol list. | ||
3709 | progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` | ||
3710 | for progfile in $progfiles; do | ||
3711 | - func_verbose "extracting global C symbols from \`$progfile'" | ||
3712 | - $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" | ||
3713 | + func_to_tool_file "$progfile" func_convert_file_msys_to_w32 | ||
3714 | + func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" | ||
3715 | + $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" | ||
3716 | done | ||
3717 | |||
3718 | if test -n "$exclude_expsyms"; then | ||
3719 | $opt_dry_run || { | ||
3720 | - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T | ||
3721 | - $MV "$nlist"T "$nlist" | ||
3722 | + eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' | ||
3723 | + eval '$MV "$nlist"T "$nlist"' | ||
3724 | } | ||
3725 | fi | ||
3726 | |||
3727 | if test -n "$export_symbols_regex"; then | ||
3728 | $opt_dry_run || { | ||
3729 | - $EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T | ||
3730 | - $MV "$nlist"T "$nlist" | ||
3731 | + eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' | ||
3732 | + eval '$MV "$nlist"T "$nlist"' | ||
3733 | } | ||
3734 | fi | ||
3735 | |||
3736 | @@ -2593,23 +3325,23 @@ extern \"C\" { | ||
3737 | export_symbols="$output_objdir/$outputname.exp" | ||
3738 | $opt_dry_run || { | ||
3739 | $RM $export_symbols | ||
3740 | - ${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' < "$nlist" > "$export_symbols" | ||
3741 | + eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' | ||
3742 | case $host in | ||
3743 | *cygwin* | *mingw* | *cegcc* ) | ||
3744 | - echo EXPORTS > "$output_objdir/$outputname.def" | ||
3745 | - cat "$export_symbols" >> "$output_objdir/$outputname.def" | ||
3746 | + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' | ||
3747 | + eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' | ||
3748 | ;; | ||
3749 | esac | ||
3750 | } | ||
3751 | else | ||
3752 | $opt_dry_run || { | ||
3753 | - ${SED} -e 's/\([].[*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/' < "$export_symbols" > "$output_objdir/$outputname.exp" | ||
3754 | - $GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T | ||
3755 | - $MV "$nlist"T "$nlist" | ||
3756 | + eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' | ||
3757 | + eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' | ||
3758 | + eval '$MV "$nlist"T "$nlist"' | ||
3759 | case $host in | ||
3760 | *cygwin* | *mingw* | *cegcc* ) | ||
3761 | - echo EXPORTS > "$output_objdir/$outputname.def" | ||
3762 | - cat "$nlist" >> "$output_objdir/$outputname.def" | ||
3763 | + eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' | ||
3764 | + eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' | ||
3765 | ;; | ||
3766 | esac | ||
3767 | } | ||
3768 | @@ -2620,10 +3352,52 @@ extern \"C\" { | ||
3769 | func_verbose "extracting global C symbols from \`$dlprefile'" | ||
3770 | func_basename "$dlprefile" | ||
3771 | name="$func_basename_result" | ||
3772 | - $opt_dry_run || { | ||
3773 | - $ECHO ": $name " >> "$nlist" | ||
3774 | - eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" | ||
3775 | - } | ||
3776 | + case $host in | ||
3777 | + *cygwin* | *mingw* | *cegcc* ) | ||
3778 | + # if an import library, we need to obtain dlname | ||
3779 | + if func_win32_import_lib_p "$dlprefile"; then | ||
3780 | + func_tr_sh "$dlprefile" | ||
3781 | + eval "curr_lafile=\$libfile_$func_tr_sh_result" | ||
3782 | + dlprefile_dlbasename="" | ||
3783 | + if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then | ||
3784 | + # Use subshell, to avoid clobbering current variable values | ||
3785 | + dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` | ||
3786 | + if test -n "$dlprefile_dlname" ; then | ||
3787 | + func_basename "$dlprefile_dlname" | ||
3788 | + dlprefile_dlbasename="$func_basename_result" | ||
3789 | + else | ||
3790 | + # no lafile. user explicitly requested -dlpreopen <import library>. | ||
3791 | + $sharedlib_from_linklib_cmd "$dlprefile" | ||
3792 | + dlprefile_dlbasename=$sharedlib_from_linklib_result | ||
3793 | + fi | ||
3794 | + fi | ||
3795 | + $opt_dry_run || { | ||
3796 | + if test -n "$dlprefile_dlbasename" ; then | ||
3797 | + eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' | ||
3798 | + else | ||
3799 | + func_warning "Could not compute DLL name from $name" | ||
3800 | + eval '$ECHO ": $name " >> "$nlist"' | ||
3801 | + fi | ||
3802 | + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 | ||
3803 | + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | | ||
3804 | + $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" | ||
3805 | + } | ||
3806 | + else # not an import lib | ||
3807 | + $opt_dry_run || { | ||
3808 | + eval '$ECHO ": $name " >> "$nlist"' | ||
3809 | + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 | ||
3810 | + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" | ||
3811 | + } | ||
3812 | + fi | ||
3813 | + ;; | ||
3814 | + *) | ||
3815 | + $opt_dry_run || { | ||
3816 | + eval '$ECHO ": $name " >> "$nlist"' | ||
3817 | + func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 | ||
3818 | + eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" | ||
3819 | + } | ||
3820 | + ;; | ||
3821 | + esac | ||
3822 | done | ||
3823 | |||
3824 | $opt_dry_run || { | ||
3825 | @@ -2661,26 +3435,9 @@ typedef struct { | ||
3826 | const char *name; | ||
3827 | void *address; | ||
3828 | } lt_dlsymlist; | ||
3829 | -" | ||
3830 | - case $host in | ||
3831 | - *cygwin* | *mingw* | *cegcc* ) | ||
3832 | - echo >> "$output_objdir/$my_dlsyms" "\ | ||
3833 | -/* DATA imports from DLLs on WIN32 con't be const, because | ||
3834 | - runtime relocations are performed -- see ld's documentation | ||
3835 | - on pseudo-relocs. */" | ||
3836 | - lt_dlsym_const= ;; | ||
3837 | - *osf5*) | ||
3838 | - echo >> "$output_objdir/$my_dlsyms" "\ | ||
3839 | -/* This system does not cope well with relocations in const data */" | ||
3840 | - lt_dlsym_const= ;; | ||
3841 | - *) | ||
3842 | - lt_dlsym_const=const ;; | ||
3843 | - esac | ||
3844 | - | ||
3845 | - echo >> "$output_objdir/$my_dlsyms" "\ | ||
3846 | -extern $lt_dlsym_const lt_dlsymlist | ||
3847 | +extern LT_DLSYM_CONST lt_dlsymlist | ||
3848 | lt_${my_prefix}_LTX_preloaded_symbols[]; | ||
3849 | -$lt_dlsym_const lt_dlsymlist | ||
3850 | +LT_DLSYM_CONST lt_dlsymlist | ||
3851 | lt_${my_prefix}_LTX_preloaded_symbols[] = | ||
3852 | {\ | ||
3853 | { \"$my_originator\", (void *) 0 }," | ||
3854 | @@ -2736,7 +3493,7 @@ static const void *lt_preloaded_setup() { | ||
3855 | for arg in $LTCFLAGS; do | ||
3856 | case $arg in | ||
3857 | -pie | -fpie | -fPIE) ;; | ||
3858 | - *) symtab_cflags="$symtab_cflags $arg" ;; | ||
3859 | + *) func_append symtab_cflags " $arg" ;; | ||
3860 | esac | ||
3861 | done | ||
3862 | |||
3863 | @@ -2796,9 +3553,11 @@ func_win32_libid () | ||
3864 | win32_libid_type="x86 archive import" | ||
3865 | ;; | ||
3866 | *ar\ archive*) # could be an import, or static | ||
3867 | - if $OBJDUMP -f "$1" | $SED -e '10q' 2>/dev/null | | ||
3868 | - $EGREP 'file format (pe-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then | ||
3869 | - win32_nmres=`$NM -f posix -A "$1" | | ||
3870 | + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. | ||
3871 | + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | | ||
3872 | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then | ||
3873 | + func_to_tool_file "$1" func_convert_file_msys_to_w32 | ||
3874 | + win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | | ||
3875 | $SED -n -e ' | ||
3876 | 1,100{ | ||
3877 | / I /{ | ||
3878 | @@ -2827,6 +3586,131 @@ func_win32_libid () | ||
3879 | $ECHO "$win32_libid_type" | ||
3880 | } | ||
3881 | |||
3882 | +# func_cygming_dll_for_implib ARG | ||
3883 | +# | ||
3884 | +# Platform-specific function to extract the | ||
3885 | +# name of the DLL associated with the specified | ||
3886 | +# import library ARG. | ||
3887 | +# Invoked by eval'ing the libtool variable | ||
3888 | +# $sharedlib_from_linklib_cmd | ||
3889 | +# Result is available in the variable | ||
3890 | +# $sharedlib_from_linklib_result | ||
3891 | +func_cygming_dll_for_implib () | ||
3892 | +{ | ||
3893 | + $opt_debug | ||
3894 | + sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` | ||
3895 | +} | ||
3896 | + | ||
3897 | +# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs | ||
3898 | +# | ||
3899 | +# The is the core of a fallback implementation of a | ||
3900 | +# platform-specific function to extract the name of the | ||
3901 | +# DLL associated with the specified import library LIBNAME. | ||
3902 | +# | ||
3903 | +# SECTION_NAME is either .idata$6 or .idata$7, depending | ||
3904 | +# on the platform and compiler that created the implib. | ||
3905 | +# | ||
3906 | +# Echos the name of the DLL associated with the | ||
3907 | +# specified import library. | ||
3908 | +func_cygming_dll_for_implib_fallback_core () | ||
3909 | +{ | ||
3910 | + $opt_debug | ||
3911 | + match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` | ||
3912 | + $OBJDUMP -s --section "$1" "$2" 2>/dev/null | | ||
3913 | + $SED '/^Contents of section '"$match_literal"':/{ | ||
3914 | + # Place marker at beginning of archive member dllname section | ||
3915 | + s/.*/====MARK====/ | ||
3916 | + p | ||
3917 | + d | ||
3918 | + } | ||
3919 | + # These lines can sometimes be longer than 43 characters, but | ||
3920 | + # are always uninteresting | ||
3921 | + /:[ ]*file format pe[i]\{,1\}-/d | ||
3922 | + /^In archive [^:]*:/d | ||
3923 | + # Ensure marker is printed | ||
3924 | + /^====MARK====/p | ||
3925 | + # Remove all lines with less than 43 characters | ||
3926 | + /^.\{43\}/!d | ||
3927 | + # From remaining lines, remove first 43 characters | ||
3928 | + s/^.\{43\}//' | | ||
3929 | + $SED -n ' | ||
3930 | + # Join marker and all lines until next marker into a single line | ||
3931 | + /^====MARK====/ b para | ||
3932 | + H | ||
3933 | + $ b para | ||
3934 | + b | ||
3935 | + :para | ||
3936 | + x | ||
3937 | + s/\n//g | ||
3938 | + # Remove the marker | ||
3939 | + s/^====MARK====// | ||
3940 | + # Remove trailing dots and whitespace | ||
3941 | + s/[\. \t]*$// | ||
3942 | |||
3943 | + /./p' | | ||
3944 | + # we now have a list, one entry per line, of the stringified | ||
3945 | + # contents of the appropriate section of all members of the | ||
3946 | + # archive which possess that section. Heuristic: eliminate | ||
3947 | + # all those which have a first or second character that is | ||
3948 | + # a '.' (that is, objdump's representation of an unprintable | ||
3949 | + # character.) This should work for all archives with less than | ||
3950 | + # 0x302f exports -- but will fail for DLLs whose name actually | ||
3951 | + # begins with a literal '.' or a single character followed by | ||
3952 | + # a '.'. | ||
3953 | + # | ||
3954 | + # Of those that remain, print the first one. | ||
3955 | + $SED -e '/^\./d;/^.\./d;q' | ||
3956 | +} | ||
3957 | + | ||
3958 | +# func_cygming_gnu_implib_p ARG | ||
3959 | +# This predicate returns with zero status (TRUE) if | ||
3960 | +# ARG is a GNU/binutils-style import library. Returns | ||
3961 | +# with nonzero status (FALSE) otherwise. | ||
3962 | +func_cygming_gnu_implib_p () | ||
3963 | +{ | ||
3964 | + $opt_debug | ||
3965 | + func_to_tool_file "$1" func_convert_file_msys_to_w32 | ||
3966 | + func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` | ||
3967 | + test -n "$func_cygming_gnu_implib_tmp" | ||
3968 | +} | ||
3969 | + | ||
3970 | +# func_cygming_ms_implib_p ARG | ||
3971 | +# This predicate returns with zero status (TRUE) if | ||
3972 | +# ARG is an MS-style import library. Returns | ||
3973 | +# with nonzero status (FALSE) otherwise. | ||
3974 | +func_cygming_ms_implib_p () | ||
3975 | +{ | ||
3976 | + $opt_debug | ||
3977 | + func_to_tool_file "$1" func_convert_file_msys_to_w32 | ||
3978 | + func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` | ||
3979 | + test -n "$func_cygming_ms_implib_tmp" | ||
3980 | +} | ||
3981 | + | ||
3982 | +# func_cygming_dll_for_implib_fallback ARG | ||
3983 | +# Platform-specific function to extract the | ||
3984 | +# name of the DLL associated with the specified | ||
3985 | +# import library ARG. | ||
3986 | +# | ||
3987 | +# This fallback implementation is for use when $DLLTOOL | ||
3988 | +# does not support the --identify-strict option. | ||
3989 | +# Invoked by eval'ing the libtool variable | ||
3990 | +# $sharedlib_from_linklib_cmd | ||
3991 | +# Result is available in the variable | ||
3992 | +# $sharedlib_from_linklib_result | ||
3993 | +func_cygming_dll_for_implib_fallback () | ||
3994 | +{ | ||
3995 | + $opt_debug | ||
3996 | + if func_cygming_gnu_implib_p "$1" ; then | ||
3997 | + # binutils import library | ||
3998 | + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` | ||
3999 | + elif func_cygming_ms_implib_p "$1" ; then | ||
4000 | + # ms-generated import library | ||
4001 | + sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` | ||
4002 | + else | ||
4003 | + # unknown | ||
4004 | + sharedlib_from_linklib_result="" | ||
4005 | + fi | ||
4006 | +} | ||
4007 | |||
4008 | |||
4009 | # func_extract_an_archive dir oldlib | ||
4010 | @@ -2917,7 +3801,7 @@ func_extract_archives () | ||
4011 | darwin_file= | ||
4012 | darwin_files= | ||
4013 | for darwin_file in $darwin_filelist; do | ||
4014 | - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` | ||
4015 | + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` | ||
4016 | $LIPO -create -output "$darwin_file" $darwin_files | ||
4017 | done # $darwin_filelist | ||
4018 | $RM -rf unfat-$$ | ||
4019 | @@ -2932,7 +3816,7 @@ func_extract_archives () | ||
4020 | func_extract_an_archive "$my_xdir" "$my_xabs" | ||
4021 | ;; | ||
4022 | esac | ||
4023 | - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` | ||
4024 | + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` | ||
4025 | done | ||
4026 | |||
4027 | func_extract_archives_result="$my_oldobjs" | ||
4028 | @@ -3014,7 +3898,110 @@ func_fallback_echo () | ||
4029 | _LTECHO_EOF' | ||
4030 | } | ||
4031 | ECHO=\"$qECHO\" | ||
4032 | - fi\ | ||
4033 | + fi | ||
4034 | + | ||
4035 | +# Very basic option parsing. These options are (a) specific to | ||
4036 | +# the libtool wrapper, (b) are identical between the wrapper | ||
4037 | +# /script/ and the wrapper /executable/ which is used only on | ||
4038 | +# windows platforms, and (c) all begin with the string "--lt-" | ||
4039 | +# (application programs are unlikely to have options which match | ||
4040 | +# this pattern). | ||
4041 | +# | ||
4042 | +# There are only two supported options: --lt-debug and | ||
4043 | +# --lt-dump-script. There is, deliberately, no --lt-help. | ||
4044 | +# | ||
4045 | +# The first argument to this parsing function should be the | ||
4046 | +# script's $0 value, followed by "$@". | ||
4047 | +lt_option_debug= | ||
4048 | +func_parse_lt_options () | ||
4049 | +{ | ||
4050 | + lt_script_arg0=\$0 | ||
4051 | + shift | ||
4052 | + for lt_opt | ||
4053 | + do | ||
4054 | + case \"\$lt_opt\" in | ||
4055 | + --lt-debug) lt_option_debug=1 ;; | ||
4056 | + --lt-dump-script) | ||
4057 | + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` | ||
4058 | + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. | ||
4059 | + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` | ||
4060 | + cat \"\$lt_dump_D/\$lt_dump_F\" | ||
4061 | + exit 0 | ||
4062 | + ;; | ||
4063 | + --lt-*) | ||
4064 | + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 | ||
4065 | + exit 1 | ||
4066 | + ;; | ||
4067 | + esac | ||
4068 | + done | ||
4069 | + | ||
4070 | + # Print the debug banner immediately: | ||
4071 | + if test -n \"\$lt_option_debug\"; then | ||
4072 | + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 | ||
4073 | + fi | ||
4074 | +} | ||
4075 | + | ||
4076 | +# Used when --lt-debug. Prints its arguments to stdout | ||
4077 | +# (redirection is the responsibility of the caller) | ||
4078 | +func_lt_dump_args () | ||
4079 | +{ | ||
4080 | + lt_dump_args_N=1; | ||
4081 | + for lt_arg | ||
4082 | + do | ||
4083 | + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" | ||
4084 | + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` | ||
4085 | + done | ||
4086 | +} | ||
4087 | + | ||
4088 | +# Core function for launching the target application | ||
4089 | +func_exec_program_core () | ||
4090 | +{ | ||
4091 | +" | ||
4092 | + case $host in | ||
4093 | + # Backslashes separate directories on plain windows | ||
4094 | + *-*-mingw | *-*-os2* | *-cegcc*) | ||
4095 | + $ECHO "\ | ||
4096 | + if test -n \"\$lt_option_debug\"; then | ||
4097 | + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 | ||
4098 | + func_lt_dump_args \${1+\"\$@\"} 1>&2 | ||
4099 | + fi | ||
4100 | + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} | ||
4101 | +" | ||
4102 | + ;; | ||
4103 | + | ||
4104 | + *) | ||
4105 | + $ECHO "\ | ||
4106 | + if test -n \"\$lt_option_debug\"; then | ||
4107 | + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 | ||
4108 | + func_lt_dump_args \${1+\"\$@\"} 1>&2 | ||
4109 | + fi | ||
4110 | + exec \"\$progdir/\$program\" \${1+\"\$@\"} | ||
4111 | +" | ||
4112 | + ;; | ||
4113 | + esac | ||
4114 | + $ECHO "\ | ||
4115 | + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 | ||
4116 | + exit 1 | ||
4117 | +} | ||
4118 | + | ||
4119 | +# A function to encapsulate launching the target application | ||
4120 | +# Strips options in the --lt-* namespace from \$@ and | ||
4121 | +# launches target application with the remaining arguments. | ||
4122 | +func_exec_program () | ||
4123 | +{ | ||
4124 | + for lt_wr_arg | ||
4125 | + do | ||
4126 | + case \$lt_wr_arg in | ||
4127 | + --lt-*) ;; | ||
4128 | + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; | ||
4129 | + esac | ||
4130 | + shift | ||
4131 | + done | ||
4132 | + func_exec_program_core \${1+\"\$@\"} | ||
4133 | +} | ||
4134 | + | ||
4135 | + # Parse options | ||
4136 | + func_parse_lt_options \"\$0\" \${1+\"\$@\"} | ||
4137 | |||
4138 | # Find the directory that this script lives in. | ||
4139 | thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` | ||
4140 | @@ -3078,7 +4065,7 @@ _LTECHO_EOF' | ||
4141 | |||
4142 | # relink executable if necessary | ||
4143 | if test -n \"\$relink_command\"; then | ||
4144 | - if relink_command_output=\`eval \"\$relink_command\" 2>&1\`; then : | ||
4145 | + if relink_command_output=\`eval \$relink_command 2>&1\`; then : | ||
4146 | else | ||
4147 | $ECHO \"\$relink_command_output\" >&2 | ||
4148 | $RM \"\$progdir/\$file\" | ||
4149 | @@ -3102,6 +4089,18 @@ _LTECHO_EOF' | ||
4150 | |||
4151 | if test -f \"\$progdir/\$program\"; then" | ||
4152 | |||
4153 | + # fixup the dll searchpath if we need to. | ||
4154 | + # | ||
4155 | + # Fix the DLL searchpath if we need to. Do this before prepending | ||
4156 | + # to shlibpath, because on Windows, both are PATH and uninstalled | ||
4157 | + # libraries must come first. | ||
4158 | + if test -n "$dllsearchpath"; then | ||
4159 | + $ECHO "\ | ||
4160 | + # Add the dll search path components to the executable PATH | ||
4161 | + PATH=$dllsearchpath:\$PATH | ||
4162 | +" | ||
4163 | + fi | ||
4164 | + | ||
4165 | # Export our shlibpath_var if we have one. | ||
4166 | if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then | ||
4167 | $ECHO "\ | ||
4168 | @@ -3116,35 +4115,10 @@ _LTECHO_EOF' | ||
4169 | " | ||
4170 | fi | ||
4171 | |||
4172 | - # fixup the dll searchpath if we need to. | ||
4173 | - if test -n "$dllsearchpath"; then | ||
4174 | - $ECHO "\ | ||
4175 | - # Add the dll search path components to the executable PATH | ||
4176 | - PATH=$dllsearchpath:\$PATH | ||
4177 | -" | ||
4178 | - fi | ||
4179 | - | ||
4180 | $ECHO "\ | ||
4181 | if test \"\$libtool_execute_magic\" != \"$magic\"; then | ||
4182 | # Run the actual program with our arguments. | ||
4183 | -" | ||
4184 | - case $host in | ||
4185 | - # Backslashes separate directories on plain windows | ||
4186 | - *-*-mingw | *-*-os2* | *-cegcc*) | ||
4187 | - $ECHO "\ | ||
4188 | - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} | ||
4189 | -" | ||
4190 | - ;; | ||
4191 | - | ||
4192 | - *) | ||
4193 | - $ECHO "\ | ||
4194 | - exec \"\$progdir/\$program\" \${1+\"\$@\"} | ||
4195 | -" | ||
4196 | - ;; | ||
4197 | - esac | ||
4198 | - $ECHO "\ | ||
4199 | - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 | ||
4200 | - exit 1 | ||
4201 | + func_exec_program \${1+\"\$@\"} | ||
4202 | fi | ||
4203 | else | ||
4204 | # The program doesn't exist. | ||
4205 | @@ -3158,166 +4132,6 @@ fi\ | ||
4206 | } | ||
4207 | |||
4208 | |||
4209 | -# func_to_host_path arg | ||
4210 | -# | ||
4211 | -# Convert paths to host format when used with build tools. | ||
4212 | -# Intended for use with "native" mingw (where libtool itself | ||
4213 | -# is running under the msys shell), or in the following cross- | ||
4214 | -# build environments: | ||
4215 | -# $build $host | ||
4216 | -# mingw (msys) mingw [e.g. native] | ||
4217 | -# cygwin mingw | ||
4218 | -# *nix + wine mingw | ||
4219 | -# where wine is equipped with the `winepath' executable. | ||
4220 | -# In the native mingw case, the (msys) shell automatically | ||
4221 | -# converts paths for any non-msys applications it launches, | ||
4222 | -# but that facility isn't available from inside the cwrapper. | ||
4223 | -# Similar accommodations are necessary for $host mingw and | ||
4224 | -# $build cygwin. Calling this function does no harm for other | ||
4225 | -# $host/$build combinations not listed above. | ||
4226 | -# | ||
4227 | -# ARG is the path (on $build) that should be converted to | ||
4228 | -# the proper representation for $host. The result is stored | ||
4229 | -# in $func_to_host_path_result. | ||
4230 | -func_to_host_path () | ||
4231 | -{ | ||
4232 | - func_to_host_path_result="$1" | ||
4233 | - if test -n "$1"; then | ||
4234 | - case $host in | ||
4235 | - *mingw* ) | ||
4236 | - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' | ||
4237 | - case $build in | ||
4238 | - *mingw* ) # actually, msys | ||
4239 | - # awkward: cmd appends spaces to result | ||
4240 | - func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | | ||
4241 | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` | ||
4242 | - ;; | ||
4243 | - *cygwin* ) | ||
4244 | - func_to_host_path_result=`cygpath -w "$1" | | ||
4245 | - $SED -e "$lt_sed_naive_backslashify"` | ||
4246 | - ;; | ||
4247 | - * ) | ||
4248 | - # Unfortunately, winepath does not exit with a non-zero | ||
4249 | - # error code, so we are forced to check the contents of | ||
4250 | - # stdout. On the other hand, if the command is not | ||
4251 | - # found, the shell will set an exit code of 127 and print | ||
4252 | - # *an error message* to stdout. So we must check for both | ||
4253 | - # error code of zero AND non-empty stdout, which explains | ||
4254 | - # the odd construction: | ||
4255 | - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` | ||
4256 | - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then | ||
4257 | - func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" | | ||
4258 | - $SED -e "$lt_sed_naive_backslashify"` | ||
4259 | - else | ||
4260 | - # Allow warning below. | ||
4261 | - func_to_host_path_result= | ||
4262 | - fi | ||
4263 | - ;; | ||
4264 | - esac | ||
4265 | - if test -z "$func_to_host_path_result" ; then | ||
4266 | - func_error "Could not determine host path corresponding to" | ||
4267 | - func_error " \`$1'" | ||
4268 | - func_error "Continuing, but uninstalled executables may not work." | ||
4269 | - # Fallback: | ||
4270 | - func_to_host_path_result="$1" | ||
4271 | - fi | ||
4272 | - ;; | ||
4273 | - esac | ||
4274 | - fi | ||
4275 | -} | ||
4276 | -# end: func_to_host_path | ||
4277 | - | ||
4278 | -# func_to_host_pathlist arg | ||
4279 | -# | ||
4280 | -# Convert pathlists to host format when used with build tools. | ||
4281 | -# See func_to_host_path(), above. This function supports the | ||
4282 | -# following $build/$host combinations (but does no harm for | ||
4283 | -# combinations not listed here): | ||
4284 | -# $build $host | ||
4285 | -# mingw (msys) mingw [e.g. native] | ||
4286 | -# cygwin mingw | ||
4287 | -# *nix + wine mingw | ||
4288 | -# | ||
4289 | -# Path separators are also converted from $build format to | ||
4290 | -# $host format. If ARG begins or ends with a path separator | ||
4291 | -# character, it is preserved (but converted to $host format) | ||
4292 | -# on output. | ||
4293 | -# | ||
4294 | -# ARG is a pathlist (on $build) that should be converted to | ||
4295 | -# the proper representation on $host. The result is stored | ||
4296 | -# in $func_to_host_pathlist_result. | ||
4297 | -func_to_host_pathlist () | ||
4298 | -{ | ||
4299 | - func_to_host_pathlist_result="$1" | ||
4300 | - if test -n "$1"; then | ||
4301 | - case $host in | ||
4302 | - *mingw* ) | ||
4303 | - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' | ||
4304 | - # Remove leading and trailing path separator characters from | ||
4305 | - # ARG. msys behavior is inconsistent here, cygpath turns them | ||
4306 | - # into '.;' and ';.', and winepath ignores them completely. | ||
4307 | - func_stripname : : "$1" | ||
4308 | - func_to_host_pathlist_tmp1=$func_stripname_result | ||
4309 | - case $build in | ||
4310 | - *mingw* ) # Actually, msys. | ||
4311 | - # Awkward: cmd appends spaces to result. | ||
4312 | - func_to_host_pathlist_result=` | ||
4313 | - ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | | ||
4314 | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` | ||
4315 | - ;; | ||
4316 | - *cygwin* ) | ||
4317 | - func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | | ||
4318 | - $SED -e "$lt_sed_naive_backslashify"` | ||
4319 | - ;; | ||
4320 | - * ) | ||
4321 | - # unfortunately, winepath doesn't convert pathlists | ||
4322 | - func_to_host_pathlist_result="" | ||
4323 | - func_to_host_pathlist_oldIFS=$IFS | ||
4324 | - IFS=: | ||
4325 | - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do | ||
4326 | - IFS=$func_to_host_pathlist_oldIFS | ||
4327 | - if test -n "$func_to_host_pathlist_f" ; then | ||
4328 | - func_to_host_path "$func_to_host_pathlist_f" | ||
4329 | - if test -n "$func_to_host_path_result" ; then | ||
4330 | - if test -z "$func_to_host_pathlist_result" ; then | ||
4331 | - func_to_host_pathlist_result="$func_to_host_path_result" | ||
4332 | - else | ||
4333 | - func_append func_to_host_pathlist_result ";$func_to_host_path_result" | ||
4334 | - fi | ||
4335 | - fi | ||
4336 | - fi | ||
4337 | - done | ||
4338 | - IFS=$func_to_host_pathlist_oldIFS | ||
4339 | - ;; | ||
4340 | - esac | ||
4341 | - if test -z "$func_to_host_pathlist_result"; then | ||
4342 | - func_error "Could not determine the host path(s) corresponding to" | ||
4343 | - func_error " \`$1'" | ||
4344 | - func_error "Continuing, but uninstalled executables may not work." | ||
4345 | - # Fallback. This may break if $1 contains DOS-style drive | ||
4346 | - # specifications. The fix is not to complicate the expression | ||
4347 | - # below, but for the user to provide a working wine installation | ||
4348 | - # with winepath so that path translation in the cross-to-mingw | ||
4349 | - # case works properly. | ||
4350 | - lt_replace_pathsep_nix_to_dos="s|:|;|g" | ||
4351 | - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ | ||
4352 | - $SED -e "$lt_replace_pathsep_nix_to_dos"` | ||
4353 | - fi | ||
4354 | - # Now, add the leading and trailing path separators back | ||
4355 | - case "$1" in | ||
4356 | - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" | ||
4357 | - ;; | ||
4358 | - esac | ||
4359 | - case "$1" in | ||
4360 | - *: ) func_append func_to_host_pathlist_result ";" | ||
4361 | - ;; | ||
4362 | - esac | ||
4363 | - ;; | ||
4364 | - esac | ||
4365 | - fi | ||
4366 | -} | ||
4367 | -# end: func_to_host_pathlist | ||
4368 | - | ||
4369 | # func_emit_cwrapperexe_src | ||
4370 | # emit the source code for a wrapper executable on stdout | ||
4371 | # Must ONLY be called from within func_mode_link because | ||
4372 | @@ -3334,10 +4148,6 @@ func_emit_cwrapperexe_src () | ||
4373 | |||
4374 | This wrapper executable should never be moved out of the build directory. | ||
4375 | If it is, it will not operate correctly. | ||
4376 | - | ||
4377 | - Currently, it simply execs the wrapper *script* "$SHELL $output", | ||
4378 | - but could eventually absorb all of the scripts functionality and | ||
4379 | - exec $objdir/$outputname directly. | ||
4380 | */ | ||
4381 | EOF | ||
4382 | cat <<"EOF" | ||
4383 | @@ -3462,22 +4272,13 @@ int setenv (const char *, const char *, int); | ||
4384 | if (stale) { free ((void *) stale); stale = 0; } \ | ||
4385 | } while (0) | ||
4386 | |||
4387 | -#undef LTWRAPPER_DEBUGPRINTF | ||
4388 | -#if defined LT_DEBUGWRAPPER | ||
4389 | -# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args | ||
4390 | -static void | ||
4391 | -ltwrapper_debugprintf (const char *fmt, ...) | ||
4392 | -{ | ||
4393 | - va_list args; | ||
4394 | - va_start (args, fmt); | ||
4395 | - (void) vfprintf (stderr, fmt, args); | ||
4396 | - va_end (args); | ||
4397 | -} | ||
4398 | +#if defined(LT_DEBUGWRAPPER) | ||
4399 | +static int lt_debug = 1; | ||
4400 | #else | ||
4401 | -# define LTWRAPPER_DEBUGPRINTF(args) | ||
4402 | +static int lt_debug = 0; | ||
4403 | #endif | ||
4404 | |||
4405 | -const char *program_name = NULL; | ||
4406 | +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ | ||
4407 | |||
4408 | void *xmalloc (size_t num); | ||
4409 | char *xstrdup (const char *string); | ||
4410 | @@ -3487,7 +4288,10 @@ char *chase_symlinks (const char *pathspec); | ||
4411 | int make_executable (const char *path); | ||
4412 | int check_executable (const char *path); | ||
4413 | char *strendzap (char *str, const char *pat); | ||
4414 | -void lt_fatal (const char *message, ...); | ||
4415 | +void lt_debugprintf (const char *file, int line, const char *fmt, ...); | ||
4416 | +void lt_fatal (const char *file, int line, const char *message, ...); | ||
4417 | +static const char *nonnull (const char *s); | ||
4418 | +static const char *nonempty (const char *s); | ||
4419 | void lt_setenv (const char *name, const char *value); | ||
4420 | char *lt_extend_str (const char *orig_value, const char *add, int to_end); | ||
4421 | void lt_update_exe_path (const char *name, const char *value); | ||
4422 | @@ -3497,14 +4301,14 @@ void lt_dump_script (FILE *f); | ||
4423 | EOF | ||
4424 | |||
4425 | cat <<EOF | ||
4426 | -const char * MAGIC_EXE = "$magic_exe"; | ||
4427 | +volatile const char * MAGIC_EXE = "$magic_exe"; | ||
4428 | const char * LIB_PATH_VARNAME = "$shlibpath_var"; | ||
4429 | EOF | ||
4430 | |||
4431 | if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then | ||
4432 | - func_to_host_pathlist "$temp_rpath" | ||
4433 | + func_to_host_path "$temp_rpath" | ||
4434 | cat <<EOF | ||
4435 | -const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result"; | ||
4436 | +const char * LIB_PATH_VALUE = "$func_to_host_path_result"; | ||
4437 | EOF | ||
4438 | else | ||
4439 | cat <<"EOF" | ||
4440 | @@ -3513,10 +4317,10 @@ EOF | ||
4441 | fi | ||
4442 | |||
4443 | if test -n "$dllsearchpath"; then | ||
4444 | - func_to_host_pathlist "$dllsearchpath:" | ||
4445 | + func_to_host_path "$dllsearchpath:" | ||
4446 | cat <<EOF | ||
4447 | const char * EXE_PATH_VARNAME = "PATH"; | ||
4448 | -const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result"; | ||
4449 | +const char * EXE_PATH_VALUE = "$func_to_host_path_result"; | ||
4450 | EOF | ||
4451 | else | ||
4452 | cat <<"EOF" | ||
4453 | @@ -3539,12 +4343,10 @@ EOF | ||
4454 | cat <<"EOF" | ||
4455 | |||
4456 | #define LTWRAPPER_OPTION_PREFIX "--lt-" | ||
4457 | -#define LTWRAPPER_OPTION_PREFIX_LENGTH 5 | ||
4458 | |||
4459 | -static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH; | ||
4460 | static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX; | ||
4461 | - | ||
4462 | static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script"; | ||
4463 | +static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug"; | ||
4464 | |||
4465 | int | ||
4466 | main (int argc, char *argv[]) | ||
4467 | @@ -3561,10 +4363,13 @@ main (int argc, char *argv[]) | ||
4468 | int i; | ||
4469 | |||
4470 | program_name = (char *) xstrdup (base_name (argv[0])); | ||
4471 | - LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0])); | ||
4472 | - LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name)); | ||
4473 | + newargz = XMALLOC (char *, argc + 1); | ||
4474 | |||
4475 | - /* very simple arg parsing; don't want to rely on getopt */ | ||
4476 | + /* very simple arg parsing; don't want to rely on getopt | ||
4477 | + * also, copy all non cwrapper options to newargz, except | ||
4478 | + * argz[0], which is handled differently | ||
4479 | + */ | ||
4480 | + newargc=0; | ||
4481 | for (i = 1; i < argc; i++) | ||
4482 | { | ||
4483 | if (strcmp (argv[i], dumpscript_opt) == 0) | ||
4484 | @@ -3581,21 +4386,54 @@ EOF | ||
4485 | lt_dump_script (stdout); | ||
4486 | return 0; | ||
4487 | } | ||
4488 | + if (strcmp (argv[i], debug_opt) == 0) | ||
4489 | + { | ||
4490 | + lt_debug = 1; | ||
4491 | + continue; | ||
4492 | + } | ||
4493 | + if (strcmp (argv[i], ltwrapper_option_prefix) == 0) | ||
4494 | + { | ||
4495 | + /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX | ||
4496 | + namespace, but it is not one of the ones we know about and | ||
4497 | + have already dealt with, above (inluding dump-script), then | ||
4498 | + report an error. Otherwise, targets might begin to believe | ||
4499 | + they are allowed to use options in the LTWRAPPER_OPTION_PREFIX | ||
4500 | + namespace. The first time any user complains about this, we'll | ||
4501 | + need to make LTWRAPPER_OPTION_PREFIX a configure-time option | ||
4502 | + or a configure.ac-settable value. | ||
4503 | + */ | ||
4504 | + lt_fatal (__FILE__, __LINE__, | ||
4505 | + "unrecognized %s option: '%s'", | ||
4506 | + ltwrapper_option_prefix, argv[i]); | ||
4507 | + } | ||
4508 | + /* otherwise ... */ | ||
4509 | + newargz[++newargc] = xstrdup (argv[i]); | ||
4510 | } | ||
4511 | + newargz[++newargc] = NULL; | ||
4512 | + | ||
4513 | +EOF | ||
4514 | + cat <<EOF | ||
4515 | + /* The GNU banner must be the first non-error debug message */ | ||
4516 | + lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n"); | ||
4517 | +EOF | ||
4518 | + cat <<"EOF" | ||
4519 | + lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]); | ||
4520 | + lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name); | ||
4521 | |||
4522 | - newargz = XMALLOC (char *, argc + 1); | ||
4523 | tmp_pathspec = find_executable (argv[0]); | ||
4524 | if (tmp_pathspec == NULL) | ||
4525 | - lt_fatal ("Couldn't find %s", argv[0]); | ||
4526 | - LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n", | ||
4527 | - tmp_pathspec)); | ||
4528 | + lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]); | ||
4529 | + lt_debugprintf (__FILE__, __LINE__, | ||
4530 | + "(main) found exe (before symlink chase) at: %s\n", | ||
4531 | + tmp_pathspec); | ||
4532 | |||
4533 | actual_cwrapper_path = chase_symlinks (tmp_pathspec); | ||
4534 | - LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n", | ||
4535 | - actual_cwrapper_path)); | ||
4536 | + lt_debugprintf (__FILE__, __LINE__, | ||
4537 | + "(main) found exe (after symlink chase) at: %s\n", | ||
4538 | + actual_cwrapper_path); | ||
4539 | XFREE (tmp_pathspec); | ||
4540 | |||
4541 | - actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path)); | ||
4542 | + actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path)); | ||
4543 | strendzap (actual_cwrapper_path, actual_cwrapper_name); | ||
4544 | |||
4545 | /* wrapper name transforms */ | ||
4546 | @@ -3613,8 +4451,9 @@ EOF | ||
4547 | target_name = tmp_pathspec; | ||
4548 | tmp_pathspec = 0; | ||
4549 | |||
4550 | - LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n", | ||
4551 | - target_name)); | ||
4552 | + lt_debugprintf (__FILE__, __LINE__, | ||
4553 | + "(main) libtool target name: %s\n", | ||
4554 | + target_name); | ||
4555 | EOF | ||
4556 | |||
4557 | cat <<EOF | ||
4558 | @@ -3664,35 +4503,19 @@ EOF | ||
4559 | |||
4560 | lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */ | ||
4561 | lt_setenv ("DUALCASE", "1"); /* for MSK sh */ | ||
4562 | - lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE); | ||
4563 | + /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must | ||
4564 | + be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath) | ||
4565 | + because on Windows, both *_VARNAMEs are PATH but uninstalled | ||
4566 | + libraries must come first. */ | ||
4567 | lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE); | ||
4568 | + lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE); | ||
4569 | |||
4570 | - newargc=0; | ||
4571 | - for (i = 1; i < argc; i++) | ||
4572 | - { | ||
4573 | - if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0) | ||
4574 | - { | ||
4575 | - /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX | ||
4576 | - namespace, but it is not one of the ones we know about and | ||
4577 | - have already dealt with, above (inluding dump-script), then | ||
4578 | - report an error. Otherwise, targets might begin to believe | ||
4579 | - they are allowed to use options in the LTWRAPPER_OPTION_PREFIX | ||
4580 | - namespace. The first time any user complains about this, we'll | ||
4581 | - need to make LTWRAPPER_OPTION_PREFIX a configure-time option | ||
4582 | - or a configure.ac-settable value. | ||
4583 | - */ | ||
4584 | - lt_fatal ("Unrecognized option in %s namespace: '%s'", | ||
4585 | - ltwrapper_option_prefix, argv[i]); | ||
4586 | - } | ||
4587 | - /* otherwise ... */ | ||
4588 | - newargz[++newargc] = xstrdup (argv[i]); | ||
4589 | - } | ||
4590 | - newargz[++newargc] = NULL; | ||
4591 | - | ||
4592 | - LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>"))); | ||
4593 | + lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n", | ||
4594 | + nonnull (lt_argv_zero)); | ||
4595 | for (i = 0; i < newargc; i++) | ||
4596 | { | ||
4597 | - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>"))); | ||
4598 | + lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n", | ||
4599 | + i, nonnull (newargz[i])); | ||
4600 | } | ||
4601 | |||
4602 | EOF | ||
4603 | @@ -3706,7 +4529,9 @@ EOF | ||
4604 | if (rval == -1) | ||
4605 | { | ||
4606 | /* failed to start process */ | ||
4607 | - LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); | ||
4608 | + lt_debugprintf (__FILE__, __LINE__, | ||
4609 | + "(main) failed to launch target \"%s\": %s\n", | ||
4610 | + lt_argv_zero, nonnull (strerror (errno))); | ||
4611 | return 127; | ||
4612 | } | ||
4613 | return rval; | ||
4614 | @@ -3728,7 +4553,7 @@ xmalloc (size_t num) | ||
4615 | { | ||
4616 | void *p = (void *) malloc (num); | ||
4617 | if (!p) | ||
4618 | - lt_fatal ("Memory exhausted"); | ||
4619 | + lt_fatal (__FILE__, __LINE__, "memory exhausted"); | ||
4620 | |||
4621 | return p; | ||
4622 | } | ||
4623 | @@ -3762,8 +4587,8 @@ check_executable (const char *path) | ||
4624 | { | ||
4625 | struct stat st; | ||
4626 | |||
4627 | - LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", | ||
4628 | - path ? (*path ? path : "EMPTY!") : "NULL!")); | ||
4629 | + lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n", | ||
4630 | + nonempty (path)); | ||
4631 | if ((!path) || (!*path)) | ||
4632 | return 0; | ||
4633 | |||
4634 | @@ -3780,8 +4605,8 @@ make_executable (const char *path) | ||
4635 | int rval = 0; | ||
4636 | struct stat st; | ||
4637 | |||
4638 | - LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", | ||
4639 | - path ? (*path ? path : "EMPTY!") : "NULL!")); | ||
4640 | + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", | ||
4641 | + nonempty (path)); | ||
4642 | if ((!path) || (!*path)) | ||
4643 | return 0; | ||
4644 | |||
4645 | @@ -3807,8 +4632,8 @@ find_executable (const char *wrapper) | ||
4646 | int tmp_len; | ||
4647 | char *concat_name; | ||
4648 | |||
4649 | - LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", | ||
4650 | - wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); | ||
4651 | + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", | ||
4652 | + nonempty (wrapper)); | ||
4653 | |||
4654 | if ((wrapper == NULL) || (*wrapper == '\0')) | ||
4655 | return NULL; | ||
4656 | @@ -3861,7 +4686,8 @@ find_executable (const char *wrapper) | ||
4657 | { | ||
4658 | /* empty path: current directory */ | ||
4659 | if (getcwd (tmp, LT_PATHMAX) == NULL) | ||
4660 | - lt_fatal ("getcwd failed"); | ||
4661 | + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", | ||
4662 | + nonnull (strerror (errno))); | ||
4663 | tmp_len = strlen (tmp); | ||
4664 | concat_name = | ||
4665 | XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); | ||
4666 | @@ -3886,7 +4712,8 @@ find_executable (const char *wrapper) | ||
4667 | } | ||
4668 | /* Relative path | not found in path: prepend cwd */ | ||
4669 | if (getcwd (tmp, LT_PATHMAX) == NULL) | ||
4670 | - lt_fatal ("getcwd failed"); | ||
4671 | + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", | ||
4672 | + nonnull (strerror (errno))); | ||
4673 | tmp_len = strlen (tmp); | ||
4674 | concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); | ||
4675 | memcpy (concat_name, tmp, tmp_len); | ||
4676 | @@ -3912,8 +4739,9 @@ chase_symlinks (const char *pathspec) | ||
4677 | int has_symlinks = 0; | ||
4678 | while (strlen (tmp_pathspec) && !has_symlinks) | ||
4679 | { | ||
4680 | - LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", | ||
4681 | - tmp_pathspec)); | ||
4682 | + lt_debugprintf (__FILE__, __LINE__, | ||
4683 | + "checking path component for symlinks: %s\n", | ||
4684 | + tmp_pathspec); | ||
4685 | if (lstat (tmp_pathspec, &s) == 0) | ||
4686 | { | ||
4687 | if (S_ISLNK (s.st_mode) != 0) | ||
4688 | @@ -3935,8 +4763,9 @@ chase_symlinks (const char *pathspec) | ||
4689 | } | ||
4690 | else | ||
4691 | { | ||
4692 | - char *errstr = strerror (errno); | ||
4693 | - lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); | ||
4694 | + lt_fatal (__FILE__, __LINE__, | ||
4695 | + "error accessing file \"%s\": %s", | ||
4696 | + tmp_pathspec, nonnull (strerror (errno))); | ||
4697 | } | ||
4698 | } | ||
4699 | XFREE (tmp_pathspec); | ||
4700 | @@ -3949,7 +4778,8 @@ chase_symlinks (const char *pathspec) | ||
4701 | tmp_pathspec = realpath (pathspec, buf); | ||
4702 | if (tmp_pathspec == 0) | ||
4703 | { | ||
4704 | - lt_fatal ("Could not follow symlinks for %s", pathspec); | ||
4705 | + lt_fatal (__FILE__, __LINE__, | ||
4706 | + "could not follow symlinks for %s", pathspec); | ||
4707 | } | ||
4708 | return xstrdup (tmp_pathspec); | ||
4709 | #endif | ||
4710 | @@ -3975,11 +4805,25 @@ strendzap (char *str, const char *pat) | ||
4711 | return str; | ||
4712 | } | ||
4713 | |||
4714 | +void | ||
4715 | +lt_debugprintf (const char *file, int line, const char *fmt, ...) | ||
4716 | +{ | ||
4717 | + va_list args; | ||
4718 | + if (lt_debug) | ||
4719 | + { | ||
4720 | + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); | ||
4721 | + va_start (args, fmt); | ||
4722 | + (void) vfprintf (stderr, fmt, args); | ||
4723 | + va_end (args); | ||
4724 | + } | ||
4725 | +} | ||
4726 | + | ||
4727 | static void | ||
4728 | -lt_error_core (int exit_status, const char *mode, | ||
4729 | +lt_error_core (int exit_status, const char *file, | ||
4730 | + int line, const char *mode, | ||
4731 | const char *message, va_list ap) | ||
4732 | { | ||
4733 | - fprintf (stderr, "%s: %s: ", program_name, mode); | ||
4734 | + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); | ||
4735 | vfprintf (stderr, message, ap); | ||
4736 | fprintf (stderr, ".\n"); | ||
4737 | |||
4738 | @@ -3988,20 +4832,32 @@ lt_error_core (int exit_status, const char *mode, | ||
4739 | } | ||
4740 | |||
4741 | void | ||
4742 | -lt_fatal (const char *message, ...) | ||
4743 | +lt_fatal (const char *file, int line, const char *message, ...) | ||
4744 | { | ||
4745 | va_list ap; | ||
4746 | va_start (ap, message); | ||
4747 | - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); | ||
4748 | + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); | ||
4749 | va_end (ap); | ||
4750 | } | ||
4751 | |||
4752 | +static const char * | ||
4753 | +nonnull (const char *s) | ||
4754 | +{ | ||
4755 | + return s ? s : "(null)"; | ||
4756 | +} | ||
4757 | + | ||
4758 | +static const char * | ||
4759 | +nonempty (const char *s) | ||
4760 | +{ | ||
4761 | + return (s && !*s) ? "(empty)" : nonnull (s); | ||
4762 | +} | ||
4763 | + | ||
4764 | void | ||
4765 | lt_setenv (const char *name, const char *value) | ||
4766 | { | ||
4767 | - LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", | ||
4768 | - (name ? name : "<NULL>"), | ||
4769 | - (value ? value : "<NULL>"))); | ||
4770 | + lt_debugprintf (__FILE__, __LINE__, | ||
4771 | + "(lt_setenv) setting '%s' to '%s'\n", | ||
4772 | + nonnull (name), nonnull (value)); | ||
4773 | { | ||
4774 | #ifdef HAVE_SETENV | ||
4775 | /* always make a copy, for consistency with !HAVE_SETENV */ | ||
4776 | @@ -4049,9 +4905,9 @@ lt_extend_str (const char *orig_value, const char *add, int to_end) | ||
4777 | void | ||
4778 | lt_update_exe_path (const char *name, const char *value) | ||
4779 | { | ||
4780 | - LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", | ||
4781 | - (name ? name : "<NULL>"), | ||
4782 | - (value ? value : "<NULL>"))); | ||
4783 | + lt_debugprintf (__FILE__, __LINE__, | ||
4784 | + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", | ||
4785 | + nonnull (name), nonnull (value)); | ||
4786 | |||
4787 | if (name && *name && value && *value) | ||
4788 | { | ||
4789 | @@ -4070,9 +4926,9 @@ lt_update_exe_path (const char *name, const char *value) | ||
4790 | void | ||
4791 | lt_update_lib_path (const char *name, const char *value) | ||
4792 | { | ||
4793 | - LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", | ||
4794 | - (name ? name : "<NULL>"), | ||
4795 | - (value ? value : "<NULL>"))); | ||
4796 | + lt_debugprintf (__FILE__, __LINE__, | ||
4797 | + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", | ||
4798 | + nonnull (name), nonnull (value)); | ||
4799 | |||
4800 | if (name && *name && value && *value) | ||
4801 | { | ||
4802 | @@ -4222,7 +5078,7 @@ EOF | ||
4803 | func_win32_import_lib_p () | ||
4804 | { | ||
4805 | $opt_debug | ||
4806 | - case `eval "$file_magic_cmd \"\$1\" 2>/dev/null" | $SED -e 10q` in | ||
4807 | + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in | ||
4808 | *import*) : ;; | ||
4809 | *) false ;; | ||
4810 | esac | ||
4811 | @@ -4401,9 +5257,9 @@ func_mode_link () | ||
4812 | ;; | ||
4813 | *) | ||
4814 | if test "$prev" = dlfiles; then | ||
4815 | - dlfiles="$dlfiles $arg" | ||
4816 | + func_append dlfiles " $arg" | ||
4817 | else | ||
4818 | - dlprefiles="$dlprefiles $arg" | ||
4819 | + func_append dlprefiles " $arg" | ||
4820 | fi | ||
4821 | prev= | ||
4822 | continue | ||
4823 | @@ -4427,7 +5283,7 @@ func_mode_link () | ||
4824 | *-*-darwin*) | ||
4825 | case "$deplibs " in | ||
4826 | *" $qarg.ltframework "*) ;; | ||
4827 | - *) deplibs="$deplibs $qarg.ltframework" # this is fixed later | ||
4828 | + *) func_append deplibs " $qarg.ltframework" # this is fixed later | ||
4829 | ;; | ||
4830 | esac | ||
4831 | ;; | ||
4832 | @@ -4446,7 +5302,7 @@ func_mode_link () | ||
4833 | moreargs= | ||
4834 | for fil in `cat "$save_arg"` | ||
4835 | do | ||
4836 | -# moreargs="$moreargs $fil" | ||
4837 | +# func_append moreargs " $fil" | ||
4838 | arg=$fil | ||
4839 | # A libtool-controlled object. | ||
4840 | |||
4841 | @@ -4475,7 +5331,7 @@ func_mode_link () | ||
4842 | |||
4843 | if test "$prev" = dlfiles; then | ||
4844 | if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then | ||
4845 | - dlfiles="$dlfiles $pic_object" | ||
4846 | + func_append dlfiles " $pic_object" | ||
4847 | prev= | ||
4848 | continue | ||
4849 | else | ||
4850 | @@ -4487,7 +5343,7 @@ func_mode_link () | ||
4851 | # CHECK ME: I think I busted this. -Ossama | ||
4852 | if test "$prev" = dlprefiles; then | ||
4853 | # Preload the old-style object. | ||
4854 | - dlprefiles="$dlprefiles $pic_object" | ||
4855 | + func_append dlprefiles " $pic_object" | ||
4856 | prev= | ||
4857 | fi | ||
4858 | |||
4859 | @@ -4557,12 +5413,12 @@ func_mode_link () | ||
4860 | if test "$prev" = rpath; then | ||
4861 | case "$rpath " in | ||
4862 | *" $arg "*) ;; | ||
4863 | - *) rpath="$rpath $arg" ;; | ||
4864 | + *) func_append rpath " $arg" ;; | ||
4865 | esac | ||
4866 | else | ||
4867 | case "$xrpath " in | ||
4868 | *" $arg "*) ;; | ||
4869 | - *) xrpath="$xrpath $arg" ;; | ||
4870 | + *) func_append xrpath " $arg" ;; | ||
4871 | esac | ||
4872 | fi | ||
4873 | prev= | ||
4874 | @@ -4574,28 +5430,28 @@ func_mode_link () | ||
4875 | continue | ||
4876 | ;; | ||
4877 | weak) | ||
4878 | - weak_libs="$weak_libs $arg" | ||
4879 | + func_append weak_libs " $arg" | ||
4880 | prev= | ||
4881 | continue | ||
4882 | ;; | ||
4883 | xcclinker) | ||
4884 | - linker_flags="$linker_flags $qarg" | ||
4885 | - compiler_flags="$compiler_flags $qarg" | ||
4886 | + func_append linker_flags " $qarg" | ||
4887 | + func_append compiler_flags " $qarg" | ||
4888 | prev= | ||
4889 | func_append compile_command " $qarg" | ||
4890 | func_append finalize_command " $qarg" | ||
4891 | continue | ||
4892 | ;; | ||
4893 | xcompiler) | ||
4894 | - compiler_flags="$compiler_flags $qarg" | ||
4895 | + func_append compiler_flags " $qarg" | ||
4896 | prev= | ||
4897 | func_append compile_command " $qarg" | ||
4898 | func_append finalize_command " $qarg" | ||
4899 | continue | ||
4900 | ;; | ||
4901 | xlinker) | ||
4902 | - linker_flags="$linker_flags $qarg" | ||
4903 | - compiler_flags="$compiler_flags $wl$qarg" | ||
4904 | + func_append linker_flags " $qarg" | ||
4905 | + func_append compiler_flags " $wl$qarg" | ||
4906 | prev= | ||
4907 | func_append compile_command " $wl$qarg" | ||
4908 | func_append finalize_command " $wl$qarg" | ||
4909 | @@ -4686,15 +5542,16 @@ func_mode_link () | ||
4910 | ;; | ||
4911 | |||
4912 | -L*) | ||
4913 | - func_stripname '-L' '' "$arg" | ||
4914 | - dir=$func_stripname_result | ||
4915 | - if test -z "$dir"; then | ||
4916 | + func_stripname "-L" '' "$arg" | ||
4917 | + if test -z "$func_stripname_result"; then | ||
4918 | if test "$#" -gt 0; then | ||
4919 | func_fatal_error "require no space between \`-L' and \`$1'" | ||
4920 | else | ||
4921 | func_fatal_error "need path for \`-L' option" | ||
4922 | fi | ||
4923 | fi | ||
4924 | + func_resolve_sysroot "$func_stripname_result" | ||
4925 | + dir=$func_resolve_sysroot_result | ||
4926 | # We need an absolute path. | ||
4927 | case $dir in | ||
4928 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
4929 | @@ -4706,10 +5563,16 @@ func_mode_link () | ||
4930 | ;; | ||
4931 | esac | ||
4932 | case "$deplibs " in | ||
4933 | - *" -L$dir "*) ;; | ||
4934 | + *" -L$dir "* | *" $arg "*) | ||
4935 | + # Will only happen for absolute or sysroot arguments | ||
4936 | + ;; | ||
4937 | *) | ||
4938 | - deplibs="$deplibs -L$dir" | ||
4939 | - lib_search_path="$lib_search_path $dir" | ||
4940 | + # Preserve sysroot, but never include relative directories | ||
4941 | + case $dir in | ||
4942 | + [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; | ||
4943 | + *) func_append deplibs " -L$dir" ;; | ||
4944 | + esac | ||
4945 | + func_append lib_search_path " $dir" | ||
4946 | ;; | ||
4947 | esac | ||
4948 | case $host in | ||
4949 | @@ -4718,12 +5581,12 @@ func_mode_link () | ||
4950 | case :$dllsearchpath: in | ||
4951 | *":$dir:"*) ;; | ||
4952 | ::) dllsearchpath=$dir;; | ||
4953 | - *) dllsearchpath="$dllsearchpath:$dir";; | ||
4954 | + *) func_append dllsearchpath ":$dir";; | ||
4955 | esac | ||
4956 | case :$dllsearchpath: in | ||
4957 | *":$testbindir:"*) ;; | ||
4958 | ::) dllsearchpath=$testbindir;; | ||
4959 | - *) dllsearchpath="$dllsearchpath:$testbindir";; | ||
4960 | + *) func_append dllsearchpath ":$testbindir";; | ||
4961 | esac | ||
4962 | ;; | ||
4963 | esac | ||
4964 | @@ -4747,7 +5610,7 @@ func_mode_link () | ||
4965 | ;; | ||
4966 | *-*-rhapsody* | *-*-darwin1.[012]) | ||
4967 | # Rhapsody C and math libraries are in the System framework | ||
4968 | - deplibs="$deplibs System.ltframework" | ||
4969 | + func_append deplibs " System.ltframework" | ||
4970 | continue | ||
4971 | ;; | ||
4972 | *-*-sco3.2v5* | *-*-sco5v6*) | ||
4973 | @@ -4758,9 +5621,6 @@ func_mode_link () | ||
4974 | # Compiler inserts libc in the correct place for threads to work | ||
4975 | test "X$arg" = "X-lc" && continue | ||
4976 | ;; | ||
4977 | - *-*-linux*) | ||
4978 | - test "X$arg" = "X-lc" && continue | ||
4979 | - ;; | ||
4980 | esac | ||
4981 | elif test "X$arg" = "X-lc_r"; then | ||
4982 | case $host in | ||
4983 | @@ -4770,7 +5630,7 @@ func_mode_link () | ||
4984 | ;; | ||
4985 | esac | ||
4986 | fi | ||
4987 | - deplibs="$deplibs $arg" | ||
4988 | + func_append deplibs " $arg" | ||
4989 | continue | ||
4990 | ;; | ||
4991 | |||
4992 | @@ -4782,8 +5642,8 @@ func_mode_link () | ||
4993 | # Tru64 UNIX uses -model [arg] to determine the layout of C++ | ||
4994 | # classes, name mangling, and exception handling. | ||
4995 | # Darwin uses the -arch flag to determine output architecture. | ||
4996 | - -model|-arch|-isysroot) | ||
4997 | - compiler_flags="$compiler_flags $arg" | ||
4998 | + -model|-arch|-isysroot|--sysroot) | ||
4999 | + func_append compiler_flags " $arg" | ||
5000 | func_append compile_command " $arg" | ||
5001 | func_append finalize_command " $arg" | ||
5002 | prev=xcompiler | ||
5003 | @@ -4791,12 +5651,12 @@ func_mode_link () | ||
5004 | ;; | ||
5005 | |||
5006 | -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) | ||
5007 | - compiler_flags="$compiler_flags $arg" | ||
5008 | + func_append compiler_flags " $arg" | ||
5009 | func_append compile_command " $arg" | ||
5010 | func_append finalize_command " $arg" | ||
5011 | case "$new_inherited_linker_flags " in | ||
5012 | *" $arg "*) ;; | ||
5013 | - * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; | ||
5014 | + * ) func_append new_inherited_linker_flags " $arg" ;; | ||
5015 | esac | ||
5016 | continue | ||
5017 | ;; | ||
5018 | @@ -4863,13 +5723,17 @@ func_mode_link () | ||
5019 | # We need an absolute path. | ||
5020 | case $dir in | ||
5021 | [\\/]* | [A-Za-z]:[\\/]*) ;; | ||
5022 | + =*) | ||
5023 | + func_stripname '=' '' "$dir" | ||
5024 | + dir=$lt_sysroot$func_stripname_result | ||
5025 | + ;; | ||
5026 | *) | ||
5027 | func_fatal_error "only absolute run-paths are allowed" | ||
5028 | ;; | ||
5029 | esac | ||
5030 | case "$xrpath " in | ||
5031 | *" $dir "*) ;; | ||
5032 | - *) xrpath="$xrpath $dir" ;; | ||
5033 | + *) func_append xrpath " $dir" ;; | ||
5034 | esac | ||
5035 | continue | ||
5036 | ;; | ||
5037 | @@ -4922,8 +5786,8 @@ func_mode_link () | ||
5038 | for flag in $args; do | ||
5039 | IFS="$save_ifs" | ||
5040 | func_quote_for_eval "$flag" | ||
5041 | - arg="$arg $func_quote_for_eval_result" | ||
5042 | - compiler_flags="$compiler_flags $func_quote_for_eval_result" | ||
5043 | + func_append arg " $func_quote_for_eval_result" | ||
5044 | + func_append compiler_flags " $func_quote_for_eval_result" | ||
5045 | done | ||
5046 | IFS="$save_ifs" | ||
5047 | func_stripname ' ' '' "$arg" | ||
5048 | @@ -4938,9 +5802,9 @@ func_mode_link () | ||
5049 | for flag in $args; do | ||
5050 | IFS="$save_ifs" | ||
5051 | func_quote_for_eval "$flag" | ||
5052 | - arg="$arg $wl$func_quote_for_eval_result" | ||
5053 | - compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" | ||
5054 | - linker_flags="$linker_flags $func_quote_for_eval_result" | ||
5055 | + func_append arg " $wl$func_quote_for_eval_result" | ||
5056 | + func_append compiler_flags " $wl$func_quote_for_eval_result" | ||
5057 | + func_append linker_flags " $func_quote_for_eval_result" | ||
5058 | done | ||
5059 | IFS="$save_ifs" | ||
5060 | func_stripname ' ' '' "$arg" | ||
5061 | @@ -4968,24 +5832,27 @@ func_mode_link () | ||
5062 | arg="$func_quote_for_eval_result" | ||
5063 | ;; | ||
5064 | |||
5065 | - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler | ||
5066 | - # -r[0-9][0-9]* specifies the processor on the SGI compiler | ||
5067 | - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler | ||
5068 | - # +DA*, +DD* enable 64-bit mode on the HP compiler | ||
5069 | - # -q* pass through compiler args for the IBM compiler | ||
5070 | - # -m*, -t[45]*, -txscale* pass through architecture-specific | ||
5071 | - # compiler args for GCC | ||
5072 | - # -F/path gives path to uninstalled frameworks, gcc on darwin | ||
5073 | - # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC | ||
5074 | - # @file GCC response files | ||
5075 | - # -tp=* Portland pgcc target processor selection | ||
5076 | + # Flags to be passed through unchanged, with rationale: | ||
5077 | + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler | ||
5078 | + # -r[0-9][0-9]* specify processor for the SGI compiler | ||
5079 | + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler | ||
5080 | + # +DA*, +DD* enable 64-bit mode for the HP compiler | ||
5081 | + # -q* compiler args for the IBM compiler | ||
5082 | + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC | ||
5083 | + # -F/path path to uninstalled frameworks, gcc on darwin | ||
5084 | + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC | ||
5085 | + # @file GCC response files | ||
5086 | + # -tp=* Portland pgcc target processor selection | ||
5087 | + # --sysroot=* for sysroot support | ||
5088 | + # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization | ||
5089 | -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ | ||
5090 | - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) | ||
5091 | + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ | ||
5092 | + -O*|-flto*|-fwhopr*|-fuse-linker-plugin) | ||
5093 | func_quote_for_eval "$arg" | ||
5094 | arg="$func_quote_for_eval_result" | ||
5095 | func_append compile_command " $arg" | ||
5096 | func_append finalize_command " $arg" | ||
5097 | - compiler_flags="$compiler_flags $arg" | ||
5098 | + func_append compiler_flags " $arg" | ||
5099 | continue | ||
5100 | ;; | ||
5101 | |||
5102 | @@ -4997,7 +5864,7 @@ func_mode_link () | ||
5103 | |||
5104 | *.$objext) | ||
5105 | # A standard object. | ||
5106 | - objs="$objs $arg" | ||
5107 | + func_append objs " $arg" | ||
5108 | ;; | ||
5109 | |||
5110 | *.lo) | ||
5111 | @@ -5028,7 +5895,7 @@ func_mode_link () | ||
5112 | |||
5113 | if test "$prev" = dlfiles; then | ||
5114 | if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then | ||
5115 | - dlfiles="$dlfiles $pic_object" | ||
5116 | + func_append dlfiles " $pic_object" | ||
5117 | prev= | ||
5118 | continue | ||
5119 | else | ||
5120 | @@ -5040,7 +5907,7 @@ func_mode_link () | ||
5121 | # CHECK ME: I think I busted this. -Ossama | ||
5122 | if test "$prev" = dlprefiles; then | ||
5123 | # Preload the old-style object. | ||
5124 | - dlprefiles="$dlprefiles $pic_object" | ||
5125 | + func_append dlprefiles " $pic_object" | ||
5126 | prev= | ||
5127 | fi | ||
5128 | |||
5129 | @@ -5085,24 +5952,25 @@ func_mode_link () | ||
5130 | |||
5131 | *.$libext) | ||
5132 | # An archive. | ||
5133 | - deplibs="$deplibs $arg" | ||
5134 | - old_deplibs="$old_deplibs $arg" | ||
5135 | + func_append deplibs " $arg" | ||
5136 | + func_append old_deplibs " $arg" | ||
5137 | continue | ||
5138 | ;; | ||
5139 | |||
5140 | *.la) | ||
5141 | # A libtool-controlled library. | ||
5142 | |||
5143 | + func_resolve_sysroot "$arg" | ||
5144 | if test "$prev" = dlfiles; then | ||
5145 | # This library was specified with -dlopen. | ||
5146 | - dlfiles="$dlfiles $arg" | ||
5147 | + func_append dlfiles " $func_resolve_sysroot_result" | ||
5148 | prev= | ||
5149 | elif test "$prev" = dlprefiles; then | ||
5150 | # The library was specified with -dlpreopen. | ||
5151 | - dlprefiles="$dlprefiles $arg" | ||
5152 | + func_append dlprefiles " $func_resolve_sysroot_result" | ||
5153 | prev= | ||
5154 | else | ||
5155 | - deplibs="$deplibs $arg" | ||
5156 | + func_append deplibs " $func_resolve_sysroot_result" | ||
5157 | fi | ||
5158 | continue | ||
5159 | ;; | ||
5160 | @@ -5127,7 +5995,7 @@ func_mode_link () | ||
5161 | func_fatal_help "the \`$prevarg' option requires an argument" | ||
5162 | |||
5163 | if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then | ||
5164 | - eval "arg=\"$export_dynamic_flag_spec\"" | ||
5165 | + eval arg=\"$export_dynamic_flag_spec\" | ||
5166 | func_append compile_command " $arg" | ||
5167 | func_append finalize_command " $arg" | ||
5168 | fi | ||
5169 | @@ -5144,11 +6012,13 @@ func_mode_link () | ||
5170 | else | ||
5171 | shlib_search_path= | ||
5172 | fi | ||
5173 | - eval "sys_lib_search_path=\"$sys_lib_search_path_spec\"" | ||
5174 | - eval "sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"" | ||
5175 | + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" | ||
5176 | + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" | ||
5177 | |||
5178 | func_dirname "$output" "/" "" | ||
5179 | output_objdir="$func_dirname_result$objdir" | ||
5180 | + func_to_tool_file "$output_objdir/" | ||
5181 | + tool_output_objdir=$func_to_tool_file_result | ||
5182 | # Create the object directory. | ||
5183 | func_mkdir_p "$output_objdir" | ||
5184 | |||
5185 | @@ -5169,12 +6039,12 @@ func_mode_link () | ||
5186 | # Find all interdependent deplibs by searching for libraries | ||
5187 | # that are linked more than once (e.g. -la -lb -la) | ||
5188 | for deplib in $deplibs; do | ||
5189 | - if $opt_duplicate_deps ; then | ||
5190 | + if $opt_preserve_dup_deps ; then | ||
5191 | case "$libs " in | ||
5192 | - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
5193 | + *" $deplib "*) func_append specialdeplibs " $deplib" ;; | ||
5194 | esac | ||
5195 | fi | ||
5196 | - libs="$libs $deplib" | ||
5197 | + func_append libs " $deplib" | ||
5198 | done | ||
5199 | |||
5200 | if test "$linkmode" = lib; then | ||
5201 | @@ -5187,9 +6057,9 @@ func_mode_link () | ||
5202 | if $opt_duplicate_compiler_generated_deps; then | ||
5203 | for pre_post_dep in $predeps $postdeps; do | ||
5204 | case "$pre_post_deps " in | ||
5205 | - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; | ||
5206 | + *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; | ||
5207 | esac | ||
5208 | - pre_post_deps="$pre_post_deps $pre_post_dep" | ||
5209 | + func_append pre_post_deps " $pre_post_dep" | ||
5210 | done | ||
5211 | fi | ||
5212 | pre_post_deps= | ||
5213 | @@ -5256,8 +6126,9 @@ func_mode_link () | ||
5214 | for lib in $dlprefiles; do | ||
5215 | # Ignore non-libtool-libs | ||
5216 | dependency_libs= | ||
5217 | + func_resolve_sysroot "$lib" | ||
5218 | case $lib in | ||
5219 | - *.la) func_source "$lib" ;; | ||
5220 | + *.la) func_source "$func_resolve_sysroot_result" ;; | ||
5221 | esac | ||
5222 | |||
5223 | # Collect preopened libtool deplibs, except any this library | ||
5224 | @@ -5267,7 +6138,7 @@ func_mode_link () | ||
5225 | deplib_base=$func_basename_result | ||
5226 | case " $weak_libs " in | ||
5227 | *" $deplib_base "*) ;; | ||
5228 | - *) deplibs="$deplibs $deplib" ;; | ||
5229 | + *) func_append deplibs " $deplib" ;; | ||
5230 | esac | ||
5231 | done | ||
5232 | done | ||
5233 | @@ -5288,11 +6159,11 @@ func_mode_link () | ||
5234 | compile_deplibs="$deplib $compile_deplibs" | ||
5235 | finalize_deplibs="$deplib $finalize_deplibs" | ||
5236 | else | ||
5237 | - compiler_flags="$compiler_flags $deplib" | ||
5238 | + func_append compiler_flags " $deplib" | ||
5239 | if test "$linkmode" = lib ; then | ||
5240 | case "$new_inherited_linker_flags " in | ||
5241 | *" $deplib "*) ;; | ||
5242 | - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; | ||
5243 | + * ) func_append new_inherited_linker_flags " $deplib" ;; | ||
5244 | esac | ||
5245 | fi | ||
5246 | fi | ||
5247 | @@ -5377,7 +6248,7 @@ func_mode_link () | ||
5248 | if test "$linkmode" = lib ; then | ||
5249 | case "$new_inherited_linker_flags " in | ||
5250 | *" $deplib "*) ;; | ||
5251 | - * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; | ||
5252 | + * ) func_append new_inherited_linker_flags " $deplib" ;; | ||
5253 | esac | ||
5254 | fi | ||
5255 | fi | ||
5256 | @@ -5390,7 +6261,8 @@ func_mode_link () | ||
5257 | test "$pass" = conv && continue | ||
5258 | newdependency_libs="$deplib $newdependency_libs" | ||
5259 | func_stripname '-L' '' "$deplib" | ||
5260 | - newlib_search_path="$newlib_search_path $func_stripname_result" | ||
5261 | + func_resolve_sysroot "$func_stripname_result" | ||
5262 | + func_append newlib_search_path " $func_resolve_sysroot_result" | ||
5263 | ;; | ||
5264 | prog) | ||
5265 | if test "$pass" = conv; then | ||
5266 | @@ -5404,7 +6276,8 @@ func_mode_link () | ||
5267 | finalize_deplibs="$deplib $finalize_deplibs" | ||
5268 | fi | ||
5269 | func_stripname '-L' '' "$deplib" | ||
5270 | - newlib_search_path="$newlib_search_path $func_stripname_result" | ||
5271 | + func_resolve_sysroot "$func_stripname_result" | ||
5272 | + func_append newlib_search_path " $func_resolve_sysroot_result" | ||
5273 | ;; | ||
5274 | *) | ||
5275 | func_warning "\`-L' is ignored for archives/objects" | ||
5276 | @@ -5415,17 +6288,21 @@ func_mode_link () | ||
5277 | -R*) | ||
5278 | if test "$pass" = link; then | ||
5279 | func_stripname '-R' '' "$deplib" | ||
5280 | - dir=$func_stripname_result | ||
5281 | + func_resolve_sysroot "$func_stripname_result" | ||
5282 | + dir=$func_resolve_sysroot_result | ||
5283 | # Make sure the xrpath contains only unique directories. | ||
5284 | case "$xrpath " in | ||
5285 | *" $dir "*) ;; | ||
5286 | - *) xrpath="$xrpath $dir" ;; | ||
5287 | + *) func_append xrpath " $dir" ;; | ||
5288 | esac | ||
5289 | fi | ||
5290 | deplibs="$deplib $deplibs" | ||
5291 | continue | ||
5292 | ;; | ||
5293 | - *.la) lib="$deplib" ;; | ||
5294 | + *.la) | ||
5295 | + func_resolve_sysroot "$deplib" | ||
5296 | + lib=$func_resolve_sysroot_result | ||
5297 | + ;; | ||
5298 | *.$libext) | ||
5299 | if test "$pass" = conv; then | ||
5300 | deplibs="$deplib $deplibs" | ||
5301 | @@ -5488,11 +6365,11 @@ func_mode_link () | ||
5302 | if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then | ||
5303 | # If there is no dlopen support or we're linking statically, | ||
5304 | # we need to preload. | ||
5305 | - newdlprefiles="$newdlprefiles $deplib" | ||
5306 | + func_append newdlprefiles " $deplib" | ||
5307 | compile_deplibs="$deplib $compile_deplibs" | ||
5308 | finalize_deplibs="$deplib $finalize_deplibs" | ||
5309 | else | ||
5310 | - newdlfiles="$newdlfiles $deplib" | ||
5311 | + func_append newdlfiles " $deplib" | ||
5312 | fi | ||
5313 | fi | ||
5314 | continue | ||
5315 | @@ -5538,7 +6415,7 @@ func_mode_link () | ||
5316 | for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do | ||
5317 | case " $new_inherited_linker_flags " in | ||
5318 | *" $tmp_inherited_linker_flag "*) ;; | ||
5319 | - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; | ||
5320 | + *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; | ||
5321 | esac | ||
5322 | done | ||
5323 | fi | ||
5324 | @@ -5546,8 +6423,8 @@ func_mode_link () | ||
5325 | if test "$linkmode,$pass" = "lib,link" || | ||
5326 | test "$linkmode,$pass" = "prog,scan" || | ||
5327 | { test "$linkmode" != prog && test "$linkmode" != lib; }; then | ||
5328 | - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" | ||
5329 | - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" | ||
5330 | + test -n "$dlopen" && func_append dlfiles " $dlopen" | ||
5331 | + test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" | ||
5332 | fi | ||
5333 | |||
5334 | if test "$pass" = conv; then | ||
5335 | @@ -5558,20 +6435,20 @@ func_mode_link () | ||
5336 | func_fatal_error "cannot find name of link library for \`$lib'" | ||
5337 | fi | ||
5338 | # It is a libtool convenience library, so add in its objects. | ||
5339 | - convenience="$convenience $ladir/$objdir/$old_library" | ||
5340 | - old_convenience="$old_convenience $ladir/$objdir/$old_library" | ||
5341 | + func_append convenience " $ladir/$objdir/$old_library" | ||
5342 | + func_append old_convenience " $ladir/$objdir/$old_library" | ||
5343 | elif test "$linkmode" != prog && test "$linkmode" != lib; then | ||
5344 | func_fatal_error "\`$lib' is not a convenience library" | ||
5345 | fi | ||
5346 | tmp_libs= | ||
5347 | for deplib in $dependency_libs; do | ||
5348 | deplibs="$deplib $deplibs" | ||
5349 | - if $opt_duplicate_deps ; then | ||
5350 | + if $opt_preserve_dup_deps ; then | ||
5351 | case "$tmp_libs " in | ||
5352 | - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
5353 | + *" $deplib "*) func_append specialdeplibs " $deplib" ;; | ||
5354 | esac | ||
5355 | fi | ||
5356 | - tmp_libs="$tmp_libs $deplib" | ||
5357 | + func_append tmp_libs " $deplib" | ||
5358 | done | ||
5359 | continue | ||
5360 | fi # $pass = conv | ||
5361 | @@ -5579,9 +6456,15 @@ func_mode_link () | ||
5362 | |||
5363 | # Get the name of the library we link against. | ||
5364 | linklib= | ||
5365 | - for l in $old_library $library_names; do | ||
5366 | - linklib="$l" | ||
5367 | - done | ||
5368 | + if test -n "$old_library" && | ||
5369 | + { test "$prefer_static_libs" = yes || | ||
5370 | + test "$prefer_static_libs,$installed" = "built,no"; }; then | ||
5371 | + linklib=$old_library | ||
5372 | + else | ||
5373 | + for l in $old_library $library_names; do | ||
5374 | + linklib="$l" | ||
5375 | + done | ||
5376 | + fi | ||
5377 | if test -z "$linklib"; then | ||
5378 | func_fatal_error "cannot find name of link library for \`$lib'" | ||
5379 | fi | ||
5380 | @@ -5598,9 +6481,9 @@ func_mode_link () | ||
5381 | # statically, we need to preload. We also need to preload any | ||
5382 | # dependent libraries so libltdl's deplib preloader doesn't | ||
5383 | # bomb out in the load deplibs phase. | ||
5384 | - dlprefiles="$dlprefiles $lib $dependency_libs" | ||
5385 | + func_append dlprefiles " $lib $dependency_libs" | ||
5386 | else | ||
5387 | - newdlfiles="$newdlfiles $lib" | ||
5388 | + func_append newdlfiles " $lib" | ||
5389 | fi | ||
5390 | continue | ||
5391 | fi # $pass = dlopen | ||
5392 | @@ -5622,14 +6505,14 @@ func_mode_link () | ||
5393 | |||
5394 | # Find the relevant object directory and library name. | ||
5395 | if test "X$installed" = Xyes; then | ||
5396 | - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then | ||
5397 | + if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then | ||
5398 | func_warning "library \`$lib' was moved." | ||
5399 | dir="$ladir" | ||
5400 | absdir="$abs_ladir" | ||
5401 | libdir="$abs_ladir" | ||
5402 | else | ||
5403 | - dir="$libdir" | ||
5404 | - absdir="$libdir" | ||
5405 | + dir="$lt_sysroot$libdir" | ||
5406 | + absdir="$lt_sysroot$libdir" | ||
5407 | fi | ||
5408 | test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes | ||
5409 | else | ||
5410 | @@ -5637,12 +6520,12 @@ func_mode_link () | ||
5411 | dir="$ladir" | ||
5412 | absdir="$abs_ladir" | ||
5413 | # Remove this search path later | ||
5414 | - notinst_path="$notinst_path $abs_ladir" | ||
5415 | + func_append notinst_path " $abs_ladir" | ||
5416 | else | ||
5417 | dir="$ladir/$objdir" | ||
5418 | absdir="$abs_ladir/$objdir" | ||
5419 | # Remove this search path later | ||
5420 | - notinst_path="$notinst_path $abs_ladir" | ||
5421 | + func_append notinst_path " $abs_ladir" | ||
5422 | fi | ||
5423 | fi # $installed = yes | ||
5424 | func_stripname 'lib' '.la' "$laname" | ||
5425 | @@ -5653,20 +6536,46 @@ func_mode_link () | ||
5426 | if test -z "$libdir" && test "$linkmode" = prog; then | ||
5427 | func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" | ||
5428 | fi | ||
5429 | - # Prefer using a static library (so that no silly _DYNAMIC symbols | ||
5430 | - # are required to link). | ||
5431 | - if test -n "$old_library"; then | ||
5432 | - newdlprefiles="$newdlprefiles $dir/$old_library" | ||
5433 | - # Keep a list of preopened convenience libraries to check | ||
5434 | - # that they are being used correctly in the link pass. | ||
5435 | - test -z "$libdir" && \ | ||
5436 | - dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" | ||
5437 | - # Otherwise, use the dlname, so that lt_dlopen finds it. | ||
5438 | - elif test -n "$dlname"; then | ||
5439 | - newdlprefiles="$newdlprefiles $dir/$dlname" | ||
5440 | - else | ||
5441 | - newdlprefiles="$newdlprefiles $dir/$linklib" | ||
5442 | - fi | ||
5443 | + case "$host" in | ||
5444 | + # special handling for platforms with PE-DLLs. | ||
5445 | + *cygwin* | *mingw* | *cegcc* ) | ||
5446 | + # Linker will automatically link against shared library if both | ||
5447 | + # static and shared are present. Therefore, ensure we extract | ||
5448 | + # symbols from the import library if a shared library is present | ||
5449 | + # (otherwise, the dlopen module name will be incorrect). We do | ||
5450 | + # this by putting the import library name into $newdlprefiles. | ||
5451 | + # We recover the dlopen module name by 'saving' the la file | ||
5452 | + # name in a special purpose variable, and (later) extracting the | ||
5453 | + # dlname from the la file. | ||
5454 | + if test -n "$dlname"; then | ||
5455 | + func_tr_sh "$dir/$linklib" | ||
5456 | + eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" | ||
5457 | + func_append newdlprefiles " $dir/$linklib" | ||
5458 | + else | ||
5459 | + func_append newdlprefiles " $dir/$old_library" | ||
5460 | + # Keep a list of preopened convenience libraries to check | ||
5461 | + # that they are being used correctly in the link pass. | ||
5462 | + test -z "$libdir" && \ | ||
5463 | + func_append dlpreconveniencelibs " $dir/$old_library" | ||
5464 | + fi | ||
5465 | + ;; | ||
5466 | + * ) | ||
5467 | + # Prefer using a static library (so that no silly _DYNAMIC symbols | ||
5468 | + # are required to link). | ||
5469 | + if test -n "$old_library"; then | ||
5470 | + func_append newdlprefiles " $dir/$old_library" | ||
5471 | + # Keep a list of preopened convenience libraries to check | ||
5472 | + # that they are being used correctly in the link pass. | ||
5473 | + test -z "$libdir" && \ | ||
5474 | + func_append dlpreconveniencelibs " $dir/$old_library" | ||
5475 | + # Otherwise, use the dlname, so that lt_dlopen finds it. | ||
5476 | + elif test -n "$dlname"; then | ||
5477 | + func_append newdlprefiles " $dir/$dlname" | ||
5478 | + else | ||
5479 | + func_append newdlprefiles " $dir/$linklib" | ||
5480 | + fi | ||
5481 | + ;; | ||
5482 | + esac | ||
5483 | fi # $pass = dlpreopen | ||
5484 | |||
5485 | if test -z "$libdir"; then | ||
5486 | @@ -5684,7 +6593,7 @@ func_mode_link () | ||
5487 | |||
5488 | |||
5489 | if test "$linkmode" = prog && test "$pass" != link; then | ||
5490 | - newlib_search_path="$newlib_search_path $ladir" | ||
5491 | + func_append newlib_search_path " $ladir" | ||
5492 | deplibs="$lib $deplibs" | ||
5493 | |||
5494 | linkalldeplibs=no | ||
5495 | @@ -5697,7 +6606,8 @@ func_mode_link () | ||
5496 | for deplib in $dependency_libs; do | ||
5497 | case $deplib in | ||
5498 | -L*) func_stripname '-L' '' "$deplib" | ||
5499 | - newlib_search_path="$newlib_search_path $func_stripname_result" | ||
5500 | + func_resolve_sysroot "$func_stripname_result" | ||
5501 | + func_append newlib_search_path " $func_resolve_sysroot_result" | ||
5502 | ;; | ||
5503 | esac | ||
5504 | # Need to link against all dependency_libs? | ||
5505 | @@ -5708,12 +6618,12 @@ func_mode_link () | ||
5506 | # or/and link against static libraries | ||
5507 | newdependency_libs="$deplib $newdependency_libs" | ||
5508 | fi | ||
5509 | - if $opt_duplicate_deps ; then | ||
5510 | + if $opt_preserve_dup_deps ; then | ||
5511 | case "$tmp_libs " in | ||
5512 | - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
5513 | + *" $deplib "*) func_append specialdeplibs " $deplib" ;; | ||
5514 | esac | ||
5515 | fi | ||
5516 | - tmp_libs="$tmp_libs $deplib" | ||
5517 | + func_append tmp_libs " $deplib" | ||
5518 | done # for deplib | ||
5519 | continue | ||
5520 | fi # $linkmode = prog... | ||
5521 | @@ -5728,7 +6638,7 @@ func_mode_link () | ||
5522 | # Make sure the rpath contains only unique directories. | ||
5523 | case "$temp_rpath:" in | ||
5524 | *"$absdir:"*) ;; | ||
5525 | - *) temp_rpath="$temp_rpath$absdir:" ;; | ||
5526 | + *) func_append temp_rpath "$absdir:" ;; | ||
5527 | esac | ||
5528 | fi | ||
5529 | |||
5530 | @@ -5740,7 +6650,7 @@ func_mode_link () | ||
5531 | *) | ||
5532 | case "$compile_rpath " in | ||
5533 | *" $absdir "*) ;; | ||
5534 | - *) compile_rpath="$compile_rpath $absdir" | ||
5535 | + *) func_append compile_rpath " $absdir" ;; | ||
5536 | esac | ||
5537 | ;; | ||
5538 | esac | ||
5539 | @@ -5749,7 +6659,7 @@ func_mode_link () | ||
5540 | *) | ||
5541 | case "$finalize_rpath " in | ||
5542 | *" $libdir "*) ;; | ||
5543 | - *) finalize_rpath="$finalize_rpath $libdir" | ||
5544 | + *) func_append finalize_rpath " $libdir" ;; | ||
5545 | esac | ||
5546 | ;; | ||
5547 | esac | ||
5548 | @@ -5774,12 +6684,12 @@ func_mode_link () | ||
5549 | case $host in | ||
5550 | *cygwin* | *mingw* | *cegcc*) | ||
5551 | # No point in relinking DLLs because paths are not encoded | ||
5552 | - notinst_deplibs="$notinst_deplibs $lib" | ||
5553 | + func_append notinst_deplibs " $lib" | ||
5554 | need_relink=no | ||
5555 | ;; | ||
5556 | *) | ||
5557 | if test "$installed" = no; then | ||
5558 | - notinst_deplibs="$notinst_deplibs $lib" | ||
5559 | + func_append notinst_deplibs " $lib" | ||
5560 | need_relink=yes | ||
5561 | fi | ||
5562 | ;; | ||
5563 | @@ -5814,7 +6724,7 @@ func_mode_link () | ||
5564 | *) | ||
5565 | case "$compile_rpath " in | ||
5566 | *" $absdir "*) ;; | ||
5567 | - *) compile_rpath="$compile_rpath $absdir" | ||
5568 | + *) func_append compile_rpath " $absdir" ;; | ||
5569 | esac | ||
5570 | ;; | ||
5571 | esac | ||
5572 | @@ -5823,7 +6733,7 @@ func_mode_link () | ||
5573 | *) | ||
5574 | case "$finalize_rpath " in | ||
5575 | *" $libdir "*) ;; | ||
5576 | - *) finalize_rpath="$finalize_rpath $libdir" | ||
5577 | + *) func_append finalize_rpath " $libdir" ;; | ||
5578 | esac | ||
5579 | ;; | ||
5580 | esac | ||
5581 | @@ -5835,7 +6745,7 @@ func_mode_link () | ||
5582 | shift | ||
5583 | realname="$1" | ||
5584 | shift | ||
5585 | - eval "libname=\"$libname_spec\"" | ||
5586 | + libname=`eval "\\$ECHO \"$libname_spec\""` | ||
5587 | # use dlname if we got it. it's perfectly good, no? | ||
5588 | if test -n "$dlname"; then | ||
5589 | soname="$dlname" | ||
5590 | @@ -5848,7 +6758,7 @@ func_mode_link () | ||
5591 | versuffix="-$major" | ||
5592 | ;; | ||
5593 | esac | ||
5594 | - eval "soname=\"$soname_spec\"" | ||
5595 | + eval soname=\"$soname_spec\" | ||
5596 | else | ||
5597 | soname="$realname" | ||
5598 | fi | ||
5599 | @@ -5877,7 +6787,7 @@ func_mode_link () | ||
5600 | linklib=$newlib | ||
5601 | fi # test -n "$old_archive_from_expsyms_cmds" | ||
5602 | |||
5603 | - if test "$linkmode" = prog || test "$mode" != relink; then | ||
5604 | + if test "$linkmode" = prog || test "$opt_mode" != relink; then | ||
5605 | add_shlibpath= | ||
5606 | add_dir= | ||
5607 | add= | ||
5608 | @@ -5933,7 +6843,7 @@ func_mode_link () | ||
5609 | if test -n "$inst_prefix_dir"; then | ||
5610 | case $libdir in | ||
5611 | [\\/]*) | ||
5612 | - add_dir="$add_dir -L$inst_prefix_dir$libdir" | ||
5613 | + func_append add_dir " -L$inst_prefix_dir$libdir" | ||
5614 | ;; | ||
5615 | esac | ||
5616 | fi | ||
5617 | @@ -5955,7 +6865,7 @@ func_mode_link () | ||
5618 | if test -n "$add_shlibpath"; then | ||
5619 | case :$compile_shlibpath: in | ||
5620 | *":$add_shlibpath:"*) ;; | ||
5621 | - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; | ||
5622 | + *) func_append compile_shlibpath "$add_shlibpath:" ;; | ||
5623 | esac | ||
5624 | fi | ||
5625 | if test "$linkmode" = prog; then | ||
5626 | @@ -5969,13 +6879,13 @@ func_mode_link () | ||
5627 | test "$hardcode_shlibpath_var" = yes; then | ||
5628 | case :$finalize_shlibpath: in | ||
5629 | *":$libdir:"*) ;; | ||
5630 | - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; | ||
5631 | + *) func_append finalize_shlibpath "$libdir:" ;; | ||
5632 | esac | ||
5633 | fi | ||
5634 | fi | ||
5635 | fi | ||
5636 | |||
5637 | - if test "$linkmode" = prog || test "$mode" = relink; then | ||
5638 | + if test "$linkmode" = prog || test "$opt_mode" = relink; then | ||
5639 | add_shlibpath= | ||
5640 | add_dir= | ||
5641 | add= | ||
5642 | @@ -5989,7 +6899,7 @@ func_mode_link () | ||
5643 | elif test "$hardcode_shlibpath_var" = yes; then | ||
5644 | case :$finalize_shlibpath: in | ||
5645 | *":$libdir:"*) ;; | ||
5646 | - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; | ||
5647 | + *) func_append finalize_shlibpath "$libdir:" ;; | ||
5648 | esac | ||
5649 | add="-l$name" | ||
5650 | elif test "$hardcode_automatic" = yes; then | ||
5651 | @@ -6001,12 +6911,12 @@ func_mode_link () | ||
5652 | fi | ||
5653 | else | ||
5654 | # We cannot seem to hardcode it, guess we'll fake it. | ||
5655 | - add_dir="-L$libdir" | ||
5656 | + add_dir="-L$lt_sysroot$libdir" | ||
5657 | # Try looking first in the location we're being installed to. | ||
5658 | if test -n "$inst_prefix_dir"; then | ||
5659 | case $libdir in | ||
5660 | [\\/]*) | ||
5661 | - add_dir="$add_dir -L$inst_prefix_dir$libdir" | ||
5662 | + func_append add_dir " -L$inst_prefix_dir$libdir" | ||
5663 | ;; | ||
5664 | esac | ||
5665 | fi | ||
5666 | @@ -6083,27 +6993,33 @@ func_mode_link () | ||
5667 | temp_xrpath=$func_stripname_result | ||
5668 | case " $xrpath " in | ||
5669 | *" $temp_xrpath "*) ;; | ||
5670 | - *) xrpath="$xrpath $temp_xrpath";; | ||
5671 | + *) func_append xrpath " $temp_xrpath";; | ||
5672 | esac;; | ||
5673 | - *) temp_deplibs="$temp_deplibs $libdir";; | ||
5674 | + *) func_append temp_deplibs " $libdir";; | ||
5675 | esac | ||
5676 | done | ||
5677 | dependency_libs="$temp_deplibs" | ||
5678 | fi | ||
5679 | |||
5680 | - newlib_search_path="$newlib_search_path $absdir" | ||
5681 | + func_append newlib_search_path " $absdir" | ||
5682 | # Link against this library | ||
5683 | test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" | ||
5684 | # ... and its dependency_libs | ||
5685 | tmp_libs= | ||
5686 | for deplib in $dependency_libs; do | ||
5687 | newdependency_libs="$deplib $newdependency_libs" | ||
5688 | - if $opt_duplicate_deps ; then | ||
5689 | + case $deplib in | ||
5690 | + -L*) func_stripname '-L' '' "$deplib" | ||
5691 | + func_resolve_sysroot "$func_stripname_result";; | ||
5692 | + *) func_resolve_sysroot "$deplib" ;; | ||
5693 | + esac | ||
5694 | + if $opt_preserve_dup_deps ; then | ||
5695 | case "$tmp_libs " in | ||
5696 | - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; | ||
5697 | + *" $func_resolve_sysroot_result "*) | ||
5698 | + func_append specialdeplibs " $func_resolve_sysroot_result" ;; | ||
5699 | esac | ||
5700 | fi | ||
5701 | - tmp_libs="$tmp_libs $deplib" | ||
5702 | + func_append tmp_libs " $func_resolve_sysroot_result" | ||
5703 | done | ||
5704 | |||
5705 | if test "$link_all_deplibs" != no; then | ||
5706 | @@ -6113,8 +7029,10 @@ func_mode_link () | ||
5707 | case $deplib in | ||
5708 | -L*) path="$deplib" ;; | ||
5709 | *.la) | ||
5710 | + func_resolve_sysroot "$deplib" | ||
5711 | + deplib=$func_resolve_sysroot_result | ||
5712 | func_dirname "$deplib" "" "." | ||
5713 | - dir="$func_dirname_result" | ||
5714 | + dir=$func_dirname_result | ||
5715 | # We need an absolute path. | ||
5716 | case $dir in | ||
5717 | [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; | ||
5718 | @@ -6130,7 +7048,7 @@ func_mode_link () | ||
5719 | case $host in | ||
5720 | *-*-darwin*) | ||
5721 | depdepl= | ||
5722 | - deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` | ||
5723 | + eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` | ||
5724 | if test -n "$deplibrary_names" ; then | ||
5725 | for tmp in $deplibrary_names ; do | ||
5726 | depdepl=$tmp | ||
5727 | @@ -6141,8 +7059,8 @@ func_mode_link () | ||
5728 | if test -z "$darwin_install_name"; then | ||
5729 | darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` | ||
5730 | fi | ||
5731 | - compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" | ||
5732 | - linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" | ||
5733 | + func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" | ||
5734 | + func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" | ||
5735 | path= | ||
5736 | fi | ||
5737 | fi | ||
5738 | @@ -6152,7 +7070,7 @@ func_mode_link () | ||
5739 | ;; | ||
5740 | esac | ||
5741 | else | ||
5742 | - libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | ||
5743 | + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | ||
5744 | test -z "$libdir" && \ | ||
5745 | func_fatal_error "\`$deplib' is not a valid libtool archive" | ||
5746 | test "$absdir" != "$libdir" && \ | ||
5747 | @@ -6192,7 +7110,7 @@ func_mode_link () | ||
5748 | for dir in $newlib_search_path; do | ||
5749 | case "$lib_search_path " in | ||
5750 | *" $dir "*) ;; | ||
5751 | - *) lib_search_path="$lib_search_path $dir" ;; | ||
5752 | + *) func_append lib_search_path " $dir" ;; | ||
5753 | esac | ||
5754 | done | ||
5755 | newlib_search_path= | ||
5756 | @@ -6205,7 +7123,7 @@ func_mode_link () | ||
5757 | fi | ||
5758 | for var in $vars dependency_libs; do | ||
5759 | # Add libraries to $var in reverse order | ||
5760 | - eval tmp_libs=\$$var | ||
5761 | + eval tmp_libs=\"\$$var\" | ||
5762 | new_libs= | ||
5763 | for deplib in $tmp_libs; do | ||
5764 | # FIXME: Pedantically, this is the right thing to do, so | ||
5765 | @@ -6250,13 +7168,13 @@ func_mode_link () | ||
5766 | -L*) | ||
5767 | case " $tmp_libs " in | ||
5768 | *" $deplib "*) ;; | ||
5769 | - *) tmp_libs="$tmp_libs $deplib" ;; | ||
5770 | + *) func_append tmp_libs " $deplib" ;; | ||
5771 | esac | ||
5772 | ;; | ||
5773 | - *) tmp_libs="$tmp_libs $deplib" ;; | ||
5774 | + *) func_append tmp_libs " $deplib" ;; | ||
5775 | esac | ||
5776 | done | ||
5777 | - eval $var=\$tmp_libs | ||
5778 | + eval $var=\"$tmp_libs\" | ||
5779 | done # for var | ||
5780 | fi | ||
5781 | # Last step: remove runtime libs from dependency_libs | ||
5782 | @@ -6269,7 +7187,7 @@ func_mode_link () | ||
5783 | ;; | ||
5784 | esac | ||
5785 | if test -n "$i" ; then | ||
5786 | - tmp_libs="$tmp_libs $i" | ||
5787 | + func_append tmp_libs " $i" | ||
5788 | fi | ||
5789 | done | ||
5790 | dependency_libs=$tmp_libs | ||
5791 | @@ -6310,7 +7228,7 @@ func_mode_link () | ||
5792 | # Now set the variables for building old libraries. | ||
5793 | build_libtool_libs=no | ||
5794 | oldlibs="$output" | ||
5795 | - objs="$objs$old_deplibs" | ||
5796 | + func_append objs "$old_deplibs" | ||
5797 | ;; | ||
5798 | |||
5799 | lib) | ||
5800 | @@ -6319,8 +7237,8 @@ func_mode_link () | ||
5801 | lib*) | ||
5802 | func_stripname 'lib' '.la' "$outputname" | ||
5803 | name=$func_stripname_result | ||
5804 | - eval "shared_ext=\"$shrext_cmds\"" | ||
5805 | - eval "libname=\"$libname_spec\"" | ||
5806 | + eval shared_ext=\"$shrext_cmds\" | ||
5807 | + eval libname=\"$libname_spec\" | ||
5808 | ;; | ||
5809 | *) | ||
5810 | test "$module" = no && \ | ||
5811 | @@ -6330,8 +7248,8 @@ func_mode_link () | ||
5812 | # Add the "lib" prefix for modules if required | ||
5813 | func_stripname '' '.la' "$outputname" | ||
5814 | name=$func_stripname_result | ||
5815 | - eval "shared_ext=\"$shrext_cmds\"" | ||
5816 | - eval "libname=\"$libname_spec\"" | ||
5817 | + eval shared_ext=\"$shrext_cmds\" | ||
5818 | + eval libname=\"$libname_spec\" | ||
5819 | else | ||
5820 | func_stripname '' '.la' "$outputname" | ||
5821 | libname=$func_stripname_result | ||
5822 | @@ -6346,7 +7264,7 @@ func_mode_link () | ||
5823 | echo | ||
5824 | $ECHO "*** Warning: Linking the shared library $output against the non-libtool" | ||
5825 | $ECHO "*** objects $objs is not portable!" | ||
5826 | - libobjs="$libobjs $objs" | ||
5827 | + func_append libobjs " $objs" | ||
5828 | fi | ||
5829 | fi | ||
5830 | |||
5831 | @@ -6544,7 +7462,7 @@ func_mode_link () | ||
5832 | done | ||
5833 | |||
5834 | # Make executables depend on our current version. | ||
5835 | - verstring="$verstring:${current}.0" | ||
5836 | + func_append verstring ":${current}.0" | ||
5837 | ;; | ||
5838 | |||
5839 | qnx) | ||
5840 | @@ -6612,10 +7530,10 @@ func_mode_link () | ||
5841 | fi | ||
5842 | |||
5843 | func_generate_dlsyms "$libname" "$libname" "yes" | ||
5844 | - libobjs="$libobjs $symfileobj" | ||
5845 | + func_append libobjs " $symfileobj" | ||
5846 | test "X$libobjs" = "X " && libobjs= | ||
5847 | |||
5848 | - if test "$mode" != relink; then | ||
5849 | + if test "$opt_mode" != relink; then | ||
5850 | # Remove our outputs, but don't remove object files since they | ||
5851 | # may have been created when compiling PIC objects. | ||
5852 | removelist= | ||
5853 | @@ -6631,7 +7549,7 @@ func_mode_link () | ||
5854 | continue | ||
5855 | fi | ||
5856 | fi | ||
5857 | - removelist="$removelist $p" | ||
5858 | + func_append removelist " $p" | ||
5859 | ;; | ||
5860 | *) ;; | ||
5861 | esac | ||
5862 | @@ -6642,7 +7560,7 @@ func_mode_link () | ||
5863 | |||
5864 | # Now set the variables for building old libraries. | ||
5865 | if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then | ||
5866 | - oldlibs="$oldlibs $output_objdir/$libname.$libext" | ||
5867 | + func_append oldlibs " $output_objdir/$libname.$libext" | ||
5868 | |||
5869 | # Transform .lo files to .o files. | ||
5870 | oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` | ||
5871 | @@ -6659,10 +7577,11 @@ func_mode_link () | ||
5872 | # If the user specified any rpath flags, then add them. | ||
5873 | temp_xrpath= | ||
5874 | for libdir in $xrpath; do | ||
5875 | - temp_xrpath="$temp_xrpath -R$libdir" | ||
5876 | + func_replace_sysroot "$libdir" | ||
5877 | + func_append temp_xrpath " -R$func_replace_sysroot_result" | ||
5878 | case "$finalize_rpath " in | ||
5879 | *" $libdir "*) ;; | ||
5880 | - *) finalize_rpath="$finalize_rpath $libdir" ;; | ||
5881 | + *) func_append finalize_rpath " $libdir" ;; | ||
5882 | esac | ||
5883 | done | ||
5884 | if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then | ||
5885 | @@ -6676,7 +7595,7 @@ func_mode_link () | ||
5886 | for lib in $old_dlfiles; do | ||
5887 | case " $dlprefiles $dlfiles " in | ||
5888 | *" $lib "*) ;; | ||
5889 | - *) dlfiles="$dlfiles $lib" ;; | ||
5890 | + *) func_append dlfiles " $lib" ;; | ||
5891 | esac | ||
5892 | done | ||
5893 | |||
5894 | @@ -6686,7 +7605,7 @@ func_mode_link () | ||
5895 | for lib in $old_dlprefiles; do | ||
5896 | case "$dlprefiles " in | ||
5897 | *" $lib "*) ;; | ||
5898 | - *) dlprefiles="$dlprefiles $lib" ;; | ||
5899 | + *) func_append dlprefiles " $lib" ;; | ||
5900 | esac | ||
5901 | done | ||
5902 | |||
5903 | @@ -6698,7 +7617,7 @@ func_mode_link () | ||
5904 | ;; | ||
5905 | *-*-rhapsody* | *-*-darwin1.[012]) | ||
5906 | # Rhapsody C library is in the System framework | ||
5907 | - deplibs="$deplibs System.ltframework" | ||
5908 | + func_append deplibs " System.ltframework" | ||
5909 | ;; | ||
5910 | *-*-netbsd*) | ||
5911 | # Don't link with libc until the a.out ld.so is fixed. | ||
5912 | @@ -6715,7 +7634,7 @@ func_mode_link () | ||
5913 | *) | ||
5914 | # Add libc to deplibs on all other systems if necessary. | ||
5915 | if test "$build_libtool_need_lc" = "yes"; then | ||
5916 | - deplibs="$deplibs -lc" | ||
5917 | + func_append deplibs " -lc" | ||
5918 | fi | ||
5919 | ;; | ||
5920 | esac | ||
5921 | @@ -6764,18 +7683,18 @@ EOF | ||
5922 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
5923 | case " $predeps $postdeps " in | ||
5924 | *" $i "*) | ||
5925 | - newdeplibs="$newdeplibs $i" | ||
5926 | + func_append newdeplibs " $i" | ||
5927 | i="" | ||
5928 | ;; | ||
5929 | esac | ||
5930 | fi | ||
5931 | if test -n "$i" ; then | ||
5932 | - eval "libname=\"$libname_spec\"" | ||
5933 | - eval "deplib_matches=\"$library_names_spec\"" | ||
5934 | + libname=`eval "\\$ECHO \"$libname_spec\""` | ||
5935 | + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` | ||
5936 | set dummy $deplib_matches; shift | ||
5937 | deplib_match=$1 | ||
5938 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then | ||
5939 | - newdeplibs="$newdeplibs $i" | ||
5940 | + func_append newdeplibs " $i" | ||
5941 | else | ||
5942 | droppeddeps=yes | ||
5943 | echo | ||
5944 | @@ -6789,7 +7708,7 @@ EOF | ||
5945 | fi | ||
5946 | ;; | ||
5947 | *) | ||
5948 | - newdeplibs="$newdeplibs $i" | ||
5949 | + func_append newdeplibs " $i" | ||
5950 | ;; | ||
5951 | esac | ||
5952 | done | ||
5953 | @@ -6807,18 +7726,18 @@ EOF | ||
5954 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
5955 | case " $predeps $postdeps " in | ||
5956 | *" $i "*) | ||
5957 | - newdeplibs="$newdeplibs $i" | ||
5958 | + func_append newdeplibs " $i" | ||
5959 | i="" | ||
5960 | ;; | ||
5961 | esac | ||
5962 | fi | ||
5963 | if test -n "$i" ; then | ||
5964 | - eval "libname=\"$libname_spec\"" | ||
5965 | - eval "deplib_matches=\"$library_names_spec\"" | ||
5966 | + libname=`eval "\\$ECHO \"$libname_spec\""` | ||
5967 | + deplib_matches=`eval "\\$ECHO \"$library_names_spec\""` | ||
5968 | set dummy $deplib_matches; shift | ||
5969 | deplib_match=$1 | ||
5970 | if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then | ||
5971 | - newdeplibs="$newdeplibs $i" | ||
5972 | + func_append newdeplibs " $i" | ||
5973 | else | ||
5974 | droppeddeps=yes | ||
5975 | echo | ||
5976 | @@ -6840,7 +7759,7 @@ EOF | ||
5977 | fi | ||
5978 | ;; | ||
5979 | *) | ||
5980 | - newdeplibs="$newdeplibs $i" | ||
5981 | + func_append newdeplibs " $i" | ||
5982 | ;; | ||
5983 | esac | ||
5984 | done | ||
5985 | @@ -6857,15 +7776,27 @@ EOF | ||
5986 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
5987 | case " $predeps $postdeps " in | ||
5988 | *" $a_deplib "*) | ||
5989 | - newdeplibs="$newdeplibs $a_deplib" | ||
5990 | + func_append newdeplibs " $a_deplib" | ||
5991 | a_deplib="" | ||
5992 | ;; | ||
5993 | esac | ||
5994 | fi | ||
5995 | if test -n "$a_deplib" ; then | ||
5996 | - eval "libname=\"$libname_spec\"" | ||
5997 | + libname=`eval "\\$ECHO \"$libname_spec\""` | ||
5998 | + if test -n "$file_magic_glob"; then | ||
5999 | + libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob` | ||
6000 | + else | ||
6001 | + libnameglob=$libname | ||
6002 | + fi | ||
6003 | + test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob` | ||
6004 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do | ||
6005 | - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` | ||
6006 | + if test "$want_nocaseglob" = yes; then | ||
6007 | + shopt -s nocaseglob | ||
6008 | + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` | ||
6009 | + $nocaseglob | ||
6010 | + else | ||
6011 | + potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` | ||
6012 | + fi | ||
6013 | for potent_lib in $potential_libs; do | ||
6014 | # Follow soft links. | ||
6015 | if ls -lLd "$potent_lib" 2>/dev/null | | ||
6016 | @@ -6885,10 +7816,10 @@ EOF | ||
6017 | *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; | ||
6018 | esac | ||
6019 | done | ||
6020 | - if eval "$file_magic_cmd \"\$potlib\"" 2>/dev/null | | ||
6021 | + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | | ||
6022 | $SED -e 10q | | ||
6023 | $EGREP "$file_magic_regex" > /dev/null; then | ||
6024 | - newdeplibs="$newdeplibs $a_deplib" | ||
6025 | + func_append newdeplibs " $a_deplib" | ||
6026 | a_deplib="" | ||
6027 | break 2 | ||
6028 | fi | ||
6029 | @@ -6913,7 +7844,7 @@ EOF | ||
6030 | ;; | ||
6031 | *) | ||
6032 | # Add a -L argument. | ||
6033 | - newdeplibs="$newdeplibs $a_deplib" | ||
6034 | + func_append newdeplibs " $a_deplib" | ||
6035 | ;; | ||
6036 | esac | ||
6037 | done # Gone through all deplibs. | ||
6038 | @@ -6929,20 +7860,20 @@ EOF | ||
6039 | if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then | ||
6040 | case " $predeps $postdeps " in | ||
6041 | *" $a_deplib "*) | ||
6042 | - newdeplibs="$newdeplibs $a_deplib" | ||
6043 | + func_append newdeplibs " $a_deplib" | ||
6044 | a_deplib="" | ||
6045 | ;; | ||
6046 | esac | ||
6047 | fi | ||
6048 | if test -n "$a_deplib" ; then | ||
6049 | - eval "libname=\"$libname_spec\"" | ||
6050 | + libname=`eval "\\$ECHO \"$libname_spec\""` | ||
6051 | for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do | ||
6052 | potential_libs=`ls $i/$libname[.-]* 2>/dev/null` | ||
6053 | for potent_lib in $potential_libs; do | ||
6054 | potlib="$potent_lib" # see symlink-check above in file_magic test | ||
6055 | if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ | ||
6056 | $EGREP "$match_pattern_regex" > /dev/null; then | ||
6057 | - newdeplibs="$newdeplibs $a_deplib" | ||
6058 | + func_append newdeplibs " $a_deplib" | ||
6059 | a_deplib="" | ||
6060 | break 2 | ||
6061 | fi | ||
6062 | @@ -6967,7 +7898,7 @@ EOF | ||
6063 | ;; | ||
6064 | *) | ||
6065 | # Add a -L argument. | ||
6066 | - newdeplibs="$newdeplibs $a_deplib" | ||
6067 | + func_append newdeplibs " $a_deplib" | ||
6068 | ;; | ||
6069 | esac | ||
6070 | done # Gone through all deplibs. | ||
6071 | @@ -7071,7 +8002,7 @@ EOF | ||
6072 | *) | ||
6073 | case " $deplibs " in | ||
6074 | *" -L$path/$objdir "*) | ||
6075 | - new_libs="$new_libs -L$path/$objdir" ;; | ||
6076 | + func_append new_libs " -L$path/$objdir" ;; | ||
6077 | esac | ||
6078 | ;; | ||
6079 | esac | ||
6080 | @@ -7081,10 +8012,10 @@ EOF | ||
6081 | -L*) | ||
6082 | case " $new_libs " in | ||
6083 | *" $deplib "*) ;; | ||
6084 | - *) new_libs="$new_libs $deplib" ;; | ||
6085 | + *) func_append new_libs " $deplib" ;; | ||
6086 | esac | ||
6087 | ;; | ||
6088 | - *) new_libs="$new_libs $deplib" ;; | ||
6089 | + *) func_append new_libs " $deplib" ;; | ||
6090 | esac | ||
6091 | done | ||
6092 | deplibs="$new_libs" | ||
6093 | @@ -7101,10 +8032,12 @@ EOF | ||
6094 | hardcode_libdirs= | ||
6095 | dep_rpath= | ||
6096 | rpath="$finalize_rpath" | ||
6097 | - test "$mode" != relink && rpath="$compile_rpath$rpath" | ||
6098 | + test "$opt_mode" != relink && rpath="$compile_rpath$rpath" | ||
6099 | for libdir in $rpath; do | ||
6100 | if test -n "$hardcode_libdir_flag_spec"; then | ||
6101 | if test -n "$hardcode_libdir_separator"; then | ||
6102 | + func_replace_sysroot "$libdir" | ||
6103 | + libdir=$func_replace_sysroot_result | ||
6104 | if test -z "$hardcode_libdirs"; then | ||
6105 | hardcode_libdirs="$libdir" | ||
6106 | else | ||
6107 | @@ -7113,18 +8046,18 @@ EOF | ||
6108 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) | ||
6109 | ;; | ||
6110 | *) | ||
6111 | - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | ||
6112 | + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" | ||
6113 | ;; | ||
6114 | esac | ||
6115 | fi | ||
6116 | else | ||
6117 | - eval "flag=\"$hardcode_libdir_flag_spec\"" | ||
6118 | - dep_rpath="$dep_rpath $flag" | ||
6119 | + eval flag=\"$hardcode_libdir_flag_spec\" | ||
6120 | + func_append dep_rpath " $flag" | ||
6121 | fi | ||
6122 | elif test -n "$runpath_var"; then | ||
6123 | case "$perm_rpath " in | ||
6124 | *" $libdir "*) ;; | ||
6125 | - *) perm_rpath="$perm_rpath $libdir" ;; | ||
6126 | + *) func_apped perm_rpath " $libdir" ;; | ||
6127 | esac | ||
6128 | fi | ||
6129 | done | ||
6130 | @@ -7133,40 +8066,38 @@ EOF | ||
6131 | test -n "$hardcode_libdirs"; then | ||
6132 | libdir="$hardcode_libdirs" | ||
6133 | if test -n "$hardcode_libdir_flag_spec_ld"; then | ||
6134 | - eval "dep_rpath=\"$hardcode_libdir_flag_spec_ld\"" | ||
6135 | + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" | ||
6136 | else | ||
6137 | - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" | ||
6138 | + eval dep_rpath=\"$hardcode_libdir_flag_spec\" | ||
6139 | fi | ||
6140 | fi | ||
6141 | if test -n "$runpath_var" && test -n "$perm_rpath"; then | ||
6142 | # We should set the runpath_var. | ||
6143 | rpath= | ||
6144 | for dir in $perm_rpath; do | ||
6145 | - rpath="$rpath$dir:" | ||
6146 | + func_append rpath "$dir:" | ||
6147 | done | ||
6148 | - eval $runpath_var=\$rpath\$$runpath_var | ||
6149 | - export $runpath_var | ||
6150 | + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" | ||
6151 | fi | ||
6152 | test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" | ||
6153 | fi | ||
6154 | |||
6155 | shlibpath="$finalize_shlibpath" | ||
6156 | - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" | ||
6157 | + test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" | ||
6158 | if test -n "$shlibpath"; then | ||
6159 | - eval $shlibpath_var=\$shlibpath\$$shlibpath_var | ||
6160 | - export $shlibpath_var | ||
6161 | + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" | ||
6162 | fi | ||
6163 | |||
6164 | # Get the real and link names of the library. | ||
6165 | - eval "shared_ext=\"$shrext_cmds\"" | ||
6166 | - eval "library_names=\"$library_names_spec\"" | ||
6167 | + eval shared_ext=\"$shrext_cmds\" | ||
6168 | + eval library_names=\"$library_names_spec\" | ||
6169 | set dummy $library_names | ||
6170 | shift | ||
6171 | realname="$1" | ||
6172 | shift | ||
6173 | |||
6174 | if test -n "$soname_spec"; then | ||
6175 | - eval "soname=\"$soname_spec\"" | ||
6176 | + eval soname=\"$soname_spec\" | ||
6177 | else | ||
6178 | soname="$realname" | ||
6179 | fi | ||
6180 | @@ -7178,7 +8109,7 @@ EOF | ||
6181 | linknames= | ||
6182 | for link | ||
6183 | do | ||
6184 | - linknames="$linknames $link" | ||
6185 | + func_append linknames " $link" | ||
6186 | done | ||
6187 | |||
6188 | # Use standard objects if they are pic | ||
6189 | @@ -7189,7 +8120,7 @@ EOF | ||
6190 | if test -n "$export_symbols" && test -n "$include_expsyms"; then | ||
6191 | $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" | ||
6192 | export_symbols="$output_objdir/$libname.uexp" | ||
6193 | - delfiles="$delfiles $export_symbols" | ||
6194 | + func_append delfiles " $export_symbols" | ||
6195 | fi | ||
6196 | |||
6197 | orig_export_symbols= | ||
6198 | @@ -7220,13 +8151,45 @@ EOF | ||
6199 | $opt_dry_run || $RM $export_symbols | ||
6200 | cmds=$export_symbols_cmds | ||
6201 | save_ifs="$IFS"; IFS='~' | ||
6202 | - for cmd in $cmds; do | ||
6203 | + for cmd1 in $cmds; do | ||
6204 | IFS="$save_ifs" | ||
6205 | - eval "cmd=\"$cmd\"" | ||
6206 | - func_len " $cmd" | ||
6207 | - len=$func_len_result | ||
6208 | - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then | ||
6209 | + # Take the normal branch if the nm_file_list_spec branch | ||
6210 | + # doesn't work or if tool conversion is not needed. | ||
6211 | + case $nm_file_list_spec~$to_tool_file_cmd in | ||
6212 | + *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) | ||
6213 | + try_normal_branch=yes | ||
6214 | + eval cmd=\"$cmd1\" | ||
6215 | + func_len " $cmd" | ||
6216 | + len=$func_len_result | ||
6217 | + ;; | ||
6218 | + *) | ||
6219 | + try_normal_branch=no | ||
6220 | + ;; | ||
6221 | + esac | ||
6222 | + if test "$try_normal_branch" = yes \ | ||
6223 | + && { test "$len" -lt "$max_cmd_len" \ | ||
6224 | + || test "$max_cmd_len" -le -1; } | ||
6225 | + then | ||
6226 | + func_show_eval "$cmd" 'exit $?' | ||
6227 | + skipped_export=false | ||
6228 | + elif test -n "$nm_file_list_spec"; then | ||
6229 | + func_basename "$output" | ||
6230 | + output_la=$func_basename_result | ||
6231 | + save_libobjs=$libobjs | ||
6232 | + save_output=$output | ||
6233 | + output=${output_objdir}/${output_la}.nm | ||
6234 | + func_to_tool_file "$output" | ||
6235 | + libobjs=$nm_file_list_spec$func_to_tool_file_result | ||
6236 | + func_append delfiles " $output" | ||
6237 | + func_verbose "creating $NM input file list: $output" | ||
6238 | + for obj in $save_libobjs; do | ||
6239 | + func_to_tool_file "$obj" | ||
6240 | + $ECHO "$func_to_tool_file_result" | ||
6241 | + done > "$output" | ||
6242 | + eval cmd=\"$cmd1\" | ||
6243 | func_show_eval "$cmd" 'exit $?' | ||
6244 | + output=$save_output | ||
6245 | + libobjs=$save_libobjs | ||
6246 | skipped_export=false | ||
6247 | else | ||
6248 | # The command line is too long to execute in one step. | ||
6249 | @@ -7248,7 +8211,7 @@ EOF | ||
6250 | if test -n "$export_symbols" && test -n "$include_expsyms"; then | ||
6251 | tmp_export_symbols="$export_symbols" | ||
6252 | test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" | ||
6253 | - $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols" | ||
6254 | + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' | ||
6255 | fi | ||
6256 | |||
6257 | if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then | ||
6258 | @@ -7260,7 +8223,7 @@ EOF | ||
6259 | # global variables. join(1) would be nice here, but unfortunately | ||
6260 | # isn't a blessed tool. | ||
6261 | $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter | ||
6262 | - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" | ||
6263 | + func_append delfiles " $export_symbols $output_objdir/$libname.filter" | ||
6264 | export_symbols=$output_objdir/$libname.def | ||
6265 | $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols | ||
6266 | fi | ||
6267 | @@ -7270,7 +8233,7 @@ EOF | ||
6268 | case " $convenience " in | ||
6269 | *" $test_deplib "*) ;; | ||
6270 | *) | ||
6271 | - tmp_deplibs="$tmp_deplibs $test_deplib" | ||
6272 | + func_append tmp_deplibs " $test_deplib" | ||
6273 | ;; | ||
6274 | esac | ||
6275 | done | ||
6276 | @@ -7286,43 +8249,43 @@ EOF | ||
6277 | fi | ||
6278 | if test -n "$whole_archive_flag_spec"; then | ||
6279 | save_libobjs=$libobjs | ||
6280 | - eval "libobjs=\"\$libobjs $whole_archive_flag_spec\"" | ||
6281 | + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" | ||
6282 | test "X$libobjs" = "X " && libobjs= | ||
6283 | else | ||
6284 | gentop="$output_objdir/${outputname}x" | ||
6285 | - generated="$generated $gentop" | ||
6286 | + func_append generated " $gentop" | ||
6287 | |||
6288 | func_extract_archives $gentop $convenience | ||
6289 | - libobjs="$libobjs $func_extract_archives_result" | ||
6290 | + func_append libobjs " $func_extract_archives_result" | ||
6291 | test "X$libobjs" = "X " && libobjs= | ||
6292 | fi | ||
6293 | fi | ||
6294 | |||
6295 | if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then | ||
6296 | - eval "flag=\"$thread_safe_flag_spec\"" | ||
6297 | - linker_flags="$linker_flags $flag" | ||
6298 | + eval flag=\"$thread_safe_flag_spec\" | ||
6299 | + func_append linker_flags " $flag" | ||
6300 | fi | ||
6301 | |||
6302 | # Make a backup of the uninstalled library when relinking | ||
6303 | - if test "$mode" = relink; then | ||
6304 | - $opt_dry_run || (cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U) || exit $? | ||
6305 | + if test "$opt_mode" = relink; then | ||
6306 | + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? | ||
6307 | fi | ||
6308 | |||
6309 | # Do each of the archive commands. | ||
6310 | if test "$module" = yes && test -n "$module_cmds" ; then | ||
6311 | if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then | ||
6312 | - eval "test_cmds=\"$module_expsym_cmds\"" | ||
6313 | + eval test_cmds=\"$module_expsym_cmds\" | ||
6314 | cmds=$module_expsym_cmds | ||
6315 | else | ||
6316 | - eval "test_cmds=\"$module_cmds\"" | ||
6317 | + eval test_cmds=\"$module_cmds\" | ||
6318 | cmds=$module_cmds | ||
6319 | fi | ||
6320 | else | ||
6321 | if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then | ||
6322 | - eval "test_cmds=\"$archive_expsym_cmds\"" | ||
6323 | + eval test_cmds=\"$archive_expsym_cmds\" | ||
6324 | cmds=$archive_expsym_cmds | ||
6325 | else | ||
6326 | - eval "test_cmds=\"$archive_cmds\"" | ||
6327 | + eval test_cmds=\"$archive_cmds\" | ||
6328 | cmds=$archive_cmds | ||
6329 | fi | ||
6330 | fi | ||
6331 | @@ -7366,10 +8329,13 @@ EOF | ||
6332 | echo 'INPUT (' > $output | ||
6333 | for obj in $save_libobjs | ||
6334 | do | ||
6335 | - $ECHO "$obj" >> $output | ||
6336 | + func_to_tool_file "$obj" | ||
6337 | + $ECHO "$func_to_tool_file_result" >> $output | ||
6338 | done | ||
6339 | echo ')' >> $output | ||
6340 | - delfiles="$delfiles $output" | ||
6341 | + func_append delfiles " $output" | ||
6342 | + func_to_tool_file "$output" | ||
6343 | + output=$func_to_tool_file_result | ||
6344 | elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then | ||
6345 | output=${output_objdir}/${output_la}.lnk | ||
6346 | func_verbose "creating linker input file list: $output" | ||
6347 | @@ -7383,15 +8349,17 @@ EOF | ||
6348 | fi | ||
6349 | for obj | ||
6350 | do | ||
6351 | - $ECHO "$obj" >> $output | ||
6352 | + func_to_tool_file "$obj" | ||
6353 | + $ECHO "$func_to_tool_file_result" >> $output | ||
6354 | done | ||
6355 | - delfiles="$delfiles $output" | ||
6356 | - output=$firstobj\"$file_list_spec$output\" | ||
6357 | + func_append delfiles " $output" | ||
6358 | + func_to_tool_file "$output" | ||
6359 | + output=$firstobj\"$file_list_spec$func_to_tool_file_result\" | ||
6360 | else | ||
6361 | if test -n "$save_libobjs"; then | ||
6362 | func_verbose "creating reloadable object files..." | ||
6363 | output=$output_objdir/$output_la-${k}.$objext | ||
6364 | - eval "test_cmds=\"$reload_cmds\"" | ||
6365 | + eval test_cmds=\"$reload_cmds\" | ||
6366 | func_len " $test_cmds" | ||
6367 | len0=$func_len_result | ||
6368 | len=$len0 | ||
6369 | @@ -7411,12 +8379,12 @@ EOF | ||
6370 | if test "$k" -eq 1 ; then | ||
6371 | # The first file doesn't have a previous command to add. | ||
6372 | reload_objs=$objlist | ||
6373 | - eval "concat_cmds=\"$reload_cmds\"" | ||
6374 | + eval concat_cmds=\"$reload_cmds\" | ||
6375 | else | ||
6376 | # All subsequent reloadable object files will link in | ||
6377 | # the last one created. | ||
6378 | reload_objs="$objlist $last_robj" | ||
6379 | - eval "concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"" | ||
6380 | + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" | ||
6381 | fi | ||
6382 | last_robj=$output_objdir/$output_la-${k}.$objext | ||
6383 | func_arith $k + 1 | ||
6384 | @@ -7433,11 +8401,11 @@ EOF | ||
6385 | # files will link in the last one created. | ||
6386 | test -z "$concat_cmds" || concat_cmds=$concat_cmds~ | ||
6387 | reload_objs="$objlist $last_robj" | ||
6388 | - eval "concat_cmds=\"\${concat_cmds}$reload_cmds\"" | ||
6389 | + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" | ||
6390 | if test -n "$last_robj"; then | ||
6391 | - eval "concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"" | ||
6392 | + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" | ||
6393 | fi | ||
6394 | - delfiles="$delfiles $output" | ||
6395 | + func_append delfiles " $output" | ||
6396 | |||
6397 | else | ||
6398 | output= | ||
6399 | @@ -7450,9 +8418,9 @@ EOF | ||
6400 | libobjs=$output | ||
6401 | # Append the command to create the export file. | ||
6402 | test -z "$concat_cmds" || concat_cmds=$concat_cmds~ | ||
6403 | - eval "concat_cmds=\"\$concat_cmds$export_symbols_cmds\"" | ||
6404 | + eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" | ||
6405 | if test -n "$last_robj"; then | ||
6406 | - eval "concat_cmds=\"\$concat_cmds~\$RM $last_robj\"" | ||
6407 | + eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" | ||
6408 | fi | ||
6409 | fi | ||
6410 | |||
6411 | @@ -7471,7 +8439,7 @@ EOF | ||
6412 | lt_exit=$? | ||
6413 | |||
6414 | # Restore the uninstalled library and exit | ||
6415 | - if test "$mode" = relink; then | ||
6416 | + if test "$opt_mode" = relink; then | ||
6417 | ( cd "$output_objdir" && \ | ||
6418 | $RM "${realname}T" && \ | ||
6419 | $MV "${realname}U" "$realname" ) | ||
6420 | @@ -7492,7 +8460,7 @@ EOF | ||
6421 | if test -n "$export_symbols" && test -n "$include_expsyms"; then | ||
6422 | tmp_export_symbols="$export_symbols" | ||
6423 | test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" | ||
6424 | - $opt_dry_run || $ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols" | ||
6425 | + $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' | ||
6426 | fi | ||
6427 | |||
6428 | if test -n "$orig_export_symbols"; then | ||
6429 | @@ -7504,7 +8472,7 @@ EOF | ||
6430 | # global variables. join(1) would be nice here, but unfortunately | ||
6431 | # isn't a blessed tool. | ||
6432 | $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter | ||
6433 | - delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" | ||
6434 | + func_append delfiles " $export_symbols $output_objdir/$libname.filter" | ||
6435 | export_symbols=$output_objdir/$libname.def | ||
6436 | $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols | ||
6437 | fi | ||
6438 | @@ -7515,7 +8483,7 @@ EOF | ||
6439 | output=$save_output | ||
6440 | |||
6441 | if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then | ||
6442 | - eval "libobjs=\"\$libobjs $whole_archive_flag_spec\"" | ||
6443 | + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" | ||
6444 | test "X$libobjs" = "X " && libobjs= | ||
6445 | fi | ||
6446 | # Expand the library linking commands again to reset the | ||
6447 | @@ -7539,23 +8507,23 @@ EOF | ||
6448 | |||
6449 | if test -n "$delfiles"; then | ||
6450 | # Append the command to remove temporary files to $cmds. | ||
6451 | - eval "cmds=\"\$cmds~\$RM $delfiles\"" | ||
6452 | + eval cmds=\"\$cmds~\$RM $delfiles\" | ||
6453 | fi | ||
6454 | |||
6455 | # Add any objects from preloaded convenience libraries | ||
6456 | if test -n "$dlprefiles"; then | ||
6457 | gentop="$output_objdir/${outputname}x" | ||
6458 | - generated="$generated $gentop" | ||
6459 | + func_append generated " $gentop" | ||
6460 | |||
6461 | func_extract_archives $gentop $dlprefiles | ||
6462 | - libobjs="$libobjs $func_extract_archives_result" | ||
6463 | + func_append libobjs " $func_extract_archives_result" | ||
6464 | test "X$libobjs" = "X " && libobjs= | ||
6465 | fi | ||
6466 | |||
6467 | save_ifs="$IFS"; IFS='~' | ||
6468 | for cmd in $cmds; do | ||
6469 | IFS="$save_ifs" | ||
6470 | - eval "cmd=\"$cmd\"" | ||
6471 | + eval cmd=\"$cmd\" | ||
6472 | $opt_silent || { | ||
6473 | func_quote_for_expand "$cmd" | ||
6474 | eval "func_echo $func_quote_for_expand_result" | ||
6475 | @@ -7564,7 +8532,7 @@ EOF | ||
6476 | lt_exit=$? | ||
6477 | |||
6478 | # Restore the uninstalled library and exit | ||
6479 | - if test "$mode" = relink; then | ||
6480 | + if test "$opt_mode" = relink; then | ||
6481 | ( cd "$output_objdir" && \ | ||
6482 | $RM "${realname}T" && \ | ||
6483 | $MV "${realname}U" "$realname" ) | ||
6484 | @@ -7576,8 +8544,8 @@ EOF | ||
6485 | IFS="$save_ifs" | ||
6486 | |||
6487 | # Restore the uninstalled library and exit | ||
6488 | - if test "$mode" = relink; then | ||
6489 | - $opt_dry_run || (cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname) || exit $? | ||
6490 | + if test "$opt_mode" = relink; then | ||
6491 | + $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? | ||
6492 | |||
6493 | if test -n "$convenience"; then | ||
6494 | if test -z "$whole_archive_flag_spec"; then | ||
6495 | @@ -7656,17 +8624,20 @@ EOF | ||
6496 | |||
6497 | if test -n "$convenience"; then | ||
6498 | if test -n "$whole_archive_flag_spec"; then | ||
6499 | - eval "tmp_whole_archive_flags=\"$whole_archive_flag_spec\"" | ||
6500 | + eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" | ||
6501 | reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` | ||
6502 | else | ||
6503 | gentop="$output_objdir/${obj}x" | ||
6504 | - generated="$generated $gentop" | ||
6505 | + func_append generated " $gentop" | ||
6506 | |||
6507 | func_extract_archives $gentop $convenience | ||
6508 | reload_conv_objs="$reload_objs $func_extract_archives_result" | ||
6509 | fi | ||
6510 | fi | ||
6511 | |||
6512 | + # If we're not building shared, we need to use non_pic_objs | ||
6513 | + test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" | ||
6514 | + | ||
6515 | # Create the old-style object. | ||
6516 | reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test | ||
6517 | |||
6518 | @@ -7690,7 +8661,7 @@ EOF | ||
6519 | # Create an invalid libtool object if no PIC, so that we don't | ||
6520 | # accidentally link it into a program. | ||
6521 | # $show "echo timestamp > $libobj" | ||
6522 | - # $opt_dry_run || echo timestamp > $libobj || exit $? | ||
6523 | + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? | ||
6524 | exit $EXIT_SUCCESS | ||
6525 | fi | ||
6526 | |||
6527 | @@ -7740,8 +8711,8 @@ EOF | ||
6528 | if test "$tagname" = CXX ; then | ||
6529 | case ${MACOSX_DEPLOYMENT_TARGET-10.0} in | ||
6530 | 10.[0123]) | ||
6531 | - compile_command="$compile_command ${wl}-bind_at_load" | ||
6532 | - finalize_command="$finalize_command ${wl}-bind_at_load" | ||
6533 | + func_append compile_command " ${wl}-bind_at_load" | ||
6534 | + func_append finalize_command " ${wl}-bind_at_load" | ||
6535 | ;; | ||
6536 | esac | ||
6537 | fi | ||
6538 | @@ -7761,7 +8732,7 @@ EOF | ||
6539 | *) | ||
6540 | case " $compile_deplibs " in | ||
6541 | *" -L$path/$objdir "*) | ||
6542 | - new_libs="$new_libs -L$path/$objdir" ;; | ||
6543 | + func_append new_libs " -L$path/$objdir" ;; | ||
6544 | esac | ||
6545 | ;; | ||
6546 | esac | ||
6547 | @@ -7771,17 +8742,17 @@ EOF | ||
6548 | -L*) | ||
6549 | case " $new_libs " in | ||
6550 | *" $deplib "*) ;; | ||
6551 | - *) new_libs="$new_libs $deplib" ;; | ||
6552 | + *) func_append new_libs " $deplib" ;; | ||
6553 | esac | ||
6554 | ;; | ||
6555 | - *) new_libs="$new_libs $deplib" ;; | ||
6556 | + *) func_append new_libs " $deplib" ;; | ||
6557 | esac | ||
6558 | done | ||
6559 | compile_deplibs="$new_libs" | ||
6560 | |||
6561 | |||
6562 | - compile_command="$compile_command $compile_deplibs" | ||
6563 | - finalize_command="$finalize_command $finalize_deplibs" | ||
6564 | + func_append compile_command " $compile_deplibs" | ||
6565 | + func_append finalize_command " $finalize_deplibs" | ||
6566 | |||
6567 | if test -n "$rpath$xrpath"; then | ||
6568 | # If the user specified any rpath flags, then add them. | ||
6569 | @@ -7789,7 +8760,7 @@ EOF | ||
6570 | # This is the magic to use -rpath. | ||
6571 | case "$finalize_rpath " in | ||
6572 | *" $libdir "*) ;; | ||
6573 | - *) finalize_rpath="$finalize_rpath $libdir" ;; | ||
6574 | + *) func_append finalize_rpath " $libdir" ;; | ||
6575 | esac | ||
6576 | done | ||
6577 | fi | ||
6578 | @@ -7808,18 +8779,18 @@ EOF | ||
6579 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) | ||
6580 | ;; | ||
6581 | *) | ||
6582 | - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | ||
6583 | + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" | ||
6584 | ;; | ||
6585 | esac | ||
6586 | fi | ||
6587 | else | ||
6588 | - eval "flag=\"$hardcode_libdir_flag_spec\"" | ||
6589 | - rpath="$rpath $flag" | ||
6590 | + eval flag=\"$hardcode_libdir_flag_spec\" | ||
6591 | + func_append rpath " $flag" | ||
6592 | fi | ||
6593 | elif test -n "$runpath_var"; then | ||
6594 | case "$perm_rpath " in | ||
6595 | *" $libdir "*) ;; | ||
6596 | - *) perm_rpath="$perm_rpath $libdir" ;; | ||
6597 | + *) func_append perm_rpath " $libdir" ;; | ||
6598 | esac | ||
6599 | fi | ||
6600 | case $host in | ||
6601 | @@ -7828,12 +8799,12 @@ EOF | ||
6602 | case :$dllsearchpath: in | ||
6603 | *":$libdir:"*) ;; | ||
6604 | ::) dllsearchpath=$libdir;; | ||
6605 | - *) dllsearchpath="$dllsearchpath:$libdir";; | ||
6606 | + *) func_append dllsearchpath ":$libdir";; | ||
6607 | esac | ||
6608 | case :$dllsearchpath: in | ||
6609 | *":$testbindir:"*) ;; | ||
6610 | ::) dllsearchpath=$testbindir;; | ||
6611 | - *) dllsearchpath="$dllsearchpath:$testbindir";; | ||
6612 | + *) func_append dllsearchpath ":$testbindir";; | ||
6613 | esac | ||
6614 | ;; | ||
6615 | esac | ||
6616 | @@ -7842,7 +8813,7 @@ EOF | ||
6617 | if test -n "$hardcode_libdir_separator" && | ||
6618 | test -n "$hardcode_libdirs"; then | ||
6619 | libdir="$hardcode_libdirs" | ||
6620 | - eval "rpath=\" $hardcode_libdir_flag_spec\"" | ||
6621 | + eval rpath=\" $hardcode_libdir_flag_spec\" | ||
6622 | fi | ||
6623 | compile_rpath="$rpath" | ||
6624 | |||
6625 | @@ -7859,18 +8830,18 @@ EOF | ||
6626 | *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) | ||
6627 | ;; | ||
6628 | *) | ||
6629 | - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | ||
6630 | + func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" | ||
6631 | ;; | ||
6632 | esac | ||
6633 | fi | ||
6634 | else | ||
6635 | - eval "flag=\"$hardcode_libdir_flag_spec\"" | ||
6636 | - rpath="$rpath $flag" | ||
6637 | + eval flag=\"$hardcode_libdir_flag_spec\" | ||
6638 | + func_append rpath " $flag" | ||
6639 | fi | ||
6640 | elif test -n "$runpath_var"; then | ||
6641 | case "$finalize_perm_rpath " in | ||
6642 | *" $libdir "*) ;; | ||
6643 | - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; | ||
6644 | + *) func_append finalize_perm_rpath " $libdir" ;; | ||
6645 | esac | ||
6646 | fi | ||
6647 | done | ||
6648 | @@ -7878,7 +8849,7 @@ EOF | ||
6649 | if test -n "$hardcode_libdir_separator" && | ||
6650 | test -n "$hardcode_libdirs"; then | ||
6651 | libdir="$hardcode_libdirs" | ||
6652 | - eval "rpath=\" $hardcode_libdir_flag_spec\"" | ||
6653 | + eval rpath=\" $hardcode_libdir_flag_spec\" | ||
6654 | fi | ||
6655 | finalize_rpath="$rpath" | ||
6656 | |||
6657 | @@ -7921,6 +8892,12 @@ EOF | ||
6658 | exit_status=0 | ||
6659 | func_show_eval "$link_command" 'exit_status=$?' | ||
6660 | |||
6661 | + if test -n "$postlink_cmds"; then | ||
6662 | + func_to_tool_file "$output" | ||
6663 | + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` | ||
6664 | + func_execute_cmds "$postlink_cmds" 'exit $?' | ||
6665 | + fi | ||
6666 | + | ||
6667 | # Delete the generated files. | ||
6668 | if test -f "$output_objdir/${outputname}S.${objext}"; then | ||
6669 | func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' | ||
6670 | @@ -7943,7 +8920,7 @@ EOF | ||
6671 | # We should set the runpath_var. | ||
6672 | rpath= | ||
6673 | for dir in $perm_rpath; do | ||
6674 | - rpath="$rpath$dir:" | ||
6675 | + func_append rpath "$dir:" | ||
6676 | done | ||
6677 | compile_var="$runpath_var=\"$rpath\$$runpath_var\" " | ||
6678 | fi | ||
6679 | @@ -7951,7 +8928,7 @@ EOF | ||
6680 | # We should set the runpath_var. | ||
6681 | rpath= | ||
6682 | for dir in $finalize_perm_rpath; do | ||
6683 | - rpath="$rpath$dir:" | ||
6684 | + func_append rpath "$dir:" | ||
6685 | done | ||
6686 | finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " | ||
6687 | fi | ||
6688 | @@ -7966,6 +8943,13 @@ EOF | ||
6689 | $opt_dry_run || $RM $output | ||
6690 | # Link the executable and exit | ||
6691 | func_show_eval "$link_command" 'exit $?' | ||
6692 | + | ||
6693 | + if test -n "$postlink_cmds"; then | ||
6694 | + func_to_tool_file "$output" | ||
6695 | + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` | ||
6696 | + func_execute_cmds "$postlink_cmds" 'exit $?' | ||
6697 | + fi | ||
6698 | + | ||
6699 | exit $EXIT_SUCCESS | ||
6700 | fi | ||
6701 | |||
6702 | @@ -7999,6 +8983,12 @@ EOF | ||
6703 | |||
6704 | func_show_eval "$link_command" 'exit $?' | ||
6705 | |||
6706 | + if test -n "$postlink_cmds"; then | ||
6707 | + func_to_tool_file "$output_objdir/$outputname" | ||
6708 | + postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` | ||
6709 | + func_execute_cmds "$postlink_cmds" 'exit $?' | ||
6710 | + fi | ||
6711 | + | ||
6712 | # Now create the wrapper script. | ||
6713 | func_verbose "creating $output" | ||
6714 | |||
6715 | @@ -8096,7 +9086,7 @@ EOF | ||
6716 | else | ||
6717 | oldobjs="$old_deplibs $non_pic_objects" | ||
6718 | if test "$preload" = yes && test -f "$symfileobj"; then | ||
6719 | - oldobjs="$oldobjs $symfileobj" | ||
6720 | + func_append oldobjs " $symfileobj" | ||
6721 | fi | ||
6722 | fi | ||
6723 | addlibs="$old_convenience" | ||
6724 | @@ -8104,10 +9094,10 @@ EOF | ||
6725 | |||
6726 | if test -n "$addlibs"; then | ||
6727 | gentop="$output_objdir/${outputname}x" | ||
6728 | - generated="$generated $gentop" | ||
6729 | + func_append generated " $gentop" | ||
6730 | |||
6731 | func_extract_archives $gentop $addlibs | ||
6732 | - oldobjs="$oldobjs $func_extract_archives_result" | ||
6733 | + func_append oldobjs " $func_extract_archives_result" | ||
6734 | fi | ||
6735 | |||
6736 | # Do each command in the archive commands. | ||
6737 | @@ -8118,10 +9108,10 @@ EOF | ||
6738 | # Add any objects from preloaded convenience libraries | ||
6739 | if test -n "$dlprefiles"; then | ||
6740 | gentop="$output_objdir/${outputname}x" | ||
6741 | - generated="$generated $gentop" | ||
6742 | + func_append generated " $gentop" | ||
6743 | |||
6744 | func_extract_archives $gentop $dlprefiles | ||
6745 | - oldobjs="$oldobjs $func_extract_archives_result" | ||
6746 | + func_append oldobjs " $func_extract_archives_result" | ||
6747 | fi | ||
6748 | |||
6749 | # POSIX demands no paths to be encoded in archives. We have | ||
6750 | @@ -8139,7 +9129,7 @@ EOF | ||
6751 | else | ||
6752 | echo "copying selected object files to avoid basename conflicts..." | ||
6753 | gentop="$output_objdir/${outputname}x" | ||
6754 | - generated="$generated $gentop" | ||
6755 | + func_append generated " $gentop" | ||
6756 | func_mkdir_p "$gentop" | ||
6757 | save_oldobjs=$oldobjs | ||
6758 | oldobjs= | ||
6759 | @@ -8163,18 +9153,28 @@ EOF | ||
6760 | esac | ||
6761 | done | ||
6762 | func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" | ||
6763 | - oldobjs="$oldobjs $gentop/$newobj" | ||
6764 | + func_append oldobjs " $gentop/$newobj" | ||
6765 | ;; | ||
6766 | - *) oldobjs="$oldobjs $obj" ;; | ||
6767 | + *) func_append oldobjs " $obj" ;; | ||
6768 | esac | ||
6769 | done | ||
6770 | fi | ||
6771 | - eval "cmds=\"$old_archive_cmds\"" | ||
6772 | + eval cmds=\"$old_archive_cmds\" | ||
6773 | |||
6774 | func_len " $cmds" | ||
6775 | len=$func_len_result | ||
6776 | if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then | ||
6777 | cmds=$old_archive_cmds | ||
6778 | + elif test -n "$archiver_list_spec"; then | ||
6779 | + func_verbose "using command file archive linking..." | ||
6780 | + for obj in $oldobjs | ||
6781 | + do | ||
6782 | + func_to_tool_file "$obj" | ||
6783 | + $ECHO "$func_to_tool_file_result" | ||
6784 | + done > $output_objdir/$libname.libcmd | ||
6785 | + func_to_tool_file "$output_objdir/$libname.libcmd" | ||
6786 | + oldobjs=" $archiver_list_spec$func_to_tool_file_result" | ||
6787 | + cmds=$old_archive_cmds | ||
6788 | else | ||
6789 | # the command line is too long to link in one step, link in parts | ||
6790 | func_verbose "using piecewise archive linking..." | ||
6791 | @@ -8189,7 +9189,7 @@ EOF | ||
6792 | do | ||
6793 | last_oldobj=$obj | ||
6794 | done | ||
6795 | - eval "test_cmds=\"$old_archive_cmds\"" | ||
6796 | + eval test_cmds=\"$old_archive_cmds\" | ||
6797 | func_len " $test_cmds" | ||
6798 | len0=$func_len_result | ||
6799 | len=$len0 | ||
6800 | @@ -8208,7 +9208,7 @@ EOF | ||
6801 | RANLIB=$save_RANLIB | ||
6802 | fi | ||
6803 | test -z "$concat_cmds" || concat_cmds=$concat_cmds~ | ||
6804 | - eval "concat_cmds=\"\${concat_cmds}$old_archive_cmds\"" | ||
6805 | + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" | ||
6806 | objlist= | ||
6807 | len=$len0 | ||
6808 | fi | ||
6809 | @@ -8216,9 +9216,9 @@ EOF | ||
6810 | RANLIB=$save_RANLIB | ||
6811 | oldobjs=$objlist | ||
6812 | if test "X$oldobjs" = "X" ; then | ||
6813 | - eval "cmds=\"\$concat_cmds\"" | ||
6814 | + eval cmds=\"\$concat_cmds\" | ||
6815 | else | ||
6816 | - eval "cmds=\"\$concat_cmds~\$old_archive_cmds\"" | ||
6817 | + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" | ||
6818 | fi | ||
6819 | fi | ||
6820 | fi | ||
6821 | @@ -8268,12 +9268,23 @@ EOF | ||
6822 | *.la) | ||
6823 | func_basename "$deplib" | ||
6824 | name="$func_basename_result" | ||
6825 | - libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` | ||
6826 | + func_resolve_sysroot "$deplib" | ||
6827 | + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` | ||
6828 | test -z "$libdir" && \ | ||
6829 | func_fatal_error "\`$deplib' is not a valid libtool archive" | ||
6830 | - newdependency_libs="$newdependency_libs $libdir/$name" | ||
6831 | + func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" | ||
6832 | + ;; | ||
6833 | + -L*) | ||
6834 | + func_stripname -L '' "$deplib" | ||
6835 | + func_replace_sysroot "$func_stripname_result" | ||
6836 | + func_append newdependency_libs " -L$func_replace_sysroot_result" | ||
6837 | ;; | ||
6838 | - *) newdependency_libs="$newdependency_libs $deplib" ;; | ||
6839 | + -R*) | ||
6840 | + func_stripname -R '' "$deplib" | ||
6841 | + func_replace_sysroot "$func_stripname_result" | ||
6842 | + func_append newdependency_libs " -R$func_replace_sysroot_result" | ||
6843 | + ;; | ||
6844 | + *) func_append newdependency_libs " $deplib" ;; | ||
6845 | esac | ||
6846 | done | ||
6847 | dependency_libs="$newdependency_libs" | ||
6848 | @@ -8284,12 +9295,14 @@ EOF | ||
6849 | *.la) | ||
6850 | func_basename "$lib" | ||
6851 | name="$func_basename_result" | ||
6852 | - libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` | ||
6853 | + func_resolve_sysroot "$lib" | ||
6854 | + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` | ||
6855 | + | ||
6856 | test -z "$libdir" && \ | ||
6857 | func_fatal_error "\`$lib' is not a valid libtool archive" | ||
6858 | - newdlfiles="$newdlfiles $libdir/$name" | ||
6859 | + func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" | ||
6860 | ;; | ||
6861 | - *) newdlfiles="$newdlfiles $lib" ;; | ||
6862 | + *) func_append newdlfiles " $lib" ;; | ||
6863 | esac | ||
6864 | done | ||
6865 | dlfiles="$newdlfiles" | ||
6866 | @@ -8303,10 +9316,11 @@ EOF | ||
6867 | # the library: | ||
6868 | func_basename "$lib" | ||
6869 | name="$func_basename_result" | ||
6870 | - libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` | ||
6871 | + func_resolve_sysroot "$lib" | ||
6872 | + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` | ||
6873 | test -z "$libdir" && \ | ||
6874 | func_fatal_error "\`$lib' is not a valid libtool archive" | ||
6875 | - newdlprefiles="$newdlprefiles $libdir/$name" | ||
6876 | + func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" | ||
6877 | ;; | ||
6878 | esac | ||
6879 | done | ||
6880 | @@ -8318,7 +9332,7 @@ EOF | ||
6881 | [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; | ||
6882 | *) abs=`pwd`"/$lib" ;; | ||
6883 | esac | ||
6884 | - newdlfiles="$newdlfiles $abs" | ||
6885 | + func_append newdlfiles " $abs" | ||
6886 | done | ||
6887 | dlfiles="$newdlfiles" | ||
6888 | newdlprefiles= | ||
6889 | @@ -8327,7 +9341,7 @@ EOF | ||
6890 | [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; | ||
6891 | *) abs=`pwd`"/$lib" ;; | ||
6892 | esac | ||
6893 | - newdlprefiles="$newdlprefiles $abs" | ||
6894 | + func_append newdlprefiles " $abs" | ||
6895 | done | ||
6896 | dlprefiles="$newdlprefiles" | ||
6897 | fi | ||
6898 | @@ -8412,7 +9426,7 @@ relink_command=\"$relink_command\"" | ||
6899 | exit $EXIT_SUCCESS | ||
6900 | } | ||
6901 | |||
6902 | -{ test "$mode" = link || test "$mode" = relink; } && | ||
6903 | +{ test "$opt_mode" = link || test "$opt_mode" = relink; } && | ||
6904 | func_mode_link ${1+"$@"} | ||
6905 | |||
6906 | |||
6907 | @@ -8432,9 +9446,9 @@ func_mode_uninstall () | ||
6908 | for arg | ||
6909 | do | ||
6910 | case $arg in | ||
6911 | - -f) RM="$RM $arg"; rmforce=yes ;; | ||
6912 | - -*) RM="$RM $arg" ;; | ||
6913 | - *) files="$files $arg" ;; | ||
6914 | + -f) func_append RM " $arg"; rmforce=yes ;; | ||
6915 | + -*) func_append RM " $arg" ;; | ||
6916 | + *) func_append files " $arg" ;; | ||
6917 | esac | ||
6918 | done | ||
6919 | |||
6920 | @@ -8443,24 +9457,23 @@ func_mode_uninstall () | ||
6921 | |||
6922 | rmdirs= | ||
6923 | |||
6924 | - origobjdir="$objdir" | ||
6925 | for file in $files; do | ||
6926 | func_dirname "$file" "" "." | ||
6927 | dir="$func_dirname_result" | ||
6928 | if test "X$dir" = X.; then | ||
6929 | - objdir="$origobjdir" | ||
6930 | + odir="$objdir" | ||
6931 | else | ||
6932 | - objdir="$dir/$origobjdir" | ||
6933 | + odir="$dir/$objdir" | ||
6934 | fi | ||
6935 | func_basename "$file" | ||
6936 | name="$func_basename_result" | ||
6937 | - test "$mode" = uninstall && objdir="$dir" | ||
6938 | + test "$opt_mode" = uninstall && odir="$dir" | ||
6939 | |||
6940 | - # Remember objdir for removal later, being careful to avoid duplicates | ||
6941 | - if test "$mode" = clean; then | ||
6942 | + # Remember odir for removal later, being careful to avoid duplicates | ||
6943 | + if test "$opt_mode" = clean; then | ||
6944 | case " $rmdirs " in | ||
6945 | - *" $objdir "*) ;; | ||
6946 | - *) rmdirs="$rmdirs $objdir" ;; | ||
6947 | + *" $odir "*) ;; | ||
6948 | + *) func_append rmdirs " $odir" ;; | ||
6949 | esac | ||
6950 | fi | ||
6951 | |||
6952 | @@ -8486,18 +9499,17 @@ func_mode_uninstall () | ||
6953 | |||
6954 | # Delete the libtool libraries and symlinks. | ||
6955 | for n in $library_names; do | ||
6956 | - rmfiles="$rmfiles $objdir/$n" | ||
6957 | + func_append rmfiles " $odir/$n" | ||
6958 | done | ||
6959 | - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" | ||
6960 | + test -n "$old_library" && func_append rmfiles " $odir/$old_library" | ||
6961 | |||
6962 | - case "$mode" in | ||
6963 | + case "$opt_mode" in | ||
6964 | clean) | ||
6965 | - case " $library_names " in | ||
6966 | - # " " in the beginning catches empty $dlname | ||
6967 | + case " $library_names " in | ||
6968 | *" $dlname "*) ;; | ||
6969 | - *) rmfiles="$rmfiles $objdir/$dlname" ;; | ||
6970 | + *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; | ||
6971 | esac | ||
6972 | - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" | ||
6973 | + test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" | ||
6974 | ;; | ||
6975 | uninstall) | ||
6976 | if test -n "$library_names"; then | ||
6977 | @@ -8525,19 +9537,19 @@ func_mode_uninstall () | ||
6978 | # Add PIC object to the list of files to remove. | ||
6979 | if test -n "$pic_object" && | ||
6980 | test "$pic_object" != none; then | ||
6981 | - rmfiles="$rmfiles $dir/$pic_object" | ||
6982 | + func_append rmfiles " $dir/$pic_object" | ||
6983 | fi | ||
6984 | |||
6985 | # Add non-PIC object to the list of files to remove. | ||
6986 | if test -n "$non_pic_object" && | ||
6987 | test "$non_pic_object" != none; then | ||
6988 | - rmfiles="$rmfiles $dir/$non_pic_object" | ||
6989 | + func_append rmfiles " $dir/$non_pic_object" | ||
6990 | fi | ||
6991 | fi | ||
6992 | ;; | ||
6993 | |||
6994 | *) | ||
6995 | - if test "$mode" = clean ; then | ||
6996 | + if test "$opt_mode" = clean ; then | ||
6997 | noexename=$name | ||
6998 | case $file in | ||
6999 | *.exe) | ||
7000 | @@ -8547,7 +9559,7 @@ func_mode_uninstall () | ||
7001 | noexename=$func_stripname_result | ||
7002 | # $file with .exe has already been added to rmfiles, | ||
7003 | # add $file without .exe | ||
7004 | - rmfiles="$rmfiles $file" | ||
7005 | + func_append rmfiles " $file" | ||
7006 | ;; | ||
7007 | esac | ||
7008 | # Do a test to see if this is a libtool program. | ||
7009 | @@ -8556,7 +9568,7 @@ func_mode_uninstall () | ||
7010 | func_ltwrapper_scriptname "$file" | ||
7011 | relink_command= | ||
7012 | func_source $func_ltwrapper_scriptname_result | ||
7013 | - rmfiles="$rmfiles $func_ltwrapper_scriptname_result" | ||
7014 | + func_append rmfiles " $func_ltwrapper_scriptname_result" | ||
7015 | else | ||
7016 | relink_command= | ||
7017 | func_source $dir/$noexename | ||
7018 | @@ -8564,12 +9576,12 @@ func_mode_uninstall () | ||
7019 | |||
7020 | # note $name still contains .exe if it was in $file originally | ||
7021 | # as does the version of $file that was added into $rmfiles | ||
7022 | - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" | ||
7023 | + func_append rmfiles " $odir/$name $odir/${name}S.${objext}" | ||
7024 | if test "$fast_install" = yes && test -n "$relink_command"; then | ||
7025 | - rmfiles="$rmfiles $objdir/lt-$name" | ||
7026 | + func_append rmfiles " $odir/lt-$name" | ||
7027 | fi | ||
7028 | if test "X$noexename" != "X$name" ; then | ||
7029 | - rmfiles="$rmfiles $objdir/lt-${noexename}.c" | ||
7030 | + func_append rmfiles " $odir/lt-${noexename}.c" | ||
7031 | fi | ||
7032 | fi | ||
7033 | fi | ||
7034 | @@ -8577,7 +9589,6 @@ func_mode_uninstall () | ||
7035 | esac | ||
7036 | func_show_eval "$RM $rmfiles" 'exit_status=1' | ||
7037 | done | ||
7038 | - objdir="$origobjdir" | ||
7039 | |||
7040 | # Try to remove the ${objdir}s in the directories where we deleted files | ||
7041 | for dir in $rmdirs; do | ||
7042 | @@ -8589,16 +9600,16 @@ func_mode_uninstall () | ||
7043 | exit $exit_status | ||
7044 | } | ||
7045 | |||
7046 | -{ test "$mode" = uninstall || test "$mode" = clean; } && | ||
7047 | +{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && | ||
7048 | func_mode_uninstall ${1+"$@"} | ||
7049 | |||
7050 | -test -z "$mode" && { | ||
7051 | +test -z "$opt_mode" && { | ||
7052 | help="$generic_help" | ||
7053 | func_fatal_help "you must specify a MODE" | ||
7054 | } | ||
7055 | |||
7056 | test -z "$exec_cmd" && \ | ||
7057 | - func_fatal_help "invalid operation mode \`$mode'" | ||
7058 | + func_fatal_help "invalid operation mode \`$opt_mode'" | ||
7059 | |||
7060 | if test -n "$exec_cmd"; then | ||
7061 | eval exec "$exec_cmd" | ||
7062 | diff --git a/ltoptions.m4 b/ltoptions.m4 | ||
7063 | index 5ef12ced2a..17cfd51c0b 100644 | ||
7064 | --- a/ltoptions.m4 | ||
7065 | +++ b/ltoptions.m4 | ||
7066 | @@ -8,7 +8,7 @@ | ||
7067 | # unlimited permission to copy and/or distribute it, with or without | ||
7068 | # modifications, as long as this notice is preserved. | ||
7069 | |||
7070 | -# serial 6 ltoptions.m4 | ||
7071 | +# serial 7 ltoptions.m4 | ||
7072 | |||
7073 | # This is to help aclocal find these macros, as it can't see m4_define. | ||
7074 | AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) | ||
7075 | diff --git a/ltversion.m4 b/ltversion.m4 | ||
7076 | index bf87f77132..9c7b5d4118 100644 | ||
7077 | --- a/ltversion.m4 | ||
7078 | +++ b/ltversion.m4 | ||
7079 | @@ -7,17 +7,17 @@ | ||
7080 | # unlimited permission to copy and/or distribute it, with or without | ||
7081 | # modifications, as long as this notice is preserved. | ||
7082 | |||
7083 | -# Generated from ltversion.in. | ||
7084 | +# @configure_input@ | ||
7085 | |||
7086 | -# serial 3134 ltversion.m4 | ||
7087 | +# serial 3293 ltversion.m4 | ||
7088 | # This file is part of GNU Libtool | ||
7089 | |||
7090 | -m4_define([LT_PACKAGE_VERSION], [2.2.7a]) | ||
7091 | -m4_define([LT_PACKAGE_REVISION], [1.3134]) | ||
7092 | +m4_define([LT_PACKAGE_VERSION], [2.4]) | ||
7093 | +m4_define([LT_PACKAGE_REVISION], [1.3293]) | ||
7094 | |||
7095 | AC_DEFUN([LTVERSION_VERSION], | ||
7096 | -[macro_version='2.2.7a' | ||
7097 | -macro_revision='1.3134' | ||
7098 | +[macro_version='2.4' | ||
7099 | +macro_revision='1.3293' | ||
7100 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) | ||
7101 | _LT_DECL(, macro_revision, 0) | ||
7102 | ]) | ||
7103 | diff --git a/lt~obsolete.m4 b/lt~obsolete.m4 | ||
7104 | index bf92b5e079..c573da90c5 100644 | ||
7105 | --- a/lt~obsolete.m4 | ||
7106 | +++ b/lt~obsolete.m4 | ||
7107 | @@ -7,7 +7,7 @@ | ||
7108 | # unlimited permission to copy and/or distribute it, with or without | ||
7109 | # modifications, as long as this notice is preserved. | ||
7110 | |||
7111 | -# serial 4 lt~obsolete.m4 | ||
7112 | +# serial 5 lt~obsolete.m4 | ||
7113 | |||
7114 | # These exist entirely to fool aclocal when bootstrapping libtool. | ||
7115 | # | ||