· 9 years ago · Apr 01, 2017, 04:12 PM
1#! /bin/sh
2
3# libtool - Provide generalized library-building support services.
4# Generated automatically by config.status (pangox-compat) 0.0.2
5# Libtool was configured on host black:
6# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7#
8# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
9# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
10# Foundation, Inc.
11# Written by Gordon Matzigkeit, 1996
12#
13# This file is part of GNU Libtool.
14#
15# GNU Libtool is free software; you can redistribute it and/or
16# modify it under the terms of the GNU General Public License as
17# published by the Free Software Foundation; either version 2 of
18# the License, or (at your option) any later version.
19#
20# As a special exception to the GNU General Public License,
21# if you distribute this file as part of a program or library that
22# is built using GNU Libtool, you may include this file under the
23# same distribution terms that you use for the rest of that program.
24#
25# GNU Libtool is distributed in the hope that it will be useful,
26# but WITHOUT ANY WARRANTY; without even the implied warranty of
27# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28# GNU General Public License for more details.
29#
30# You should have received a copy of the GNU General Public License
31# along with GNU Libtool; see the file COPYING. If not, a copy
32# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
33# obtained by writing to the Free Software Foundation, Inc.,
34# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
35
36
37# The names of the tagged configurations supported by this script.
38available_tags=""
39
40# ### BEGIN LIBTOOL CONFIG
41
42# Which release of libtool.m4 was used?
43macro_version=2.4.2
44macro_revision=1.3337
45
46# Whether or not to build shared libraries.
47build_libtool_libs=yes
48
49# Whether or not to build static libraries.
50build_old_libs=yes
51
52# What type of objects to build.
53pic_mode=default
54
55# Whether or not to optimize for fast installation.
56fast_install=yes
57
58# Shell to use when invoking shell scripts.
59SHELL="/bin/sh"
60
61# An echo program that protects backslashes.
62ECHO="printf %s\\n"
63
64# The PATH separator for the build system.
65PATH_SEPARATOR=":"
66
67# The host system.
68host_alias=
69host=x86_64-unknown-linux-gnu
70host_os=linux-gnu
71
72# The build system.
73build_alias=
74build=x86_64-unknown-linux-gnu
75build_os=linux-gnu
76
77# A sed program that does not truncate output.
78SED="/bin/sed"
79
80# Sed that helps us avoid accidentally triggering echo(1) options like -n.
81Xsed="$SED -e 1s/^X//"
82
83# A grep program that handles long lines.
84GREP="/usr/bin/grep"
85
86# An ERE matcher.
87EGREP="/usr/bin/grep -E"
88
89# A literal string matcher.
90FGREP="/usr/bin/grep -F"
91
92# A BSD- or MS-compatible name lister.
93NM="/usr/bin/nm -B"
94
95# Whether we need soft or hard links.
96LN_S="ln -s"
97
98# What is the maximum length of a command?
99max_cmd_len=1572864
100
101# Object file suffix (normally "o").
102objext=o
103
104# Executable file suffix (normally "").
105exeext=
106
107# whether the shell understands "unset".
108lt_unset=unset
109
110# turn spaces into newlines.
111SP2NL="tr \\040 \\012"
112
113# turn newlines into spaces.
114NL2SP="tr \\015\\012 \\040\\040"
115
116# convert $build file names to $host format.
117to_host_file_cmd=func_convert_file_noop
118
119# convert $build files to toolchain format.
120to_tool_file_cmd=func_convert_file_noop
121
122# An object symbol dumper.
123OBJDUMP="objdump"
124
125# Method to check whether dependent libraries are shared objects.
126deplibs_check_method="pass_all"
127
128# Command to use when deplibs_check_method = "file_magic".
129file_magic_cmd="\$MAGIC_CMD"
130
131# How to find potential files when deplibs_check_method = "file_magic".
132file_magic_glob=""
133
134# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
135want_nocaseglob="no"
136
137# DLL creation program.
138DLLTOOL="false"
139
140# Command to associate shared and link libraries.
141sharedlib_from_linklib_cmd="printf %s\\n"
142
143# The archiver.
144AR="ar"
145
146# Flags to create an archive.
147AR_FLAGS="cru"
148
149# How to feed a file listing to the archiver.
150archiver_list_spec="@"
151
152# A symbol stripping program.
153STRIP="strip"
154
155# Commands used to install an old-style archive.
156RANLIB="ranlib"
157old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$tool_oldlib"
158old_postuninstall_cmds=""
159
160# Whether to use a lock for old archive extraction.
161lock_old_archive_extraction=no
162
163# A C compiler.
164LTCC="gcc"
165
166# LTCC compiler flags.
167LTCFLAGS="-O2 -march=native -pipe"
168
169# Take the output of nm and produce a listing of raw symbols and C names.
170global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p' | sed '/ __gnu_lto/d'"
171
172# Transform the output of nm in a proper C declaration.
173global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'"
174
175# Transform the output of nm in a C name address pair.
176global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'"
177
178# Transform the output of nm in a C name address pair when lib prefix is needed.
179global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\)[ ]*\$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'"
180
181# Specify filename containing input files for $NM.
182nm_file_list_spec="@"
183
184# The root where to search for dependent libraries,and in which our libraries should be installed.
185lt_sysroot=
186
187# The name of the directory that contains temporary libtool files.
188objdir=.libs
189
190# Used to examine libraries when file_magic_cmd begins with "file".
191MAGIC_CMD=file
192
193# Must we lock files when doing compilation?
194need_locks="no"
195
196# Manifest tool.
197MANIFEST_TOOL=":"
198
199# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
200DSYMUTIL=""
201
202# Tool to change global to local symbols on Mac OS X.
203NMEDIT=""
204
205# Tool to manipulate fat objects and archives on Mac OS X.
206LIPO=""
207
208# ldd/readelf like tool for Mach-O binaries on Mac OS X.
209OTOOL=""
210
211# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
212OTOOL64=""
213
214# Old archive suffix (normally "a").
215libext=a
216
217# Shared library suffix (normally ".so").
218shrext_cmds=".so"
219
220# The commands to extract the exported symbol list from a shared archive.
221extract_expsyms_cmds=""
222
223# Variables whose values should be saved in libtool wrapper scripts and
224# restored at link time.
225variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
226
227# Do we need the "lib" prefix for modules?
228need_lib_prefix=no
229
230# Do we need a version for libraries?
231need_version=no
232
233# Library versioning type.
234version_type=linux
235
236# Shared library runtime path variable.
237runpath_var=LD_RUN_PATH
238
239# Shared library path variable.
240shlibpath_var=LD_LIBRARY_PATH
241
242# Is shlibpath searched before the hard-coded library search path?
243shlibpath_overrides_runpath=no
244
245# Format of library name prefix.
246libname_spec="lib\$name"
247
248# List of archive names. First name is the real one, the rest are links.
249# The last name is the one that the linker finds with -lNAME
250library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
251
252# The coded name of the library, if different from the real name.
253soname_spec="\${libname}\${release}\${shared_ext}\$major"
254
255# Permission mode override for installation of shared libraries.
256install_override_mode=""
257
258# Command to use after installation of a shared archive.
259postinstall_cmds=""
260
261# Command to use after uninstallation of a shared archive.
262postuninstall_cmds=""
263
264# Commands used to finish a libtool library installation in a directory.
265finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
266
267# As "finish_cmds", except a single script fragment to be evaled but
268# not shown.
269finish_eval=""
270
271# Whether we should hardcode library paths into libraries.
272hardcode_into_libs=yes
273
274# Compile-time system search path for libraries.
275sys_lib_search_path_spec="/usr/lib/gcc/x86_64-unknown-linux-gnu/5.4.0 /usr/lib /lib "
276
277# Run-time system search path for libraries.
278sys_lib_dlsearch_path_spec="/lib /usr/lib /lib32 /usr/lib32 /usr/lib/i386-linux-gnu/amdgpu-pro /usr/lib/i386-linux-gnu/amdgpu-pro/gbm /usr/lib/x86_64-linux-gnu/amdgpu-pro /usr/lib/x86_64-linux-gnu/amdgpu-pro/gbm ELF>@%@ d@8@„\\\\„\\\\ \\\`\\\` \\\` ¸è (\\\`(\\\` (\\\` ððPÃ¥tdlHlHlH\$\$QÃ¥tdƒÂkÂs~M‡pˆ;‹INYzWu hvf_VSL lÂ…JU\\\`†7E\\\\)56m‰C?ej<t„Š2Pg€|ÂŒ(ƒnq]}oZ‚wx1y@{[X-
279\$&! 4.> ñÿ† ¦9† 2%p<˜ð8¼09\\\`A&ä ñÿ¦7 ¨ U ç C&§à 46p0 ØP9Æ@5ê +'ú ñÿR 66 ç°/_ =€P ú ° ui » ui Ë ui b à + b @ 8b @)Pb €*\\\`b Ãc xb @*ˆb Âb *¨b *°b )¸b \\\`)Àb ÂCØb \\\`*°c °c (b 0b @b Hb *Xb /hb Bpb L€b S˜b j b oÈb xÃb |à b ďb „c c c c (c 0c 8c ? héÃÿÿÿÿ%? héÀÿÿÿÿ%ú> hé°ÿÿÿÿ%ò> hé ÿÿÿÿ%ê> héÂÿÿÿÿ%â> hé€ÿÿÿÿ%Ú> hépÿÿÿÿ%Ã’> hé\\\`ÿÿÿÿ%Ê> h éPÿÿÿÿ%Â> h é@ÿÿÿÿ%º> hé0ÿÿÿÿ%²> hé ÿÿÿÿ%ª> h
280éÿÿÿÿ%¢> héÿÿÿÿ%š> héðþÿÿÿ%Â’> héà þÿÿÿ%Š> héÃþÿÿÿ%‚> héÀþÿÿÿ%z> hé°þÿÿÿ%r> hé þÿÿHÂx> H UH)øH‰åHƒøw]ÃH‹Ì< H…Àtò]ÿà @HÂA> H > UH)øH‰åHÃøH‰ÂHÃê?HÃHÑøu]ÃH‹/ HÂ…Ã’tò]H‰Æÿâ@€ > urUHƒ= H‰åATStH‹=ß èZÿÿÿHÂ; LÂ% H‹à L)ãHÃûHđH9Øs DHƒÀH‰½ AÿÄH‹² H9Øråè ÿÿÿ[A\\\\]ƕ Ã@Hƒ t&H‹_< H…ÀtUH H‰åÿÃ]éÿÿÿ€éÿÿÿf.„ÂSH‹è; ‹…Àt[Ãè+‰[ÀAWAVAUATUSH‰ûHēHH…ÿÇD\$ tLèÃH…ÀH‰Åt?HÂ5dH‰ÇèÆH…ÀI‰Ät H ÿÃ…ÀtH‰ïè¦HĀH[]A\\\\A]A^A_ÀD‹|\$ D‰úHÃâH‰×H‰T\$è§ýÿÿH…ÀI‰ÆtÃH‹T\$1öH䂏 ýÿÿ1Ã’L‰öD‰ÿAÿՅÀu£‹T\$ Â…Ã’t›HÂD\$0E1ÃH‰D\$ëf.„‹T\$ AāA9ՃqÿÿÿD‰èMÂ<ÆI‹?H…ÿtäH‹1É1Ã’L‹D\$¾ ÿP…ÀuÈH‹T\$0H‰×H‰T\$èýÿÿH…ÀI‰ÂH‹T\$t©I‹?E1ÀL‰ÑL‰T\$¾ H‹ÿP…ÀL‹T\$…³¿(L‰T\$èÔüÿÿH…ÀL‹T\$„–HÇHÇ@H‰ßHÇ@HÇ@HÇ@ L‰T\$H‰D\$è ë*fÂHĂtH‹H…ÀtH ÿà €M…ÉtAÇÞÿÿÿ1ÀÃf„H…ÿtH‹H‹€(ÿà €H…ÉtÇÞÿÿÿ1ÀÃf.„H…ÿtH‹H‹€à ÿà €HÂ…Ã’tÇÞÿÿÿ1ÀÃf.„H…ÿtH‹H‹€¸ÿà €M…ÉtAÇÞÿÿÿ1ÀÃf„H…ÿtH‹H‹€Ãÿà €H…ÉtÇÞÿÿÿ1ÀÃf.„ATI‰ÔU‰ýSH‰óèïùÿÿH…ە…Ä£H…Û„ªM…ätAÇ\$Â…Ãt1À„Òt‰ƒÀ9Ã…HÇÓwïH‹˜5 H‹@H…Àt|M…ätOf.„H…ÛtÂ…ÃtH‹PƒÃHƒÃH‰SøAƒ\$H‹@ H…ÀuÚ1À[]A\\\\ÃH‹PƒÃHƒÃH‰SøH‹@ H…Àtá…ÃtóH…ÛtîfÂëۄ҄Uÿÿÿ¸âÿÿÿÂëÆM…ä…Mÿÿÿëøüÿÿë´fff.„AVM‰ÆAUI‰ÃATI‰ÔU‰õSH‰ûèõøÿÿH…Ût H‹H‰ß‰î[]L‰âL‰éM‰ðA\\\\A]A^H‹@ÿà Â[]A\\\\A]¸à ÿÿÿA^ÃfÂAVM‰ÆAUI‰ÃATA‰ÔUH‰õSH‰ûè¤øÿÿH…Ût'H‹H‰ßH‰î[]D‰âL‰éM‰ðA\\\\A]A^H‹@ÿà €[]A\\\\A]¸à ÿÿÿA^Ãf.„H…ÿtH‹H‹@ÿà f¸ßÿÿÿÃf.„H…ÿtH‹H‹€èÿà €¸ßÿÿÿÃfÂH…ÿtH‹H‹€ðÿà €¸ßÿÿÿÃfÂH…ÿtH‹H‹€øÿà €¸ßÿÿÿÃfÂAWM‰ÇAVI‰ÎAUI‰ýATI‰ÔU‰õSL‰ËHƒìè¼÷ÿÿ…Ãt8M…ät3I‹\$H…ÀtJH‹I‰Ù‰îL‰âL‰ïL‰ñM‰øH‹@ HĀ[]A\\\\A]A^A_ÿà fÂH…ÛtÇâÿÿÿHĀ1À[]A\\\\A]A^A_Ã@H…ÛtæÇßÿÿÿëÞAVI‰ÎAUI‰ÕATI‰ôUL‰ÅSH‰ûHēHÇ\$è(÷ÿÿH‰æH䧏ÂùÿÿH‹\$H…Àt\$H‹I‰èL‰ñL‰êL‰æH‰ßÿP(HĀ[]A\\\\A]A^ÃfÂHÂ…ÃtÇEà ÿÿÿHĀ[]A\\\\A]A^À1ÀëÃfff.„H…ÿtH‹H‹@0ÿà f¸ÞÿÿÿÃf.„H…ÿtH‹H‹@8ÿà f¸ÞÿÿÿÃf.„H…ÿtH‹H‹@@ÿà f¸ÞÿÿÿÃf.„H…ÿtH‹H‹@Hÿà fÂH…ÉtÇÞÿÿÿ1ÀÃfÂH…ÿtH‹H‹@Pÿà f¸ÜÿÿÿÃf.„H…ÿtH‹H‹@Xÿà f¸ÜÿÿÿÃf.„H…ÿtH‹H‹@\\\`ÿà f¸ÜÿÿÿÃf.„H…ÿtH‹H‹@pÿà fÂM…ÀtAÇÞÿÿÿ1ÀÃÂH…ÿtH‹H‹€ÿà €M…ÉtAÇÞÿÿÿ1ÀÃf„H…ÿtH‹H‹€ˆÿà €¸ÚÿÿÿÃfÂH…ÿtH‹H‹€Âÿà €¸ÚÿÿÿÃfÂH…ÿtH‹H‹€˜ÿà €¸ÞÿÿÿÃfÂH…ÿtH‹H‹€ ÿà €¸ÚÿÿÿÃfÂH…ÿtH‹H‹€¨ÿà €¸ÚÿÿÿÃfÂH…ÿtH‹H‹€°ÿà €M…ÀtAÇÞÿÿÿ1ÀÃf„H…ÿtH‹H‹€¸ÿà €¸×ÿÿÿÃfÂH…ÿtH‹H‹€Àÿà €¸×ÿÿÿÃfÂH…ÿtH‹H‹€Èÿà €¸×ÿÿÿÃfÂH…ÿtH‹H‹€Ãÿà €M…ÀtAÇÞÿÿÿ1ÀÃf„H…ÿH‹D\$tL‹H‰D\$I‹‚Øÿà DH…ÀtÇÞÿÿÿ1ÀÃfÂH…ÿtH‹H‹€ÿà €M…ÀtAÇÞÿÿÿ1ÀÃf„H…ÿtH‹H‹€à ÿà €¸ÔÿÿÿÃfÂH…ÿtH‹H‹€èÿà €¸ÔÿÿÿÃfÂH…ÿtH‹H‹€ðÿà €¸ÔÿÿÿÃfÂH…ÿtH‹H‹€ÿà €¸ÔÿÿÿÃfÂH…ÿL‹T\$L‹\\\$H‹D\$tH‰D\$H‹L‰\\\$L‰T\$H‹€ÿà ÂH…ÀtÇÞÿÿÿ1ÀÃfÂSH‰ûèóÿÿH…ÛtH‹H‰ß[H‹€ ÿà f¸à ÿÿÿ[Ãf„H…ÿtH‹H‹€ÿà €¸ÔÿÿÿÃfÂH…ÿtH‹H‹€ÿà €¸ÔÿÿÿÃfÂH…ÿtH‹H‹€ÿà €HÂ…Ã’tÇÔÿÿÿ1ÀÃf.„H…ÿtH‹H‹€ÿà €¸ÔÿÿÿÃfÂH…ÿtH‹H‹€ ÿà €¸ÃÿÿÿÃfÂH…ÿtH‹H‹€(ÿà €¸ÃÿÿÿÃfÂH…ÿtH‹H‹€0ÿà €¸ÃÿÿÿÃfÂH…ÿtH‹H‹€8ÿà €¸ÃÿÿÿÃfÂH…ÿtH‹H‹€(ÿà €¸ÃÿÿÿÃfÂH…ÿtH‹H‹€@ÿà €¸ÃÿÿÿÃfÂ…ÿtH…ötH‹H…ÀtH‹H‹€Hÿà ¸âÿÿÿÃf.„¸ÆÿÿÿÃf.„H…ÿtH‹H‹€Pÿà €¸ÆÿÿÿÃfÂH…ÿtH‹H‹€Xÿà €¸ÆÿÿÿÃfÂH…ÿtH‹H‹€\\\`ÿà €¸ÆÿÿÿÃfÂH…ÿtH‹H‹€hÿà €¸ÆÿÿÿÃfÂH…ÿtH‹H‹€pÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€xÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€€ÿà €¸ÜÿÿÿÃfÂAVH…ÿAUATUSt[]A\\\\H‹A]A^H‹€°ÿà €[]A\\\\A]¸ÜÿÿÿA^Ãf.„H…ÿtH‹H‹€ˆÿà €¸ÜÿÿÿÃfÂAVH…ÿAUATUSt[]A\\\\H‹A]A^H‹€¸ÿà €[]A\\\\A]¸ÜÿÿÿA^Ãf.„H…ÿtH‹H‹€0ÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€Âÿà €¸ÜÿÿÿÃfÂAUH…ÿATUSt[]H‹A\\\\A]H‹€Àÿà []A\\\\¸ÜÿÿÿA]Ã@UH…ÿStH‹[]H‹€˜ÿà [¸Üÿÿÿ]ÃUH…ÿStH‹[]H‹€ ÿà [¸Üÿÿÿ]ÃH…ÿtL‹I‹ƒ8ÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€¨ÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€°ÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€¸ÿà €¸ÜÿÿÿÃfÂH…ÿSD‹T\$L‹\\\$H‹\\\$ H‹D\$(t&H‰D\$(H‹H‰\\\$ L‰\\\$D‰T\$[H‹€Àÿà DH…ÀtÇÜÿÿÿ1À[ÃÂATH…ÿUSL‹T\$ L‹\\\$(‹\\\$0H‹l\$8L‹d\$@H‹D\$Ht2H‰D\$HL‰d\$@H‰l\$8‰\\\$0L‰\\\$(L‰T\$ H‹[]A\\\\H‹€Èÿà DH…ÀtÇÜÿÿÿ[]1ÀA\\\\ÃfDH…ÿtH‹H‹€Ãÿà €¸ÜÿÿÿÃfÂH…ÿtL‹I‹‚@ÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€Øÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€à ÿà €¸ÜÿÿÿÃfÂH…ÿStH‹[H‹€èÿà D¸Üÿÿÿ[ÃÂH…ÿtH‹H‹€Hÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€Pÿà €¸ÜÿÿÿÃfÂUH‰ýSH‰óHƒìèïìÿÿHÂ=Ó¹H‰Þ󦄨HÂ=ѹH‰Þ󦄱HÂ=ùH‰Þó¦„ÊHÂ=ѹH‰Þ󦄣HÂ=Ò¹H‰Þ󦄬HÂ=Ö¹H‰Þ󦄵HÂ=ѹH‰Þ󦄎HÂ=ùH‰Þ󦄗HÂ=ùH‰Þ󦄉HÂ=Ó¹H‰Þó¦„{HÂ=Ò¹H‰Þó¦„pHÂ=Ö¹H‰Þó¦„eHÂ=Õ¹H‰Þó¦„ZHÂ=ùH‰Þó¦„OH H‹ñ []A\\\\A]A^Ã[]A\\\\A]H‹S A^ÃH‹¡ ëހ[]A\\\\A]H‹; A^ÃH‹Y 뾀H‹1 뮀H‹ñ! 란H‹¡ ëŽH‹0 ë…H‹÷! éyÿÿÿH‹³! émÿÿÿH‹? éaÿÿÿH‹»! éUÿÿÿH‹/ éIÿÿÿH‹ó! é é1ÿÿÿH‹ã! é%ÿÿÿH‹g! éÿÿÿH‰ßI‹D\$[]A\\\\A]A^ÿà H‹ éûþÿÿH‹•! éïþÿÿ„H…ÿtH‹H‹€ˆÿà €¸ÆÿÿÿÃfÂH…ÿtH‹H‹€Âÿà €M…ÀtAÇÚÿÿÿ1ÀÃf„H…ÿtH‹H‹€˜ÿà €¸ÚÿÿÿÃfÂH…ÿtH‹H‹€ ÿà €H…ötÇÞÿÿÿ1ÀÃf.„H…ÿtH‹H‹€¨ÿà €¸ÆÿÿÿÃfÂH…ÿtH‹H‹€Øÿà €H…ÉtÇÞÿÿÿ1ÀÃf.„H…ÿtH‹H‹€à ÿà €M…ÉtAÇÞÿÿÿ1ÀÃf„H…ÿtH‹H‹€èÿà €¸ÚÿÿÿÃfÂH…ÿtH‹H‹€ðÿà €1ÀÃDH…ÿuóÃf„H…ötðH‹H‹€øÿà ffffff.„H…ÿtL‹I‹ƒÿà €¸ÜÿÿÿÃfÂH…ÿtL‹I‹ƒÿà €¸ÜÿÿÿÃfÂH…ÿtL‹I‹ƒÿà €¸ÜÿÿÿÃfÂH…ÿtL‹I‹ƒÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€ ÿà €¸ÜÿÿÿÃfÂH…ÿtH‹H‹€(ÿà €HÂ…Ã’tÇÞÿÿÿ1ÀÃf.„H…ÿtH‹H‹€0ÿà €¸ÃÿÿÿÃfÂH…ÿtH‹H‹€8ÿà €¸ÃÿÿÿÃfÂAWH w>L‰à HÓà ©t1MÂ}L‰ÿèEà ÿÿHƒøI‰ÆvIÂtH t%L‰ÿèYáÿÿL‰÷èÃÞÿÿL‰ÿè¹ÞÿÿL‰ïèáÞÿÿéÜþÿÿÆëÖL‰÷@è›ÞÿÿéÆþÿÿL‰÷èŽÞÿÿL‰ïè¶Þÿÿé±þÿÿ¾é6ßÿÿfDé‹ßÿÿff.„éKßÿÿff.„HēH‹5 H ôèÿÿ\$ éÿÿ< DéÿÿT déÿÿl „éÿÿ„ ¤éÿÿœ Ôéÿÿ´ êÿÿÌ 4êÿÿä Têÿÿü têÿÿ”êÿÿ ´êÿÿDôêÿÿ\\\\\$ëÿÿ|Dëÿÿ”dëÿÿ¬”ëÿÿÄ´ëÿÿÜÔëÿÿôôëÿÿìÿÿ\$4ìÿÿ<TìÿÿTtìÿÿl´ìÿÿ„Ôìÿÿœôìÿÿ´ÃÿÿÌ4ÃÿÿäTÃÿÿütÃÿÿ
281”Ãÿÿ
282ÔÃÿÿ|
283ôÃÿÿ”
2844îÿÿä
285Tîÿÿü
286tîÿÿ¤îÿÿTÄîÿÿ„äîÿÿ´ïÿÿÌ\$ïÿÿäDïÿÿüdïÿÿ´ïÿÿ4\$ðÿÿlDðÿÿ„dðÿÿœ„ðÿÿ´¤ðÿÿÌÄðÿÿìäðÿÿñÿÿôÿÿt\$ôÿÿŒdôÿÿ¤´ôÿÿÄÄôÿÿÜäôÿÿôõÿÿ\$õÿÿ\$„øÿÿœ¤øÿÿ´ÔøÿÿÌôøÿÿä\$ùÿÿüDùÿÿtùÿÿ ¤ùÿÿDÄùÿÿ\\\\äùÿÿtúÿÿŒ4úÿÿ¤Túÿÿ¼túÿÿԔúÿÿì´úÿÿäúÿÿûÿÿ4\$ûÿÿLýÿÿ´\$ýÿÿÌ4ýÿÿäDýÿÿüzRxÂ\$0×ÿÿ\\\`FJw€?;*3\$D˜ÙÿÿAƒN AHLd˜ÙÿÿEBÂBÂŽB ÂB(ÂŒA0†A8ƒG€] 8A0A(B BBBH´˜Ûÿÿ ÌÀÛÿÿäÈÛÿÿüÃÛÿÿØÛÿÿ à ÛÿÿDèÛÿÿ\\\\ðÛÿÿtøÛÿÿŒÜÿÿ¤Üÿÿ¼ÜÿÿDÔÜÿÿgBÂŽEÂE ÂŒD(†C0ƒG@| 0A(A BBBB@Üÿÿ&4XÜÿÿ'LpÜÿÿ'dˆÜÿÿ'| Üÿÿ&”¸Üÿÿ&¬ÃÜÿÿ'ÄèÜÿÿ& ÜÃÿÿäBÂŒD†C ƒ ABALÀÃÿÿNBÂŽEÂE ÂŒD(†C0ƒV (A KBBGA(A BBGL\\\\ÀÃÿÿVBÂŽEÂE ÂŒD(†D0ƒW (A KBBMA(A BBG¬ÃÃÿÿÄØÃÿÿÜà ÃÿÿôèÃÿÿdðÃÿÿÂBÂEÂŽE ÂE(ÂŒD0†C8ƒG@s 8A0A(B BBBDO 8C0A(B BBBETtÞÿÿ„BÂŽEÂE ÂŒD(†D0ƒG@z 0A(A BBBCP 0A(A BBBHÃŒPÞÿÿäXÞÿÿü\\\`ÞÿÿhÞÿÿ pÞÿÿDxÞÿÿ\\\\€ÞÿÿtˆÞÿÿŒÂÞÿÿ'¤¨Þÿÿ¼°ÞÿÿÔ¸ÞÿÿìÀÞÿÿÈÞÿÿÃÞÿÿ'4èÞÿÿLðÞÿÿdøÞÿÿ|ßÿÿ'”ßÿÿ.¬0ßÿÿ'ÄHßÿÿÜPßÿÿôXßÿÿ\\\`ßÿÿ\$hßÿÿ><Âßÿÿ'AƒT KF\\\\ ßÿÿt¨ßÿÿŒ°ßÿÿ&¤Èßÿÿ¼ÃßÿÿÔØßÿÿìà ßÿÿèßÿÿðßÿÿ4øßÿÿLà ÿÿ6d(à ÿÿ|0à ÿÿ”8à ÿÿ¬@à ÿÿÄHà ÿÿÜPà ÿÿôXà ÿÿL \\\`à ÿÿ6BÂŽEÂB ÂŒA(†A0ƒC (A BEBPA(A BBG\\\\ Pà ÿÿLt Xà ÿÿ6BÂŽEÂB ÂŒA(†A0ƒC (A BEBPA(A BBGÄ Hà ÿÿÜ Pà ÿÿ<ô Xà ÿÿ BÂEÂŒA †A(ƒC AEBLA ABG 4 Hà ÿÿ A†DƒF ALAF d 8à ÿÿ A†DƒF ALAF” (à ÿÿ¬ 0à ÿÿÄ 8à ÿÿÜ @à ÿÿô Hà ÿÿODƒn NN4xà ÿÿjBÂŒD†A ƒ@ ABNLADL°à ÿÿd¸à ÿÿ|Àà ÿÿ”Èà ÿÿ¬Ãà ÿÿDƒF NFÃŒÃà ÿÿäØà ÿÿTüà à ÿÿA†DƒG ï AACK AAC[ AACÀ AABTˆãÿÿlÂãÿÿ6„¸ãÿÿODƒn NN¤èãÿÿ¼à ãÿÿÔèãÿÿìðãÿÿt
287øãÿÿXBÂŽBÂB ÂŒA(†A0ƒ@ (A BBBAA (A BBIAQ (A BBIA· (A BBBB|
288à æÿÿ”
289èæÿÿ'¬
290çÿÿÄ
291çÿÿ&Ü
292 çÿÿô
293(çÿÿ&@çÿÿ'\$Xçÿÿ<\\\`çÿÿThçÿÿ!l€çÿÿ„ˆçÿÿœÂçÿÿ´˜çÿÿÌ çÿÿä¨çÿÿ&üÀçÿÿÈçÿÿd ÃçÿÿïBÂIÂŽB ÂB(ÂŒA0†A8ƒDPŸ 8D0A(B BBBOD 8A0A(B BBBB”Xéÿÿ ¬PéÿÿÄHéÿÿÜ@éÿÿ!D\\\\ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ› ¦ ° » Ë Õ ° ðb ø¸! üÿÿoýÿÿoþÿÿo¸ÿÿÿoðÿÿoôùÿÿoà +@ @)€*Ãc @* ** )\\\`)ÂC\\\`*(\\\` ö !ÿÿÿoôô.ýÿÿo¤ \\\`° "
294
295# Whether dlopen is supported.
296dlopen_support=unknown
297
298# Whether dlopen of programs is supported.
299dlopen_self=unknown
300
301# Whether dlopen of statically linked programs is supported.
302dlopen_self_static=unknown
303
304# Commands to strip libraries.
305old_striplib="strip --strip-debug"
306striplib="strip --strip-unneeded"
307
308
309# The linker used to build libraries.
310LD="/usr/bin/ld -m elf_x86_64"
311
312# How to create reloadable object files.
313reload_flag=" -r"
314reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
315
316# Commands used to build an old-style archive.
317old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$tool_oldlib"
318
319# A language specific compiler.
320CC="gcc"
321
322# Is the compiler the GNU compiler?
323with_gcc=yes
324
325# Compiler flag to turn off builtin functions.
326no_builtin_flag=" -fno-builtin"
327
328# Additional compiler flags for building library objects.
329pic_flag=" -fPIC -DPIC"
330
331# How to pass a linker flag through the compiler.
332wl="-Wl,"
333
334# Compiler flag to prevent dynamic linking.
335link_static_flag="-static"
336
337# Does compiler simultaneously support -c and -o options?
338compiler_c_o="yes"
339
340# Whether or not to add -lc for building shared libraries.
341build_libtool_need_lc=no
342
343# Whether or not to disallow shared libs when runtime libs are static.
344allow_libtool_libs_with_static_runtimes=no
345
346# Compiler flag to allow reflexive dlopens.
347export_dynamic_flag_spec="\${wl}--export-dynamic"
348
349# Compiler flag to generate shared objects directly from archives.
350whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
351
352# Whether the compiler copes with passing no objects directly.
353compiler_needs_object="no"
354
355# Create an old-style archive from a shared archive.
356old_archive_from_new_cmds=""
357
358# Create a temporary old-style archive to link instead of a shared archive.
359old_archive_from_expsyms_cmds=""
360
361# Commands used to build a shared archive.
362archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
363archive_expsym_cmds="echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
364 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
365 echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
366 \$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
367
368# Commands used to build a loadable module if different from building
369# a shared archive.
370module_cmds=""
371module_expsym_cmds=""
372
373# Whether we are building with GNU ld or not.
374with_gnu_ld="yes"
375
376# Flag that allows shared libraries with undefined symbols to be built.
377allow_undefined_flag=""
378
379# Flag that enforces no undefined symbols.
380no_undefined_flag=""
381
382# Flag to hardcode $libdir into a binary during linking.
383# This must work even if $libdir does not exist
384hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir"
385
386# Whether we need a single "-rpath" flag with a separated argument.
387hardcode_libdir_separator=""
388
389# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
390# DIR into the resulting binary.
391hardcode_direct=no
392
393# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
394# DIR into the resulting binary and the resulting library dependency is
395# "absolute",i.e impossible to change by setting ${shlibpath_var} if the
396# library is relocated.
397hardcode_direct_absolute=no
398
399# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
400# into the resulting binary.
401hardcode_minus_L=no
402
403# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
404# into the resulting binary.
405hardcode_shlibpath_var=unsupported
406
407# Set to "yes" if building a shared library automatically hardcodes DIR
408# into the library and all subsequent libraries and executables linked
409# against it.
410hardcode_automatic=no
411
412# Set to yes if linker adds runtime paths of dependent libraries
413# to runtime path list.
414inherit_rpath=no
415
416# Whether libtool must link a program against all its dependency libraries.
417link_all_deplibs=no
418
419# Set to "yes" if exported symbols are required.
420always_export_symbols=no
421
422# The commands to list exported symbols.
423export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
424
425# Symbols that should not be listed in the preloaded symbols.
426exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*"
427
428# Symbols that must always be exported.
429include_expsyms=""
430
431# Commands necessary for linking programs (against libraries) with templates.
432prelink_cmds=""
433
434# Commands necessary for finishing linking programs.
435postlink_cmds=""
436
437# Specify filename containing input files.
438file_list_spec=""
439
440# How to hardcode a shared library path into an executable.
441hardcode_action=immediate
442
443# ### END LIBTOOL CONFIG
444
445
446# libtool (GNU libtool) 2.4.2
447# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
448
449# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
450# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
451# This is free software; see the source for copying conditions. There is NO
452# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
453
454# GNU Libtool is free software; you can redistribute it and/or modify
455# it under the terms of the GNU General Public License as published by
456# the Free Software Foundation; either version 2 of the License, or
457# (at your option) any later version.
458#
459# As a special exception to the GNU General Public License,
460# if you distribute this file as part of a program or library that
461# is built using GNU Libtool, you may include this file under the
462# same distribution terms that you use for the rest of that program.
463#
464# GNU Libtool is distributed in the hope that it will be useful, but
465# WITHOUT ANY WARRANTY; without even the implied warranty of
466# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
467# General Public License for more details.
468#
469# You should have received a copy of the GNU General Public License
470# along with GNU Libtool; see the file COPYING. If not, a copy
471# can be downloaded from http://www.gnu.org/licenses/gpl.html,
472# or obtained by writing to the Free Software Foundation, Inc.,
473# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
474
475# Usage: $progname [OPTION]... [MODE-ARG]...
476#
477# Provide generalized library-building support services.
478#
479# --config show all configuration variables
480# --debug enable verbose shell tracing
481# -n, --dry-run display commands without modifying any files
482# --features display basic configuration information and exit
483# --mode=MODE use operation mode MODE
484# --preserve-dup-deps don't remove duplicate dependency libraries
485# --quiet, --silent don't print informational messages
486# --no-quiet, --no-silent
487# print informational messages (default)
488# --no-warn don't display warning messages
489# --tag=TAG use configuration variables from tag TAG
490# -v, --verbose print more informational messages than default
491# --no-verbose don't print the extra informational messages
492# --version print version information
493# -h, --help, --help-all print short, long, or detailed help message
494#
495# MODE must be one of the following:
496#
497# clean remove files from the build directory
498# compile compile a source file into a libtool object
499# execute automatically set library path, then run a program
500# finish complete the installation of libtool libraries
501# install install libraries or executables
502# link create a library or an executable
503# uninstall remove libraries from an installed directory
504#
505# MODE-ARGS vary depending on the MODE. When passed as first option,
506# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
507# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
508#
509# When reporting a bug, please describe a test case to reproduce it and
510# include the following information:
511#
512# host-triplet: $host
513# shell: $SHELL
514# compiler: $LTCC
515# compiler flags: $LTCFLAGS
516# linker: $LD (gnu? $with_gnu_ld)
517# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1
518# automake: $automake_version
519# autoconf: $autoconf_version
520#
521# Report bugs to <bug-libtool@gnu.org>.
522# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
523# General help using GNU software: <http://www.gnu.org/gethelp/>.
524
525PROGRAM=libtool
526PACKAGE=libtool
527VERSION="2.4.2 Debian-2.4.2-1ubuntu1"
528TIMESTAMP=""
529package_revision=1.3337
530
531# Be Bourne compatible
532if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
533 emulate sh
534 NULLCMD=:
535 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
536 # is contrary to our usage. Disable this feature.
537 alias -g '${1+"$@"}'='"$@"'
538 setopt NO_GLOB_SUBST
539else
540 case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
541fi
542BIN_SH=xpg4; export BIN_SH # for Tru64
543DUALCASE=1; export DUALCASE # for MKS sh
544
545# A function that is used when there is no print builtin or printf.
546func_fallback_echo ()
547{
548 eval 'cat <<_LTECHO_EOF
549$1
550_LTECHO_EOF'
551}
552
553# NLS nuisances: We save the old values to restore during execute mode.
554lt_user_locale=
555lt_safe_locale=
556for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
557do
558 eval "if test \"\${$lt_var+set}\" = set; then
559 save_$lt_var=\$$lt_var
560 $lt_var=C
561 export $lt_var
562 lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
563 lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
564 fi"
565done
566LC_ALL=C
567LANGUAGE=C
568export LANGUAGE LC_ALL
569
570$lt_unset CDPATH
571
572
573# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
574# is ksh but when the shell is invoked as "sh" and the current value of
575# the _XPG environment variable is not equal to 1 (one), the special
576# positional parameter $0, within a function call, is the name of the
577# function.
578progpath="$0"
579
580
581
582: ${CP="cp -f"}
583test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
584: ${MAKE="make"}
585: ${MKDIR="mkdir"}
586: ${MV="mv -f"}
587: ${RM="rm -f"}
588: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
589: ${Xsed="$SED -e 1s/^X//"}
590
591# Global variables:
592EXIT_SUCCESS=0
593EXIT_FAILURE=1
594EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
595EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
596
597exit_status=$EXIT_SUCCESS
598
599# Make sure IFS has a sensible default
600lt_nl='
601'
602IFS=" $lt_nl"
603
604dirname="s,/[^/]*$,,"
605basename="s,^.*/,,"
606
607# func_dirname file append nondir_replacement
608# Compute the dirname of FILE. If nonempty, add APPEND to the result,
609# otherwise set result to NONDIR_REPLACEMENT.
610func_dirname ()
611{
612 case ${1} in
613 */*) func_dirname_result="${1%/*}${2}" ;;
614 * ) func_dirname_result="${3}" ;;
615 esac
616} # Extended-shell func_dirname implementation
617
618
619# func_basename file
620func_basename ()
621{
622 func_basename_result="${1##*/}"
623} # Extended-shell func_basename implementation
624
625
626# func_dirname_and_basename file append nondir_replacement
627# perform func_basename and func_dirname in a single function
628# call:
629# dirname: Compute the dirname of FILE. If nonempty,
630# add APPEND to the result, otherwise set result
631# to NONDIR_REPLACEMENT.
632# value returned in "$func_dirname_result"
633# basename: Compute filename of FILE.
634# value retuned in "$func_basename_result"
635# Implementation must be kept synchronized with func_dirname
636# and func_basename. For efficiency, we do not delegate to
637# those functions but instead duplicate the functionality here.
638func_dirname_and_basename ()
639{
640 case ${1} in
641 */*) func_dirname_result="${1%/*}${2}" ;;
642 * ) func_dirname_result="${3}" ;;
643 esac
644 func_basename_result="${1##*/}"
645} # Extended-shell func_dirname_and_basename implementation
646
647
648# func_stripname prefix suffix name
649# strip PREFIX and SUFFIX off of NAME.
650# PREFIX and SUFFIX must not contain globbing or regex special
651# characters, hashes, percent signs, but SUFFIX may contain a leading
652# dot (in which case that matches only a dot).
653# func_strip_suffix prefix name
654func_stripname ()
655{
656 # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
657 # positional parameters, so assign one to ordinary parameter first.
658 func_stripname_result=${3}
659 func_stripname_result=${func_stripname_result#"${1}"}
660 func_stripname_result=${func_stripname_result%"${2}"}
661} # Extended-shell func_stripname implementation
662
663
664# These SED scripts presuppose an absolute path with a trailing slash.
665pathcar='s,^/\([^/]*\).*$,\1,'
666pathcdr='s,^/[^/]*,,'
667removedotparts=':dotsl
668 s@/\./@/@g
669 t dotsl
670 s,/\.$,/,'
671collapseslashes='s@/\{1,\}@/@g'
672finalslash='s,/*$,/,'
673
674# func_normal_abspath PATH
675# Remove doubled-up and trailing slashes, "." path components,
676# and cancel out any ".." path components in PATH after making
677# it an absolute path.
678# value returned in "$func_normal_abspath_result"
679func_normal_abspath ()
680{
681 # Start from root dir and reassemble the path.
682 func_normal_abspath_result=
683 func_normal_abspath_tpath=$1
684 func_normal_abspath_altnamespace=
685 case $func_normal_abspath_tpath in
686 "")
687 # Empty path, that just means $cwd.
688 func_stripname '' '/' "`pwd`"
689 func_normal_abspath_result=$func_stripname_result
690 return
691 ;;
692 # The next three entries are used to spot a run of precisely
693 # two leading slashes without using negated character classes;
694 # we take advantage of case's first-match behaviour.
695 ///*)
696 # Unusual form of absolute path, do nothing.
697 ;;
698 //*)
699 # Not necessarily an ordinary path; POSIX reserves leading '//'
700 # and for example Cygwin uses it to access remote file shares
701 # over CIFS/SMB, so we conserve a leading double slash if found.
702 func_normal_abspath_altnamespace=/
703 ;;
704 /*)
705 # Absolute path, do nothing.
706 ;;
707 *)
708 # Relative path, prepend $cwd.
709 func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
710 ;;
711 esac
712 # Cancel out all the simple stuff to save iterations. We also want
713 # the path to end with a slash for ease of parsing, so make sure
714 # there is one (and only one) here.
715 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
716 -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
717 while :; do
718 # Processed it all yet?
719 if test "$func_normal_abspath_tpath" = / ; then
720 # If we ascended to the root using ".." the result may be empty now.
721 if test -z "$func_normal_abspath_result" ; then
722 func_normal_abspath_result=/
723 fi
724 break
725 fi
726 func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
727 -e "$pathcar"`
728 func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
729 -e "$pathcdr"`
730 # Figure out what to do with it
731 case $func_normal_abspath_tcomponent in
732 "")
733 # Trailing empty path component, ignore it.
734 ;;
735 ..)
736 # Parent dir; strip last assembled component from result.
737 func_dirname "$func_normal_abspath_result"
738 func_normal_abspath_result=$func_dirname_result
739 ;;
740 *)
741 # Actual path component, append it.
742 func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
743 ;;
744 esac
745 done
746 # Restore leading double-slash if one was found on entry.
747 func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
748}
749
750# func_relative_path SRCDIR DSTDIR
751# generates a relative path from SRCDIR to DSTDIR, with a trailing
752# slash if non-empty, suitable for immediately appending a filename
753# without needing to append a separator.
754# value returned in "$func_relative_path_result"
755func_relative_path ()
756{
757 func_relative_path_result=
758 func_normal_abspath "$1"
759 func_relative_path_tlibdir=$func_normal_abspath_result
760 func_normal_abspath "$2"
761 func_relative_path_tbindir=$func_normal_abspath_result
762
763 # Ascend the tree starting from libdir
764 while :; do
765 # check if we have found a prefix of bindir
766 case $func_relative_path_tbindir in
767 $func_relative_path_tlibdir)
768 # found an exact match
769 func_relative_path_tcancelled=
770 break
771 ;;
772 $func_relative_path_tlibdir*)
773 # found a matching prefix
774 func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
775 func_relative_path_tcancelled=$func_stripname_result
776 if test -z "$func_relative_path_result"; then
777 func_relative_path_result=.
778 fi
779 break
780 ;;
781 *)
782 func_dirname $func_relative_path_tlibdir
783 func_relative_path_tlibdir=${func_dirname_result}
784 if test "x$func_relative_path_tlibdir" = x ; then
785 # Have to descend all the way to the root!
786 func_relative_path_result=../$func_relative_path_result
787 func_relative_path_tcancelled=$func_relative_path_tbindir
788 break
789 fi
790 func_relative_path_result=../$func_relative_path_result
791 ;;
792 esac
793 done
794
795 # Now calculate path; take care to avoid doubling-up slashes.
796 func_stripname '' '/' "$func_relative_path_result"
797 func_relative_path_result=$func_stripname_result
798 func_stripname '/' '/' "$func_relative_path_tcancelled"
799 if test "x$func_stripname_result" != x ; then
800 func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
801 fi
802
803 # Normalisation. If bindir is libdir, return empty string,
804 # else relative path ending with a slash; either way, target
805 # file name can be directly appended.
806 if test ! -z "$func_relative_path_result"; then
807 func_stripname './' '' "$func_relative_path_result/"
808 func_relative_path_result=$func_stripname_result
809 fi
810}
811
812# The name of this program:
813func_dirname_and_basename "$progpath"
814progname=$func_basename_result
815
816# Make sure we have an absolute path for reexecution:
817case $progpath in
818 [\\/]*|[A-Za-z]:\\*) ;;
819 *[\\/]*)
820 progdir=$func_dirname_result
821 progdir=`cd "$progdir" && pwd`
822 progpath="$progdir/$progname"
823 ;;
824 *)
825 save_IFS="$IFS"
826 IFS=${PATH_SEPARATOR-:}
827 for progdir in $PATH; do
828 IFS="$save_IFS"
829 test -x "$progdir/$progname" && break
830 done
831 IFS="$save_IFS"
832 test -n "$progdir" || progdir=`pwd`
833 progpath="$progdir/$progname"
834 ;;
835esac
836
837# Sed substitution that helps us do robust quoting. It backslashifies
838# metacharacters that are still active within double-quoted strings.
839Xsed="${SED}"' -e 1s/^X//'
840sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
841
842# Same as above, but do not quote variable references.
843double_quote_subst='s/\(["`\\]\)/\\\1/g'
844
845# Sed substitution that turns a string into a regex matching for the
846# string literally.
847sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
848
849# Sed substitution that converts a w32 file name or path
850# which contains forward slashes, into one that contains
851# (escaped) backslashes. A very naive implementation.
852lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
853
854# Re-`\' parameter expansions in output of double_quote_subst that were
855# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
856# in input to double_quote_subst, that '$' was protected from expansion.
857# Since each input `\' is now two `\'s, look for any number of runs of
858# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
859bs='\\'
860bs2='\\\\'
861bs4='\\\\\\\\'
862dollar='\$'
863sed_double_backslash="\
864 s/$bs4/&\\
865/g
866 s/^$bs2$dollar/$bs&/
867 s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
868 s/\n//g"
869
870# Standard options:
871opt_dry_run=false
872opt_help=false
873opt_quiet=false
874opt_verbose=false
875opt_warning=:
876
877# func_echo arg...
878# Echo program name prefixed message, along with the current mode
879# name if it has been set yet.
880func_echo ()
881{
882 $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
883}
884
885# func_verbose arg...
886# Echo program name prefixed message in verbose mode only.
887func_verbose ()
888{
889 $opt_verbose && func_echo ${1+"$@"}
890
891 # A bug in bash halts the script if the last line of a function
892 # fails when set -e is in force, so we need another command to
893 # work around that:
894 :
895}
896
897# func_echo_all arg...
898# Invoke $ECHO with all args, space-separated.
899func_echo_all ()
900{
901 $ECHO "$*"
902}
903
904# func_error arg...
905# Echo program name prefixed message to standard error.
906func_error ()
907{
908 $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
909}
910
911# func_warning arg...
912# Echo program name prefixed warning message to standard error.
913func_warning ()
914{
915 $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
916
917 # bash bug again:
918 :
919}
920
921# func_fatal_error arg...
922# Echo program name prefixed message to standard error, and exit.
923func_fatal_error ()
924{
925 func_error ${1+"$@"}
926 exit $EXIT_FAILURE
927}
928
929# func_fatal_help arg...
930# Echo program name prefixed message to standard error, followed by
931# a help hint, and exit.
932func_fatal_help ()
933{
934 func_error ${1+"$@"}
935 func_fatal_error "$help"
936}
937help="Try \`$progname --help' for more information." ## default
938
939
940# func_grep expression filename
941# Check whether EXPRESSION matches any line of FILENAME, without output.
942func_grep ()
943{
944 $GREP "$1" "$2" >/dev/null 2>&1
945}
946
947
948# func_mkdir_p directory-path
949# Make sure the entire path to DIRECTORY-PATH is available.
950func_mkdir_p ()
951{
952 my_directory_path="$1"
953 my_dir_list=
954
955 if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
956
957 # Protect directory names starting with `-'
958 case $my_directory_path in
959 -*) my_directory_path="./$my_directory_path" ;;
960 esac
961
962 # While some portion of DIR does not yet exist...
963 while test ! -d "$my_directory_path"; do
964 # ...make a list in topmost first order. Use a colon delimited
965 # list incase some portion of path contains whitespace.
966 my_dir_list="$my_directory_path:$my_dir_list"
967
968 # If the last portion added has no slash in it, the list is done
969 case $my_directory_path in */*) ;; *) break ;; esac
970
971 # ...otherwise throw away the child directory and loop
972 my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
973 done
974 my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
975
976 save_mkdir_p_IFS="$IFS"; IFS=':'
977 for my_dir in $my_dir_list; do
978 IFS="$save_mkdir_p_IFS"
979 # mkdir can fail with a `File exist' error if two processes
980 # try to create one of the directories concurrently. Don't
981 # stop in that case!
982 $MKDIR "$my_dir" 2>/dev/null || :
983 done
984 IFS="$save_mkdir_p_IFS"
985
986 # Bail out if we (or some other process) failed to create a directory.
987 test -d "$my_directory_path" || \
988 func_fatal_error "Failed to create \`$1'"
989 fi
990}
991
992
993# func_mktempdir [string]
994# Make a temporary directory that won't clash with other running
995# libtool processes, and avoids race conditions if possible. If
996# given, STRING is the basename for that directory.
997func_mktempdir ()
998{
999 my_template="${TMPDIR-/tmp}/${1-$progname}"
1000
1001 if test "$opt_dry_run" = ":"; then
1002 # Return a directory name, but don't create it in dry-run mode
1003 my_tmpdir="${my_template}-$$"
1004 else
1005
1006 # If mktemp works, use that first and foremost
1007 my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
1008
1009 if test ! -d "$my_tmpdir"; then
1010 # Failing that, at least try and use $RANDOM to avoid a race
1011 my_tmpdir="${my_template}-${RANDOM-0}$$"
1012
1013 save_mktempdir_umask=`umask`
1014 umask 0077
1015 $MKDIR "$my_tmpdir"
1016 umask $save_mktempdir_umask
1017 fi
1018
1019 # If we're not in dry-run mode, bomb out on failure
1020 test -d "$my_tmpdir" || \
1021 func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
1022 fi
1023
1024 $ECHO "$my_tmpdir"
1025}
1026
1027
1028# func_quote_for_eval arg
1029# Aesthetically quote ARG to be evaled later.
1030# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
1031# is double-quoted, suitable for a subsequent eval, whereas
1032# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
1033# which are still active within double quotes backslashified.
1034func_quote_for_eval ()
1035{
1036 case $1 in
1037 *[\\\`\"\$]*)
1038 func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
1039 *)
1040 func_quote_for_eval_unquoted_result="$1" ;;
1041 esac
1042
1043 case $func_quote_for_eval_unquoted_result in
1044 # Double-quote args containing shell metacharacters to delay
1045 # word splitting, command substitution and and variable
1046 # expansion for a subsequent eval.
1047 # Many Bourne shells cannot handle close brackets correctly
1048 # in scan sets, so we specify it separately.
1049 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1050 func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
1051 ;;
1052 *)
1053 func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
1054 esac
1055}
1056
1057
1058# func_quote_for_expand arg
1059# Aesthetically quote ARG to be evaled later; same as above,
1060# but do not quote variable references.
1061func_quote_for_expand ()
1062{
1063 case $1 in
1064 *[\\\`\"]*)
1065 my_arg=`$ECHO "$1" | $SED \
1066 -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
1067 *)
1068 my_arg="$1" ;;
1069 esac
1070
1071 case $my_arg in
1072 # Double-quote args containing shell metacharacters to delay
1073 # word splitting and command substitution for a subsequent eval.
1074 # Many Bourne shells cannot handle close brackets correctly
1075 # in scan sets, so we specify it separately.
1076 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
1077 my_arg="\"$my_arg\""
1078 ;;
1079 esac
1080
1081 func_quote_for_expand_result="$my_arg"
1082}
1083
1084
1085# func_show_eval cmd [fail_exp]
1086# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1087# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1088# is given, then evaluate it.
1089func_show_eval ()
1090{
1091 my_cmd="$1"
1092 my_fail_exp="${2-:}"
1093
1094 ${opt_silent-false} || {
1095 func_quote_for_expand "$my_cmd"
1096 eval "func_echo $func_quote_for_expand_result"
1097 }
1098
1099 if ${opt_dry_run-false}; then :; else
1100 eval "$my_cmd"
1101 my_status=$?
1102 if test "$my_status" -eq 0; then :; else
1103 eval "(exit $my_status); $my_fail_exp"
1104 fi
1105 fi
1106}
1107
1108
1109# func_show_eval_locale cmd [fail_exp]
1110# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
1111# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
1112# is given, then evaluate it. Use the saved locale for evaluation.
1113func_show_eval_locale ()
1114{
1115 my_cmd="$1"
1116 my_fail_exp="${2-:}"
1117
1118 ${opt_silent-false} || {
1119 func_quote_for_expand "$my_cmd"
1120 eval "func_echo $func_quote_for_expand_result"
1121 }
1122
1123 if ${opt_dry_run-false}; then :; else
1124 eval "$lt_user_locale
1125 $my_cmd"
1126 my_status=$?
1127 eval "$lt_safe_locale"
1128 if test "$my_status" -eq 0; then :; else
1129 eval "(exit $my_status); $my_fail_exp"
1130 fi
1131 fi
1132}
1133
1134# func_tr_sh
1135# Turn $1 into a string suitable for a shell variable name.
1136# Result is stored in $func_tr_sh_result. All characters
1137# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
1138# if $1 begins with a digit, a '_' is prepended as well.
1139func_tr_sh ()
1140{
1141 case $1 in
1142 [0-9]* | *[!a-zA-Z0-9_]*)
1143 func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
1144 ;;
1145 * )
1146 func_tr_sh_result=$1
1147 ;;
1148 esac
1149}
1150
1151
1152# func_version
1153# Echo version message to standard output and exit.
1154func_version ()
1155{
1156 $opt_debug
1157
1158 $SED -n '/(C)/!b go
1159 :more
1160 /\./!{
1161 N
1162 s/\n# / /
1163 b more
1164 }
1165 :go
1166 /^# '$PROGRAM' (GNU /,/# warranty; / {
1167 s/^# //
1168 s/^# *$//
1169 s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
1170 p
1171 }' < "$progpath"
1172 exit $?
1173}
1174
1175# func_usage
1176# Echo short help message to standard output and exit.
1177func_usage ()
1178{
1179 $opt_debug
1180
1181 $SED -n '/^# Usage:/,/^# *.*--help/ {
1182 s/^# //
1183 s/^# *$//
1184 s/\$progname/'$progname'/
1185 p
1186 }' < "$progpath"
1187 echo
1188 $ECHO "run \`$progname --help | more' for full usage"
1189 exit $?
1190}
1191
1192# func_help [NOEXIT]
1193# Echo long help message to standard output and exit,
1194# unless 'noexit' is passed as argument.
1195func_help ()
1196{
1197 $opt_debug
1198
1199 $SED -n '/^# Usage:/,/# Report bugs to/ {
1200 :print
1201 s/^# //
1202 s/^# *$//
1203 s*\$progname*'$progname'*
1204 s*\$host*'"$host"'*
1205 s*\$SHELL*'"$SHELL"'*
1206 s*\$LTCC*'"$LTCC"'*
1207 s*\$LTCFLAGS*'"$LTCFLAGS"'*
1208 s*\$LD*'"$LD"'*
1209 s/\$with_gnu_ld/'"$with_gnu_ld"'/
1210 s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
1211 s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
1212 p
1213 d
1214 }
1215 /^# .* home page:/b print
1216 /^# General help using/b print
1217 ' < "$progpath"
1218 ret=$?
1219 if test -z "$1"; then
1220 exit $ret
1221 fi
1222}
1223
1224# func_missing_arg argname
1225# Echo program name prefixed message to standard error and set global
1226# exit_cmd.
1227func_missing_arg ()
1228{
1229 $opt_debug
1230
1231 func_error "missing argument for $1."
1232 exit_cmd=exit
1233}
1234
1235
1236# func_split_short_opt shortopt
1237# Set func_split_short_opt_name and func_split_short_opt_arg shell
1238# variables after splitting SHORTOPT after the 2nd character.
1239func_split_short_opt ()
1240{
1241 func_split_short_opt_arg=${1#??}
1242 func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
1243} # Extended-shell func_split_short_opt implementation
1244
1245
1246# func_split_long_opt longopt
1247# Set func_split_long_opt_name and func_split_long_opt_arg shell
1248# variables after splitting LONGOPT at the `=' sign.
1249func_split_long_opt ()
1250{
1251 func_split_long_opt_name=${1%%=*}
1252 func_split_long_opt_arg=${1#*=}
1253} # Extended-shell func_split_long_opt implementation
1254
1255exit_cmd=:
1256
1257
1258
1259
1260
1261magic="%%%MAGIC variable%%%"
1262magic_exe="%%%MAGIC EXE variable%%%"
1263
1264# Global variables.
1265nonopt=
1266preserve_args=
1267lo2o="s/\\.lo\$/.${objext}/"
1268o2lo="s/\\.${objext}\$/.lo/"
1269extracted_archives=
1270extracted_serial=0
1271
1272# If this variable is set in any of the actions, the command in it
1273# will be execed at the end. This prevents here-documents from being
1274# left over by shells.
1275exec_cmd=
1276
1277# func_append var value
1278# Append VALUE to the end of shell variable VAR.
1279func_append ()
1280{
1281 eval "${1}=\$${1}\${2}"
1282} # func_append may be replaced by extended shell implementation
1283
1284# func_append_quoted var value
1285# Quote VALUE and append to the end of shell variable VAR, separated
1286# by a space.
1287func_append_quoted ()
1288{
1289 func_quote_for_eval "${2}"
1290 eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
1291} # func_append_quoted may be replaced by extended shell implementation
1292
1293
1294# func_arith arithmetic-term...
1295func_arith ()
1296{
1297 func_arith_result=$(( $* ))
1298} # Extended-shell func_arith implementation
1299
1300
1301# func_len string
1302# STRING may not start with a hyphen.
1303func_len ()
1304{
1305 func_len_result=${#1}
1306} # Extended-shell func_len implementation
1307
1308
1309# func_lo2o object
1310func_lo2o ()
1311{
1312 case ${1} in
1313 *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
1314 *) func_lo2o_result=${1} ;;
1315 esac
1316} # Extended-shell func_lo2o implementation
1317
1318
1319# func_xform libobj-or-source
1320func_xform ()
1321{
1322 func_xform_result=${1%.*}.lo
1323} # Extended-shell func_xform implementation
1324
1325
1326# func_fatal_configuration arg...
1327# Echo program name prefixed message to standard error, followed by
1328# a configuration failure hint, and exit.
1329func_fatal_configuration ()
1330{
1331 func_error ${1+"$@"}
1332 func_error "See the $PACKAGE documentation for more information."
1333 func_fatal_error "Fatal configuration error."
1334}
1335
1336
1337# func_config
1338# Display the configuration for all the tags in this script.
1339func_config ()
1340{
1341 re_begincf='^# ### BEGIN LIBTOOL'
1342 re_endcf='^# ### END LIBTOOL'
1343
1344 # Default configuration.
1345 $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
1346
1347 # Now print the configurations for the tags.
1348 for tagname in $taglist; do
1349 $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
1350 done
1351
1352 exit $?
1353}
1354
1355# func_features
1356# Display the features supported by this script.
1357func_features ()
1358{
1359 echo "host: $host"
1360 if test "$build_libtool_libs" = yes; then
1361 echo "enable shared libraries"
1362 else
1363 echo "disable shared libraries"
1364 fi
1365 if test "$build_old_libs" = yes; then
1366 echo "enable static libraries"
1367 else
1368 echo "disable static libraries"
1369 fi
1370
1371 exit $?
1372}
1373
1374# func_enable_tag tagname
1375# Verify that TAGNAME is valid, and either flag an error and exit, or
1376# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
1377# variable here.
1378func_enable_tag ()
1379{
1380 # Global variable:
1381 tagname="$1"
1382
1383 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
1384 re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
1385 sed_extractcf="/$re_begincf/,/$re_endcf/p"
1386
1387 # Validate tagname.
1388 case $tagname in
1389 *[!-_A-Za-z0-9,/]*)
1390 func_fatal_error "invalid tag name: $tagname"
1391 ;;
1392 esac
1393
1394 # Don't test for the "default" C tag, as we know it's
1395 # there but not specially marked.
1396 case $tagname in
1397 CC) ;;
1398 *)
1399 if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
1400 taglist="$taglist $tagname"
1401
1402 # Evaluate the configuration. Be careful to quote the path
1403 # and the sed script, to avoid splitting on whitespace, but
1404 # also don't use non-portable quotes within backquotes within
1405 # quotes we have to do it in 2 steps:
1406 extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
1407 eval "$extractedcf"
1408 else
1409 func_error "ignoring unknown tag $tagname"
1410 fi
1411 ;;
1412 esac
1413}
1414
1415# func_check_version_match
1416# Ensure that we are using m4 macros, and libtool script from the same
1417# release of libtool.
1418func_check_version_match ()
1419{
1420 if test "$package_revision" != "$macro_revision"; then
1421 if test "$VERSION" != "$macro_version"; then
1422 if test -z "$macro_version"; then
1423 cat >&2 <<_LT_EOF
1424$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1425$progname: definition of this LT_INIT comes from an older release.
1426$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1427$progname: and run autoconf again.
1428_LT_EOF
1429 else
1430 cat >&2 <<_LT_EOF
1431$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
1432$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
1433$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
1434$progname: and run autoconf again.
1435_LT_EOF
1436 fi
1437 else
1438 cat >&2 <<_LT_EOF
1439$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
1440$progname: but the definition of this LT_INIT comes from revision $macro_revision.
1441$progname: You should recreate aclocal.m4 with macros from revision $package_revision
1442$progname: of $PACKAGE $VERSION and run autoconf again.
1443_LT_EOF
1444 fi
1445
1446 exit $EXIT_MISMATCH
1447 fi
1448}
1449
1450
1451# Shorthand for --mode=foo, only valid as the first argument
1452case $1 in
1453clean|clea|cle|cl)
1454 shift; set dummy --mode clean ${1+"$@"}; shift
1455 ;;
1456compile|compil|compi|comp|com|co|c)
1457 shift; set dummy --mode compile ${1+"$@"}; shift
1458 ;;
1459execute|execut|execu|exec|exe|ex|e)
1460 shift; set dummy --mode execute ${1+"$@"}; shift
1461 ;;
1462finish|finis|fini|fin|fi|f)
1463 shift; set dummy --mode finish ${1+"$@"}; shift
1464 ;;
1465install|instal|insta|inst|ins|in|i)
1466 shift; set dummy --mode install ${1+"$@"}; shift
1467 ;;
1468link|lin|li|l)
1469 shift; set dummy --mode link ${1+"$@"}; shift
1470 ;;
1471uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
1472 shift; set dummy --mode uninstall ${1+"$@"}; shift
1473 ;;
1474esac
1475
1476
1477
1478# Option defaults:
1479opt_debug=:
1480opt_dry_run=false
1481opt_config=false
1482opt_preserve_dup_deps=false
1483opt_features=false
1484opt_finish=false
1485opt_help=false
1486opt_help_all=false
1487opt_silent=:
1488opt_warning=:
1489opt_verbose=:
1490opt_silent=false
1491opt_verbose=false
1492
1493
1494# Parse options once, thoroughly. This comes as soon as possible in the
1495# script to make things like `--version' happen as quickly as we can.
1496{
1497 # this just eases exit handling
1498 while test $# -gt 0; do
1499 opt="$1"
1500 shift
1501 case $opt in
1502 --debug|-x) opt_debug='set -x'
1503 func_echo "enabling shell trace mode"
1504 $opt_debug
1505 ;;
1506 --dry-run|--dryrun|-n)
1507 opt_dry_run=:
1508 ;;
1509 --config)
1510 opt_config=:
1511func_config
1512 ;;
1513 --dlopen|-dlopen)
1514 optarg="$1"
1515 opt_dlopen="${opt_dlopen+$opt_dlopen
1516}$optarg"
1517 shift
1518 ;;
1519 --preserve-dup-deps)
1520 opt_preserve_dup_deps=:
1521 ;;
1522 --features)
1523 opt_features=:
1524func_features
1525 ;;
1526 --finish)
1527 opt_finish=:
1528set dummy --mode finish ${1+"$@"}; shift
1529 ;;
1530 --help)
1531 opt_help=:
1532 ;;
1533 --help-all)
1534 opt_help_all=:
1535opt_help=': help-all'
1536 ;;
1537 --mode)
1538 test $# = 0 && func_missing_arg $opt && break
1539 optarg="$1"
1540 opt_mode="$optarg"
1541case $optarg in
1542 # Valid mode arguments:
1543 clean|compile|execute|finish|install|link|relink|uninstall) ;;
1544
1545 # Catch anything else as an error
1546 *) func_error "invalid argument for $opt"
1547 exit_cmd=exit
1548 break
1549 ;;
1550esac
1551 shift
1552 ;;
1553 --no-silent|--no-quiet)
1554 opt_silent=false
1555preserve_args="$preserve_args $opt"
1556 ;;
1557 --no-warning|--no-warn)
1558 opt_warning=false
1559preserve_args="$preserve_args $opt"
1560 ;;
1561 --no-verbose)
1562 opt_verbose=false
1563preserve_args="$preserve_args $opt"
1564 ;;
1565 --silent|--quiet)
1566 opt_silent=:
1567preserve_args="$preserve_args $opt"
1568 opt_verbose=false
1569 ;;
1570 --verbose|-v)
1571 opt_verbose=:
1572preserve_args="$preserve_args $opt"
1573opt_silent=false
1574 ;;
1575 --tag)
1576 test $# = 0 && func_missing_arg $opt && break
1577 optarg="$1"
1578 opt_tag="$optarg"
1579preserve_args="$preserve_args $opt $optarg"
1580func_enable_tag "$optarg"
1581 shift
1582 ;;
1583
1584 -\?|-h) func_usage ;;
1585 --help) func_help ;;
1586 --version) func_version ;;
1587
1588 # Separate optargs to long options:
1589 --*=*)
1590 func_split_long_opt "$opt"
1591 set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
1592 shift
1593 ;;
1594
1595 # Separate non-argument short options:
1596 -\?*|-h*|-n*|-v*)
1597 func_split_short_opt "$opt"
1598 set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
1599 shift
1600 ;;
1601
1602 --) break ;;
1603 -*) func_fatal_help "unrecognized option \`$opt'" ;;
1604 *) set dummy "$opt" ${1+"$@"}; shift; break ;;
1605 esac
1606 done
1607
1608 # Validate options:
1609
1610 # save first non-option argument
1611 if test "$#" -gt 0; then
1612 nonopt="$opt"
1613 shift
1614 fi
1615
1616 # preserve --debug
1617 test "$opt_debug" = : || preserve_args="$preserve_args --debug"
1618
1619 case $host in
1620 *cygwin* | *mingw* | *pw32* | *cegcc*)
1621 # don't eliminate duplications in $postdeps and $predeps
1622 opt_duplicate_compiler_generated_deps=:
1623 ;;
1624 *)
1625 opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
1626 ;;
1627 esac
1628
1629 $opt_help || {
1630 # Sanity checks first:
1631 func_check_version_match
1632
1633 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
1634 func_fatal_configuration "not configured to build any kind of library"
1635 fi
1636
1637 # Darwin sucks
1638 eval std_shrext=\"$shrext_cmds\"
1639
1640 # Only execute mode is allowed to have -dlopen flags.
1641 if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
1642 func_error "unrecognized option \`-dlopen'"
1643 $ECHO "$help" 1>&2
1644 exit $EXIT_FAILURE
1645 fi
1646
1647 # Change the help message to a mode-specific one.
1648 generic_help="$help"
1649 help="Try \`$progname --help --mode=$opt_mode' for more information."
1650 }
1651
1652
1653 # Bail if the options were screwed
1654 $exit_cmd $EXIT_FAILURE
1655}
1656
1657
1658
1659
1660## ----------- ##
1661## Main. ##
1662## ----------- ##
1663
1664# func_lalib_p file
1665# True iff FILE is a libtool `.la' library or `.lo' object file.
1666# This function is only a basic sanity check; it will hardly flush out
1667# determined imposters.
1668func_lalib_p ()
1669{
1670 test -f "$1" &&
1671 $SED -e 4q "$1" 2>/dev/null \
1672 | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
1673}
1674
1675# func_lalib_unsafe_p file
1676# True iff FILE is a libtool `.la' library or `.lo' object file.
1677# This function implements the same check as func_lalib_p without
1678# resorting to external programs. To this end, it redirects stdin and
1679# closes it afterwards, without saving the original file descriptor.
1680# As a safety measure, use it only where a negative result would be
1681# fatal anyway. Works if `file' does not exist.
1682func_lalib_unsafe_p ()
1683{
1684 lalib_p=no
1685 if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
1686 for lalib_p_l in 1 2 3 4
1687 do
1688 read lalib_p_line
1689 case "$lalib_p_line" in
1690 \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
1691 esac
1692 done
1693 exec 0<&5 5<&-
1694 fi
1695 test "$lalib_p" = yes
1696}
1697
1698# func_ltwrapper_script_p file
1699# True iff FILE is a libtool wrapper script
1700# This function is only a basic sanity check; it will hardly flush out
1701# determined imposters.
1702func_ltwrapper_script_p ()
1703{
1704 func_lalib_p "$1"
1705}
1706
1707# func_ltwrapper_executable_p file
1708# True iff FILE is a libtool wrapper executable
1709# This function is only a basic sanity check; it will hardly flush out
1710# determined imposters.
1711func_ltwrapper_executable_p ()
1712{
1713 func_ltwrapper_exec_suffix=
1714 case $1 in
1715 *.exe) ;;
1716 *) func_ltwrapper_exec_suffix=.exe ;;
1717 esac
1718 $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
1719}
1720
1721# func_ltwrapper_scriptname file
1722# Assumes file is an ltwrapper_executable
1723# uses $file to determine the appropriate filename for a
1724# temporary ltwrapper_script.
1725func_ltwrapper_scriptname ()
1726{
1727 func_dirname_and_basename "$1" "" "."
1728 func_stripname '' '.exe' "$func_basename_result"
1729 func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
1730}
1731
1732# func_ltwrapper_p file
1733# True iff FILE is a libtool wrapper script or wrapper executable
1734# This function is only a basic sanity check; it will hardly flush out
1735# determined imposters.
1736func_ltwrapper_p ()
1737{
1738 func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
1739}
1740
1741
1742# func_execute_cmds commands fail_cmd
1743# Execute tilde-delimited COMMANDS.
1744# If FAIL_CMD is given, eval that upon failure.
1745# FAIL_CMD may read-access the current command in variable CMD!
1746func_execute_cmds ()
1747{
1748 $opt_debug
1749 save_ifs=$IFS; IFS='~'
1750 for cmd in $1; do
1751 IFS=$save_ifs
1752 eval cmd=\"$cmd\"
1753 func_show_eval "$cmd" "${2-:}"
1754 done
1755 IFS=$save_ifs
1756}
1757
1758
1759# func_source file
1760# Source FILE, adding directory component if necessary.
1761# Note that it is not necessary on cygwin/mingw to append a dot to
1762# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
1763# behavior happens only for exec(3), not for open(2)! Also, sourcing
1764# `FILE.' does not work on cygwin managed mounts.
1765func_source ()
1766{
1767 $opt_debug
1768 case $1 in
1769 */* | *\\*) . "$1" ;;
1770 *) . "./$1" ;;
1771 esac
1772}
1773
1774
1775# func_resolve_sysroot PATH
1776# Replace a leading = in PATH with a sysroot. Store the result into
1777# func_resolve_sysroot_result
1778func_resolve_sysroot ()
1779{
1780 func_resolve_sysroot_result=$1
1781 case $func_resolve_sysroot_result in
1782 =*)
1783 func_stripname '=' '' "$func_resolve_sysroot_result"
1784 func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
1785 ;;
1786 esac
1787}
1788
1789# func_replace_sysroot PATH
1790# If PATH begins with the sysroot, replace it with = and
1791# store the result into func_replace_sysroot_result.
1792func_replace_sysroot ()
1793{
1794 case "$lt_sysroot:$1" in
1795 ?*:"$lt_sysroot"*)
1796 func_stripname "$lt_sysroot" '' "$1"
1797 func_replace_sysroot_result="=$func_stripname_result"
1798 ;;
1799 *)
1800 # Including no sysroot.
1801 func_replace_sysroot_result=$1
1802 ;;
1803 esac
1804}
1805
1806# func_infer_tag arg
1807# Infer tagged configuration to use if any are available and
1808# if one wasn't chosen via the "--tag" command line option.
1809# Only attempt this if the compiler in the base compile
1810# command doesn't match the default compiler.
1811# arg is usually of the form 'gcc ...'
1812func_infer_tag ()
1813{
1814 $opt_debug
1815 if test -n "$available_tags" && test -z "$tagname"; then
1816 CC_quoted=
1817 for arg in $CC; do
1818 func_append_quoted CC_quoted "$arg"
1819 done
1820 CC_expanded=`func_echo_all $CC`
1821 CC_quoted_expanded=`func_echo_all $CC_quoted`
1822 case $@ in
1823 # Blanks in the command may have been stripped by the calling shell,
1824 # but not from the CC environment variable when configure was run.
1825 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1826 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
1827 # Blanks at the start of $base_compile will cause this to fail
1828 # if we don't check for them as well.
1829 *)
1830 for z in $available_tags; do
1831 if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
1832 # Evaluate the configuration.
1833 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
1834 CC_quoted=
1835 for arg in $CC; do
1836 # Double-quote args containing other shell metacharacters.
1837 func_append_quoted CC_quoted "$arg"
1838 done
1839 CC_expanded=`func_echo_all $CC`
1840 CC_quoted_expanded=`func_echo_all $CC_quoted`
1841 case "$@ " in
1842 " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
1843 " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
1844 # The compiler in the base compile command matches
1845 # the one in the tagged configuration.
1846 # Assume this is the tagged configuration we want.
1847 tagname=$z
1848 break
1849 ;;
1850 esac
1851 fi
1852 done
1853 # If $tagname still isn't set, then no tagged configuration
1854 # was found and let the user know that the "--tag" command
1855 # line option must be used.
1856 if test -z "$tagname"; then
1857 func_echo "unable to infer tagged configuration"
1858 func_fatal_error "specify a tag with \`--tag'"
1859# else
1860# func_verbose "using $tagname tagged configuration"
1861 fi
1862 ;;
1863 esac
1864 fi
1865}
1866
1867
1868
1869# func_write_libtool_object output_name pic_name nonpic_name
1870# Create a libtool object file (analogous to a ".la" file),
1871# but don't create it if we're doing a dry run.
1872func_write_libtool_object ()
1873{
1874 write_libobj=${1}
1875 if test "$build_libtool_libs" = yes; then
1876 write_lobj=\'${2}\'
1877 else
1878 write_lobj=none
1879 fi
1880
1881 if test "$build_old_libs" = yes; then
1882 write_oldobj=\'${3}\'
1883 else
1884 write_oldobj=none
1885 fi
1886
1887 $opt_dry_run || {
1888 cat >${write_libobj}T <<EOF
1889# $write_libobj - a libtool object file
1890# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
1891#
1892# Please DO NOT delete this file!
1893# It is necessary for linking the library.
1894
1895# Name of the PIC object.
1896pic_object=$write_lobj
1897
1898# Name of the non-PIC object
1899non_pic_object=$write_oldobj
1900
1901EOF
1902 $MV "${write_libobj}T" "${write_libobj}"
1903 }
1904}
1905
1906
1907##################################################
1908# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
1909##################################################
1910
1911# func_convert_core_file_wine_to_w32 ARG
1912# Helper function used by file name conversion functions when $build is *nix,
1913# and $host is mingw, cygwin, or some other w32 environment. Relies on a
1914# correctly configured wine environment available, with the winepath program
1915# in $build's $PATH.
1916#
1917# ARG is the $build file name to be converted to w32 format.
1918# Result is available in $func_convert_core_file_wine_to_w32_result, and will
1919# be empty on error (or when ARG is empty)
1920func_convert_core_file_wine_to_w32 ()
1921{
1922 $opt_debug
1923 func_convert_core_file_wine_to_w32_result="$1"
1924 if test -n "$1"; then
1925 # Unfortunately, winepath does not exit with a non-zero error code, so we
1926 # are forced to check the contents of stdout. On the other hand, if the
1927 # command is not found, the shell will set an exit code of 127 and print
1928 # *an error message* to stdout. So we must check for both error code of
1929 # zero AND non-empty stdout, which explains the odd construction:
1930 func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
1931 if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
1932 func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
1933 $SED -e "$lt_sed_naive_backslashify"`
1934 else
1935 func_convert_core_file_wine_to_w32_result=
1936 fi
1937 fi
1938}
1939# end: func_convert_core_file_wine_to_w32
1940
1941
1942# func_convert_core_path_wine_to_w32 ARG
1943# Helper function used by path conversion functions when $build is *nix, and
1944# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
1945# configured wine environment available, with the winepath program in $build's
1946# $PATH. Assumes ARG has no leading or trailing path separator characters.
1947#
1948# ARG is path to be converted from $build format to win32.
1949# Result is available in $func_convert_core_path_wine_to_w32_result.
1950# Unconvertible file (directory) names in ARG are skipped; if no directory names
1951# are convertible, then the result may be empty.
1952func_convert_core_path_wine_to_w32 ()
1953{
1954 $opt_debug
1955 # unfortunately, winepath doesn't convert paths, only file names
1956 func_convert_core_path_wine_to_w32_result=""
1957 if test -n "$1"; then
1958 oldIFS=$IFS
1959 IFS=:
1960 for func_convert_core_path_wine_to_w32_f in $1; do
1961 IFS=$oldIFS
1962 func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
1963 if test -n "$func_convert_core_file_wine_to_w32_result" ; then
1964 if test -z "$func_convert_core_path_wine_to_w32_result"; then
1965 func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
1966 else
1967 func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
1968 fi
1969 fi
1970 done
1971 IFS=$oldIFS
1972 fi
1973}
1974# end: func_convert_core_path_wine_to_w32
1975
1976
1977# func_cygpath ARGS...
1978# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
1979# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
1980# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
1981# (2), returns the Cygwin file name or path in func_cygpath_result (input
1982# file name or path is assumed to be in w32 format, as previously converted
1983# from $build's *nix or MSYS format). In case (3), returns the w32 file name
1984# or path in func_cygpath_result (input file name or path is assumed to be in
1985# Cygwin format). Returns an empty string on error.
1986#
1987# ARGS are passed to cygpath, with the last one being the file name or path to
1988# be converted.
1989#
1990# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
1991# environment variable; do not put it in $PATH.
1992func_cygpath ()
1993{
1994 $opt_debug
1995 if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
1996 func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
1997 if test "$?" -ne 0; then
1998 # on failure, ensure result is empty
1999 func_cygpath_result=
2000 fi
2001 else
2002 func_cygpath_result=
2003 func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
2004 fi
2005}
2006#end: func_cygpath
2007
2008
2009# func_convert_core_msys_to_w32 ARG
2010# Convert file name or path ARG from MSYS format to w32 format. Return
2011# result in func_convert_core_msys_to_w32_result.
2012func_convert_core_msys_to_w32 ()
2013{
2014 $opt_debug
2015 # awkward: cmd appends spaces to result
2016 func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
2017 $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
2018}
2019#end: func_convert_core_msys_to_w32
2020
2021
2022# func_convert_file_check ARG1 ARG2
2023# Verify that ARG1 (a file name in $build format) was converted to $host
2024# format in ARG2. Otherwise, emit an error message, but continue (resetting
2025# func_to_host_file_result to ARG1).
2026func_convert_file_check ()
2027{
2028 $opt_debug
2029 if test -z "$2" && test -n "$1" ; then
2030 func_error "Could not determine host file name corresponding to"
2031 func_error " \`$1'"
2032 func_error "Continuing, but uninstalled executables may not work."
2033 # Fallback:
2034 func_to_host_file_result="$1"
2035 fi
2036}
2037# end func_convert_file_check
2038
2039
2040# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
2041# Verify that FROM_PATH (a path in $build format) was converted to $host
2042# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
2043# func_to_host_file_result to a simplistic fallback value (see below).
2044func_convert_path_check ()
2045{
2046 $opt_debug
2047 if test -z "$4" && test -n "$3"; then
2048 func_error "Could not determine the host path corresponding to"
2049 func_error " \`$3'"
2050 func_error "Continuing, but uninstalled executables may not work."
2051 # Fallback. This is a deliberately simplistic "conversion" and
2052 # should not be "improved". See libtool.info.
2053 if test "x$1" != "x$2"; then
2054 lt_replace_pathsep_chars="s|$1|$2|g"
2055 func_to_host_path_result=`echo "$3" |
2056 $SED -e "$lt_replace_pathsep_chars"`
2057 else
2058 func_to_host_path_result="$3"
2059 fi
2060 fi
2061}
2062# end func_convert_path_check
2063
2064
2065# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
2066# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
2067# and appending REPL if ORIG matches BACKPAT.
2068func_convert_path_front_back_pathsep ()
2069{
2070 $opt_debug
2071 case $4 in
2072 $1 ) func_to_host_path_result="$3$func_to_host_path_result"
2073 ;;
2074 esac
2075 case $4 in
2076 $2 ) func_to_host_path_result="$func_to_host_path_result$3"
2077 ;;
2078 esac
2079}
2080# end func_convert_path_front_back_pathsep
2081
2082
2083##################################################
2084# $build to $host FILE NAME CONVERSION FUNCTIONS #
2085##################################################
2086# invoked via `$to_host_file_cmd ARG'
2087#
2088# In each case, ARG is the path to be converted from $build to $host format.
2089# Result will be available in $func_to_host_file_result.
2090
2091
2092# func_to_host_file ARG
2093# Converts the file name ARG from $build format to $host format. Return result
2094# in func_to_host_file_result.
2095func_to_host_file ()
2096{
2097 $opt_debug
2098 $to_host_file_cmd "$1"
2099}
2100# end func_to_host_file
2101
2102
2103# func_to_tool_file ARG LAZY
2104# converts the file name ARG from $build format to toolchain format. Return
2105# result in func_to_tool_file_result. If the conversion in use is listed
2106# in (the comma separated) LAZY, no conversion takes place.
2107func_to_tool_file ()
2108{
2109 $opt_debug
2110 case ,$2, in
2111 *,"$to_tool_file_cmd",*)
2112 func_to_tool_file_result=$1
2113 ;;
2114 *)
2115 $to_tool_file_cmd "$1"
2116 func_to_tool_file_result=$func_to_host_file_result
2117 ;;
2118 esac
2119}
2120# end func_to_tool_file
2121
2122
2123# func_convert_file_noop ARG
2124# Copy ARG to func_to_host_file_result.
2125func_convert_file_noop ()
2126{
2127 func_to_host_file_result="$1"
2128}
2129# end func_convert_file_noop
2130
2131
2132# func_convert_file_msys_to_w32 ARG
2133# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
2134# conversion to w32 is not available inside the cwrapper. Returns result in
2135# func_to_host_file_result.
2136func_convert_file_msys_to_w32 ()
2137{
2138 $opt_debug
2139 func_to_host_file_result="$1"
2140 if test -n "$1"; then
2141 func_convert_core_msys_to_w32 "$1"
2142 func_to_host_file_result="$func_convert_core_msys_to_w32_result"
2143 fi
2144 func_convert_file_check "$1" "$func_to_host_file_result"
2145}
2146# end func_convert_file_msys_to_w32
2147
2148
2149# func_convert_file_cygwin_to_w32 ARG
2150# Convert file name ARG from Cygwin to w32 format. Returns result in
2151# func_to_host_file_result.
2152func_convert_file_cygwin_to_w32 ()
2153{
2154 $opt_debug
2155 func_to_host_file_result="$1"
2156 if test -n "$1"; then
2157 # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
2158 # LT_CYGPATH in this case.
2159 func_to_host_file_result=`cygpath -m "$1"`
2160 fi
2161 func_convert_file_check "$1" "$func_to_host_file_result"
2162}
2163# end func_convert_file_cygwin_to_w32
2164
2165
2166# func_convert_file_nix_to_w32 ARG
2167# Convert file name ARG from *nix to w32 format. Requires a wine environment
2168# and a working winepath. Returns result in func_to_host_file_result.
2169func_convert_file_nix_to_w32 ()
2170{
2171 $opt_debug
2172 func_to_host_file_result="$1"
2173 if test -n "$1"; then
2174 func_convert_core_file_wine_to_w32 "$1"
2175 func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
2176 fi
2177 func_convert_file_check "$1" "$func_to_host_file_result"
2178}
2179# end func_convert_file_nix_to_w32
2180
2181
2182# func_convert_file_msys_to_cygwin ARG
2183# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2184# Returns result in func_to_host_file_result.
2185func_convert_file_msys_to_cygwin ()
2186{
2187 $opt_debug
2188 func_to_host_file_result="$1"
2189 if test -n "$1"; then
2190 func_convert_core_msys_to_w32 "$1"
2191 func_cygpath -u "$func_convert_core_msys_to_w32_result"
2192 func_to_host_file_result="$func_cygpath_result"
2193 fi
2194 func_convert_file_check "$1" "$func_to_host_file_result"
2195}
2196# end func_convert_file_msys_to_cygwin
2197
2198
2199# func_convert_file_nix_to_cygwin ARG
2200# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
2201# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
2202# in func_to_host_file_result.
2203func_convert_file_nix_to_cygwin ()
2204{
2205 $opt_debug
2206 func_to_host_file_result="$1"
2207 if test -n "$1"; then
2208 # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
2209 func_convert_core_file_wine_to_w32 "$1"
2210 func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
2211 func_to_host_file_result="$func_cygpath_result"
2212 fi
2213 func_convert_file_check "$1" "$func_to_host_file_result"
2214}
2215# end func_convert_file_nix_to_cygwin
2216
2217
2218#############################################
2219# $build to $host PATH CONVERSION FUNCTIONS #
2220#############################################
2221# invoked via `$to_host_path_cmd ARG'
2222#
2223# In each case, ARG is the path to be converted from $build to $host format.
2224# The result will be available in $func_to_host_path_result.
2225#
2226# Path separators are also converted from $build format to $host format. If
2227# ARG begins or ends with a path separator character, it is preserved (but
2228# converted to $host format) on output.
2229#
2230# All path conversion functions are named using the following convention:
2231# file name conversion function : func_convert_file_X_to_Y ()
2232# path conversion function : func_convert_path_X_to_Y ()
2233# where, for any given $build/$host combination the 'X_to_Y' value is the
2234# same. If conversion functions are added for new $build/$host combinations,
2235# the two new functions must follow this pattern, or func_init_to_host_path_cmd
2236# will break.
2237
2238
2239# func_init_to_host_path_cmd
2240# Ensures that function "pointer" variable $to_host_path_cmd is set to the
2241# appropriate value, based on the value of $to_host_file_cmd.
2242to_host_path_cmd=
2243func_init_to_host_path_cmd ()
2244{
2245 $opt_debug
2246 if test -z "$to_host_path_cmd"; then
2247 func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
2248 to_host_path_cmd="func_convert_path_${func_stripname_result}"
2249 fi
2250}
2251
2252
2253# func_to_host_path ARG
2254# Converts the path ARG from $build format to $host format. Return result
2255# in func_to_host_path_result.
2256func_to_host_path ()
2257{
2258 $opt_debug
2259 func_init_to_host_path_cmd
2260 $to_host_path_cmd "$1"
2261}
2262# end func_to_host_path
2263
2264
2265# func_convert_path_noop ARG
2266# Copy ARG to func_to_host_path_result.
2267func_convert_path_noop ()
2268{
2269 func_to_host_path_result="$1"
2270}
2271# end func_convert_path_noop
2272
2273
2274# func_convert_path_msys_to_w32 ARG
2275# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
2276# conversion to w32 is not available inside the cwrapper. Returns result in
2277# func_to_host_path_result.
2278func_convert_path_msys_to_w32 ()
2279{
2280 $opt_debug
2281 func_to_host_path_result="$1"
2282 if test -n "$1"; then
2283 # Remove leading and trailing path separator characters from ARG. MSYS
2284 # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
2285 # and winepath ignores them completely.
2286 func_stripname : : "$1"
2287 func_to_host_path_tmp1=$func_stripname_result
2288 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2289 func_to_host_path_result="$func_convert_core_msys_to_w32_result"
2290 func_convert_path_check : ";" \
2291 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2292 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2293 fi
2294}
2295# end func_convert_path_msys_to_w32
2296
2297
2298# func_convert_path_cygwin_to_w32 ARG
2299# Convert path ARG from Cygwin to w32 format. Returns result in
2300# func_to_host_file_result.
2301func_convert_path_cygwin_to_w32 ()
2302{
2303 $opt_debug
2304 func_to_host_path_result="$1"
2305 if test -n "$1"; then
2306 # See func_convert_path_msys_to_w32:
2307 func_stripname : : "$1"
2308 func_to_host_path_tmp1=$func_stripname_result
2309 func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
2310 func_convert_path_check : ";" \
2311 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2312 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2313 fi
2314}
2315# end func_convert_path_cygwin_to_w32
2316
2317
2318# func_convert_path_nix_to_w32 ARG
2319# Convert path ARG from *nix to w32 format. Requires a wine environment and
2320# a working winepath. Returns result in func_to_host_file_result.
2321func_convert_path_nix_to_w32 ()
2322{
2323 $opt_debug
2324 func_to_host_path_result="$1"
2325 if test -n "$1"; then
2326 # See func_convert_path_msys_to_w32:
2327 func_stripname : : "$1"
2328 func_to_host_path_tmp1=$func_stripname_result
2329 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2330 func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
2331 func_convert_path_check : ";" \
2332 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2333 func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
2334 fi
2335}
2336# end func_convert_path_nix_to_w32
2337
2338
2339# func_convert_path_msys_to_cygwin ARG
2340# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
2341# Returns result in func_to_host_file_result.
2342func_convert_path_msys_to_cygwin ()
2343{
2344 $opt_debug
2345 func_to_host_path_result="$1"
2346 if test -n "$1"; then
2347 # See func_convert_path_msys_to_w32:
2348 func_stripname : : "$1"
2349 func_to_host_path_tmp1=$func_stripname_result
2350 func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
2351 func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
2352 func_to_host_path_result="$func_cygpath_result"
2353 func_convert_path_check : : \
2354 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2355 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2356 fi
2357}
2358# end func_convert_path_msys_to_cygwin
2359
2360
2361# func_convert_path_nix_to_cygwin ARG
2362# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
2363# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
2364# func_to_host_file_result.
2365func_convert_path_nix_to_cygwin ()
2366{
2367 $opt_debug
2368 func_to_host_path_result="$1"
2369 if test -n "$1"; then
2370 # Remove leading and trailing path separator characters from
2371 # ARG. msys behavior is inconsistent here, cygpath turns them
2372 # into '.;' and ';.', and winepath ignores them completely.
2373 func_stripname : : "$1"
2374 func_to_host_path_tmp1=$func_stripname_result
2375 func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
2376 func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
2377 func_to_host_path_result="$func_cygpath_result"
2378 func_convert_path_check : : \
2379 "$func_to_host_path_tmp1" "$func_to_host_path_result"
2380 func_convert_path_front_back_pathsep ":*" "*:" : "$1"
2381 fi
2382}
2383# end func_convert_path_nix_to_cygwin
2384
2385
2386# func_mode_compile arg...
2387func_mode_compile ()
2388{
2389 $opt_debug
2390 # Get the compilation command and the source file.
2391 base_compile=
2392 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
2393 suppress_opt=yes
2394 suppress_output=
2395 arg_mode=normal
2396 libobj=
2397 later=
2398 pie_flag=
2399
2400 for arg
2401 do
2402 case $arg_mode in
2403 arg )
2404 # do not "continue". Instead, add this to base_compile
2405 lastarg="$arg"
2406 arg_mode=normal
2407 ;;
2408
2409 target )
2410 libobj="$arg"
2411 arg_mode=normal
2412 continue
2413 ;;
2414
2415 normal )
2416 # Accept any command-line options.
2417 case $arg in
2418 -o)
2419 test -n "$libobj" && \
2420 func_fatal_error "you cannot specify \`-o' more than once"
2421 arg_mode=target
2422 continue
2423 ;;
2424
2425 -pie | -fpie | -fPIE)
2426 pie_flag="$pie_flag $arg"
2427 continue
2428 ;;
2429
2430 -shared | -static | -prefer-pic | -prefer-non-pic)
2431 later="$later $arg"
2432 continue
2433 ;;
2434
2435 -no-suppress)
2436 suppress_opt=no
2437 continue
2438 ;;
2439
2440 -Xcompiler)
2441 arg_mode=arg # the next one goes into the "base_compile" arg list
2442 continue # The current "srcfile" will either be retained or
2443 ;; # replaced later. I would guess that would be a bug.
2444
2445 -Wc,*)
2446 func_stripname '-Wc,' '' "$arg"
2447 args=$func_stripname_result
2448 lastarg=
2449 save_ifs="$IFS"; IFS=','
2450 for arg in $args; do
2451 IFS="$save_ifs"
2452 func_append_quoted lastarg "$arg"
2453 done
2454 IFS="$save_ifs"
2455 func_stripname ' ' '' "$lastarg"
2456 lastarg=$func_stripname_result
2457
2458 # Add the arguments to base_compile.
2459 base_compile="$base_compile $lastarg"
2460 continue
2461 ;;
2462
2463 *)
2464 # Accept the current argument as the source file.
2465 # The previous "srcfile" becomes the current argument.
2466 #
2467 lastarg="$srcfile"
2468 srcfile="$arg"
2469 ;;
2470 esac # case $arg
2471 ;;
2472 esac # case $arg_mode
2473
2474 # Aesthetically quote the previous argument.
2475 func_append_quoted base_compile "$lastarg"
2476 done # for arg
2477
2478 case $arg_mode in
2479 arg)
2480 func_fatal_error "you must specify an argument for -Xcompile"
2481 ;;
2482 target)
2483 func_fatal_error "you must specify a target with \`-o'"
2484 ;;
2485 *)
2486 # Get the name of the library object.
2487 test -z "$libobj" && {
2488 func_basename "$srcfile"
2489 libobj="$func_basename_result"
2490 }
2491 ;;
2492 esac
2493
2494 # Recognize several different file suffixes.
2495 # If the user specifies -o file.o, it is replaced with file.lo
2496 case $libobj in
2497 *.[cCFSifmso] | \
2498 *.ada | *.adb | *.ads | *.asm | \
2499 *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
2500 *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
2501 func_xform "$libobj"
2502 libobj=$func_xform_result
2503 ;;
2504 esac
2505
2506 case $libobj in
2507 *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
2508 *)
2509 func_fatal_error "cannot determine name of library object from \`$libobj'"
2510 ;;
2511 esac
2512
2513 func_infer_tag $base_compile
2514
2515 for arg in $later; do
2516 case $arg in
2517 -shared)
2518 test "$build_libtool_libs" != yes && \
2519 func_fatal_configuration "can not build a shared library"
2520 build_old_libs=no
2521 continue
2522 ;;
2523
2524 -static)
2525 build_libtool_libs=no
2526 build_old_libs=yes
2527 continue
2528 ;;
2529
2530 -prefer-pic)
2531 pic_mode=yes
2532 continue
2533 ;;
2534
2535 -prefer-non-pic)
2536 pic_mode=no
2537 continue
2538 ;;
2539 esac
2540 done
2541
2542 func_quote_for_eval "$libobj"
2543 test "X$libobj" != "X$func_quote_for_eval_result" \
2544 && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
2545 && func_warning "libobj name \`$libobj' may not contain shell special characters."
2546 func_dirname_and_basename "$obj" "/" ""
2547 objname="$func_basename_result"
2548 xdir="$func_dirname_result"
2549 lobj=${xdir}$objdir/$objname
2550
2551 test -z "$base_compile" && \
2552 func_fatal_help "you must specify a compilation command"
2553
2554 # Delete any leftover library objects.
2555 if test "$build_old_libs" = yes; then
2556 removelist="$obj $lobj $libobj ${libobj}T"
2557 else
2558 removelist="$lobj $libobj ${libobj}T"
2559 fi
2560
2561 # On Cygwin there's no "real" PIC flag so we must build both object types
2562 case $host_os in
2563 cygwin* | mingw* | pw32* | os2* | cegcc*)
2564 pic_mode=default
2565 ;;
2566 esac
2567 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
2568 # non-PIC code in shared libraries is not supported
2569 pic_mode=default
2570 fi
2571
2572 # Calculate the filename of the output object if compiler does
2573 # not support -o with -c
2574 if test "$compiler_c_o" = no; then
2575 output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
2576 lockfile="$output_obj.lock"
2577 else
2578 output_obj=
2579 need_locks=no
2580 lockfile=
2581 fi
2582
2583 # Lock this critical section if it is needed
2584 # We use this script file to make the link, it avoids creating a new file
2585 if test "$need_locks" = yes; then
2586 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
2587 func_echo "Waiting for $lockfile to be removed"
2588 sleep 2
2589 done
2590 elif test "$need_locks" = warn; then
2591 if test -f "$lockfile"; then
2592 $ECHO "\
2593*** ERROR, $lockfile exists and contains:
2594`cat $lockfile 2>/dev/null`
2595
2596This indicates that another process is trying to use the same
2597temporary object file, and libtool could not work around it because
2598your compiler does not support \`-c' and \`-o' together. If you
2599repeat this compilation, it may succeed, by chance, but you had better
2600avoid parallel builds (make -j) in this platform, or get a better
2601compiler."
2602
2603 $opt_dry_run || $RM $removelist
2604 exit $EXIT_FAILURE
2605 fi
2606 removelist="$removelist $output_obj"
2607 $ECHO "$srcfile" > "$lockfile"
2608 fi
2609
2610 $opt_dry_run || $RM $removelist
2611 removelist="$removelist $lockfile"
2612 trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
2613
2614 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
2615 srcfile=$func_to_tool_file_result
2616 func_quote_for_eval "$srcfile"
2617 qsrcfile=$func_quote_for_eval_result
2618
2619 # Only build a PIC object if we are building libtool libraries.
2620 if test "$build_libtool_libs" = yes; then
2621 # Without this assignment, base_compile gets emptied.
2622 fbsd_hideous_sh_bug=$base_compile
2623
2624 if test "$pic_mode" != no; then
2625 command="$base_compile $qsrcfile $pic_flag"
2626 else
2627 # Don't build PIC code
2628 command="$base_compile $qsrcfile"
2629 fi
2630
2631 func_mkdir_p "$xdir$objdir"
2632
2633 if test -z "$output_obj"; then
2634 # Place PIC objects in $objdir
2635 command="$command -o $lobj"
2636 fi
2637
2638 func_show_eval_locale "$command" \
2639 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
2640
2641 if test "$need_locks" = warn &&
2642 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2643 $ECHO "\
2644*** ERROR, $lockfile contains:
2645`cat $lockfile 2>/dev/null`
2646
2647but it should contain:
2648$srcfile
2649
2650This indicates that another process is trying to use the same
2651temporary object file, and libtool could not work around it because
2652your compiler does not support \`-c' and \`-o' together. If you
2653repeat this compilation, it may succeed, by chance, but you had better
2654avoid parallel builds (make -j) in this platform, or get a better
2655compiler."
2656
2657 $opt_dry_run || $RM $removelist
2658 exit $EXIT_FAILURE
2659 fi
2660
2661 # Just move the object if needed, then go on to compile the next one
2662 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
2663 func_show_eval '$MV "$output_obj" "$lobj"' \
2664 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2665 fi
2666
2667 # Allow error messages only from the first compilation.
2668 if test "$suppress_opt" = yes; then
2669 suppress_output=' >/dev/null 2>&1'
2670 fi
2671 fi
2672
2673 # Only build a position-dependent object if we build old libraries.
2674 if test "$build_old_libs" = yes; then
2675 if test "$pic_mode" != yes; then
2676 # Don't build PIC code
2677 command="$base_compile $qsrcfile$pie_flag"
2678 else
2679 command="$base_compile $qsrcfile $pic_flag"
2680 fi
2681 if test "$compiler_c_o" = yes; then
2682 command="$command -o $obj"
2683 fi
2684
2685 # Suppress compiler output if we already did a PIC compilation.
2686 command="$command$suppress_output"
2687 func_show_eval_locale "$command" \
2688 '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
2689
2690 if test "$need_locks" = warn &&
2691 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
2692 $ECHO "\
2693*** ERROR, $lockfile contains:
2694`cat $lockfile 2>/dev/null`
2695
2696but it should contain:
2697$srcfile
2698
2699This indicates that another process is trying to use the same
2700temporary object file, and libtool could not work around it because
2701your compiler does not support \`-c' and \`-o' together. If you
2702repeat this compilation, it may succeed, by chance, but you had better
2703avoid parallel builds (make -j) in this platform, or get a better
2704compiler."
2705
2706 $opt_dry_run || $RM $removelist
2707 exit $EXIT_FAILURE
2708 fi
2709
2710 # Just move the object if needed
2711 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
2712 func_show_eval '$MV "$output_obj" "$obj"' \
2713 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
2714 fi
2715 fi
2716
2717 $opt_dry_run || {
2718 func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
2719
2720 # Unlock the critical section if it was locked
2721 if test "$need_locks" != no; then
2722 removelist=$lockfile
2723 $RM "$lockfile"
2724 fi
2725 }
2726
2727 exit $EXIT_SUCCESS
2728}
2729
2730$opt_help || {
2731 test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
2732}
2733
2734func_mode_help ()
2735{
2736 # We need to display help for each of the modes.
2737 case $opt_mode in
2738 "")
2739 # Generic help is extracted from the usage comments
2740 # at the start of this file.
2741 func_help
2742 ;;
2743
2744 clean)
2745 $ECHO \
2746"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
2747
2748Remove files from the build directory.
2749
2750RM is the name of the program to use to delete files associated with each FILE
2751(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2752to RM.
2753
2754If FILE is a libtool library, object or program, all the files associated
2755with it are deleted. Otherwise, only FILE itself is deleted using RM."
2756 ;;
2757
2758 compile)
2759 $ECHO \
2760"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
2761
2762Compile a source file into a libtool library object.
2763
2764This mode accepts the following additional options:
2765
2766 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
2767 -no-suppress do not suppress compiler output for multiple passes
2768 -prefer-pic try to build PIC objects only
2769 -prefer-non-pic try to build non-PIC objects only
2770 -shared do not build a \`.o' file suitable for static linking
2771 -static only build a \`.o' file suitable for static linking
2772 -Wc,FLAG pass FLAG directly to the compiler
2773
2774COMPILE-COMMAND is a command to be used in creating a \`standard' object file
2775from the given SOURCEFILE.
2776
2777The output file name is determined by removing the directory component from
2778SOURCEFILE, then substituting the C source code suffix \`.c' with the
2779library object suffix, \`.lo'."
2780 ;;
2781
2782 execute)
2783 $ECHO \
2784"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
2785
2786Automatically set library path, then run a program.
2787
2788This mode accepts the following additional options:
2789
2790 -dlopen FILE add the directory containing FILE to the library path
2791
2792This mode sets the library path environment variable according to \`-dlopen'
2793flags.
2794
2795If any of the ARGS are libtool executable wrappers, then they are translated
2796into their corresponding uninstalled binary, and any of their required library
2797directories are added to the library path.
2798
2799Then, COMMAND is executed, with ARGS as arguments."
2800 ;;
2801
2802 finish)
2803 $ECHO \
2804"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
2805
2806Complete the installation of libtool libraries.
2807
2808Each LIBDIR is a directory that contains libtool libraries.
2809
2810The commands that this mode executes may require superuser privileges. Use
2811the \`--dry-run' option if you just want to see what would be executed."
2812 ;;
2813
2814 install)
2815 $ECHO \
2816"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
2817
2818Install executables or libraries.
2819
2820INSTALL-COMMAND is the installation command. The first component should be
2821either the \`install' or \`cp' program.
2822
2823The following components of INSTALL-COMMAND are treated specially:
2824
2825 -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation
2826
2827The rest of the components are interpreted as arguments to that command (only
2828BSD-compatible install options are recognized)."
2829 ;;
2830
2831 link)
2832 $ECHO \
2833"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
2834
2835Link object files or libraries together to form another library, or to
2836create an executable program.
2837
2838LINK-COMMAND is a command using the C compiler that you would use to create
2839a program from several object files.
2840
2841The following components of LINK-COMMAND are treated specially:
2842
2843 -all-static do not do any dynamic linking at all
2844 -avoid-version do not add a version suffix if possible
2845 -bindir BINDIR specify path to binaries directory (for systems where
2846 libraries must be found in the PATH setting at runtime)
2847 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
2848 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
2849 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
2850 -export-symbols SYMFILE
2851 try to export only the symbols listed in SYMFILE
2852 -export-symbols-regex REGEX
2853 try to export only the symbols matching REGEX
2854 -LLIBDIR search LIBDIR for required installed libraries
2855 -lNAME OUTPUT-FILE requires the installed library libNAME
2856 -module build a library that can dlopened
2857 -no-fast-install disable the fast-install mode
2858 -no-install link a not-installable executable
2859 -no-undefined declare that a library does not refer to external symbols
2860 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
2861 -objectlist FILE Use a list of object files found in FILE to specify objects
2862 -precious-files-regex REGEX
2863 don't remove output files matching REGEX
2864 -release RELEASE specify package release information
2865 -rpath LIBDIR the created library will eventually be installed in LIBDIR
2866 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
2867 -shared only do dynamic linking of libtool libraries
2868 -shrext SUFFIX override the standard shared library file extension
2869 -static do not do any dynamic linking of uninstalled libtool libraries
2870 -static-libtool-libs
2871 do not do any dynamic linking of libtool libraries
2872 -version-info CURRENT[:REVISION[:AGE]]
2873 specify library version info [each variable defaults to 0]
2874 -weak LIBNAME declare that the target provides the LIBNAME interface
2875 -Wc,FLAG
2876 -Xcompiler FLAG pass linker-specific FLAG directly to the compiler
2877 -Wl,FLAG
2878 -Xlinker FLAG pass linker-specific FLAG directly to the linker
2879 -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
2880
2881All other options (arguments beginning with \`-') are ignored.
2882
2883Every other argument is treated as a filename. Files ending in \`.la' are
2884treated as uninstalled libtool libraries, other files are standard or library
2885object files.
2886
2887If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
2888only library objects (\`.lo' files) may be specified, and \`-rpath' is
2889required, except when creating a convenience library.
2890
2891If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
2892using \`ar' and \`ranlib', or on Windows using \`lib'.
2893
2894If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
2895is created, otherwise an executable program is created."
2896 ;;
2897
2898 uninstall)
2899 $ECHO \
2900"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
2901
2902Remove libraries from an installation directory.
2903
2904RM is the name of the program to use to delete files associated with each FILE
2905(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
2906to RM.
2907
2908If FILE is a libtool library, all the files associated with it are deleted.
2909Otherwise, only FILE itself is deleted using RM."
2910 ;;
2911
2912 *)
2913 func_fatal_help "invalid operation mode \`$opt_mode'"
2914 ;;
2915 esac
2916
2917 echo
2918 $ECHO "Try \`$progname --help' for more information about other modes."
2919}
2920
2921# Now that we've collected a possible --mode arg, show help if necessary
2922if $opt_help; then
2923 if test "$opt_help" = :; then
2924 func_mode_help
2925 else
2926 {
2927 func_help noexit
2928 for opt_mode in compile link execute install finish uninstall clean; do
2929 func_mode_help
2930 done
2931 } | sed -n '1p; 2,$s/^Usage:/ or: /p'
2932 {
2933 func_help noexit
2934 for opt_mode in compile link execute install finish uninstall clean; do
2935 echo
2936 func_mode_help
2937 done
2938 } |
2939 sed '1d
2940 /^When reporting/,/^Report/{
2941 H
2942 d
2943 }
2944 $x
2945 /information about other modes/d
2946 /more detailed .*MODE/d
2947 s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
2948 fi
2949 exit $?
2950fi
2951
2952
2953# func_mode_execute arg...
2954func_mode_execute ()
2955{
2956 $opt_debug
2957 # The first argument is the command name.
2958 cmd="$nonopt"
2959 test -z "$cmd" && \
2960 func_fatal_help "you must specify a COMMAND"
2961
2962 # Handle -dlopen flags immediately.
2963 for file in $opt_dlopen; do
2964 test -f "$file" \
2965 || func_fatal_help "\`$file' is not a file"
2966
2967 dir=
2968 case $file in
2969 *.la)
2970 func_resolve_sysroot "$file"
2971 file=$func_resolve_sysroot_result
2972
2973 # Check to see that this really is a libtool archive.
2974 func_lalib_unsafe_p "$file" \
2975 || func_fatal_help "\`$lib' is not a valid libtool archive"
2976
2977 # Read the libtool library.
2978 dlname=
2979 library_names=
2980 func_source "$file"
2981
2982 # Skip this library if it cannot be dlopened.
2983 if test -z "$dlname"; then
2984 # Warn if it was a shared library.
2985 test -n "$library_names" && \
2986 func_warning "\`$file' was not linked with \`-export-dynamic'"
2987 continue
2988 fi
2989
2990 func_dirname "$file" "" "."
2991 dir="$func_dirname_result"
2992
2993 if test -f "$dir/$objdir/$dlname"; then
2994 dir="$dir/$objdir"
2995 else
2996 if test ! -f "$dir/$dlname"; then
2997 func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
2998 fi
2999 fi
3000 ;;
3001
3002 *.lo)
3003 # Just add the directory containing the .lo file.
3004 func_dirname "$file" "" "."
3005 dir="$func_dirname_result"
3006 ;;
3007
3008 *)
3009 func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
3010 continue
3011 ;;
3012 esac
3013
3014 # Get the absolute pathname.
3015 absdir=`cd "$dir" && pwd`
3016 test -n "$absdir" && dir="$absdir"
3017
3018 # Now add the directory to shlibpath_var.
3019 if eval "test -z \"\$$shlibpath_var\""; then
3020 eval "$shlibpath_var=\"\$dir\""
3021 else
3022 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
3023 fi
3024 done
3025
3026 # This variable tells wrapper scripts just to set shlibpath_var
3027 # rather than running their programs.
3028 libtool_execute_magic="$magic"
3029
3030 # Check if any of the arguments is a wrapper script.
3031 args=
3032 for file
3033 do
3034 case $file in
3035 -* | *.la | *.lo ) ;;
3036 *)
3037 # Do a test to see if this is really a libtool program.
3038 if func_ltwrapper_script_p "$file"; then
3039 func_source "$file"
3040 # Transform arg to wrapped name.
3041 file="$progdir/$program"
3042 elif func_ltwrapper_executable_p "$file"; then
3043 func_ltwrapper_scriptname "$file"
3044 func_source "$func_ltwrapper_scriptname_result"
3045 # Transform arg to wrapped name.
3046 file="$progdir/$program"
3047 fi
3048 ;;
3049 esac
3050 # Quote arguments (to preserve shell metacharacters).
3051 func_append_quoted args "$file"
3052 done
3053
3054 if test "X$opt_dry_run" = Xfalse; then
3055 if test -n "$shlibpath_var"; then
3056 # Export the shlibpath_var.
3057 eval "export $shlibpath_var"
3058 fi
3059
3060 # Restore saved environment variables
3061 for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
3062 do
3063 eval "if test \"\${save_$lt_var+set}\" = set; then
3064 $lt_var=\$save_$lt_var; export $lt_var
3065 else
3066 $lt_unset $lt_var
3067 fi"
3068 done
3069
3070 # Now prepare to actually exec the command.
3071 exec_cmd="\$cmd$args"
3072 else
3073 # Display what would be done.
3074 if test -n "$shlibpath_var"; then
3075 eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
3076 echo "export $shlibpath_var"
3077 fi
3078 $ECHO "$cmd$args"
3079 exit $EXIT_SUCCESS
3080 fi
3081}
3082
3083test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
3084
3085
3086# func_mode_finish arg...
3087func_mode_finish ()
3088{
3089 $opt_debug
3090 libs=
3091 libdirs=
3092 admincmds=
3093
3094 for opt in "$nonopt" ${1+"$@"}
3095 do
3096 if test -d "$opt"; then
3097 libdirs="$libdirs $opt"
3098
3099 elif test -f "$opt"; then
3100 if func_lalib_unsafe_p "$opt"; then
3101 libs="$libs $opt"
3102 else
3103 func_warning "\`$opt' is not a valid libtool archive"
3104 fi
3105
3106 else
3107 func_fatal_error "invalid argument \`$opt'"
3108 fi
3109 done
3110
3111 if test -n "$libs"; then
3112 if test -n "$lt_sysroot"; then
3113 sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
3114 sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
3115 else
3116 sysroot_cmd=
3117 fi
3118
3119 # Remove sysroot references
3120 if $opt_dry_run; then
3121 for lib in $libs; do
3122 echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
3123 done
3124 else
3125 tmpdir=`func_mktempdir`
3126 for lib in $libs; do
3127 sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
3128 > $tmpdir/tmp-la
3129 mv -f $tmpdir/tmp-la $lib
3130 done
3131 ${RM}r "$tmpdir"
3132 fi
3133 fi
3134
3135 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3136 for libdir in $libdirs; do
3137 if test -n "$finish_cmds"; then
3138 # Do each command in the finish commands.
3139 func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
3140'"$cmd"'"'
3141 fi
3142 if test -n "$finish_eval"; then
3143 # Do the single finish_eval.
3144 eval cmds=\"$finish_eval\"
3145 $opt_dry_run || eval "$cmds" || admincmds="$admincmds
3146 $cmds"
3147 fi
3148 done
3149 fi
3150
3151 # Exit here if they wanted silent mode.
3152 $opt_silent && exit $EXIT_SUCCESS
3153
3154 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
3155 echo "----------------------------------------------------------------------"
3156 echo "Libraries have been installed in:"
3157 for libdir in $libdirs; do
3158 $ECHO " $libdir"
3159 done
3160 echo
3161 echo "If you ever happen to want to link against installed libraries"
3162 echo "in a given directory, LIBDIR, you must either use libtool, and"
3163 echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
3164 echo "flag during linking and do at least one of the following:"
3165 if test -n "$shlibpath_var"; then
3166 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
3167 echo " during execution"
3168 fi
3169 if test -n "$runpath_var"; then
3170 echo " - add LIBDIR to the \`$runpath_var' environment variable"
3171 echo " during linking"
3172 fi
3173 if test -n "$hardcode_libdir_flag_spec"; then
3174 libdir=LIBDIR
3175 eval flag=\"$hardcode_libdir_flag_spec\"
3176
3177 $ECHO " - use the \`$flag' linker flag"
3178 fi
3179 if test -n "$admincmds"; then
3180 $ECHO " - have your system administrator run these commands:$admincmds"
3181 fi
3182 if test -f /etc/ld.so.conf; then
3183 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
3184 fi
3185 echo
3186
3187 echo "See any operating system documentation about shared libraries for"
3188 case $host in
3189 solaris2.[6789]|solaris2.1[0-9])
3190 echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
3191 echo "pages."
3192 ;;
3193 *)
3194 echo "more information, such as the ld(1) and ld.so(8) manual pages."
3195 ;;
3196 esac
3197 echo "----------------------------------------------------------------------"
3198 fi
3199 exit $EXIT_SUCCESS
3200}
3201
3202test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
3203
3204
3205# func_mode_install arg...
3206func_mode_install ()
3207{
3208 $opt_debug
3209 # There may be an optional sh(1) argument at the beginning of
3210 # install_prog (especially on Windows NT).
3211 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
3212 # Allow the use of GNU shtool's install command.
3213 case $nonopt in *shtool*) :;; *) false;; esac; then
3214 # Aesthetically quote it.
3215 func_quote_for_eval "$nonopt"
3216 install_prog="$func_quote_for_eval_result "
3217 arg=$1
3218 shift
3219 else
3220 install_prog=
3221 arg=$nonopt
3222 fi
3223
3224 # The real first argument should be the name of the installation program.
3225 # Aesthetically quote it.
3226 func_quote_for_eval "$arg"
3227 install_prog="$install_prog$func_quote_for_eval_result"
3228 install_shared_prog=$install_prog
3229 case " $install_prog " in
3230 *[\\\ /]cp\ *) install_cp=: ;;
3231 *) install_cp=false ;;
3232 esac
3233
3234 # We need to accept at least all the BSD install flags.
3235 dest=
3236 files=
3237 opts=
3238 prev=
3239 install_type=
3240 isdir=no
3241 stripme=
3242 no_mode=:
3243 for arg
3244 do
3245 arg2=
3246 if test -n "$dest"; then
3247 files="$files $dest"
3248 dest=$arg
3249 continue
3250 fi
3251
3252 case $arg in
3253 -d) isdir=yes ;;
3254 -f)
3255 if $install_cp; then :; else
3256 prev=$arg
3257 fi
3258 ;;
3259 -g | -m | -o)
3260 prev=$arg
3261 ;;
3262 -s)
3263 stripme=" -s"
3264 continue
3265 ;;
3266 -*)
3267 ;;
3268 *)
3269 # If the previous option needed an argument, then skip it.
3270 if test -n "$prev"; then
3271 if test "x$prev" = x-m && test -n "$install_override_mode"; then
3272 arg2=$install_override_mode
3273 no_mode=false
3274 fi
3275 prev=
3276 else
3277 dest=$arg
3278 continue
3279 fi
3280 ;;
3281 esac
3282
3283 # Aesthetically quote the argument.
3284 func_quote_for_eval "$arg"
3285 install_prog="$install_prog $func_quote_for_eval_result"
3286 if test -n "$arg2"; then
3287 func_quote_for_eval "$arg2"
3288 fi
3289 install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
3290 done
3291
3292 test -z "$install_prog" && \
3293 func_fatal_help "you must specify an install program"
3294
3295 test -n "$prev" && \
3296 func_fatal_help "the \`$prev' option requires an argument"
3297
3298 if test -n "$install_override_mode" && $no_mode; then
3299 if $install_cp; then :; else
3300 func_quote_for_eval "$install_override_mode"
3301 install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
3302 fi
3303 fi
3304
3305 if test -z "$files"; then
3306 if test -z "$dest"; then
3307 func_fatal_help "no file or destination specified"
3308 else
3309 func_fatal_help "you must specify a destination"
3310 fi
3311 fi
3312
3313 # Strip any trailing slash from the destination.
3314 func_stripname '' '/' "$dest"
3315 dest=$func_stripname_result
3316
3317 # Check to see that the destination is a directory.
3318 test -d "$dest" && isdir=yes
3319 if test "$isdir" = yes; then
3320 destdir="$dest"
3321 destname=
3322 else
3323 func_dirname_and_basename "$dest" "" "."
3324 destdir="$func_dirname_result"
3325 destname="$func_basename_result"
3326
3327 # Not a directory, so check to see that there is only one file specified.
3328 set dummy $files; shift
3329 test "$#" -gt 1 && \
3330 func_fatal_help "\`$dest' is not a directory"
3331 fi
3332 case $destdir in
3333 [\\/]* | [A-Za-z]:[\\/]*) ;;
3334 *)
3335 for file in $files; do
3336 case $file in
3337 *.lo) ;;
3338 *)
3339 func_fatal_help "\`$destdir' must be an absolute directory name"
3340 ;;
3341 esac
3342 done
3343 ;;
3344 esac
3345
3346 # This variable tells wrapper scripts just to set variables rather
3347 # than running their programs.
3348 libtool_install_magic="$magic"
3349
3350 staticlibs=
3351 future_libdirs=
3352 current_libdirs=
3353 for file in $files; do
3354
3355 # Do each installation.
3356 case $file in
3357 *.$libext)
3358 # Do the static libraries later.
3359 staticlibs="$staticlibs $file"
3360 ;;
3361
3362 *.la)
3363 func_resolve_sysroot "$file"
3364 file=$func_resolve_sysroot_result
3365
3366 # Check to see that this really is a libtool archive.
3367 func_lalib_unsafe_p "$file" \
3368 || func_fatal_help "\`$file' is not a valid libtool archive"
3369
3370 library_names=
3371 old_library=
3372 relink_command=
3373 func_source "$file"
3374
3375 # Add the libdir to current_libdirs if it is the destination.
3376 if test "X$destdir" = "X$libdir"; then
3377 case "$current_libdirs " in
3378 *" $libdir "*) ;;
3379 *) current_libdirs="$current_libdirs $libdir" ;;
3380 esac
3381 else
3382 # Note the libdir as a future libdir.
3383 case "$future_libdirs " in
3384 *" $libdir "*) ;;
3385 *) future_libdirs="$future_libdirs $libdir" ;;
3386 esac
3387 fi
3388
3389 func_dirname "$file" "/" ""
3390 dir="$func_dirname_result"
3391 dir="$dir$objdir"
3392
3393 if test -n "$relink_command"; then
3394 # Determine the prefix the user has applied to our future dir.
3395 inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
3396
3397 # Don't allow the user to place us outside of our expected
3398 # location b/c this prevents finding dependent libraries that
3399 # are installed to the same prefix.
3400 # At present, this check doesn't affect windows .dll's that
3401 # are installed into $libdir/../bin (currently, that works fine)
3402 # but it's something to keep an eye on.
3403 test "$inst_prefix_dir" = "$destdir" && \
3404 func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
3405
3406 if test -n "$inst_prefix_dir"; then
3407 # Stick the inst_prefix_dir data into the link command.
3408 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
3409 else
3410 relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
3411 fi
3412
3413 func_warning "relinking \`$file'"
3414 func_show_eval "$relink_command" \
3415 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
3416 fi
3417
3418 # See the names of the shared library.
3419 set dummy $library_names; shift
3420 if test -n "$1"; then
3421 realname="$1"
3422 shift
3423
3424 srcname="$realname"
3425 test -n "$relink_command" && srcname="$realname"T
3426
3427 # Install the shared library and build the symlinks.
3428 func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
3429 'exit $?'
3430 tstripme="$stripme"
3431 case $host_os in
3432 cygwin* | mingw* | pw32* | cegcc*)
3433 case $realname in
3434 *.dll.a)
3435 tstripme=""
3436 ;;
3437 esac
3438 ;;
3439 esac
3440 if test -n "$tstripme" && test -n "$striplib"; then
3441 func_show_eval "$striplib $destdir/$realname" 'exit $?'
3442 fi
3443
3444 if test "$#" -gt 0; then
3445 # Delete the old symlinks, and create new ones.
3446 # Try `ln -sf' first, because the `ln' binary might depend on
3447 # the symlink we replace! Solaris /bin/ln does not understand -f,
3448 # so we also need to try rm && ln -s.
3449 for linkname
3450 do
3451 test "$linkname" != "$realname" \
3452 && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
3453 done
3454 fi
3455
3456 # Do each command in the postinstall commands.
3457 lib="$destdir/$realname"
3458 func_execute_cmds "$postinstall_cmds" 'exit $?'
3459 fi
3460
3461 # Install the pseudo-library for information purposes.
3462 func_basename "$file"
3463 name="$func_basename_result"
3464 instname="$dir/$name"i
3465 func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
3466
3467 # Maybe install the static library, too.
3468 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
3469 ;;
3470
3471 *.lo)
3472 # Install (i.e. copy) a libtool object.
3473
3474 # Figure out destination file name, if it wasn't already specified.
3475 if test -n "$destname"; then
3476 destfile="$destdir/$destname"
3477 else
3478 func_basename "$file"
3479 destfile="$func_basename_result"
3480 destfile="$destdir/$destfile"
3481 fi
3482
3483 # Deduce the name of the destination old-style object file.
3484 case $destfile in
3485 *.lo)
3486 func_lo2o "$destfile"
3487 staticdest=$func_lo2o_result
3488 ;;
3489 *.$objext)
3490 staticdest="$destfile"
3491 destfile=
3492 ;;
3493 *)
3494 func_fatal_help "cannot copy a libtool object to \`$destfile'"
3495 ;;
3496 esac
3497
3498 # Install the libtool object if requested.
3499 test -n "$destfile" && \
3500 func_show_eval "$install_prog $file $destfile" 'exit $?'
3501
3502 # Install the old object if enabled.
3503 if test "$build_old_libs" = yes; then
3504 # Deduce the name of the old-style object file.
3505 func_lo2o "$file"
3506 staticobj=$func_lo2o_result
3507 func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
3508 fi
3509 exit $EXIT_SUCCESS
3510 ;;
3511
3512 *)
3513 # Figure out destination file name, if it wasn't already specified.
3514 if test -n "$destname"; then
3515 destfile="$destdir/$destname"
3516 else
3517 func_basename "$file"
3518 destfile="$func_basename_result"
3519 destfile="$destdir/$destfile"
3520 fi
3521
3522 # If the file is missing, and there is a .exe on the end, strip it
3523 # because it is most likely a libtool script we actually want to
3524 # install
3525 stripped_ext=""
3526 case $file in
3527 *.exe)
3528 if test ! -f "$file"; then
3529 func_stripname '' '.exe' "$file"
3530 file=$func_stripname_result
3531 stripped_ext=".exe"
3532 fi
3533 ;;
3534 esac
3535
3536 # Do a test to see if this is really a libtool program.
3537 case $host in
3538 *cygwin* | *mingw*)
3539 if func_ltwrapper_executable_p "$file"; then
3540 func_ltwrapper_scriptname "$file"
3541 wrapper=$func_ltwrapper_scriptname_result
3542 else
3543 func_stripname '' '.exe' "$file"
3544 wrapper=$func_stripname_result
3545 fi
3546 ;;
3547 *)
3548 wrapper=$file
3549 ;;
3550 esac
3551 if func_ltwrapper_script_p "$wrapper"; then
3552 notinst_deplibs=
3553 relink_command=
3554
3555 func_source "$wrapper"
3556
3557 # Check the variables that should have been set.
3558 test -z "$generated_by_libtool_version" && \
3559 func_fatal_error "invalid libtool wrapper script \`$wrapper'"
3560
3561 finalize=yes
3562 for lib in $notinst_deplibs; do
3563 # Check to see that each library is installed.
3564 libdir=
3565 if test -f "$lib"; then
3566 func_source "$lib"
3567 fi
3568 libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
3569 if test -n "$libdir" && test ! -f "$libfile"; then
3570 func_warning "\`$lib' has not been installed in \`$libdir'"
3571 finalize=no
3572 fi
3573 done
3574
3575 relink_command=
3576 func_source "$wrapper"
3577
3578 outputname=
3579 if test "$fast_install" = no && test -n "$relink_command"; then
3580 $opt_dry_run || {
3581 if test "$finalize" = yes; then
3582 tmpdir=`func_mktempdir`
3583 func_basename "$file$stripped_ext"
3584 file="$func_basename_result"
3585 outputname="$tmpdir/$file"
3586 # Replace the output file specification.
3587 relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
3588
3589 $opt_silent || {
3590 func_quote_for_expand "$relink_command"
3591 eval "func_echo $func_quote_for_expand_result"
3592 }
3593 if eval "$relink_command"; then :
3594 else
3595 func_error "error: relink \`$file' with the above command before installing it"
3596 $opt_dry_run || ${RM}r "$tmpdir"
3597 continue
3598 fi
3599 file="$outputname"
3600 else
3601 func_warning "cannot relink \`$file'"
3602 fi
3603 }
3604 else
3605 # Install the binary that we compiled earlier.
3606 file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
3607 fi
3608 fi
3609
3610 # remove .exe since cygwin /usr/bin/install will append another
3611 # one anyway
3612 case $install_prog,$host in
3613 */usr/bin/install*,*cygwin*)
3614 case $file:$destfile in
3615 *.exe:*.exe)
3616 # this is ok
3617 ;;
3618 *.exe:*)
3619 destfile=$destfile.exe
3620 ;;
3621 *:*.exe)
3622 func_stripname '' '.exe' "$destfile"
3623 destfile=$func_stripname_result
3624 ;;
3625 esac
3626 ;;
3627 esac
3628 func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
3629 $opt_dry_run || if test -n "$outputname"; then
3630 ${RM}r "$tmpdir"
3631 fi
3632 ;;
3633 esac
3634 done
3635
3636 for file in $staticlibs; do
3637 func_basename "$file"
3638 name="$func_basename_result"
3639
3640 # Set up the ranlib parameters.
3641 oldlib="$destdir/$name"
3642 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
3643 tool_oldlib=$func_to_tool_file_result
3644
3645 func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
3646
3647 if test -n "$stripme" && test -n "$old_striplib"; then
3648 func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
3649 fi
3650
3651 # Do each command in the postinstall commands.
3652 func_execute_cmds "$old_postinstall_cmds" 'exit $?'
3653 done
3654
3655 test -n "$future_libdirs" && \
3656 func_warning "remember to run \`$progname --finish$future_libdirs'"
3657
3658 if test -n "$current_libdirs"; then
3659 # Maybe just do a dry run.
3660 $opt_dry_run && current_libdirs=" -n$current_libdirs"
3661 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
3662 else
3663 exit $EXIT_SUCCESS
3664 fi
3665}
3666
3667test "$opt_mode" = install && func_mode_install ${1+"$@"}
3668
3669
3670# func_generate_dlsyms outputname originator pic_p
3671# Extract symbols from dlprefiles and create ${outputname}S.o with
3672# a dlpreopen symbol table.
3673func_generate_dlsyms ()
3674{
3675 $opt_debug
3676 my_outputname="$1"
3677 my_originator="$2"
3678 my_pic_p="${3-no}"
3679 my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
3680 my_dlsyms=
3681
3682 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
3683 if test -n "$NM" && test -n "$global_symbol_pipe"; then
3684 my_dlsyms="${my_outputname}S.c"
3685 else
3686 func_error "not configured to extract global symbols from dlpreopened files"
3687 fi
3688 fi
3689
3690 if test -n "$my_dlsyms"; then
3691 case $my_dlsyms in
3692 "") ;;
3693 *.c)
3694 # Discover the nlist of each of the dlfiles.
3695 nlist="$output_objdir/${my_outputname}.nm"
3696
3697 func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
3698
3699 # Parse the name list into a source file.
3700 func_verbose "creating $output_objdir/$my_dlsyms"
3701
3702 $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
3703/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
3704/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
3705
3706#ifdef __cplusplus
3707extern \"C\" {
3708#endif
3709
3710#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
3711#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
3712#endif
3713
3714/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
3715#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3716/* DATA imports from DLLs on WIN32 con't be const, because runtime
3717 relocations are performed -- see ld's documentation on pseudo-relocs. */
3718# define LT_DLSYM_CONST
3719#elif defined(__osf__)
3720/* This system does not cope well with relocations in const data. */
3721# define LT_DLSYM_CONST
3722#else
3723# define LT_DLSYM_CONST const
3724#endif
3725
3726/* External symbol declarations for the compiler. */\
3727"
3728
3729 if test "$dlself" = yes; then
3730 func_verbose "generating symbol list for \`$output'"
3731
3732 $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
3733
3734 # Add our own program objects to the symbol list.
3735 progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
3736 for progfile in $progfiles; do
3737 func_to_tool_file "$progfile" func_convert_file_msys_to_w32
3738 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
3739 $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
3740 done
3741
3742 if test -n "$exclude_expsyms"; then
3743 $opt_dry_run || {
3744 eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
3745 eval '$MV "$nlist"T "$nlist"'
3746 }
3747 fi
3748
3749 if test -n "$export_symbols_regex"; then
3750 $opt_dry_run || {
3751 eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
3752 eval '$MV "$nlist"T "$nlist"'
3753 }
3754 fi
3755
3756 # Prepare the list of exported symbols
3757 if test -z "$export_symbols"; then
3758 export_symbols="$output_objdir/$outputname.exp"
3759 $opt_dry_run || {
3760 $RM $export_symbols
3761 eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
3762 case $host in
3763 *cygwin* | *mingw* | *cegcc* )
3764 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3765 eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
3766 ;;
3767 esac
3768 }
3769 else
3770 $opt_dry_run || {
3771 eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
3772 eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
3773 eval '$MV "$nlist"T "$nlist"'
3774 case $host in
3775 *cygwin* | *mingw* | *cegcc* )
3776 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
3777 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
3778 ;;
3779 esac
3780 }
3781 fi
3782 fi
3783
3784 for dlprefile in $dlprefiles; do
3785 func_verbose "extracting global C symbols from \`$dlprefile'"
3786 func_basename "$dlprefile"
3787 name="$func_basename_result"
3788 case $host in
3789 *cygwin* | *mingw* | *cegcc* )
3790 # if an import library, we need to obtain dlname
3791 if func_win32_import_lib_p "$dlprefile"; then
3792 func_tr_sh "$dlprefile"
3793 eval "curr_lafile=\$libfile_$func_tr_sh_result"
3794 dlprefile_dlbasename=""
3795 if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
3796 # Use subshell, to avoid clobbering current variable values
3797 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
3798 if test -n "$dlprefile_dlname" ; then
3799 func_basename "$dlprefile_dlname"
3800 dlprefile_dlbasename="$func_basename_result"
3801 else
3802 # no lafile. user explicitly requested -dlpreopen <import library>.
3803 $sharedlib_from_linklib_cmd "$dlprefile"
3804 dlprefile_dlbasename=$sharedlib_from_linklib_result
3805 fi
3806 fi
3807 $opt_dry_run || {
3808 if test -n "$dlprefile_dlbasename" ; then
3809 eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
3810 else
3811 func_warning "Could not compute DLL name from $name"
3812 eval '$ECHO ": $name " >> "$nlist"'
3813 fi
3814 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3815 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
3816 $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
3817 }
3818 else # not an import lib
3819 $opt_dry_run || {
3820 eval '$ECHO ": $name " >> "$nlist"'
3821 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3822 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3823 }
3824 fi
3825 ;;
3826 *)
3827 $opt_dry_run || {
3828 eval '$ECHO ": $name " >> "$nlist"'
3829 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
3830 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
3831 }
3832 ;;
3833 esac
3834 done
3835
3836 $opt_dry_run || {
3837 # Make sure we have at least an empty file.
3838 test -f "$nlist" || : > "$nlist"
3839
3840 if test -n "$exclude_expsyms"; then
3841 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
3842 $MV "$nlist"T "$nlist"
3843 fi
3844
3845 # Try sorting and uniquifying the output.
3846 if $GREP -v "^: " < "$nlist" |
3847 if sort -k 3 </dev/null >/dev/null 2>&1; then
3848 sort -k 3
3849 else
3850 sort +2
3851 fi |
3852 uniq > "$nlist"S; then
3853 :
3854 else
3855 $GREP -v "^: " < "$nlist" > "$nlist"S
3856 fi
3857
3858 if test -f "$nlist"S; then
3859 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
3860 else
3861 echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
3862 fi
3863
3864 echo >> "$output_objdir/$my_dlsyms" "\
3865
3866/* The mapping between symbol names and symbols. */
3867typedef struct {
3868 const char *name;
3869 void *address;
3870} lt_dlsymlist;
3871extern LT_DLSYM_CONST lt_dlsymlist
3872lt_${my_prefix}_LTX_preloaded_symbols[];
3873LT_DLSYM_CONST lt_dlsymlist
3874lt_${my_prefix}_LTX_preloaded_symbols[] =
3875{\
3876 { \"$my_originator\", (void *) 0 },"
3877
3878 case $need_lib_prefix in
3879 no)
3880 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
3881 ;;
3882 *)
3883 eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
3884 ;;
3885 esac
3886 echo >> "$output_objdir/$my_dlsyms" "\
3887 {0, (void *) 0}
3888};
3889
3890/* This works around a problem in FreeBSD linker */
3891#ifdef FREEBSD_WORKAROUND
3892static const void *lt_preloaded_setup() {
3893 return lt_${my_prefix}_LTX_preloaded_symbols;
3894}
3895#endif
3896
3897#ifdef __cplusplus
3898}
3899#endif\
3900"
3901 } # !$opt_dry_run
3902
3903 pic_flag_for_symtable=
3904 case "$compile_command " in
3905 *" -static "*) ;;
3906 *)
3907 case $host in
3908 # compiling the symbol table file with pic_flag works around
3909 # a FreeBSD bug that causes programs to crash when -lm is
3910 # linked before any other PIC object. But we must not use
3911 # pic_flag when linking with -static. The problem exists in
3912 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
3913 *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
3914 pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
3915 *-*-hpux*)
3916 pic_flag_for_symtable=" $pic_flag" ;;
3917 *)
3918 if test "X$my_pic_p" != Xno; then
3919 pic_flag_for_symtable=" $pic_flag"
3920 fi
3921 ;;
3922 esac
3923 ;;
3924 esac
3925 symtab_cflags=
3926 for arg in $LTCFLAGS; do
3927 case $arg in
3928 -pie | -fpie | -fPIE) ;;
3929 *) symtab_cflags="$symtab_cflags $arg" ;;
3930 esac
3931 done
3932
3933 # Now compile the dynamic symbol file.
3934 func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
3935
3936 # Clean up the generated files.
3937 func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
3938
3939 # Transform the symbol file into the correct name.
3940 symfileobj="$output_objdir/${my_outputname}S.$objext"
3941 case $host in
3942 *cygwin* | *mingw* | *cegcc* )
3943 if test -f "$output_objdir/$my_outputname.def"; then
3944 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3945 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
3946 else
3947 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3948 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3949 fi
3950 ;;
3951 *)
3952 compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3953 finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
3954 ;;
3955 esac
3956 ;;
3957 *)
3958 func_fatal_error "unknown suffix for \`$my_dlsyms'"
3959 ;;
3960 esac
3961 else
3962 # We keep going just in case the user didn't refer to
3963 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
3964 # really was required.
3965
3966 # Nullify the symbol file.
3967 compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
3968 finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
3969 fi
3970}
3971
3972# func_win32_libid arg
3973# return the library type of file 'arg'
3974#
3975# Need a lot of goo to handle *both* DLLs and import libs
3976# Has to be a shell function in order to 'eat' the argument
3977# that is supplied when $file_magic_command is called.
3978# Despite the name, also deal with 64 bit binaries.
3979func_win32_libid ()
3980{
3981 $opt_debug
3982 win32_libid_type="unknown"
3983 win32_fileres=`file -L $1 2>/dev/null`
3984 case $win32_fileres in
3985 *ar\ archive\ import\ library*) # definitely import
3986 win32_libid_type="x86 archive import"
3987 ;;
3988 *ar\ archive*) # could be an import, or static
3989 # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
3990 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
3991 $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
3992 func_to_tool_file "$1" func_convert_file_msys_to_w32
3993 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
3994 $SED -n -e '
3995 1,100{
3996 / I /{
3997 s,.*,import,
3998 p
3999 q
4000 }
4001 }'`
4002 case $win32_nmres in
4003 import*) win32_libid_type="x86 archive import";;
4004 *) win32_libid_type="x86 archive static";;
4005 esac
4006 fi
4007 ;;
4008 *DLL*)
4009 win32_libid_type="x86 DLL"
4010 ;;
4011 *executable*) # but shell scripts are "executable" too...
4012 case $win32_fileres in
4013 *MS\ Windows\ PE\ Intel*)
4014 win32_libid_type="x86 DLL"
4015 ;;
4016 esac
4017 ;;
4018 esac
4019 $ECHO "$win32_libid_type"
4020}
4021
4022# func_cygming_dll_for_implib ARG
4023#
4024# Platform-specific function to extract the
4025# name of the DLL associated with the specified
4026# import library ARG.
4027# Invoked by eval'ing the libtool variable
4028# $sharedlib_from_linklib_cmd
4029# Result is available in the variable
4030# $sharedlib_from_linklib_result
4031func_cygming_dll_for_implib ()
4032{
4033 $opt_debug
4034 sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
4035}
4036
4037# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
4038#
4039# The is the core of a fallback implementation of a
4040# platform-specific function to extract the name of the
4041# DLL associated with the specified import library LIBNAME.
4042#
4043# SECTION_NAME is either .idata$6 or .idata$7, depending
4044# on the platform and compiler that created the implib.
4045#
4046# Echos the name of the DLL associated with the
4047# specified import library.
4048func_cygming_dll_for_implib_fallback_core ()
4049{
4050 $opt_debug
4051 match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
4052 $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
4053 $SED '/^Contents of section '"$match_literal"':/{
4054 # Place marker at beginning of archive member dllname section
4055 s/.*/====MARK====/
4056 p
4057 d
4058 }
4059 # These lines can sometimes be longer than 43 characters, but
4060 # are always uninteresting
4061 /:[ ]*file format pe[i]\{,1\}-/d
4062 /^In archive [^:]*:/d
4063 # Ensure marker is printed
4064 /^====MARK====/p
4065 # Remove all lines with less than 43 characters
4066 /^.\{43\}/!d
4067 # From remaining lines, remove first 43 characters
4068 s/^.\{43\}//' |
4069 $SED -n '
4070 # Join marker and all lines until next marker into a single line
4071 /^====MARK====/ b para
4072 H
4073 $ b para
4074 b
4075 :para
4076 x
4077 s/\n//g
4078 # Remove the marker
4079 s/^====MARK====//
4080 # Remove trailing dots and whitespace
4081 s/[\. \t]*$//
4082 # Print
4083 /./p' |
4084 # we now have a list, one entry per line, of the stringified
4085 # contents of the appropriate section of all members of the
4086 # archive which possess that section. Heuristic: eliminate
4087 # all those which have a first or second character that is
4088 # a '.' (that is, objdump's representation of an unprintable
4089 # character.) This should work for all archives with less than
4090 # 0x302f exports -- but will fail for DLLs whose name actually
4091 # begins with a literal '.' or a single character followed by
4092 # a '.'.
4093 #
4094 # Of those that remain, print the first one.
4095 $SED -e '/^\./d;/^.\./d;q'
4096}
4097
4098# func_cygming_gnu_implib_p ARG
4099# This predicate returns with zero status (TRUE) if
4100# ARG is a GNU/binutils-style import library. Returns
4101# with nonzero status (FALSE) otherwise.
4102func_cygming_gnu_implib_p ()
4103{
4104 $opt_debug
4105 func_to_tool_file "$1" func_convert_file_msys_to_w32
4106 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)$'`
4107 test -n "$func_cygming_gnu_implib_tmp"
4108}
4109
4110# func_cygming_ms_implib_p ARG
4111# This predicate returns with zero status (TRUE) if
4112# ARG is an MS-style import library. Returns
4113# with nonzero status (FALSE) otherwise.
4114func_cygming_ms_implib_p ()
4115{
4116 $opt_debug
4117 func_to_tool_file "$1" func_convert_file_msys_to_w32
4118 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
4119 test -n "$func_cygming_ms_implib_tmp"
4120}
4121
4122# func_cygming_dll_for_implib_fallback ARG
4123# Platform-specific function to extract the
4124# name of the DLL associated with the specified
4125# import library ARG.
4126#
4127# This fallback implementation is for use when $DLLTOOL
4128# does not support the --identify-strict option.
4129# Invoked by eval'ing the libtool variable
4130# $sharedlib_from_linklib_cmd
4131# Result is available in the variable
4132# $sharedlib_from_linklib_result
4133func_cygming_dll_for_implib_fallback ()
4134{
4135 $opt_debug
4136 if func_cygming_gnu_implib_p "$1" ; then
4137 # binutils import library
4138 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
4139 elif func_cygming_ms_implib_p "$1" ; then
4140 # ms-generated import library
4141 sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
4142 else
4143 # unknown
4144 sharedlib_from_linklib_result=""
4145 fi
4146}
4147
4148
4149# func_extract_an_archive dir oldlib
4150func_extract_an_archive ()
4151{
4152 $opt_debug
4153 f_ex_an_ar_dir="$1"; shift
4154 f_ex_an_ar_oldlib="$1"
4155 if test "$lock_old_archive_extraction" = yes; then
4156 lockfile=$f_ex_an_ar_oldlib.lock
4157 until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
4158 func_echo "Waiting for $lockfile to be removed"
4159 sleep 2
4160 done
4161 fi
4162 func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
4163 'stat=$?; rm -f "$lockfile"; exit $stat'
4164 if test "$lock_old_archive_extraction" = yes; then
4165 $opt_dry_run || rm -f "$lockfile"
4166 fi
4167 if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
4168 :
4169 else
4170 func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
4171 fi
4172}
4173
4174
4175# func_extract_archives gentop oldlib ...
4176func_extract_archives ()
4177{
4178 $opt_debug
4179 my_gentop="$1"; shift
4180 my_oldlibs=${1+"$@"}
4181 my_oldobjs=""
4182 my_xlib=""
4183 my_xabs=""
4184 my_xdir=""
4185
4186 for my_xlib in $my_oldlibs; do
4187 # Extract the objects.
4188 case $my_xlib in
4189 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
4190 *) my_xabs=`pwd`"/$my_xlib" ;;
4191 esac
4192 func_basename "$my_xlib"
4193 my_xlib="$func_basename_result"
4194 my_xlib_u=$my_xlib
4195 while :; do
4196 case " $extracted_archives " in
4197 *" $my_xlib_u "*)
4198 func_arith $extracted_serial + 1
4199 extracted_serial=$func_arith_result
4200 my_xlib_u=lt$extracted_serial-$my_xlib ;;
4201 *) break ;;
4202 esac
4203 done
4204 extracted_archives="$extracted_archives $my_xlib_u"
4205 my_xdir="$my_gentop/$my_xlib_u"
4206
4207 func_mkdir_p "$my_xdir"
4208
4209 case $host in
4210 *-darwin*)
4211 func_verbose "Extracting $my_xabs"
4212 # Do not bother doing anything if just a dry run
4213 $opt_dry_run || {
4214 darwin_orig_dir=`pwd`
4215 cd $my_xdir || exit $?
4216 darwin_archive=$my_xabs
4217 darwin_curdir=`pwd`
4218 darwin_base_archive=`basename "$darwin_archive"`
4219 darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
4220 if test -n "$darwin_arches"; then
4221 darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
4222 darwin_arch=
4223 func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
4224 for darwin_arch in $darwin_arches ; do
4225 func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4226 $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
4227 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
4228 func_extract_an_archive "`pwd`" "${darwin_base_archive}"
4229 cd "$darwin_curdir"
4230 $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
4231 done # $darwin_arches
4232 ## Okay now we've a bunch of thin objects, gotta fatten them up :)
4233 darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
4234 darwin_file=
4235 darwin_files=
4236 for darwin_file in $darwin_filelist; do
4237 darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
4238 $LIPO -create -output "$darwin_file" $darwin_files
4239 done # $darwin_filelist
4240 $RM -rf unfat-$$
4241 cd "$darwin_orig_dir"
4242 else
4243 cd $darwin_orig_dir
4244 func_extract_an_archive "$my_xdir" "$my_xabs"
4245 fi # $darwin_arches
4246 } # !$opt_dry_run
4247 ;;
4248 *)
4249 func_extract_an_archive "$my_xdir" "$my_xabs"
4250 ;;
4251 esac
4252 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
4253 done
4254
4255 func_extract_archives_result="$my_oldobjs"
4256}
4257
4258
4259# func_emit_wrapper [arg=no]
4260#
4261# Emit a libtool wrapper script on stdout.
4262# Don't directly open a file because we may want to
4263# incorporate the script contents within a cygwin/mingw
4264# wrapper executable. Must ONLY be called from within
4265# func_mode_link because it depends on a number of variables
4266# set therein.
4267#
4268# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
4269# variable will take. If 'yes', then the emitted script
4270# will assume that the directory in which it is stored is
4271# the $objdir directory. This is a cygwin/mingw-specific
4272# behavior.
4273func_emit_wrapper ()
4274{
4275 func_emit_wrapper_arg1=${1-no}
4276
4277 $ECHO "\
4278#! $SHELL
4279
4280# $output - temporary wrapper script for $objdir/$outputname
4281# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4282#
4283# The $output program cannot be directly executed until all the libtool
4284# libraries that it depends on are installed.
4285#
4286# This wrapper script should never be moved out of the build directory.
4287# If it is, it will not operate correctly.
4288
4289# Sed substitution that helps us do robust quoting. It backslashifies
4290# metacharacters that are still active within double-quoted strings.
4291sed_quote_subst='$sed_quote_subst'
4292
4293# Be Bourne compatible
4294if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
4295 emulate sh
4296 NULLCMD=:
4297 # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
4298 # is contrary to our usage. Disable this feature.
4299 alias -g '\${1+\"\$@\"}'='\"\$@\"'
4300 setopt NO_GLOB_SUBST
4301else
4302 case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
4303fi
4304BIN_SH=xpg4; export BIN_SH # for Tru64
4305DUALCASE=1; export DUALCASE # for MKS sh
4306
4307# The HP-UX ksh and POSIX shell print the target directory to stdout
4308# if CDPATH is set.
4309(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
4310
4311relink_command=\"$relink_command\"
4312
4313# This environment variable determines our operation mode.
4314if test \"\$libtool_install_magic\" = \"$magic\"; then
4315 # install mode needs the following variables:
4316 generated_by_libtool_version='$macro_version'
4317 notinst_deplibs='$notinst_deplibs'
4318else
4319 # When we are sourced in execute mode, \$file and \$ECHO are already set.
4320 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4321 file=\"\$0\""
4322
4323 qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
4324 $ECHO "\
4325
4326# A function that is used when there is no print builtin or printf.
4327func_fallback_echo ()
4328{
4329 eval 'cat <<_LTECHO_EOF
4330\$1
4331_LTECHO_EOF'
4332}
4333 ECHO=\"$qECHO\"
4334 fi
4335
4336# Very basic option parsing. These options are (a) specific to
4337# the libtool wrapper, (b) are identical between the wrapper
4338# /script/ and the wrapper /executable/ which is used only on
4339# windows platforms, and (c) all begin with the string "--lt-"
4340# (application programs are unlikely to have options which match
4341# this pattern).
4342#
4343# There are only two supported options: --lt-debug and
4344# --lt-dump-script. There is, deliberately, no --lt-help.
4345#
4346# The first argument to this parsing function should be the
4347# script's $0 value, followed by "$@".
4348lt_option_debug=
4349func_parse_lt_options ()
4350{
4351 lt_script_arg0=\$0
4352 shift
4353 for lt_opt
4354 do
4355 case \"\$lt_opt\" in
4356 --lt-debug) lt_option_debug=1 ;;
4357 --lt-dump-script)
4358 lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
4359 test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
4360 lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
4361 cat \"\$lt_dump_D/\$lt_dump_F\"
4362 exit 0
4363 ;;
4364 --lt-*)
4365 \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
4366 exit 1
4367 ;;
4368 esac
4369 done
4370
4371 # Print the debug banner immediately:
4372 if test -n \"\$lt_option_debug\"; then
4373 echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
4374 fi
4375}
4376
4377# Used when --lt-debug. Prints its arguments to stdout
4378# (redirection is the responsibility of the caller)
4379func_lt_dump_args ()
4380{
4381 lt_dump_args_N=1;
4382 for lt_arg
4383 do
4384 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
4385 lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
4386 done
4387}
4388
4389# Core function for launching the target application
4390func_exec_program_core ()
4391{
4392"
4393 case $host in
4394 # Backslashes separate directories on plain windows
4395 *-*-mingw | *-*-os2* | *-cegcc*)
4396 $ECHO "\
4397 if test -n \"\$lt_option_debug\"; then
4398 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
4399 func_lt_dump_args \${1+\"\$@\"} 1>&2
4400 fi
4401 exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
4402"
4403 ;;
4404
4405 *)
4406 $ECHO "\
4407 if test -n \"\$lt_option_debug\"; then
4408 \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
4409 func_lt_dump_args \${1+\"\$@\"} 1>&2
4410 fi
4411 exec \"\$progdir/\$program\" \${1+\"\$@\"}
4412"
4413 ;;
4414 esac
4415 $ECHO "\
4416 \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
4417 exit 1
4418}
4419
4420# A function to encapsulate launching the target application
4421# Strips options in the --lt-* namespace from \$@ and
4422# launches target application with the remaining arguments.
4423func_exec_program ()
4424{
4425 case \" \$* \" in
4426 *\\ --lt-*)
4427 for lt_wr_arg
4428 do
4429 case \$lt_wr_arg in
4430 --lt-*) ;;
4431 *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
4432 esac
4433 shift
4434 done ;;
4435 esac
4436 func_exec_program_core \${1+\"\$@\"}
4437}
4438
4439 # Parse options
4440 func_parse_lt_options \"\$0\" \${1+\"\$@\"}
4441
4442 # Find the directory that this script lives in.
4443 thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
4444 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
4445
4446 # Follow symbolic links until we get to the real thisdir.
4447 file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
4448 while test -n \"\$file\"; do
4449 destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
4450
4451 # If there was a directory component, then change thisdir.
4452 if test \"x\$destdir\" != \"x\$file\"; then
4453 case \"\$destdir\" in
4454 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
4455 *) thisdir=\"\$thisdir/\$destdir\" ;;
4456 esac
4457 fi
4458
4459 file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
4460 file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
4461 done
4462
4463 # Usually 'no', except on cygwin/mingw when embedded into
4464 # the cwrapper.
4465 WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
4466 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
4467 # special case for '.'
4468 if test \"\$thisdir\" = \".\"; then
4469 thisdir=\`pwd\`
4470 fi
4471 # remove .libs from thisdir
4472 case \"\$thisdir\" in
4473 *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
4474 $objdir ) thisdir=. ;;
4475 esac
4476 fi
4477
4478 # Try to get the absolute directory name.
4479 absdir=\`cd \"\$thisdir\" && pwd\`
4480 test -n \"\$absdir\" && thisdir=\"\$absdir\"
4481"
4482
4483 if test "$fast_install" = yes; then
4484 $ECHO "\
4485 program=lt-'$outputname'$exeext
4486 progdir=\"\$thisdir/$objdir\"
4487
4488 if test ! -f \"\$progdir/\$program\" ||
4489 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
4490 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
4491
4492 file=\"\$\$-\$program\"
4493
4494 if test ! -d \"\$progdir\"; then
4495 $MKDIR \"\$progdir\"
4496 else
4497 $RM \"\$progdir/\$file\"
4498 fi"
4499
4500 $ECHO "\
4501
4502 # relink executable if necessary
4503 if test -n \"\$relink_command\"; then
4504 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
4505 else
4506 $ECHO \"\$relink_command_output\" >&2
4507 $RM \"\$progdir/\$file\"
4508 exit 1
4509 fi
4510 fi
4511
4512 $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
4513 { $RM \"\$progdir/\$program\";
4514 $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
4515 $RM \"\$progdir/\$file\"
4516 fi"
4517 else
4518 $ECHO "\
4519 program='$outputname'
4520 progdir=\"\$thisdir/$objdir\"
4521"
4522 fi
4523
4524 $ECHO "\
4525
4526 if test -f \"\$progdir/\$program\"; then"
4527
4528 # fixup the dll searchpath if we need to.
4529 #
4530 # Fix the DLL searchpath if we need to. Do this before prepending
4531 # to shlibpath, because on Windows, both are PATH and uninstalled
4532 # libraries must come first.
4533 if test -n "$dllsearchpath"; then
4534 $ECHO "\
4535 # Add the dll search path components to the executable PATH
4536 PATH=$dllsearchpath:\$PATH
4537"
4538 fi
4539
4540 # Export our shlibpath_var if we have one.
4541 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4542 $ECHO "\
4543 # Add our own library path to $shlibpath_var
4544 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
4545
4546 # Some systems cannot cope with colon-terminated $shlibpath_var
4547 # The second colon is a workaround for a bug in BeOS R4 sed
4548 $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
4549
4550 export $shlibpath_var
4551"
4552 fi
4553
4554 $ECHO "\
4555 if test \"\$libtool_execute_magic\" != \"$magic\"; then
4556 # Run the actual program with our arguments.
4557 func_exec_program \${1+\"\$@\"}
4558 fi
4559 else
4560 # The program doesn't exist.
4561 \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
4562 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
4563 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
4564 exit 1
4565 fi
4566fi\
4567"
4568}
4569
4570
4571# func_emit_cwrapperexe_src
4572# emit the source code for a wrapper executable on stdout
4573# Must ONLY be called from within func_mode_link because
4574# it depends on a number of variable set therein.
4575func_emit_cwrapperexe_src ()
4576{
4577 cat <<EOF
4578
4579/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
4580 Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
4581
4582 The $output program cannot be directly executed until all the libtool
4583 libraries that it depends on are installed.
4584
4585 This wrapper executable should never be moved out of the build directory.
4586 If it is, it will not operate correctly.
4587*/
4588EOF
4589 cat <<"EOF"
4590#ifdef _MSC_VER
4591# define _CRT_SECURE_NO_DEPRECATE 1
4592#endif
4593#include <stdio.h>
4594#include <stdlib.h>
4595#ifdef _MSC_VER
4596# include <direct.h>
4597# include <process.h>
4598# include <io.h>
4599#else
4600# include <unistd.h>
4601# include <stdint.h>
4602# ifdef __CYGWIN__
4603# include <io.h>
4604# endif
4605#endif
4606#include <malloc.h>
4607#include <stdarg.h>
4608#include <assert.h>
4609#include <string.h>
4610#include <ctype.h>
4611#include <errno.h>
4612#include <fcntl.h>
4613#include <sys/stat.h>
4614
4615/* declarations of non-ANSI functions */
4616#if defined(__MINGW32__)
4617# ifdef __STRICT_ANSI__
4618int _putenv (const char *);
4619# endif
4620#elif defined(__CYGWIN__)
4621# ifdef __STRICT_ANSI__
4622char *realpath (const char *, char *);
4623int putenv (char *);
4624int setenv (const char *, const char *, int);
4625# endif
4626/* #elif defined (other platforms) ... */
4627#endif
4628
4629/* portability defines, excluding path handling macros */
4630#if defined(_MSC_VER)
4631# define setmode _setmode
4632# define stat _stat
4633# define chmod _chmod
4634# define getcwd _getcwd
4635# define putenv _putenv
4636# define S_IXUSR _S_IEXEC
4637# ifndef _INTPTR_T_DEFINED
4638# define _INTPTR_T_DEFINED
4639# define intptr_t int
4640# endif
4641#elif defined(__MINGW32__)
4642# define setmode _setmode
4643# define stat _stat
4644# define chmod _chmod
4645# define getcwd _getcwd
4646# define putenv _putenv
4647#elif defined(__CYGWIN__)
4648# define HAVE_SETENV
4649# define FOPEN_WB "wb"
4650/* #elif defined (other platforms) ... */
4651#endif
4652
4653#if defined(PATH_MAX)
4654# define LT_PATHMAX PATH_MAX
4655#elif defined(MAXPATHLEN)
4656# define LT_PATHMAX MAXPATHLEN
4657#else
4658# define LT_PATHMAX 1024
4659#endif
4660
4661#ifndef S_IXOTH
4662# define S_IXOTH 0
4663#endif
4664#ifndef S_IXGRP
4665# define S_IXGRP 0
4666#endif
4667
4668/* path handling portability macros */
4669#ifndef DIR_SEPARATOR
4670# define DIR_SEPARATOR '/'
4671# define PATH_SEPARATOR ':'
4672#endif
4673
4674#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
4675 defined (__OS2__)
4676# define HAVE_DOS_BASED_FILE_SYSTEM
4677# define FOPEN_WB "wb"
4678# ifndef DIR_SEPARATOR_2
4679# define DIR_SEPARATOR_2 '\\'
4680# endif
4681# ifndef PATH_SEPARATOR_2
4682# define PATH_SEPARATOR_2 ';'
4683# endif
4684#endif
4685
4686#ifndef DIR_SEPARATOR_2
4687# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
4688#else /* DIR_SEPARATOR_2 */
4689# define IS_DIR_SEPARATOR(ch) \
4690 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
4691#endif /* DIR_SEPARATOR_2 */
4692
4693#ifndef PATH_SEPARATOR_2
4694# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
4695#else /* PATH_SEPARATOR_2 */
4696# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
4697#endif /* PATH_SEPARATOR_2 */
4698
4699#ifndef FOPEN_WB
4700# define FOPEN_WB "w"
4701#endif
4702#ifndef _O_BINARY
4703# define _O_BINARY 0
4704#endif
4705
4706#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
4707#define XFREE(stale) do { \
4708 if (stale) { free ((void *) stale); stale = 0; } \
4709} while (0)
4710
4711#if defined(LT_DEBUGWRAPPER)
4712static int lt_debug = 1;
4713#else
4714static int lt_debug = 0;
4715#endif
4716
4717const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
4718
4719void *xmalloc (size_t num);
4720char *xstrdup (const char *string);
4721const char *base_name (const char *name);
4722char *find_executable (const char *wrapper);
4723char *chase_symlinks (const char *pathspec);
4724int make_executable (const char *path);
4725int check_executable (const char *path);
4726char *strendzap (char *str, const char *pat);
4727void lt_debugprintf (const char *file, int line, const char *fmt, ...);
4728void lt_fatal (const char *file, int line, const char *message, ...);
4729static const char *nonnull (const char *s);
4730static const char *nonempty (const char *s);
4731void lt_setenv (const char *name, const char *value);
4732char *lt_extend_str (const char *orig_value, const char *add, int to_end);
4733void lt_update_exe_path (const char *name, const char *value);
4734void lt_update_lib_path (const char *name, const char *value);
4735char **prepare_spawn (char **argv);
4736void lt_dump_script (FILE *f);
4737EOF
4738
4739 cat <<EOF
4740volatile const char * MAGIC_EXE = "$magic_exe";
4741const char * LIB_PATH_VARNAME = "$shlibpath_var";
4742EOF
4743
4744 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
4745 func_to_host_path "$temp_rpath"
4746 cat <<EOF
4747const char * LIB_PATH_VALUE = "$func_to_host_path_result";
4748EOF
4749 else
4750 cat <<"EOF"
4751const char * LIB_PATH_VALUE = "";
4752EOF
4753 fi
4754
4755 if test -n "$dllsearchpath"; then
4756 func_to_host_path "$dllsearchpath:"
4757 cat <<EOF
4758const char * EXE_PATH_VARNAME = "PATH";
4759const char * EXE_PATH_VALUE = "$func_to_host_path_result";
4760EOF
4761 else
4762 cat <<"EOF"
4763const char * EXE_PATH_VARNAME = "";
4764const char * EXE_PATH_VALUE = "";
4765EOF
4766 fi
4767
4768 if test "$fast_install" = yes; then
4769 cat <<EOF
4770const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
4771EOF
4772 else
4773 cat <<EOF
4774const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
4775EOF
4776 fi
4777
4778
4779 cat <<"EOF"
4780
4781#define LTWRAPPER_OPTION_PREFIX "--lt-"
4782
4783static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
4784static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
4785static const char *debug_opt = LTWRAPPER_OPTION_PREFIX "debug";
4786
4787int
4788main (int argc, char *argv[])
4789{
4790 char **newargz;
4791 int newargc;
4792 char *tmp_pathspec;
4793 char *actual_cwrapper_path;
4794 char *actual_cwrapper_name;
4795 char *target_name;
4796 char *lt_argv_zero;
4797 intptr_t rval = 127;
4798
4799 int i;
4800
4801 program_name = (char *) xstrdup (base_name (argv[0]));
4802 newargz = XMALLOC (char *, argc + 1);
4803
4804 /* very simple arg parsing; don't want to rely on getopt
4805 * also, copy all non cwrapper options to newargz, except
4806 * argz[0], which is handled differently
4807 */
4808 newargc=0;
4809 for (i = 1; i < argc; i++)
4810 {
4811 if (strcmp (argv[i], dumpscript_opt) == 0)
4812 {
4813EOF
4814 case "$host" in
4815 *mingw* | *cygwin* )
4816 # make stdout use "unix" line endings
4817 echo " setmode(1,_O_BINARY);"
4818 ;;
4819 esac
4820
4821 cat <<"EOF"
4822 lt_dump_script (stdout);
4823 return 0;
4824 }
4825 if (strcmp (argv[i], debug_opt) == 0)
4826 {
4827 lt_debug = 1;
4828 continue;
4829 }
4830 if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
4831 {
4832 /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
4833 namespace, but it is not one of the ones we know about and
4834 have already dealt with, above (inluding dump-script), then
4835 report an error. Otherwise, targets might begin to believe
4836 they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
4837 namespace. The first time any user complains about this, we'll
4838 need to make LTWRAPPER_OPTION_PREFIX a configure-time option
4839 or a configure.ac-settable value.
4840 */
4841 lt_fatal (__FILE__, __LINE__,
4842 "unrecognized %s option: '%s'",
4843 ltwrapper_option_prefix, argv[i]);
4844 }
4845 /* otherwise ... */
4846 newargz[++newargc] = xstrdup (argv[i]);
4847 }
4848 newargz[++newargc] = NULL;
4849
4850EOF
4851 cat <<EOF
4852 /* The GNU banner must be the first non-error debug message */
4853 lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
4854EOF
4855 cat <<"EOF"
4856 lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
4857 lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
4858
4859 tmp_pathspec = find_executable (argv[0]);
4860 if (tmp_pathspec == NULL)
4861 lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
4862 lt_debugprintf (__FILE__, __LINE__,
4863 "(main) found exe (before symlink chase) at: %s\n",
4864 tmp_pathspec);
4865
4866 actual_cwrapper_path = chase_symlinks (tmp_pathspec);
4867 lt_debugprintf (__FILE__, __LINE__,
4868 "(main) found exe (after symlink chase) at: %s\n",
4869 actual_cwrapper_path);
4870 XFREE (tmp_pathspec);
4871
4872 actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
4873 strendzap (actual_cwrapper_path, actual_cwrapper_name);
4874
4875 /* wrapper name transforms */
4876 strendzap (actual_cwrapper_name, ".exe");
4877 tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
4878 XFREE (actual_cwrapper_name);
4879 actual_cwrapper_name = tmp_pathspec;
4880 tmp_pathspec = 0;
4881
4882 /* target_name transforms -- use actual target program name; might have lt- prefix */
4883 target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
4884 strendzap (target_name, ".exe");
4885 tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
4886 XFREE (target_name);
4887 target_name = tmp_pathspec;
4888 tmp_pathspec = 0;
4889
4890 lt_debugprintf (__FILE__, __LINE__,
4891 "(main) libtool target name: %s\n",
4892 target_name);
4893EOF
4894
4895 cat <<EOF
4896 newargz[0] =
4897 XMALLOC (char, (strlen (actual_cwrapper_path) +
4898 strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
4899 strcpy (newargz[0], actual_cwrapper_path);
4900 strcat (newargz[0], "$objdir");
4901 strcat (newargz[0], "/");
4902EOF
4903
4904 cat <<"EOF"
4905 /* stop here, and copy so we don't have to do this twice */
4906 tmp_pathspec = xstrdup (newargz[0]);
4907
4908 /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
4909 strcat (newargz[0], actual_cwrapper_name);
4910
4911 /* DO want the lt- prefix here if it exists, so use target_name */
4912 lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
4913 XFREE (tmp_pathspec);
4914 tmp_pathspec = NULL;
4915EOF
4916
4917 case $host_os in
4918 mingw*)
4919 cat <<"EOF"
4920 {
4921 char* p;
4922 while ((p = strchr (newargz[0], '\\')) != NULL)
4923 {
4924 *p = '/';
4925 }
4926 while ((p = strchr (lt_argv_zero, '\\')) != NULL)
4927 {
4928 *p = '/';
4929 }
4930 }
4931EOF
4932 ;;
4933 esac
4934
4935 cat <<"EOF"
4936 XFREE (target_name);
4937 XFREE (actual_cwrapper_path);
4938 XFREE (actual_cwrapper_name);
4939
4940 lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
4941 lt_setenv ("DUALCASE", "1"); /* for MSK sh */
4942 /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
4943 be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
4944 because on Windows, both *_VARNAMEs are PATH but uninstalled
4945 libraries must come first. */
4946 lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
4947 lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
4948
4949 lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
4950 nonnull (lt_argv_zero));
4951 for (i = 0; i < newargc; i++)
4952 {
4953 lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
4954 i, nonnull (newargz[i]));
4955 }
4956
4957EOF
4958
4959 case $host_os in
4960 mingw*)
4961 cat <<"EOF"
4962 /* execv doesn't actually work on mingw as expected on unix */
4963 newargz = prepare_spawn (newargz);
4964 rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
4965 if (rval == -1)
4966 {
4967 /* failed to start process */
4968 lt_debugprintf (__FILE__, __LINE__,
4969 "(main) failed to launch target \"%s\": %s\n",
4970 lt_argv_zero, nonnull (strerror (errno)));
4971 return 127;
4972 }
4973 return rval;
4974EOF
4975 ;;
4976 *)
4977 cat <<"EOF"
4978 execv (lt_argv_zero, newargz);
4979 return rval; /* =127, but avoids unused variable warning */
4980EOF
4981 ;;
4982 esac
4983
4984 cat <<"EOF"
4985}
4986
4987void *
4988xmalloc (size_t num)
4989{
4990 void *p = (void *) malloc (num);
4991 if (!p)
4992 lt_fatal (__FILE__, __LINE__, "memory exhausted");
4993
4994 return p;
4995}
4996
4997char *
4998xstrdup (const char *string)
4999{
5000 return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
5001 string) : NULL;
5002}
5003
5004const char *
5005base_name (const char *name)
5006{
5007 const char *base;
5008
5009#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5010 /* Skip over the disk name in MSDOS pathnames. */
5011 if (isalpha ((unsigned char) name[0]) && name[1] == ':')
5012 name += 2;
5013#endif
5014
5015 for (base = name; *name; name++)
5016 if (IS_DIR_SEPARATOR (*name))
5017 base = name + 1;
5018 return base;
5019}
5020
5021int
5022check_executable (const char *path)
5023{
5024 struct stat st;
5025
5026 lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
5027 nonempty (path));
5028 if ((!path) || (!*path))
5029 return 0;
5030
5031 if ((stat (path, &st) >= 0)
5032 && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
5033 return 1;
5034 else
5035 return 0;
5036}
5037
5038int
5039make_executable (const char *path)
5040{
5041 int rval = 0;
5042 struct stat st;
5043
5044 lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
5045 nonempty (path));
5046 if ((!path) || (!*path))
5047 return 0;
5048
5049 if (stat (path, &st) >= 0)
5050 {
5051 rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
5052 }
5053 return rval;
5054}
5055
5056/* Searches for the full path of the wrapper. Returns
5057 newly allocated full path name if found, NULL otherwise
5058 Does not chase symlinks, even on platforms that support them.
5059*/
5060char *
5061find_executable (const char *wrapper)
5062{
5063 int has_slash = 0;
5064 const char *p;
5065 const char *p_next;
5066 /* static buffer for getcwd */
5067 char tmp[LT_PATHMAX + 1];
5068 int tmp_len;
5069 char *concat_name;
5070
5071 lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
5072 nonempty (wrapper));
5073
5074 if ((wrapper == NULL) || (*wrapper == '\0'))
5075 return NULL;
5076
5077 /* Absolute path? */
5078#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5079 if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
5080 {
5081 concat_name = xstrdup (wrapper);
5082 if (check_executable (concat_name))
5083 return concat_name;
5084 XFREE (concat_name);
5085 }
5086 else
5087 {
5088#endif
5089 if (IS_DIR_SEPARATOR (wrapper[0]))
5090 {
5091 concat_name = xstrdup (wrapper);
5092 if (check_executable (concat_name))
5093 return concat_name;
5094 XFREE (concat_name);
5095 }
5096#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
5097 }
5098#endif
5099
5100 for (p = wrapper; *p; p++)
5101 if (*p == '/')
5102 {
5103 has_slash = 1;
5104 break;
5105 }
5106 if (!has_slash)
5107 {
5108 /* no slashes; search PATH */
5109 const char *path = getenv ("PATH");
5110 if (path != NULL)
5111 {
5112 for (p = path; *p; p = p_next)
5113 {
5114 const char *q;
5115 size_t p_len;
5116 for (q = p; *q; q++)
5117 if (IS_PATH_SEPARATOR (*q))
5118 break;
5119 p_len = q - p;
5120 p_next = (*q == '\0' ? q : q + 1);
5121 if (p_len == 0)
5122 {
5123 /* empty path: current directory */
5124 if (getcwd (tmp, LT_PATHMAX) == NULL)
5125 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
5126 nonnull (strerror (errno)));
5127 tmp_len = strlen (tmp);
5128 concat_name =
5129 XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
5130 memcpy (concat_name, tmp, tmp_len);
5131 concat_name[tmp_len] = '/';
5132 strcpy (concat_name + tmp_len + 1, wrapper);
5133 }
5134 else
5135 {
5136 concat_name =
5137 XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
5138 memcpy (concat_name, p, p_len);
5139 concat_name[p_len] = '/';
5140 strcpy (concat_name + p_len + 1, wrapper);
5141 }
5142 if (check_executable (concat_name))
5143 return concat_name;
5144 XFREE (concat_name);
5145 }
5146 }
5147 /* not found in PATH; assume curdir */
5148 }
5149 /* Relative path | not found in path: prepend cwd */
5150 if (getcwd (tmp, LT_PATHMAX) == NULL)
5151 lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
5152 nonnull (strerror (errno)));
5153 tmp_len = strlen (tmp);
5154 concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
5155 memcpy (concat_name, tmp, tmp_len);
5156 concat_name[tmp_len] = '/';
5157 strcpy (concat_name + tmp_len + 1, wrapper);
5158
5159 if (check_executable (concat_name))
5160 return concat_name;
5161 XFREE (concat_name);
5162 return NULL;
5163}
5164
5165char *
5166chase_symlinks (const char *pathspec)
5167{
5168#ifndef S_ISLNK
5169 return xstrdup (pathspec);
5170#else
5171 char buf[LT_PATHMAX];
5172 struct stat s;
5173 char *tmp_pathspec = xstrdup (pathspec);
5174 char *p;
5175 int has_symlinks = 0;
5176 while (strlen (tmp_pathspec) && !has_symlinks)
5177 {
5178 lt_debugprintf (__FILE__, __LINE__,
5179 "checking path component for symlinks: %s\n",
5180 tmp_pathspec);
5181 if (lstat (tmp_pathspec, &s) == 0)
5182 {
5183 if (S_ISLNK (s.st_mode) != 0)
5184 {
5185 has_symlinks = 1;
5186 break;
5187 }
5188
5189 /* search backwards for last DIR_SEPARATOR */
5190 p = tmp_pathspec + strlen (tmp_pathspec) - 1;
5191 while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
5192 p--;
5193 if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
5194 {
5195 /* no more DIR_SEPARATORS left */
5196 break;
5197 }
5198 *p = '\0';
5199 }
5200 else
5201 {
5202 lt_fatal (__FILE__, __LINE__,
5203 "error accessing file \"%s\": %s",
5204 tmp_pathspec, nonnull (strerror (errno)));
5205 }
5206 }
5207 XFREE (tmp_pathspec);
5208
5209 if (!has_symlinks)
5210 {
5211 return xstrdup (pathspec);
5212 }
5213
5214 tmp_pathspec = realpath (pathspec, buf);
5215 if (tmp_pathspec == 0)
5216 {
5217 lt_fatal (__FILE__, __LINE__,
5218 "could not follow symlinks for %s", pathspec);
5219 }
5220 return xstrdup (tmp_pathspec);
5221#endif
5222}
5223
5224char *
5225strendzap (char *str, const char *pat)
5226{
5227 size_t len, patlen;
5228
5229 assert (str != NULL);
5230 assert (pat != NULL);
5231
5232 len = strlen (str);
5233 patlen = strlen (pat);
5234
5235 if (patlen <= len)
5236 {
5237 str += len - patlen;
5238 if (strcmp (str, pat) == 0)
5239 *str = '\0';
5240 }
5241 return str;
5242}
5243
5244void
5245lt_debugprintf (const char *file, int line, const char *fmt, ...)
5246{
5247 va_list args;
5248 if (lt_debug)
5249 {
5250 (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
5251 va_start (args, fmt);
5252 (void) vfprintf (stderr, fmt, args);
5253 va_end (args);
5254 }
5255}
5256
5257static void
5258lt_error_core (int exit_status, const char *file,
5259 int line, const char *mode,
5260 const char *message, va_list ap)
5261{
5262 fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
5263 vfprintf (stderr, message, ap);
5264 fprintf (stderr, ".\n");
5265
5266 if (exit_status >= 0)
5267 exit (exit_status);
5268}
5269
5270void
5271lt_fatal (const char *file, int line, const char *message, ...)
5272{
5273 va_list ap;
5274 va_start (ap, message);
5275 lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
5276 va_end (ap);
5277}
5278
5279static const char *
5280nonnull (const char *s)
5281{
5282 return s ? s : "(null)";
5283}
5284
5285static const char *
5286nonempty (const char *s)
5287{
5288 return (s && !*s) ? "(empty)" : nonnull (s);
5289}
5290
5291void
5292lt_setenv (const char *name, const char *value)
5293{
5294 lt_debugprintf (__FILE__, __LINE__,
5295 "(lt_setenv) setting '%s' to '%s'\n",
5296 nonnull (name), nonnull (value));
5297 {
5298#ifdef HAVE_SETENV
5299 /* always make a copy, for consistency with !HAVE_SETENV */
5300 char *str = xstrdup (value);
5301 setenv (name, str, 1);
5302#else
5303 int len = strlen (name) + 1 + strlen (value) + 1;
5304 char *str = XMALLOC (char, len);
5305 sprintf (str, "%s=%s", name, value);
5306 if (putenv (str) != EXIT_SUCCESS)
5307 {
5308 XFREE (str);
5309 }
5310#endif
5311 }
5312}
5313
5314char *
5315lt_extend_str (const char *orig_value, const char *add, int to_end)
5316{
5317 char *new_value;
5318 if (orig_value && *orig_value)
5319 {
5320 int orig_value_len = strlen (orig_value);
5321 int add_len = strlen (add);
5322 new_value = XMALLOC (char, add_len + orig_value_len + 1);
5323 if (to_end)
5324 {
5325 strcpy (new_value, orig_value);
5326 strcpy (new_value + orig_value_len, add);
5327 }
5328 else
5329 {
5330 strcpy (new_value, add);
5331 strcpy (new_value + add_len, orig_value);
5332 }
5333 }
5334 else
5335 {
5336 new_value = xstrdup (add);
5337 }
5338 return new_value;
5339}
5340
5341void
5342lt_update_exe_path (const char *name, const char *value)
5343{
5344 lt_debugprintf (__FILE__, __LINE__,
5345 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
5346 nonnull (name), nonnull (value));
5347
5348 if (name && *name && value && *value)
5349 {
5350 char *new_value = lt_extend_str (getenv (name), value, 0);
5351 /* some systems can't cope with a ':'-terminated path #' */
5352 int len = strlen (new_value);
5353 while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
5354 {
5355 new_value[len-1] = '\0';
5356 }
5357 lt_setenv (name, new_value);
5358 XFREE (new_value);
5359 }
5360}
5361
5362void
5363lt_update_lib_path (const char *name, const char *value)
5364{
5365 lt_debugprintf (__FILE__, __LINE__,
5366 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
5367 nonnull (name), nonnull (value));
5368
5369 if (name && *name && value && *value)
5370 {
5371 char *new_value = lt_extend_str (getenv (name), value, 0);
5372 lt_setenv (name, new_value);
5373 XFREE (new_value);
5374 }
5375}
5376
5377EOF
5378 case $host_os in
5379 mingw*)
5380 cat <<"EOF"
5381
5382/* Prepares an argument vector before calling spawn().
5383 Note that spawn() does not by itself call the command interpreter
5384 (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
5385 ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
5386 GetVersionEx(&v);
5387 v.dwPlatformId == VER_PLATFORM_WIN32_NT;
5388 }) ? "cmd.exe" : "command.com").
5389 Instead it simply concatenates the arguments, separated by ' ', and calls
5390 CreateProcess(). We must quote the arguments since Win32 CreateProcess()
5391 interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
5392 special way:
5393 - Space and tab are interpreted as delimiters. They are not treated as
5394 delimiters if they are surrounded by double quotes: "...".
5395 - Unescaped double quotes are removed from the input. Their only effect is
5396 that within double quotes, space and tab are treated like normal
5397 characters.
5398 - Backslashes not followed by double quotes are not special.
5399 - But 2*n+1 backslashes followed by a double quote become
5400 n backslashes followed by a double quote (n >= 0):
5401 \" -> "
5402 \\\" -> \"
5403 \\\\\" -> \\"
5404 */
5405#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
5406#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
5407char **
5408prepare_spawn (char **argv)
5409{
5410 size_t argc;
5411 char **new_argv;
5412 size_t i;
5413
5414 /* Count number of arguments. */
5415 for (argc = 0; argv[argc] != NULL; argc++)
5416 ;
5417
5418 /* Allocate new argument vector. */
5419 new_argv = XMALLOC (char *, argc + 1);
5420
5421 /* Put quoted arguments into the new argument vector. */
5422 for (i = 0; i < argc; i++)
5423 {
5424 const char *string = argv[i];
5425
5426 if (string[0] == '\0')
5427 new_argv[i] = xstrdup ("\"\"");
5428 else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
5429 {
5430 int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
5431 size_t length;
5432 unsigned int backslashes;
5433 const char *s;
5434 char *quoted_string;
5435 char *p;
5436
5437 length = 0;
5438 backslashes = 0;
5439 if (quote_around)
5440 length++;
5441 for (s = string; *s != '\0'; s++)
5442 {
5443 char c = *s;
5444 if (c == '"')
5445 length += backslashes + 1;
5446 length++;
5447 if (c == '\\')
5448 backslashes++;
5449 else
5450 backslashes = 0;
5451 }
5452 if (quote_around)
5453 length += backslashes + 1;
5454
5455 quoted_string = XMALLOC (char, length + 1);
5456
5457 p = quoted_string;
5458 backslashes = 0;
5459 if (quote_around)
5460 *p++ = '"';
5461 for (s = string; *s != '\0'; s++)
5462 {
5463 char c = *s;
5464 if (c == '"')
5465 {
5466 unsigned int j;
5467 for (j = backslashes + 1; j > 0; j--)
5468 *p++ = '\\';
5469 }
5470 *p++ = c;
5471 if (c == '\\')
5472 backslashes++;
5473 else
5474 backslashes = 0;
5475 }
5476 if (quote_around)
5477 {
5478 unsigned int j;
5479 for (j = backslashes; j > 0; j--)
5480 *p++ = '\\';
5481 *p++ = '"';
5482 }
5483 *p = '\0';
5484
5485 new_argv[i] = quoted_string;
5486 }
5487 else
5488 new_argv[i] = (char *) string;
5489 }
5490 new_argv[argc] = NULL;
5491
5492 return new_argv;
5493}
5494EOF
5495 ;;
5496 esac
5497
5498 cat <<"EOF"
5499void lt_dump_script (FILE* f)
5500{
5501EOF
5502 func_emit_wrapper yes |
5503 $SED -n -e '
5504s/^\(.\{79\}\)\(..*\)/\1\
5505\2/
5506h
5507s/\([\\"]\)/\\\1/g
5508s/$/\\n/
5509s/\([^\n]*\).*/ fputs ("\1", f);/p
5510g
5511D'
5512 cat <<"EOF"
5513}
5514EOF
5515}
5516# end: func_emit_cwrapperexe_src
5517
5518# func_win32_import_lib_p ARG
5519# True if ARG is an import lib, as indicated by $file_magic_cmd
5520func_win32_import_lib_p ()
5521{
5522 $opt_debug
5523 case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
5524 *import*) : ;;
5525 *) false ;;
5526 esac
5527}
5528
5529# func_mode_link arg...
5530func_mode_link ()
5531{
5532 $opt_debug
5533 case $host in
5534 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
5535 # It is impossible to link a dll without this setting, and
5536 # we shouldn't force the makefile maintainer to figure out
5537 # which system we are compiling for in order to pass an extra
5538 # flag for every libtool invocation.
5539 # allow_undefined=no
5540
5541 # FIXME: Unfortunately, there are problems with the above when trying
5542 # to make a dll which has undefined symbols, in which case not
5543 # even a static library is built. For now, we need to specify
5544 # -no-undefined on the libtool link line when we can be certain
5545 # that all symbols are satisfied, otherwise we get a static library.
5546 allow_undefined=yes
5547 ;;
5548 *)
5549 allow_undefined=yes
5550 ;;
5551 esac
5552 libtool_args=$nonopt
5553 base_compile="$nonopt $@"
5554 compile_command=$nonopt
5555 finalize_command=$nonopt
5556
5557 compile_rpath=
5558 finalize_rpath=
5559 compile_shlibpath=
5560 finalize_shlibpath=
5561 convenience=
5562 old_convenience=
5563 deplibs=
5564 old_deplibs=
5565 compiler_flags=
5566 linker_flags=
5567 dllsearchpath=
5568 lib_search_path=`pwd`
5569 inst_prefix_dir=
5570 new_inherited_linker_flags=
5571
5572 avoid_version=no
5573 bindir=
5574 dlfiles=
5575 dlprefiles=
5576 dlself=no
5577 export_dynamic=no
5578 export_symbols=
5579 export_symbols_regex=
5580 generated=
5581 libobjs=
5582 ltlibs=
5583 module=no
5584 no_install=no
5585 objs=
5586 non_pic_objects=
5587 precious_files_regex=
5588 prefer_static_libs=no
5589 preload=no
5590 prev=
5591 prevarg=
5592 release=
5593 rpath=
5594 xrpath=
5595 perm_rpath=
5596 temp_rpath=
5597 thread_safe=no
5598 vinfo=
5599 vinfo_number=no
5600 weak_libs=
5601 single_module="${wl}-single_module"
5602 func_infer_tag $base_compile
5603
5604 # We need to know -static, to get the right output filenames.
5605 for arg
5606 do
5607 case $arg in
5608 -shared)
5609 test "$build_libtool_libs" != yes && \
5610 func_fatal_configuration "can not build a shared library"
5611 build_old_libs=no
5612 break
5613 ;;
5614 -all-static | -static | -static-libtool-libs)
5615 case $arg in
5616 -all-static)
5617 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
5618 func_warning "complete static linking is impossible in this configuration"
5619 fi
5620 if test -n "$link_static_flag"; then
5621 dlopen_self=$dlopen_self_static
5622 fi
5623 prefer_static_libs=yes
5624 ;;
5625 -static)
5626 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5627 dlopen_self=$dlopen_self_static
5628 fi
5629 prefer_static_libs=built
5630 ;;
5631 -static-libtool-libs)
5632 if test -z "$pic_flag" && test -n "$link_static_flag"; then
5633 dlopen_self=$dlopen_self_static
5634 fi
5635 prefer_static_libs=yes
5636 ;;
5637 esac
5638 build_libtool_libs=no
5639 build_old_libs=yes
5640 break
5641 ;;
5642 esac
5643 done
5644
5645 # See if our shared archives depend on static archives.
5646 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
5647
5648 # Go through the arguments, transforming them on the way.
5649 while test "$#" -gt 0; do
5650 arg="$1"
5651 shift
5652 func_quote_for_eval "$arg"
5653 qarg=$func_quote_for_eval_unquoted_result
5654 libtool_args="$libtool_args $func_quote_for_eval_result"
5655
5656 # If the previous option needs an argument, assign it.
5657 if test -n "$prev"; then
5658 case $prev in
5659 output)
5660 compile_command="$compile_command @OUTPUT@"
5661 finalize_command="$finalize_command @OUTPUT@"
5662 ;;
5663 esac
5664
5665 case $prev in
5666 bindir)
5667 bindir="$arg"
5668 prev=
5669 continue
5670 ;;
5671 dlfiles|dlprefiles)
5672 if test "$preload" = no; then
5673 # Add the symbol object into the linking commands.
5674 compile_command="$compile_command @SYMFILE@"
5675 finalize_command="$finalize_command @SYMFILE@"
5676 preload=yes
5677 fi
5678 case $arg in
5679 *.la | *.lo) ;; # We handle these cases below.
5680 force)
5681 if test "$dlself" = no; then
5682 dlself=needless
5683 export_dynamic=yes
5684 fi
5685 prev=
5686 continue
5687 ;;
5688 self)
5689 if test "$prev" = dlprefiles; then
5690 dlself=yes
5691 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
5692 dlself=yes
5693 else
5694 dlself=needless
5695 export_dynamic=yes
5696 fi
5697 prev=
5698 continue
5699 ;;
5700 *)
5701 if test "$prev" = dlfiles; then
5702 dlfiles="$dlfiles $arg"
5703 else
5704 dlprefiles="$dlprefiles $arg"
5705 fi
5706 prev=
5707 continue
5708 ;;
5709 esac
5710 ;;
5711 expsyms)
5712 export_symbols="$arg"
5713 test -f "$arg" \
5714 || func_fatal_error "symbol file \`$arg' does not exist"
5715 prev=
5716 continue
5717 ;;
5718 expsyms_regex)
5719 export_symbols_regex="$arg"
5720 prev=
5721 continue
5722 ;;
5723 framework)
5724 case $host in
5725 *-*-darwin*)
5726 case "$deplibs " in
5727 *" $qarg.ltframework "*) ;;
5728 *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
5729 ;;
5730 esac
5731 ;;
5732 esac
5733 prev=
5734 continue
5735 ;;
5736 inst_prefix)
5737 inst_prefix_dir="$arg"
5738 prev=
5739 continue
5740 ;;
5741 objectlist)
5742 if test -f "$arg"; then
5743 save_arg=$arg
5744 moreargs=
5745 for fil in `cat "$save_arg"`
5746 do
5747# moreargs="$moreargs $fil"
5748 arg=$fil
5749 # A libtool-controlled object.
5750
5751 # Check to see that this really is a libtool object.
5752 if func_lalib_unsafe_p "$arg"; then
5753 pic_object=
5754 non_pic_object=
5755
5756 # Read the .lo file
5757 func_source "$arg"
5758
5759 if test -z "$pic_object" ||
5760 test -z "$non_pic_object" ||
5761 test "$pic_object" = none &&
5762 test "$non_pic_object" = none; then
5763 func_fatal_error "cannot find name of object for \`$arg'"
5764 fi
5765
5766 # Extract subdirectory from the argument.
5767 func_dirname "$arg" "/" ""
5768 xdir="$func_dirname_result"
5769
5770 if test "$pic_object" != none; then
5771 # Prepend the subdirectory the object is found in.
5772 pic_object="$xdir$pic_object"
5773
5774 if test "$prev" = dlfiles; then
5775 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
5776 dlfiles="$dlfiles $pic_object"
5777 prev=
5778 continue
5779 else
5780 # If libtool objects are unsupported, then we need to preload.
5781 prev=dlprefiles
5782 fi
5783 fi
5784
5785 # CHECK ME: I think I busted this. -Ossama
5786 if test "$prev" = dlprefiles; then
5787 # Preload the old-style object.
5788 dlprefiles="$dlprefiles $pic_object"
5789 prev=
5790 fi
5791
5792 # A PIC object.
5793 libobjs="$libobjs $pic_object"
5794 arg="$pic_object"
5795 fi
5796
5797 # Non-PIC object.
5798 if test "$non_pic_object" != none; then
5799 # Prepend the subdirectory the object is found in.
5800 non_pic_object="$xdir$non_pic_object"
5801
5802 # A standard non-PIC object
5803 non_pic_objects="$non_pic_objects $non_pic_object"
5804 if test -z "$pic_object" || test "$pic_object" = none ; then
5805 arg="$non_pic_object"
5806 fi
5807 else
5808 # If the PIC object exists, use it instead.
5809 # $xdir was prepended to $pic_object above.
5810 non_pic_object="$pic_object"
5811 non_pic_objects="$non_pic_objects $non_pic_object"
5812 fi
5813 else
5814 # Only an error if not doing a dry-run.
5815 if $opt_dry_run; then
5816 # Extract subdirectory from the argument.
5817 func_dirname "$arg" "/" ""
5818 xdir="$func_dirname_result"
5819
5820 func_lo2o "$arg"
5821 pic_object=$xdir$objdir/$func_lo2o_result
5822 non_pic_object=$xdir$func_lo2o_result
5823 libobjs="$libobjs $pic_object"
5824 non_pic_objects="$non_pic_objects $non_pic_object"
5825 else
5826 func_fatal_error "\`$arg' is not a valid libtool object"
5827 fi
5828 fi
5829 done
5830 else
5831 func_fatal_error "link input file \`$arg' does not exist"
5832 fi
5833 arg=$save_arg
5834 prev=
5835 continue
5836 ;;
5837 precious_regex)
5838 precious_files_regex="$arg"
5839 prev=
5840 continue
5841 ;;
5842 release)
5843 release="-$arg"
5844 prev=
5845 continue
5846 ;;
5847 rpath | xrpath)
5848 # We need an absolute path.
5849 case $arg in
5850 [\\/]* | [A-Za-z]:[\\/]*) ;;
5851 *)
5852 func_fatal_error "only absolute run-paths are allowed"
5853 ;;
5854 esac
5855 if test "$prev" = rpath; then
5856 case "$rpath " in
5857 *" $arg "*) ;;
5858 *) rpath="$rpath $arg" ;;
5859 esac
5860 else
5861 case "$xrpath " in
5862 *" $arg "*) ;;
5863 *) xrpath="$xrpath $arg" ;;
5864 esac
5865 fi
5866 prev=
5867 continue
5868 ;;
5869 shrext)
5870 shrext_cmds="$arg"
5871 prev=
5872 continue
5873 ;;
5874 weak)
5875 weak_libs="$weak_libs $arg"
5876 prev=
5877 continue
5878 ;;
5879 xcclinker)
5880 linker_flags="$linker_flags $qarg"
5881 compiler_flags="$compiler_flags $qarg"
5882 prev=
5883 compile_command="$compile_command $qarg"
5884 finalize_command="$finalize_command $qarg"
5885 continue
5886 ;;
5887 xcompiler)
5888 compiler_flags="$compiler_flags $qarg"
5889 prev=
5890 compile_command="$compile_command $qarg"
5891 finalize_command="$finalize_command $qarg"
5892 continue
5893 ;;
5894 xlinker)
5895 linker_flags="$linker_flags $qarg"
5896 compiler_flags="$compiler_flags $wl$qarg"
5897 prev=
5898 compile_command="$compile_command $wl$qarg"
5899 finalize_command="$finalize_command $wl$qarg"
5900 continue
5901 ;;
5902 *)
5903 eval "$prev=\"\$arg\""
5904 prev=
5905 continue
5906 ;;
5907 esac
5908 fi # test -n "$prev"
5909
5910 prevarg="$arg"
5911
5912 case $arg in
5913 -all-static)
5914 if test -n "$link_static_flag"; then
5915 # See comment for -static flag below, for more details.
5916 compile_command="$compile_command $link_static_flag"
5917 finalize_command="$finalize_command $link_static_flag"
5918 fi
5919 continue
5920 ;;
5921
5922 -allow-undefined)
5923 # FIXME: remove this flag sometime in the future.
5924 func_fatal_error "\`-allow-undefined' must not be used because it is the default"
5925 ;;
5926
5927 -avoid-version)
5928 avoid_version=yes
5929 continue
5930 ;;
5931
5932 -bindir)
5933 prev=bindir
5934 continue
5935 ;;
5936
5937 -dlopen)
5938 prev=dlfiles
5939 continue
5940 ;;
5941
5942 -dlpreopen)
5943 prev=dlprefiles
5944 continue
5945 ;;
5946
5947 -export-dynamic)
5948 export_dynamic=yes
5949 continue
5950 ;;
5951
5952 -export-symbols | -export-symbols-regex)
5953 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
5954 func_fatal_error "more than one -exported-symbols argument is not allowed"
5955 fi
5956 if test "X$arg" = "X-export-symbols"; then
5957 prev=expsyms
5958 else
5959 prev=expsyms_regex
5960 fi
5961 continue
5962 ;;
5963
5964 -framework)
5965 prev=framework
5966 continue
5967 ;;
5968
5969 -inst-prefix-dir)
5970 prev=inst_prefix
5971 continue
5972 ;;
5973
5974 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
5975 # so, if we see these flags be careful not to treat them like -L
5976 -L[A-Z][A-Z]*:*)
5977 case $with_gcc/$host in
5978 no/*-*-irix* | /*-*-irix*)
5979 compile_command="$compile_command $arg"
5980 finalize_command="$finalize_command $arg"
5981 ;;
5982 esac
5983 continue
5984 ;;
5985
5986 -L*)
5987 func_stripname "-L" '' "$arg"
5988 if test -z "$func_stripname_result"; then
5989 if test "$#" -gt 0; then
5990 func_fatal_error "require no space between \`-L' and \`$1'"
5991 else
5992 func_fatal_error "need path for \`-L' option"
5993 fi
5994 fi
5995 func_resolve_sysroot "$func_stripname_result"
5996 dir=$func_resolve_sysroot_result
5997 # We need an absolute path.
5998 case $dir in
5999 [\\/]* | [A-Za-z]:[\\/]*) ;;
6000 *)
6001 absdir=`cd "$dir" && pwd`
6002 test -z "$absdir" && \
6003 func_fatal_error "cannot determine absolute directory name of \`$dir'"
6004 dir="$absdir"
6005 ;;
6006 esac
6007 case "$deplibs " in
6008 *" -L$dir "* | *" $arg "*)
6009 # Will only happen for absolute or sysroot arguments
6010 ;;
6011 *)
6012 # Preserve sysroot, but never include relative directories
6013 case $dir in
6014 [\\/]* | [A-Za-z]:[\\/]* | =*) deplibs="$deplibs $arg" ;;
6015 *) deplibs="$deplibs -L$dir" ;;
6016 esac
6017 lib_search_path="$lib_search_path $dir"
6018 ;;
6019 esac
6020 case $host in
6021 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
6022 testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
6023 case :$dllsearchpath: in
6024 *":$dir:"*) ;;
6025 ::) dllsearchpath=$dir;;
6026 *) dllsearchpath="$dllsearchpath:$dir";;
6027 esac
6028 case :$dllsearchpath: in
6029 *":$testbindir:"*) ;;
6030 ::) dllsearchpath=$testbindir;;
6031 *) dllsearchpath="$dllsearchpath:$testbindir";;
6032 esac
6033 ;;
6034 esac
6035 continue
6036 ;;
6037
6038 -l*)
6039 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
6040 case $host in
6041 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
6042 # These systems don't actually have a C or math library (as such)
6043 continue
6044 ;;
6045 *-*-os2*)
6046 # These systems don't actually have a C library (as such)
6047 test "X$arg" = "X-lc" && continue
6048 ;;
6049 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6050 # Do not include libc due to us having libc/libc_r.
6051 test "X$arg" = "X-lc" && continue
6052 ;;
6053 *-*-rhapsody* | *-*-darwin1.[012])
6054 # Rhapsody C and math libraries are in the System framework
6055 deplibs="$deplibs System.ltframework"
6056 continue
6057 ;;
6058 *-*-sco3.2v5* | *-*-sco5v6*)
6059 # Causes problems with __ctype
6060 test "X$arg" = "X-lc" && continue
6061 ;;
6062 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
6063 # Compiler inserts libc in the correct place for threads to work
6064 test "X$arg" = "X-lc" && continue
6065 ;;
6066 esac
6067 elif test "X$arg" = "X-lc_r"; then
6068 case $host in
6069 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
6070 # Do not include libc_r directly, use -pthread flag.
6071 continue
6072 ;;
6073 esac
6074 fi
6075 deplibs="$deplibs $arg"
6076 continue
6077 ;;
6078
6079 -module)
6080 module=yes
6081 continue
6082 ;;
6083
6084 # Tru64 UNIX uses -model [arg] to determine the layout of C++
6085 # classes, name mangling, and exception handling.
6086 # Darwin uses the -arch flag to determine output architecture.
6087 -model|-arch|-isysroot|--sysroot)
6088 compiler_flags="$compiler_flags $arg"
6089 compile_command="$compile_command $arg"
6090 finalize_command="$finalize_command $arg"
6091 prev=xcompiler
6092 continue
6093 ;;
6094
6095 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6096 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6097 compiler_flags="$compiler_flags $arg"
6098 compile_command="$compile_command $arg"
6099 finalize_command="$finalize_command $arg"
6100 case "$new_inherited_linker_flags " in
6101 *" $arg "*) ;;
6102 * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
6103 esac
6104 continue
6105 ;;
6106
6107 -multi_module)
6108 single_module="${wl}-multi_module"
6109 continue
6110 ;;
6111
6112 -no-fast-install)
6113 fast_install=no
6114 continue
6115 ;;
6116
6117 -no-install)
6118 case $host in
6119 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
6120 # The PATH hackery in wrapper scripts is required on Windows
6121 # and Darwin in order for the loader to find any dlls it needs.
6122 func_warning "\`-no-install' is ignored for $host"
6123 func_warning "assuming \`-no-fast-install' instead"
6124 fast_install=no
6125 ;;
6126 *) no_install=yes ;;
6127 esac
6128 continue
6129 ;;
6130
6131 -no-undefined)
6132 allow_undefined=no
6133 continue
6134 ;;
6135
6136 -objectlist)
6137 prev=objectlist
6138 continue
6139 ;;
6140
6141 -o) prev=output ;;
6142
6143 -precious-files-regex)
6144 prev=precious_regex
6145 continue
6146 ;;
6147
6148 -release)
6149 prev=release
6150 continue
6151 ;;
6152
6153 -rpath)
6154 prev=rpath
6155 continue
6156 ;;
6157
6158 -R)
6159 prev=xrpath
6160 continue
6161 ;;
6162
6163 -R*)
6164 func_stripname '-R' '' "$arg"
6165 dir=$func_stripname_result
6166 # We need an absolute path.
6167 case $dir in
6168 [\\/]* | [A-Za-z]:[\\/]*) ;;
6169 =*)
6170 func_stripname '=' '' "$dir"
6171 dir=$lt_sysroot$func_stripname_result
6172 ;;
6173 *)
6174 func_fatal_error "only absolute run-paths are allowed"
6175 ;;
6176 esac
6177 case "$xrpath " in
6178 *" $dir "*) ;;
6179 *) xrpath="$xrpath $dir" ;;
6180 esac
6181 continue
6182 ;;
6183
6184 -shared)
6185 # The effects of -shared are defined in a previous loop.
6186 continue
6187 ;;
6188
6189 -shrext)
6190 prev=shrext
6191 continue
6192 ;;
6193
6194 -static | -static-libtool-libs)
6195 # The effects of -static are defined in a previous loop.
6196 # We used to do the same as -all-static on platforms that
6197 # didn't have a PIC flag, but the assumption that the effects
6198 # would be equivalent was wrong. It would break on at least
6199 # Digital Unix and AIX.
6200 continue
6201 ;;
6202
6203 -thread-safe)
6204 thread_safe=yes
6205 continue
6206 ;;
6207
6208 -version-info)
6209 prev=vinfo
6210 continue
6211 ;;
6212
6213 -version-number)
6214 prev=vinfo
6215 vinfo_number=yes
6216 continue
6217 ;;
6218
6219 -weak)
6220 prev=weak
6221 continue
6222 ;;
6223
6224 -Wc,*)
6225 func_stripname '-Wc,' '' "$arg"
6226 args=$func_stripname_result
6227 arg=
6228 save_ifs="$IFS"; IFS=','
6229 for flag in $args; do
6230 IFS="$save_ifs"
6231 func_quote_for_eval "$flag"
6232 arg="$arg $func_quote_for_eval_result"
6233 compiler_flags="$compiler_flags $func_quote_for_eval_result"
6234 done
6235 IFS="$save_ifs"
6236 func_stripname ' ' '' "$arg"
6237 arg=$func_stripname_result
6238 ;;
6239
6240 -Wl,*)
6241 func_stripname '-Wl,' '' "$arg"
6242 args=$func_stripname_result
6243 arg=
6244 save_ifs="$IFS"; IFS=','
6245 for flag in $args; do
6246 IFS="$save_ifs"
6247 func_quote_for_eval "$flag"
6248 arg="$arg $wl$func_quote_for_eval_result"
6249 compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
6250 linker_flags="$linker_flags $func_quote_for_eval_result"
6251 done
6252 IFS="$save_ifs"
6253 func_stripname ' ' '' "$arg"
6254 arg=$func_stripname_result
6255 ;;
6256
6257 -Xcompiler)
6258 prev=xcompiler
6259 continue
6260 ;;
6261
6262 -Xlinker)
6263 prev=xlinker
6264 continue
6265 ;;
6266
6267 -XCClinker)
6268 prev=xcclinker
6269 continue
6270 ;;
6271
6272 # -msg_* for osf cc
6273 -msg_*)
6274 func_quote_for_eval "$arg"
6275 arg="$func_quote_for_eval_result"
6276 ;;
6277
6278 # Flags to be passed through unchanged, with rationale:
6279 # -64, -mips[0-9] enable 64-bit mode for the SGI compiler
6280 # -r[0-9][0-9]* specify processor for the SGI compiler
6281 # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
6282 # +DA*, +DD* enable 64-bit mode for the HP compiler
6283 # -q* compiler args for the IBM compiler
6284 # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
6285 # -F/path path to uninstalled frameworks, gcc on darwin
6286 # -p, -pg, --coverage, -fprofile-* profiling flags for GCC
6287 # @file GCC response files
6288 # -tp=* Portland pgcc target processor selection
6289 # --sysroot=* for sysroot support
6290 # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
6291 -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
6292 -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
6293 -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
6294 func_quote_for_eval "$arg"
6295 arg="$func_quote_for_eval_result"
6296 compile_command="$compile_command $arg"
6297 finalize_command="$finalize_command $arg"
6298 compiler_flags="$compiler_flags $arg"
6299 continue
6300 ;;
6301
6302 # Some other compiler flag.
6303 -* | +*)
6304 func_quote_for_eval "$arg"
6305 arg="$func_quote_for_eval_result"
6306 ;;
6307
6308 *.$objext)
6309 # A standard object.
6310 objs="$objs $arg"
6311 ;;
6312
6313 *.lo)
6314 # A libtool-controlled object.
6315
6316 # Check to see that this really is a libtool object.
6317 if func_lalib_unsafe_p "$arg"; then
6318 pic_object=
6319 non_pic_object=
6320
6321 # Read the .lo file
6322 func_source "$arg"
6323
6324 if test -z "$pic_object" ||
6325 test -z "$non_pic_object" ||
6326 test "$pic_object" = none &&
6327 test "$non_pic_object" = none; then
6328 func_fatal_error "cannot find name of object for \`$arg'"
6329 fi
6330
6331 # Extract subdirectory from the argument.
6332 func_dirname "$arg" "/" ""
6333 xdir="$func_dirname_result"
6334
6335 if test "$pic_object" != none; then
6336 # Prepend the subdirectory the object is found in.
6337 pic_object="$xdir$pic_object"
6338
6339 if test "$prev" = dlfiles; then
6340 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
6341 dlfiles="$dlfiles $pic_object"
6342 prev=
6343 continue
6344 else
6345 # If libtool objects are unsupported, then we need to preload.
6346 prev=dlprefiles
6347 fi
6348 fi
6349
6350 # CHECK ME: I think I busted this. -Ossama
6351 if test "$prev" = dlprefiles; then
6352 # Preload the old-style object.
6353 dlprefiles="$dlprefiles $pic_object"
6354 prev=
6355 fi
6356
6357 # A PIC object.
6358 libobjs="$libobjs $pic_object"
6359 arg="$pic_object"
6360 fi
6361
6362 # Non-PIC object.
6363 if test "$non_pic_object" != none; then
6364 # Prepend the subdirectory the object is found in.
6365 non_pic_object="$xdir$non_pic_object"
6366
6367 # A standard non-PIC object
6368 non_pic_objects="$non_pic_objects $non_pic_object"
6369 if test -z "$pic_object" || test "$pic_object" = none ; then
6370 arg="$non_pic_object"
6371 fi
6372 else
6373 # If the PIC object exists, use it instead.
6374 # $xdir was prepended to $pic_object above.
6375 non_pic_object="$pic_object"
6376 non_pic_objects="$non_pic_objects $non_pic_object"
6377 fi
6378 else
6379 # Only an error if not doing a dry-run.
6380 if $opt_dry_run; then
6381 # Extract subdirectory from the argument.
6382 func_dirname "$arg" "/" ""
6383 xdir="$func_dirname_result"
6384
6385 func_lo2o "$arg"
6386 pic_object=$xdir$objdir/$func_lo2o_result
6387 non_pic_object=$xdir$func_lo2o_result
6388 libobjs="$libobjs $pic_object"
6389 non_pic_objects="$non_pic_objects $non_pic_object"
6390 else
6391 func_fatal_error "\`$arg' is not a valid libtool object"
6392 fi
6393 fi
6394 ;;
6395
6396 *.$libext)
6397 # An archive.
6398 deplibs="$deplibs $arg"
6399 old_deplibs="$old_deplibs $arg"
6400 continue
6401 ;;
6402
6403 *.la)
6404 # A libtool-controlled library.
6405
6406 func_resolve_sysroot "$arg"
6407 if test "$prev" = dlfiles; then
6408 # This library was specified with -dlopen.
6409 dlfiles="$dlfiles $func_resolve_sysroot_result"
6410 prev=
6411 elif test "$prev" = dlprefiles; then
6412 # The library was specified with -dlpreopen.
6413 dlprefiles="$dlprefiles $func_resolve_sysroot_result"
6414 prev=
6415 else
6416 deplibs="$deplibs $func_resolve_sysroot_result"
6417 fi
6418 continue
6419 ;;
6420
6421 # Some other compiler argument.
6422 *)
6423 # Unknown arguments in both finalize_command and compile_command need
6424 # to be aesthetically quoted because they are evaled later.
6425 func_quote_for_eval "$arg"
6426 arg="$func_quote_for_eval_result"
6427 ;;
6428 esac # arg
6429
6430 # Now actually substitute the argument into the commands.
6431 if test -n "$arg"; then
6432 compile_command="$compile_command $arg"
6433 finalize_command="$finalize_command $arg"
6434 fi
6435 done # argument parsing loop
6436
6437 test -n "$prev" && \
6438 func_fatal_help "the \`$prevarg' option requires an argument"
6439
6440 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
6441 eval arg=\"$export_dynamic_flag_spec\"
6442 compile_command="$compile_command $arg"
6443 finalize_command="$finalize_command $arg"
6444 fi
6445
6446 oldlibs=
6447 # calculate the name of the file, without its directory
6448 func_basename "$output"
6449 outputname="$func_basename_result"
6450 libobjs_save="$libobjs"
6451
6452 if test -n "$shlibpath_var"; then
6453 # get the directories listed in $shlibpath_var
6454 eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
6455 else
6456 shlib_search_path=
6457 fi
6458 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
6459 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
6460
6461 func_dirname "$output" "/" ""
6462 output_objdir="$func_dirname_result$objdir"
6463 func_to_tool_file "$output_objdir/"
6464 tool_output_objdir=$func_to_tool_file_result
6465 # Create the object directory.
6466 func_mkdir_p "$output_objdir"
6467
6468 # Determine the type of output
6469 case $output in
6470 "")
6471 func_fatal_help "you must specify an output file"
6472 ;;
6473 *.$libext) linkmode=oldlib ;;
6474 *.lo | *.$objext) linkmode=obj ;;
6475 *.la) linkmode=lib ;;
6476 *) linkmode=prog ;; # Anything else should be a program.
6477 esac
6478
6479 specialdeplibs=
6480
6481 libs=
6482 # Find all interdependent deplibs by searching for libraries
6483 # that are linked more than once (e.g. -la -lb -la)
6484 for deplib in $deplibs; do
6485 if $opt_preserve_dup_deps ; then
6486 case "$libs " in
6487 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6488 esac
6489 fi
6490 libs="$libs $deplib"
6491 done
6492
6493 if test "$linkmode" = lib; then
6494 libs="$predeps $libs $compiler_lib_search_path $postdeps"
6495
6496 # Compute libraries that are listed more than once in $predeps
6497 # $postdeps and mark them as special (i.e., whose duplicates are
6498 # not to be eliminated).
6499 pre_post_deps=
6500 if $opt_duplicate_compiler_generated_deps; then
6501 for pre_post_dep in $predeps $postdeps; do
6502 case "$pre_post_deps " in
6503 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
6504 esac
6505 pre_post_deps="$pre_post_deps $pre_post_dep"
6506 done
6507 fi
6508 pre_post_deps=
6509 fi
6510
6511 deplibs=
6512 newdependency_libs=
6513 newlib_search_path=
6514 need_relink=no # whether we're linking any uninstalled libtool libraries
6515 notinst_deplibs= # not-installed libtool libraries
6516 notinst_path= # paths that contain not-installed libtool libraries
6517
6518 case $linkmode in
6519 lib)
6520 passes="conv dlpreopen link"
6521 for file in $dlfiles $dlprefiles; do
6522 case $file in
6523 *.la) ;;
6524 *)
6525 func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
6526 ;;
6527 esac
6528 done
6529 ;;
6530 prog)
6531 compile_deplibs=
6532 finalize_deplibs=
6533 alldeplibs=no
6534 newdlfiles=
6535 newdlprefiles=
6536 passes="conv scan dlopen dlpreopen link"
6537 ;;
6538 *) passes="conv"
6539 ;;
6540 esac
6541
6542 for pass in $passes; do
6543 # The preopen pass in lib mode reverses $deplibs; put it back here
6544 # so that -L comes before libs that need it for instance...
6545 if test "$linkmode,$pass" = "lib,link"; then
6546 ## FIXME: Find the place where the list is rebuilt in the wrong
6547 ## order, and fix it there properly
6548 tmp_deplibs=
6549 for deplib in $deplibs; do
6550 tmp_deplibs="$deplib $tmp_deplibs"
6551 done
6552 deplibs="$tmp_deplibs"
6553 fi
6554
6555 if test "$linkmode,$pass" = "lib,link" ||
6556 test "$linkmode,$pass" = "prog,scan"; then
6557 libs="$deplibs"
6558 deplibs=
6559 fi
6560 if test "$linkmode" = prog; then
6561 case $pass in
6562 dlopen) libs="$dlfiles" ;;
6563 dlpreopen) libs="$dlprefiles" ;;
6564 link)
6565 libs="$deplibs %DEPLIBS%"
6566 test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
6567 ;;
6568 esac
6569 fi
6570 if test "$linkmode,$pass" = "lib,dlpreopen"; then
6571 # Collect and forward deplibs of preopened libtool libs
6572 for lib in $dlprefiles; do
6573 # Ignore non-libtool-libs
6574 dependency_libs=
6575 func_resolve_sysroot "$lib"
6576 case $lib in
6577 *.la) func_source "$func_resolve_sysroot_result" ;;
6578 esac
6579
6580 # Collect preopened libtool deplibs, except any this library
6581 # has declared as weak libs
6582 for deplib in $dependency_libs; do
6583 func_basename "$deplib"
6584 deplib_base=$func_basename_result
6585 case " $weak_libs " in
6586 *" $deplib_base "*) ;;
6587 *) deplibs="$deplibs $deplib" ;;
6588 esac
6589 done
6590 done
6591 libs="$dlprefiles"
6592 fi
6593 if test "$pass" = dlopen; then
6594 # Collect dlpreopened libraries
6595 save_deplibs="$deplibs"
6596 deplibs=
6597 fi
6598
6599 for deplib in $libs; do
6600 lib=
6601 found=no
6602 case $deplib in
6603 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
6604 |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
6605 if test "$linkmode,$pass" = "prog,link"; then
6606 compile_deplibs="$deplib $compile_deplibs"
6607 finalize_deplibs="$deplib $finalize_deplibs"
6608 else
6609 compiler_flags="$compiler_flags $deplib"
6610 if test "$linkmode" = lib ; then
6611 case "$new_inherited_linker_flags " in
6612 *" $deplib "*) ;;
6613 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
6614 esac
6615 fi
6616 fi
6617 continue
6618 ;;
6619 -l*)
6620 if test "$linkmode" != lib && test "$linkmode" != prog; then
6621 func_warning "\`-l' is ignored for archives/objects"
6622 continue
6623 fi
6624 func_stripname '-l' '' "$deplib"
6625 name=$func_stripname_result
6626 if test "$linkmode" = lib; then
6627 searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
6628 else
6629 searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
6630 fi
6631 for searchdir in $searchdirs; do
6632 for search_ext in .la $std_shrext .so .a; do
6633 # Search the libtool library
6634 lib="$searchdir/lib${name}${search_ext}"
6635 if test -f "$lib"; then
6636 if test "$search_ext" = ".la"; then
6637 found=yes
6638 else
6639 found=no
6640 fi
6641 break 2
6642 fi
6643 done
6644 done
6645 if test "$found" != yes; then
6646 # deplib doesn't seem to be a libtool library
6647 if test "$linkmode,$pass" = "prog,link"; then
6648 compile_deplibs="$deplib $compile_deplibs"
6649 finalize_deplibs="$deplib $finalize_deplibs"
6650 else
6651 deplibs="$deplib $deplibs"
6652 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6653 fi
6654 continue
6655 else # deplib is a libtool library
6656 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
6657 # We need to do some special things here, and not later.
6658 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
6659 case " $predeps $postdeps " in
6660 *" $deplib "*)
6661 if func_lalib_p "$lib"; then
6662 library_names=
6663 old_library=
6664 func_source "$lib"
6665 for l in $old_library $library_names; do
6666 ll="$l"
6667 done
6668 if test "X$ll" = "X$old_library" ; then # only static version available
6669 found=no
6670 func_dirname "$lib" "" "."
6671 ladir="$func_dirname_result"
6672 lib=$ladir/$old_library
6673 if test "$linkmode,$pass" = "prog,link"; then
6674 compile_deplibs="$deplib $compile_deplibs"
6675 finalize_deplibs="$deplib $finalize_deplibs"
6676 else
6677 deplibs="$deplib $deplibs"
6678 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
6679 fi
6680 continue
6681 fi
6682 fi
6683 ;;
6684 *) ;;
6685 esac
6686 fi
6687 fi
6688 ;; # -l
6689 *.ltframework)
6690 if test "$linkmode,$pass" = "prog,link"; then
6691 compile_deplibs="$deplib $compile_deplibs"
6692 finalize_deplibs="$deplib $finalize_deplibs"
6693 else
6694 deplibs="$deplib $deplibs"
6695 if test "$linkmode" = lib ; then
6696 case "$new_inherited_linker_flags " in
6697 *" $deplib "*) ;;
6698 * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
6699 esac
6700 fi
6701 fi
6702 continue
6703 ;;
6704 -L*)
6705 case $linkmode in
6706 lib)
6707 deplibs="$deplib $deplibs"
6708 test "$pass" = conv && continue
6709 newdependency_libs="$deplib $newdependency_libs"
6710 func_stripname '-L' '' "$deplib"
6711 func_resolve_sysroot "$func_stripname_result"
6712 newlib_search_path="$newlib_search_path $func_resolve_sysroot_result"
6713 ;;
6714 prog)
6715 if test "$pass" = conv; then
6716 deplibs="$deplib $deplibs"
6717 continue
6718 fi
6719 if test "$pass" = scan; then
6720 deplibs="$deplib $deplibs"
6721 else
6722 compile_deplibs="$deplib $compile_deplibs"
6723 finalize_deplibs="$deplib $finalize_deplibs"
6724 fi
6725 func_stripname '-L' '' "$deplib"
6726 func_resolve_sysroot "$func_stripname_result"
6727 newlib_search_path="$newlib_search_path $func_resolve_sysroot_result"
6728 ;;
6729 *)
6730 func_warning "\`-L' is ignored for archives/objects"
6731 ;;
6732 esac # linkmode
6733 continue
6734 ;; # -L
6735 -R*)
6736 if test "$pass" = link; then
6737 func_stripname '-R' '' "$deplib"
6738 func_resolve_sysroot "$func_stripname_result"
6739 dir=$func_resolve_sysroot_result
6740 # Make sure the xrpath contains only unique directories.
6741 case "$xrpath " in
6742 *" $dir "*) ;;
6743 *) xrpath="$xrpath $dir" ;;
6744 esac
6745 fi
6746 deplibs="$deplib $deplibs"
6747 continue
6748 ;;
6749 *.la)
6750 func_resolve_sysroot "$deplib"
6751 lib=$func_resolve_sysroot_result
6752 ;;
6753 *.$libext)
6754 if test "$pass" = conv; then
6755 deplibs="$deplib $deplibs"
6756 continue
6757 fi
6758 case $linkmode in
6759 lib)
6760 # Linking convenience modules into shared libraries is allowed,
6761 # but linking other static libraries is non-portable.
6762 case " $dlpreconveniencelibs " in
6763 *" $deplib "*) ;;
6764 *)
6765 valid_a_lib=no
6766 case $deplibs_check_method in
6767 match_pattern*)
6768 set dummy $deplibs_check_method; shift
6769 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
6770 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
6771 | $EGREP "$match_pattern_regex" > /dev/null; then
6772 valid_a_lib=yes
6773 fi
6774 ;;
6775 pass_all)
6776 valid_a_lib=yes
6777 ;;
6778 esac
6779 if test "$valid_a_lib" != yes; then
6780 echo
6781 $ECHO "*** Warning: Trying to link with static lib archive $deplib."
6782 echo "*** I have the capability to make that library automatically link in when"
6783 echo "*** you link to this library. But I can only do this if you have a"
6784 echo "*** shared version of the library, which you do not appear to have"
6785 echo "*** because the file extensions .$libext of this argument makes me believe"
6786 echo "*** that it is just a static archive that I should not use here."
6787 else
6788 echo
6789 $ECHO "*** Warning: Linking the shared library $output against the"
6790 $ECHO "*** static library $deplib is not portable!"
6791 deplibs="$deplib $deplibs"
6792 fi
6793 ;;
6794 esac
6795 continue
6796 ;;
6797 prog)
6798 if test "$pass" != link; then
6799 deplibs="$deplib $deplibs"
6800 else
6801 compile_deplibs="$deplib $compile_deplibs"
6802 finalize_deplibs="$deplib $finalize_deplibs"
6803 fi
6804 continue
6805 ;;
6806 esac # linkmode
6807 ;; # *.$libext
6808 *.lo | *.$objext)
6809 if test "$pass" = conv; then
6810 deplibs="$deplib $deplibs"
6811 elif test "$linkmode" = prog; then
6812 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
6813 # If there is no dlopen support or we're linking statically,
6814 # we need to preload.
6815 newdlprefiles="$newdlprefiles $deplib"
6816 compile_deplibs="$deplib $compile_deplibs"
6817 finalize_deplibs="$deplib $finalize_deplibs"
6818 else
6819 newdlfiles="$newdlfiles $deplib"
6820 fi
6821 fi
6822 continue
6823 ;;
6824 %DEPLIBS%)
6825 alldeplibs=yes
6826 continue
6827 ;;
6828 esac # case $deplib
6829
6830 if test "$found" = yes || test -f "$lib"; then :
6831 else
6832 func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
6833 fi
6834
6835 # Check to see that this really is a libtool archive.
6836 func_lalib_unsafe_p "$lib" \
6837 || func_fatal_error "\`$lib' is not a valid libtool archive"
6838
6839 func_dirname "$lib" "" "."
6840 ladir="$func_dirname_result"
6841
6842 dlname=
6843 dlopen=
6844 dlpreopen=
6845 libdir=
6846 library_names=
6847 old_library=
6848 inherited_linker_flags=
6849 # If the library was installed with an old release of libtool,
6850 # it will not redefine variables installed, or shouldnotlink
6851 installed=yes
6852 shouldnotlink=no
6853 avoidtemprpath=
6854
6855
6856 # Read the .la file
6857 func_source "$lib"
6858
6859 # Convert "-framework foo" to "foo.ltframework"
6860 if test -n "$inherited_linker_flags"; then
6861 tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
6862 for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
6863 case " $new_inherited_linker_flags " in
6864 *" $tmp_inherited_linker_flag "*) ;;
6865 *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
6866 esac
6867 done
6868 fi
6869 dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
6870 if test "$linkmode,$pass" = "lib,link" ||
6871 test "$linkmode,$pass" = "prog,scan" ||
6872 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
6873 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
6874 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
6875 fi
6876
6877 if test "$pass" = conv; then
6878 # Only check for convenience libraries
6879 deplibs="$lib $deplibs"
6880 if test -z "$libdir"; then
6881 if test -z "$old_library"; then
6882 func_fatal_error "cannot find name of link library for \`$lib'"
6883 fi
6884 # It is a libtool convenience library, so add in its objects.
6885 convenience="$convenience $ladir/$objdir/$old_library"
6886 old_convenience="$old_convenience $ladir/$objdir/$old_library"
6887 tmp_libs=
6888 for deplib in $dependency_libs; do
6889 deplibs="$deplib $deplibs"
6890 if $opt_preserve_dup_deps ; then
6891 case "$tmp_libs " in
6892 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
6893 esac
6894 fi
6895 tmp_libs="$tmp_libs $deplib"
6896 done
6897 elif test "$linkmode" != prog && test "$linkmode" != lib; then
6898 func_fatal_error "\`$lib' is not a convenience library"
6899 fi
6900 continue
6901 fi # $pass = conv
6902
6903
6904 # Get the name of the library we link against.
6905 linklib=
6906 if test -n "$old_library" &&
6907 { test "$prefer_static_libs" = yes ||
6908 test "$prefer_static_libs,$installed" = "built,no"; }; then
6909 linklib=$old_library
6910 else
6911 for l in $old_library $library_names; do
6912 linklib="$l"
6913 done
6914 fi
6915 if test -z "$linklib"; then
6916 func_fatal_error "cannot find name of link library for \`$lib'"
6917 fi
6918
6919 # This library was specified with -dlopen.
6920 if test "$pass" = dlopen; then
6921 if test -z "$libdir"; then
6922 func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
6923 fi
6924 if test -z "$dlname" ||
6925 test "$dlopen_support" != yes ||
6926 test "$build_libtool_libs" = no; then
6927 # If there is no dlname, no dlopen support or we're linking
6928 # statically, we need to preload. We also need to preload any
6929 # dependent libraries so libltdl's deplib preloader doesn't
6930 # bomb out in the load deplibs phase.
6931 dlprefiles="$dlprefiles $lib $dependency_libs"
6932 else
6933 newdlfiles="$newdlfiles $lib"
6934 fi
6935 continue
6936 fi # $pass = dlopen
6937
6938 # We need an absolute path.
6939 case $ladir in
6940 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
6941 *)
6942 abs_ladir=`cd "$ladir" && pwd`
6943 if test -z "$abs_ladir"; then
6944 func_warning "cannot determine absolute directory name of \`$ladir'"
6945 func_warning "passing it literally to the linker, although it might fail"
6946 abs_ladir="$ladir"
6947 fi
6948 ;;
6949 esac
6950 func_basename "$lib"
6951 laname="$func_basename_result"
6952
6953 # Find the relevant object directory and library name.
6954 if test "X$installed" = Xyes; then
6955 if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6956 func_warning "library \`$lib' was moved."
6957 dir="$ladir"
6958 absdir="$abs_ladir"
6959 libdir="$abs_ladir"
6960 else
6961 dir="$lt_sysroot$libdir"
6962 absdir="$lt_sysroot$libdir"
6963 fi
6964 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
6965 else
6966 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
6967 dir="$ladir"
6968 absdir="$abs_ladir"
6969 # Remove this search path later
6970 notinst_path="$notinst_path $abs_ladir"
6971 else
6972 dir="$ladir/$objdir"
6973 absdir="$abs_ladir/$objdir"
6974 # Remove this search path later
6975 notinst_path="$notinst_path $abs_ladir"
6976 fi
6977 fi # $installed = yes
6978 func_stripname 'lib' '.la' "$laname"
6979 name=$func_stripname_result
6980
6981 # This library was specified with -dlpreopen.
6982 if test "$pass" = dlpreopen; then
6983 if test -z "$libdir" && test "$linkmode" = prog; then
6984 func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
6985 fi
6986 case "$host" in
6987 # special handling for platforms with PE-DLLs.
6988 *cygwin* | *mingw* | *cegcc* )
6989 # Linker will automatically link against shared library if both
6990 # static and shared are present. Therefore, ensure we extract
6991 # symbols from the import library if a shared library is present
6992 # (otherwise, the dlopen module name will be incorrect). We do
6993 # this by putting the import library name into $newdlprefiles.
6994 # We recover the dlopen module name by 'saving' the la file
6995 # name in a special purpose variable, and (later) extracting the
6996 # dlname from the la file.
6997 if test -n "$dlname"; then
6998 func_tr_sh "$dir/$linklib"
6999 eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
7000 newdlprefiles="$newdlprefiles $dir/$linklib"
7001 else
7002 newdlprefiles="$newdlprefiles $dir/$old_library"
7003 # Keep a list of preopened convenience libraries to check
7004 # that they are being used correctly in the link pass.
7005 test -z "$libdir" && \
7006 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
7007 fi
7008 ;;
7009 * )
7010 # Prefer using a static library (so that no silly _DYNAMIC symbols
7011 # are required to link).
7012 if test -n "$old_library"; then
7013 newdlprefiles="$newdlprefiles $dir/$old_library"
7014 # Keep a list of preopened convenience libraries to check
7015 # that they are being used correctly in the link pass.
7016 test -z "$libdir" && \
7017 dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
7018 # Otherwise, use the dlname, so that lt_dlopen finds it.
7019 elif test -n "$dlname"; then
7020 newdlprefiles="$newdlprefiles $dir/$dlname"
7021 else
7022 newdlprefiles="$newdlprefiles $dir/$linklib"
7023 fi
7024 ;;
7025 esac
7026 fi # $pass = dlpreopen
7027
7028 if test -z "$libdir"; then
7029 # Link the convenience library
7030 if test "$linkmode" = lib; then
7031 deplibs="$dir/$old_library $deplibs"
7032 elif test "$linkmode,$pass" = "prog,link"; then
7033 compile_deplibs="$dir/$old_library $compile_deplibs"
7034 finalize_deplibs="$dir/$old_library $finalize_deplibs"
7035 else
7036 deplibs="$lib $deplibs" # used for prog,scan pass
7037 fi
7038 continue
7039 fi
7040
7041
7042 if test "$linkmode" = prog && test "$pass" != link; then
7043 newlib_search_path="$newlib_search_path $ladir"
7044 deplibs="$lib $deplibs"
7045
7046 linkalldeplibs=no
7047 if test "$link_all_deplibs" != no || test -z "$library_names" ||
7048 test "$build_libtool_libs" = no; then
7049 linkalldeplibs=yes
7050 fi
7051
7052 tmp_libs=
7053 for deplib in $dependency_libs; do
7054 case $deplib in
7055 -L*) func_stripname '-L' '' "$deplib"
7056 func_resolve_sysroot "$func_stripname_result"
7057 newlib_search_path="$newlib_search_path $func_resolve_sysroot_result"
7058 ;;
7059 esac
7060 # Need to link against all dependency_libs?
7061 if test "$linkalldeplibs" = yes; then
7062 deplibs="$deplib $deplibs"
7063 else
7064 # Need to hardcode shared library paths
7065 # or/and link against static libraries
7066 newdependency_libs="$deplib $newdependency_libs"
7067 fi
7068 if $opt_preserve_dup_deps ; then
7069 case "$tmp_libs " in
7070 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
7071 esac
7072 fi
7073 tmp_libs="$tmp_libs $deplib"
7074 done # for deplib
7075 continue
7076 fi # $linkmode = prog...
7077
7078 if test "$linkmode,$pass" = "prog,link"; then
7079 if test -n "$library_names" &&
7080 { { test "$prefer_static_libs" = no ||
7081 test "$prefer_static_libs,$installed" = "built,yes"; } ||
7082 test -z "$old_library"; }; then
7083 # We need to hardcode the library path
7084 if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
7085 # Make sure the rpath contains only unique directories.
7086 case "$temp_rpath:" in
7087 *"$absdir:"*) ;;
7088 *) temp_rpath="$temp_rpath$absdir:" ;;
7089 esac
7090 fi
7091
7092 # Hardcode the library path.
7093 # Skip directories that are in the system default run-time
7094 # search path.
7095 case " $sys_lib_dlsearch_path " in
7096 *" $absdir "*) ;;
7097 *)
7098 case "$compile_rpath " in
7099 *" $absdir "*) ;;
7100 *) compile_rpath="$compile_rpath $absdir" ;;
7101 esac
7102 ;;
7103 esac
7104 case " $sys_lib_dlsearch_path " in
7105 *" $libdir "*) ;;
7106 *)
7107 case "$finalize_rpath " in
7108 *" $libdir "*) ;;
7109 *) finalize_rpath="$finalize_rpath $libdir" ;;
7110 esac
7111 ;;
7112 esac
7113 fi # $linkmode,$pass = prog,link...
7114
7115 if test "$alldeplibs" = yes &&
7116 { test "$deplibs_check_method" = pass_all ||
7117 { test "$build_libtool_libs" = yes &&
7118 test -n "$library_names"; }; }; then
7119 # We only need to search for static libraries
7120 continue
7121 fi
7122 fi
7123
7124 link_static=no # Whether the deplib will be linked statically
7125 use_static_libs=$prefer_static_libs
7126 if test "$use_static_libs" = built && test "$installed" = yes; then
7127 use_static_libs=no
7128 fi
7129 if test -n "$library_names" &&
7130 { test "$use_static_libs" = no || test -z "$old_library"; }; then
7131 case $host in
7132 *cygwin* | *mingw* | *cegcc*)
7133 # No point in relinking DLLs because paths are not encoded
7134 notinst_deplibs="$notinst_deplibs $lib"
7135 need_relink=no
7136 ;;
7137 *)
7138 if test "$installed" = no; then
7139 notinst_deplibs="$notinst_deplibs $lib"
7140 need_relink=yes
7141 fi
7142 ;;
7143 esac
7144 # This is a shared library
7145
7146 # Warn about portability, can't link against -module's on some
7147 # systems (darwin). Don't bleat about dlopened modules though!
7148 dlopenmodule=""
7149 for dlpremoduletest in $dlprefiles; do
7150 if test "X$dlpremoduletest" = "X$lib"; then
7151 dlopenmodule="$dlpremoduletest"
7152 break
7153 fi
7154 done
7155 if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
7156 echo
7157 if test "$linkmode" = prog; then
7158 $ECHO "*** Warning: Linking the executable $output against the loadable module"
7159 else
7160 $ECHO "*** Warning: Linking the shared library $output against the loadable module"
7161 fi
7162 $ECHO "*** $linklib is not portable!"
7163 fi
7164 if test "$linkmode" = lib &&
7165 test "$hardcode_into_libs" = yes; then
7166 # Hardcode the library path.
7167 # Skip directories that are in the system default run-time
7168 # search path.
7169 case " $sys_lib_dlsearch_path " in
7170 *" $absdir "*) ;;
7171 *)
7172 case "$compile_rpath " in
7173 *" $absdir "*) ;;
7174 *) compile_rpath="$compile_rpath $absdir" ;;
7175 esac
7176 ;;
7177 esac
7178 case " $sys_lib_dlsearch_path " in
7179 *" $libdir "*) ;;
7180 *)
7181 case "$finalize_rpath " in
7182 *" $libdir "*) ;;
7183 *) finalize_rpath="$finalize_rpath $libdir" ;;
7184 esac
7185 ;;
7186 esac
7187 fi
7188
7189 if test -n "$old_archive_from_expsyms_cmds"; then
7190 # figure out the soname
7191 set dummy $library_names
7192 shift
7193 realname="$1"
7194 shift
7195 libname=`eval "\\$ECHO \"$libname_spec\""`
7196 # use dlname if we got it. it's perfectly good, no?
7197 if test -n "$dlname"; then
7198 soname="$dlname"
7199 elif test -n "$soname_spec"; then
7200 # bleh windows
7201 case $host in
7202 *cygwin* | mingw* | *cegcc*)
7203 func_arith $current - $age
7204 major=$func_arith_result
7205 versuffix="-$major"
7206 ;;
7207 esac
7208 eval soname=\"$soname_spec\"
7209 else
7210 soname="$realname"
7211 fi
7212
7213 # Make a new name for the extract_expsyms_cmds to use
7214 soroot="$soname"
7215 func_basename "$soroot"
7216 soname="$func_basename_result"
7217 func_stripname 'lib' '.dll' "$soname"
7218 newlib=libimp-$func_stripname_result.a
7219
7220 # If the library has no export list, then create one now
7221 if test -f "$output_objdir/$soname-def"; then :
7222 else
7223 func_verbose "extracting exported symbol list from \`$soname'"
7224 func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
7225 fi
7226
7227 # Create $newlib
7228 if test -f "$output_objdir/$newlib"; then :; else
7229 func_verbose "generating import library for \`$soname'"
7230 func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
7231 fi
7232 # make sure the library variables are pointing to the new library
7233 dir=$output_objdir
7234 linklib=$newlib
7235 fi # test -n "$old_archive_from_expsyms_cmds"
7236
7237 if test "$linkmode" = prog || test "$opt_mode" != relink; then
7238 add_shlibpath=
7239 add_dir=
7240 add=
7241 lib_linked=yes
7242 case $hardcode_action in
7243 immediate | unsupported)
7244 if test "$hardcode_direct" = no; then
7245 add="$dir/$linklib"
7246 case $host in
7247 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
7248 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
7249 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
7250 *-*-unixware7*) add_dir="-L$dir" ;;
7251 *-*-darwin* )
7252 # if the lib is a (non-dlopened) module then we can not
7253 # link against it, someone is ignoring the earlier warnings
7254 if /usr/bin/file -L $add 2> /dev/null |
7255 $GREP ": [^:]* bundle" >/dev/null ; then
7256 if test "X$dlopenmodule" != "X$lib"; then
7257 $ECHO "*** Warning: lib $linklib is a module, not a shared library"
7258 if test -z "$old_library" ; then
7259 echo
7260 echo "*** And there doesn't seem to be a static archive available"
7261 echo "*** The link will probably fail, sorry"
7262 else
7263 add="$dir/$old_library"
7264 fi
7265 elif test -n "$old_library"; then
7266 add="$dir/$old_library"
7267 fi
7268 fi
7269 esac
7270 elif test "$hardcode_minus_L" = no; then
7271 case $host in
7272 *-*-sunos*) add_shlibpath="$dir" ;;
7273 esac
7274 add_dir="-L$dir"
7275 add="-l$name"
7276 elif test "$hardcode_shlibpath_var" = no; then
7277 add_shlibpath="$dir"
7278 add="-l$name"
7279 else
7280 lib_linked=no
7281 fi
7282 ;;
7283 relink)
7284 if test "$hardcode_direct" = yes &&
7285 test "$hardcode_direct_absolute" = no; then
7286 add="$dir/$linklib"
7287 elif test "$hardcode_minus_L" = yes; then
7288 add_dir="-L$absdir"
7289 # Try looking first in the location we're being installed to.
7290 if test -n "$inst_prefix_dir"; then
7291 case $libdir in
7292 [\\/]*)
7293 add_dir="$add_dir -L$inst_prefix_dir$libdir"
7294 ;;
7295 esac
7296 fi
7297 add="-l$name"
7298 elif test "$hardcode_shlibpath_var" = yes; then
7299 add_shlibpath="$dir"
7300 add="-l$name"
7301 else
7302 lib_linked=no
7303 fi
7304 ;;
7305 *) lib_linked=no ;;
7306 esac
7307
7308 if test "$lib_linked" != yes; then
7309 func_fatal_configuration "unsupported hardcode properties"
7310 fi
7311
7312 if test -n "$add_shlibpath"; then
7313 case :$compile_shlibpath: in
7314 *":$add_shlibpath:"*) ;;
7315 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
7316 esac
7317 fi
7318 if test "$linkmode" = prog; then
7319 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
7320 test -n "$add" && compile_deplibs="$add $compile_deplibs"
7321 else
7322 test -n "$add_dir" && deplibs="$add_dir $deplibs"
7323 test -n "$add" && deplibs="$add $deplibs"
7324 if test "$hardcode_direct" != yes &&
7325 test "$hardcode_minus_L" != yes &&
7326 test "$hardcode_shlibpath_var" = yes; then
7327 case :$finalize_shlibpath: in
7328 *":$libdir:"*) ;;
7329 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
7330 esac
7331 fi
7332 fi
7333 fi
7334
7335 if test "$linkmode" = prog || test "$opt_mode" = relink; then
7336 add_shlibpath=
7337 add_dir=
7338 add=
7339 # Finalize command for both is simple: just hardcode it.
7340 if test "$hardcode_direct" = yes &&
7341 test "$hardcode_direct_absolute" = no; then
7342 add="$libdir/$linklib"
7343 elif test "$hardcode_minus_L" = yes; then
7344 add_dir="-L$libdir"
7345 add="-l$name"
7346 elif test "$hardcode_shlibpath_var" = yes; then
7347 case :$finalize_shlibpath: in
7348 *":$libdir:"*) ;;
7349 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
7350 esac
7351 add="-l$name"
7352 elif test "$hardcode_automatic" = yes; then
7353 if test -n "$inst_prefix_dir" &&
7354 test -f "$inst_prefix_dir$libdir/$linklib" ; then
7355 add="$inst_prefix_dir$libdir/$linklib"
7356 else
7357 add="$libdir/$linklib"
7358 fi
7359 else
7360 # We cannot seem to hardcode it, guess we'll fake it.
7361 add_dir="-L$libdir"
7362 # Try looking first in the location we're being installed to.
7363 if test -n "$inst_prefix_dir"; then
7364 case $libdir in
7365 [\\/]*)
7366 add_dir="$add_dir -L$inst_prefix_dir$libdir"
7367 ;;
7368 esac
7369 fi
7370 add="-l$name"
7371 fi
7372
7373 if test "$linkmode" = prog; then
7374 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
7375 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
7376 else
7377 test -n "$add_dir" && deplibs="$add_dir $deplibs"
7378 test -n "$add" && deplibs="$add $deplibs"
7379 fi
7380 fi
7381 elif test "$linkmode" = prog; then
7382 # Here we assume that one of hardcode_direct or hardcode_minus_L
7383 # is not unsupported. This is valid on all known static and
7384 # shared platforms.
7385 if test "$hardcode_direct" != unsupported; then
7386 test -n "$old_library" && linklib="$old_library"
7387 compile_deplibs="$dir/$linklib $compile_deplibs"
7388 finalize_deplibs="$dir/$linklib $finalize_deplibs"
7389 else
7390 compile_deplibs="-l$name -L$dir $compile_deplibs"
7391 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
7392 fi
7393 elif test "$build_libtool_libs" = yes; then
7394 # Not a shared library
7395 if test "$deplibs_check_method" != pass_all; then
7396 # We're trying link a shared library against a static one
7397 # but the system doesn't support it.
7398
7399 # Just print a warning and add the library to dependency_libs so
7400 # that the program can be linked against the static library.
7401 echo
7402 $ECHO "*** Warning: This system can not link to static lib archive $lib."
7403 echo "*** I have the capability to make that library automatically link in when"
7404 echo "*** you link to this library. But I can only do this if you have a"
7405 echo "*** shared version of the library, which you do not appear to have."
7406 if test "$module" = yes; then
7407 echo "*** But as you try to build a module library, libtool will still create "
7408 echo "*** a static module, that should work as long as the dlopening application"
7409 echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
7410 if test -z "$global_symbol_pipe"; then
7411 echo
7412 echo "*** However, this would only work if libtool was able to extract symbol"
7413 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
7414 echo "*** not find such a program. So, this module is probably useless."
7415 echo "*** \`nm' from GNU binutils and a full rebuild may help."
7416 fi
7417 if test "$build_old_libs" = no; then
7418 build_libtool_libs=module
7419 build_old_libs=yes
7420 else
7421 build_libtool_libs=no
7422 fi
7423 fi
7424 else
7425 deplibs="$dir/$old_library $deplibs"
7426 link_static=yes
7427 fi
7428 fi # link shared/static library?
7429
7430 if test "$linkmode" = lib; then
7431 if test -n "$dependency_libs" &&
7432 { test "$hardcode_into_libs" != yes ||
7433 test "$build_old_libs" = yes ||
7434 test "$link_static" = yes; }; then
7435 # Extract -R from dependency_libs
7436 temp_deplibs=
7437 for libdir in $dependency_libs; do
7438 case $libdir in
7439 -R*) func_stripname '-R' '' "$libdir"
7440 temp_xrpath=$func_stripname_result
7441 case " $xrpath " in
7442 *" $temp_xrpath "*) ;;
7443 *) xrpath="$xrpath $temp_xrpath";;
7444 esac;;
7445 *) temp_deplibs="$temp_deplibs $libdir";;
7446 esac
7447 done
7448 dependency_libs="$temp_deplibs"
7449 fi
7450
7451 newlib_search_path="$newlib_search_path $absdir"
7452 # Link against this library
7453 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
7454 # ... and its dependency_libs
7455 tmp_libs=
7456 for deplib in $dependency_libs; do
7457 newdependency_libs="$deplib $newdependency_libs"
7458 case $deplib in
7459 -L*) func_stripname '-L' '' "$deplib"
7460 func_resolve_sysroot "$func_stripname_result";;
7461 *) func_resolve_sysroot "$deplib" ;;
7462 esac
7463 if $opt_preserve_dup_deps ; then
7464 case "$tmp_libs " in
7465 *" $func_resolve_sysroot_result "*)
7466 specialdeplibs="$specialdeplibs $func_resolve_sysroot_result" ;;
7467 esac
7468 fi
7469 tmp_libs="$tmp_libs $func_resolve_sysroot_result"
7470 done
7471
7472 if test "$link_all_deplibs" != no; then
7473 # Add the search paths of all dependency libraries
7474 for deplib in $dependency_libs; do
7475 path=
7476 case $deplib in
7477 -L*) path="$deplib" ;;
7478 *.la)
7479 func_resolve_sysroot "$deplib"
7480 deplib=$func_resolve_sysroot_result
7481 func_dirname "$deplib" "" "."
7482 dir=$func_dirname_result
7483 # We need an absolute path.
7484 case $dir in
7485 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
7486 *)
7487 absdir=`cd "$dir" && pwd`
7488 if test -z "$absdir"; then
7489 func_warning "cannot determine absolute directory name of \`$dir'"
7490 absdir="$dir"
7491 fi
7492 ;;
7493 esac
7494 if $GREP "^installed=no" $deplib > /dev/null; then
7495 case $host in
7496 *-*-darwin*)
7497 depdepl=
7498 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
7499 if test -n "$deplibrary_names" ; then
7500 for tmp in $deplibrary_names ; do
7501 depdepl=$tmp
7502 done
7503 if test -f "$absdir/$objdir/$depdepl" ; then
7504 depdepl="$absdir/$objdir/$depdepl"
7505 darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7506 if test -z "$darwin_install_name"; then
7507 darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
7508 fi
7509 compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
7510 linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
7511 path=
7512 fi
7513 fi
7514 ;;
7515 *)
7516 path="-L$absdir/$objdir"
7517 ;;
7518 esac
7519 else
7520 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
7521 test -z "$libdir" && \
7522 func_fatal_error "\`$deplib' is not a valid libtool archive"
7523 test "$absdir" != "$libdir" && \
7524 func_warning "\`$deplib' seems to be moved"
7525
7526 path="-L$absdir"
7527 fi
7528 ;;
7529 esac
7530 case " $deplibs " in
7531 *" $path "*) ;;
7532 *) deplibs="$path $deplibs" ;;
7533 esac
7534 done
7535 fi # link_all_deplibs != no
7536 fi # linkmode = lib
7537 done # for deplib in $libs
7538 if test "$pass" = link; then
7539 if test "$linkmode" = "prog"; then
7540 compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
7541 finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
7542 else
7543 compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
7544 fi
7545 fi
7546 dependency_libs="$newdependency_libs"
7547 if test "$pass" = dlpreopen; then
7548 # Link the dlpreopened libraries before other libraries
7549 for deplib in $save_deplibs; do
7550 deplibs="$deplib $deplibs"
7551 done
7552 fi
7553 if test "$pass" != dlopen; then
7554 if test "$pass" != conv; then
7555 # Make sure lib_search_path contains only unique directories.
7556 lib_search_path=
7557 for dir in $newlib_search_path; do
7558 case "$lib_search_path " in
7559 *" $dir "*) ;;
7560 *) lib_search_path="$lib_search_path $dir" ;;
7561 esac
7562 done
7563 newlib_search_path=
7564 fi
7565
7566 if test "$linkmode,$pass" != "prog,link"; then
7567 vars="deplibs"
7568 else
7569 vars="compile_deplibs finalize_deplibs"
7570 fi
7571 for var in $vars dependency_libs; do
7572 # Add libraries to $var in reverse order
7573 eval tmp_libs=\"\$$var\"
7574 new_libs=
7575 for deplib in $tmp_libs; do
7576 # FIXME: Pedantically, this is the right thing to do, so
7577 # that some nasty dependency loop isn't accidentally
7578 # broken:
7579 #new_libs="$deplib $new_libs"
7580 # Pragmatically, this seems to cause very few problems in
7581 # practice:
7582 case $deplib in
7583 -L*) new_libs="$deplib $new_libs" ;;
7584 -R*) ;;
7585 *)
7586 # And here is the reason: when a library appears more
7587 # than once as an explicit dependence of a library, or
7588 # is implicitly linked in more than once by the
7589 # compiler, it is considered special, and multiple
7590 # occurrences thereof are not removed. Compare this
7591 # with having the same library being listed as a
7592 # dependency of multiple other libraries: in this case,
7593 # we know (pedantically, we assume) the library does not
7594 # need to be listed more than once, so we keep only the
7595 # last copy. This is not always right, but it is rare
7596 # enough that we require users that really mean to play
7597 # such unportable linking tricks to link the library
7598 # using -Wl,-lname, so that libtool does not consider it
7599 # for duplicate removal.
7600 case " $specialdeplibs " in
7601 *" $deplib "*) new_libs="$deplib $new_libs" ;;
7602 *)
7603 case " $new_libs " in
7604 *" $deplib "*) ;;
7605 *) new_libs="$deplib $new_libs" ;;
7606 esac
7607 ;;
7608 esac
7609 ;;
7610 esac
7611 done
7612 tmp_libs=
7613 for deplib in $new_libs; do
7614 case $deplib in
7615 -L*)
7616 case " $tmp_libs " in
7617 *" $deplib "*) ;;
7618 *) tmp_libs="$tmp_libs $deplib" ;;
7619 esac
7620 ;;
7621 *) tmp_libs="$tmp_libs $deplib" ;;
7622 esac
7623 done
7624 eval $var=\"$tmp_libs\"
7625 done # for var
7626 fi
7627 # Last step: remove runtime libs from dependency_libs
7628 # (they stay in deplibs)
7629 tmp_libs=
7630 for i in $dependency_libs ; do
7631 case " $predeps $postdeps $compiler_lib_search_path " in
7632 *" $i "*)
7633 i=""
7634 ;;
7635 esac
7636 if test -n "$i" ; then
7637 tmp_libs="$tmp_libs $i"
7638 fi
7639 done
7640 dependency_libs=$tmp_libs
7641 done # for pass
7642 if test "$linkmode" = prog; then
7643 dlfiles="$newdlfiles"
7644 fi
7645 if test "$linkmode" = prog || test "$linkmode" = lib; then
7646 dlprefiles="$newdlprefiles"
7647 fi
7648
7649 case $linkmode in
7650 oldlib)
7651 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
7652 func_warning "\`-dlopen' is ignored for archives"
7653 fi
7654
7655 case " $deplibs" in
7656 *\ -l* | *\ -L*)
7657 func_warning "\`-l' and \`-L' are ignored for archives" ;;
7658 esac
7659
7660 test -n "$rpath" && \
7661 func_warning "\`-rpath' is ignored for archives"
7662
7663 test -n "$xrpath" && \
7664 func_warning "\`-R' is ignored for archives"
7665
7666 test -n "$vinfo" && \
7667 func_warning "\`-version-info/-version-number' is ignored for archives"
7668
7669 test -n "$release" && \
7670 func_warning "\`-release' is ignored for archives"
7671
7672 test -n "$export_symbols$export_symbols_regex" && \
7673 func_warning "\`-export-symbols' is ignored for archives"
7674
7675 # Now set the variables for building old libraries.
7676 build_libtool_libs=no
7677 oldlibs="$output"
7678 objs="$objs$old_deplibs"
7679 ;;
7680
7681 lib)
7682 # Make sure we only generate libraries of the form `libNAME.la'.
7683 case $outputname in
7684 lib*)
7685 func_stripname 'lib' '.la' "$outputname"
7686 name=$func_stripname_result
7687 eval shared_ext=\"$shrext_cmds\"
7688 eval libname=\"$libname_spec\"
7689 ;;
7690 *)
7691 test "$module" = no && \
7692 func_fatal_help "libtool library \`$output' must begin with \`lib'"
7693
7694 if test "$need_lib_prefix" != no; then
7695 # Add the "lib" prefix for modules if required
7696 func_stripname '' '.la' "$outputname"
7697 name=$func_stripname_result
7698 eval shared_ext=\"$shrext_cmds\"
7699 eval libname=\"$libname_spec\"
7700 else
7701 func_stripname '' '.la' "$outputname"
7702 libname=$func_stripname_result
7703 fi
7704 ;;
7705 esac
7706
7707 if test -n "$objs"; then
7708 if test "$deplibs_check_method" != pass_all; then
7709 func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
7710 else
7711 echo
7712 $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
7713 $ECHO "*** objects $objs is not portable!"
7714 libobjs="$libobjs $objs"
7715 fi
7716 fi
7717
7718 test "$dlself" != no && \
7719 func_warning "\`-dlopen self' is ignored for libtool libraries"
7720
7721 set dummy $rpath
7722 shift
7723 test "$#" -gt 1 && \
7724 func_warning "ignoring multiple \`-rpath's for a libtool library"
7725
7726 install_libdir="$1"
7727
7728 oldlibs=
7729 if test -z "$rpath"; then
7730 if test "$build_libtool_libs" = yes; then
7731 # Building a libtool convenience library.
7732 # Some compilers have problems with a `.al' extension so
7733 # convenience libraries should have the same extension an
7734 # archive normally would.
7735 oldlibs="$output_objdir/$libname.$libext $oldlibs"
7736 build_libtool_libs=convenience
7737 build_old_libs=yes
7738 fi
7739
7740 test -n "$vinfo" && \
7741 func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
7742
7743 test -n "$release" && \
7744 func_warning "\`-release' is ignored for convenience libraries"
7745 else
7746
7747 # Parse the version information argument.
7748 save_ifs="$IFS"; IFS=':'
7749 set dummy $vinfo 0 0 0
7750 shift
7751 IFS="$save_ifs"
7752
7753 test -n "$7" && \
7754 func_fatal_help "too many parameters to \`-version-info'"
7755
7756 # convert absolute version numbers to libtool ages
7757 # this retains compatibility with .la files and attempts
7758 # to make the code below a bit more comprehensible
7759
7760 case $vinfo_number in
7761 yes)
7762 number_major="$1"
7763 number_minor="$2"
7764 number_revision="$3"
7765 #
7766 # There are really only two kinds -- those that
7767 # use the current revision as the major version
7768 # and those that subtract age and use age as
7769 # a minor version. But, then there is irix
7770 # which has an extra 1 added just for fun
7771 #
7772 case $version_type in
7773 # correct linux to gnu/linux during the next big refactor
7774 darwin|linux|osf|windows|none)
7775 func_arith $number_major + $number_minor
7776 current=$func_arith_result
7777 age="$number_minor"
7778 revision="$number_revision"
7779 ;;
7780 freebsd-aout|freebsd-elf|qnx|sunos)
7781 current="$number_major"
7782 revision="$number_minor"
7783 age="0"
7784 ;;
7785 irix|nonstopux)
7786 func_arith $number_major + $number_minor
7787 current=$func_arith_result
7788 age="$number_minor"
7789 revision="$number_minor"
7790 lt_irix_increment=no
7791 ;;
7792 *)
7793 func_fatal_configuration "$modename: unknown library version type \`$version_type'"
7794 ;;
7795 esac
7796 ;;
7797 no)
7798 current="$1"
7799 revision="$2"
7800 age="$3"
7801 ;;
7802 esac
7803
7804 # Check that each of the things are valid numbers.
7805 case $current in
7806 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7807 *)
7808 func_error "CURRENT \`$current' must be a nonnegative integer"
7809 func_fatal_error "\`$vinfo' is not valid version information"
7810 ;;
7811 esac
7812
7813 case $revision in
7814 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7815 *)
7816 func_error "REVISION \`$revision' must be a nonnegative integer"
7817 func_fatal_error "\`$vinfo' is not valid version information"
7818 ;;
7819 esac
7820
7821 case $age in
7822 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
7823 *)
7824 func_error "AGE \`$age' must be a nonnegative integer"
7825 func_fatal_error "\`$vinfo' is not valid version information"
7826 ;;
7827 esac
7828
7829 if test "$age" -gt "$current"; then
7830 func_error "AGE \`$age' is greater than the current interface number \`$current'"
7831 func_fatal_error "\`$vinfo' is not valid version information"
7832 fi
7833
7834 # Calculate the version variables.
7835 major=
7836 versuffix=
7837 verstring=
7838 case $version_type in
7839 none) ;;
7840
7841 darwin)
7842 # Like Linux, but with the current version available in
7843 # verstring for coding it into the library header
7844 func_arith $current - $age
7845 major=.$func_arith_result
7846 versuffix="$major.$age.$revision"
7847 # Darwin ld doesn't like 0 for these options...
7848 func_arith $current + 1
7849 minor_current=$func_arith_result
7850 xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
7851 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
7852 ;;
7853
7854 freebsd-aout)
7855 major=".$current"
7856 versuffix=".$current.$revision";
7857 ;;
7858
7859 freebsd-elf)
7860 major=".$current"
7861 versuffix=".$current"
7862 ;;
7863
7864 irix | nonstopux)
7865 if test "X$lt_irix_increment" = "Xno"; then
7866 func_arith $current - $age
7867 else
7868 func_arith $current - $age + 1
7869 fi
7870 major=$func_arith_result
7871
7872 case $version_type in
7873 nonstopux) verstring_prefix=nonstopux ;;
7874 *) verstring_prefix=sgi ;;
7875 esac
7876 verstring="$verstring_prefix$major.$revision"
7877
7878 # Add in all the interfaces that we are compatible with.
7879 loop=$revision
7880 while test "$loop" -ne 0; do
7881 func_arith $revision - $loop
7882 iface=$func_arith_result
7883 func_arith $loop - 1
7884 loop=$func_arith_result
7885 verstring="$verstring_prefix$major.$iface:$verstring"
7886 done
7887
7888 # Before this point, $major must not contain `.'.
7889 major=.$major
7890 versuffix="$major.$revision"
7891 ;;
7892
7893 linux) # correct to gnu/linux during the next big refactor
7894 func_arith $current - $age
7895 major=.$func_arith_result
7896 versuffix="$major.$age.$revision"
7897 ;;
7898
7899 osf)
7900 func_arith $current - $age
7901 major=.$func_arith_result
7902 versuffix=".$current.$age.$revision"
7903 verstring="$current.$age.$revision"
7904
7905 # Add in all the interfaces that we are compatible with.
7906 loop=$age
7907 while test "$loop" -ne 0; do
7908 func_arith $current - $loop
7909 iface=$func_arith_result
7910 func_arith $loop - 1
7911 loop=$func_arith_result
7912 verstring="$verstring:${iface}.0"
7913 done
7914
7915 # Make executables depend on our current version.
7916 verstring="$verstring:${current}.0"
7917 ;;
7918
7919 qnx)
7920 major=".$current"
7921 versuffix=".$current"
7922 ;;
7923
7924 sunos)
7925 major=".$current"
7926 versuffix=".$current.$revision"
7927 ;;
7928
7929 windows)
7930 # Use '-' rather than '.', since we only want one
7931 # extension on DOS 8.3 filesystems.
7932 func_arith $current - $age
7933 major=$func_arith_result
7934 versuffix="-$major"
7935 ;;
7936
7937 *)
7938 func_fatal_configuration "unknown library version type \`$version_type'"
7939 ;;
7940 esac
7941
7942 # Clear the version info if we defaulted, and they specified a release.
7943 if test -z "$vinfo" && test -n "$release"; then
7944 major=
7945 case $version_type in
7946 darwin)
7947 # we can't check for "0.0" in archive_cmds due to quoting
7948 # problems, so we reset it completely
7949 verstring=
7950 ;;
7951 *)
7952 verstring="0.0"
7953 ;;
7954 esac
7955 if test "$need_version" = no; then
7956 versuffix=
7957 else
7958 versuffix=".0.0"
7959 fi
7960 fi
7961
7962 # Remove version info from name if versioning should be avoided
7963 if test "$avoid_version" = yes && test "$need_version" = no; then
7964 major=
7965 versuffix=
7966 verstring=""
7967 fi
7968
7969 # Check to see if the archive will have undefined symbols.
7970 if test "$allow_undefined" = yes; then
7971 if test "$allow_undefined_flag" = unsupported; then
7972 func_warning "undefined symbols not allowed in $host shared libraries"
7973 build_libtool_libs=no
7974 build_old_libs=yes
7975 fi
7976 else
7977 # Don't allow undefined symbols.
7978 allow_undefined_flag="$no_undefined_flag"
7979 fi
7980
7981 fi
7982
7983 func_generate_dlsyms "$libname" "$libname" "yes"
7984 libobjs="$libobjs $symfileobj"
7985 test "X$libobjs" = "X " && libobjs=
7986
7987 if test "$opt_mode" != relink; then
7988 # Remove our outputs, but don't remove object files since they
7989 # may have been created when compiling PIC objects.
7990 removelist=
7991 tempremovelist=`$ECHO "$output_objdir/*"`
7992 for p in $tempremovelist; do
7993 case $p in
7994 *.$objext | *.gcno)
7995 ;;
7996 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
7997 if test "X$precious_files_regex" != "X"; then
7998 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
7999 then
8000 continue
8001 fi
8002 fi
8003 removelist="$removelist $p"
8004 ;;
8005 *) ;;
8006 esac
8007 done
8008 test -n "$removelist" && \
8009 func_show_eval "${RM}r \$removelist"
8010 fi
8011
8012 # Now set the variables for building old libraries.
8013 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
8014 oldlibs="$oldlibs $output_objdir/$libname.$libext"
8015
8016 # Transform .lo files to .o files.
8017 oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
8018 fi
8019
8020 # Eliminate all temporary directories.
8021 #for path in $notinst_path; do
8022 # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
8023 # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
8024 # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
8025 #done
8026
8027 if test -n "$xrpath"; then
8028 # If the user specified any rpath flags, then add them.
8029 temp_xrpath=
8030 for libdir in $xrpath; do
8031 func_replace_sysroot "$libdir"
8032 temp_xrpath="$temp_xrpath -R$func_replace_sysroot_result"
8033 case "$finalize_rpath " in
8034 *" $libdir "*) ;;
8035 *) finalize_rpath="$finalize_rpath $libdir" ;;
8036 esac
8037 done
8038 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
8039 dependency_libs="$temp_xrpath $dependency_libs"
8040 fi
8041 fi
8042
8043 # Make sure dlfiles contains only unique files that won't be dlpreopened
8044 old_dlfiles="$dlfiles"
8045 dlfiles=
8046 for lib in $old_dlfiles; do
8047 case " $dlprefiles $dlfiles " in
8048 *" $lib "*) ;;
8049 *) dlfiles="$dlfiles $lib" ;;
8050 esac
8051 done
8052
8053 # Make sure dlprefiles contains only unique files
8054 old_dlprefiles="$dlprefiles"
8055 dlprefiles=
8056 for lib in $old_dlprefiles; do
8057 case "$dlprefiles " in
8058 *" $lib "*) ;;
8059 *) dlprefiles="$dlprefiles $lib" ;;
8060 esac
8061 done
8062
8063 if test "$build_libtool_libs" = yes; then
8064 if test -n "$rpath"; then
8065 case $host in
8066 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
8067 # these systems don't actually have a c library (as such)!
8068 ;;
8069 *-*-rhapsody* | *-*-darwin1.[012])
8070 # Rhapsody C library is in the System framework
8071 deplibs="$deplibs System.ltframework"
8072 ;;
8073 *-*-netbsd*)
8074 # Don't link with libc until the a.out ld.so is fixed.
8075 ;;
8076 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
8077 # Do not include libc due to us having libc/libc_r.
8078 ;;
8079 *-*-sco3.2v5* | *-*-sco5v6*)
8080 # Causes problems with __ctype
8081 ;;
8082 *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
8083 # Compiler inserts libc in the correct place for threads to work
8084 ;;
8085 *)
8086 # Add libc to deplibs on all other systems if necessary.
8087 if test "$build_libtool_need_lc" = "yes"; then
8088 deplibs="$deplibs -lc"
8089 fi
8090 ;;
8091 esac
8092 fi
8093
8094 # Transform deplibs into only deplibs that can be linked in shared.
8095 name_save=$name
8096 libname_save=$libname
8097 release_save=$release
8098 versuffix_save=$versuffix
8099 major_save=$major
8100 # I'm not sure if I'm treating the release correctly. I think
8101 # release should show up in the -l (ie -lgmp5) so we don't want to
8102 # add it in twice. Is that correct?
8103 release=""
8104 versuffix=""
8105 major=""
8106 newdeplibs=
8107 droppeddeps=no
8108 case $deplibs_check_method in
8109 pass_all)
8110 # Don't check for shared/static. Everything works.
8111 # This might be a little naive. We might want to check
8112 # whether the library exists or not. But this is on
8113 # osf3 & osf4 and I'm not really sure... Just
8114 # implementing what was already the behavior.
8115 newdeplibs=$deplibs
8116 ;;
8117 test_compile)
8118 # This code stresses the "libraries are programs" paradigm to its
8119 # limits. Maybe even breaks it. We compile a program, linking it
8120 # against the deplibs as a proxy for the library. Then we can check
8121 # whether they linked in statically or dynamically with ldd.
8122 $opt_dry_run || $RM conftest.c
8123 cat > conftest.c <<EOF
8124 int main() { return 0; }
8125EOF
8126 $opt_dry_run || $RM conftest
8127 if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
8128 ldd_output=`ldd conftest`
8129 for i in $deplibs; do
8130 case $i in
8131 -l*)
8132 func_stripname -l '' "$i"
8133 name=$func_stripname_result
8134 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8135 case " $predeps $postdeps " in
8136 *" $i "*)
8137 newdeplibs="$newdeplibs $i"
8138 i=""
8139 ;;
8140 esac
8141 fi
8142 if test -n "$i" ; then
8143 libname=`eval "\\$ECHO \"$libname_spec\""`
8144 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8145 set dummy $deplib_matches; shift
8146 deplib_match=$1
8147 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8148 newdeplibs="$newdeplibs $i"
8149 else
8150 droppeddeps=yes
8151 echo
8152 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
8153 echo "*** I have the capability to make that library automatically link in when"
8154 echo "*** you link to this library. But I can only do this if you have a"
8155 echo "*** shared version of the library, which I believe you do not have"
8156 echo "*** because a test_compile did reveal that the linker did not use it for"
8157 echo "*** its dynamic dependency list that programs get resolved with at runtime."
8158 fi
8159 fi
8160 ;;
8161 *)
8162 newdeplibs="$newdeplibs $i"
8163 ;;
8164 esac
8165 done
8166 else
8167 # Error occurred in the first compile. Let's try to salvage
8168 # the situation: Compile a separate program for each library.
8169 for i in $deplibs; do
8170 case $i in
8171 -l*)
8172 func_stripname -l '' "$i"
8173 name=$func_stripname_result
8174 $opt_dry_run || $RM conftest
8175 if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
8176 ldd_output=`ldd conftest`
8177 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8178 case " $predeps $postdeps " in
8179 *" $i "*)
8180 newdeplibs="$newdeplibs $i"
8181 i=""
8182 ;;
8183 esac
8184 fi
8185 if test -n "$i" ; then
8186 libname=`eval "\\$ECHO \"$libname_spec\""`
8187 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
8188 set dummy $deplib_matches; shift
8189 deplib_match=$1
8190 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
8191 newdeplibs="$newdeplibs $i"
8192 else
8193 droppeddeps=yes
8194 echo
8195 $ECHO "*** Warning: dynamic linker does not accept needed library $i."
8196 echo "*** I have the capability to make that library automatically link in when"
8197 echo "*** you link to this library. But I can only do this if you have a"
8198 echo "*** shared version of the library, which you do not appear to have"
8199 echo "*** because a test_compile did reveal that the linker did not use this one"
8200 echo "*** as a dynamic dependency that programs can get resolved with at runtime."
8201 fi
8202 fi
8203 else
8204 droppeddeps=yes
8205 echo
8206 $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
8207 echo "*** make it link in! You will probably need to install it or some"
8208 echo "*** library that it depends on before this library will be fully"
8209 echo "*** functional. Installing it before continuing would be even better."
8210 fi
8211 ;;
8212 *)
8213 newdeplibs="$newdeplibs $i"
8214 ;;
8215 esac
8216 done
8217 fi
8218 ;;
8219 file_magic*)
8220 set dummy $deplibs_check_method; shift
8221 file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8222 for a_deplib in $deplibs; do
8223 case $a_deplib in
8224 -l*)
8225 func_stripname -l '' "$a_deplib"
8226 name=$func_stripname_result
8227 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8228 case " $predeps $postdeps " in
8229 *" $a_deplib "*)
8230 newdeplibs="$newdeplibs $a_deplib"
8231 a_deplib=""
8232 ;;
8233 esac
8234 fi
8235 if test -n "$a_deplib" ; then
8236 libname=`eval "\\$ECHO \"$libname_spec\""`
8237 if test -n "$file_magic_glob"; then
8238 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
8239 else
8240 libnameglob=$libname
8241 fi
8242 test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
8243 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8244 if test "$want_nocaseglob" = yes; then
8245 shopt -s nocaseglob
8246 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
8247 $nocaseglob
8248 else
8249 potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
8250 fi
8251 for potent_lib in $potential_libs; do
8252 # Follow soft links.
8253 if ls -lLd "$potent_lib" 2>/dev/null |
8254 $GREP " -> " >/dev/null; then
8255 continue
8256 fi
8257 # The statement above tries to avoid entering an
8258 # endless loop below, in case of cyclic links.
8259 # We might still enter an endless loop, since a link
8260 # loop can be closed while we follow links,
8261 # but so what?
8262 potlib="$potent_lib"
8263 while test -h "$potlib" 2>/dev/null; do
8264 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
8265 case $potliblink in
8266 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
8267 *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
8268 esac
8269 done
8270 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
8271 $SED -e 10q |
8272 $EGREP "$file_magic_regex" > /dev/null; then
8273 newdeplibs="$newdeplibs $a_deplib"
8274 a_deplib=""
8275 break 2
8276 fi
8277 done
8278 done
8279 fi
8280 if test -n "$a_deplib" ; then
8281 droppeddeps=yes
8282 echo
8283 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8284 echo "*** I have the capability to make that library automatically link in when"
8285 echo "*** you link to this library. But I can only do this if you have a"
8286 echo "*** shared version of the library, which you do not appear to have"
8287 echo "*** because I did check the linker path looking for a file starting"
8288 if test -z "$potlib" ; then
8289 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
8290 else
8291 $ECHO "*** with $libname and none of the candidates passed a file format test"
8292 $ECHO "*** using a file magic. Last file checked: $potlib"
8293 fi
8294 fi
8295 ;;
8296 *)
8297 # Add a -L argument.
8298 newdeplibs="$newdeplibs $a_deplib"
8299 ;;
8300 esac
8301 done # Gone through all deplibs.
8302 ;;
8303 match_pattern*)
8304 set dummy $deplibs_check_method; shift
8305 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
8306 for a_deplib in $deplibs; do
8307 case $a_deplib in
8308 -l*)
8309 func_stripname -l '' "$a_deplib"
8310 name=$func_stripname_result
8311 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8312 case " $predeps $postdeps " in
8313 *" $a_deplib "*)
8314 newdeplibs="$newdeplibs $a_deplib"
8315 a_deplib=""
8316 ;;
8317 esac
8318 fi
8319 if test -n "$a_deplib" ; then
8320 libname=`eval "\\$ECHO \"$libname_spec\""`
8321 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
8322 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
8323 for potent_lib in $potential_libs; do
8324 potlib="$potent_lib" # see symlink-check above in file_magic test
8325 if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
8326 $EGREP "$match_pattern_regex" > /dev/null; then
8327 newdeplibs="$newdeplibs $a_deplib"
8328 a_deplib=""
8329 break 2
8330 fi
8331 done
8332 done
8333 fi
8334 if test -n "$a_deplib" ; then
8335 droppeddeps=yes
8336 echo
8337 $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
8338 echo "*** I have the capability to make that library automatically link in when"
8339 echo "*** you link to this library. But I can only do this if you have a"
8340 echo "*** shared version of the library, which you do not appear to have"
8341 echo "*** because I did check the linker path looking for a file starting"
8342 if test -z "$potlib" ; then
8343 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
8344 else
8345 $ECHO "*** with $libname and none of the candidates passed a file format test"
8346 $ECHO "*** using a regex pattern. Last file checked: $potlib"
8347 fi
8348 fi
8349 ;;
8350 *)
8351 # Add a -L argument.
8352 newdeplibs="$newdeplibs $a_deplib"
8353 ;;
8354 esac
8355 done # Gone through all deplibs.
8356 ;;
8357 none | unknown | *)
8358 newdeplibs=""
8359 tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
8360 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
8361 for i in $predeps $postdeps ; do
8362 # can't use Xsed below, because $i might contain '/'
8363 tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
8364 done
8365 fi
8366 case $tmp_deplibs in
8367 *[!\ \ ]*)
8368 echo
8369 if test "X$deplibs_check_method" = "Xnone"; then
8370 echo "*** Warning: inter-library dependencies are not supported in this platform."
8371 else
8372 echo "*** Warning: inter-library dependencies are not known to be supported."
8373 fi
8374 echo "*** All declared inter-library dependencies are being dropped."
8375 droppeddeps=yes
8376 ;;
8377 esac
8378 ;;
8379 esac
8380 versuffix=$versuffix_save
8381 major=$major_save
8382 release=$release_save
8383 libname=$libname_save
8384 name=$name_save
8385
8386 case $host in
8387 *-*-rhapsody* | *-*-darwin1.[012])
8388 # On Rhapsody replace the C library with the System framework
8389 newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
8390 ;;
8391 esac
8392
8393 if test "$droppeddeps" = yes; then
8394 if test "$module" = yes; then
8395 echo
8396 echo "*** Warning: libtool could not satisfy all declared inter-library"
8397 $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
8398 echo "*** a static module, that should work as long as the dlopening"
8399 echo "*** application is linked with the -dlopen flag."
8400 if test -z "$global_symbol_pipe"; then
8401 echo
8402 echo "*** However, this would only work if libtool was able to extract symbol"
8403 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
8404 echo "*** not find such a program. So, this module is probably useless."
8405 echo "*** \`nm' from GNU binutils and a full rebuild may help."
8406 fi
8407 if test "$build_old_libs" = no; then
8408 oldlibs="$output_objdir/$libname.$libext"
8409 build_libtool_libs=module
8410 build_old_libs=yes
8411 else
8412 build_libtool_libs=no
8413 fi
8414 else
8415 echo "*** The inter-library dependencies that have been dropped here will be"
8416 echo "*** automatically added whenever a program is linked with this library"
8417 echo "*** or is declared to -dlopen it."
8418
8419 if test "$allow_undefined" = no; then
8420 echo
8421 echo "*** Since this library must not contain undefined symbols,"
8422 echo "*** because either the platform does not support them or"
8423 echo "*** it was explicitly requested with -no-undefined,"
8424 echo "*** libtool will only create a static version of it."
8425 if test "$build_old_libs" = no; then
8426 oldlibs="$output_objdir/$libname.$libext"
8427 build_libtool_libs=module
8428 build_old_libs=yes
8429 else
8430 build_libtool_libs=no
8431 fi
8432 fi
8433 fi
8434 fi
8435 # Done checking deplibs!
8436 deplibs=$newdeplibs
8437 fi
8438 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
8439 case $host in
8440 *-*-darwin*)
8441 newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8442 new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8443 deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
8444 ;;
8445 esac
8446
8447 # move library search paths that coincide with paths to not yet
8448 # installed libraries to the beginning of the library search list
8449 new_libs=
8450 for path in $notinst_path; do
8451 case " $new_libs " in
8452 *" -L$path/$objdir "*) ;;
8453 *)
8454 case " $deplibs " in
8455 *" -L$path/$objdir "*)
8456 new_libs="$new_libs -L$path/$objdir" ;;
8457 esac
8458 ;;
8459 esac
8460 done
8461 for deplib in $deplibs; do
8462 case $deplib in
8463 -L*)
8464 case " $new_libs " in
8465 *" $deplib "*) ;;
8466 *) new_libs="$new_libs $deplib" ;;
8467 esac
8468 ;;
8469 *) new_libs="$new_libs $deplib" ;;
8470 esac
8471 done
8472 deplibs="$new_libs"
8473
8474 # All the library-specific variables (install_libdir is set above).
8475 library_names=
8476 old_library=
8477 dlname=
8478
8479 # Test again, we may have decided not to build it any more
8480 if test "$build_libtool_libs" = yes; then
8481 # Remove ${wl} instances when linking with ld.
8482 # FIXME: should test the right _cmds variable.
8483 case $archive_cmds in
8484 *\$LD\ *) wl= ;;
8485 esac
8486 if test "$hardcode_into_libs" = yes; then
8487 # Hardcode the library paths
8488 hardcode_libdirs=
8489 dep_rpath=
8490 rpath="$finalize_rpath"
8491 test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
8492 for libdir in $rpath; do
8493 if test -n "$hardcode_libdir_flag_spec"; then
8494 if test -n "$hardcode_libdir_separator"; then
8495 func_replace_sysroot "$libdir"
8496 libdir=$func_replace_sysroot_result
8497 if test -z "$hardcode_libdirs"; then
8498 hardcode_libdirs="$libdir"
8499 else
8500 # Just accumulate the unique libdirs.
8501 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
8502 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
8503 ;;
8504 *)
8505 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
8506 ;;
8507 esac
8508 fi
8509 else
8510 eval flag=\"$hardcode_libdir_flag_spec\"
8511 dep_rpath="$dep_rpath $flag"
8512 fi
8513 elif test -n "$runpath_var"; then
8514 case "$perm_rpath " in
8515 *" $libdir "*) ;;
8516 *) perm_rpath="$perm_rpath $libdir" ;;
8517 esac
8518 fi
8519 done
8520 # Substitute the hardcoded libdirs into the rpath.
8521 if test -n "$hardcode_libdir_separator" &&
8522 test -n "$hardcode_libdirs"; then
8523 libdir="$hardcode_libdirs"
8524 eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
8525 fi
8526 if test -n "$runpath_var" && test -n "$perm_rpath"; then
8527 # We should set the runpath_var.
8528 rpath=
8529 for dir in $perm_rpath; do
8530 rpath="$rpath$dir:"
8531 done
8532 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
8533 fi
8534 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
8535 fi
8536
8537 shlibpath="$finalize_shlibpath"
8538 test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
8539 if test -n "$shlibpath"; then
8540 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
8541 fi
8542
8543 # Get the real and link names of the library.
8544 eval shared_ext=\"$shrext_cmds\"
8545 eval library_names=\"$library_names_spec\"
8546 set dummy $library_names
8547 shift
8548 realname="$1"
8549 shift
8550
8551 if test -n "$soname_spec"; then
8552 eval soname=\"$soname_spec\"
8553 else
8554 soname="$realname"
8555 fi
8556 if test -z "$dlname"; then
8557 dlname=$soname
8558 fi
8559
8560 lib="$output_objdir/$realname"
8561 linknames=
8562 for link
8563 do
8564 linknames="$linknames $link"
8565 done
8566
8567 # Use standard objects if they are pic
8568 test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
8569 test "X$libobjs" = "X " && libobjs=
8570
8571 delfiles=
8572 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8573 $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
8574 export_symbols="$output_objdir/$libname.uexp"
8575 delfiles="$delfiles $export_symbols"
8576 fi
8577
8578 orig_export_symbols=
8579 case $host_os in
8580 cygwin* | mingw* | cegcc*)
8581 if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
8582 # exporting using user supplied symfile
8583 if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
8584 # and it's NOT already a .def file. Must figure out
8585 # which of the given symbols are data symbols and tag
8586 # them as such. So, trigger use of export_symbols_cmds.
8587 # export_symbols gets reassigned inside the "prepare
8588 # the list of exported symbols" if statement, so the
8589 # include_expsyms logic still works.
8590 orig_export_symbols="$export_symbols"
8591 export_symbols=
8592 always_export_symbols=yes
8593 fi
8594 fi
8595 ;;
8596 esac
8597
8598 # Prepare the list of exported symbols
8599 if test -z "$export_symbols"; then
8600 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
8601 func_verbose "generating symbol list for \`$libname.la'"
8602 export_symbols="$output_objdir/$libname.exp"
8603 $opt_dry_run || $RM $export_symbols
8604 cmds=$export_symbols_cmds
8605 save_ifs="$IFS"; IFS='~'
8606 for cmd1 in $cmds; do
8607 IFS="$save_ifs"
8608 # Take the normal branch if the nm_file_list_spec branch
8609 # doesn't work or if tool conversion is not needed.
8610 case $nm_file_list_spec~$to_tool_file_cmd in
8611 *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
8612 try_normal_branch=yes
8613 eval cmd=\"$cmd1\"
8614 func_len " $cmd"
8615 len=$func_len_result
8616 ;;
8617 *)
8618 try_normal_branch=no
8619 ;;
8620 esac
8621 if test "$try_normal_branch" = yes \
8622 && { test "$len" -lt "$max_cmd_len" \
8623 || test "$max_cmd_len" -le -1; }
8624 then
8625 func_show_eval "$cmd" 'exit $?'
8626 skipped_export=false
8627 elif test -n "$nm_file_list_spec"; then
8628 func_basename "$output"
8629 output_la=$func_basename_result
8630 save_libobjs=$libobjs
8631 save_output=$output
8632 output=${output_objdir}/${output_la}.nm
8633 func_to_tool_file "$output"
8634 libobjs=$nm_file_list_spec$func_to_tool_file_result
8635 delfiles="$delfiles $output"
8636 func_verbose "creating $NM input file list: $output"
8637 for obj in $save_libobjs; do
8638 func_to_tool_file "$obj"
8639 $ECHO "$func_to_tool_file_result"
8640 done > "$output"
8641 eval cmd=\"$cmd1\"
8642 func_show_eval "$cmd" 'exit $?'
8643 output=$save_output
8644 libobjs=$save_libobjs
8645 skipped_export=false
8646 else
8647 # The command line is too long to execute in one step.
8648 func_verbose "using reloadable object file for export list..."
8649 skipped_export=:
8650 # Break out early, otherwise skipped_export may be
8651 # set to false by a later but shorter cmd.
8652 break
8653 fi
8654 done
8655 IFS="$save_ifs"
8656 if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
8657 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8658 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8659 fi
8660 fi
8661 fi
8662
8663 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8664 tmp_export_symbols="$export_symbols"
8665 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8666 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8667 fi
8668
8669 if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
8670 # The given exports_symbols file has to be filtered, so filter it.
8671 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8672 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8673 # 's' commands which not all seds can handle. GNU sed should be fine
8674 # though. Also, the filter scales superlinearly with the number of
8675 # global variables. join(1) would be nice here, but unfortunately
8676 # isn't a blessed tool.
8677 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8678 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
8679 export_symbols=$output_objdir/$libname.def
8680 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8681 fi
8682
8683 tmp_deplibs=
8684 for test_deplib in $deplibs; do
8685 case " $convenience " in
8686 *" $test_deplib "*) ;;
8687 *)
8688 tmp_deplibs="$tmp_deplibs $test_deplib"
8689 ;;
8690 esac
8691 done
8692 deplibs="$tmp_deplibs"
8693
8694 if test -n "$convenience"; then
8695 if test -n "$whole_archive_flag_spec" &&
8696 test "$compiler_needs_object" = yes &&
8697 test -z "$libobjs"; then
8698 # extract the archives, so we have objects to list.
8699 # TODO: could optimize this to just extract one archive.
8700 whole_archive_flag_spec=
8701 fi
8702 if test -n "$whole_archive_flag_spec"; then
8703 save_libobjs=$libobjs
8704 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8705 test "X$libobjs" = "X " && libobjs=
8706 else
8707 gentop="$output_objdir/${outputname}x"
8708 generated="$generated $gentop"
8709
8710 func_extract_archives $gentop $convenience
8711 libobjs="$libobjs $func_extract_archives_result"
8712 test "X$libobjs" = "X " && libobjs=
8713 fi
8714 fi
8715
8716 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
8717 eval flag=\"$thread_safe_flag_spec\"
8718 linker_flags="$linker_flags $flag"
8719 fi
8720
8721 # Make a backup of the uninstalled library when relinking
8722 if test "$opt_mode" = relink; then
8723 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
8724 fi
8725
8726 # Do each of the archive commands.
8727 if test "$module" = yes && test -n "$module_cmds" ; then
8728 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8729 eval test_cmds=\"$module_expsym_cmds\"
8730 cmds=$module_expsym_cmds
8731 else
8732 eval test_cmds=\"$module_cmds\"
8733 cmds=$module_cmds
8734 fi
8735 else
8736 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8737 eval test_cmds=\"$archive_expsym_cmds\"
8738 cmds=$archive_expsym_cmds
8739 else
8740 eval test_cmds=\"$archive_cmds\"
8741 cmds=$archive_cmds
8742 fi
8743 fi
8744
8745 if test "X$skipped_export" != "X:" &&
8746 func_len " $test_cmds" &&
8747 len=$func_len_result &&
8748 test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
8749 :
8750 else
8751 # The command line is too long to link in one step, link piecewise
8752 # or, if using GNU ld and skipped_export is not :, use a linker
8753 # script.
8754
8755 # Save the value of $output and $libobjs because we want to
8756 # use them later. If we have whole_archive_flag_spec, we
8757 # want to use save_libobjs as it was before
8758 # whole_archive_flag_spec was expanded, because we can't
8759 # assume the linker understands whole_archive_flag_spec.
8760 # This may have to be revisited, in case too many
8761 # convenience libraries get linked in and end up exceeding
8762 # the spec.
8763 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
8764 save_libobjs=$libobjs
8765 fi
8766 save_output=$output
8767 func_basename "$output"
8768 output_la=$func_basename_result
8769
8770 # Clear the reloadable object creation command queue and
8771 # initialize k to one.
8772 test_cmds=
8773 concat_cmds=
8774 objlist=
8775 last_robj=
8776 k=1
8777
8778 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
8779 output=${output_objdir}/${output_la}.lnkscript
8780 func_verbose "creating GNU ld script: $output"
8781 echo 'INPUT (' > $output
8782 for obj in $save_libobjs
8783 do
8784 func_to_tool_file "$obj"
8785 $ECHO "$func_to_tool_file_result" >> $output
8786 done
8787 echo ')' >> $output
8788 delfiles="$delfiles $output"
8789 func_to_tool_file "$output"
8790 output=$func_to_tool_file_result
8791 elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
8792 output=${output_objdir}/${output_la}.lnk
8793 func_verbose "creating linker input file list: $output"
8794 : > $output
8795 set x $save_libobjs
8796 shift
8797 firstobj=
8798 if test "$compiler_needs_object" = yes; then
8799 firstobj="$1 "
8800 shift
8801 fi
8802 for obj
8803 do
8804 func_to_tool_file "$obj"
8805 $ECHO "$func_to_tool_file_result" >> $output
8806 done
8807 delfiles="$delfiles $output"
8808 func_to_tool_file "$output"
8809 output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
8810 else
8811 if test -n "$save_libobjs"; then
8812 func_verbose "creating reloadable object files..."
8813 output=$output_objdir/$output_la-${k}.$objext
8814 eval test_cmds=\"$reload_cmds\"
8815 func_len " $test_cmds"
8816 len0=$func_len_result
8817 len=$len0
8818
8819 # Loop over the list of objects to be linked.
8820 for obj in $save_libobjs
8821 do
8822 func_len " $obj"
8823 func_arith $len + $func_len_result
8824 len=$func_arith_result
8825 if test "X$objlist" = X ||
8826 test "$len" -lt "$max_cmd_len"; then
8827 objlist="$objlist $obj"
8828 else
8829 # The command $test_cmds is almost too long, add a
8830 # command to the queue.
8831 if test "$k" -eq 1 ; then
8832 # The first file doesn't have a previous command to add.
8833 reload_objs=$objlist
8834 eval concat_cmds=\"$reload_cmds\"
8835 else
8836 # All subsequent reloadable object files will link in
8837 # the last one created.
8838 reload_objs="$objlist $last_robj"
8839 eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
8840 fi
8841 last_robj=$output_objdir/$output_la-${k}.$objext
8842 func_arith $k + 1
8843 k=$func_arith_result
8844 output=$output_objdir/$output_la-${k}.$objext
8845 objlist=" $obj"
8846 func_len " $last_robj"
8847 func_arith $len0 + $func_len_result
8848 len=$func_arith_result
8849 fi
8850 done
8851 # Handle the remaining objects by creating one last
8852 # reloadable object file. All subsequent reloadable object
8853 # files will link in the last one created.
8854 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8855 reload_objs="$objlist $last_robj"
8856 eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
8857 if test -n "$last_robj"; then
8858 eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
8859 fi
8860 delfiles="$delfiles $output"
8861
8862 else
8863 output=
8864 fi
8865
8866 if ${skipped_export-false}; then
8867 func_verbose "generating symbol list for \`$libname.la'"
8868 export_symbols="$output_objdir/$libname.exp"
8869 $opt_dry_run || $RM $export_symbols
8870 libobjs=$output
8871 # Append the command to create the export file.
8872 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
8873 eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
8874 if test -n "$last_robj"; then
8875 eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
8876 fi
8877 fi
8878
8879 test -n "$save_libobjs" &&
8880 func_verbose "creating a temporary reloadable object file: $output"
8881
8882 # Loop through the commands generated above and execute them.
8883 save_ifs="$IFS"; IFS='~'
8884 for cmd in $concat_cmds; do
8885 IFS="$save_ifs"
8886 $opt_silent || {
8887 func_quote_for_expand "$cmd"
8888 eval "func_echo $func_quote_for_expand_result"
8889 }
8890 $opt_dry_run || eval "$cmd" || {
8891 lt_exit=$?
8892
8893 # Restore the uninstalled library and exit
8894 if test "$opt_mode" = relink; then
8895 ( cd "$output_objdir" && \
8896 $RM "${realname}T" && \
8897 $MV "${realname}U" "$realname" )
8898 fi
8899
8900 exit $lt_exit
8901 }
8902 done
8903 IFS="$save_ifs"
8904
8905 if test -n "$export_symbols_regex" && ${skipped_export-false}; then
8906 func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
8907 func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
8908 fi
8909 fi
8910
8911 if ${skipped_export-false}; then
8912 if test -n "$export_symbols" && test -n "$include_expsyms"; then
8913 tmp_export_symbols="$export_symbols"
8914 test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
8915 $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
8916 fi
8917
8918 if test -n "$orig_export_symbols"; then
8919 # The given exports_symbols file has to be filtered, so filter it.
8920 func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
8921 # FIXME: $output_objdir/$libname.filter potentially contains lots of
8922 # 's' commands which not all seds can handle. GNU sed should be fine
8923 # though. Also, the filter scales superlinearly with the number of
8924 # global variables. join(1) would be nice here, but unfortunately
8925 # isn't a blessed tool.
8926 $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
8927 delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
8928 export_symbols=$output_objdir/$libname.def
8929 $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
8930 fi
8931 fi
8932
8933 libobjs=$output
8934 # Restore the value of output.
8935 output=$save_output
8936
8937 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
8938 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
8939 test "X$libobjs" = "X " && libobjs=
8940 fi
8941 # Expand the library linking commands again to reset the
8942 # value of $libobjs for piecewise linking.
8943
8944 # Do each of the archive commands.
8945 if test "$module" = yes && test -n "$module_cmds" ; then
8946 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
8947 cmds=$module_expsym_cmds
8948 else
8949 cmds=$module_cmds
8950 fi
8951 else
8952 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
8953 cmds=$archive_expsym_cmds
8954 else
8955 cmds=$archive_cmds
8956 fi
8957 fi
8958 fi
8959
8960 if test -n "$delfiles"; then
8961 # Append the command to remove temporary files to $cmds.
8962 eval cmds=\"\$cmds~\$RM $delfiles\"
8963 fi
8964
8965 # Add any objects from preloaded convenience libraries
8966 if test -n "$dlprefiles"; then
8967 gentop="$output_objdir/${outputname}x"
8968 generated="$generated $gentop"
8969
8970 func_extract_archives $gentop $dlprefiles
8971 libobjs="$libobjs $func_extract_archives_result"
8972 test "X$libobjs" = "X " && libobjs=
8973 fi
8974
8975 save_ifs="$IFS"; IFS='~'
8976 for cmd in $cmds; do
8977 IFS="$save_ifs"
8978 eval cmd=\"$cmd\"
8979 $opt_silent || {
8980 func_quote_for_expand "$cmd"
8981 eval "func_echo $func_quote_for_expand_result"
8982 }
8983 $opt_dry_run || eval "$cmd" || {
8984 lt_exit=$?
8985
8986 # Restore the uninstalled library and exit
8987 if test "$opt_mode" = relink; then
8988 ( cd "$output_objdir" && \
8989 $RM "${realname}T" && \
8990 $MV "${realname}U" "$realname" )
8991 fi
8992
8993 exit $lt_exit
8994 }
8995 done
8996 IFS="$save_ifs"
8997
8998 # Restore the uninstalled library and exit
8999 if test "$opt_mode" = relink; then
9000 $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
9001
9002 if test -n "$convenience"; then
9003 if test -z "$whole_archive_flag_spec"; then
9004 func_show_eval '${RM}r "$gentop"'
9005 fi
9006 fi
9007
9008 exit $EXIT_SUCCESS
9009 fi
9010
9011 # Create links to the real library.
9012 for linkname in $linknames; do
9013 if test "$realname" != "$linkname"; then
9014 func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
9015 fi
9016 done
9017
9018 # If -module or -export-dynamic was specified, set the dlname.
9019 if test "$module" = yes || test "$export_dynamic" = yes; then
9020 # On all known operating systems, these are identical.
9021 dlname="$soname"
9022 fi
9023 fi
9024 ;;
9025
9026 obj)
9027 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
9028 func_warning "\`-dlopen' is ignored for objects"
9029 fi
9030
9031 case " $deplibs" in
9032 *\ -l* | *\ -L*)
9033 func_warning "\`-l' and \`-L' are ignored for objects" ;;
9034 esac
9035
9036 test -n "$rpath" && \
9037 func_warning "\`-rpath' is ignored for objects"
9038
9039 test -n "$xrpath" && \
9040 func_warning "\`-R' is ignored for objects"
9041
9042 test -n "$vinfo" && \
9043 func_warning "\`-version-info' is ignored for objects"
9044
9045 test -n "$release" && \
9046 func_warning "\`-release' is ignored for objects"
9047
9048 case $output in
9049 *.lo)
9050 test -n "$objs$old_deplibs" && \
9051 func_fatal_error "cannot build library object \`$output' from non-libtool objects"
9052
9053 libobj=$output
9054 func_lo2o "$libobj"
9055 obj=$func_lo2o_result
9056 ;;
9057 *)
9058 libobj=
9059 obj="$output"
9060 ;;
9061 esac
9062
9063 # Delete the old objects.
9064 $opt_dry_run || $RM $obj $libobj
9065
9066 # Objects from convenience libraries. This assumes
9067 # single-version convenience libraries. Whenever we create
9068 # different ones for PIC/non-PIC, this we'll have to duplicate
9069 # the extraction.
9070 reload_conv_objs=
9071 gentop=
9072 # reload_cmds runs $LD directly, so let us get rid of
9073 # -Wl from whole_archive_flag_spec and hope we can get by with
9074 # turning comma into space..
9075 wl=
9076
9077 if test -n "$convenience"; then
9078 if test -n "$whole_archive_flag_spec"; then
9079 eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
9080 reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
9081 else
9082 gentop="$output_objdir/${obj}x"
9083 generated="$generated $gentop"
9084
9085 func_extract_archives $gentop $convenience
9086 reload_conv_objs="$reload_objs $func_extract_archives_result"
9087 fi
9088 fi
9089
9090 # If we're not building shared, we need to use non_pic_objs
9091 test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
9092
9093 # Create the old-style object.
9094 reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
9095
9096 output="$obj"
9097 func_execute_cmds "$reload_cmds" 'exit $?'
9098
9099 # Exit if we aren't doing a library object file.
9100 if test -z "$libobj"; then
9101 if test -n "$gentop"; then
9102 func_show_eval '${RM}r "$gentop"'
9103 fi
9104
9105 exit $EXIT_SUCCESS
9106 fi
9107
9108 if test "$build_libtool_libs" != yes; then
9109 if test -n "$gentop"; then
9110 func_show_eval '${RM}r "$gentop"'
9111 fi
9112
9113 # Create an invalid libtool object if no PIC, so that we don't
9114 # accidentally link it into a program.
9115 # $show "echo timestamp > $libobj"
9116 # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
9117 exit $EXIT_SUCCESS
9118 fi
9119
9120 if test -n "$pic_flag" || test "$pic_mode" != default; then
9121 # Only do commands if we really have different PIC objects.
9122 reload_objs="$libobjs $reload_conv_objs"
9123 output="$libobj"
9124 func_execute_cmds "$reload_cmds" 'exit $?'
9125 fi
9126
9127 if test -n "$gentop"; then
9128 func_show_eval '${RM}r "$gentop"'
9129 fi
9130
9131 exit $EXIT_SUCCESS
9132 ;;
9133
9134 prog)
9135 case $host in
9136 *cygwin*) func_stripname '' '.exe' "$output"
9137 output=$func_stripname_result.exe;;
9138 esac
9139 test -n "$vinfo" && \
9140 func_warning "\`-version-info' is ignored for programs"
9141
9142 test -n "$release" && \
9143 func_warning "\`-release' is ignored for programs"
9144
9145 test "$preload" = yes \
9146 && test "$dlopen_support" = unknown \
9147 && test "$dlopen_self" = unknown \
9148 && test "$dlopen_self_static" = unknown && \
9149 func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
9150
9151 case $host in
9152 *-*-rhapsody* | *-*-darwin1.[012])
9153 # On Rhapsody replace the C library is the System framework
9154 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
9155 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
9156 ;;
9157 esac
9158
9159 case $host in
9160 *-*-darwin*)
9161 # Don't allow lazy linking, it breaks C++ global constructors
9162 # But is supposedly fixed on 10.4 or later (yay!).
9163 if test "$tagname" = CXX ; then
9164 case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
9165 10.[0123])
9166 compile_command="$compile_command ${wl}-bind_at_load"
9167 finalize_command="$finalize_command ${wl}-bind_at_load"
9168 ;;
9169 esac
9170 fi
9171 # Time to change all our "foo.ltframework" stuff back to "-framework foo"
9172 compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9173 finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
9174 ;;
9175 esac
9176
9177
9178 # move library search paths that coincide with paths to not yet
9179 # installed libraries to the beginning of the library search list
9180 new_libs=
9181 for path in $notinst_path; do
9182 case " $new_libs " in
9183 *" -L$path/$objdir "*) ;;
9184 *)
9185 case " $compile_deplibs " in
9186 *" -L$path/$objdir "*)
9187 new_libs="$new_libs -L$path/$objdir" ;;
9188 esac
9189 ;;
9190 esac
9191 done
9192 for deplib in $compile_deplibs; do
9193 case $deplib in
9194 -L*)
9195 case " $new_libs " in
9196 *" $deplib "*) ;;
9197 *) new_libs="$new_libs $deplib" ;;
9198 esac
9199 ;;
9200 *) new_libs="$new_libs $deplib" ;;
9201 esac
9202 done
9203 compile_deplibs="$new_libs"
9204
9205
9206 compile_command="$compile_command $compile_deplibs"
9207 finalize_command="$finalize_command $finalize_deplibs"
9208
9209 if test -n "$rpath$xrpath"; then
9210 # If the user specified any rpath flags, then add them.
9211 for libdir in $rpath $xrpath; do
9212 # This is the magic to use -rpath.
9213 case "$finalize_rpath " in
9214 *" $libdir "*) ;;
9215 *) finalize_rpath="$finalize_rpath $libdir" ;;
9216 esac
9217 done
9218 fi
9219
9220 # Now hardcode the library paths
9221 rpath=
9222 hardcode_libdirs=
9223 for libdir in $compile_rpath $finalize_rpath; do
9224 if test -n "$hardcode_libdir_flag_spec"; then
9225 if test -n "$hardcode_libdir_separator"; then
9226 if test -z "$hardcode_libdirs"; then
9227 hardcode_libdirs="$libdir"
9228 else
9229 # Just accumulate the unique libdirs.
9230 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9231 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9232 ;;
9233 *)
9234 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
9235 ;;
9236 esac
9237 fi
9238 else
9239 eval flag=\"$hardcode_libdir_flag_spec\"
9240 rpath="$rpath $flag"
9241 fi
9242 elif test -n "$runpath_var"; then
9243 case "$perm_rpath " in
9244 *" $libdir "*) ;;
9245 *) perm_rpath="$perm_rpath $libdir" ;;
9246 esac
9247 fi
9248 case $host in
9249 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
9250 testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
9251 case :$dllsearchpath: in
9252 *":$libdir:"*) ;;
9253 ::) dllsearchpath=$libdir;;
9254 *) dllsearchpath="$dllsearchpath:$libdir";;
9255 esac
9256 case :$dllsearchpath: in
9257 *":$testbindir:"*) ;;
9258 ::) dllsearchpath=$testbindir;;
9259 *) dllsearchpath="$dllsearchpath:$testbindir";;
9260 esac
9261 ;;
9262 esac
9263 done
9264 # Substitute the hardcoded libdirs into the rpath.
9265 if test -n "$hardcode_libdir_separator" &&
9266 test -n "$hardcode_libdirs"; then
9267 libdir="$hardcode_libdirs"
9268 eval rpath=\" $hardcode_libdir_flag_spec\"
9269 fi
9270 compile_rpath="$rpath"
9271
9272 rpath=
9273 hardcode_libdirs=
9274 for libdir in $finalize_rpath; do
9275 if test -n "$hardcode_libdir_flag_spec"; then
9276 if test -n "$hardcode_libdir_separator"; then
9277 if test -z "$hardcode_libdirs"; then
9278 hardcode_libdirs="$libdir"
9279 else
9280 # Just accumulate the unique libdirs.
9281 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
9282 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
9283 ;;
9284 *)
9285 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
9286 ;;
9287 esac
9288 fi
9289 else
9290 eval flag=\"$hardcode_libdir_flag_spec\"
9291 rpath="$rpath $flag"
9292 fi
9293 elif test -n "$runpath_var"; then
9294 case "$finalize_perm_rpath " in
9295 *" $libdir "*) ;;
9296 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
9297 esac
9298 fi
9299 done
9300 # Substitute the hardcoded libdirs into the rpath.
9301 if test -n "$hardcode_libdir_separator" &&
9302 test -n "$hardcode_libdirs"; then
9303 libdir="$hardcode_libdirs"
9304 eval rpath=\" $hardcode_libdir_flag_spec\"
9305 fi
9306 finalize_rpath="$rpath"
9307
9308 if test -n "$libobjs" && test "$build_old_libs" = yes; then
9309 # Transform all the library objects into standard objects.
9310 compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9311 finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
9312 fi
9313
9314 func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
9315
9316 # template prelinking step
9317 if test -n "$prelink_cmds"; then
9318 func_execute_cmds "$prelink_cmds" 'exit $?'
9319 fi
9320
9321 wrappers_required=yes
9322 case $host in
9323 *cegcc* | *mingw32ce*)
9324 # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
9325 wrappers_required=no
9326 ;;
9327 *cygwin* | *mingw* )
9328 if test "$build_libtool_libs" != yes; then
9329 wrappers_required=no
9330 fi
9331 ;;
9332 *)
9333 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
9334 wrappers_required=no
9335 fi
9336 ;;
9337 esac
9338 if test "$wrappers_required" = no; then
9339 # Replace the output file specification.
9340 compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9341 link_command="$compile_command$compile_rpath"
9342
9343 # We have no uninstalled library dependencies, so finalize right now.
9344 exit_status=0
9345 func_show_eval "$link_command" 'exit_status=$?'
9346
9347 if test -n "$postlink_cmds"; then
9348 func_to_tool_file "$output"
9349 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9350 func_execute_cmds "$postlink_cmds" 'exit $?'
9351 fi
9352
9353 # Delete the generated files.
9354 if test -f "$output_objdir/${outputname}S.${objext}"; then
9355 func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
9356 fi
9357
9358 exit $exit_status
9359 fi
9360
9361 if test -n "$compile_shlibpath$finalize_shlibpath"; then
9362 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
9363 fi
9364 if test -n "$finalize_shlibpath"; then
9365 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
9366 fi
9367
9368 compile_var=
9369 finalize_var=
9370 if test -n "$runpath_var"; then
9371 if test -n "$perm_rpath"; then
9372 # We should set the runpath_var.
9373 rpath=
9374 for dir in $perm_rpath; do
9375 rpath="$rpath$dir:"
9376 done
9377 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
9378 fi
9379 if test -n "$finalize_perm_rpath"; then
9380 # We should set the runpath_var.
9381 rpath=
9382 for dir in $finalize_perm_rpath; do
9383 rpath="$rpath$dir:"
9384 done
9385 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
9386 fi
9387 fi
9388
9389 if test "$no_install" = yes; then
9390 # We don't need to create a wrapper script.
9391 link_command="$compile_var$compile_command$compile_rpath"
9392 # Replace the output file specification.
9393 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
9394 # Delete the old output file.
9395 $opt_dry_run || $RM $output
9396 # Link the executable and exit
9397 func_show_eval "$link_command" 'exit $?'
9398
9399 if test -n "$postlink_cmds"; then
9400 func_to_tool_file "$output"
9401 postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
9402 func_execute_cmds "$postlink_cmds" 'exit $?'
9403 fi
9404
9405 exit $EXIT_SUCCESS
9406 fi
9407
9408 if test "$hardcode_action" = relink; then
9409 # Fast installation is not supported
9410 link_command="$compile_var$compile_command$compile_rpath"
9411 relink_command="$finalize_var$finalize_command$finalize_rpath"
9412
9413 func_warning "this platform does not like uninstalled shared libraries"
9414 func_warning "\`$output' will be relinked during installation"
9415 else
9416 if test "$fast_install" != no; then
9417 link_command="$finalize_var$compile_command$finalize_rpath"
9418 if test "$fast_install" = yes; then
9419 relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
9420 else
9421 # fast_install is set to needless
9422 relink_command=
9423 fi
9424 else
9425 link_command="$compile_var$compile_command$compile_rpath"
9426 relink_command="$finalize_var$finalize_command$finalize_rpath"
9427 fi
9428 fi
9429
9430 # Replace the output file specification.
9431 link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
9432
9433 # Delete the old output files.
9434 $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
9435
9436 func_show_eval "$link_command" 'exit $?'
9437
9438 if test -n "$postlink_cmds"; then
9439 func_to_tool_file "$output_objdir/$outputname"
9440 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'`
9441 func_execute_cmds "$postlink_cmds" 'exit $?'
9442 fi
9443
9444 # Now create the wrapper script.
9445 func_verbose "creating $output"
9446
9447 # Quote the relink command for shipping.
9448 if test -n "$relink_command"; then
9449 # Preserve any variables that may affect compiler behavior
9450 for var in $variables_saved_for_relink; do
9451 if eval test -z \"\${$var+set}\"; then
9452 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9453 elif eval var_value=\$$var; test -z "$var_value"; then
9454 relink_command="$var=; export $var; $relink_command"
9455 else
9456 func_quote_for_eval "$var_value"
9457 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9458 fi
9459 done
9460 relink_command="(cd `pwd`; $relink_command)"
9461 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9462 fi
9463
9464 # Only actually do things if not in dry run mode.
9465 $opt_dry_run || {
9466 # win32 will think the script is a binary if it has
9467 # a .exe suffix, so we strip it off here.
9468 case $output in
9469 *.exe) func_stripname '' '.exe' "$output"
9470 output=$func_stripname_result ;;
9471 esac
9472 # test for cygwin because mv fails w/o .exe extensions
9473 case $host in
9474 *cygwin*)
9475 exeext=.exe
9476 func_stripname '' '.exe' "$outputname"
9477 outputname=$func_stripname_result ;;
9478 *) exeext= ;;
9479 esac
9480 case $host in
9481 *cygwin* | *mingw* )
9482 func_dirname_and_basename "$output" "" "."
9483 output_name=$func_basename_result
9484 output_path=$func_dirname_result
9485 cwrappersource="$output_path/$objdir/lt-$output_name.c"
9486 cwrapper="$output_path/$output_name.exe"
9487 $RM $cwrappersource $cwrapper
9488 trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
9489
9490 func_emit_cwrapperexe_src > $cwrappersource
9491
9492 # The wrapper executable is built using the $host compiler,
9493 # because it contains $host paths and files. If cross-
9494 # compiling, it, like the target executable, must be
9495 # executed on the $host or under an emulation environment.
9496 $opt_dry_run || {
9497 $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
9498 $STRIP $cwrapper
9499 }
9500
9501 # Now, create the wrapper script for func_source use:
9502 func_ltwrapper_scriptname $cwrapper
9503 $RM $func_ltwrapper_scriptname_result
9504 trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
9505 $opt_dry_run || {
9506 # note: this script will not be executed, so do not chmod.
9507 if test "x$build" = "x$host" ; then
9508 $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
9509 else
9510 func_emit_wrapper no > $func_ltwrapper_scriptname_result
9511 fi
9512 }
9513 ;;
9514 * )
9515 $RM $output
9516 trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
9517
9518 func_emit_wrapper no > $output
9519 chmod +x $output
9520 ;;
9521 esac
9522 }
9523 exit $EXIT_SUCCESS
9524 ;;
9525 esac
9526
9527 # See if we need to build an old-fashioned archive.
9528 for oldlib in $oldlibs; do
9529
9530 if test "$build_libtool_libs" = convenience; then
9531 oldobjs="$libobjs_save $symfileobj"
9532 addlibs="$convenience"
9533 build_libtool_libs=no
9534 else
9535 if test "$build_libtool_libs" = module; then
9536 oldobjs="$libobjs_save"
9537 build_libtool_libs=no
9538 else
9539 oldobjs="$old_deplibs $non_pic_objects"
9540 if test "$preload" = yes && test -f "$symfileobj"; then
9541 oldobjs="$oldobjs $symfileobj"
9542 fi
9543 fi
9544 addlibs="$old_convenience"
9545 fi
9546
9547 if test -n "$addlibs"; then
9548 gentop="$output_objdir/${outputname}x"
9549 generated="$generated $gentop"
9550
9551 func_extract_archives $gentop $addlibs
9552 oldobjs="$oldobjs $func_extract_archives_result"
9553 fi
9554
9555 # Do each command in the archive commands.
9556 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
9557 cmds=$old_archive_from_new_cmds
9558 else
9559
9560 # Add any objects from preloaded convenience libraries
9561 if test -n "$dlprefiles"; then
9562 gentop="$output_objdir/${outputname}x"
9563 generated="$generated $gentop"
9564
9565 func_extract_archives $gentop $dlprefiles
9566 oldobjs="$oldobjs $func_extract_archives_result"
9567 fi
9568
9569 # POSIX demands no paths to be encoded in archives. We have
9570 # to avoid creating archives with duplicate basenames if we
9571 # might have to extract them afterwards, e.g., when creating a
9572 # static archive out of a convenience library, or when linking
9573 # the entirety of a libtool archive into another (currently
9574 # not supported by libtool).
9575 if (for obj in $oldobjs
9576 do
9577 func_basename "$obj"
9578 $ECHO "$func_basename_result"
9579 done | sort | sort -uc >/dev/null 2>&1); then
9580 :
9581 else
9582 echo "copying selected object files to avoid basename conflicts..."
9583 gentop="$output_objdir/${outputname}x"
9584 generated="$generated $gentop"
9585 func_mkdir_p "$gentop"
9586 save_oldobjs=$oldobjs
9587 oldobjs=
9588 counter=1
9589 for obj in $save_oldobjs
9590 do
9591 func_basename "$obj"
9592 objbase="$func_basename_result"
9593 case " $oldobjs " in
9594 " ") oldobjs=$obj ;;
9595 *[\ /]"$objbase "*)
9596 while :; do
9597 # Make sure we don't pick an alternate name that also
9598 # overlaps.
9599 newobj=lt$counter-$objbase
9600 func_arith $counter + 1
9601 counter=$func_arith_result
9602 case " $oldobjs " in
9603 *[\ /]"$newobj "*) ;;
9604 *) if test ! -f "$gentop/$newobj"; then break; fi ;;
9605 esac
9606 done
9607 func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
9608 oldobjs="$oldobjs $gentop/$newobj"
9609 ;;
9610 *) oldobjs="$oldobjs $obj" ;;
9611 esac
9612 done
9613 fi
9614 func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
9615 tool_oldlib=$func_to_tool_file_result
9616 eval cmds=\"$old_archive_cmds\"
9617
9618 func_len " $cmds"
9619 len=$func_len_result
9620 if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
9621 cmds=$old_archive_cmds
9622 elif test -n "$archiver_list_spec"; then
9623 func_verbose "using command file archive linking..."
9624 for obj in $oldobjs
9625 do
9626 func_to_tool_file "$obj"
9627 $ECHO "$func_to_tool_file_result"
9628 done > $output_objdir/$libname.libcmd
9629 func_to_tool_file "$output_objdir/$libname.libcmd"
9630 oldobjs=" $archiver_list_spec$func_to_tool_file_result"
9631 cmds=$old_archive_cmds
9632 else
9633 # the command line is too long to link in one step, link in parts
9634 func_verbose "using piecewise archive linking..."
9635 save_RANLIB=$RANLIB
9636 RANLIB=:
9637 objlist=
9638 concat_cmds=
9639 save_oldobjs=$oldobjs
9640 oldobjs=
9641 # Is there a better way of finding the last object in the list?
9642 for obj in $save_oldobjs
9643 do
9644 last_oldobj=$obj
9645 done
9646 eval test_cmds=\"$old_archive_cmds\"
9647 func_len " $test_cmds"
9648 len0=$func_len_result
9649 len=$len0
9650 for obj in $save_oldobjs
9651 do
9652 func_len " $obj"
9653 func_arith $len + $func_len_result
9654 len=$func_arith_result
9655 objlist="$objlist $obj"
9656 if test "$len" -lt "$max_cmd_len"; then
9657 :
9658 else
9659 # the above command should be used before it gets too long
9660 oldobjs=$objlist
9661 if test "$obj" = "$last_oldobj" ; then
9662 RANLIB=$save_RANLIB
9663 fi
9664 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
9665 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
9666 objlist=
9667 len=$len0
9668 fi
9669 done
9670 RANLIB=$save_RANLIB
9671 oldobjs=$objlist
9672 if test "X$oldobjs" = "X" ; then
9673 eval cmds=\"\$concat_cmds\"
9674 else
9675 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
9676 fi
9677 fi
9678 fi
9679 func_execute_cmds "$cmds" 'exit $?'
9680 done
9681
9682 test -n "$generated" && \
9683 func_show_eval "${RM}r$generated"
9684
9685 # Now create the libtool archive.
9686 case $output in
9687 *.la)
9688 old_library=
9689 test "$build_old_libs" = yes && old_library="$libname.$libext"
9690 func_verbose "creating $output"
9691
9692 # Preserve any variables that may affect compiler behavior
9693 for var in $variables_saved_for_relink; do
9694 if eval test -z \"\${$var+set}\"; then
9695 relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
9696 elif eval var_value=\$$var; test -z "$var_value"; then
9697 relink_command="$var=; export $var; $relink_command"
9698 else
9699 func_quote_for_eval "$var_value"
9700 relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
9701 fi
9702 done
9703 # Quote the link command for shipping.
9704 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
9705 relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
9706 if test "$hardcode_automatic" = yes ; then
9707 relink_command=
9708 fi
9709
9710 # Only create the output if not a dry run.
9711 $opt_dry_run || {
9712 for installed in no yes; do
9713 if test "$installed" = yes; then
9714 if test -z "$install_libdir"; then
9715 break
9716 fi
9717 output="$output_objdir/$outputname"i
9718 # Replace all uninstalled libtool libraries with the installed ones
9719 newdependency_libs=
9720 for deplib in $dependency_libs; do
9721 case $deplib in
9722 *.la)
9723 func_basename "$deplib"
9724 name="$func_basename_result"
9725 func_resolve_sysroot "$deplib"
9726 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
9727 test -z "$libdir" && \
9728 func_fatal_error "\`$deplib' is not a valid libtool archive"
9729 newdependency_libs="$newdependency_libs ${lt_sysroot:+=}$libdir/$name"
9730 ;;
9731 -L*)
9732 func_stripname -L '' "$deplib"
9733 func_replace_sysroot "$func_stripname_result"
9734 newdependency_libs="$newdependency_libs -L$func_replace_sysroot_result"
9735 ;;
9736 -R*)
9737 func_stripname -R '' "$deplib"
9738 func_replace_sysroot "$func_stripname_result"
9739 newdependency_libs="$newdependency_libs -R$func_replace_sysroot_result"
9740 ;;
9741 *) newdependency_libs="$newdependency_libs $deplib" ;;
9742 esac
9743 done
9744 dependency_libs="$newdependency_libs"
9745 newdlfiles=
9746
9747 for lib in $dlfiles; do
9748 case $lib in
9749 *.la)
9750 func_basename "$lib"
9751 name="$func_basename_result"
9752 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9753 test -z "$libdir" && \
9754 func_fatal_error "\`$lib' is not a valid libtool archive"
9755 newdlfiles="$newdlfiles ${lt_sysroot:+=}$libdir/$name"
9756 ;;
9757 *) newdlfiles="$newdlfiles $lib" ;;
9758 esac
9759 done
9760 dlfiles="$newdlfiles"
9761 newdlprefiles=
9762 for lib in $dlprefiles; do
9763 case $lib in
9764 *.la)
9765 # Only pass preopened files to the pseudo-archive (for
9766 # eventual linking with the app. that links it) if we
9767 # didn't already link the preopened objects directly into
9768 # the library:
9769 func_basename "$lib"
9770 name="$func_basename_result"
9771 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
9772 test -z "$libdir" && \
9773 func_fatal_error "\`$lib' is not a valid libtool archive"
9774 newdlprefiles="$newdlprefiles ${lt_sysroot:+=}$libdir/$name"
9775 ;;
9776 esac
9777 done
9778 dlprefiles="$newdlprefiles"
9779 else
9780 newdlfiles=
9781 for lib in $dlfiles; do
9782 case $lib in
9783 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9784 *) abs=`pwd`"/$lib" ;;
9785 esac
9786 newdlfiles="$newdlfiles $abs"
9787 done
9788 dlfiles="$newdlfiles"
9789 newdlprefiles=
9790 for lib in $dlprefiles; do
9791 case $lib in
9792 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
9793 *) abs=`pwd`"/$lib" ;;
9794 esac
9795 newdlprefiles="$newdlprefiles $abs"
9796 done
9797 dlprefiles="$newdlprefiles"
9798 fi
9799 $RM $output
9800 # place dlname in correct position for cygwin
9801 # In fact, it would be nice if we could use this code for all target
9802 # systems that can't hard-code library paths into their executables
9803 # and that have no shared library path variable independent of PATH,
9804 # but it turns out we can't easily determine that from inspecting
9805 # libtool variables, so we have to hard-code the OSs to which it
9806 # applies here; at the moment, that means platforms that use the PE
9807 # object format with DLL files. See the long comment at the top of
9808 # tests/bindir.at for full details.
9809 tdlname=$dlname
9810 case $host,$output,$installed,$module,$dlname in
9811 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
9812 # If a -bindir argument was supplied, place the dll there.
9813 if test "x$bindir" != x ;
9814 then
9815 func_relative_path "$install_libdir" "$bindir"
9816 tdlname=$func_relative_path_result$dlname
9817 else
9818 # Otherwise fall back on heuristic.
9819 tdlname=../bin/$dlname
9820 fi
9821 ;;
9822 esac
9823 $ECHO > $output "\
9824# $outputname - a libtool library file
9825# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
9826#
9827# Please DO NOT delete this file!
9828# It is necessary for linking the library.
9829
9830# The name that we can dlopen(3).
9831dlname='$tdlname'
9832
9833# Names of this library.
9834library_names='$library_names'
9835
9836# The name of the static archive.
9837old_library='$old_library'
9838
9839# Linker flags that can not go in dependency_libs.
9840inherited_linker_flags='$new_inherited_linker_flags'
9841
9842# Libraries that this one depends upon.
9843dependency_libs='$dependency_libs'
9844
9845# Names of additional weak libraries provided by this library
9846weak_library_names='$weak_libs'
9847
9848# Version information for $libname.
9849current=$current
9850age=$age
9851revision=$revision
9852
9853# Is this an already installed library?
9854installed=$installed
9855
9856# Should we warn about portability when linking against -modules?
9857shouldnotlink=$module
9858
9859# Files to dlopen/dlpreopen
9860dlopen='$dlfiles'
9861dlpreopen='$dlprefiles'
9862
9863# Directory that this library needs to be installed in:
9864libdir='$install_libdir'"
9865 if test "$installed" = no && test "$need_relink" = yes; then
9866 $ECHO >> $output "\
9867relink_command=\"$relink_command\""
9868 fi
9869 done
9870 }
9871
9872 # Do a symbolic link so that the libtool archive can be found in
9873 # LD_LIBRARY_PATH before the program is installed.
9874 func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
9875 ;;
9876 esac
9877 exit $EXIT_SUCCESS
9878}
9879
9880{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
9881 func_mode_link ${1+"$@"}
9882
9883
9884# func_mode_uninstall arg...
9885func_mode_uninstall ()
9886{
9887 $opt_debug
9888 RM="$nonopt"
9889 files=
9890 rmforce=
9891 exit_status=0
9892
9893 # This variable tells wrapper scripts just to set variables rather
9894 # than running their programs.
9895 libtool_install_magic="$magic"
9896
9897 for arg
9898 do
9899 case $arg in
9900 -f) RM="$RM $arg"; rmforce=yes ;;
9901 -*) RM="$RM $arg" ;;
9902 *) files="$files $arg" ;;
9903 esac
9904 done
9905
9906 test -z "$RM" && \
9907 func_fatal_help "you must specify an RM program"
9908
9909 rmdirs=
9910
9911 for file in $files; do
9912 func_dirname "$file" "" "."
9913 dir="$func_dirname_result"
9914 if test "X$dir" = X.; then
9915 odir="$objdir"
9916 else
9917 odir="$dir/$objdir"
9918 fi
9919 func_basename "$file"
9920 name="$func_basename_result"
9921 test "$opt_mode" = uninstall && odir="$dir"
9922
9923 # Remember odir for removal later, being careful to avoid duplicates
9924 if test "$opt_mode" = clean; then
9925 case " $rmdirs " in
9926 *" $odir "*) ;;
9927 *) rmdirs="$rmdirs $odir" ;;
9928 esac
9929 fi
9930
9931 # Don't error if the file doesn't exist and rm -f was used.
9932 if { test -L "$file"; } >/dev/null 2>&1 ||
9933 { test -h "$file"; } >/dev/null 2>&1 ||
9934 test -f "$file"; then
9935 :
9936 elif test -d "$file"; then
9937 exit_status=1
9938 continue
9939 elif test "$rmforce" = yes; then
9940 continue
9941 fi
9942
9943 rmfiles="$file"
9944
9945 case $name in
9946 *.la)
9947 # Possibly a libtool archive, so verify it.
9948 if func_lalib_p "$file"; then
9949 func_source $dir/$name
9950
9951 # Delete the libtool libraries and symlinks.
9952 for n in $library_names; do
9953 rmfiles="$rmfiles $odir/$n"
9954 done
9955 test -n "$old_library" && rmfiles="$rmfiles $odir/$old_library"
9956
9957 case "$opt_mode" in
9958 clean)
9959 case " $library_names " in
9960 *" $dlname "*) ;;
9961 *) test -n "$dlname" && rmfiles="$rmfiles $odir/$dlname" ;;
9962 esac
9963 test -n "$libdir" && rmfiles="$rmfiles $odir/$name $odir/${name}i"
9964 ;;
9965 uninstall)
9966 if test -n "$library_names"; then
9967 # Do each command in the postuninstall commands.
9968 func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9969 fi
9970
9971 if test -n "$old_library"; then
9972 # Do each command in the old_postuninstall commands.
9973 func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
9974 fi
9975 # FIXME: should reinstall the best remaining shared library.
9976 ;;
9977 esac
9978 fi
9979 ;;
9980
9981 *.lo)
9982 # Possibly a libtool object, so verify it.
9983 if func_lalib_p "$file"; then
9984
9985 # Read the .lo file
9986 func_source $dir/$name
9987
9988 # Add PIC object to the list of files to remove.
9989 if test -n "$pic_object" &&
9990 test "$pic_object" != none; then
9991 rmfiles="$rmfiles $dir/$pic_object"
9992 fi
9993
9994 # Add non-PIC object to the list of files to remove.
9995 if test -n "$non_pic_object" &&
9996 test "$non_pic_object" != none; then
9997 rmfiles="$rmfiles $dir/$non_pic_object"
9998 fi
9999 fi
10000 ;;
10001
10002 *)
10003 if test "$opt_mode" = clean ; then
10004 noexename=$name
10005 case $file in
10006 *.exe)
10007 func_stripname '' '.exe' "$file"
10008 file=$func_stripname_result
10009 func_stripname '' '.exe' "$name"
10010 noexename=$func_stripname_result
10011 # $file with .exe has already been added to rmfiles,
10012 # add $file without .exe
10013 rmfiles="$rmfiles $file"
10014 ;;
10015 esac
10016 # Do a test to see if this is a libtool program.
10017 if func_ltwrapper_p "$file"; then
10018 if func_ltwrapper_executable_p "$file"; then
10019 func_ltwrapper_scriptname "$file"
10020 relink_command=
10021 func_source $func_ltwrapper_scriptname_result
10022 rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
10023 else
10024 relink_command=
10025 func_source $dir/$noexename
10026 fi
10027
10028 # note $name still contains .exe if it was in $file originally
10029 # as does the version of $file that was added into $rmfiles
10030 rmfiles="$rmfiles $odir/$name $odir/${name}S.${objext}"
10031 if test "$fast_install" = yes && test -n "$relink_command"; then
10032 rmfiles="$rmfiles $odir/lt-$name"
10033 fi
10034 if test "X$noexename" != "X$name" ; then
10035 rmfiles="$rmfiles $odir/lt-${noexename}.c"
10036 fi
10037 fi
10038 fi
10039 ;;
10040 esac
10041 func_show_eval "$RM $rmfiles" 'exit_status=1'
10042 done
10043
10044 # Try to remove the ${objdir}s in the directories where we deleted files
10045 for dir in $rmdirs; do
10046 if test -d "$dir"; then
10047 func_show_eval "rmdir $dir >/dev/null 2>&1"
10048 fi
10049 done
10050
10051 exit $exit_status
10052}
10053
10054{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
10055 func_mode_uninstall ${1+"$@"}
10056
10057test -z "$opt_mode" && {
10058 help="$generic_help"
10059 func_fatal_help "you must specify a MODE"
10060}
10061
10062test -z "$exec_cmd" && \
10063 func_fatal_help "invalid operation mode \`$opt_mode'"
10064
10065if test -n "$exec_cmd"; then
10066 eval exec "$exec_cmd"
10067 exit $EXIT_FAILURE
10068fi
10069
10070exit $exit_status
10071
10072
10073# The TAGs below are defined such that we never get into a situation
10074# in which we disable both kinds of libraries. Given conflicting
10075# choices, we go for a static library, that is the most portable,
10076# since we can't tell whether shared libraries were disabled because
10077# the user asked for that or because the platform doesn't support
10078# them. This is particularly important on AIX, because we don't
10079# support having both static and shared libraries enabled at the same
10080# time on that platform, so we default to a shared-only configuration.
10081# If a disable-shared tag is given, we'll fallback to a static-only
10082# configuration. But we'll never go from static-only to shared-only.
10083
10084# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
10085build_libtool_libs=no
10086build_old_libs=yes
10087# ### END LIBTOOL TAG CONFIG: disable-shared
10088
10089# ### BEGIN LIBTOOL TAG CONFIG: disable-static
10090build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
10091# ### END LIBTOOL TAG CONFIG: disable-static
10092
10093# Local Variables:
10094# mode:shell-script
10095# sh-indentation:2
10096# End:
10097# vi:sw=2