annotate libtool @ 6:128cae6f3459

initial coding
author carl
date Fri, 02 Dec 2005 18:01:07 -0800
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
6
128cae6f3459 initial coding
carl
parents:
diff changeset
1 #! /bin/sh
128cae6f3459 initial coding
carl
parents:
diff changeset
2
128cae6f3459 initial coding
carl
parents:
diff changeset
3 # libtoolT - Provide generalized library-building support services.
128cae6f3459 initial coding
carl
parents:
diff changeset
4 # Generated automatically by (GNU syslog2iptables 0.1)
128cae6f3459 initial coding
carl
parents:
diff changeset
5 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
128cae6f3459 initial coding
carl
parents:
diff changeset
6 #
128cae6f3459 initial coding
carl
parents:
diff changeset
7 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
128cae6f3459 initial coding
carl
parents:
diff changeset
8 # Free Software Foundation, Inc.
128cae6f3459 initial coding
carl
parents:
diff changeset
9 #
128cae6f3459 initial coding
carl
parents:
diff changeset
10 # This file is part of GNU Libtool:
128cae6f3459 initial coding
carl
parents:
diff changeset
11 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
128cae6f3459 initial coding
carl
parents:
diff changeset
12 #
128cae6f3459 initial coding
carl
parents:
diff changeset
13 # This program is free software; you can redistribute it and/or modify
128cae6f3459 initial coding
carl
parents:
diff changeset
14 # it under the terms of the GNU General Public License as published by
128cae6f3459 initial coding
carl
parents:
diff changeset
15 # the Free Software Foundation; either version 2 of the License, or
128cae6f3459 initial coding
carl
parents:
diff changeset
16 # (at your option) any later version.
128cae6f3459 initial coding
carl
parents:
diff changeset
17 #
128cae6f3459 initial coding
carl
parents:
diff changeset
18 # This program is distributed in the hope that it will be useful, but
128cae6f3459 initial coding
carl
parents:
diff changeset
19 # WITHOUT ANY WARRANTY; without even the implied warranty of
128cae6f3459 initial coding
carl
parents:
diff changeset
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
128cae6f3459 initial coding
carl
parents:
diff changeset
21 # General Public License for more details.
128cae6f3459 initial coding
carl
parents:
diff changeset
22 #
128cae6f3459 initial coding
carl
parents:
diff changeset
23 # You should have received a copy of the GNU General Public License
128cae6f3459 initial coding
carl
parents:
diff changeset
24 # along with this program; if not, write to the Free Software
128cae6f3459 initial coding
carl
parents:
diff changeset
25 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
128cae6f3459 initial coding
carl
parents:
diff changeset
26 #
128cae6f3459 initial coding
carl
parents:
diff changeset
27 # As a special exception to the GNU General Public License, if you
128cae6f3459 initial coding
carl
parents:
diff changeset
28 # distribute this file as part of a program that contains a
128cae6f3459 initial coding
carl
parents:
diff changeset
29 # configuration script generated by Autoconf, you may include it under
128cae6f3459 initial coding
carl
parents:
diff changeset
30 # the same distribution terms that you use for the rest of that program.
128cae6f3459 initial coding
carl
parents:
diff changeset
31
128cae6f3459 initial coding
carl
parents:
diff changeset
32 # A sed program that does not truncate output.
128cae6f3459 initial coding
carl
parents:
diff changeset
33 SED="/bin/sed"
128cae6f3459 initial coding
carl
parents:
diff changeset
34
128cae6f3459 initial coding
carl
parents:
diff changeset
35 # Sed that helps us avoid accidentally triggering echo(1) options like -n.
128cae6f3459 initial coding
carl
parents:
diff changeset
36 Xsed="/bin/sed -e s/^X//"
128cae6f3459 initial coding
carl
parents:
diff changeset
37
128cae6f3459 initial coding
carl
parents:
diff changeset
38 # The HP-UX ksh and POSIX shell print the target directory to stdout
128cae6f3459 initial coding
carl
parents:
diff changeset
39 # if CDPATH is set.
128cae6f3459 initial coding
carl
parents:
diff changeset
40 if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
128cae6f3459 initial coding
carl
parents:
diff changeset
41
128cae6f3459 initial coding
carl
parents:
diff changeset
42 # The names of the tagged configurations supported by this script.
128cae6f3459 initial coding
carl
parents:
diff changeset
43 available_tags=" CXX F77"
128cae6f3459 initial coding
carl
parents:
diff changeset
44
128cae6f3459 initial coding
carl
parents:
diff changeset
45 # ### BEGIN LIBTOOL CONFIG
128cae6f3459 initial coding
carl
parents:
diff changeset
46
128cae6f3459 initial coding
carl
parents:
diff changeset
47 # Libtool was configured on host ns.five-ten-sg.com:
128cae6f3459 initial coding
carl
parents:
diff changeset
48
128cae6f3459 initial coding
carl
parents:
diff changeset
49 # Shell to use when invoking shell scripts.
128cae6f3459 initial coding
carl
parents:
diff changeset
50 SHELL="/bin/sh"
128cae6f3459 initial coding
carl
parents:
diff changeset
51
128cae6f3459 initial coding
carl
parents:
diff changeset
52 # Whether or not to build shared libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
53 build_libtool_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
54
128cae6f3459 initial coding
carl
parents:
diff changeset
55 # Whether or not to build static libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
56 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
57
128cae6f3459 initial coding
carl
parents:
diff changeset
58 # Whether or not to add -lc for building shared libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
59 build_libtool_need_lc=no
128cae6f3459 initial coding
carl
parents:
diff changeset
60
128cae6f3459 initial coding
carl
parents:
diff changeset
61 # Whether or not to disallow shared libs when runtime libs are static
128cae6f3459 initial coding
carl
parents:
diff changeset
62 allow_libtool_libs_with_static_runtimes=no
128cae6f3459 initial coding
carl
parents:
diff changeset
63
128cae6f3459 initial coding
carl
parents:
diff changeset
64 # Whether or not to optimize for fast installation.
128cae6f3459 initial coding
carl
parents:
diff changeset
65 fast_install=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
66
128cae6f3459 initial coding
carl
parents:
diff changeset
67 # The host system.
128cae6f3459 initial coding
carl
parents:
diff changeset
68 host_alias=
128cae6f3459 initial coding
carl
parents:
diff changeset
69 host=i686-redhat-linux-gnu
128cae6f3459 initial coding
carl
parents:
diff changeset
70
128cae6f3459 initial coding
carl
parents:
diff changeset
71 # An echo program that does not interpret backslashes.
128cae6f3459 initial coding
carl
parents:
diff changeset
72 echo="echo"
128cae6f3459 initial coding
carl
parents:
diff changeset
73
128cae6f3459 initial coding
carl
parents:
diff changeset
74 # The archiver.
128cae6f3459 initial coding
carl
parents:
diff changeset
75 AR="ar"
128cae6f3459 initial coding
carl
parents:
diff changeset
76 AR_FLAGS="cru"
128cae6f3459 initial coding
carl
parents:
diff changeset
77
128cae6f3459 initial coding
carl
parents:
diff changeset
78 # A C compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
79 LTCC="gcc"
128cae6f3459 initial coding
carl
parents:
diff changeset
80
128cae6f3459 initial coding
carl
parents:
diff changeset
81 # A language-specific compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
82 CC="gcc"
128cae6f3459 initial coding
carl
parents:
diff changeset
83
128cae6f3459 initial coding
carl
parents:
diff changeset
84 # Is the compiler the GNU C compiler?
128cae6f3459 initial coding
carl
parents:
diff changeset
85 with_gcc=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
86
128cae6f3459 initial coding
carl
parents:
diff changeset
87 # An ERE matcher.
128cae6f3459 initial coding
carl
parents:
diff changeset
88 EGREP="grep -E"
128cae6f3459 initial coding
carl
parents:
diff changeset
89
128cae6f3459 initial coding
carl
parents:
diff changeset
90 # The linker used to build libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
91 LD="/usr/bin/ld"
128cae6f3459 initial coding
carl
parents:
diff changeset
92
128cae6f3459 initial coding
carl
parents:
diff changeset
93 # Whether we need hard or soft links.
128cae6f3459 initial coding
carl
parents:
diff changeset
94 LN_S="ln -s"
128cae6f3459 initial coding
carl
parents:
diff changeset
95
128cae6f3459 initial coding
carl
parents:
diff changeset
96 # A BSD-compatible nm program.
128cae6f3459 initial coding
carl
parents:
diff changeset
97 NM="/usr/bin/nm -B"
128cae6f3459 initial coding
carl
parents:
diff changeset
98
128cae6f3459 initial coding
carl
parents:
diff changeset
99 # A symbol stripping program
128cae6f3459 initial coding
carl
parents:
diff changeset
100 STRIP="strip"
128cae6f3459 initial coding
carl
parents:
diff changeset
101
128cae6f3459 initial coding
carl
parents:
diff changeset
102 # Used to examine libraries when file_magic_cmd begins "file"
128cae6f3459 initial coding
carl
parents:
diff changeset
103 MAGIC_CMD=file
128cae6f3459 initial coding
carl
parents:
diff changeset
104
128cae6f3459 initial coding
carl
parents:
diff changeset
105 # Used on cygwin: DLL creation program.
128cae6f3459 initial coding
carl
parents:
diff changeset
106 DLLTOOL="dlltool"
128cae6f3459 initial coding
carl
parents:
diff changeset
107
128cae6f3459 initial coding
carl
parents:
diff changeset
108 # Used on cygwin: object dumper.
128cae6f3459 initial coding
carl
parents:
diff changeset
109 OBJDUMP="objdump"
128cae6f3459 initial coding
carl
parents:
diff changeset
110
128cae6f3459 initial coding
carl
parents:
diff changeset
111 # Used on cygwin: assembler.
128cae6f3459 initial coding
carl
parents:
diff changeset
112 AS="as"
128cae6f3459 initial coding
carl
parents:
diff changeset
113
128cae6f3459 initial coding
carl
parents:
diff changeset
114 # The name of the directory that contains temporary libtool files.
128cae6f3459 initial coding
carl
parents:
diff changeset
115 objdir=.libs
128cae6f3459 initial coding
carl
parents:
diff changeset
116
128cae6f3459 initial coding
carl
parents:
diff changeset
117 # How to create reloadable object files.
128cae6f3459 initial coding
carl
parents:
diff changeset
118 reload_flag=" -r"
128cae6f3459 initial coding
carl
parents:
diff changeset
119 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
128cae6f3459 initial coding
carl
parents:
diff changeset
120
128cae6f3459 initial coding
carl
parents:
diff changeset
121 # How to pass a linker flag through the compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
122 wl="-Wl,"
128cae6f3459 initial coding
carl
parents:
diff changeset
123
128cae6f3459 initial coding
carl
parents:
diff changeset
124 # Object file suffix (normally "o").
128cae6f3459 initial coding
carl
parents:
diff changeset
125 objext="o"
128cae6f3459 initial coding
carl
parents:
diff changeset
126
128cae6f3459 initial coding
carl
parents:
diff changeset
127 # Old archive suffix (normally "a").
128cae6f3459 initial coding
carl
parents:
diff changeset
128 libext="a"
128cae6f3459 initial coding
carl
parents:
diff changeset
129
128cae6f3459 initial coding
carl
parents:
diff changeset
130 # Shared library suffix (normally ".so").
128cae6f3459 initial coding
carl
parents:
diff changeset
131 shrext_cmds='.so'
128cae6f3459 initial coding
carl
parents:
diff changeset
132
128cae6f3459 initial coding
carl
parents:
diff changeset
133 # Executable file suffix (normally "").
128cae6f3459 initial coding
carl
parents:
diff changeset
134 exeext=""
128cae6f3459 initial coding
carl
parents:
diff changeset
135
128cae6f3459 initial coding
carl
parents:
diff changeset
136 # Additional compiler flags for building library objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
137 pic_flag=" -fPIC -DPIC"
128cae6f3459 initial coding
carl
parents:
diff changeset
138 pic_mode=default
128cae6f3459 initial coding
carl
parents:
diff changeset
139
128cae6f3459 initial coding
carl
parents:
diff changeset
140 # What is the maximum length of a command?
128cae6f3459 initial coding
carl
parents:
diff changeset
141 max_cmd_len=32768
128cae6f3459 initial coding
carl
parents:
diff changeset
142
128cae6f3459 initial coding
carl
parents:
diff changeset
143 # Does compiler simultaneously support -c and -o options?
128cae6f3459 initial coding
carl
parents:
diff changeset
144 compiler_c_o="yes"
128cae6f3459 initial coding
carl
parents:
diff changeset
145
128cae6f3459 initial coding
carl
parents:
diff changeset
146 # Must we lock files when doing compilation ?
128cae6f3459 initial coding
carl
parents:
diff changeset
147 need_locks="no"
128cae6f3459 initial coding
carl
parents:
diff changeset
148
128cae6f3459 initial coding
carl
parents:
diff changeset
149 # Do we need the lib prefix for modules?
128cae6f3459 initial coding
carl
parents:
diff changeset
150 need_lib_prefix=no
128cae6f3459 initial coding
carl
parents:
diff changeset
151
128cae6f3459 initial coding
carl
parents:
diff changeset
152 # Do we need a version for libraries?
128cae6f3459 initial coding
carl
parents:
diff changeset
153 need_version=no
128cae6f3459 initial coding
carl
parents:
diff changeset
154
128cae6f3459 initial coding
carl
parents:
diff changeset
155 # Whether dlopen is supported.
128cae6f3459 initial coding
carl
parents:
diff changeset
156 dlopen_support=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
157
128cae6f3459 initial coding
carl
parents:
diff changeset
158 # Whether dlopen of programs is supported.
128cae6f3459 initial coding
carl
parents:
diff changeset
159 dlopen_self=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
160
128cae6f3459 initial coding
carl
parents:
diff changeset
161 # Whether dlopen of statically linked programs is supported.
128cae6f3459 initial coding
carl
parents:
diff changeset
162 dlopen_self_static=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
163
128cae6f3459 initial coding
carl
parents:
diff changeset
164 # Compiler flag to prevent dynamic linking.
128cae6f3459 initial coding
carl
parents:
diff changeset
165 link_static_flag="-static"
128cae6f3459 initial coding
carl
parents:
diff changeset
166
128cae6f3459 initial coding
carl
parents:
diff changeset
167 # Compiler flag to turn off builtin functions.
128cae6f3459 initial coding
carl
parents:
diff changeset
168 no_builtin_flag=" -fno-builtin"
128cae6f3459 initial coding
carl
parents:
diff changeset
169
128cae6f3459 initial coding
carl
parents:
diff changeset
170 # Compiler flag to allow reflexive dlopens.
128cae6f3459 initial coding
carl
parents:
diff changeset
171 export_dynamic_flag_spec="\${wl}--export-dynamic"
128cae6f3459 initial coding
carl
parents:
diff changeset
172
128cae6f3459 initial coding
carl
parents:
diff changeset
173 # Compiler flag to generate shared objects directly from archives.
128cae6f3459 initial coding
carl
parents:
diff changeset
174 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
128cae6f3459 initial coding
carl
parents:
diff changeset
175
128cae6f3459 initial coding
carl
parents:
diff changeset
176 # Compiler flag to generate thread-safe objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
177 thread_safe_flag_spec=""
128cae6f3459 initial coding
carl
parents:
diff changeset
178
128cae6f3459 initial coding
carl
parents:
diff changeset
179 # Library versioning type.
128cae6f3459 initial coding
carl
parents:
diff changeset
180 version_type=linux
128cae6f3459 initial coding
carl
parents:
diff changeset
181
128cae6f3459 initial coding
carl
parents:
diff changeset
182 # Format of library name prefix.
128cae6f3459 initial coding
carl
parents:
diff changeset
183 libname_spec="lib\$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
184
128cae6f3459 initial coding
carl
parents:
diff changeset
185 # List of archive names. First name is the real one, the rest are links.
128cae6f3459 initial coding
carl
parents:
diff changeset
186 # The last name is the one that the linker finds with -lNAME.
128cae6f3459 initial coding
carl
parents:
diff changeset
187 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
128cae6f3459 initial coding
carl
parents:
diff changeset
188
128cae6f3459 initial coding
carl
parents:
diff changeset
189 # The coded name of the library, if different from the real name.
128cae6f3459 initial coding
carl
parents:
diff changeset
190 soname_spec="\${libname}\${release}\${shared_ext}\$major"
128cae6f3459 initial coding
carl
parents:
diff changeset
191
128cae6f3459 initial coding
carl
parents:
diff changeset
192 # Commands used to build and install an old-style archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
193 RANLIB="ranlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
194 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
195 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
196 old_postuninstall_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
197
128cae6f3459 initial coding
carl
parents:
diff changeset
198 # Create an old-style archive from a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
199 old_archive_from_new_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
200
128cae6f3459 initial coding
carl
parents:
diff changeset
201 # Create a temporary old-style archive to link instead of a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
202 old_archive_from_expsyms_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
203
128cae6f3459 initial coding
carl
parents:
diff changeset
204 # Commands used to build and install a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
205 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
128cae6f3459 initial coding
carl
parents:
diff changeset
206 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
128cae6f3459 initial coding
carl
parents:
diff changeset
207 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
128cae6f3459 initial coding
carl
parents:
diff changeset
208 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
128cae6f3459 initial coding
carl
parents:
diff changeset
209 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
128cae6f3459 initial coding
carl
parents:
diff changeset
210 postinstall_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
211 postuninstall_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
212
128cae6f3459 initial coding
carl
parents:
diff changeset
213 # Commands used to build a loadable module (assumed same as above if empty)
128cae6f3459 initial coding
carl
parents:
diff changeset
214 module_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
215 module_expsym_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
216
128cae6f3459 initial coding
carl
parents:
diff changeset
217 # Commands to strip libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
218 old_striplib="strip --strip-debug"
128cae6f3459 initial coding
carl
parents:
diff changeset
219 striplib="strip --strip-unneeded"
128cae6f3459 initial coding
carl
parents:
diff changeset
220
128cae6f3459 initial coding
carl
parents:
diff changeset
221 # Dependencies to place before the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
222 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
223 predep_objects=""
128cae6f3459 initial coding
carl
parents:
diff changeset
224
128cae6f3459 initial coding
carl
parents:
diff changeset
225 # Dependencies to place after the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
226 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
227 postdep_objects=""
128cae6f3459 initial coding
carl
parents:
diff changeset
228
128cae6f3459 initial coding
carl
parents:
diff changeset
229 # Dependencies to place before the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
230 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
231 predeps=""
128cae6f3459 initial coding
carl
parents:
diff changeset
232
128cae6f3459 initial coding
carl
parents:
diff changeset
233 # Dependencies to place after the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
234 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
235 postdeps=""
128cae6f3459 initial coding
carl
parents:
diff changeset
236
128cae6f3459 initial coding
carl
parents:
diff changeset
237 # The library search path used internally by the compiler when linking
128cae6f3459 initial coding
carl
parents:
diff changeset
238 # a shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
239 compiler_lib_search_path=""
128cae6f3459 initial coding
carl
parents:
diff changeset
240
128cae6f3459 initial coding
carl
parents:
diff changeset
241 # Method to check whether dependent libraries are shared objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
242 deplibs_check_method="pass_all"
128cae6f3459 initial coding
carl
parents:
diff changeset
243
128cae6f3459 initial coding
carl
parents:
diff changeset
244 # Command to use when deplibs_check_method == file_magic.
128cae6f3459 initial coding
carl
parents:
diff changeset
245 file_magic_cmd="\$MAGIC_CMD"
128cae6f3459 initial coding
carl
parents:
diff changeset
246
128cae6f3459 initial coding
carl
parents:
diff changeset
247 # Flag that allows shared libraries with undefined symbols to be built.
128cae6f3459 initial coding
carl
parents:
diff changeset
248 allow_undefined_flag=""
128cae6f3459 initial coding
carl
parents:
diff changeset
249
128cae6f3459 initial coding
carl
parents:
diff changeset
250 # Flag that forces no undefined symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
251 no_undefined_flag=""
128cae6f3459 initial coding
carl
parents:
diff changeset
252
128cae6f3459 initial coding
carl
parents:
diff changeset
253 # Commands used to finish a libtool library installation in a directory.
128cae6f3459 initial coding
carl
parents:
diff changeset
254 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
255
128cae6f3459 initial coding
carl
parents:
diff changeset
256 # Same as above, but a single script fragment to be evaled but not shown.
128cae6f3459 initial coding
carl
parents:
diff changeset
257 finish_eval=""
128cae6f3459 initial coding
carl
parents:
diff changeset
258
128cae6f3459 initial coding
carl
parents:
diff changeset
259 # Take the output of nm and produce a listing of raw symbols and C names.
128cae6f3459 initial coding
carl
parents:
diff changeset
260 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
128cae6f3459 initial coding
carl
parents:
diff changeset
261
128cae6f3459 initial coding
carl
parents:
diff changeset
262 # Transform the output of nm in a proper C declaration
128cae6f3459 initial coding
carl
parents:
diff changeset
263 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
128cae6f3459 initial coding
carl
parents:
diff changeset
264
128cae6f3459 initial coding
carl
parents:
diff changeset
265 # Transform the output of nm in a C name address pair
128cae6f3459 initial coding
carl
parents:
diff changeset
266 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
128cae6f3459 initial coding
carl
parents:
diff changeset
267
128cae6f3459 initial coding
carl
parents:
diff changeset
268 # This is the shared library runtime path variable.
128cae6f3459 initial coding
carl
parents:
diff changeset
269 runpath_var=LD_RUN_PATH
128cae6f3459 initial coding
carl
parents:
diff changeset
270
128cae6f3459 initial coding
carl
parents:
diff changeset
271 # This is the shared library path variable.
128cae6f3459 initial coding
carl
parents:
diff changeset
272 shlibpath_var=LD_LIBRARY_PATH
128cae6f3459 initial coding
carl
parents:
diff changeset
273
128cae6f3459 initial coding
carl
parents:
diff changeset
274 # Is shlibpath searched before the hard-coded library search path?
128cae6f3459 initial coding
carl
parents:
diff changeset
275 shlibpath_overrides_runpath=no
128cae6f3459 initial coding
carl
parents:
diff changeset
276
128cae6f3459 initial coding
carl
parents:
diff changeset
277 # How to hardcode a shared library path into an executable.
128cae6f3459 initial coding
carl
parents:
diff changeset
278 hardcode_action=immediate
128cae6f3459 initial coding
carl
parents:
diff changeset
279
128cae6f3459 initial coding
carl
parents:
diff changeset
280 # Whether we should hardcode library paths into libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
281 hardcode_into_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
282
128cae6f3459 initial coding
carl
parents:
diff changeset
283 # Flag to hardcode $libdir into a binary during linking.
128cae6f3459 initial coding
carl
parents:
diff changeset
284 # This must work even if $libdir does not exist.
128cae6f3459 initial coding
carl
parents:
diff changeset
285 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
286
128cae6f3459 initial coding
carl
parents:
diff changeset
287 # If ld is used when linking, flag to hardcode $libdir into
128cae6f3459 initial coding
carl
parents:
diff changeset
288 # a binary during linking. This must work even if $libdir does
128cae6f3459 initial coding
carl
parents:
diff changeset
289 # not exist.
128cae6f3459 initial coding
carl
parents:
diff changeset
290 hardcode_libdir_flag_spec_ld=""
128cae6f3459 initial coding
carl
parents:
diff changeset
291
128cae6f3459 initial coding
carl
parents:
diff changeset
292 # Whether we need a single -rpath flag with a separated argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
293 hardcode_libdir_separator=""
128cae6f3459 initial coding
carl
parents:
diff changeset
294
128cae6f3459 initial coding
carl
parents:
diff changeset
295 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
128cae6f3459 initial coding
carl
parents:
diff changeset
296 # resulting binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
297 hardcode_direct=no
128cae6f3459 initial coding
carl
parents:
diff changeset
298
128cae6f3459 initial coding
carl
parents:
diff changeset
299 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
128cae6f3459 initial coding
carl
parents:
diff changeset
300 # resulting binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
301 hardcode_minus_L=no
128cae6f3459 initial coding
carl
parents:
diff changeset
302
128cae6f3459 initial coding
carl
parents:
diff changeset
303 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
128cae6f3459 initial coding
carl
parents:
diff changeset
304 # the resulting binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
305 hardcode_shlibpath_var=unsupported
128cae6f3459 initial coding
carl
parents:
diff changeset
306
128cae6f3459 initial coding
carl
parents:
diff changeset
307 # Set to yes if building a shared library automatically hardcodes DIR into the library
128cae6f3459 initial coding
carl
parents:
diff changeset
308 # and all subsequent libraries and executables linked against it.
128cae6f3459 initial coding
carl
parents:
diff changeset
309 hardcode_automatic=no
128cae6f3459 initial coding
carl
parents:
diff changeset
310
128cae6f3459 initial coding
carl
parents:
diff changeset
311 # Variables whose values should be saved in libtool wrapper scripts and
128cae6f3459 initial coding
carl
parents:
diff changeset
312 # restored at relink time.
128cae6f3459 initial coding
carl
parents:
diff changeset
313 variables_saved_for_relink="PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
128cae6f3459 initial coding
carl
parents:
diff changeset
314
128cae6f3459 initial coding
carl
parents:
diff changeset
315 # Whether libtool must link a program against all its dependency libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
316 link_all_deplibs=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
317
128cae6f3459 initial coding
carl
parents:
diff changeset
318 # Compile-time system search path for libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
319 sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../ /lib/i386-redhat-linux/3.4.4/ /lib/ /usr/lib/i386-redhat-linux/3.4.4/ /usr/lib/"
128cae6f3459 initial coding
carl
parents:
diff changeset
320
128cae6f3459 initial coding
carl
parents:
diff changeset
321 # Run-time system search path for libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
322 sys_lib_dlsearch_path_spec="/lib /usr/lib include ld.so.conf.d/*.conf /usr/lib/wine "
128cae6f3459 initial coding
carl
parents:
diff changeset
323
128cae6f3459 initial coding
carl
parents:
diff changeset
324 # Fix the shell variable $srcfile for the compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
325 fix_srcfile_path=""
128cae6f3459 initial coding
carl
parents:
diff changeset
326
128cae6f3459 initial coding
carl
parents:
diff changeset
327 # Set to yes if exported symbols are required.
128cae6f3459 initial coding
carl
parents:
diff changeset
328 always_export_symbols=no
128cae6f3459 initial coding
carl
parents:
diff changeset
329
128cae6f3459 initial coding
carl
parents:
diff changeset
330 # The commands to list exported symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
331 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
128cae6f3459 initial coding
carl
parents:
diff changeset
332
128cae6f3459 initial coding
carl
parents:
diff changeset
333 # The commands to extract the exported symbol list from a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
334 extract_expsyms_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
335
128cae6f3459 initial coding
carl
parents:
diff changeset
336 # Symbols that should not be listed in the preloaded symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
337 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
128cae6f3459 initial coding
carl
parents:
diff changeset
338
128cae6f3459 initial coding
carl
parents:
diff changeset
339 # Symbols that must always be exported.
128cae6f3459 initial coding
carl
parents:
diff changeset
340 include_expsyms=""
128cae6f3459 initial coding
carl
parents:
diff changeset
341
128cae6f3459 initial coding
carl
parents:
diff changeset
342 # ### END LIBTOOL CONFIG
128cae6f3459 initial coding
carl
parents:
diff changeset
343
128cae6f3459 initial coding
carl
parents:
diff changeset
344 # ltmain.sh - Provide generalized library-building support services.
128cae6f3459 initial coding
carl
parents:
diff changeset
345 # NOTE: Changing this file will not affect anything until you rerun configure.
128cae6f3459 initial coding
carl
parents:
diff changeset
346 #
128cae6f3459 initial coding
carl
parents:
diff changeset
347 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
128cae6f3459 initial coding
carl
parents:
diff changeset
348 # Free Software Foundation, Inc.
128cae6f3459 initial coding
carl
parents:
diff changeset
349 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
128cae6f3459 initial coding
carl
parents:
diff changeset
350 #
128cae6f3459 initial coding
carl
parents:
diff changeset
351 # This program is free software; you can redistribute it and/or modify
128cae6f3459 initial coding
carl
parents:
diff changeset
352 # it under the terms of the GNU General Public License as published by
128cae6f3459 initial coding
carl
parents:
diff changeset
353 # the Free Software Foundation; either version 2 of the License, or
128cae6f3459 initial coding
carl
parents:
diff changeset
354 # (at your option) any later version.
128cae6f3459 initial coding
carl
parents:
diff changeset
355 #
128cae6f3459 initial coding
carl
parents:
diff changeset
356 # This program is distributed in the hope that it will be useful, but
128cae6f3459 initial coding
carl
parents:
diff changeset
357 # WITHOUT ANY WARRANTY; without even the implied warranty of
128cae6f3459 initial coding
carl
parents:
diff changeset
358 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
128cae6f3459 initial coding
carl
parents:
diff changeset
359 # General Public License for more details.
128cae6f3459 initial coding
carl
parents:
diff changeset
360 #
128cae6f3459 initial coding
carl
parents:
diff changeset
361 # You should have received a copy of the GNU General Public License
128cae6f3459 initial coding
carl
parents:
diff changeset
362 # along with this program; if not, write to the Free Software
128cae6f3459 initial coding
carl
parents:
diff changeset
363 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
128cae6f3459 initial coding
carl
parents:
diff changeset
364 #
128cae6f3459 initial coding
carl
parents:
diff changeset
365 # As a special exception to the GNU General Public License, if you
128cae6f3459 initial coding
carl
parents:
diff changeset
366 # distribute this file as part of a program that contains a
128cae6f3459 initial coding
carl
parents:
diff changeset
367 # configuration script generated by Autoconf, you may include it under
128cae6f3459 initial coding
carl
parents:
diff changeset
368 # the same distribution terms that you use for the rest of that program.
128cae6f3459 initial coding
carl
parents:
diff changeset
369
128cae6f3459 initial coding
carl
parents:
diff changeset
370 # Check that we have a working $echo.
128cae6f3459 initial coding
carl
parents:
diff changeset
371 if test "X$1" = X--no-reexec; then
128cae6f3459 initial coding
carl
parents:
diff changeset
372 # Discard the --no-reexec flag, and continue.
128cae6f3459 initial coding
carl
parents:
diff changeset
373 shift
128cae6f3459 initial coding
carl
parents:
diff changeset
374 elif test "X$1" = X--fallback-echo; then
128cae6f3459 initial coding
carl
parents:
diff changeset
375 # Avoid inline document here, it may be left over
128cae6f3459 initial coding
carl
parents:
diff changeset
376 :
128cae6f3459 initial coding
carl
parents:
diff changeset
377 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
128cae6f3459 initial coding
carl
parents:
diff changeset
378 # Yippee, $echo works!
128cae6f3459 initial coding
carl
parents:
diff changeset
379 :
128cae6f3459 initial coding
carl
parents:
diff changeset
380 else
128cae6f3459 initial coding
carl
parents:
diff changeset
381 # Restart under the correct shell, and then maybe $echo will work.
128cae6f3459 initial coding
carl
parents:
diff changeset
382 exec $SHELL "$0" --no-reexec ${1+"$@"}
128cae6f3459 initial coding
carl
parents:
diff changeset
383 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
384
128cae6f3459 initial coding
carl
parents:
diff changeset
385 if test "X$1" = X--fallback-echo; then
128cae6f3459 initial coding
carl
parents:
diff changeset
386 # used as fallback echo
128cae6f3459 initial coding
carl
parents:
diff changeset
387 shift
128cae6f3459 initial coding
carl
parents:
diff changeset
388 cat <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
389 $*
128cae6f3459 initial coding
carl
parents:
diff changeset
390 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
391 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
392 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
393
128cae6f3459 initial coding
carl
parents:
diff changeset
394 # The name of this program.
128cae6f3459 initial coding
carl
parents:
diff changeset
395 progname=`$echo "$0" | ${SED} 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
396 modename="$progname"
128cae6f3459 initial coding
carl
parents:
diff changeset
397
128cae6f3459 initial coding
carl
parents:
diff changeset
398 # Constants.
128cae6f3459 initial coding
carl
parents:
diff changeset
399 PROGRAM=ltmain.sh
128cae6f3459 initial coding
carl
parents:
diff changeset
400 PACKAGE=libtool
128cae6f3459 initial coding
carl
parents:
diff changeset
401 VERSION=1.5a
128cae6f3459 initial coding
carl
parents:
diff changeset
402 TIMESTAMP=" (1.1240 2003/06/26 06:55:19)"
128cae6f3459 initial coding
carl
parents:
diff changeset
403
128cae6f3459 initial coding
carl
parents:
diff changeset
404 default_mode=
128cae6f3459 initial coding
carl
parents:
diff changeset
405 help="Try \`$progname --help' for more information."
128cae6f3459 initial coding
carl
parents:
diff changeset
406 magic="%%%MAGIC variable%%%"
128cae6f3459 initial coding
carl
parents:
diff changeset
407 mkdir="mkdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
408 mv="mv -f"
128cae6f3459 initial coding
carl
parents:
diff changeset
409 rm="rm -f"
128cae6f3459 initial coding
carl
parents:
diff changeset
410
128cae6f3459 initial coding
carl
parents:
diff changeset
411 # Sed substitution that helps us do robust quoting. It backslashifies
128cae6f3459 initial coding
carl
parents:
diff changeset
412 # metacharacters that are still active within double-quoted strings.
128cae6f3459 initial coding
carl
parents:
diff changeset
413 Xsed="${SED}"' -e 1s/^X//'
128cae6f3459 initial coding
carl
parents:
diff changeset
414 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
128cae6f3459 initial coding
carl
parents:
diff changeset
415 # test EBCDIC or ASCII
128cae6f3459 initial coding
carl
parents:
diff changeset
416 case `echo A|tr A '\301'` in
128cae6f3459 initial coding
carl
parents:
diff changeset
417 A) # EBCDIC based system
128cae6f3459 initial coding
carl
parents:
diff changeset
418 SP2NL="tr '\100' '\n'"
128cae6f3459 initial coding
carl
parents:
diff changeset
419 NL2SP="tr '\r\n' '\100\100'"
128cae6f3459 initial coding
carl
parents:
diff changeset
420 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
421 *) # Assume ASCII based system
128cae6f3459 initial coding
carl
parents:
diff changeset
422 SP2NL="tr '\040' '\012'"
128cae6f3459 initial coding
carl
parents:
diff changeset
423 NL2SP="tr '\015\012' '\040\040'"
128cae6f3459 initial coding
carl
parents:
diff changeset
424 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
425 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
426
128cae6f3459 initial coding
carl
parents:
diff changeset
427 # NLS nuisances.
128cae6f3459 initial coding
carl
parents:
diff changeset
428 # Only set LANG and LC_ALL to C if already set.
128cae6f3459 initial coding
carl
parents:
diff changeset
429 # These must not be set unconditionally because not all systems understand
128cae6f3459 initial coding
carl
parents:
diff changeset
430 # e.g. LANG=C (notably SCO).
128cae6f3459 initial coding
carl
parents:
diff changeset
431 # We save the old values to restore during execute mode.
128cae6f3459 initial coding
carl
parents:
diff changeset
432 if test "${LC_ALL+set}" = set; then
128cae6f3459 initial coding
carl
parents:
diff changeset
433 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
128cae6f3459 initial coding
carl
parents:
diff changeset
434 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
435 if test "${LANG+set}" = set; then
128cae6f3459 initial coding
carl
parents:
diff changeset
436 save_LANG="$LANG"; LANG=C; export LANG
128cae6f3459 initial coding
carl
parents:
diff changeset
437 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
438
128cae6f3459 initial coding
carl
parents:
diff changeset
439 # Make sure IFS has a sensible default
128cae6f3459 initial coding
carl
parents:
diff changeset
440 : ${IFS=" "}
128cae6f3459 initial coding
carl
parents:
diff changeset
441
128cae6f3459 initial coding
carl
parents:
diff changeset
442 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
443 $echo "$modename: not configured to build any kind of library" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
444 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
445 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
446 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
447
128cae6f3459 initial coding
carl
parents:
diff changeset
448 # Global variables.
128cae6f3459 initial coding
carl
parents:
diff changeset
449 mode=$default_mode
128cae6f3459 initial coding
carl
parents:
diff changeset
450 nonopt=
128cae6f3459 initial coding
carl
parents:
diff changeset
451 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
452 prevopt=
128cae6f3459 initial coding
carl
parents:
diff changeset
453 run=
128cae6f3459 initial coding
carl
parents:
diff changeset
454 show="$echo"
128cae6f3459 initial coding
carl
parents:
diff changeset
455 show_help=
128cae6f3459 initial coding
carl
parents:
diff changeset
456 execute_dlfiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
457 lo2o="s/\\.lo\$/.${objext}/"
128cae6f3459 initial coding
carl
parents:
diff changeset
458 o2lo="s/\\.${objext}\$/.lo/"
128cae6f3459 initial coding
carl
parents:
diff changeset
459
128cae6f3459 initial coding
carl
parents:
diff changeset
460 #####################################
128cae6f3459 initial coding
carl
parents:
diff changeset
461 # Shell function definitions:
128cae6f3459 initial coding
carl
parents:
diff changeset
462 # This seems to be the best place for them
128cae6f3459 initial coding
carl
parents:
diff changeset
463
128cae6f3459 initial coding
carl
parents:
diff changeset
464 # Need a lot of goo to handle *both* DLLs and import libs
128cae6f3459 initial coding
carl
parents:
diff changeset
465 # Has to be a shell function in order to 'eat' the argument
128cae6f3459 initial coding
carl
parents:
diff changeset
466 # that is supplied when $file_magic_command is called.
128cae6f3459 initial coding
carl
parents:
diff changeset
467 win32_libid () {
128cae6f3459 initial coding
carl
parents:
diff changeset
468 win32_libid_type="unknown"
128cae6f3459 initial coding
carl
parents:
diff changeset
469 win32_fileres=`file -L $1 2>/dev/null`
128cae6f3459 initial coding
carl
parents:
diff changeset
470 case $win32_fileres in
128cae6f3459 initial coding
carl
parents:
diff changeset
471 *ar\ archive\ import\ library*) # definitely import
128cae6f3459 initial coding
carl
parents:
diff changeset
472 win32_libid_type="x86 archive import"
128cae6f3459 initial coding
carl
parents:
diff changeset
473 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
474 *ar\ archive*) # could be an import, or static
128cae6f3459 initial coding
carl
parents:
diff changeset
475 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
128cae6f3459 initial coding
carl
parents:
diff changeset
476 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
477 win32_nmres=`eval $NM -f posix -A $1 | \
128cae6f3459 initial coding
carl
parents:
diff changeset
478 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
128cae6f3459 initial coding
carl
parents:
diff changeset
479 if test "X$win32_nmres" = "Ximport" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
480 win32_libid_type="x86 archive import"
128cae6f3459 initial coding
carl
parents:
diff changeset
481 else
128cae6f3459 initial coding
carl
parents:
diff changeset
482 win32_libid_type="x86 archive static"
128cae6f3459 initial coding
carl
parents:
diff changeset
483 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
484 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
485 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
486 *DLL*)
128cae6f3459 initial coding
carl
parents:
diff changeset
487 win32_libid_type="x86 DLL"
128cae6f3459 initial coding
carl
parents:
diff changeset
488 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
489 *executable*) # but shell scripts are "executable" too...
128cae6f3459 initial coding
carl
parents:
diff changeset
490 case $win32_fileres in
128cae6f3459 initial coding
carl
parents:
diff changeset
491 *MS\ Windows\ PE\ Intel*)
128cae6f3459 initial coding
carl
parents:
diff changeset
492 win32_libid_type="x86 DLL"
128cae6f3459 initial coding
carl
parents:
diff changeset
493 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
494 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
495 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
496 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
497 $echo $win32_libid_type
128cae6f3459 initial coding
carl
parents:
diff changeset
498 }
128cae6f3459 initial coding
carl
parents:
diff changeset
499
128cae6f3459 initial coding
carl
parents:
diff changeset
500 # End of Shell function definitions
128cae6f3459 initial coding
carl
parents:
diff changeset
501 #####################################
128cae6f3459 initial coding
carl
parents:
diff changeset
502
128cae6f3459 initial coding
carl
parents:
diff changeset
503 # Parse our command line options once, thoroughly.
128cae6f3459 initial coding
carl
parents:
diff changeset
504 while test "$#" -gt 0
128cae6f3459 initial coding
carl
parents:
diff changeset
505 do
128cae6f3459 initial coding
carl
parents:
diff changeset
506 arg="$1"
128cae6f3459 initial coding
carl
parents:
diff changeset
507 shift
128cae6f3459 initial coding
carl
parents:
diff changeset
508
128cae6f3459 initial coding
carl
parents:
diff changeset
509 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
510 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
511 *) optarg= ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
512 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
513
128cae6f3459 initial coding
carl
parents:
diff changeset
514 # If the previous option needs an argument, assign it.
128cae6f3459 initial coding
carl
parents:
diff changeset
515 if test -n "$prev"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
516 case $prev in
128cae6f3459 initial coding
carl
parents:
diff changeset
517 execute_dlfiles)
128cae6f3459 initial coding
carl
parents:
diff changeset
518 execute_dlfiles="$execute_dlfiles $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
519 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
520 tag)
128cae6f3459 initial coding
carl
parents:
diff changeset
521 tagname="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
522
128cae6f3459 initial coding
carl
parents:
diff changeset
523 # Check whether tagname contains only valid characters
128cae6f3459 initial coding
carl
parents:
diff changeset
524 case $tagname in
128cae6f3459 initial coding
carl
parents:
diff changeset
525 *[!-_A-Za-z0-9,/]*)
128cae6f3459 initial coding
carl
parents:
diff changeset
526 $echo "$progname: invalid tag name: $tagname" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
527 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
528 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
529 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
530
128cae6f3459 initial coding
carl
parents:
diff changeset
531 case $tagname in
128cae6f3459 initial coding
carl
parents:
diff changeset
532 CC)
128cae6f3459 initial coding
carl
parents:
diff changeset
533 # Don't test for the "default" C tag, as we know, it's there, but
128cae6f3459 initial coding
carl
parents:
diff changeset
534 # not specially marked.
128cae6f3459 initial coding
carl
parents:
diff changeset
535 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
536 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
537 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
128cae6f3459 initial coding
carl
parents:
diff changeset
538 taglist="$taglist $tagname"
128cae6f3459 initial coding
carl
parents:
diff changeset
539 # Evaluate the configuration.
128cae6f3459 initial coding
carl
parents:
diff changeset
540 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
128cae6f3459 initial coding
carl
parents:
diff changeset
541 else
128cae6f3459 initial coding
carl
parents:
diff changeset
542 $echo "$progname: ignoring unknown tag $tagname" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
543 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
544 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
545 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
546 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
547 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
548 eval "$prev=\$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
549 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
550 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
551
128cae6f3459 initial coding
carl
parents:
diff changeset
552 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
553 prevopt=
128cae6f3459 initial coding
carl
parents:
diff changeset
554 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
555 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
556
128cae6f3459 initial coding
carl
parents:
diff changeset
557 # Have we seen a non-optional argument yet?
128cae6f3459 initial coding
carl
parents:
diff changeset
558 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
559 --help)
128cae6f3459 initial coding
carl
parents:
diff changeset
560 show_help=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
561 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
562
128cae6f3459 initial coding
carl
parents:
diff changeset
563 --version)
128cae6f3459 initial coding
carl
parents:
diff changeset
564 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
128cae6f3459 initial coding
carl
parents:
diff changeset
565 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
566 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
128cae6f3459 initial coding
carl
parents:
diff changeset
567 $echo "This is free software; see the source for copying conditions. There is NO"
128cae6f3459 initial coding
carl
parents:
diff changeset
568 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
128cae6f3459 initial coding
carl
parents:
diff changeset
569 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
570 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
571
128cae6f3459 initial coding
carl
parents:
diff changeset
572 --config)
128cae6f3459 initial coding
carl
parents:
diff changeset
573 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
128cae6f3459 initial coding
carl
parents:
diff changeset
574 # Now print the configurations for the tags.
128cae6f3459 initial coding
carl
parents:
diff changeset
575 for tagname in $taglist; do
128cae6f3459 initial coding
carl
parents:
diff changeset
576 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
128cae6f3459 initial coding
carl
parents:
diff changeset
577 done
128cae6f3459 initial coding
carl
parents:
diff changeset
578 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
579 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
580
128cae6f3459 initial coding
carl
parents:
diff changeset
581 --debug)
128cae6f3459 initial coding
carl
parents:
diff changeset
582 $echo "$progname: enabling shell trace mode"
128cae6f3459 initial coding
carl
parents:
diff changeset
583 set -x
128cae6f3459 initial coding
carl
parents:
diff changeset
584 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
585
128cae6f3459 initial coding
carl
parents:
diff changeset
586 --dry-run | -n)
128cae6f3459 initial coding
carl
parents:
diff changeset
587 run=:
128cae6f3459 initial coding
carl
parents:
diff changeset
588 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
589
128cae6f3459 initial coding
carl
parents:
diff changeset
590 --features)
128cae6f3459 initial coding
carl
parents:
diff changeset
591 $echo "host: $host"
128cae6f3459 initial coding
carl
parents:
diff changeset
592 if test "$build_libtool_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
593 $echo "enable shared libraries"
128cae6f3459 initial coding
carl
parents:
diff changeset
594 else
128cae6f3459 initial coding
carl
parents:
diff changeset
595 $echo "disable shared libraries"
128cae6f3459 initial coding
carl
parents:
diff changeset
596 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
597 if test "$build_old_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
598 $echo "enable static libraries"
128cae6f3459 initial coding
carl
parents:
diff changeset
599 else
128cae6f3459 initial coding
carl
parents:
diff changeset
600 $echo "disable static libraries"
128cae6f3459 initial coding
carl
parents:
diff changeset
601 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
602 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
603 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
604
128cae6f3459 initial coding
carl
parents:
diff changeset
605 --finish) mode="finish" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
606
128cae6f3459 initial coding
carl
parents:
diff changeset
607 --mode) prevopt="--mode" prev=mode ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
608 --mode=*) mode="$optarg" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
609
128cae6f3459 initial coding
carl
parents:
diff changeset
610 --preserve-dup-deps) duplicate_deps="yes" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
611
128cae6f3459 initial coding
carl
parents:
diff changeset
612 --quiet | --silent)
128cae6f3459 initial coding
carl
parents:
diff changeset
613 show=:
128cae6f3459 initial coding
carl
parents:
diff changeset
614 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
615
128cae6f3459 initial coding
carl
parents:
diff changeset
616 --tag) prevopt="--tag" prev=tag ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
617 --tag=*)
128cae6f3459 initial coding
carl
parents:
diff changeset
618 set tag "$optarg" ${1+"$@"}
128cae6f3459 initial coding
carl
parents:
diff changeset
619 shift
128cae6f3459 initial coding
carl
parents:
diff changeset
620 prev=tag
128cae6f3459 initial coding
carl
parents:
diff changeset
621 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
622
128cae6f3459 initial coding
carl
parents:
diff changeset
623 -dlopen)
128cae6f3459 initial coding
carl
parents:
diff changeset
624 prevopt="-dlopen"
128cae6f3459 initial coding
carl
parents:
diff changeset
625 prev=execute_dlfiles
128cae6f3459 initial coding
carl
parents:
diff changeset
626 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
627
128cae6f3459 initial coding
carl
parents:
diff changeset
628 -*)
128cae6f3459 initial coding
carl
parents:
diff changeset
629 $echo "$modename: unrecognized option \`$arg'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
630 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
631 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
632 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
633
128cae6f3459 initial coding
carl
parents:
diff changeset
634 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
635 nonopt="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
636 break
128cae6f3459 initial coding
carl
parents:
diff changeset
637 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
638 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
639 done
128cae6f3459 initial coding
carl
parents:
diff changeset
640
128cae6f3459 initial coding
carl
parents:
diff changeset
641 if test -n "$prevopt"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
642 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
643 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
644 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
645 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
646
128cae6f3459 initial coding
carl
parents:
diff changeset
647 # If this variable is set in any of the actions, the command in it
128cae6f3459 initial coding
carl
parents:
diff changeset
648 # will be execed at the end. This prevents here-documents from being
128cae6f3459 initial coding
carl
parents:
diff changeset
649 # left over by shells.
128cae6f3459 initial coding
carl
parents:
diff changeset
650 exec_cmd=
128cae6f3459 initial coding
carl
parents:
diff changeset
651
128cae6f3459 initial coding
carl
parents:
diff changeset
652 if test -z "$show_help"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
653
128cae6f3459 initial coding
carl
parents:
diff changeset
654 # Infer the operation mode.
128cae6f3459 initial coding
carl
parents:
diff changeset
655 if test -z "$mode"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
656 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
657 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
658 case $nonopt in
128cae6f3459 initial coding
carl
parents:
diff changeset
659 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
128cae6f3459 initial coding
carl
parents:
diff changeset
660 mode=link
128cae6f3459 initial coding
carl
parents:
diff changeset
661 for arg
128cae6f3459 initial coding
carl
parents:
diff changeset
662 do
128cae6f3459 initial coding
carl
parents:
diff changeset
663 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
664 -c)
128cae6f3459 initial coding
carl
parents:
diff changeset
665 mode=compile
128cae6f3459 initial coding
carl
parents:
diff changeset
666 break
128cae6f3459 initial coding
carl
parents:
diff changeset
667 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
668 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
669 done
128cae6f3459 initial coding
carl
parents:
diff changeset
670 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
671 *db | *dbx | *strace | *truss)
128cae6f3459 initial coding
carl
parents:
diff changeset
672 mode=execute
128cae6f3459 initial coding
carl
parents:
diff changeset
673 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
674 *install*|cp|mv)
128cae6f3459 initial coding
carl
parents:
diff changeset
675 mode=install
128cae6f3459 initial coding
carl
parents:
diff changeset
676 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
677 *rm)
128cae6f3459 initial coding
carl
parents:
diff changeset
678 mode=uninstall
128cae6f3459 initial coding
carl
parents:
diff changeset
679 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
680 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
681 # If we have no mode, but dlfiles were specified, then do execute mode.
128cae6f3459 initial coding
carl
parents:
diff changeset
682 test -n "$execute_dlfiles" && mode=execute
128cae6f3459 initial coding
carl
parents:
diff changeset
683
128cae6f3459 initial coding
carl
parents:
diff changeset
684 # Just use the default operation mode.
128cae6f3459 initial coding
carl
parents:
diff changeset
685 if test -z "$mode"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
686 if test -n "$nonopt"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
687 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
688 else
128cae6f3459 initial coding
carl
parents:
diff changeset
689 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
690 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
691 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
692 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
693 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
694 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
695
128cae6f3459 initial coding
carl
parents:
diff changeset
696 # Only execute mode is allowed to have -dlopen flags.
128cae6f3459 initial coding
carl
parents:
diff changeset
697 if test -n "$execute_dlfiles" && test "$mode" != execute; then
128cae6f3459 initial coding
carl
parents:
diff changeset
698 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
699 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
700 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
701 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
702
128cae6f3459 initial coding
carl
parents:
diff changeset
703 # Change the help message to a mode-specific one.
128cae6f3459 initial coding
carl
parents:
diff changeset
704 generic_help="$help"
128cae6f3459 initial coding
carl
parents:
diff changeset
705 help="Try \`$modename --help --mode=$mode' for more information."
128cae6f3459 initial coding
carl
parents:
diff changeset
706
128cae6f3459 initial coding
carl
parents:
diff changeset
707 # These modes are in order of execution frequency so that they run quickly.
128cae6f3459 initial coding
carl
parents:
diff changeset
708 case $mode in
128cae6f3459 initial coding
carl
parents:
diff changeset
709 # libtool compile mode
128cae6f3459 initial coding
carl
parents:
diff changeset
710 compile)
128cae6f3459 initial coding
carl
parents:
diff changeset
711 modename="$modename: compile"
128cae6f3459 initial coding
carl
parents:
diff changeset
712 # Get the compilation command and the source file.
128cae6f3459 initial coding
carl
parents:
diff changeset
713 base_compile=
128cae6f3459 initial coding
carl
parents:
diff changeset
714 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
715 suppress_output=
128cae6f3459 initial coding
carl
parents:
diff changeset
716 arg_mode=normal
128cae6f3459 initial coding
carl
parents:
diff changeset
717 libobj=
128cae6f3459 initial coding
carl
parents:
diff changeset
718
128cae6f3459 initial coding
carl
parents:
diff changeset
719 for arg
128cae6f3459 initial coding
carl
parents:
diff changeset
720 do
128cae6f3459 initial coding
carl
parents:
diff changeset
721 case "$arg_mode" in
128cae6f3459 initial coding
carl
parents:
diff changeset
722 arg )
128cae6f3459 initial coding
carl
parents:
diff changeset
723 # do not "continue". Instead, add this to base_compile
128cae6f3459 initial coding
carl
parents:
diff changeset
724 lastarg="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
725 arg_mode=normal
128cae6f3459 initial coding
carl
parents:
diff changeset
726 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
727
128cae6f3459 initial coding
carl
parents:
diff changeset
728 target )
128cae6f3459 initial coding
carl
parents:
diff changeset
729 libobj="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
730 arg_mode=normal
128cae6f3459 initial coding
carl
parents:
diff changeset
731 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
732 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
733
128cae6f3459 initial coding
carl
parents:
diff changeset
734 normal )
128cae6f3459 initial coding
carl
parents:
diff changeset
735 # Accept any command-line options.
128cae6f3459 initial coding
carl
parents:
diff changeset
736 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
737 -o)
128cae6f3459 initial coding
carl
parents:
diff changeset
738 if test -n "$libobj" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
739 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
740 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
741 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
742 arg_mode=target
128cae6f3459 initial coding
carl
parents:
diff changeset
743 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
744 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
745
128cae6f3459 initial coding
carl
parents:
diff changeset
746 -static)
128cae6f3459 initial coding
carl
parents:
diff changeset
747 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
748 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
749 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
750
128cae6f3459 initial coding
carl
parents:
diff changeset
751 -prefer-pic)
128cae6f3459 initial coding
carl
parents:
diff changeset
752 pic_mode=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
753 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
754 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
755
128cae6f3459 initial coding
carl
parents:
diff changeset
756 -prefer-non-pic)
128cae6f3459 initial coding
carl
parents:
diff changeset
757 pic_mode=no
128cae6f3459 initial coding
carl
parents:
diff changeset
758 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
759 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
760
128cae6f3459 initial coding
carl
parents:
diff changeset
761 -Xcompiler)
128cae6f3459 initial coding
carl
parents:
diff changeset
762 arg_mode=arg # the next one goes into the "base_compile" arg list
128cae6f3459 initial coding
carl
parents:
diff changeset
763 continue # The current "srcfile" will either be retained or
128cae6f3459 initial coding
carl
parents:
diff changeset
764 ;; # replaced later. I would guess that would be a bug.
128cae6f3459 initial coding
carl
parents:
diff changeset
765
128cae6f3459 initial coding
carl
parents:
diff changeset
766 -Wc,*)
128cae6f3459 initial coding
carl
parents:
diff changeset
767 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
128cae6f3459 initial coding
carl
parents:
diff changeset
768 lastarg=
128cae6f3459 initial coding
carl
parents:
diff changeset
769 save_ifs="$IFS"; IFS=','
128cae6f3459 initial coding
carl
parents:
diff changeset
770 for arg in $args; do
128cae6f3459 initial coding
carl
parents:
diff changeset
771 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
772
128cae6f3459 initial coding
carl
parents:
diff changeset
773 # Double-quote args containing other shell metacharacters.
128cae6f3459 initial coding
carl
parents:
diff changeset
774 # Many Bourne shells cannot handle close brackets correctly
128cae6f3459 initial coding
carl
parents:
diff changeset
775 # in scan sets, so we specify it separately.
128cae6f3459 initial coding
carl
parents:
diff changeset
776 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
777 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
128cae6f3459 initial coding
carl
parents:
diff changeset
778 arg="\"$arg\""
128cae6f3459 initial coding
carl
parents:
diff changeset
779 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
780 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
781 lastarg="$lastarg $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
782 done
128cae6f3459 initial coding
carl
parents:
diff changeset
783 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
784 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
128cae6f3459 initial coding
carl
parents:
diff changeset
785
128cae6f3459 initial coding
carl
parents:
diff changeset
786 # Add the arguments to base_compile.
128cae6f3459 initial coding
carl
parents:
diff changeset
787 base_compile="$base_compile $lastarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
788 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
789 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
790
128cae6f3459 initial coding
carl
parents:
diff changeset
791 * )
128cae6f3459 initial coding
carl
parents:
diff changeset
792 # Accept the current argument as the source file.
128cae6f3459 initial coding
carl
parents:
diff changeset
793 # The previous "srcfile" becomes the current argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
794 #
128cae6f3459 initial coding
carl
parents:
diff changeset
795 lastarg="$srcfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
796 srcfile="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
797 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
798 esac # case $arg
128cae6f3459 initial coding
carl
parents:
diff changeset
799 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
800 esac # case $arg_mode
128cae6f3459 initial coding
carl
parents:
diff changeset
801
128cae6f3459 initial coding
carl
parents:
diff changeset
802 # Aesthetically quote the previous argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
803 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
804
128cae6f3459 initial coding
carl
parents:
diff changeset
805 case $lastarg in
128cae6f3459 initial coding
carl
parents:
diff changeset
806 # Double-quote args containing other shell metacharacters.
128cae6f3459 initial coding
carl
parents:
diff changeset
807 # Many Bourne shells cannot handle close brackets correctly
128cae6f3459 initial coding
carl
parents:
diff changeset
808 # in scan sets, so we specify it separately.
128cae6f3459 initial coding
carl
parents:
diff changeset
809 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
128cae6f3459 initial coding
carl
parents:
diff changeset
810 lastarg="\"$lastarg\""
128cae6f3459 initial coding
carl
parents:
diff changeset
811 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
812 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
813
128cae6f3459 initial coding
carl
parents:
diff changeset
814 base_compile="$base_compile $lastarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
815 done # for arg
128cae6f3459 initial coding
carl
parents:
diff changeset
816
128cae6f3459 initial coding
carl
parents:
diff changeset
817 case $arg_mode in
128cae6f3459 initial coding
carl
parents:
diff changeset
818 arg)
128cae6f3459 initial coding
carl
parents:
diff changeset
819 $echo "$modename: you must specify an argument for -Xcompile"
128cae6f3459 initial coding
carl
parents:
diff changeset
820 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
821 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
822 target)
128cae6f3459 initial coding
carl
parents:
diff changeset
823 $echo "$modename: you must specify a target with \`-o'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
824 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
825 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
826 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
827 # Get the name of the library object.
128cae6f3459 initial coding
carl
parents:
diff changeset
828 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
829 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
830 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
831
128cae6f3459 initial coding
carl
parents:
diff changeset
832 # Recognize several different file suffixes.
128cae6f3459 initial coding
carl
parents:
diff changeset
833 # If the user specifies -o file.o, it is replaced with file.lo
128cae6f3459 initial coding
carl
parents:
diff changeset
834 xform='[cCFSifmso]'
128cae6f3459 initial coding
carl
parents:
diff changeset
835 case $libobj in
128cae6f3459 initial coding
carl
parents:
diff changeset
836 *.ada) xform=ada ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
837 *.adb) xform=adb ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
838 *.ads) xform=ads ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
839 *.asm) xform=asm ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
840 *.c++) xform=c++ ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
841 *.cc) xform=cc ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
842 *.ii) xform=ii ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
843 *.class) xform=class ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
844 *.cpp) xform=cpp ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
845 *.cxx) xform=cxx ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
846 *.f90) xform=f90 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
847 *.for) xform=for ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
848 *.java) xform=java ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
849 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
850
128cae6f3459 initial coding
carl
parents:
diff changeset
851 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
128cae6f3459 initial coding
carl
parents:
diff changeset
852
128cae6f3459 initial coding
carl
parents:
diff changeset
853 case $libobj in
128cae6f3459 initial coding
carl
parents:
diff changeset
854 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
855 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
856 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
857 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
858 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
859 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
860
128cae6f3459 initial coding
carl
parents:
diff changeset
861 # Infer tagged configuration to use if any are available and
128cae6f3459 initial coding
carl
parents:
diff changeset
862 # if one wasn't chosen via the "--tag" command line option.
128cae6f3459 initial coding
carl
parents:
diff changeset
863 # Only attempt this if the compiler in the base compile
128cae6f3459 initial coding
carl
parents:
diff changeset
864 # command doesn't match the default compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
865 if test -n "$available_tags" && test -z "$tagname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
866 case $base_compile in
128cae6f3459 initial coding
carl
parents:
diff changeset
867 # Blanks in the command may have been stripped by the calling shell,
128cae6f3459 initial coding
carl
parents:
diff changeset
868 # but not from the CC environment variable when configure was run.
128cae6f3459 initial coding
carl
parents:
diff changeset
869 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
870 # Blanks at the start of $base_compile will cause this to fail
128cae6f3459 initial coding
carl
parents:
diff changeset
871 # if we don't check for them as well.
128cae6f3459 initial coding
carl
parents:
diff changeset
872 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
873 for z in $available_tags; do
128cae6f3459 initial coding
carl
parents:
diff changeset
874 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
128cae6f3459 initial coding
carl
parents:
diff changeset
875 # Evaluate the configuration.
128cae6f3459 initial coding
carl
parents:
diff changeset
876 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
128cae6f3459 initial coding
carl
parents:
diff changeset
877 case "$base_compile " in
128cae6f3459 initial coding
carl
parents:
diff changeset
878 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
128cae6f3459 initial coding
carl
parents:
diff changeset
879 # The compiler in the base compile command matches
128cae6f3459 initial coding
carl
parents:
diff changeset
880 # the one in the tagged configuration.
128cae6f3459 initial coding
carl
parents:
diff changeset
881 # Assume this is the tagged configuration we want.
128cae6f3459 initial coding
carl
parents:
diff changeset
882 tagname=$z
128cae6f3459 initial coding
carl
parents:
diff changeset
883 break
128cae6f3459 initial coding
carl
parents:
diff changeset
884 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
885 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
886 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
887 done
128cae6f3459 initial coding
carl
parents:
diff changeset
888 # If $tagname still isn't set, then no tagged configuration
128cae6f3459 initial coding
carl
parents:
diff changeset
889 # was found and let the user know that the "--tag" command
128cae6f3459 initial coding
carl
parents:
diff changeset
890 # line option must be used.
128cae6f3459 initial coding
carl
parents:
diff changeset
891 if test -z "$tagname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
892 $echo "$modename: unable to infer tagged configuration"
128cae6f3459 initial coding
carl
parents:
diff changeset
893 $echo "$modename: specify a tag with \`--tag'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
894 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
895 # else
128cae6f3459 initial coding
carl
parents:
diff changeset
896 # $echo "$modename: using $tagname tagged configuration"
128cae6f3459 initial coding
carl
parents:
diff changeset
897 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
898 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
899 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
900 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
901
128cae6f3459 initial coding
carl
parents:
diff changeset
902 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
903 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
904 if test "X$xdir" = "X$obj"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
905 xdir=
128cae6f3459 initial coding
carl
parents:
diff changeset
906 else
128cae6f3459 initial coding
carl
parents:
diff changeset
907 xdir=$xdir/
128cae6f3459 initial coding
carl
parents:
diff changeset
908 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
909 lobj=${xdir}$objdir/$objname
128cae6f3459 initial coding
carl
parents:
diff changeset
910
128cae6f3459 initial coding
carl
parents:
diff changeset
911 if test -z "$base_compile"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
912 $echo "$modename: you must specify a compilation command" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
913 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
914 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
915 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
916
128cae6f3459 initial coding
carl
parents:
diff changeset
917 # Delete any leftover library objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
918 if test "$build_old_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
919 removelist="$obj $lobj $libobj ${libobj}T"
128cae6f3459 initial coding
carl
parents:
diff changeset
920 else
128cae6f3459 initial coding
carl
parents:
diff changeset
921 removelist="$lobj $libobj ${libobj}T"
128cae6f3459 initial coding
carl
parents:
diff changeset
922 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
923
128cae6f3459 initial coding
carl
parents:
diff changeset
924 $run $rm $removelist
128cae6f3459 initial coding
carl
parents:
diff changeset
925 trap "$run $rm $removelist; exit 1" 1 2 15
128cae6f3459 initial coding
carl
parents:
diff changeset
926
128cae6f3459 initial coding
carl
parents:
diff changeset
927 # On Cygwin there's no "real" PIC flag so we must build both object types
128cae6f3459 initial coding
carl
parents:
diff changeset
928 case $host_os in
128cae6f3459 initial coding
carl
parents:
diff changeset
929 cygwin* | mingw* | pw32* | os2*)
128cae6f3459 initial coding
carl
parents:
diff changeset
930 pic_mode=default
128cae6f3459 initial coding
carl
parents:
diff changeset
931 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
932 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
933 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
128cae6f3459 initial coding
carl
parents:
diff changeset
934 # non-PIC code in shared libraries is not supported
128cae6f3459 initial coding
carl
parents:
diff changeset
935 pic_mode=default
128cae6f3459 initial coding
carl
parents:
diff changeset
936 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
937
128cae6f3459 initial coding
carl
parents:
diff changeset
938 # Calculate the filename of the output object if compiler does
128cae6f3459 initial coding
carl
parents:
diff changeset
939 # not support -o with -c
128cae6f3459 initial coding
carl
parents:
diff changeset
940 if test "$compiler_c_o" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
941 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
128cae6f3459 initial coding
carl
parents:
diff changeset
942 lockfile="$output_obj.lock"
128cae6f3459 initial coding
carl
parents:
diff changeset
943 removelist="$removelist $output_obj $lockfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
944 trap "$run $rm $removelist; exit 1" 1 2 15
128cae6f3459 initial coding
carl
parents:
diff changeset
945 else
128cae6f3459 initial coding
carl
parents:
diff changeset
946 output_obj=
128cae6f3459 initial coding
carl
parents:
diff changeset
947 need_locks=no
128cae6f3459 initial coding
carl
parents:
diff changeset
948 lockfile=
128cae6f3459 initial coding
carl
parents:
diff changeset
949 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
950
128cae6f3459 initial coding
carl
parents:
diff changeset
951 # Lock this critical section if it is needed
128cae6f3459 initial coding
carl
parents:
diff changeset
952 # We use this script file to make the link, it avoids creating a new file
128cae6f3459 initial coding
carl
parents:
diff changeset
953 if test "$need_locks" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
954 until $run ln "$0" "$lockfile" 2>/dev/null; do
128cae6f3459 initial coding
carl
parents:
diff changeset
955 $show "Waiting for $lockfile to be removed"
128cae6f3459 initial coding
carl
parents:
diff changeset
956 sleep 2
128cae6f3459 initial coding
carl
parents:
diff changeset
957 done
128cae6f3459 initial coding
carl
parents:
diff changeset
958 elif test "$need_locks" = warn; then
128cae6f3459 initial coding
carl
parents:
diff changeset
959 if test -f "$lockfile"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
960 $echo "\
128cae6f3459 initial coding
carl
parents:
diff changeset
961 *** ERROR, $lockfile exists and contains:
128cae6f3459 initial coding
carl
parents:
diff changeset
962 `cat $lockfile 2>/dev/null`
128cae6f3459 initial coding
carl
parents:
diff changeset
963
128cae6f3459 initial coding
carl
parents:
diff changeset
964 This indicates that another process is trying to use the same
128cae6f3459 initial coding
carl
parents:
diff changeset
965 temporary object file, and libtool could not work around it because
128cae6f3459 initial coding
carl
parents:
diff changeset
966 your compiler does not support \`-c' and \`-o' together. If you
128cae6f3459 initial coding
carl
parents:
diff changeset
967 repeat this compilation, it may succeed, by chance, but you had better
128cae6f3459 initial coding
carl
parents:
diff changeset
968 avoid parallel builds (make -j) in this platform, or get a better
128cae6f3459 initial coding
carl
parents:
diff changeset
969 compiler."
128cae6f3459 initial coding
carl
parents:
diff changeset
970
128cae6f3459 initial coding
carl
parents:
diff changeset
971 $run $rm $removelist
128cae6f3459 initial coding
carl
parents:
diff changeset
972 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
973 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
974 $echo $srcfile > "$lockfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
975 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
976
128cae6f3459 initial coding
carl
parents:
diff changeset
977 if test -n "$fix_srcfile_path"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
978 eval srcfile=\"$fix_srcfile_path\"
128cae6f3459 initial coding
carl
parents:
diff changeset
979 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
980
128cae6f3459 initial coding
carl
parents:
diff changeset
981 $run $rm "$libobj" "${libobj}T"
128cae6f3459 initial coding
carl
parents:
diff changeset
982
128cae6f3459 initial coding
carl
parents:
diff changeset
983 # Create a libtool object file (analogous to a ".la" file),
128cae6f3459 initial coding
carl
parents:
diff changeset
984 # but don't create it if we're doing a dry run.
128cae6f3459 initial coding
carl
parents:
diff changeset
985 test -z "$run" && cat > ${libobj}T <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
986 # $libobj - a libtool object file
128cae6f3459 initial coding
carl
parents:
diff changeset
987 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
128cae6f3459 initial coding
carl
parents:
diff changeset
988 #
128cae6f3459 initial coding
carl
parents:
diff changeset
989 # Please DO NOT delete this file!
128cae6f3459 initial coding
carl
parents:
diff changeset
990 # It is necessary for linking the library.
128cae6f3459 initial coding
carl
parents:
diff changeset
991
128cae6f3459 initial coding
carl
parents:
diff changeset
992 # Name of the PIC object.
128cae6f3459 initial coding
carl
parents:
diff changeset
993 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
994
128cae6f3459 initial coding
carl
parents:
diff changeset
995 # Only build a PIC object if we are building libtool libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
996 if test "$build_libtool_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
997 # Without this assignment, base_compile gets emptied.
128cae6f3459 initial coding
carl
parents:
diff changeset
998 fbsd_hideous_sh_bug=$base_compile
128cae6f3459 initial coding
carl
parents:
diff changeset
999
128cae6f3459 initial coding
carl
parents:
diff changeset
1000 if test "$pic_mode" != no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1001 command="$base_compile $srcfile $pic_flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
1002 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1003 # Don't build PIC code
128cae6f3459 initial coding
carl
parents:
diff changeset
1004 command="$base_compile $srcfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
1005 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1006
128cae6f3459 initial coding
carl
parents:
diff changeset
1007 if test ! -d "${xdir}$objdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1008 $show "$mkdir ${xdir}$objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
1009 $run $mkdir ${xdir}$objdir
128cae6f3459 initial coding
carl
parents:
diff changeset
1010 status=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
1011 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1012 exit $status
128cae6f3459 initial coding
carl
parents:
diff changeset
1013 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1014 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1015
128cae6f3459 initial coding
carl
parents:
diff changeset
1016 if test -z "$output_obj"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1017 # Place PIC objects in $objdir
128cae6f3459 initial coding
carl
parents:
diff changeset
1018 command="$command -o $lobj"
128cae6f3459 initial coding
carl
parents:
diff changeset
1019 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1020
128cae6f3459 initial coding
carl
parents:
diff changeset
1021 $run $rm "$lobj" "$output_obj"
128cae6f3459 initial coding
carl
parents:
diff changeset
1022
128cae6f3459 initial coding
carl
parents:
diff changeset
1023 $show "$command"
128cae6f3459 initial coding
carl
parents:
diff changeset
1024 if $run eval "$command"; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
1025 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1026 test -n "$output_obj" && $run $rm $removelist
128cae6f3459 initial coding
carl
parents:
diff changeset
1027 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1028 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1029
128cae6f3459 initial coding
carl
parents:
diff changeset
1030 if test "$need_locks" = warn &&
128cae6f3459 initial coding
carl
parents:
diff changeset
1031 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1032 $echo "\
128cae6f3459 initial coding
carl
parents:
diff changeset
1033 *** ERROR, $lockfile contains:
128cae6f3459 initial coding
carl
parents:
diff changeset
1034 `cat $lockfile 2>/dev/null`
128cae6f3459 initial coding
carl
parents:
diff changeset
1035
128cae6f3459 initial coding
carl
parents:
diff changeset
1036 but it should contain:
128cae6f3459 initial coding
carl
parents:
diff changeset
1037 $srcfile
128cae6f3459 initial coding
carl
parents:
diff changeset
1038
128cae6f3459 initial coding
carl
parents:
diff changeset
1039 This indicates that another process is trying to use the same
128cae6f3459 initial coding
carl
parents:
diff changeset
1040 temporary object file, and libtool could not work around it because
128cae6f3459 initial coding
carl
parents:
diff changeset
1041 your compiler does not support \`-c' and \`-o' together. If you
128cae6f3459 initial coding
carl
parents:
diff changeset
1042 repeat this compilation, it may succeed, by chance, but you had better
128cae6f3459 initial coding
carl
parents:
diff changeset
1043 avoid parallel builds (make -j) in this platform, or get a better
128cae6f3459 initial coding
carl
parents:
diff changeset
1044 compiler."
128cae6f3459 initial coding
carl
parents:
diff changeset
1045
128cae6f3459 initial coding
carl
parents:
diff changeset
1046 $run $rm $removelist
128cae6f3459 initial coding
carl
parents:
diff changeset
1047 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1048 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1049
128cae6f3459 initial coding
carl
parents:
diff changeset
1050 # Just move the object if needed, then go on to compile the next one
128cae6f3459 initial coding
carl
parents:
diff changeset
1051 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1052 $show "$mv $output_obj $lobj"
128cae6f3459 initial coding
carl
parents:
diff changeset
1053 if $run $mv $output_obj $lobj; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
1054 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1055 error=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
1056 $run $rm $removelist
128cae6f3459 initial coding
carl
parents:
diff changeset
1057 exit $error
128cae6f3459 initial coding
carl
parents:
diff changeset
1058 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1059 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1060
128cae6f3459 initial coding
carl
parents:
diff changeset
1061 # Append the name of the PIC object to the libtool object file.
128cae6f3459 initial coding
carl
parents:
diff changeset
1062 test -z "$run" && cat >> ${libobj}T <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
1063 pic_object='$objdir/$objname'
128cae6f3459 initial coding
carl
parents:
diff changeset
1064
128cae6f3459 initial coding
carl
parents:
diff changeset
1065 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
1066
128cae6f3459 initial coding
carl
parents:
diff changeset
1067 # Allow error messages only from the first compilation.
128cae6f3459 initial coding
carl
parents:
diff changeset
1068 suppress_output=' >/dev/null 2>&1'
128cae6f3459 initial coding
carl
parents:
diff changeset
1069 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1070 # No PIC object so indicate it doesn't exist in the libtool
128cae6f3459 initial coding
carl
parents:
diff changeset
1071 # object file.
128cae6f3459 initial coding
carl
parents:
diff changeset
1072 test -z "$run" && cat >> ${libobj}T <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
1073 pic_object=none
128cae6f3459 initial coding
carl
parents:
diff changeset
1074
128cae6f3459 initial coding
carl
parents:
diff changeset
1075 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
1076 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1077
128cae6f3459 initial coding
carl
parents:
diff changeset
1078 # Only build a position-dependent object if we build old libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
1079 if test "$build_old_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1080 if test "$pic_mode" != yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1081 # Don't build PIC code
128cae6f3459 initial coding
carl
parents:
diff changeset
1082 command="$base_compile $srcfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
1083 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1084 command="$base_compile $srcfile $pic_flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
1085 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1086 if test "$compiler_c_o" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1087 command="$command -o $obj"
128cae6f3459 initial coding
carl
parents:
diff changeset
1088 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1089
128cae6f3459 initial coding
carl
parents:
diff changeset
1090 # Suppress compiler output if we already did a PIC compilation.
128cae6f3459 initial coding
carl
parents:
diff changeset
1091 command="$command$suppress_output"
128cae6f3459 initial coding
carl
parents:
diff changeset
1092 $run $rm "$obj" "$output_obj"
128cae6f3459 initial coding
carl
parents:
diff changeset
1093 $show "$command"
128cae6f3459 initial coding
carl
parents:
diff changeset
1094 if $run eval "$command"; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
1095 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1096 $run $rm $removelist
128cae6f3459 initial coding
carl
parents:
diff changeset
1097 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1098 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1099
128cae6f3459 initial coding
carl
parents:
diff changeset
1100 if test "$need_locks" = warn &&
128cae6f3459 initial coding
carl
parents:
diff changeset
1101 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1102 $echo "\
128cae6f3459 initial coding
carl
parents:
diff changeset
1103 *** ERROR, $lockfile contains:
128cae6f3459 initial coding
carl
parents:
diff changeset
1104 `cat $lockfile 2>/dev/null`
128cae6f3459 initial coding
carl
parents:
diff changeset
1105
128cae6f3459 initial coding
carl
parents:
diff changeset
1106 but it should contain:
128cae6f3459 initial coding
carl
parents:
diff changeset
1107 $srcfile
128cae6f3459 initial coding
carl
parents:
diff changeset
1108
128cae6f3459 initial coding
carl
parents:
diff changeset
1109 This indicates that another process is trying to use the same
128cae6f3459 initial coding
carl
parents:
diff changeset
1110 temporary object file, and libtool could not work around it because
128cae6f3459 initial coding
carl
parents:
diff changeset
1111 your compiler does not support \`-c' and \`-o' together. If you
128cae6f3459 initial coding
carl
parents:
diff changeset
1112 repeat this compilation, it may succeed, by chance, but you had better
128cae6f3459 initial coding
carl
parents:
diff changeset
1113 avoid parallel builds (make -j) in this platform, or get a better
128cae6f3459 initial coding
carl
parents:
diff changeset
1114 compiler."
128cae6f3459 initial coding
carl
parents:
diff changeset
1115
128cae6f3459 initial coding
carl
parents:
diff changeset
1116 $run $rm $removelist
128cae6f3459 initial coding
carl
parents:
diff changeset
1117 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1118 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1119
128cae6f3459 initial coding
carl
parents:
diff changeset
1120 # Just move the object if needed
128cae6f3459 initial coding
carl
parents:
diff changeset
1121 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1122 $show "$mv $output_obj $obj"
128cae6f3459 initial coding
carl
parents:
diff changeset
1123 if $run $mv $output_obj $obj; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
1124 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1125 error=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
1126 $run $rm $removelist
128cae6f3459 initial coding
carl
parents:
diff changeset
1127 exit $error
128cae6f3459 initial coding
carl
parents:
diff changeset
1128 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1129 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1130
128cae6f3459 initial coding
carl
parents:
diff changeset
1131 # Append the name of the non-PIC object the libtool object file.
128cae6f3459 initial coding
carl
parents:
diff changeset
1132 # Only append if the libtool object file exists.
128cae6f3459 initial coding
carl
parents:
diff changeset
1133 test -z "$run" && cat >> ${libobj}T <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
1134 # Name of the non-PIC object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1135 non_pic_object='$objname'
128cae6f3459 initial coding
carl
parents:
diff changeset
1136
128cae6f3459 initial coding
carl
parents:
diff changeset
1137 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
1138 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1139 # Append the name of the non-PIC object the libtool object file.
128cae6f3459 initial coding
carl
parents:
diff changeset
1140 # Only append if the libtool object file exists.
128cae6f3459 initial coding
carl
parents:
diff changeset
1141 test -z "$run" && cat >> ${libobj}T <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
1142 # Name of the non-PIC object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1143 non_pic_object=none
128cae6f3459 initial coding
carl
parents:
diff changeset
1144
128cae6f3459 initial coding
carl
parents:
diff changeset
1145 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
1146 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1147
128cae6f3459 initial coding
carl
parents:
diff changeset
1148 $run $mv "${libobj}T" "${libobj}"
128cae6f3459 initial coding
carl
parents:
diff changeset
1149
128cae6f3459 initial coding
carl
parents:
diff changeset
1150 # Unlock the critical section if it was locked
128cae6f3459 initial coding
carl
parents:
diff changeset
1151 if test "$need_locks" != no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1152 $run $rm "$lockfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
1153 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1154
128cae6f3459 initial coding
carl
parents:
diff changeset
1155 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
1156 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1157
128cae6f3459 initial coding
carl
parents:
diff changeset
1158 # libtool link mode
128cae6f3459 initial coding
carl
parents:
diff changeset
1159 link | relink)
128cae6f3459 initial coding
carl
parents:
diff changeset
1160 modename="$modename: link"
128cae6f3459 initial coding
carl
parents:
diff changeset
1161 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
1162 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1163 # It is impossible to link a dll without this setting, and
128cae6f3459 initial coding
carl
parents:
diff changeset
1164 # we shouldn't force the makefile maintainer to figure out
128cae6f3459 initial coding
carl
parents:
diff changeset
1165 # which system we are compiling for in order to pass an extra
128cae6f3459 initial coding
carl
parents:
diff changeset
1166 # flag for every libtool invocation.
128cae6f3459 initial coding
carl
parents:
diff changeset
1167 # allow_undefined=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1168
128cae6f3459 initial coding
carl
parents:
diff changeset
1169 # FIXME: Unfortunately, there are problems with the above when trying
128cae6f3459 initial coding
carl
parents:
diff changeset
1170 # to make a dll which has undefined symbols, in which case not
128cae6f3459 initial coding
carl
parents:
diff changeset
1171 # even a static library is built. For now, we need to specify
128cae6f3459 initial coding
carl
parents:
diff changeset
1172 # -no-undefined on the libtool link line when we can be certain
128cae6f3459 initial coding
carl
parents:
diff changeset
1173 # that all symbols are satisfied, otherwise we get a static library.
128cae6f3459 initial coding
carl
parents:
diff changeset
1174 allow_undefined=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1175 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1176 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
1177 allow_undefined=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1178 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1179 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1180 libtool_args="$nonopt"
128cae6f3459 initial coding
carl
parents:
diff changeset
1181 base_compile="$nonopt"
128cae6f3459 initial coding
carl
parents:
diff changeset
1182 compile_command="$nonopt"
128cae6f3459 initial coding
carl
parents:
diff changeset
1183 finalize_command="$nonopt"
128cae6f3459 initial coding
carl
parents:
diff changeset
1184
128cae6f3459 initial coding
carl
parents:
diff changeset
1185 compile_rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
1186 finalize_rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
1187 compile_shlibpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
1188 finalize_shlibpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
1189 convenience=
128cae6f3459 initial coding
carl
parents:
diff changeset
1190 old_convenience=
128cae6f3459 initial coding
carl
parents:
diff changeset
1191 deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
1192 old_deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
1193 add_flags=
128cae6f3459 initial coding
carl
parents:
diff changeset
1194 compiler_flags=
128cae6f3459 initial coding
carl
parents:
diff changeset
1195 linker_flags=
128cae6f3459 initial coding
carl
parents:
diff changeset
1196 dllsearchpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
1197 lib_search_path=`pwd`
128cae6f3459 initial coding
carl
parents:
diff changeset
1198 inst_prefix_dir=
128cae6f3459 initial coding
carl
parents:
diff changeset
1199
128cae6f3459 initial coding
carl
parents:
diff changeset
1200 avoid_version=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1201 dlfiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
1202 dlprefiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
1203 dlself=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1204 export_dynamic=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1205 export_symbols=
128cae6f3459 initial coding
carl
parents:
diff changeset
1206 export_symbols_regex=
128cae6f3459 initial coding
carl
parents:
diff changeset
1207 generated=
128cae6f3459 initial coding
carl
parents:
diff changeset
1208 libobjs=
128cae6f3459 initial coding
carl
parents:
diff changeset
1209 ltlibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
1210 module=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1211 no_install=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1212 objs=
128cae6f3459 initial coding
carl
parents:
diff changeset
1213 non_pic_objects=
128cae6f3459 initial coding
carl
parents:
diff changeset
1214 prefer_static_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1215 preload=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1216 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1217 prevarg=
128cae6f3459 initial coding
carl
parents:
diff changeset
1218 release=
128cae6f3459 initial coding
carl
parents:
diff changeset
1219 rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
1220 xrpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
1221 perm_rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
1222 temp_rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
1223 thread_safe=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1224 vinfo=
128cae6f3459 initial coding
carl
parents:
diff changeset
1225 vinfo_number=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1226
128cae6f3459 initial coding
carl
parents:
diff changeset
1227 # We need to know -static, to get the right output filenames.
128cae6f3459 initial coding
carl
parents:
diff changeset
1228 for arg
128cae6f3459 initial coding
carl
parents:
diff changeset
1229 do
128cae6f3459 initial coding
carl
parents:
diff changeset
1230 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1231 -all-static | -static)
128cae6f3459 initial coding
carl
parents:
diff changeset
1232 if test "X$arg" = "X-all-static"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1233 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1234 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1235 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1236 if test -n "$link_static_flag"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1237 dlopen_self=$dlopen_self_static
128cae6f3459 initial coding
carl
parents:
diff changeset
1238 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1239 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1240 if test -z "$pic_flag" && test -n "$link_static_flag"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1241 dlopen_self=$dlopen_self_static
128cae6f3459 initial coding
carl
parents:
diff changeset
1242 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1243 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1244 build_libtool_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1245 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1246 prefer_static_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1247 break
128cae6f3459 initial coding
carl
parents:
diff changeset
1248 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1249 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1250 done
128cae6f3459 initial coding
carl
parents:
diff changeset
1251
128cae6f3459 initial coding
carl
parents:
diff changeset
1252 # See if our shared archives depend on static archives.
128cae6f3459 initial coding
carl
parents:
diff changeset
1253 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1254
128cae6f3459 initial coding
carl
parents:
diff changeset
1255 # Go through the arguments, transforming them on the way.
128cae6f3459 initial coding
carl
parents:
diff changeset
1256 while test "$#" -gt 0; do
128cae6f3459 initial coding
carl
parents:
diff changeset
1257 arg="$1"
128cae6f3459 initial coding
carl
parents:
diff changeset
1258 base_compile="$base_compile $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1259 shift
128cae6f3459 initial coding
carl
parents:
diff changeset
1260 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1261 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
128cae6f3459 initial coding
carl
parents:
diff changeset
1262 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
128cae6f3459 initial coding
carl
parents:
diff changeset
1263 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1264 *) qarg=$arg ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1265 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1266 libtool_args="$libtool_args $qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1267
128cae6f3459 initial coding
carl
parents:
diff changeset
1268 # If the previous option needs an argument, assign it.
128cae6f3459 initial coding
carl
parents:
diff changeset
1269 if test -n "$prev"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1270 case $prev in
128cae6f3459 initial coding
carl
parents:
diff changeset
1271 output)
128cae6f3459 initial coding
carl
parents:
diff changeset
1272 compile_command="$compile_command @OUTPUT@"
128cae6f3459 initial coding
carl
parents:
diff changeset
1273 finalize_command="$finalize_command @OUTPUT@"
128cae6f3459 initial coding
carl
parents:
diff changeset
1274 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1275 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1276
128cae6f3459 initial coding
carl
parents:
diff changeset
1277 case $prev in
128cae6f3459 initial coding
carl
parents:
diff changeset
1278 dlfiles|dlprefiles)
128cae6f3459 initial coding
carl
parents:
diff changeset
1279 if test "$preload" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1280 # Add the symbol object into the linking commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
1281 compile_command="$compile_command @SYMFILE@"
128cae6f3459 initial coding
carl
parents:
diff changeset
1282 finalize_command="$finalize_command @SYMFILE@"
128cae6f3459 initial coding
carl
parents:
diff changeset
1283 preload=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1284 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1285 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1286 *.la | *.lo) ;; # We handle these cases below.
128cae6f3459 initial coding
carl
parents:
diff changeset
1287 force)
128cae6f3459 initial coding
carl
parents:
diff changeset
1288 if test "$dlself" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1289 dlself=needless
128cae6f3459 initial coding
carl
parents:
diff changeset
1290 export_dynamic=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1291 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1292 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1293 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1294 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1295 self)
128cae6f3459 initial coding
carl
parents:
diff changeset
1296 if test "$prev" = dlprefiles; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1297 dlself=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1298 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1299 dlself=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1300 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1301 dlself=needless
128cae6f3459 initial coding
carl
parents:
diff changeset
1302 export_dynamic=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1303 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1304 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1305 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1306 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1307 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
1308 if test "$prev" = dlfiles; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1309 dlfiles="$dlfiles $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1310 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1311 dlprefiles="$dlprefiles $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1312 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1313 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1314 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1315 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1316 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1317 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1318 expsyms)
128cae6f3459 initial coding
carl
parents:
diff changeset
1319 export_symbols="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1320 if test ! -f "$arg"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1321 $echo "$modename: symbol file \`$arg' does not exist"
128cae6f3459 initial coding
carl
parents:
diff changeset
1322 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1323 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1324 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1325 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1326 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1327 expsyms_regex)
128cae6f3459 initial coding
carl
parents:
diff changeset
1328 export_symbols_regex="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1329 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1330 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1331 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1332 inst_prefix)
128cae6f3459 initial coding
carl
parents:
diff changeset
1333 inst_prefix_dir="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1334 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1335 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1336 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1337 release)
128cae6f3459 initial coding
carl
parents:
diff changeset
1338 release="-$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1339 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1340 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1341 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1342 objectlist)
128cae6f3459 initial coding
carl
parents:
diff changeset
1343 if test -f "$arg"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1344 save_arg=$arg
128cae6f3459 initial coding
carl
parents:
diff changeset
1345 moreargs=
128cae6f3459 initial coding
carl
parents:
diff changeset
1346 for fil in `cat $save_arg`
128cae6f3459 initial coding
carl
parents:
diff changeset
1347 do
128cae6f3459 initial coding
carl
parents:
diff changeset
1348 # moreargs="$moreargs $fil"
128cae6f3459 initial coding
carl
parents:
diff changeset
1349 arg=$fil
128cae6f3459 initial coding
carl
parents:
diff changeset
1350 # A libtool-controlled object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1351
128cae6f3459 initial coding
carl
parents:
diff changeset
1352 # Check to see that this really is a libtool object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1353 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1354 pic_object=
128cae6f3459 initial coding
carl
parents:
diff changeset
1355 non_pic_object=
128cae6f3459 initial coding
carl
parents:
diff changeset
1356
128cae6f3459 initial coding
carl
parents:
diff changeset
1357 # Read the .lo file
128cae6f3459 initial coding
carl
parents:
diff changeset
1358 # If there is no directory component, then add one.
128cae6f3459 initial coding
carl
parents:
diff changeset
1359 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1360 */* | *\\*) . $arg ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1361 *) . ./$arg ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1362 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1363
128cae6f3459 initial coding
carl
parents:
diff changeset
1364 if test -z "$pic_object" || \
128cae6f3459 initial coding
carl
parents:
diff changeset
1365 test -z "$non_pic_object" ||
128cae6f3459 initial coding
carl
parents:
diff changeset
1366 test "$pic_object" = none && \
128cae6f3459 initial coding
carl
parents:
diff changeset
1367 test "$non_pic_object" = none; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1368 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1369 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1370 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1371
128cae6f3459 initial coding
carl
parents:
diff changeset
1372 # Extract subdirectory from the argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
1373 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
1374 if test "X$xdir" = "X$arg"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1375 xdir=
128cae6f3459 initial coding
carl
parents:
diff changeset
1376 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1377 xdir="$xdir/"
128cae6f3459 initial coding
carl
parents:
diff changeset
1378 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1379
128cae6f3459 initial coding
carl
parents:
diff changeset
1380 if test "$pic_object" != none; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1381 # Prepend the subdirectory the object is found in.
128cae6f3459 initial coding
carl
parents:
diff changeset
1382 pic_object="$xdir$pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1383
128cae6f3459 initial coding
carl
parents:
diff changeset
1384 if test "$prev" = dlfiles; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1385 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1386 dlfiles="$dlfiles $pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1387 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1388 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1389 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1390 # If libtool objects are unsupported, then we need to preload.
128cae6f3459 initial coding
carl
parents:
diff changeset
1391 prev=dlprefiles
128cae6f3459 initial coding
carl
parents:
diff changeset
1392 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1393 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1394
128cae6f3459 initial coding
carl
parents:
diff changeset
1395 # CHECK ME: I think I busted this. -Ossama
128cae6f3459 initial coding
carl
parents:
diff changeset
1396 if test "$prev" = dlprefiles; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1397 # Preload the old-style object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1398 dlprefiles="$dlprefiles $pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1399 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1400 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1401
128cae6f3459 initial coding
carl
parents:
diff changeset
1402 # A PIC object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1403 libobjs="$libobjs $pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1404 arg="$pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1405 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1406
128cae6f3459 initial coding
carl
parents:
diff changeset
1407 # Non-PIC object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1408 if test "$non_pic_object" != none; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1409 # Prepend the subdirectory the object is found in.
128cae6f3459 initial coding
carl
parents:
diff changeset
1410 non_pic_object="$xdir$non_pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1411
128cae6f3459 initial coding
carl
parents:
diff changeset
1412 # A standard non-PIC object
128cae6f3459 initial coding
carl
parents:
diff changeset
1413 non_pic_objects="$non_pic_objects $non_pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1414 if test -z "$pic_object" || test "$pic_object" = none ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1415 arg="$non_pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1416 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1417 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1418 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1419 # Only an error if not doing a dry-run.
128cae6f3459 initial coding
carl
parents:
diff changeset
1420 if test -z "$run"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1421 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1422 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1423 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1424 # Dry-run case.
128cae6f3459 initial coding
carl
parents:
diff changeset
1425
128cae6f3459 initial coding
carl
parents:
diff changeset
1426 # Extract subdirectory from the argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
1427 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
1428 if test "X$xdir" = "X$arg"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1429 xdir=
128cae6f3459 initial coding
carl
parents:
diff changeset
1430 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1431 xdir="$xdir/"
128cae6f3459 initial coding
carl
parents:
diff changeset
1432 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1433
128cae6f3459 initial coding
carl
parents:
diff changeset
1434 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
128cae6f3459 initial coding
carl
parents:
diff changeset
1435 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
128cae6f3459 initial coding
carl
parents:
diff changeset
1436 libobjs="$libobjs $pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1437 non_pic_objects="$non_pic_objects $non_pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1438 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1439 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1440 done
128cae6f3459 initial coding
carl
parents:
diff changeset
1441 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1442 $echo "$modename: link input file \`$save_arg' does not exist"
128cae6f3459 initial coding
carl
parents:
diff changeset
1443 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1444 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1445 arg=$save_arg
128cae6f3459 initial coding
carl
parents:
diff changeset
1446 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1447 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1448 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1449 rpath | xrpath)
128cae6f3459 initial coding
carl
parents:
diff changeset
1450 # We need an absolute path.
128cae6f3459 initial coding
carl
parents:
diff changeset
1451 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1452 [\\/]* | [A-Za-z]:[\\/]*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1453 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
1454 $echo "$modename: only absolute run-paths are allowed" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1455 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1456 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1457 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1458 if test "$prev" = rpath; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1459 case "$rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
1460 *" $arg "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1461 *) rpath="$rpath $arg" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1462 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1463 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1464 case "$xrpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
1465 *" $arg "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1466 *) xrpath="$xrpath $arg" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1467 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1468 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1469 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1470 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1471 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1472 xcompiler)
128cae6f3459 initial coding
carl
parents:
diff changeset
1473 compiler_flags="$compiler_flags $qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1474 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1475 compile_command="$compile_command $qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1476 finalize_command="$finalize_command $qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1477 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1478 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1479 xlinker)
128cae6f3459 initial coding
carl
parents:
diff changeset
1480 linker_flags="$linker_flags $qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1481 compiler_flags="$compiler_flags $wl$qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1482 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1483 compile_command="$compile_command $wl$qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1484 finalize_command="$finalize_command $wl$qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1485 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1486 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1487 xcclinker)
128cae6f3459 initial coding
carl
parents:
diff changeset
1488 linker_flags="$linker_flags $qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1489 compiler_flags="$compiler_flags $qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1490 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1491 compile_command="$compile_command $qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1492 finalize_command="$finalize_command $qarg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1493 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1494 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1495 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
1496 eval "$prev=\"\$arg\""
128cae6f3459 initial coding
carl
parents:
diff changeset
1497 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1498 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1499 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1500 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1501 fi # test -n "$prev"
128cae6f3459 initial coding
carl
parents:
diff changeset
1502
128cae6f3459 initial coding
carl
parents:
diff changeset
1503 prevarg="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1504
128cae6f3459 initial coding
carl
parents:
diff changeset
1505 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1506 -all-static)
128cae6f3459 initial coding
carl
parents:
diff changeset
1507 if test -n "$link_static_flag"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1508 compile_command="$compile_command $link_static_flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
1509 finalize_command="$finalize_command $link_static_flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
1510 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1511 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1512 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1513
128cae6f3459 initial coding
carl
parents:
diff changeset
1514 -allow-undefined)
128cae6f3459 initial coding
carl
parents:
diff changeset
1515 # FIXME: remove this flag sometime in the future.
128cae6f3459 initial coding
carl
parents:
diff changeset
1516 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1517 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1518 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1519
128cae6f3459 initial coding
carl
parents:
diff changeset
1520 -avoid-version)
128cae6f3459 initial coding
carl
parents:
diff changeset
1521 avoid_version=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1522 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1523 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1524
128cae6f3459 initial coding
carl
parents:
diff changeset
1525 -dlopen)
128cae6f3459 initial coding
carl
parents:
diff changeset
1526 prev=dlfiles
128cae6f3459 initial coding
carl
parents:
diff changeset
1527 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1528 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1529
128cae6f3459 initial coding
carl
parents:
diff changeset
1530 -dlpreopen)
128cae6f3459 initial coding
carl
parents:
diff changeset
1531 prev=dlprefiles
128cae6f3459 initial coding
carl
parents:
diff changeset
1532 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1533 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1534
128cae6f3459 initial coding
carl
parents:
diff changeset
1535 -export-dynamic)
128cae6f3459 initial coding
carl
parents:
diff changeset
1536 export_dynamic=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1537 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1538 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1539
128cae6f3459 initial coding
carl
parents:
diff changeset
1540 -export-symbols | -export-symbols-regex)
128cae6f3459 initial coding
carl
parents:
diff changeset
1541 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1542 $echo "$modename: more than one -exported-symbols argument is not allowed"
128cae6f3459 initial coding
carl
parents:
diff changeset
1543 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1544 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1545 if test "X$arg" = "X-export-symbols"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1546 prev=expsyms
128cae6f3459 initial coding
carl
parents:
diff changeset
1547 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1548 prev=expsyms_regex
128cae6f3459 initial coding
carl
parents:
diff changeset
1549 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1550 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1551 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1552
128cae6f3459 initial coding
carl
parents:
diff changeset
1553 -inst-prefix-dir)
128cae6f3459 initial coding
carl
parents:
diff changeset
1554 prev=inst_prefix
128cae6f3459 initial coding
carl
parents:
diff changeset
1555 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1556 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1557
128cae6f3459 initial coding
carl
parents:
diff changeset
1558 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
128cae6f3459 initial coding
carl
parents:
diff changeset
1559 # so, if we see these flags be careful not to treat them like -L
128cae6f3459 initial coding
carl
parents:
diff changeset
1560 -L[A-Z][A-Z]*:*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1561 case $with_gcc/$host in
128cae6f3459 initial coding
carl
parents:
diff changeset
1562 no/*-*-irix* | /*-*-irix*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1563 compile_command="$compile_command $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1564 finalize_command="$finalize_command $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1565 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1566 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1567 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1568 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1569
128cae6f3459 initial coding
carl
parents:
diff changeset
1570 -L*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1571 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
1572 # We need an absolute path.
128cae6f3459 initial coding
carl
parents:
diff changeset
1573 case $dir in
128cae6f3459 initial coding
carl
parents:
diff changeset
1574 [\\/]* | [A-Za-z]:[\\/]*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1575 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
1576 absdir=`cd "$dir" && pwd`
128cae6f3459 initial coding
carl
parents:
diff changeset
1577 if test -z "$absdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1578 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1579 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1580 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1581 dir="$absdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
1582 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1583 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1584 case "$deplibs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
1585 *" -L$dir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1586 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
1587 deplibs="$deplibs -L$dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
1588 lib_search_path="$lib_search_path $dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
1589 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1590 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1591 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
1592 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1593 case :$dllsearchpath: in
128cae6f3459 initial coding
carl
parents:
diff changeset
1594 *":$dir:"*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1595 *) dllsearchpath="$dllsearchpath:$dir";;
128cae6f3459 initial coding
carl
parents:
diff changeset
1596 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1597 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1598 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1599 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1600 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1601
128cae6f3459 initial coding
carl
parents:
diff changeset
1602 -l*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1603 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1604 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
1605 *-*-cygwin* | *-*-pw32* | *-*-beos*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1606 # These systems don't actually have a C or math library (as such)
128cae6f3459 initial coding
carl
parents:
diff changeset
1607 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1608 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1609 *-*-freebsd*-gnu*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1610 # prevent being parsed by the freebsd regexp below
128cae6f3459 initial coding
carl
parents:
diff changeset
1611 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1612 *-*-mingw* | *-*-os2*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1613 # These systems don't actually have a C library (as such)
128cae6f3459 initial coding
carl
parents:
diff changeset
1614 test "X$arg" = "X-lc" && continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1615 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1616 *-*-openbsd* | *-*-freebsd*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1617 # Do not include libc due to us having libc/libc_r.
128cae6f3459 initial coding
carl
parents:
diff changeset
1618 test "X$arg" = "X-lc" && continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1619 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1620 *-*-rhapsody* | *-*-darwin1.[012])
128cae6f3459 initial coding
carl
parents:
diff changeset
1621 # Rhapsody C and math libraries are in the System framework
128cae6f3459 initial coding
carl
parents:
diff changeset
1622 deplibs="$deplibs -framework System"
128cae6f3459 initial coding
carl
parents:
diff changeset
1623 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1624 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1625 elif test "X$arg" = "X-lc_r"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1626 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
1627 *-*-freebsd*-gnu*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1628 # prevent being parsed by the freebsd regexp below
128cae6f3459 initial coding
carl
parents:
diff changeset
1629 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1630 *-*-openbsd*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1631 # Do not include libc_r directly, use -pthread flag.
128cae6f3459 initial coding
carl
parents:
diff changeset
1632 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1633 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1634 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1635 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1636 deplibs="$deplibs $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1637 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1638 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1639
128cae6f3459 initial coding
carl
parents:
diff changeset
1640 -module)
128cae6f3459 initial coding
carl
parents:
diff changeset
1641 module=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1642 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1643 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1644
128cae6f3459 initial coding
carl
parents:
diff changeset
1645 # gcc -m* arguments should be passed to the linker via $compiler_flags
128cae6f3459 initial coding
carl
parents:
diff changeset
1646 # in order to pass architecture information to the linker
128cae6f3459 initial coding
carl
parents:
diff changeset
1647 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
128cae6f3459 initial coding
carl
parents:
diff changeset
1648 # but this is not reliable with gcc because gcc may use -mfoo to
128cae6f3459 initial coding
carl
parents:
diff changeset
1649 # select a different linker, different libraries, etc, while
128cae6f3459 initial coding
carl
parents:
diff changeset
1650 # -Wl,-mfoo simply passes -mfoo to the linker.
128cae6f3459 initial coding
carl
parents:
diff changeset
1651 -m*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1652 # Unknown arguments in both finalize_command and compile_command need
128cae6f3459 initial coding
carl
parents:
diff changeset
1653 # to be aesthetically quoted because they are evaled later.
128cae6f3459 initial coding
carl
parents:
diff changeset
1654 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
1655 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1656 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
128cae6f3459 initial coding
carl
parents:
diff changeset
1657 arg="\"$arg\""
128cae6f3459 initial coding
carl
parents:
diff changeset
1658 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1659 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1660 compile_command="$compile_command $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1661 finalize_command="$finalize_command $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1662 if test "$with_gcc" = "yes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1663 compiler_flags="$compiler_flags $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1664 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1665 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1666 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1667
128cae6f3459 initial coding
carl
parents:
diff changeset
1668 -shrext)
128cae6f3459 initial coding
carl
parents:
diff changeset
1669 prev=shrext
128cae6f3459 initial coding
carl
parents:
diff changeset
1670 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1671 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1672
128cae6f3459 initial coding
carl
parents:
diff changeset
1673 -no-fast-install)
128cae6f3459 initial coding
carl
parents:
diff changeset
1674 fast_install=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1675 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1676 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1677
128cae6f3459 initial coding
carl
parents:
diff changeset
1678 -no-install)
128cae6f3459 initial coding
carl
parents:
diff changeset
1679 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
1680 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1681 # The PATH hackery in wrapper scripts is required on Windows
128cae6f3459 initial coding
carl
parents:
diff changeset
1682 # in order for the loader to find any dlls it needs.
128cae6f3459 initial coding
carl
parents:
diff changeset
1683 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1684 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1685 fast_install=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1686 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1687 *) no_install=yes ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1688 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1689 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1690 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1691
128cae6f3459 initial coding
carl
parents:
diff changeset
1692 -no-undefined)
128cae6f3459 initial coding
carl
parents:
diff changeset
1693 allow_undefined=no
128cae6f3459 initial coding
carl
parents:
diff changeset
1694 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1695 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1696
128cae6f3459 initial coding
carl
parents:
diff changeset
1697 -objectlist)
128cae6f3459 initial coding
carl
parents:
diff changeset
1698 prev=objectlist
128cae6f3459 initial coding
carl
parents:
diff changeset
1699 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1700 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1701
128cae6f3459 initial coding
carl
parents:
diff changeset
1702 -o) prev=output ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1703
128cae6f3459 initial coding
carl
parents:
diff changeset
1704 -release)
128cae6f3459 initial coding
carl
parents:
diff changeset
1705 prev=release
128cae6f3459 initial coding
carl
parents:
diff changeset
1706 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1707 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1708
128cae6f3459 initial coding
carl
parents:
diff changeset
1709 -rpath)
128cae6f3459 initial coding
carl
parents:
diff changeset
1710 prev=rpath
128cae6f3459 initial coding
carl
parents:
diff changeset
1711 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1712 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1713
128cae6f3459 initial coding
carl
parents:
diff changeset
1714 -R)
128cae6f3459 initial coding
carl
parents:
diff changeset
1715 prev=xrpath
128cae6f3459 initial coding
carl
parents:
diff changeset
1716 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1717 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1718
128cae6f3459 initial coding
carl
parents:
diff changeset
1719 -R*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1720 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
1721 # We need an absolute path.
128cae6f3459 initial coding
carl
parents:
diff changeset
1722 case $dir in
128cae6f3459 initial coding
carl
parents:
diff changeset
1723 [\\/]* | [A-Za-z]:[\\/]*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1724 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
1725 $echo "$modename: only absolute run-paths are allowed" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1726 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1727 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1728 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1729 case "$xrpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
1730 *" $dir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1731 *) xrpath="$xrpath $dir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1732 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1733 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1734 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1735
128cae6f3459 initial coding
carl
parents:
diff changeset
1736 -static)
128cae6f3459 initial coding
carl
parents:
diff changeset
1737 # The effects of -static are defined in a previous loop.
128cae6f3459 initial coding
carl
parents:
diff changeset
1738 # We used to do the same as -all-static on platforms that
128cae6f3459 initial coding
carl
parents:
diff changeset
1739 # didn't have a PIC flag, but the assumption that the effects
128cae6f3459 initial coding
carl
parents:
diff changeset
1740 # would be equivalent was wrong. It would break on at least
128cae6f3459 initial coding
carl
parents:
diff changeset
1741 # Digital Unix and AIX.
128cae6f3459 initial coding
carl
parents:
diff changeset
1742 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1743 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1744
128cae6f3459 initial coding
carl
parents:
diff changeset
1745 -thread-safe)
128cae6f3459 initial coding
carl
parents:
diff changeset
1746 thread_safe=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1747 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1748 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1749
128cae6f3459 initial coding
carl
parents:
diff changeset
1750 -version-info)
128cae6f3459 initial coding
carl
parents:
diff changeset
1751 prev=vinfo
128cae6f3459 initial coding
carl
parents:
diff changeset
1752 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1753 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1754 -version-number)
128cae6f3459 initial coding
carl
parents:
diff changeset
1755 prev=vinfo
128cae6f3459 initial coding
carl
parents:
diff changeset
1756 vinfo_number=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
1757 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1758 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1759
128cae6f3459 initial coding
carl
parents:
diff changeset
1760 -Wc,*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1761 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
1762 arg=
128cae6f3459 initial coding
carl
parents:
diff changeset
1763 save_ifs="$IFS"; IFS=','
128cae6f3459 initial coding
carl
parents:
diff changeset
1764 for flag in $args; do
128cae6f3459 initial coding
carl
parents:
diff changeset
1765 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
1766 case $flag in
128cae6f3459 initial coding
carl
parents:
diff changeset
1767 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
128cae6f3459 initial coding
carl
parents:
diff changeset
1768 flag="\"$flag\""
128cae6f3459 initial coding
carl
parents:
diff changeset
1769 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1770 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1771 arg="$arg $wl$flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
1772 compiler_flags="$compiler_flags $flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
1773 done
128cae6f3459 initial coding
carl
parents:
diff changeset
1774 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
1775 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
128cae6f3459 initial coding
carl
parents:
diff changeset
1776 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1777
128cae6f3459 initial coding
carl
parents:
diff changeset
1778 -Wl,*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1779 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
1780 arg=
128cae6f3459 initial coding
carl
parents:
diff changeset
1781 save_ifs="$IFS"; IFS=','
128cae6f3459 initial coding
carl
parents:
diff changeset
1782 for flag in $args; do
128cae6f3459 initial coding
carl
parents:
diff changeset
1783 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
1784 case $flag in
128cae6f3459 initial coding
carl
parents:
diff changeset
1785 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
128cae6f3459 initial coding
carl
parents:
diff changeset
1786 flag="\"$flag\""
128cae6f3459 initial coding
carl
parents:
diff changeset
1787 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1788 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1789 arg="$arg $wl$flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
1790 compiler_flags="$compiler_flags $wl$flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
1791 linker_flags="$linker_flags $flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
1792 done
128cae6f3459 initial coding
carl
parents:
diff changeset
1793 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
1794 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
128cae6f3459 initial coding
carl
parents:
diff changeset
1795 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1796
128cae6f3459 initial coding
carl
parents:
diff changeset
1797 -Xcompiler)
128cae6f3459 initial coding
carl
parents:
diff changeset
1798 prev=xcompiler
128cae6f3459 initial coding
carl
parents:
diff changeset
1799 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1800 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1801
128cae6f3459 initial coding
carl
parents:
diff changeset
1802 -Xlinker)
128cae6f3459 initial coding
carl
parents:
diff changeset
1803 prev=xlinker
128cae6f3459 initial coding
carl
parents:
diff changeset
1804 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1805 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1806
128cae6f3459 initial coding
carl
parents:
diff changeset
1807 -XCClinker)
128cae6f3459 initial coding
carl
parents:
diff changeset
1808 prev=xcclinker
128cae6f3459 initial coding
carl
parents:
diff changeset
1809 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1810 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1811
128cae6f3459 initial coding
carl
parents:
diff changeset
1812 # Some other compiler flag.
128cae6f3459 initial coding
carl
parents:
diff changeset
1813 -* | +*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1814 # Unknown arguments in both finalize_command and compile_command need
128cae6f3459 initial coding
carl
parents:
diff changeset
1815 # to be aesthetically quoted because they are evaled later.
128cae6f3459 initial coding
carl
parents:
diff changeset
1816 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
1817 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1818 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
128cae6f3459 initial coding
carl
parents:
diff changeset
1819 arg="\"$arg\""
128cae6f3459 initial coding
carl
parents:
diff changeset
1820 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1821 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1822 add_flags="$add_flags $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1823 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1824
128cae6f3459 initial coding
carl
parents:
diff changeset
1825 *.$objext)
128cae6f3459 initial coding
carl
parents:
diff changeset
1826 # A standard object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1827 objs="$objs $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1828 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1829
128cae6f3459 initial coding
carl
parents:
diff changeset
1830 *.lo)
128cae6f3459 initial coding
carl
parents:
diff changeset
1831 # A libtool-controlled object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1832
128cae6f3459 initial coding
carl
parents:
diff changeset
1833 # Check to see that this really is a libtool object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1834 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1835 pic_object=
128cae6f3459 initial coding
carl
parents:
diff changeset
1836 non_pic_object=
128cae6f3459 initial coding
carl
parents:
diff changeset
1837
128cae6f3459 initial coding
carl
parents:
diff changeset
1838 # Read the .lo file
128cae6f3459 initial coding
carl
parents:
diff changeset
1839 # If there is no directory component, then add one.
128cae6f3459 initial coding
carl
parents:
diff changeset
1840 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1841 */* | *\\*) . $arg ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1842 *) . ./$arg ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1843 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1844
128cae6f3459 initial coding
carl
parents:
diff changeset
1845 if test -z "$pic_object" || \
128cae6f3459 initial coding
carl
parents:
diff changeset
1846 test -z "$non_pic_object" ||
128cae6f3459 initial coding
carl
parents:
diff changeset
1847 test "$pic_object" = none && \
128cae6f3459 initial coding
carl
parents:
diff changeset
1848 test "$non_pic_object" = none; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1849 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1850 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1851 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1852
128cae6f3459 initial coding
carl
parents:
diff changeset
1853 # Extract subdirectory from the argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
1854 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
1855 if test "X$xdir" = "X$arg"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1856 xdir=
128cae6f3459 initial coding
carl
parents:
diff changeset
1857 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1858 xdir="$xdir/"
128cae6f3459 initial coding
carl
parents:
diff changeset
1859 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1860
128cae6f3459 initial coding
carl
parents:
diff changeset
1861 if test "$pic_object" != none; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1862 # Prepend the subdirectory the object is found in.
128cae6f3459 initial coding
carl
parents:
diff changeset
1863 pic_object="$xdir$pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1864
128cae6f3459 initial coding
carl
parents:
diff changeset
1865 if test "$prev" = dlfiles; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1866 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1867 dlfiles="$dlfiles $pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1868 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1869 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1870 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1871 # If libtool objects are unsupported, then we need to preload.
128cae6f3459 initial coding
carl
parents:
diff changeset
1872 prev=dlprefiles
128cae6f3459 initial coding
carl
parents:
diff changeset
1873 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1874 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1875
128cae6f3459 initial coding
carl
parents:
diff changeset
1876 # CHECK ME: I think I busted this. -Ossama
128cae6f3459 initial coding
carl
parents:
diff changeset
1877 if test "$prev" = dlprefiles; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1878 # Preload the old-style object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1879 dlprefiles="$dlprefiles $pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1880 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1881 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1882
128cae6f3459 initial coding
carl
parents:
diff changeset
1883 # A PIC object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1884 libobjs="$libobjs $pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1885 arg="$pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1886 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1887
128cae6f3459 initial coding
carl
parents:
diff changeset
1888 # Non-PIC object.
128cae6f3459 initial coding
carl
parents:
diff changeset
1889 if test "$non_pic_object" != none; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1890 # Prepend the subdirectory the object is found in.
128cae6f3459 initial coding
carl
parents:
diff changeset
1891 non_pic_object="$xdir$non_pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1892
128cae6f3459 initial coding
carl
parents:
diff changeset
1893 # A standard non-PIC object
128cae6f3459 initial coding
carl
parents:
diff changeset
1894 non_pic_objects="$non_pic_objects $non_pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1895 if test -z "$pic_object" || test "$pic_object" = none ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1896 arg="$non_pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1897 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1898 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1899 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1900 # Only an error if not doing a dry-run.
128cae6f3459 initial coding
carl
parents:
diff changeset
1901 if test -z "$run"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1902 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1903 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1904 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1905 # Dry-run case.
128cae6f3459 initial coding
carl
parents:
diff changeset
1906
128cae6f3459 initial coding
carl
parents:
diff changeset
1907 # Extract subdirectory from the argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
1908 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
1909 if test "X$xdir" = "X$arg"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1910 xdir=
128cae6f3459 initial coding
carl
parents:
diff changeset
1911 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1912 xdir="$xdir/"
128cae6f3459 initial coding
carl
parents:
diff changeset
1913 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1914
128cae6f3459 initial coding
carl
parents:
diff changeset
1915 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
128cae6f3459 initial coding
carl
parents:
diff changeset
1916 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
128cae6f3459 initial coding
carl
parents:
diff changeset
1917 libobjs="$libobjs $pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1918 non_pic_objects="$non_pic_objects $non_pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
1919 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1920 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1921 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1922
128cae6f3459 initial coding
carl
parents:
diff changeset
1923 *.$libext)
128cae6f3459 initial coding
carl
parents:
diff changeset
1924 # An archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
1925 deplibs="$deplibs $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1926 old_deplibs="$old_deplibs $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1927 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1928 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1929
128cae6f3459 initial coding
carl
parents:
diff changeset
1930 *.la)
128cae6f3459 initial coding
carl
parents:
diff changeset
1931 # A libtool-controlled library.
128cae6f3459 initial coding
carl
parents:
diff changeset
1932
128cae6f3459 initial coding
carl
parents:
diff changeset
1933 if test "$prev" = dlfiles; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1934 # This library was specified with -dlopen.
128cae6f3459 initial coding
carl
parents:
diff changeset
1935 dlfiles="$dlfiles $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1936 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1937 elif test "$prev" = dlprefiles; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1938 # The library was specified with -dlpreopen.
128cae6f3459 initial coding
carl
parents:
diff changeset
1939 dlprefiles="$dlprefiles $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1940 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
1941 else
128cae6f3459 initial coding
carl
parents:
diff changeset
1942 deplibs="$deplibs $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1943 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1944 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
1945 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1946
128cae6f3459 initial coding
carl
parents:
diff changeset
1947 # Some other compiler argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
1948 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
1949 # Unknown arguments in both finalize_command and compile_command need
128cae6f3459 initial coding
carl
parents:
diff changeset
1950 # to be aesthetically quoted because they are evaled later.
128cae6f3459 initial coding
carl
parents:
diff changeset
1951 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
1952 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
1953 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
128cae6f3459 initial coding
carl
parents:
diff changeset
1954 arg="\"$arg\""
128cae6f3459 initial coding
carl
parents:
diff changeset
1955 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1956 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1957 add_flags="$add_flags $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1958 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1959 esac # arg
128cae6f3459 initial coding
carl
parents:
diff changeset
1960
128cae6f3459 initial coding
carl
parents:
diff changeset
1961 # Now actually substitute the argument into the commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
1962 if test -n "$arg"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1963 compile_command="$compile_command $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1964 finalize_command="$finalize_command $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
1965 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1966 done # argument parsing loop
128cae6f3459 initial coding
carl
parents:
diff changeset
1967
128cae6f3459 initial coding
carl
parents:
diff changeset
1968 if test -n "$prev"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1969 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1970 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
1971 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
1972 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
1973
128cae6f3459 initial coding
carl
parents:
diff changeset
1974 # Infer tagged configuration to use if any are available and
128cae6f3459 initial coding
carl
parents:
diff changeset
1975 # if one wasn't chosen via the "--tag" command line option.
128cae6f3459 initial coding
carl
parents:
diff changeset
1976 # Only attempt this if the compiler in the base link
128cae6f3459 initial coding
carl
parents:
diff changeset
1977 # command doesn't match the default compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
1978 if test -n "$available_tags" && test -z "$tagname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1979 case $base_compile in
128cae6f3459 initial coding
carl
parents:
diff changeset
1980 # Blanks in the command may have been stripped by the calling shell,
128cae6f3459 initial coding
carl
parents:
diff changeset
1981 # but not from the CC environment variable when configure was run.
128cae6f3459 initial coding
carl
parents:
diff changeset
1982 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1983 # Blanks at the start of $base_compile will cause this to fail
128cae6f3459 initial coding
carl
parents:
diff changeset
1984 # if we don't check for them as well.
128cae6f3459 initial coding
carl
parents:
diff changeset
1985 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
1986 for z in $available_tags; do
128cae6f3459 initial coding
carl
parents:
diff changeset
1987 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
128cae6f3459 initial coding
carl
parents:
diff changeset
1988 # Evaluate the configuration.
128cae6f3459 initial coding
carl
parents:
diff changeset
1989 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
128cae6f3459 initial coding
carl
parents:
diff changeset
1990 case $base_compile in
128cae6f3459 initial coding
carl
parents:
diff changeset
1991 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
128cae6f3459 initial coding
carl
parents:
diff changeset
1992 # The compiler in $compile_command matches
128cae6f3459 initial coding
carl
parents:
diff changeset
1993 # the one in the tagged configuration.
128cae6f3459 initial coding
carl
parents:
diff changeset
1994 # Assume this is the tagged configuration we want.
128cae6f3459 initial coding
carl
parents:
diff changeset
1995 tagname=$z
128cae6f3459 initial coding
carl
parents:
diff changeset
1996 break
128cae6f3459 initial coding
carl
parents:
diff changeset
1997 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
1998 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
1999 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2000 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2001 # If $tagname still isn't set, then no tagged configuration
128cae6f3459 initial coding
carl
parents:
diff changeset
2002 # was found and let the user know that the "--tag" command
128cae6f3459 initial coding
carl
parents:
diff changeset
2003 # line option must be used.
128cae6f3459 initial coding
carl
parents:
diff changeset
2004 if test -z "$tagname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2005 $echo "$modename: unable to infer tagged configuration"
128cae6f3459 initial coding
carl
parents:
diff changeset
2006 $echo "$modename: specify a tag with \`--tag'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2007 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2008 # else
128cae6f3459 initial coding
carl
parents:
diff changeset
2009 # $echo "$modename: using $tagname tagged configuration"
128cae6f3459 initial coding
carl
parents:
diff changeset
2010 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2011 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2012 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2013 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2014
128cae6f3459 initial coding
carl
parents:
diff changeset
2015 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2016 eval arg=\"$export_dynamic_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
2017 compile_command="$compile_command $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
2018 finalize_command="$finalize_command $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
2019 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2020
128cae6f3459 initial coding
carl
parents:
diff changeset
2021 oldlibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2022 # calculate the name of the file, without its directory
128cae6f3459 initial coding
carl
parents:
diff changeset
2023 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2024 libobjs_save="$libobjs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2025
128cae6f3459 initial coding
carl
parents:
diff changeset
2026 if test -n "$shlibpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2027 # get the directories listed in $shlibpath_var
128cae6f3459 initial coding
carl
parents:
diff changeset
2028 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
128cae6f3459 initial coding
carl
parents:
diff changeset
2029 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2030 shlib_search_path=
128cae6f3459 initial coding
carl
parents:
diff changeset
2031 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2032 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
2033 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
2034
128cae6f3459 initial coding
carl
parents:
diff changeset
2035 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2036 if test "X$output_objdir" = "X$output"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2037 output_objdir="$objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2038 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2039 output_objdir="$output_objdir/$objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2040 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2041 # Create the object directory.
128cae6f3459 initial coding
carl
parents:
diff changeset
2042 if test ! -d "$output_objdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2043 $show "$mkdir $output_objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2044 $run $mkdir $output_objdir
128cae6f3459 initial coding
carl
parents:
diff changeset
2045 status=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
2046 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2047 exit $status
128cae6f3459 initial coding
carl
parents:
diff changeset
2048 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2049 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2050
128cae6f3459 initial coding
carl
parents:
diff changeset
2051 # Determine the type of output
128cae6f3459 initial coding
carl
parents:
diff changeset
2052 case $output in
128cae6f3459 initial coding
carl
parents:
diff changeset
2053 "")
128cae6f3459 initial coding
carl
parents:
diff changeset
2054 $echo "$modename: you must specify an output file" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2055 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2056 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2057 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2058 *.$libext) linkmode=oldlib ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2059 *.lo | *.$objext) linkmode=obj ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2060 *.la) linkmode=lib ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2061 *) linkmode=prog ;; # Anything else should be a program.
128cae6f3459 initial coding
carl
parents:
diff changeset
2062 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2063
128cae6f3459 initial coding
carl
parents:
diff changeset
2064 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
2065 *cygwin* | *mingw* | *pw32*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2066 # don't eliminate duplcations in $postdeps and $predeps
128cae6f3459 initial coding
carl
parents:
diff changeset
2067 duplicate_compiler_generated_deps=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2068 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2069 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2070 duplicate_compiler_generated_deps=$duplicate_deps
128cae6f3459 initial coding
carl
parents:
diff changeset
2071 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2072 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2073 specialdeplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2074
128cae6f3459 initial coding
carl
parents:
diff changeset
2075 libs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2076 # Find all interdependent deplibs by searching for libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2077 # that are linked more than once (e.g. -la -lb -la)
128cae6f3459 initial coding
carl
parents:
diff changeset
2078 for deplib in $deplibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2079 if test "X$duplicate_deps" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2080 case "$libs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2081 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2082 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2083 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2084 libs="$libs $deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2085 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2086
128cae6f3459 initial coding
carl
parents:
diff changeset
2087 if test "$linkmode" = lib; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2088 libs="$predeps $libs $compiler_lib_search_path $postdeps"
128cae6f3459 initial coding
carl
parents:
diff changeset
2089
128cae6f3459 initial coding
carl
parents:
diff changeset
2090 # Compute libraries that are listed more than once in $predeps
128cae6f3459 initial coding
carl
parents:
diff changeset
2091 # $postdeps and mark them as special (i.e., whose duplicates are
128cae6f3459 initial coding
carl
parents:
diff changeset
2092 # not to be eliminated).
128cae6f3459 initial coding
carl
parents:
diff changeset
2093 pre_post_deps=
128cae6f3459 initial coding
carl
parents:
diff changeset
2094 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2095 for pre_post_dep in $predeps $postdeps; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2096 case "$pre_post_deps " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2097 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2098 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2099 pre_post_deps="$pre_post_deps $pre_post_dep"
128cae6f3459 initial coding
carl
parents:
diff changeset
2100 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2101 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2102 pre_post_deps=
128cae6f3459 initial coding
carl
parents:
diff changeset
2103 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2104
128cae6f3459 initial coding
carl
parents:
diff changeset
2105 deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2106 newdependency_libs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2107 newlib_search_path=
128cae6f3459 initial coding
carl
parents:
diff changeset
2108 need_relink=no # whether we're linking any uninstalled libtool libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2109 notinst_deplibs= # not-installed libtool libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2110 notinst_path= # paths that contain not-installed libtool libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2111 case $linkmode in
128cae6f3459 initial coding
carl
parents:
diff changeset
2112 lib)
128cae6f3459 initial coding
carl
parents:
diff changeset
2113 passes="conv link"
128cae6f3459 initial coding
carl
parents:
diff changeset
2114 for file in $dlfiles $dlprefiles; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2115 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
2116 *.la) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2117 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2118 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2119 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2120 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2121 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2122 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2123 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2124 prog)
128cae6f3459 initial coding
carl
parents:
diff changeset
2125 compile_deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2126 finalize_deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2127 alldeplibs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
2128 newdlfiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
2129 newdlprefiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
2130 passes="conv scan dlopen dlpreopen link"
128cae6f3459 initial coding
carl
parents:
diff changeset
2131 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2132 *) passes="conv"
128cae6f3459 initial coding
carl
parents:
diff changeset
2133 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2134 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2135 for pass in $passes; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2136 if test "$linkmode,$pass" = "lib,link" ||
128cae6f3459 initial coding
carl
parents:
diff changeset
2137 test "$linkmode,$pass" = "prog,scan"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2138 libs="$deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2139 deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2140 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2141 if test "$linkmode" = prog; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2142 case $pass in
128cae6f3459 initial coding
carl
parents:
diff changeset
2143 dlopen) libs="$dlfiles" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2144 dlpreopen) libs="$dlprefiles" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2145 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2146 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2147 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2148 if test "$pass" = dlopen; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2149 # Collect dlpreopened libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2150 save_deplibs="$deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2151 deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2152 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2153 for deplib in $libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2154 lib=
128cae6f3459 initial coding
carl
parents:
diff changeset
2155 found=no
128cae6f3459 initial coding
carl
parents:
diff changeset
2156 case $deplib in
128cae6f3459 initial coding
carl
parents:
diff changeset
2157 -l*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2158 if test "$linkmode" != lib && test "$linkmode" != prog; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2159 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2160 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2161 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2162 if test "$pass" = conv && test "$allow_undefined" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2163 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2164 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2165 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2166 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2167 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2168 for search_ext in .la $shrext .so .a; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2169 # Search the libtool library
128cae6f3459 initial coding
carl
parents:
diff changeset
2170 lib="$searchdir/lib${name}${search_ext}"
128cae6f3459 initial coding
carl
parents:
diff changeset
2171 if test -f "$lib"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2172 if test "$search_ext" = ".la"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2173 found=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2174 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2175 found=no
128cae6f3459 initial coding
carl
parents:
diff changeset
2176 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2177 break 2
128cae6f3459 initial coding
carl
parents:
diff changeset
2178 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2179 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2180 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2181 if test "$found" != yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2182 # deplib doesn't seem to be a libtool library
128cae6f3459 initial coding
carl
parents:
diff changeset
2183 if test "$linkmode,$pass" = "prog,link"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2184 compile_deplibs="$deplib $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2185 finalize_deplibs="$deplib $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2186 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2187 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2188 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2189 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2190 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2191 else # deplib is a libtool library
128cae6f3459 initial coding
carl
parents:
diff changeset
2192 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
128cae6f3459 initial coding
carl
parents:
diff changeset
2193 # We need to do some special things here, and not later.
128cae6f3459 initial coding
carl
parents:
diff changeset
2194 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2195 case " $predeps $postdeps " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2196 *" $deplib "*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2197 if (${SED} -e '2q' $lib |
128cae6f3459 initial coding
carl
parents:
diff changeset
2198 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2199 library_names=
128cae6f3459 initial coding
carl
parents:
diff changeset
2200 old_library=
128cae6f3459 initial coding
carl
parents:
diff changeset
2201 case $lib in
128cae6f3459 initial coding
carl
parents:
diff changeset
2202 */* | *\\*) . $lib ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2203 *) . ./$lib ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2204 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2205 for l in $old_library $library_names; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2206 ll="$l"
128cae6f3459 initial coding
carl
parents:
diff changeset
2207 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2208 if test "X$ll" = "X$old_library" ; then # only static version available
128cae6f3459 initial coding
carl
parents:
diff changeset
2209 found=no
128cae6f3459 initial coding
carl
parents:
diff changeset
2210 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2211 test "X$ladir" = "X$lib" && ladir="."
128cae6f3459 initial coding
carl
parents:
diff changeset
2212 lib=$ladir/$old_library
128cae6f3459 initial coding
carl
parents:
diff changeset
2213 if test "$linkmode,$pass" = "prog,link"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2214 compile_deplibs="$deplib $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2215 finalize_deplibs="$deplib $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2216 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2217 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2218 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2219 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2220 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2221 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2222 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2223 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2224 *) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2225 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2226 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2227 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2228 ;; # -l
128cae6f3459 initial coding
carl
parents:
diff changeset
2229 -L*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2230 case $linkmode in
128cae6f3459 initial coding
carl
parents:
diff changeset
2231 lib)
128cae6f3459 initial coding
carl
parents:
diff changeset
2232 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2233 test "$pass" = conv && continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2234 newdependency_libs="$deplib $newdependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2235 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2236 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2237 prog)
128cae6f3459 initial coding
carl
parents:
diff changeset
2238 if test "$pass" = conv; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2239 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2240 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2241 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2242 if test "$pass" = scan; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2243 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2244 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2245 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2246 compile_deplibs="$deplib $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2247 finalize_deplibs="$deplib $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2248 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2249 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2250 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2251 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2252 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2253 esac # linkmode
128cae6f3459 initial coding
carl
parents:
diff changeset
2254 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2255 ;; # -L
128cae6f3459 initial coding
carl
parents:
diff changeset
2256 -R*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2257 if test "$pass" = link; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2258 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2259 # Make sure the xrpath contains only unique directories.
128cae6f3459 initial coding
carl
parents:
diff changeset
2260 case "$xrpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2261 *" $dir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2262 *) xrpath="$xrpath $dir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2263 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2264 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2265 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2266 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2267 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2268 *.la) lib="$deplib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2269 *.$libext)
128cae6f3459 initial coding
carl
parents:
diff changeset
2270 if test "$pass" = conv; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2271 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2272 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2273 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2274 case $linkmode in
128cae6f3459 initial coding
carl
parents:
diff changeset
2275 lib)
128cae6f3459 initial coding
carl
parents:
diff changeset
2276 if test "$deplibs_check_method" != pass_all; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2277 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
2278 $echo "*** Warning: Trying to link with static lib archive $deplib."
128cae6f3459 initial coding
carl
parents:
diff changeset
2279 $echo "*** I have the capability to make that library automatically link in when"
128cae6f3459 initial coding
carl
parents:
diff changeset
2280 $echo "*** you link to this library. But I can only do this if you have a"
128cae6f3459 initial coding
carl
parents:
diff changeset
2281 $echo "*** shared version of the library, which you do not appear to have"
128cae6f3459 initial coding
carl
parents:
diff changeset
2282 $echo "*** because the file extensions .$libext of this argument makes me believe"
128cae6f3459 initial coding
carl
parents:
diff changeset
2283 $echo "*** that it is just a static archive that I should not used here."
128cae6f3459 initial coding
carl
parents:
diff changeset
2284 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2285 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
2286 $echo "*** Warning: Linking the shared library $output against the"
128cae6f3459 initial coding
carl
parents:
diff changeset
2287 $echo "*** static library $deplib is not portable!"
128cae6f3459 initial coding
carl
parents:
diff changeset
2288 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2289 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2290 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2291 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2292 prog)
128cae6f3459 initial coding
carl
parents:
diff changeset
2293 if test "$pass" != link; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2294 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2295 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2296 compile_deplibs="$deplib $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2297 finalize_deplibs="$deplib $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2298 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2299 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2300 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2301 esac # linkmode
128cae6f3459 initial coding
carl
parents:
diff changeset
2302 ;; # *.$libext
128cae6f3459 initial coding
carl
parents:
diff changeset
2303 *.lo | *.$objext)
128cae6f3459 initial coding
carl
parents:
diff changeset
2304 if test "$pass" = conv; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2305 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2306 elif test "$linkmode" = prog; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2307 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2308 # If there is no dlopen support or we're linking statically,
128cae6f3459 initial coding
carl
parents:
diff changeset
2309 # we need to preload.
128cae6f3459 initial coding
carl
parents:
diff changeset
2310 newdlprefiles="$newdlprefiles $deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2311 compile_deplibs="$deplib $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2312 finalize_deplibs="$deplib $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2313 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2314 newdlfiles="$newdlfiles $deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2315 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2316 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2317 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2318 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2319 %DEPLIBS%)
128cae6f3459 initial coding
carl
parents:
diff changeset
2320 alldeplibs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2321 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2322 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2323 esac # case $deplib
128cae6f3459 initial coding
carl
parents:
diff changeset
2324 if test "$found" = yes || test -f "$lib"; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
2325 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2326 $echo "$modename: cannot find the library \`$lib'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2327 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2328 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2329
128cae6f3459 initial coding
carl
parents:
diff changeset
2330 # Check to see that this really is a libtool archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
2331 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
2332 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2333 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2334 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2335 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2336
128cae6f3459 initial coding
carl
parents:
diff changeset
2337 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2338 test "X$ladir" = "X$lib" && ladir="."
128cae6f3459 initial coding
carl
parents:
diff changeset
2339
128cae6f3459 initial coding
carl
parents:
diff changeset
2340 dlname=
128cae6f3459 initial coding
carl
parents:
diff changeset
2341 dlopen=
128cae6f3459 initial coding
carl
parents:
diff changeset
2342 dlpreopen=
128cae6f3459 initial coding
carl
parents:
diff changeset
2343 libdir=
128cae6f3459 initial coding
carl
parents:
diff changeset
2344 library_names=
128cae6f3459 initial coding
carl
parents:
diff changeset
2345 old_library=
128cae6f3459 initial coding
carl
parents:
diff changeset
2346 # If the library was installed with an old release of libtool,
128cae6f3459 initial coding
carl
parents:
diff changeset
2347 # it will not redefine variables installed, or shouldnotlink
128cae6f3459 initial coding
carl
parents:
diff changeset
2348 installed=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2349 shouldnotlink=no
128cae6f3459 initial coding
carl
parents:
diff changeset
2350
128cae6f3459 initial coding
carl
parents:
diff changeset
2351 # Read the .la file
128cae6f3459 initial coding
carl
parents:
diff changeset
2352 case $lib in
128cae6f3459 initial coding
carl
parents:
diff changeset
2353 */* | *\\*) . $lib ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2354 *) . ./$lib ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2355 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2356
128cae6f3459 initial coding
carl
parents:
diff changeset
2357 if test "$linkmode,$pass" = "lib,link" ||
128cae6f3459 initial coding
carl
parents:
diff changeset
2358 test "$linkmode,$pass" = "prog,scan" ||
128cae6f3459 initial coding
carl
parents:
diff changeset
2359 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2360 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
128cae6f3459 initial coding
carl
parents:
diff changeset
2361 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
128cae6f3459 initial coding
carl
parents:
diff changeset
2362 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2363
128cae6f3459 initial coding
carl
parents:
diff changeset
2364 if test "$pass" = conv; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2365 # Only check for convenience libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2366 deplibs="$lib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2367 tmp_libs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2368 for deplib in $dependency_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2369 #echo "Adding $deplib to \$deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2370 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2371 if test "X$duplicate_deps" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2372 case "$tmp_libs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2373 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2374 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2375 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2376 tmp_libs="$tmp_libs $deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2377 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2378 if test -z "$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2379 if test -z "$old_library"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2380 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2381 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2382 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2383 # It is a libtool convenience library, so add in its objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
2384 convenience="$convenience $ladir/$objdir/$old_library"
128cae6f3459 initial coding
carl
parents:
diff changeset
2385 old_convenience="$old_convenience $ladir/$objdir/$old_library"
128cae6f3459 initial coding
carl
parents:
diff changeset
2386 elif test "$linkmode" != prog && test "$linkmode" != lib; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2387 $echo "$modename: \`$lib' is not a convenience library" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2388 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2389 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2390 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2391 fi # $pass = conv
128cae6f3459 initial coding
carl
parents:
diff changeset
2392
128cae6f3459 initial coding
carl
parents:
diff changeset
2393
128cae6f3459 initial coding
carl
parents:
diff changeset
2394 # Get the name of the library we link against.
128cae6f3459 initial coding
carl
parents:
diff changeset
2395 linklib=
128cae6f3459 initial coding
carl
parents:
diff changeset
2396 for l in $old_library $library_names; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2397 linklib="$l"
128cae6f3459 initial coding
carl
parents:
diff changeset
2398 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2399 if test -z "$linklib"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2400 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2401 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2402 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2403
128cae6f3459 initial coding
carl
parents:
diff changeset
2404 # This library was specified with -dlopen.
128cae6f3459 initial coding
carl
parents:
diff changeset
2405 if test "$pass" = dlopen; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2406 if test -z "$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2407 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2408 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2409 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2410 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2411 # If there is no dlname, no dlopen support or we're linking
128cae6f3459 initial coding
carl
parents:
diff changeset
2412 # statically, we need to preload. We also need to preload any
128cae6f3459 initial coding
carl
parents:
diff changeset
2413 # dependent libraries so libltdl's deplib preloader doesn't
128cae6f3459 initial coding
carl
parents:
diff changeset
2414 # bomb out in the load deplibs phase.
128cae6f3459 initial coding
carl
parents:
diff changeset
2415 dlprefiles="$dlprefiles $lib $dependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2416 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2417 newdlfiles="$newdlfiles $lib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2418 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2419 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2420 fi # $pass = dlopen
128cae6f3459 initial coding
carl
parents:
diff changeset
2421
128cae6f3459 initial coding
carl
parents:
diff changeset
2422 # We need an absolute path.
128cae6f3459 initial coding
carl
parents:
diff changeset
2423 case $ladir in
128cae6f3459 initial coding
carl
parents:
diff changeset
2424 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2425 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2426 abs_ladir=`cd "$ladir" && pwd`
128cae6f3459 initial coding
carl
parents:
diff changeset
2427 if test -z "$abs_ladir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2428 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2429 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2430 abs_ladir="$ladir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2431 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2432 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2433 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2434 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2435
128cae6f3459 initial coding
carl
parents:
diff changeset
2436 # Find the relevant object directory and library name.
128cae6f3459 initial coding
carl
parents:
diff changeset
2437 if test "X$installed" = Xyes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2438 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2439 $echo "$modename: warning: library \`$lib' was moved." 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2440 dir="$ladir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2441 absdir="$abs_ladir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2442 libdir="$abs_ladir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2443 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2444 dir="$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2445 absdir="$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2446 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2447 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2448 dir="$ladir/$objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2449 absdir="$abs_ladir/$objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2450 # Remove this search path later
128cae6f3459 initial coding
carl
parents:
diff changeset
2451 notinst_path="$notinst_path $abs_ladir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2452 fi # $installed = yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2453 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2454
128cae6f3459 initial coding
carl
parents:
diff changeset
2455 # This library was specified with -dlpreopen.
128cae6f3459 initial coding
carl
parents:
diff changeset
2456 if test "$pass" = dlpreopen; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2457 if test -z "$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2458 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2459 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2460 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2461 # Prefer using a static library (so that no silly _DYNAMIC symbols
128cae6f3459 initial coding
carl
parents:
diff changeset
2462 # are required to link).
128cae6f3459 initial coding
carl
parents:
diff changeset
2463 if test -n "$old_library"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2464 newdlprefiles="$newdlprefiles $dir/$old_library"
128cae6f3459 initial coding
carl
parents:
diff changeset
2465 # Otherwise, use the dlname, so that lt_dlopen finds it.
128cae6f3459 initial coding
carl
parents:
diff changeset
2466 elif test -n "$dlname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2467 newdlprefiles="$newdlprefiles $dir/$dlname"
128cae6f3459 initial coding
carl
parents:
diff changeset
2468 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2469 newdlprefiles="$newdlprefiles $dir/$linklib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2470 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2471 fi # $pass = dlpreopen
128cae6f3459 initial coding
carl
parents:
diff changeset
2472
128cae6f3459 initial coding
carl
parents:
diff changeset
2473 if test -z "$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2474 # Link the convenience library
128cae6f3459 initial coding
carl
parents:
diff changeset
2475 if test "$linkmode" = lib; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2476 deplibs="$dir/$old_library $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2477 elif test "$linkmode,$pass" = "prog,link"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2478 compile_deplibs="$dir/$old_library $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2479 finalize_deplibs="$dir/$old_library $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2480 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2481 deplibs="$lib $deplibs" # used for prog,scan pass
128cae6f3459 initial coding
carl
parents:
diff changeset
2482 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2483 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2484 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2485
128cae6f3459 initial coding
carl
parents:
diff changeset
2486
128cae6f3459 initial coding
carl
parents:
diff changeset
2487 if test "$linkmode" = prog && test "$pass" != link; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2488 newlib_search_path="$newlib_search_path $ladir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2489 deplibs="$lib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2490
128cae6f3459 initial coding
carl
parents:
diff changeset
2491 linkalldeplibs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
2492 if test "$link_all_deplibs" != no || test -z "$library_names" ||
128cae6f3459 initial coding
carl
parents:
diff changeset
2493 test "$build_libtool_libs" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2494 linkalldeplibs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2495 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2496
128cae6f3459 initial coding
carl
parents:
diff changeset
2497 tmp_libs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2498 for deplib in $dependency_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2499 case $deplib in
128cae6f3459 initial coding
carl
parents:
diff changeset
2500 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
128cae6f3459 initial coding
carl
parents:
diff changeset
2501 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2502 # Need to link against all dependency_libs?
128cae6f3459 initial coding
carl
parents:
diff changeset
2503 if test "$linkalldeplibs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2504 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2505 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2506 # Need to hardcode shared library paths
128cae6f3459 initial coding
carl
parents:
diff changeset
2507 # or/and link against static libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2508 newdependency_libs="$deplib $newdependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2509 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2510 if test "X$duplicate_deps" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2511 case "$tmp_libs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2512 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2513 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2514 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2515 tmp_libs="$tmp_libs $deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2516 done # for deplib
128cae6f3459 initial coding
carl
parents:
diff changeset
2517 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2518 fi # $linkmode = prog...
128cae6f3459 initial coding
carl
parents:
diff changeset
2519
128cae6f3459 initial coding
carl
parents:
diff changeset
2520 if test "$linkmode,$pass" = "prog,link"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2521 if test -n "$library_names" &&
128cae6f3459 initial coding
carl
parents:
diff changeset
2522 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2523 # We need to hardcode the library path
128cae6f3459 initial coding
carl
parents:
diff changeset
2524 if test -n "$shlibpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2525 # Make sure the rpath contains only unique directories.
128cae6f3459 initial coding
carl
parents:
diff changeset
2526 case "$temp_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2527 *" $dir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2528 *" $absdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2529 *) temp_rpath="$temp_rpath $dir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2530 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2531 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2532
128cae6f3459 initial coding
carl
parents:
diff changeset
2533 # Hardcode the library path.
128cae6f3459 initial coding
carl
parents:
diff changeset
2534 # Skip directories that are in the system default run-time
128cae6f3459 initial coding
carl
parents:
diff changeset
2535 # search path.
128cae6f3459 initial coding
carl
parents:
diff changeset
2536 case " $sys_lib_dlsearch_path " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2537 *" $absdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2538 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2539 case "$compile_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2540 *" $absdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2541 *) compile_rpath="$compile_rpath $absdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2542 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2543 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2544 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2545 case " $sys_lib_dlsearch_path " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2546 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2547 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2548 case "$finalize_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2549 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2550 *) finalize_rpath="$finalize_rpath $libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2551 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2552 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2553 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2554 fi # $linkmode,$pass = prog,link...
128cae6f3459 initial coding
carl
parents:
diff changeset
2555
128cae6f3459 initial coding
carl
parents:
diff changeset
2556 if test "$alldeplibs" = yes &&
128cae6f3459 initial coding
carl
parents:
diff changeset
2557 { test "$deplibs_check_method" = pass_all ||
128cae6f3459 initial coding
carl
parents:
diff changeset
2558 { test "$build_libtool_libs" = yes &&
128cae6f3459 initial coding
carl
parents:
diff changeset
2559 test -n "$library_names"; }; }; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2560 # We only need to search for static libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2561 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
2562 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2563 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2564
128cae6f3459 initial coding
carl
parents:
diff changeset
2565 link_static=no # Whether the deplib will be linked statically
128cae6f3459 initial coding
carl
parents:
diff changeset
2566 if test -n "$library_names" &&
128cae6f3459 initial coding
carl
parents:
diff changeset
2567 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2568 if test "$installed" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2569 notinst_deplibs="$notinst_deplibs $lib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2570 need_relink=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2571 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2572 # This is a shared library
128cae6f3459 initial coding
carl
parents:
diff changeset
2573
128cae6f3459 initial coding
carl
parents:
diff changeset
2574 # Warn about portability, can't link against -module's on some systems (darwin)
128cae6f3459 initial coding
carl
parents:
diff changeset
2575 if test "$shouldnotlink" = yes && test "$pass" = link ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2576 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
2577 if test "$linkmode" = prog; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2578 $echo "*** Warning: Linking the executable $output against the loadable module"
128cae6f3459 initial coding
carl
parents:
diff changeset
2579 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2580 $echo "*** Warning: Linking the shared library $output against the loadable module"
128cae6f3459 initial coding
carl
parents:
diff changeset
2581 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2582 $echo "*** $linklib is not portable!"
128cae6f3459 initial coding
carl
parents:
diff changeset
2583 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2584 if test "$linkmode" = lib &&
128cae6f3459 initial coding
carl
parents:
diff changeset
2585 test "$hardcode_into_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2586 # Hardcode the library path.
128cae6f3459 initial coding
carl
parents:
diff changeset
2587 # Skip directories that are in the system default run-time
128cae6f3459 initial coding
carl
parents:
diff changeset
2588 # search path.
128cae6f3459 initial coding
carl
parents:
diff changeset
2589 case " $sys_lib_dlsearch_path " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2590 *" $absdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2591 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2592 case "$compile_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2593 *" $absdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2594 *) compile_rpath="$compile_rpath $absdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2595 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2596 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2597 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2598 case " $sys_lib_dlsearch_path " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2599 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2600 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2601 case "$finalize_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2602 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2603 *) finalize_rpath="$finalize_rpath $libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2604 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2605 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2606 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2607 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2608
128cae6f3459 initial coding
carl
parents:
diff changeset
2609 if test -n "$old_archive_from_expsyms_cmds"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2610 # figure out the soname
128cae6f3459 initial coding
carl
parents:
diff changeset
2611 set dummy $library_names
128cae6f3459 initial coding
carl
parents:
diff changeset
2612 realname="$2"
128cae6f3459 initial coding
carl
parents:
diff changeset
2613 shift; shift
128cae6f3459 initial coding
carl
parents:
diff changeset
2614 libname=`eval \\$echo \"$libname_spec\"`
128cae6f3459 initial coding
carl
parents:
diff changeset
2615 # use dlname if we got it. it's perfectly good, no?
128cae6f3459 initial coding
carl
parents:
diff changeset
2616 if test -n "$dlname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2617 soname="$dlname"
128cae6f3459 initial coding
carl
parents:
diff changeset
2618 elif test -n "$soname_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2619 # bleh windows
128cae6f3459 initial coding
carl
parents:
diff changeset
2620 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
2621 *cygwin* | mingw*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2622 major=`expr $current - $age`
128cae6f3459 initial coding
carl
parents:
diff changeset
2623 versuffix="-$major"
128cae6f3459 initial coding
carl
parents:
diff changeset
2624 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2625 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2626 eval soname=\"$soname_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
2627 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2628 soname="$realname"
128cae6f3459 initial coding
carl
parents:
diff changeset
2629 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2630
128cae6f3459 initial coding
carl
parents:
diff changeset
2631 # Make a new name for the extract_expsyms_cmds to use
128cae6f3459 initial coding
carl
parents:
diff changeset
2632 soroot="$soname"
128cae6f3459 initial coding
carl
parents:
diff changeset
2633 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2634 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
128cae6f3459 initial coding
carl
parents:
diff changeset
2635
128cae6f3459 initial coding
carl
parents:
diff changeset
2636 # If the library has no export list, then create one now
128cae6f3459 initial coding
carl
parents:
diff changeset
2637 if test -f "$output_objdir/$soname-def"; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
2638 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2639 $show "extracting exported symbol list from \`$soname'"
128cae6f3459 initial coding
carl
parents:
diff changeset
2640 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
2641 eval cmds=\"$extract_expsyms_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
2642 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2643 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2644 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
2645 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
2646 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2647 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2648 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2649
128cae6f3459 initial coding
carl
parents:
diff changeset
2650 # Create $newlib
128cae6f3459 initial coding
carl
parents:
diff changeset
2651 if test -f "$output_objdir/$newlib"; then :; else
128cae6f3459 initial coding
carl
parents:
diff changeset
2652 $show "generating import library for \`$soname'"
128cae6f3459 initial coding
carl
parents:
diff changeset
2653 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
2654 eval cmds=\"$old_archive_from_expsyms_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
2655 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2656 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2657 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
2658 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
2659 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2660 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2661 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2662 # make sure the library variables are pointing to the new library
128cae6f3459 initial coding
carl
parents:
diff changeset
2663 dir=$output_objdir
128cae6f3459 initial coding
carl
parents:
diff changeset
2664 linklib=$newlib
128cae6f3459 initial coding
carl
parents:
diff changeset
2665 fi # test -n "$old_archive_from_expsyms_cmds"
128cae6f3459 initial coding
carl
parents:
diff changeset
2666
128cae6f3459 initial coding
carl
parents:
diff changeset
2667 if test "$linkmode" = prog || test "$mode" != relink; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2668 add_shlibpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
2669 add_dir=
128cae6f3459 initial coding
carl
parents:
diff changeset
2670 add=
128cae6f3459 initial coding
carl
parents:
diff changeset
2671 lib_linked=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2672 case $hardcode_action in
128cae6f3459 initial coding
carl
parents:
diff changeset
2673 immediate | unsupported)
128cae6f3459 initial coding
carl
parents:
diff changeset
2674 if test "$hardcode_direct" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2675 add="$dir/$linklib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2676 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
2677 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2678 *-*-darwin* )
128cae6f3459 initial coding
carl
parents:
diff changeset
2679 # if the lib is a module then we can not link against it, someone
128cae6f3459 initial coding
carl
parents:
diff changeset
2680 # is ignoring the new warnings I added
128cae6f3459 initial coding
carl
parents:
diff changeset
2681 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2682 $echo "** Warning, lib $linklib is a module, not a shared library"
128cae6f3459 initial coding
carl
parents:
diff changeset
2683 if test -z "$old_library" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2684 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
2685 $echo "** And there doesn't seem to be a static archive available"
128cae6f3459 initial coding
carl
parents:
diff changeset
2686 $echo "** The link will probably fail, sorry"
128cae6f3459 initial coding
carl
parents:
diff changeset
2687 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2688 add="$dir/$old_library"
128cae6f3459 initial coding
carl
parents:
diff changeset
2689 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2690 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2691 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2692 elif test "$hardcode_minus_L" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2693 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
2694 *-*-sunos*) add_shlibpath="$dir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2695 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2696 add_dir="-L$dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2697 add="-l$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
2698 elif test "$hardcode_shlibpath_var" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2699 add_shlibpath="$dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2700 add="-l$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
2701 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2702 lib_linked=no
128cae6f3459 initial coding
carl
parents:
diff changeset
2703 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2704 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2705 relink)
128cae6f3459 initial coding
carl
parents:
diff changeset
2706 if test "$hardcode_direct" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2707 add="$dir/$linklib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2708 elif test "$hardcode_minus_L" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2709 add_dir="-L$dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2710 # Try looking first in the location we're being installed to.
128cae6f3459 initial coding
carl
parents:
diff changeset
2711 if test -n "$inst_prefix_dir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2712 case "$libdir" in
128cae6f3459 initial coding
carl
parents:
diff changeset
2713 [\\/]*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2714 add_dir="-L$inst_prefix_dir$libdir $add_dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2715 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2716 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2717 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2718 add="-l$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
2719 elif test "$hardcode_shlibpath_var" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2720 add_shlibpath="$dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2721 add="-l$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
2722 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2723 lib_linked=no
128cae6f3459 initial coding
carl
parents:
diff changeset
2724 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2725 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2726 *) lib_linked=no ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2727 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2728
128cae6f3459 initial coding
carl
parents:
diff changeset
2729 if test "$lib_linked" != yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2730 $echo "$modename: configuration error: unsupported hardcode properties"
128cae6f3459 initial coding
carl
parents:
diff changeset
2731 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2732 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2733
128cae6f3459 initial coding
carl
parents:
diff changeset
2734 if test -n "$add_shlibpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2735 case :$compile_shlibpath: in
128cae6f3459 initial coding
carl
parents:
diff changeset
2736 *":$add_shlibpath:"*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2737 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2738 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2739 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2740 if test "$linkmode" = prog; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2741 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2742 test -n "$add" && compile_deplibs="$add $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2743 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2744 test -n "$add_dir" && deplibs="$add_dir $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2745 test -n "$add" && deplibs="$add $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2746 if test "$hardcode_direct" != yes && \
128cae6f3459 initial coding
carl
parents:
diff changeset
2747 test "$hardcode_minus_L" != yes && \
128cae6f3459 initial coding
carl
parents:
diff changeset
2748 test "$hardcode_shlibpath_var" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2749 case :$finalize_shlibpath: in
128cae6f3459 initial coding
carl
parents:
diff changeset
2750 *":$libdir:"*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2751 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2752 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2753 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2754 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2755 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2756
128cae6f3459 initial coding
carl
parents:
diff changeset
2757 if test "$linkmode" = prog || test "$mode" = relink; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2758 add_shlibpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
2759 add_dir=
128cae6f3459 initial coding
carl
parents:
diff changeset
2760 add=
128cae6f3459 initial coding
carl
parents:
diff changeset
2761 # Finalize command for both is simple: just hardcode it.
128cae6f3459 initial coding
carl
parents:
diff changeset
2762 if test "$hardcode_direct" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2763 add="$libdir/$linklib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2764 elif test "$hardcode_minus_L" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2765 add_dir="-L$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2766 add="-l$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
2767 elif test "$hardcode_shlibpath_var" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2768 case :$finalize_shlibpath: in
128cae6f3459 initial coding
carl
parents:
diff changeset
2769 *":$libdir:"*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2770 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2771 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2772 add="-l$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
2773 elif test "$hardcode_automatic" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2774 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2775 add="$inst_prefix_dir$libdir/$linklib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2776 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2777 add="$libdir/$linklib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2778 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2779 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2780 # We cannot seem to hardcode it, guess we'll fake it.
128cae6f3459 initial coding
carl
parents:
diff changeset
2781 add_dir="-L$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2782 # Try looking first in the location we're being installed to.
128cae6f3459 initial coding
carl
parents:
diff changeset
2783 if test -n "$inst_prefix_dir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2784 case "$libdir" in
128cae6f3459 initial coding
carl
parents:
diff changeset
2785 [\\/]*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2786 add_dir="-L$inst_prefix_dir$libdir $add_dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2787 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2788 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2789 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2790 add="-l$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
2791 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2792
128cae6f3459 initial coding
carl
parents:
diff changeset
2793 if test "$linkmode" = prog; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2794 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2795 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2796 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2797 test -n "$add_dir" && deplibs="$add_dir $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2798 test -n "$add" && deplibs="$add $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2799 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2800 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2801 elif test "$linkmode" = prog; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2802 # Here we assume that one of hardcode_direct or hardcode_minus_L
128cae6f3459 initial coding
carl
parents:
diff changeset
2803 # is not unsupported. This is valid on all known static and
128cae6f3459 initial coding
carl
parents:
diff changeset
2804 # shared platforms.
128cae6f3459 initial coding
carl
parents:
diff changeset
2805 if test "$hardcode_direct" != unsupported; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2806 test -n "$old_library" && linklib="$old_library"
128cae6f3459 initial coding
carl
parents:
diff changeset
2807 compile_deplibs="$dir/$linklib $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2808 finalize_deplibs="$dir/$linklib $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2809 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2810 compile_deplibs="-l$name -L$dir $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2811 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2812 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2813 elif test "$build_libtool_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2814 # Not a shared library
128cae6f3459 initial coding
carl
parents:
diff changeset
2815 if test "$deplibs_check_method" != pass_all; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2816 # We're trying link a shared library against a static one
128cae6f3459 initial coding
carl
parents:
diff changeset
2817 # but the system doesn't support it.
128cae6f3459 initial coding
carl
parents:
diff changeset
2818
128cae6f3459 initial coding
carl
parents:
diff changeset
2819 # Just print a warning and add the library to dependency_libs so
128cae6f3459 initial coding
carl
parents:
diff changeset
2820 # that the program can be linked against the static library.
128cae6f3459 initial coding
carl
parents:
diff changeset
2821 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
2822 $echo "*** Warning: This system can not link to static lib archive $lib."
128cae6f3459 initial coding
carl
parents:
diff changeset
2823 $echo "*** I have the capability to make that library automatically link in when"
128cae6f3459 initial coding
carl
parents:
diff changeset
2824 $echo "*** you link to this library. But I can only do this if you have a"
128cae6f3459 initial coding
carl
parents:
diff changeset
2825 $echo "*** shared version of the library, which you do not appear to have."
128cae6f3459 initial coding
carl
parents:
diff changeset
2826 if test "$module" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2827 $echo "*** But as you try to build a module library, libtool will still create "
128cae6f3459 initial coding
carl
parents:
diff changeset
2828 $echo "*** a static module, that should work as long as the dlopening application"
128cae6f3459 initial coding
carl
parents:
diff changeset
2829 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
128cae6f3459 initial coding
carl
parents:
diff changeset
2830 if test -z "$global_symbol_pipe"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2831 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
2832 $echo "*** However, this would only work if libtool was able to extract symbol"
128cae6f3459 initial coding
carl
parents:
diff changeset
2833 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
128cae6f3459 initial coding
carl
parents:
diff changeset
2834 $echo "*** not find such a program. So, this module is probably useless."
128cae6f3459 initial coding
carl
parents:
diff changeset
2835 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
128cae6f3459 initial coding
carl
parents:
diff changeset
2836 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2837 if test "$build_old_libs" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2838 build_libtool_libs=module
128cae6f3459 initial coding
carl
parents:
diff changeset
2839 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2840 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2841 build_libtool_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
2842 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2843 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2844 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2845 convenience="$convenience $dir/$old_library"
128cae6f3459 initial coding
carl
parents:
diff changeset
2846 old_convenience="$old_convenience $dir/$old_library"
128cae6f3459 initial coding
carl
parents:
diff changeset
2847 deplibs="$dir/$old_library $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2848 link_static=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
2849 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2850 fi # link shared/static library?
128cae6f3459 initial coding
carl
parents:
diff changeset
2851
128cae6f3459 initial coding
carl
parents:
diff changeset
2852 if test "$linkmode" = lib; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2853 #if test -n "$dependency_libs" &&
128cae6f3459 initial coding
carl
parents:
diff changeset
2854 # { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
128cae6f3459 initial coding
carl
parents:
diff changeset
2855 # test "$link_static" = yes; }; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2856 # Extract -R from dependency_libs
128cae6f3459 initial coding
carl
parents:
diff changeset
2857 temp_deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2858 for libdir in $dependency_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2859 case $libdir in
128cae6f3459 initial coding
carl
parents:
diff changeset
2860 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2861 case " $xrpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2862 *" $temp_xrpath "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2863 *) xrpath="$xrpath $temp_xrpath";;
128cae6f3459 initial coding
carl
parents:
diff changeset
2864 esac;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2865 *) temp_deplibs="$temp_deplibs $libdir";;
128cae6f3459 initial coding
carl
parents:
diff changeset
2866 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2867 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2868 dependency_libs="$temp_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2869 #fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2870
128cae6f3459 initial coding
carl
parents:
diff changeset
2871 newlib_search_path="$newlib_search_path $absdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2872 # Link against this library
128cae6f3459 initial coding
carl
parents:
diff changeset
2873 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2874 # ... and its dependency_libs
128cae6f3459 initial coding
carl
parents:
diff changeset
2875 tmp_libs=
128cae6f3459 initial coding
carl
parents:
diff changeset
2876 for deplib in $dependency_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2877 newdependency_libs="$deplib $newdependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2878 if test "X$duplicate_deps" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2879 case "$tmp_libs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2880 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2881 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2882 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2883 tmp_libs="$tmp_libs $deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2884 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2885
128cae6f3459 initial coding
carl
parents:
diff changeset
2886 if test "$link_all_deplibs" != no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2887 # Add the search paths of all dependency libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2888 for deplib in $dependency_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2889 case $deplib in
128cae6f3459 initial coding
carl
parents:
diff changeset
2890 -L*) path="$deplib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2891 *.la)
128cae6f3459 initial coding
carl
parents:
diff changeset
2892 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
2893 test "X$dir" = "X$deplib" && dir="."
128cae6f3459 initial coding
carl
parents:
diff changeset
2894 # We need an absolute path.
128cae6f3459 initial coding
carl
parents:
diff changeset
2895 case $dir in
128cae6f3459 initial coding
carl
parents:
diff changeset
2896 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2897 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2898 absdir=`cd "$dir" && pwd`
128cae6f3459 initial coding
carl
parents:
diff changeset
2899 if test -z "$absdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2900 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2901 absdir="$dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2902 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2903 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2904 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2905 if grep "^installed=no" $deplib > /dev/null; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2906 path="$absdir/$objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2907 else
128cae6f3459 initial coding
carl
parents:
diff changeset
2908 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
128cae6f3459 initial coding
carl
parents:
diff changeset
2909 if test -z "$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2910 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2911 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
2912 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2913 if test "$absdir" != "$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2914 # Sure, some shells/systems don't implement the -ef.
128cae6f3459 initial coding
carl
parents:
diff changeset
2915 # Those will have to live with the warning.
128cae6f3459 initial coding
carl
parents:
diff changeset
2916 test "$absdir" -ef "$libdir" > /dev/null 2>&1 ||
128cae6f3459 initial coding
carl
parents:
diff changeset
2917 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
2918 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2919 path="$absdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
2920 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2921 depdepl=
128cae6f3459 initial coding
carl
parents:
diff changeset
2922 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
2923 *-*-darwin*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2924 # we do not want to link against static libs, but need to link against shared
128cae6f3459 initial coding
carl
parents:
diff changeset
2925 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
128cae6f3459 initial coding
carl
parents:
diff changeset
2926 if test -n "$deplibrary_names" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2927 for tmp in $deplibrary_names ; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2928 depdepl=$tmp
128cae6f3459 initial coding
carl
parents:
diff changeset
2929 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2930 if test -f "$path/$depdepl" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2931 depdepl="$path/$depdepl"
128cae6f3459 initial coding
carl
parents:
diff changeset
2932 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2933 # do not add paths which are already there
128cae6f3459 initial coding
carl
parents:
diff changeset
2934 case " $newlib_search_path " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2935 *" $path "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2936 *) newlib_search_path="$newlib_search_path $path";;
128cae6f3459 initial coding
carl
parents:
diff changeset
2937 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2938 path=""
128cae6f3459 initial coding
carl
parents:
diff changeset
2939 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2940 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2941 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
2942 path="-L$path"
128cae6f3459 initial coding
carl
parents:
diff changeset
2943 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2944 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2945
128cae6f3459 initial coding
carl
parents:
diff changeset
2946 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2947 -l*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2948 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
2949 *-*-darwin*)
128cae6f3459 initial coding
carl
parents:
diff changeset
2950 # Again, we only want to link against shared libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2951 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
128cae6f3459 initial coding
carl
parents:
diff changeset
2952 for tmp in $newlib_search_path ; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2953 if test -f "$tmp/lib$tmp_libs.dylib" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2954 eval depdepl="$tmp/lib$tmp_libs.dylib"
128cae6f3459 initial coding
carl
parents:
diff changeset
2955 break
128cae6f3459 initial coding
carl
parents:
diff changeset
2956 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2957 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2958 path=""
128cae6f3459 initial coding
carl
parents:
diff changeset
2959 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2960 *) continue ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2961 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2962 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2963 *) continue ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2964 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2965 case " $deplibs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2966 *" $depdepl "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2967 *) deplibs="$deplibs $depdepl" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2968 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2969 case " $deplibs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2970 *" $path "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2971 *) deplibs="$deplibs $path" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2972 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2973 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2974 fi # link_all_deplibs != no
128cae6f3459 initial coding
carl
parents:
diff changeset
2975 fi # linkmode = lib
128cae6f3459 initial coding
carl
parents:
diff changeset
2976 done # for deplib in $libs
128cae6f3459 initial coding
carl
parents:
diff changeset
2977 dependency_libs="$newdependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2978 if test "$pass" = dlpreopen; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2979 # Link the dlpreopened libraries before other libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
2980 for deplib in $save_deplibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2981 deplibs="$deplib $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2982 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2983 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2984 if test "$pass" != dlopen; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2985 if test "$pass" != conv; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2986 # Make sure lib_search_path contains only unique directories.
128cae6f3459 initial coding
carl
parents:
diff changeset
2987 lib_search_path=
128cae6f3459 initial coding
carl
parents:
diff changeset
2988 for dir in $newlib_search_path; do
128cae6f3459 initial coding
carl
parents:
diff changeset
2989 case "$lib_search_path " in
128cae6f3459 initial coding
carl
parents:
diff changeset
2990 *" $dir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2991 *) lib_search_path="$lib_search_path $dir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
2992 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
2993 done
128cae6f3459 initial coding
carl
parents:
diff changeset
2994 newlib_search_path=
128cae6f3459 initial coding
carl
parents:
diff changeset
2995 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
2996
128cae6f3459 initial coding
carl
parents:
diff changeset
2997 if test "$linkmode,$pass" != "prog,link"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
2998 vars="deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
2999 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3000 vars="compile_deplibs finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3001 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3002 for var in $vars dependency_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3003 # Add libraries to $var in reverse order
128cae6f3459 initial coding
carl
parents:
diff changeset
3004 eval tmp_libs=\"\$$var\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3005 new_libs=
128cae6f3459 initial coding
carl
parents:
diff changeset
3006 for deplib in $tmp_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3007 # FIXME: Pedantically, this is the right thing to do, so
128cae6f3459 initial coding
carl
parents:
diff changeset
3008 # that some nasty dependency loop isn't accidentally
128cae6f3459 initial coding
carl
parents:
diff changeset
3009 # broken:
128cae6f3459 initial coding
carl
parents:
diff changeset
3010 #new_libs="$deplib $new_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3011 # Pragmatically, this seems to cause very few problems in
128cae6f3459 initial coding
carl
parents:
diff changeset
3012 # practice:
128cae6f3459 initial coding
carl
parents:
diff changeset
3013 case $deplib in
128cae6f3459 initial coding
carl
parents:
diff changeset
3014 -L*) new_libs="$deplib $new_libs" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3015 -R*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3016 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3017 # And here is the reason: when a library appears more
128cae6f3459 initial coding
carl
parents:
diff changeset
3018 # than once as an explicit dependence of a library, or
128cae6f3459 initial coding
carl
parents:
diff changeset
3019 # is implicitly linked in more than once by the
128cae6f3459 initial coding
carl
parents:
diff changeset
3020 # compiler, it is considered special, and multiple
128cae6f3459 initial coding
carl
parents:
diff changeset
3021 # occurrences thereof are not removed. Compare this
128cae6f3459 initial coding
carl
parents:
diff changeset
3022 # with having the same library being listed as a
128cae6f3459 initial coding
carl
parents:
diff changeset
3023 # dependency of multiple other libraries: in this case,
128cae6f3459 initial coding
carl
parents:
diff changeset
3024 # we know (pedantically, we assume) the library does not
128cae6f3459 initial coding
carl
parents:
diff changeset
3025 # need to be listed more than once, so we keep only the
128cae6f3459 initial coding
carl
parents:
diff changeset
3026 # last copy. This is not always right, but it is rare
128cae6f3459 initial coding
carl
parents:
diff changeset
3027 # enough that we require users that really mean to play
128cae6f3459 initial coding
carl
parents:
diff changeset
3028 # such unportable linking tricks to link the library
128cae6f3459 initial coding
carl
parents:
diff changeset
3029 # using -Wl,-lname, so that libtool does not consider it
128cae6f3459 initial coding
carl
parents:
diff changeset
3030 # for duplicate removal.
128cae6f3459 initial coding
carl
parents:
diff changeset
3031 case " $specialdeplibs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3032 *" $deplib "*) new_libs="$deplib $new_libs" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3033 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3034 case " $new_libs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3035 *" $deplib "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3036 *) new_libs="$deplib $new_libs" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3037 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3038 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3039 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3040 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3041 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3042 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3043 tmp_libs=
128cae6f3459 initial coding
carl
parents:
diff changeset
3044 for deplib in $new_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3045 case $deplib in
128cae6f3459 initial coding
carl
parents:
diff changeset
3046 -L*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3047 case " $tmp_libs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3048 *" $deplib "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3049 *) tmp_libs="$tmp_libs $deplib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3050 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3051 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3052 *) tmp_libs="$tmp_libs $deplib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3053 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3054 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3055 eval $var=\"$tmp_libs\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3056 done # for var
128cae6f3459 initial coding
carl
parents:
diff changeset
3057 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3058 # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
128cae6f3459 initial coding
carl
parents:
diff changeset
3059 tmp_libs=
128cae6f3459 initial coding
carl
parents:
diff changeset
3060 for i in $dependency_libs ; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3061 case " $predeps $postdeps $compiler_lib_search_path " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3062 *" $i "*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3063 i=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3064 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3065 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3066 if test -n "$i" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3067 tmp_libs="$tmp_libs $i"
128cae6f3459 initial coding
carl
parents:
diff changeset
3068 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3069 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3070 dependency_libs=$tmp_libs
128cae6f3459 initial coding
carl
parents:
diff changeset
3071 done # for pass
128cae6f3459 initial coding
carl
parents:
diff changeset
3072 if test "$linkmode" = prog; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3073 dlfiles="$newdlfiles"
128cae6f3459 initial coding
carl
parents:
diff changeset
3074 dlprefiles="$newdlprefiles"
128cae6f3459 initial coding
carl
parents:
diff changeset
3075 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3076
128cae6f3459 initial coding
carl
parents:
diff changeset
3077 case $linkmode in
128cae6f3459 initial coding
carl
parents:
diff changeset
3078 oldlib)
128cae6f3459 initial coding
carl
parents:
diff changeset
3079 if test -n "$deplibs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3080 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3081 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3082
128cae6f3459 initial coding
carl
parents:
diff changeset
3083 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3084 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3085 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3086
128cae6f3459 initial coding
carl
parents:
diff changeset
3087 if test -n "$rpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3088 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3089 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3090
128cae6f3459 initial coding
carl
parents:
diff changeset
3091 if test -n "$xrpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3092 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3093 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3094
128cae6f3459 initial coding
carl
parents:
diff changeset
3095 if test -n "$vinfo"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3096 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3097 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3098
128cae6f3459 initial coding
carl
parents:
diff changeset
3099 if test -n "$release"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3100 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3101 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3102
128cae6f3459 initial coding
carl
parents:
diff changeset
3103 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3104 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3105 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3106
128cae6f3459 initial coding
carl
parents:
diff changeset
3107 # Now set the variables for building old libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
3108 build_libtool_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
3109 oldlibs="$output"
128cae6f3459 initial coding
carl
parents:
diff changeset
3110 objs="$objs$old_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3111 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3112
128cae6f3459 initial coding
carl
parents:
diff changeset
3113 lib)
128cae6f3459 initial coding
carl
parents:
diff changeset
3114 # Make sure we only generate libraries of the form `libNAME.la'.
128cae6f3459 initial coding
carl
parents:
diff changeset
3115 case $outputname in
128cae6f3459 initial coding
carl
parents:
diff changeset
3116 lib*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3117 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3118 eval shared_ext=\"$shrext\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3119 eval libname=\"$libname_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3120 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3121 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3122 if test "$module" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3123 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3124 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3125 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
3126 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3127 if test "$need_lib_prefix" != no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3128 # Add the "lib" prefix for modules if required
128cae6f3459 initial coding
carl
parents:
diff changeset
3129 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3130 eval shared_ext=\"$shrext\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3131 eval libname=\"$libname_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3132 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3133 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3134 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3135 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3136 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3137
128cae6f3459 initial coding
carl
parents:
diff changeset
3138 if test -n "$objs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3139 if test "$deplibs_check_method" != pass_all; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3140 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
128cae6f3459 initial coding
carl
parents:
diff changeset
3141 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
3142 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3143 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3144 $echo "*** Warning: Linking the shared library $output against the non-libtool"
128cae6f3459 initial coding
carl
parents:
diff changeset
3145 $echo "*** objects $objs is not portable!"
128cae6f3459 initial coding
carl
parents:
diff changeset
3146 libobjs="$libobjs $objs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3147 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3148 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3149
128cae6f3459 initial coding
carl
parents:
diff changeset
3150 if test "$dlself" != no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3151 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3152 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3153
128cae6f3459 initial coding
carl
parents:
diff changeset
3154 set dummy $rpath
128cae6f3459 initial coding
carl
parents:
diff changeset
3155 if test "$#" -gt 2; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3156 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3157 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3158 install_libdir="$2"
128cae6f3459 initial coding
carl
parents:
diff changeset
3159
128cae6f3459 initial coding
carl
parents:
diff changeset
3160 oldlibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
3161 if test -z "$rpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3162 if test "$build_libtool_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3163 # Building a libtool convenience library.
128cae6f3459 initial coding
carl
parents:
diff changeset
3164 # Some compilers have problems with a `.al' extension so
128cae6f3459 initial coding
carl
parents:
diff changeset
3165 # convenience libraries should have the same extension an
128cae6f3459 initial coding
carl
parents:
diff changeset
3166 # archive normally would.
128cae6f3459 initial coding
carl
parents:
diff changeset
3167 oldlibs="$output_objdir/$libname.$libext $oldlibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3168 build_libtool_libs=convenience
128cae6f3459 initial coding
carl
parents:
diff changeset
3169 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3170 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3171
128cae6f3459 initial coding
carl
parents:
diff changeset
3172 if test -n "$vinfo"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3173 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3174 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3175
128cae6f3459 initial coding
carl
parents:
diff changeset
3176 if test -n "$release"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3177 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3178 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3179 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3180
128cae6f3459 initial coding
carl
parents:
diff changeset
3181 # Parse the version information argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
3182 save_ifs="$IFS"; IFS=':'
128cae6f3459 initial coding
carl
parents:
diff changeset
3183 set dummy $vinfo 0 0 0
128cae6f3459 initial coding
carl
parents:
diff changeset
3184 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3185
128cae6f3459 initial coding
carl
parents:
diff changeset
3186 if test -n "$8"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3187 $echo "$modename: too many parameters to \`-version-info'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3188 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3189 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
3190 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3191
128cae6f3459 initial coding
carl
parents:
diff changeset
3192 # convert absolute version numbers to libtool ages
128cae6f3459 initial coding
carl
parents:
diff changeset
3193 # this retains compatibility with .la files and attempts
128cae6f3459 initial coding
carl
parents:
diff changeset
3194 # to make the code below a bit more comprehensible
128cae6f3459 initial coding
carl
parents:
diff changeset
3195
128cae6f3459 initial coding
carl
parents:
diff changeset
3196 case $vinfo_number in
128cae6f3459 initial coding
carl
parents:
diff changeset
3197 yes)
128cae6f3459 initial coding
carl
parents:
diff changeset
3198 number_major="$2"
128cae6f3459 initial coding
carl
parents:
diff changeset
3199 number_minor="$3"
128cae6f3459 initial coding
carl
parents:
diff changeset
3200 number_revision="$4"
128cae6f3459 initial coding
carl
parents:
diff changeset
3201 #
128cae6f3459 initial coding
carl
parents:
diff changeset
3202 # There are really only two kinds -- those that
128cae6f3459 initial coding
carl
parents:
diff changeset
3203 # use the current revision as the major version
128cae6f3459 initial coding
carl
parents:
diff changeset
3204 # and those that subtract age and use age as
128cae6f3459 initial coding
carl
parents:
diff changeset
3205 # a minor version. But, then there is irix
128cae6f3459 initial coding
carl
parents:
diff changeset
3206 # which has an extra 1 added just for fun
128cae6f3459 initial coding
carl
parents:
diff changeset
3207 #
128cae6f3459 initial coding
carl
parents:
diff changeset
3208 case $version_type in
128cae6f3459 initial coding
carl
parents:
diff changeset
3209 darwin|linux|osf|windows)
128cae6f3459 initial coding
carl
parents:
diff changeset
3210 current=`expr $number_major + $number_minor`
128cae6f3459 initial coding
carl
parents:
diff changeset
3211 age="$number_minor"
128cae6f3459 initial coding
carl
parents:
diff changeset
3212 revision="$number_revision"
128cae6f3459 initial coding
carl
parents:
diff changeset
3213 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3214 freebsd-aout|freebsd-elf|sunos)
128cae6f3459 initial coding
carl
parents:
diff changeset
3215 current="$number_major"
128cae6f3459 initial coding
carl
parents:
diff changeset
3216 revision="$number_minor"
128cae6f3459 initial coding
carl
parents:
diff changeset
3217 age="0"
128cae6f3459 initial coding
carl
parents:
diff changeset
3218 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3219 irix|nonstopux)
128cae6f3459 initial coding
carl
parents:
diff changeset
3220 current=`expr $number_major + $number_minor - 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
3221 age="$number_minor"
128cae6f3459 initial coding
carl
parents:
diff changeset
3222 revision="$number_minor"
128cae6f3459 initial coding
carl
parents:
diff changeset
3223 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3224 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3225 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3226 no)
128cae6f3459 initial coding
carl
parents:
diff changeset
3227 current="$2"
128cae6f3459 initial coding
carl
parents:
diff changeset
3228 revision="$3"
128cae6f3459 initial coding
carl
parents:
diff changeset
3229 age="$4"
128cae6f3459 initial coding
carl
parents:
diff changeset
3230 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3231 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3232
128cae6f3459 initial coding
carl
parents:
diff changeset
3233 # Check that each of the things are valid numbers.
128cae6f3459 initial coding
carl
parents:
diff changeset
3234 case $current in
128cae6f3459 initial coding
carl
parents:
diff changeset
3235 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3236 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3237 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3238 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3239 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
3240 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3241 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3242
128cae6f3459 initial coding
carl
parents:
diff changeset
3243 case $revision in
128cae6f3459 initial coding
carl
parents:
diff changeset
3244 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3245 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3246 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3247 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3248 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
3249 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3250 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3251
128cae6f3459 initial coding
carl
parents:
diff changeset
3252 case $age in
128cae6f3459 initial coding
carl
parents:
diff changeset
3253 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3254 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3255 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3256 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3257 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
3258 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3259 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3260
128cae6f3459 initial coding
carl
parents:
diff changeset
3261 if test "$age" -gt "$current"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3262 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3263 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3264 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
3265 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3266
128cae6f3459 initial coding
carl
parents:
diff changeset
3267 # Calculate the version variables.
128cae6f3459 initial coding
carl
parents:
diff changeset
3268 major=
128cae6f3459 initial coding
carl
parents:
diff changeset
3269 versuffix=
128cae6f3459 initial coding
carl
parents:
diff changeset
3270 verstring=
128cae6f3459 initial coding
carl
parents:
diff changeset
3271 case $version_type in
128cae6f3459 initial coding
carl
parents:
diff changeset
3272 none) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3273
128cae6f3459 initial coding
carl
parents:
diff changeset
3274 darwin)
128cae6f3459 initial coding
carl
parents:
diff changeset
3275 # Like Linux, but with the current version available in
128cae6f3459 initial coding
carl
parents:
diff changeset
3276 # verstring for coding it into the library header
128cae6f3459 initial coding
carl
parents:
diff changeset
3277 major=.`expr $current - $age`
128cae6f3459 initial coding
carl
parents:
diff changeset
3278 versuffix="$major.$age.$revision"
128cae6f3459 initial coding
carl
parents:
diff changeset
3279 # Darwin ld doesn't like 0 for these options...
128cae6f3459 initial coding
carl
parents:
diff changeset
3280 minor_current=`expr $current + 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
3281 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
128cae6f3459 initial coding
carl
parents:
diff changeset
3282 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3283
128cae6f3459 initial coding
carl
parents:
diff changeset
3284 freebsd-aout)
128cae6f3459 initial coding
carl
parents:
diff changeset
3285 major=".$current"
128cae6f3459 initial coding
carl
parents:
diff changeset
3286 versuffix=".$current.$revision";
128cae6f3459 initial coding
carl
parents:
diff changeset
3287 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3288
128cae6f3459 initial coding
carl
parents:
diff changeset
3289 freebsd-elf)
128cae6f3459 initial coding
carl
parents:
diff changeset
3290 major=".$current"
128cae6f3459 initial coding
carl
parents:
diff changeset
3291 versuffix=".$current";
128cae6f3459 initial coding
carl
parents:
diff changeset
3292 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3293
128cae6f3459 initial coding
carl
parents:
diff changeset
3294 irix | nonstopux)
128cae6f3459 initial coding
carl
parents:
diff changeset
3295 major=`expr $current - $age + 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
3296
128cae6f3459 initial coding
carl
parents:
diff changeset
3297 case $version_type in
128cae6f3459 initial coding
carl
parents:
diff changeset
3298 nonstopux) verstring_prefix=nonstopux ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3299 *) verstring_prefix=sgi ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3300 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3301 verstring="$verstring_prefix$major.$revision"
128cae6f3459 initial coding
carl
parents:
diff changeset
3302
128cae6f3459 initial coding
carl
parents:
diff changeset
3303 # Add in all the interfaces that we are compatible with.
128cae6f3459 initial coding
carl
parents:
diff changeset
3304 loop=$revision
128cae6f3459 initial coding
carl
parents:
diff changeset
3305 while test "$loop" -ne 0; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3306 iface=`expr $revision - $loop`
128cae6f3459 initial coding
carl
parents:
diff changeset
3307 loop=`expr $loop - 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
3308 verstring="$verstring_prefix$major.$iface:$verstring"
128cae6f3459 initial coding
carl
parents:
diff changeset
3309 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3310
128cae6f3459 initial coding
carl
parents:
diff changeset
3311 # Before this point, $major must not contain `.'.
128cae6f3459 initial coding
carl
parents:
diff changeset
3312 major=.$major
128cae6f3459 initial coding
carl
parents:
diff changeset
3313 versuffix="$major.$revision"
128cae6f3459 initial coding
carl
parents:
diff changeset
3314 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3315
128cae6f3459 initial coding
carl
parents:
diff changeset
3316 linux)
128cae6f3459 initial coding
carl
parents:
diff changeset
3317 major=.`expr $current - $age`
128cae6f3459 initial coding
carl
parents:
diff changeset
3318 versuffix="$major.$age.$revision"
128cae6f3459 initial coding
carl
parents:
diff changeset
3319 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3320
128cae6f3459 initial coding
carl
parents:
diff changeset
3321 osf)
128cae6f3459 initial coding
carl
parents:
diff changeset
3322 major=.`expr $current - $age`
128cae6f3459 initial coding
carl
parents:
diff changeset
3323 versuffix=".$current.$age.$revision"
128cae6f3459 initial coding
carl
parents:
diff changeset
3324 verstring="$current.$age.$revision"
128cae6f3459 initial coding
carl
parents:
diff changeset
3325
128cae6f3459 initial coding
carl
parents:
diff changeset
3326 # Add in all the interfaces that we are compatible with.
128cae6f3459 initial coding
carl
parents:
diff changeset
3327 loop=$age
128cae6f3459 initial coding
carl
parents:
diff changeset
3328 while test "$loop" -ne 0; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3329 iface=`expr $current - $loop`
128cae6f3459 initial coding
carl
parents:
diff changeset
3330 loop=`expr $loop - 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
3331 verstring="$verstring:${iface}.0"
128cae6f3459 initial coding
carl
parents:
diff changeset
3332 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3333
128cae6f3459 initial coding
carl
parents:
diff changeset
3334 # Make executables depend on our current version.
128cae6f3459 initial coding
carl
parents:
diff changeset
3335 verstring="$verstring:${current}.0"
128cae6f3459 initial coding
carl
parents:
diff changeset
3336 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3337
128cae6f3459 initial coding
carl
parents:
diff changeset
3338 sunos)
128cae6f3459 initial coding
carl
parents:
diff changeset
3339 major=".$current"
128cae6f3459 initial coding
carl
parents:
diff changeset
3340 versuffix=".$current.$revision"
128cae6f3459 initial coding
carl
parents:
diff changeset
3341 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3342
128cae6f3459 initial coding
carl
parents:
diff changeset
3343 windows)
128cae6f3459 initial coding
carl
parents:
diff changeset
3344 # Use '-' rather than '.', since we only want one
128cae6f3459 initial coding
carl
parents:
diff changeset
3345 # extension on DOS 8.3 filesystems.
128cae6f3459 initial coding
carl
parents:
diff changeset
3346 major=`expr $current - $age`
128cae6f3459 initial coding
carl
parents:
diff changeset
3347 versuffix="-$major"
128cae6f3459 initial coding
carl
parents:
diff changeset
3348 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3349
128cae6f3459 initial coding
carl
parents:
diff changeset
3350 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3351 $echo "$modename: unknown library version type \`$version_type'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3352 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3353 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
3354 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3355 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3356
128cae6f3459 initial coding
carl
parents:
diff changeset
3357 # Clear the version info if we defaulted, and they specified a release.
128cae6f3459 initial coding
carl
parents:
diff changeset
3358 if test -z "$vinfo" && test -n "$release"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3359 major=
128cae6f3459 initial coding
carl
parents:
diff changeset
3360 case $version_type in
128cae6f3459 initial coding
carl
parents:
diff changeset
3361 darwin)
128cae6f3459 initial coding
carl
parents:
diff changeset
3362 # we can't check for "0.0" in archive_cmds due to quoting
128cae6f3459 initial coding
carl
parents:
diff changeset
3363 # problems, so we reset it completely
128cae6f3459 initial coding
carl
parents:
diff changeset
3364 verstring=
128cae6f3459 initial coding
carl
parents:
diff changeset
3365 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3366 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3367 verstring="0.0"
128cae6f3459 initial coding
carl
parents:
diff changeset
3368 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3369 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3370 if test "$need_version" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3371 versuffix=
128cae6f3459 initial coding
carl
parents:
diff changeset
3372 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3373 versuffix=".0.0"
128cae6f3459 initial coding
carl
parents:
diff changeset
3374 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3375 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3376
128cae6f3459 initial coding
carl
parents:
diff changeset
3377 # Remove version info from name if versioning should be avoided
128cae6f3459 initial coding
carl
parents:
diff changeset
3378 if test "$avoid_version" = yes && test "$need_version" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3379 major=
128cae6f3459 initial coding
carl
parents:
diff changeset
3380 versuffix=
128cae6f3459 initial coding
carl
parents:
diff changeset
3381 verstring=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3382 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3383
128cae6f3459 initial coding
carl
parents:
diff changeset
3384 # Check to see if the archive will have undefined symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
3385 if test "$allow_undefined" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3386 if test "$allow_undefined_flag" = unsupported; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3387 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
3388 build_libtool_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
3389 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3390 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3391 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3392 # Don't allow undefined symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
3393 allow_undefined_flag="$no_undefined_flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
3394 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3395 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3396
128cae6f3459 initial coding
carl
parents:
diff changeset
3397 if test "$mode" != relink; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3398 # Remove our outputs, but don't remove object files since they
128cae6f3459 initial coding
carl
parents:
diff changeset
3399 # may have been created when compiling PIC objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
3400 removelist=
128cae6f3459 initial coding
carl
parents:
diff changeset
3401 tempremovelist=`$echo "$output_objdir/*"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3402 for p in $tempremovelist; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3403 case $p in
128cae6f3459 initial coding
carl
parents:
diff changeset
3404 *.$objext)
128cae6f3459 initial coding
carl
parents:
diff changeset
3405 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3406 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3407 removelist="$removelist $p"
128cae6f3459 initial coding
carl
parents:
diff changeset
3408 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3409 *) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3410 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3411 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3412 if test -n "$removelist"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3413 $show "${rm}r $removelist"
128cae6f3459 initial coding
carl
parents:
diff changeset
3414 $run ${rm}r $removelist
128cae6f3459 initial coding
carl
parents:
diff changeset
3415 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3416 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3417
128cae6f3459 initial coding
carl
parents:
diff changeset
3418 # Now set the variables for building old libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
3419 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3420 oldlibs="$oldlibs $output_objdir/$libname.$libext"
128cae6f3459 initial coding
carl
parents:
diff changeset
3421
128cae6f3459 initial coding
carl
parents:
diff changeset
3422 # Transform .lo files to .o files.
128cae6f3459 initial coding
carl
parents:
diff changeset
3423 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
128cae6f3459 initial coding
carl
parents:
diff changeset
3424 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3425
128cae6f3459 initial coding
carl
parents:
diff changeset
3426 # Eliminate all temporary directories.
128cae6f3459 initial coding
carl
parents:
diff changeset
3427 for path in $notinst_path; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3428 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3429 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3430 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3431 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3432
128cae6f3459 initial coding
carl
parents:
diff changeset
3433 if test -n "$xrpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3434 # If the user specified any rpath flags, then add them.
128cae6f3459 initial coding
carl
parents:
diff changeset
3435 temp_xrpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
3436 for libdir in $xrpath; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3437 temp_xrpath="$temp_xrpath -R$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
3438 case "$finalize_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3439 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3440 *) finalize_rpath="$finalize_rpath $libdir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3441 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3442 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3443 if true || test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3444 dependency_libs="$temp_xrpath $dependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3445 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3446 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3447
128cae6f3459 initial coding
carl
parents:
diff changeset
3448 # Make sure dlfiles contains only unique files that won't be dlpreopened
128cae6f3459 initial coding
carl
parents:
diff changeset
3449 old_dlfiles="$dlfiles"
128cae6f3459 initial coding
carl
parents:
diff changeset
3450 dlfiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
3451 for lib in $old_dlfiles; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3452 case " $dlprefiles $dlfiles " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3453 *" $lib "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3454 *) dlfiles="$dlfiles $lib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3455 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3456 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3457
128cae6f3459 initial coding
carl
parents:
diff changeset
3458 # Make sure dlprefiles contains only unique files
128cae6f3459 initial coding
carl
parents:
diff changeset
3459 old_dlprefiles="$dlprefiles"
128cae6f3459 initial coding
carl
parents:
diff changeset
3460 dlprefiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
3461 for lib in $old_dlprefiles; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3462 case "$dlprefiles " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3463 *" $lib "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3464 *) dlprefiles="$dlprefiles $lib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3465 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3466 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3467
128cae6f3459 initial coding
carl
parents:
diff changeset
3468 if test "$build_libtool_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3469 if test -n "$rpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3470 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
3471 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3472 # these systems don't actually have a c library (as such)!
128cae6f3459 initial coding
carl
parents:
diff changeset
3473 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3474 *-*-rhapsody* | *-*-darwin1.[012])
128cae6f3459 initial coding
carl
parents:
diff changeset
3475 # Rhapsody C library is in the System framework
128cae6f3459 initial coding
carl
parents:
diff changeset
3476 deplibs="$deplibs -framework System"
128cae6f3459 initial coding
carl
parents:
diff changeset
3477 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3478 *-*-netbsd*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3479 # Don't link with libc until the a.out ld.so is fixed.
128cae6f3459 initial coding
carl
parents:
diff changeset
3480 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3481 *-*-freebsd*-gnu*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3482 # Prevent $arg from being parsed by the freebsd regexp below.
128cae6f3459 initial coding
carl
parents:
diff changeset
3483 if test "$build_libtool_need_lc" = "yes"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3484 deplibs="$deplibs -lc"
128cae6f3459 initial coding
carl
parents:
diff changeset
3485 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3486 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3487 *-*-openbsd* | *-*-freebsd*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3488 # Do not include libc due to us having libc/libc_r.
128cae6f3459 initial coding
carl
parents:
diff changeset
3489 test "X$arg" = "X-lc" && continue
128cae6f3459 initial coding
carl
parents:
diff changeset
3490 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3491 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3492 # Add libc to deplibs on all other systems if necessary.
128cae6f3459 initial coding
carl
parents:
diff changeset
3493 if test "$build_libtool_need_lc" = "yes"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3494 deplibs="$deplibs -lc"
128cae6f3459 initial coding
carl
parents:
diff changeset
3495 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3496 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3497 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3498 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3499
128cae6f3459 initial coding
carl
parents:
diff changeset
3500 # Transform deplibs into only deplibs that can be linked in shared.
128cae6f3459 initial coding
carl
parents:
diff changeset
3501 name_save=$name
128cae6f3459 initial coding
carl
parents:
diff changeset
3502 libname_save=$libname
128cae6f3459 initial coding
carl
parents:
diff changeset
3503 release_save=$release
128cae6f3459 initial coding
carl
parents:
diff changeset
3504 versuffix_save=$versuffix
128cae6f3459 initial coding
carl
parents:
diff changeset
3505 major_save=$major
128cae6f3459 initial coding
carl
parents:
diff changeset
3506 # I'm not sure if I'm treating the release correctly. I think
128cae6f3459 initial coding
carl
parents:
diff changeset
3507 # release should show up in the -l (ie -lgmp5) so we don't want to
128cae6f3459 initial coding
carl
parents:
diff changeset
3508 # add it in twice. Is that correct?
128cae6f3459 initial coding
carl
parents:
diff changeset
3509 release=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3510 versuffix=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3511 major=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3512 newdeplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
3513 droppeddeps=no
128cae6f3459 initial coding
carl
parents:
diff changeset
3514 case $deplibs_check_method in
128cae6f3459 initial coding
carl
parents:
diff changeset
3515 pass_all)
128cae6f3459 initial coding
carl
parents:
diff changeset
3516 # Don't check for shared/static. Everything works.
128cae6f3459 initial coding
carl
parents:
diff changeset
3517 # This might be a little naive. We might want to check
128cae6f3459 initial coding
carl
parents:
diff changeset
3518 # whether the library exists or not. But this is on
128cae6f3459 initial coding
carl
parents:
diff changeset
3519 # osf3 & osf4 and I'm not really sure... Just
128cae6f3459 initial coding
carl
parents:
diff changeset
3520 # implementing what was already the behavior.
128cae6f3459 initial coding
carl
parents:
diff changeset
3521 newdeplibs=$deplibs
128cae6f3459 initial coding
carl
parents:
diff changeset
3522 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3523 test_compile)
128cae6f3459 initial coding
carl
parents:
diff changeset
3524 # This code stresses the "libraries are programs" paradigm to its
128cae6f3459 initial coding
carl
parents:
diff changeset
3525 # limits. Maybe even breaks it. We compile a program, linking it
128cae6f3459 initial coding
carl
parents:
diff changeset
3526 # against the deplibs as a proxy for the library. Then we can check
128cae6f3459 initial coding
carl
parents:
diff changeset
3527 # whether they linked in statically or dynamically with ldd.
128cae6f3459 initial coding
carl
parents:
diff changeset
3528 $rm conftest.c
128cae6f3459 initial coding
carl
parents:
diff changeset
3529 cat > conftest.c <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
3530 int main() { return 0; }
128cae6f3459 initial coding
carl
parents:
diff changeset
3531 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
3532 $rm conftest
128cae6f3459 initial coding
carl
parents:
diff changeset
3533 $LTCC -o conftest conftest.c $deplibs
128cae6f3459 initial coding
carl
parents:
diff changeset
3534 if test "$?" -eq 0 ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3535 ldd_output=`ldd conftest`
128cae6f3459 initial coding
carl
parents:
diff changeset
3536 for i in $deplibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3537 name="`expr $i : '-l\(.*\)'`"
128cae6f3459 initial coding
carl
parents:
diff changeset
3538 # If $name is empty we are operating on a -L argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
3539 if test "$name" != "" && test "$name" -ne "0"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3540 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3541 case " $predeps $postdeps " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3542 *" $i "*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3543 newdeplibs="$newdeplibs $i"
128cae6f3459 initial coding
carl
parents:
diff changeset
3544 i=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3545 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3546 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3547 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3548 if test -n "$i" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3549 libname=`eval \\$echo \"$libname_spec\"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3550 deplib_matches=`eval \\$echo \"$library_names_spec\"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3551 set dummy $deplib_matches
128cae6f3459 initial coding
carl
parents:
diff changeset
3552 deplib_match=$2
128cae6f3459 initial coding
carl
parents:
diff changeset
3553 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3554 newdeplibs="$newdeplibs $i"
128cae6f3459 initial coding
carl
parents:
diff changeset
3555 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3556 droppeddeps=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3557 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3558 $echo "*** Warning: dynamic linker does not accept needed library $i."
128cae6f3459 initial coding
carl
parents:
diff changeset
3559 $echo "*** I have the capability to make that library automatically link in when"
128cae6f3459 initial coding
carl
parents:
diff changeset
3560 $echo "*** you link to this library. But I can only do this if you have a"
128cae6f3459 initial coding
carl
parents:
diff changeset
3561 $echo "*** shared version of the library, which I believe you do not have"
128cae6f3459 initial coding
carl
parents:
diff changeset
3562 $echo "*** because a test_compile did reveal that the linker did not use it for"
128cae6f3459 initial coding
carl
parents:
diff changeset
3563 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
128cae6f3459 initial coding
carl
parents:
diff changeset
3564 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3565 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3566 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3567 newdeplibs="$newdeplibs $i"
128cae6f3459 initial coding
carl
parents:
diff changeset
3568 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3569 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3570 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3571 # Error occurred in the first compile. Let's try to salvage
128cae6f3459 initial coding
carl
parents:
diff changeset
3572 # the situation: Compile a separate program for each library.
128cae6f3459 initial coding
carl
parents:
diff changeset
3573 for i in $deplibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3574 name="`expr $i : '-l\(.*\)'`"
128cae6f3459 initial coding
carl
parents:
diff changeset
3575 # If $name is empty we are operating on a -L argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
3576 if test "$name" != "" && test "$name" != "0"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3577 $rm conftest
128cae6f3459 initial coding
carl
parents:
diff changeset
3578 $LTCC -o conftest conftest.c $i
128cae6f3459 initial coding
carl
parents:
diff changeset
3579 # Did it work?
128cae6f3459 initial coding
carl
parents:
diff changeset
3580 if test "$?" -eq 0 ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3581 ldd_output=`ldd conftest`
128cae6f3459 initial coding
carl
parents:
diff changeset
3582 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3583 case " $predeps $postdeps " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3584 *" $i "*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3585 newdeplibs="$newdeplibs $i"
128cae6f3459 initial coding
carl
parents:
diff changeset
3586 i=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3587 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3588 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3589 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3590 if test -n "$i" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3591 libname=`eval \\$echo \"$libname_spec\"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3592 deplib_matches=`eval \\$echo \"$library_names_spec\"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3593 set dummy $deplib_matches
128cae6f3459 initial coding
carl
parents:
diff changeset
3594 deplib_match=$2
128cae6f3459 initial coding
carl
parents:
diff changeset
3595 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3596 newdeplibs="$newdeplibs $i"
128cae6f3459 initial coding
carl
parents:
diff changeset
3597 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3598 droppeddeps=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3599 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3600 $echo "*** Warning: dynamic linker does not accept needed library $i."
128cae6f3459 initial coding
carl
parents:
diff changeset
3601 $echo "*** I have the capability to make that library automatically link in when"
128cae6f3459 initial coding
carl
parents:
diff changeset
3602 $echo "*** you link to this library. But I can only do this if you have a"
128cae6f3459 initial coding
carl
parents:
diff changeset
3603 $echo "*** shared version of the library, which you do not appear to have"
128cae6f3459 initial coding
carl
parents:
diff changeset
3604 $echo "*** because a test_compile did reveal that the linker did not use this one"
128cae6f3459 initial coding
carl
parents:
diff changeset
3605 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
128cae6f3459 initial coding
carl
parents:
diff changeset
3606 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3607 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3608 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3609 droppeddeps=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3610 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3611 $echo "*** Warning! Library $i is needed by this library but I was not able to"
128cae6f3459 initial coding
carl
parents:
diff changeset
3612 $echo "*** make it link in! You will probably need to install it or some"
128cae6f3459 initial coding
carl
parents:
diff changeset
3613 $echo "*** library that it depends on before this library will be fully"
128cae6f3459 initial coding
carl
parents:
diff changeset
3614 $echo "*** functional. Installing it before continuing would be even better."
128cae6f3459 initial coding
carl
parents:
diff changeset
3615 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3616 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3617 newdeplibs="$newdeplibs $i"
128cae6f3459 initial coding
carl
parents:
diff changeset
3618 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3619 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3620 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3621 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3622 file_magic*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3623 set dummy $deplibs_check_method
128cae6f3459 initial coding
carl
parents:
diff changeset
3624 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3625 for a_deplib in $deplibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3626 name="`expr $a_deplib : '-l\(.*\)'`"
128cae6f3459 initial coding
carl
parents:
diff changeset
3627 # If $name is empty we are operating on a -L argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
3628 if test "$name" != "" && test "$name" != "0"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3629 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3630 case " $predeps $postdeps " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3631 *" $a_deplib "*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3632 newdeplibs="$newdeplibs $a_deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3633 a_deplib=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3634 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3635 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3636 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3637 if test -n "$a_deplib" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3638 libname=`eval \\$echo \"$libname_spec\"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3639 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3640 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
128cae6f3459 initial coding
carl
parents:
diff changeset
3641 for potent_lib in $potential_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3642 # Follow soft links.
128cae6f3459 initial coding
carl
parents:
diff changeset
3643 if ls -lLd "$potent_lib" 2>/dev/null \
128cae6f3459 initial coding
carl
parents:
diff changeset
3644 | grep " -> " >/dev/null; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3645 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
3646 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3647 # The statement above tries to avoid entering an
128cae6f3459 initial coding
carl
parents:
diff changeset
3648 # endless loop below, in case of cyclic links.
128cae6f3459 initial coding
carl
parents:
diff changeset
3649 # We might still enter an endless loop, since a link
128cae6f3459 initial coding
carl
parents:
diff changeset
3650 # loop can be closed while we follow links,
128cae6f3459 initial coding
carl
parents:
diff changeset
3651 # but so what?
128cae6f3459 initial coding
carl
parents:
diff changeset
3652 potlib="$potent_lib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3653 while test -h "$potlib" 2>/dev/null; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3654 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3655 case $potliblink in
128cae6f3459 initial coding
carl
parents:
diff changeset
3656 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
128cae6f3459 initial coding
carl
parents:
diff changeset
3657 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
128cae6f3459 initial coding
carl
parents:
diff changeset
3658 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3659 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3660 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
128cae6f3459 initial coding
carl
parents:
diff changeset
3661 | ${SED} 10q \
128cae6f3459 initial coding
carl
parents:
diff changeset
3662 | $EGREP "$file_magic_regex" > /dev/null; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3663 newdeplibs="$newdeplibs $a_deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3664 a_deplib=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3665 break 2
128cae6f3459 initial coding
carl
parents:
diff changeset
3666 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3667 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3668 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3669 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3670 if test -n "$a_deplib" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3671 droppeddeps=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3672 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3673 $echo "*** Warning: linker path does not have real file for library $a_deplib."
128cae6f3459 initial coding
carl
parents:
diff changeset
3674 $echo "*** I have the capability to make that library automatically link in when"
128cae6f3459 initial coding
carl
parents:
diff changeset
3675 $echo "*** you link to this library. But I can only do this if you have a"
128cae6f3459 initial coding
carl
parents:
diff changeset
3676 $echo "*** shared version of the library, which you do not appear to have"
128cae6f3459 initial coding
carl
parents:
diff changeset
3677 $echo "*** because I did check the linker path looking for a file starting"
128cae6f3459 initial coding
carl
parents:
diff changeset
3678 if test -z "$potlib" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3679 $echo "*** with $libname but no candidates were found. (...for file magic test)"
128cae6f3459 initial coding
carl
parents:
diff changeset
3680 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3681 $echo "*** with $libname and none of the candidates passed a file format test"
128cae6f3459 initial coding
carl
parents:
diff changeset
3682 $echo "*** using a file magic. Last file checked: $potlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3683 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3684 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3685 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3686 # Add a -L argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
3687 newdeplibs="$newdeplibs $a_deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3688 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3689 done # Gone through all deplibs.
128cae6f3459 initial coding
carl
parents:
diff changeset
3690 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3691 match_pattern*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3692 set dummy $deplibs_check_method
128cae6f3459 initial coding
carl
parents:
diff changeset
3693 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3694 for a_deplib in $deplibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3695 name="`expr $a_deplib : '-l\(.*\)'`"
128cae6f3459 initial coding
carl
parents:
diff changeset
3696 # If $name is empty we are operating on a -L argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
3697 if test -n "$name" && test "$name" != "0"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3698 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3699 case " $predeps $postdeps " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3700 *" $a_deplib "*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3701 newdeplibs="$newdeplibs $a_deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3702 a_deplib=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3703 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3704 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3705 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3706 if test -n "$a_deplib" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3707 libname=`eval \\$echo \"$libname_spec\"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3708 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3709 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
128cae6f3459 initial coding
carl
parents:
diff changeset
3710 for potent_lib in $potential_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3711 potlib="$potent_lib" # see symlink-check above in file_magic test
128cae6f3459 initial coding
carl
parents:
diff changeset
3712 if eval $echo \"$potent_lib\" 2>/dev/null \
128cae6f3459 initial coding
carl
parents:
diff changeset
3713 | ${SED} 10q \
128cae6f3459 initial coding
carl
parents:
diff changeset
3714 | $EGREP "$match_pattern_regex" > /dev/null; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3715 newdeplibs="$newdeplibs $a_deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3716 a_deplib=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3717 break 2
128cae6f3459 initial coding
carl
parents:
diff changeset
3718 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3719 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3720 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3721 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3722 if test -n "$a_deplib" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3723 droppeddeps=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3724 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3725 $echo "*** Warning: linker path does not have real file for library $a_deplib."
128cae6f3459 initial coding
carl
parents:
diff changeset
3726 $echo "*** I have the capability to make that library automatically link in when"
128cae6f3459 initial coding
carl
parents:
diff changeset
3727 $echo "*** you link to this library. But I can only do this if you have a"
128cae6f3459 initial coding
carl
parents:
diff changeset
3728 $echo "*** shared version of the library, which you do not appear to have"
128cae6f3459 initial coding
carl
parents:
diff changeset
3729 $echo "*** because I did check the linker path looking for a file starting"
128cae6f3459 initial coding
carl
parents:
diff changeset
3730 if test -z "$potlib" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3731 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
128cae6f3459 initial coding
carl
parents:
diff changeset
3732 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3733 $echo "*** with $libname and none of the candidates passed a file format test"
128cae6f3459 initial coding
carl
parents:
diff changeset
3734 $echo "*** using a regex pattern. Last file checked: $potlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3735 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3736 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3737 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3738 # Add a -L argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
3739 newdeplibs="$newdeplibs $a_deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3740 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3741 done # Gone through all deplibs.
128cae6f3459 initial coding
carl
parents:
diff changeset
3742 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3743 none | unknown | *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3744 newdeplibs=""
128cae6f3459 initial coding
carl
parents:
diff changeset
3745 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
128cae6f3459 initial coding
carl
parents:
diff changeset
3746 -e 's/ -[LR][^ ]*//g'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3747 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3748 for i in $predeps $postdeps ; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3749 # can't use Xsed below, because $i might contain '/'
128cae6f3459 initial coding
carl
parents:
diff changeset
3750 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
128cae6f3459 initial coding
carl
parents:
diff changeset
3751 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3752 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3753 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
128cae6f3459 initial coding
carl
parents:
diff changeset
3754 | grep . >/dev/null; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3755 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3756 if test "X$deplibs_check_method" = "Xnone"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3757 $echo "*** Warning: inter-library dependencies are not supported in this platform."
128cae6f3459 initial coding
carl
parents:
diff changeset
3758 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3759 $echo "*** Warning: inter-library dependencies are not known to be supported."
128cae6f3459 initial coding
carl
parents:
diff changeset
3760 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3761 $echo "*** All declared inter-library dependencies are being dropped."
128cae6f3459 initial coding
carl
parents:
diff changeset
3762 droppeddeps=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3763 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3764 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3765 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3766 versuffix=$versuffix_save
128cae6f3459 initial coding
carl
parents:
diff changeset
3767 major=$major_save
128cae6f3459 initial coding
carl
parents:
diff changeset
3768 release=$release_save
128cae6f3459 initial coding
carl
parents:
diff changeset
3769 libname=$libname_save
128cae6f3459 initial coding
carl
parents:
diff changeset
3770 name=$name_save
128cae6f3459 initial coding
carl
parents:
diff changeset
3771
128cae6f3459 initial coding
carl
parents:
diff changeset
3772 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
3773 *-*-rhapsody* | *-*-darwin1.[012])
128cae6f3459 initial coding
carl
parents:
diff changeset
3774 # On Rhapsody replace the C library is the System framework
128cae6f3459 initial coding
carl
parents:
diff changeset
3775 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3776 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3777 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3778
128cae6f3459 initial coding
carl
parents:
diff changeset
3779 if test "$droppeddeps" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3780 if test "$module" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3781 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3782 $echo "*** Warning: libtool could not satisfy all declared inter-library"
128cae6f3459 initial coding
carl
parents:
diff changeset
3783 $echo "*** dependencies of module $libname. Therefore, libtool will create"
128cae6f3459 initial coding
carl
parents:
diff changeset
3784 $echo "*** a static module, that should work as long as the dlopening"
128cae6f3459 initial coding
carl
parents:
diff changeset
3785 $echo "*** application is linked with the -dlopen flag."
128cae6f3459 initial coding
carl
parents:
diff changeset
3786 if test -z "$global_symbol_pipe"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3787 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3788 $echo "*** However, this would only work if libtool was able to extract symbol"
128cae6f3459 initial coding
carl
parents:
diff changeset
3789 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
128cae6f3459 initial coding
carl
parents:
diff changeset
3790 $echo "*** not find such a program. So, this module is probably useless."
128cae6f3459 initial coding
carl
parents:
diff changeset
3791 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
128cae6f3459 initial coding
carl
parents:
diff changeset
3792 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3793 if test "$build_old_libs" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3794 oldlibs="$output_objdir/$libname.$libext"
128cae6f3459 initial coding
carl
parents:
diff changeset
3795 build_libtool_libs=module
128cae6f3459 initial coding
carl
parents:
diff changeset
3796 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3797 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3798 build_libtool_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
3799 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3800 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3801 $echo "*** The inter-library dependencies that have been dropped here will be"
128cae6f3459 initial coding
carl
parents:
diff changeset
3802 $echo "*** automatically added whenever a program is linked with this library"
128cae6f3459 initial coding
carl
parents:
diff changeset
3803 $echo "*** or is declared to -dlopen it."
128cae6f3459 initial coding
carl
parents:
diff changeset
3804
128cae6f3459 initial coding
carl
parents:
diff changeset
3805 if test "$allow_undefined" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3806 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
3807 $echo "*** Since this library must not contain undefined symbols,"
128cae6f3459 initial coding
carl
parents:
diff changeset
3808 $echo "*** because either the platform does not support them or"
128cae6f3459 initial coding
carl
parents:
diff changeset
3809 $echo "*** it was explicitly requested with -no-undefined,"
128cae6f3459 initial coding
carl
parents:
diff changeset
3810 $echo "*** libtool will only create a static version of it."
128cae6f3459 initial coding
carl
parents:
diff changeset
3811 if test "$build_old_libs" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3812 oldlibs="$output_objdir/$libname.$libext"
128cae6f3459 initial coding
carl
parents:
diff changeset
3813 build_libtool_libs=module
128cae6f3459 initial coding
carl
parents:
diff changeset
3814 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
3815 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3816 build_libtool_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
3817 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3818 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3819 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3820 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3821 # Done checking deplibs!
128cae6f3459 initial coding
carl
parents:
diff changeset
3822 deplibs=$newdeplibs
128cae6f3459 initial coding
carl
parents:
diff changeset
3823 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3824
128cae6f3459 initial coding
carl
parents:
diff changeset
3825 # All the library-specific variables (install_libdir is set above).
128cae6f3459 initial coding
carl
parents:
diff changeset
3826 library_names=
128cae6f3459 initial coding
carl
parents:
diff changeset
3827 old_library=
128cae6f3459 initial coding
carl
parents:
diff changeset
3828 dlname=
128cae6f3459 initial coding
carl
parents:
diff changeset
3829
128cae6f3459 initial coding
carl
parents:
diff changeset
3830 # Test again, we may have decided not to build it any more
128cae6f3459 initial coding
carl
parents:
diff changeset
3831 if test "$build_libtool_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3832 if test "$hardcode_into_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3833 # Hardcode the library paths
128cae6f3459 initial coding
carl
parents:
diff changeset
3834 hardcode_libdirs=
128cae6f3459 initial coding
carl
parents:
diff changeset
3835 dep_rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
3836 rpath="$finalize_rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
3837 test "$mode" != relink && test "$fast_install" = no && rpath="$compile_rpath$rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
3838 for libdir in $rpath; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3839 if test -n "$hardcode_libdir_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3840 if test -n "$hardcode_libdir_separator"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3841 if test -z "$hardcode_libdirs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3842 hardcode_libdirs="$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
3843 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3844 # Just accumulate the unique libdirs.
128cae6f3459 initial coding
carl
parents:
diff changeset
3845 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
128cae6f3459 initial coding
carl
parents:
diff changeset
3846 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
128cae6f3459 initial coding
carl
parents:
diff changeset
3847 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3848 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3849 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
3850 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3851 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3852 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3853 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3854 eval flag=\"$hardcode_libdir_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3855 dep_rpath="$dep_rpath $flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
3856 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3857 elif test -n "$runpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3858 case "$perm_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3859 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3860 *) perm_rpath="$perm_rpath $libdir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3861 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3862 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3863 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3864 # Substitute the hardcoded libdirs into the rpath.
128cae6f3459 initial coding
carl
parents:
diff changeset
3865 if test -n "$hardcode_libdir_separator" &&
128cae6f3459 initial coding
carl
parents:
diff changeset
3866 test -n "$hardcode_libdirs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3867 libdir="$hardcode_libdirs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3868 if test -n "$hardcode_libdir_flag_spec_ld"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3869 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3870 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3871 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3872 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3873 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3874 if test -n "$runpath_var" && test -n "$perm_rpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3875 # We should set the runpath_var.
128cae6f3459 initial coding
carl
parents:
diff changeset
3876 rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
3877 for dir in $perm_rpath; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3878 rpath="$rpath$dir:"
128cae6f3459 initial coding
carl
parents:
diff changeset
3879 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3880 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
128cae6f3459 initial coding
carl
parents:
diff changeset
3881 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3882 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3883 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3884
128cae6f3459 initial coding
carl
parents:
diff changeset
3885 shlibpath="$finalize_shlibpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
3886 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
3887 if test -n "$shlibpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3888 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
128cae6f3459 initial coding
carl
parents:
diff changeset
3889 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3890
128cae6f3459 initial coding
carl
parents:
diff changeset
3891 # Get the real and link names of the library.
128cae6f3459 initial coding
carl
parents:
diff changeset
3892 eval shared_ext=\"$shrext\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3893 eval library_names=\"$library_names_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3894 set dummy $library_names
128cae6f3459 initial coding
carl
parents:
diff changeset
3895 realname="$2"
128cae6f3459 initial coding
carl
parents:
diff changeset
3896 shift; shift
128cae6f3459 initial coding
carl
parents:
diff changeset
3897
128cae6f3459 initial coding
carl
parents:
diff changeset
3898 if test -n "$soname_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3899 eval soname=\"$soname_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3900 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3901 soname="$realname"
128cae6f3459 initial coding
carl
parents:
diff changeset
3902 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3903 if test -z "$dlname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3904 dlname=$soname
128cae6f3459 initial coding
carl
parents:
diff changeset
3905 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3906
128cae6f3459 initial coding
carl
parents:
diff changeset
3907 lib="$output_objdir/$realname"
128cae6f3459 initial coding
carl
parents:
diff changeset
3908 for link
128cae6f3459 initial coding
carl
parents:
diff changeset
3909 do
128cae6f3459 initial coding
carl
parents:
diff changeset
3910 linknames="$linknames $link"
128cae6f3459 initial coding
carl
parents:
diff changeset
3911 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3912
128cae6f3459 initial coding
carl
parents:
diff changeset
3913 # Use standard objects if they are pic
128cae6f3459 initial coding
carl
parents:
diff changeset
3914 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
128cae6f3459 initial coding
carl
parents:
diff changeset
3915
128cae6f3459 initial coding
carl
parents:
diff changeset
3916 # Prepare the list of exported symbols
128cae6f3459 initial coding
carl
parents:
diff changeset
3917 if test -z "$export_symbols"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3918 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3919 $show "generating symbol list for \`$libname.la'"
128cae6f3459 initial coding
carl
parents:
diff changeset
3920 export_symbols="$output_objdir/$libname.exp"
128cae6f3459 initial coding
carl
parents:
diff changeset
3921 $run $rm $export_symbols
128cae6f3459 initial coding
carl
parents:
diff changeset
3922 eval cmds=\"$export_symbols_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3923 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
3924 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3925 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3926 if len=`expr "X$cmd" : ".*"` &&
128cae6f3459 initial coding
carl
parents:
diff changeset
3927 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3928 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
3929 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
3930 skipped_export=false
128cae6f3459 initial coding
carl
parents:
diff changeset
3931 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3932 # The command line is too long to execute in one step.
128cae6f3459 initial coding
carl
parents:
diff changeset
3933 $show "using reloadable object file for export list..."
128cae6f3459 initial coding
carl
parents:
diff changeset
3934 skipped_export=:
128cae6f3459 initial coding
carl
parents:
diff changeset
3935 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3936 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3937 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3938 if test -n "$export_symbols_regex"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3939 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
128cae6f3459 initial coding
carl
parents:
diff changeset
3940 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
128cae6f3459 initial coding
carl
parents:
diff changeset
3941 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
128cae6f3459 initial coding
carl
parents:
diff changeset
3942 $run eval '$mv "${export_symbols}T" "$export_symbols"'
128cae6f3459 initial coding
carl
parents:
diff changeset
3943 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3944 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3945 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3946
128cae6f3459 initial coding
carl
parents:
diff changeset
3947 if test -n "$export_symbols" && test -n "$include_expsyms"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3948 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
128cae6f3459 initial coding
carl
parents:
diff changeset
3949 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3950
128cae6f3459 initial coding
carl
parents:
diff changeset
3951 tmp_deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
3952 for test_deplib in $deplibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3953 case " $convenience " in
128cae6f3459 initial coding
carl
parents:
diff changeset
3954 *" $test_deplib "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3955 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
3956 tmp_deplibs="$tmp_deplibs $test_deplib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3957 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3958 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3959 done
128cae6f3459 initial coding
carl
parents:
diff changeset
3960 deplibs="$tmp_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
3961
128cae6f3459 initial coding
carl
parents:
diff changeset
3962 if test -n "$convenience"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3963 if test -n "$whole_archive_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3964 save_libobjs=$libobjs
128cae6f3459 initial coding
carl
parents:
diff changeset
3965 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
3966 else
128cae6f3459 initial coding
carl
parents:
diff changeset
3967 gentop="$output_objdir/${outputname}x"
128cae6f3459 initial coding
carl
parents:
diff changeset
3968 $show "${rm}r $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
3969 $run ${rm}r "$gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
3970 $show "$mkdir $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
3971 $run $mkdir "$gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
3972 status=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
3973 if test "$status" -ne 0 && test ! -d "$gentop"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3974 exit $status
128cae6f3459 initial coding
carl
parents:
diff changeset
3975 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3976 generated="$generated $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
3977
128cae6f3459 initial coding
carl
parents:
diff changeset
3978 for xlib in $convenience; do
128cae6f3459 initial coding
carl
parents:
diff changeset
3979 # Extract the objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
3980 case $xlib in
128cae6f3459 initial coding
carl
parents:
diff changeset
3981 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3982 *) xabs=`pwd`"/$xlib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
3983 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
3984 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
3985 xdir="$gentop/$xlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
3986
128cae6f3459 initial coding
carl
parents:
diff changeset
3987 $show "${rm}r $xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
3988 $run ${rm}r "$xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
3989 $show "$mkdir $xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
3990 $run $mkdir "$xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
3991 status=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
3992 if test "$status" -ne 0 && test ! -d "$xdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
3993 exit $status
128cae6f3459 initial coding
carl
parents:
diff changeset
3994 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
3995 # We will extract separately just the conflicting names and we will no
128cae6f3459 initial coding
carl
parents:
diff changeset
3996 # longer touch any unique names. It is faster to leave these extract
128cae6f3459 initial coding
carl
parents:
diff changeset
3997 # automatically by $AR in one run.
128cae6f3459 initial coding
carl
parents:
diff changeset
3998 $show "(cd $xdir && $AR x $xabs)"
128cae6f3459 initial coding
carl
parents:
diff changeset
3999 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4000 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
128cae6f3459 initial coding
carl
parents:
diff changeset
4001 :
128cae6f3459 initial coding
carl
parents:
diff changeset
4002 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4003 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4004 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4005 $AR t "$xabs" | sort | uniq -cd | while read -r count name
128cae6f3459 initial coding
carl
parents:
diff changeset
4006 do
128cae6f3459 initial coding
carl
parents:
diff changeset
4007 i=1
128cae6f3459 initial coding
carl
parents:
diff changeset
4008 while test "$i" -le "$count"
128cae6f3459 initial coding
carl
parents:
diff changeset
4009 do
128cae6f3459 initial coding
carl
parents:
diff changeset
4010 # Put our $i before any first dot (extension)
128cae6f3459 initial coding
carl
parents:
diff changeset
4011 # Never overwrite any file
128cae6f3459 initial coding
carl
parents:
diff changeset
4012 name_to="$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
4013 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
128cae6f3459 initial coding
carl
parents:
diff changeset
4014 do
128cae6f3459 initial coding
carl
parents:
diff changeset
4015 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4016 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4017 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
128cae6f3459 initial coding
carl
parents:
diff changeset
4018 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4019 i=`expr $i + 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
4020 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4021 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4022 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4023
128cae6f3459 initial coding
carl
parents:
diff changeset
4024 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
128cae6f3459 initial coding
carl
parents:
diff changeset
4025 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4026 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4027 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4028
128cae6f3459 initial coding
carl
parents:
diff changeset
4029 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4030 eval flag=\"$thread_safe_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4031 linker_flags="$linker_flags $flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
4032 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4033
128cae6f3459 initial coding
carl
parents:
diff changeset
4034 # Make a backup of the uninstalled library when relinking
128cae6f3459 initial coding
carl
parents:
diff changeset
4035 if test "$mode" = relink; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4036 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4037 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4038
128cae6f3459 initial coding
carl
parents:
diff changeset
4039 # Add all flags from the command line. We here create a library,
128cae6f3459 initial coding
carl
parents:
diff changeset
4040 # but those flags were only added to compile_command and
128cae6f3459 initial coding
carl
parents:
diff changeset
4041 # finalize_command, which are only used when creating executables.
128cae6f3459 initial coding
carl
parents:
diff changeset
4042 # So do it by hand here.
128cae6f3459 initial coding
carl
parents:
diff changeset
4043 compiler_flags="$compiler_flags $add_flags"
128cae6f3459 initial coding
carl
parents:
diff changeset
4044 # Only add it to commands which use CC, instead of LD, i.e.
128cae6f3459 initial coding
carl
parents:
diff changeset
4045 # only to $compiler_flags
128cae6f3459 initial coding
carl
parents:
diff changeset
4046 #linker_flags="$linker_flags $add_flags"
128cae6f3459 initial coding
carl
parents:
diff changeset
4047
128cae6f3459 initial coding
carl
parents:
diff changeset
4048 # Do each of the archive commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
4049 if test "$module" = yes && test -n "$module_cmds" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4050 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4051 eval cmds=\"$module_expsym_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4052 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4053 eval cmds=\"$module_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4054 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4055 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4056 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4057 eval cmds=\"$archive_expsym_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4058 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4059 eval cmds=\"$archive_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4060 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4061 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4062
128cae6f3459 initial coding
carl
parents:
diff changeset
4063 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
128cae6f3459 initial coding
carl
parents:
diff changeset
4064 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4065 :
128cae6f3459 initial coding
carl
parents:
diff changeset
4066 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4067 # The command line is too long to link in one step, link piecewise.
128cae6f3459 initial coding
carl
parents:
diff changeset
4068 $echo "creating reloadable object files..."
128cae6f3459 initial coding
carl
parents:
diff changeset
4069
128cae6f3459 initial coding
carl
parents:
diff changeset
4070 # Save the value of $output and $libobjs because we want to
128cae6f3459 initial coding
carl
parents:
diff changeset
4071 # use them later. If we have whole_archive_flag_spec, we
128cae6f3459 initial coding
carl
parents:
diff changeset
4072 # want to use save_libobjs as it was before
128cae6f3459 initial coding
carl
parents:
diff changeset
4073 # whole_archive_flag_spec was expanded, because we can't
128cae6f3459 initial coding
carl
parents:
diff changeset
4074 # assume the linker understands whole_archive_flag_spec.
128cae6f3459 initial coding
carl
parents:
diff changeset
4075 # This may have to be revisited, in case too many
128cae6f3459 initial coding
carl
parents:
diff changeset
4076 # convenience libraries get linked in and end up exceeding
128cae6f3459 initial coding
carl
parents:
diff changeset
4077 # the spec.
128cae6f3459 initial coding
carl
parents:
diff changeset
4078 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4079 save_libobjs=$libobjs
128cae6f3459 initial coding
carl
parents:
diff changeset
4080 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4081 save_output=$output
128cae6f3459 initial coding
carl
parents:
diff changeset
4082
128cae6f3459 initial coding
carl
parents:
diff changeset
4083 # Clear the reloadable object creation command queue and
128cae6f3459 initial coding
carl
parents:
diff changeset
4084 # initialize k to one.
128cae6f3459 initial coding
carl
parents:
diff changeset
4085 test_cmds=
128cae6f3459 initial coding
carl
parents:
diff changeset
4086 concat_cmds=
128cae6f3459 initial coding
carl
parents:
diff changeset
4087 objlist=
128cae6f3459 initial coding
carl
parents:
diff changeset
4088 delfiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
4089 last_robj=
128cae6f3459 initial coding
carl
parents:
diff changeset
4090 k=1
128cae6f3459 initial coding
carl
parents:
diff changeset
4091 output=$output_objdir/$save_output-${k}.$objext
128cae6f3459 initial coding
carl
parents:
diff changeset
4092 # Loop over the list of objects to be linked.
128cae6f3459 initial coding
carl
parents:
diff changeset
4093 for obj in $save_libobjs
128cae6f3459 initial coding
carl
parents:
diff changeset
4094 do
128cae6f3459 initial coding
carl
parents:
diff changeset
4095 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4096 if test "X$objlist" = X ||
128cae6f3459 initial coding
carl
parents:
diff changeset
4097 { len=`expr "X$test_cmds" : ".*"` &&
128cae6f3459 initial coding
carl
parents:
diff changeset
4098 test "$len" -le "$max_cmd_len"; }; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4099 objlist="$objlist $obj"
128cae6f3459 initial coding
carl
parents:
diff changeset
4100 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4101 # The command $test_cmds is almost too long, add a
128cae6f3459 initial coding
carl
parents:
diff changeset
4102 # command to the queue.
128cae6f3459 initial coding
carl
parents:
diff changeset
4103 if test "$k" -eq 1 ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4104 # The first file doesn't have a previous command to add.
128cae6f3459 initial coding
carl
parents:
diff changeset
4105 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4106 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4107 # All subsequent reloadable object files will link in
128cae6f3459 initial coding
carl
parents:
diff changeset
4108 # the last one created.
128cae6f3459 initial coding
carl
parents:
diff changeset
4109 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4110 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4111 last_robj=$output_objdir/$save_output-${k}.$objext
128cae6f3459 initial coding
carl
parents:
diff changeset
4112 k=`expr $k + 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
4113 output=$output_objdir/$save_output-${k}.$objext
128cae6f3459 initial coding
carl
parents:
diff changeset
4114 objlist=$obj
128cae6f3459 initial coding
carl
parents:
diff changeset
4115 len=1
128cae6f3459 initial coding
carl
parents:
diff changeset
4116 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4117 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4118 # Handle the remaining objects by creating one last
128cae6f3459 initial coding
carl
parents:
diff changeset
4119 # reloadable object file. All subsequent reloadable object
128cae6f3459 initial coding
carl
parents:
diff changeset
4120 # files will link in the last one created.
128cae6f3459 initial coding
carl
parents:
diff changeset
4121 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
128cae6f3459 initial coding
carl
parents:
diff changeset
4122 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4123
128cae6f3459 initial coding
carl
parents:
diff changeset
4124 if ${skipped_export-false}; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4125 $show "generating symbol list for \`$libname.la'"
128cae6f3459 initial coding
carl
parents:
diff changeset
4126 export_symbols="$output_objdir/$libname.exp"
128cae6f3459 initial coding
carl
parents:
diff changeset
4127 $run $rm $export_symbols
128cae6f3459 initial coding
carl
parents:
diff changeset
4128 libobjs=$output
128cae6f3459 initial coding
carl
parents:
diff changeset
4129 # Append the command to create the export file.
128cae6f3459 initial coding
carl
parents:
diff changeset
4130 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4131 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4132
128cae6f3459 initial coding
carl
parents:
diff changeset
4133 # Set up a command to remove the reloadale object files
128cae6f3459 initial coding
carl
parents:
diff changeset
4134 # after they are used.
128cae6f3459 initial coding
carl
parents:
diff changeset
4135 i=0
128cae6f3459 initial coding
carl
parents:
diff changeset
4136 while test "$i" -lt "$k"
128cae6f3459 initial coding
carl
parents:
diff changeset
4137 do
128cae6f3459 initial coding
carl
parents:
diff changeset
4138 i=`expr $i + 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
4139 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
128cae6f3459 initial coding
carl
parents:
diff changeset
4140 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4141
128cae6f3459 initial coding
carl
parents:
diff changeset
4142 $echo "creating a temporary reloadable object file: $output"
128cae6f3459 initial coding
carl
parents:
diff changeset
4143
128cae6f3459 initial coding
carl
parents:
diff changeset
4144 # Loop through the commands generated above and execute them.
128cae6f3459 initial coding
carl
parents:
diff changeset
4145 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
4146 for cmd in $concat_cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4147 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4148 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
4149 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4150 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4151 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4152
128cae6f3459 initial coding
carl
parents:
diff changeset
4153 libobjs=$output
128cae6f3459 initial coding
carl
parents:
diff changeset
4154 # Restore the value of output.
128cae6f3459 initial coding
carl
parents:
diff changeset
4155 output=$save_output
128cae6f3459 initial coding
carl
parents:
diff changeset
4156
128cae6f3459 initial coding
carl
parents:
diff changeset
4157 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4158 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4159 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4160 # Expand the library linking commands again to reset the
128cae6f3459 initial coding
carl
parents:
diff changeset
4161 # value of $libobjs for piecewise linking.
128cae6f3459 initial coding
carl
parents:
diff changeset
4162
128cae6f3459 initial coding
carl
parents:
diff changeset
4163 # Do each of the archive commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
4164 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4165 eval cmds=\"$archive_expsym_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4166 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4167 eval cmds=\"$archive_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4168 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4169
128cae6f3459 initial coding
carl
parents:
diff changeset
4170 # Append the command to remove the reloadable object files
128cae6f3459 initial coding
carl
parents:
diff changeset
4171 # to the just-reset $cmds.
128cae6f3459 initial coding
carl
parents:
diff changeset
4172 eval cmds=\"\$cmds~$rm $delfiles\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4173 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4174 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
4175 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4176 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4177 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
4178 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4179 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4180 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4181
128cae6f3459 initial coding
carl
parents:
diff changeset
4182 # Restore the uninstalled library and exit
128cae6f3459 initial coding
carl
parents:
diff changeset
4183 if test "$mode" = relink; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4184 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4185 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
4186 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4187
128cae6f3459 initial coding
carl
parents:
diff changeset
4188 # Create links to the real library.
128cae6f3459 initial coding
carl
parents:
diff changeset
4189 for linkname in $linknames; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4190 if test "$realname" != "$linkname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4191 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
128cae6f3459 initial coding
carl
parents:
diff changeset
4192 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4193 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4194 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4195
128cae6f3459 initial coding
carl
parents:
diff changeset
4196 # If -module or -export-dynamic was specified, set the dlname.
128cae6f3459 initial coding
carl
parents:
diff changeset
4197 if test "$module" = yes || test "$export_dynamic" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4198 # On all known operating systems, these are identical.
128cae6f3459 initial coding
carl
parents:
diff changeset
4199 dlname="$soname"
128cae6f3459 initial coding
carl
parents:
diff changeset
4200 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4201 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4202 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4203
128cae6f3459 initial coding
carl
parents:
diff changeset
4204 obj)
128cae6f3459 initial coding
carl
parents:
diff changeset
4205 if test -n "$deplibs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4206 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4207 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4208
128cae6f3459 initial coding
carl
parents:
diff changeset
4209 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4210 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4211 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4212
128cae6f3459 initial coding
carl
parents:
diff changeset
4213 if test -n "$rpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4214 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4215 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4216
128cae6f3459 initial coding
carl
parents:
diff changeset
4217 if test -n "$xrpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4218 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4219 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4220
128cae6f3459 initial coding
carl
parents:
diff changeset
4221 if test -n "$vinfo"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4222 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4223 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4224
128cae6f3459 initial coding
carl
parents:
diff changeset
4225 if test -n "$release"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4226 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4227 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4228
128cae6f3459 initial coding
carl
parents:
diff changeset
4229 case $output in
128cae6f3459 initial coding
carl
parents:
diff changeset
4230 *.lo)
128cae6f3459 initial coding
carl
parents:
diff changeset
4231 if test -n "$objs$old_deplibs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4232 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4233 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
4234 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4235 libobj="$output"
128cae6f3459 initial coding
carl
parents:
diff changeset
4236 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4237 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4238 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
4239 libobj=
128cae6f3459 initial coding
carl
parents:
diff changeset
4240 obj="$output"
128cae6f3459 initial coding
carl
parents:
diff changeset
4241 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4242 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4243
128cae6f3459 initial coding
carl
parents:
diff changeset
4244 # Delete the old objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
4245 $run $rm $obj $libobj
128cae6f3459 initial coding
carl
parents:
diff changeset
4246
128cae6f3459 initial coding
carl
parents:
diff changeset
4247 # Objects from convenience libraries. This assumes
128cae6f3459 initial coding
carl
parents:
diff changeset
4248 # single-version convenience libraries. Whenever we create
128cae6f3459 initial coding
carl
parents:
diff changeset
4249 # different ones for PIC/non-PIC, this we'll have to duplicate
128cae6f3459 initial coding
carl
parents:
diff changeset
4250 # the extraction.
128cae6f3459 initial coding
carl
parents:
diff changeset
4251 reload_conv_objs=
128cae6f3459 initial coding
carl
parents:
diff changeset
4252 gentop=
128cae6f3459 initial coding
carl
parents:
diff changeset
4253 # reload_cmds runs $LD directly, so let us get rid of
128cae6f3459 initial coding
carl
parents:
diff changeset
4254 # -Wl from whole_archive_flag_spec
128cae6f3459 initial coding
carl
parents:
diff changeset
4255 wl=
128cae6f3459 initial coding
carl
parents:
diff changeset
4256
128cae6f3459 initial coding
carl
parents:
diff changeset
4257 if test -n "$convenience"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4258 if test -n "$whole_archive_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4259 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4260 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4261 gentop="$output_objdir/${obj}x"
128cae6f3459 initial coding
carl
parents:
diff changeset
4262 $show "${rm}r $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
4263 $run ${rm}r "$gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
4264 $show "$mkdir $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
4265 $run $mkdir "$gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
4266 status=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
4267 if test "$status" -ne 0 && test ! -d "$gentop"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4268 exit $status
128cae6f3459 initial coding
carl
parents:
diff changeset
4269 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4270 generated="$generated $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
4271
128cae6f3459 initial coding
carl
parents:
diff changeset
4272 for xlib in $convenience; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4273 # Extract the objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
4274 case $xlib in
128cae6f3459 initial coding
carl
parents:
diff changeset
4275 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4276 *) xabs=`pwd`"/$xlib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4277 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4278 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
4279 xdir="$gentop/$xlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
4280
128cae6f3459 initial coding
carl
parents:
diff changeset
4281 $show "${rm}r $xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
4282 $run ${rm}r "$xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
4283 $show "$mkdir $xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
4284 $run $mkdir "$xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
4285 status=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
4286 if test "$status" -ne 0 && test ! -d "$xdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4287 exit $status
128cae6f3459 initial coding
carl
parents:
diff changeset
4288 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4289 # We will extract separately just the conflicting names and we will no
128cae6f3459 initial coding
carl
parents:
diff changeset
4290 # longer touch any unique names. It is faster to leave these extract
128cae6f3459 initial coding
carl
parents:
diff changeset
4291 # automatically by $AR in one run.
128cae6f3459 initial coding
carl
parents:
diff changeset
4292 $show "(cd $xdir && $AR x $xabs)"
128cae6f3459 initial coding
carl
parents:
diff changeset
4293 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4294 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
128cae6f3459 initial coding
carl
parents:
diff changeset
4295 :
128cae6f3459 initial coding
carl
parents:
diff changeset
4296 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4297 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4298 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4299 $AR t "$xabs" | sort | uniq -cd | while read -r count name
128cae6f3459 initial coding
carl
parents:
diff changeset
4300 do
128cae6f3459 initial coding
carl
parents:
diff changeset
4301 i=1
128cae6f3459 initial coding
carl
parents:
diff changeset
4302 while test "$i" -le "$count"
128cae6f3459 initial coding
carl
parents:
diff changeset
4303 do
128cae6f3459 initial coding
carl
parents:
diff changeset
4304 # Put our $i before any first dot (extension)
128cae6f3459 initial coding
carl
parents:
diff changeset
4305 # Never overwrite any file
128cae6f3459 initial coding
carl
parents:
diff changeset
4306 name_to="$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
4307 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
128cae6f3459 initial coding
carl
parents:
diff changeset
4308 do
128cae6f3459 initial coding
carl
parents:
diff changeset
4309 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4310 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4311 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
128cae6f3459 initial coding
carl
parents:
diff changeset
4312 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4313 i=`expr $i + 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
4314 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4315 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4316 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4317
128cae6f3459 initial coding
carl
parents:
diff changeset
4318 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
128cae6f3459 initial coding
carl
parents:
diff changeset
4319 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4320 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4321 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4322
128cae6f3459 initial coding
carl
parents:
diff changeset
4323 # Create the old-style object.
128cae6f3459 initial coding
carl
parents:
diff changeset
4324 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
128cae6f3459 initial coding
carl
parents:
diff changeset
4325
128cae6f3459 initial coding
carl
parents:
diff changeset
4326 output="$obj"
128cae6f3459 initial coding
carl
parents:
diff changeset
4327 eval cmds=\"$reload_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4328 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
4329 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4330 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4331 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
4332 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4333 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4334 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4335
128cae6f3459 initial coding
carl
parents:
diff changeset
4336 # Exit if we aren't doing a library object file.
128cae6f3459 initial coding
carl
parents:
diff changeset
4337 if test -z "$libobj"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4338 if test -n "$gentop"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4339 $show "${rm}r $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
4340 $run ${rm}r $gentop
128cae6f3459 initial coding
carl
parents:
diff changeset
4341 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4342
128cae6f3459 initial coding
carl
parents:
diff changeset
4343 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
4344 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4345
128cae6f3459 initial coding
carl
parents:
diff changeset
4346 if test "$build_libtool_libs" != yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4347 if test -n "$gentop"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4348 $show "${rm}r $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
4349 $run ${rm}r $gentop
128cae6f3459 initial coding
carl
parents:
diff changeset
4350 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4351
128cae6f3459 initial coding
carl
parents:
diff changeset
4352 # Create an invalid libtool object if no PIC, so that we don't
128cae6f3459 initial coding
carl
parents:
diff changeset
4353 # accidentally link it into a program.
128cae6f3459 initial coding
carl
parents:
diff changeset
4354 # $show "echo timestamp > $libobj"
128cae6f3459 initial coding
carl
parents:
diff changeset
4355 # $run eval "echo timestamp > $libobj" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4356 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
4357 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4358
128cae6f3459 initial coding
carl
parents:
diff changeset
4359 if test -n "$pic_flag" || test "$pic_mode" != default; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4360 # Only do commands if we really have different PIC objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
4361 reload_objs="$libobjs $reload_conv_objs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4362 output="$libobj"
128cae6f3459 initial coding
carl
parents:
diff changeset
4363 eval cmds=\"$reload_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4364 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
4365 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4366 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4367 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
4368 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4369 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4370 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4371 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4372
128cae6f3459 initial coding
carl
parents:
diff changeset
4373 if test -n "$gentop"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4374 $show "${rm}r $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
4375 $run ${rm}r $gentop
128cae6f3459 initial coding
carl
parents:
diff changeset
4376 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4377
128cae6f3459 initial coding
carl
parents:
diff changeset
4378 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
4379 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4380
128cae6f3459 initial coding
carl
parents:
diff changeset
4381 prog)
128cae6f3459 initial coding
carl
parents:
diff changeset
4382 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
4383 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4384 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4385 if test -n "$vinfo"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4386 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4387 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4388
128cae6f3459 initial coding
carl
parents:
diff changeset
4389 if test -n "$release"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4390 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4391 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4392
128cae6f3459 initial coding
carl
parents:
diff changeset
4393 if test "$preload" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4394 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
128cae6f3459 initial coding
carl
parents:
diff changeset
4395 test "$dlopen_self_static" = unknown; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4396 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
128cae6f3459 initial coding
carl
parents:
diff changeset
4397 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4398 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4399
128cae6f3459 initial coding
carl
parents:
diff changeset
4400 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
4401 *-*-rhapsody* | *-*-darwin1.[012])
128cae6f3459 initial coding
carl
parents:
diff changeset
4402 # On Rhapsody replace the C library is the System framework
128cae6f3459 initial coding
carl
parents:
diff changeset
4403 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
128cae6f3459 initial coding
carl
parents:
diff changeset
4404 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
128cae6f3459 initial coding
carl
parents:
diff changeset
4405 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4406 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4407
128cae6f3459 initial coding
carl
parents:
diff changeset
4408 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
4409 *darwin*)
128cae6f3459 initial coding
carl
parents:
diff changeset
4410 # Don't allow lazy linking, it breaks C++ global constructors
128cae6f3459 initial coding
carl
parents:
diff changeset
4411 if test "$tagname" = CXX ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4412 compile_command="$compile_command ${wl}-bind_at_load"
128cae6f3459 initial coding
carl
parents:
diff changeset
4413 finalize_command="$finalize_command ${wl}-bind_at_load"
128cae6f3459 initial coding
carl
parents:
diff changeset
4414 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4415 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4416 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4417
128cae6f3459 initial coding
carl
parents:
diff changeset
4418 compile_command="$compile_command $compile_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4419 finalize_command="$finalize_command $finalize_deplibs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4420
128cae6f3459 initial coding
carl
parents:
diff changeset
4421 if test -n "$rpath$xrpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4422 # If the user specified any rpath flags, then add them.
128cae6f3459 initial coding
carl
parents:
diff changeset
4423 for libdir in $rpath $xrpath; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4424 # This is the magic to use -rpath.
128cae6f3459 initial coding
carl
parents:
diff changeset
4425 case "$finalize_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
4426 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4427 *) finalize_rpath="$finalize_rpath $libdir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4428 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4429 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4430 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4431
128cae6f3459 initial coding
carl
parents:
diff changeset
4432 # Now hardcode the library paths
128cae6f3459 initial coding
carl
parents:
diff changeset
4433 rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
4434 hardcode_libdirs=
128cae6f3459 initial coding
carl
parents:
diff changeset
4435 for libdir in $compile_rpath $finalize_rpath; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4436 if test -n "$hardcode_libdir_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4437 if test -n "$hardcode_libdir_separator"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4438 if test -z "$hardcode_libdirs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4439 hardcode_libdirs="$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
4440 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4441 # Just accumulate the unique libdirs.
128cae6f3459 initial coding
carl
parents:
diff changeset
4442 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
128cae6f3459 initial coding
carl
parents:
diff changeset
4443 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
128cae6f3459 initial coding
carl
parents:
diff changeset
4444 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4445 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
4446 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
4447 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4448 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4449 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4450 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4451 eval flag=\"$hardcode_libdir_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4452 rpath="$rpath $flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
4453 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4454 elif test -n "$runpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4455 case "$perm_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
4456 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4457 *) perm_rpath="$perm_rpath $libdir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4458 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4459 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4460 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
4461 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
128cae6f3459 initial coding
carl
parents:
diff changeset
4462 case :$dllsearchpath: in
128cae6f3459 initial coding
carl
parents:
diff changeset
4463 *":$libdir:"*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4464 *) dllsearchpath="$dllsearchpath:$libdir";;
128cae6f3459 initial coding
carl
parents:
diff changeset
4465 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4466 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4467 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4468 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4469 # Substitute the hardcoded libdirs into the rpath.
128cae6f3459 initial coding
carl
parents:
diff changeset
4470 if test -n "$hardcode_libdir_separator" &&
128cae6f3459 initial coding
carl
parents:
diff changeset
4471 test -n "$hardcode_libdirs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4472 libdir="$hardcode_libdirs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4473 eval rpath=\" $hardcode_libdir_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4474 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4475 compile_rpath="$rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4476
128cae6f3459 initial coding
carl
parents:
diff changeset
4477 rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
4478 hardcode_libdirs=
128cae6f3459 initial coding
carl
parents:
diff changeset
4479 for libdir in $finalize_rpath; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4480 if test -n "$hardcode_libdir_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4481 if test -n "$hardcode_libdir_separator"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4482 if test -z "$hardcode_libdirs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4483 hardcode_libdirs="$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
4484 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4485 # Just accumulate the unique libdirs.
128cae6f3459 initial coding
carl
parents:
diff changeset
4486 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
128cae6f3459 initial coding
carl
parents:
diff changeset
4487 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
128cae6f3459 initial coding
carl
parents:
diff changeset
4488 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4489 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
4490 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
4491 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4492 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4493 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4494 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4495 eval flag=\"$hardcode_libdir_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4496 rpath="$rpath $flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
4497 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4498 elif test -n "$runpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4499 case "$finalize_perm_rpath " in
128cae6f3459 initial coding
carl
parents:
diff changeset
4500 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4501 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4502 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4503 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4504 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4505 # Substitute the hardcoded libdirs into the rpath.
128cae6f3459 initial coding
carl
parents:
diff changeset
4506 if test -n "$hardcode_libdir_separator" &&
128cae6f3459 initial coding
carl
parents:
diff changeset
4507 test -n "$hardcode_libdirs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4508 libdir="$hardcode_libdirs"
128cae6f3459 initial coding
carl
parents:
diff changeset
4509 eval rpath=\" $hardcode_libdir_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
4510 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4511 finalize_rpath="$rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4512
128cae6f3459 initial coding
carl
parents:
diff changeset
4513 if test -n "$libobjs" && test "$build_old_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4514 # Transform all the library objects into standard objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
4515 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
128cae6f3459 initial coding
carl
parents:
diff changeset
4516 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
128cae6f3459 initial coding
carl
parents:
diff changeset
4517 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4518
128cae6f3459 initial coding
carl
parents:
diff changeset
4519 dlsyms=
128cae6f3459 initial coding
carl
parents:
diff changeset
4520 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4521 if test -n "$NM" && test -n "$global_symbol_pipe"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4522 dlsyms="${outputname}S.c"
128cae6f3459 initial coding
carl
parents:
diff changeset
4523 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4524 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4525 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4526 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4527
128cae6f3459 initial coding
carl
parents:
diff changeset
4528 if test -n "$dlsyms"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4529 case $dlsyms in
128cae6f3459 initial coding
carl
parents:
diff changeset
4530 "") ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4531 *.c)
128cae6f3459 initial coding
carl
parents:
diff changeset
4532 # Discover the nlist of each of the dlfiles.
128cae6f3459 initial coding
carl
parents:
diff changeset
4533 nlist="$output_objdir/${outputname}.nm"
128cae6f3459 initial coding
carl
parents:
diff changeset
4534
128cae6f3459 initial coding
carl
parents:
diff changeset
4535 $show "$rm $nlist ${nlist}S ${nlist}T"
128cae6f3459 initial coding
carl
parents:
diff changeset
4536 $run $rm "$nlist" "${nlist}S" "${nlist}T"
128cae6f3459 initial coding
carl
parents:
diff changeset
4537
128cae6f3459 initial coding
carl
parents:
diff changeset
4538 # Parse the name list into a source file.
128cae6f3459 initial coding
carl
parents:
diff changeset
4539 $show "creating $output_objdir/$dlsyms"
128cae6f3459 initial coding
carl
parents:
diff changeset
4540
128cae6f3459 initial coding
carl
parents:
diff changeset
4541 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
128cae6f3459 initial coding
carl
parents:
diff changeset
4542 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
128cae6f3459 initial coding
carl
parents:
diff changeset
4543 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
128cae6f3459 initial coding
carl
parents:
diff changeset
4544
128cae6f3459 initial coding
carl
parents:
diff changeset
4545 #ifdef __cplusplus
128cae6f3459 initial coding
carl
parents:
diff changeset
4546 extern \"C\" {
128cae6f3459 initial coding
carl
parents:
diff changeset
4547 #endif
128cae6f3459 initial coding
carl
parents:
diff changeset
4548
128cae6f3459 initial coding
carl
parents:
diff changeset
4549 /* Prevent the only kind of declaration conflicts we can make. */
128cae6f3459 initial coding
carl
parents:
diff changeset
4550 #define lt_preloaded_symbols some_other_symbol
128cae6f3459 initial coding
carl
parents:
diff changeset
4551
128cae6f3459 initial coding
carl
parents:
diff changeset
4552 /* External symbol declarations for the compiler. */\
128cae6f3459 initial coding
carl
parents:
diff changeset
4553 "
128cae6f3459 initial coding
carl
parents:
diff changeset
4554
128cae6f3459 initial coding
carl
parents:
diff changeset
4555 if test "$dlself" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4556 $show "generating symbol list for \`$output'"
128cae6f3459 initial coding
carl
parents:
diff changeset
4557
128cae6f3459 initial coding
carl
parents:
diff changeset
4558 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
128cae6f3459 initial coding
carl
parents:
diff changeset
4559
128cae6f3459 initial coding
carl
parents:
diff changeset
4560 # Add our own program objects to the symbol list.
128cae6f3459 initial coding
carl
parents:
diff changeset
4561 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
128cae6f3459 initial coding
carl
parents:
diff changeset
4562 for arg in $progfiles; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4563 $show "extracting global C symbols from \`$arg'"
128cae6f3459 initial coding
carl
parents:
diff changeset
4564 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
128cae6f3459 initial coding
carl
parents:
diff changeset
4565 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4566
128cae6f3459 initial coding
carl
parents:
diff changeset
4567 if test -n "$exclude_expsyms"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4568 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
128cae6f3459 initial coding
carl
parents:
diff changeset
4569 $run eval '$mv "$nlist"T "$nlist"'
128cae6f3459 initial coding
carl
parents:
diff changeset
4570 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4571
128cae6f3459 initial coding
carl
parents:
diff changeset
4572 if test -n "$export_symbols_regex"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4573 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
128cae6f3459 initial coding
carl
parents:
diff changeset
4574 $run eval '$mv "$nlist"T "$nlist"'
128cae6f3459 initial coding
carl
parents:
diff changeset
4575 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4576
128cae6f3459 initial coding
carl
parents:
diff changeset
4577 # Prepare the list of exported symbols
128cae6f3459 initial coding
carl
parents:
diff changeset
4578 if test -z "$export_symbols"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4579 export_symbols="$output_objdir/$output.exp"
128cae6f3459 initial coding
carl
parents:
diff changeset
4580 $run $rm $export_symbols
128cae6f3459 initial coding
carl
parents:
diff changeset
4581 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
128cae6f3459 initial coding
carl
parents:
diff changeset
4582 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4583 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
128cae6f3459 initial coding
carl
parents:
diff changeset
4584 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
128cae6f3459 initial coding
carl
parents:
diff changeset
4585 $run eval 'mv "$nlist"T "$nlist"'
128cae6f3459 initial coding
carl
parents:
diff changeset
4586 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4587 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4588
128cae6f3459 initial coding
carl
parents:
diff changeset
4589 for arg in $dlprefiles; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4590 $show "extracting global C symbols from \`$arg'"
128cae6f3459 initial coding
carl
parents:
diff changeset
4591 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
4592 $run eval '$echo ": $name " >> "$nlist"'
128cae6f3459 initial coding
carl
parents:
diff changeset
4593 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
128cae6f3459 initial coding
carl
parents:
diff changeset
4594 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4595
128cae6f3459 initial coding
carl
parents:
diff changeset
4596 if test -z "$run"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4597 # Make sure we have at least an empty file.
128cae6f3459 initial coding
carl
parents:
diff changeset
4598 test -f "$nlist" || : > "$nlist"
128cae6f3459 initial coding
carl
parents:
diff changeset
4599
128cae6f3459 initial coding
carl
parents:
diff changeset
4600 if test -n "$exclude_expsyms"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4601 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
128cae6f3459 initial coding
carl
parents:
diff changeset
4602 $mv "$nlist"T "$nlist"
128cae6f3459 initial coding
carl
parents:
diff changeset
4603 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4604
128cae6f3459 initial coding
carl
parents:
diff changeset
4605 # Try sorting and uniquifying the output.
128cae6f3459 initial coding
carl
parents:
diff changeset
4606 if grep -v "^: " < "$nlist" |
128cae6f3459 initial coding
carl
parents:
diff changeset
4607 if sort -k 3 </dev/null >/dev/null 2>&1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4608 sort -k 3
128cae6f3459 initial coding
carl
parents:
diff changeset
4609 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4610 sort +2
128cae6f3459 initial coding
carl
parents:
diff changeset
4611 fi |
128cae6f3459 initial coding
carl
parents:
diff changeset
4612 uniq > "$nlist"S; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4613 :
128cae6f3459 initial coding
carl
parents:
diff changeset
4614 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4615 grep -v "^: " < "$nlist" > "$nlist"S
128cae6f3459 initial coding
carl
parents:
diff changeset
4616 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4617
128cae6f3459 initial coding
carl
parents:
diff changeset
4618 if test -f "$nlist"S; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4619 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
128cae6f3459 initial coding
carl
parents:
diff changeset
4620 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4621 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
128cae6f3459 initial coding
carl
parents:
diff changeset
4622 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4623
128cae6f3459 initial coding
carl
parents:
diff changeset
4624 $echo >> "$output_objdir/$dlsyms" "\
128cae6f3459 initial coding
carl
parents:
diff changeset
4625
128cae6f3459 initial coding
carl
parents:
diff changeset
4626 #undef lt_preloaded_symbols
128cae6f3459 initial coding
carl
parents:
diff changeset
4627
128cae6f3459 initial coding
carl
parents:
diff changeset
4628 #if defined (__STDC__) && __STDC__
128cae6f3459 initial coding
carl
parents:
diff changeset
4629 # define lt_ptr void *
128cae6f3459 initial coding
carl
parents:
diff changeset
4630 #else
128cae6f3459 initial coding
carl
parents:
diff changeset
4631 # define lt_ptr char *
128cae6f3459 initial coding
carl
parents:
diff changeset
4632 # define const
128cae6f3459 initial coding
carl
parents:
diff changeset
4633 #endif
128cae6f3459 initial coding
carl
parents:
diff changeset
4634
128cae6f3459 initial coding
carl
parents:
diff changeset
4635 /* The mapping between symbol names and symbols. */
128cae6f3459 initial coding
carl
parents:
diff changeset
4636 const struct {
128cae6f3459 initial coding
carl
parents:
diff changeset
4637 const char *name;
128cae6f3459 initial coding
carl
parents:
diff changeset
4638 lt_ptr address;
128cae6f3459 initial coding
carl
parents:
diff changeset
4639 }
128cae6f3459 initial coding
carl
parents:
diff changeset
4640 lt_preloaded_symbols[] =
128cae6f3459 initial coding
carl
parents:
diff changeset
4641 {\
128cae6f3459 initial coding
carl
parents:
diff changeset
4642 "
128cae6f3459 initial coding
carl
parents:
diff changeset
4643
128cae6f3459 initial coding
carl
parents:
diff changeset
4644 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
128cae6f3459 initial coding
carl
parents:
diff changeset
4645
128cae6f3459 initial coding
carl
parents:
diff changeset
4646 $echo >> "$output_objdir/$dlsyms" "\
128cae6f3459 initial coding
carl
parents:
diff changeset
4647 {0, (lt_ptr) 0}
128cae6f3459 initial coding
carl
parents:
diff changeset
4648 };
128cae6f3459 initial coding
carl
parents:
diff changeset
4649
128cae6f3459 initial coding
carl
parents:
diff changeset
4650 /* This works around a problem in FreeBSD linker */
128cae6f3459 initial coding
carl
parents:
diff changeset
4651 #ifdef FREEBSD_WORKAROUND
128cae6f3459 initial coding
carl
parents:
diff changeset
4652 static const void *lt_preloaded_setup() {
128cae6f3459 initial coding
carl
parents:
diff changeset
4653 return lt_preloaded_symbols;
128cae6f3459 initial coding
carl
parents:
diff changeset
4654 }
128cae6f3459 initial coding
carl
parents:
diff changeset
4655 #endif
128cae6f3459 initial coding
carl
parents:
diff changeset
4656
128cae6f3459 initial coding
carl
parents:
diff changeset
4657 #ifdef __cplusplus
128cae6f3459 initial coding
carl
parents:
diff changeset
4658 }
128cae6f3459 initial coding
carl
parents:
diff changeset
4659 #endif\
128cae6f3459 initial coding
carl
parents:
diff changeset
4660 "
128cae6f3459 initial coding
carl
parents:
diff changeset
4661 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4662
128cae6f3459 initial coding
carl
parents:
diff changeset
4663 pic_flag_for_symtable=
128cae6f3459 initial coding
carl
parents:
diff changeset
4664 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
4665 # compiling the symbol table file with pic_flag works around
128cae6f3459 initial coding
carl
parents:
diff changeset
4666 # a FreeBSD bug that causes programs to crash when -lm is
128cae6f3459 initial coding
carl
parents:
diff changeset
4667 # linked before any other PIC object. But we must not use
128cae6f3459 initial coding
carl
parents:
diff changeset
4668 # pic_flag when linking with -static. The problem exists in
128cae6f3459 initial coding
carl
parents:
diff changeset
4669 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
128cae6f3459 initial coding
carl
parents:
diff changeset
4670 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
128cae6f3459 initial coding
carl
parents:
diff changeset
4671 case "$compile_command " in
128cae6f3459 initial coding
carl
parents:
diff changeset
4672 *" -static "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4673 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
128cae6f3459 initial coding
carl
parents:
diff changeset
4674 esac;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4675 *-*-hpux*)
128cae6f3459 initial coding
carl
parents:
diff changeset
4676 case "$compile_command " in
128cae6f3459 initial coding
carl
parents:
diff changeset
4677 *" -static "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4678 *) pic_flag_for_symtable=" $pic_flag";;
128cae6f3459 initial coding
carl
parents:
diff changeset
4679 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4680 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4681
128cae6f3459 initial coding
carl
parents:
diff changeset
4682 # Now compile the dynamic symbol file.
128cae6f3459 initial coding
carl
parents:
diff changeset
4683 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
128cae6f3459 initial coding
carl
parents:
diff changeset
4684 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4685
128cae6f3459 initial coding
carl
parents:
diff changeset
4686 # Clean up the generated files.
128cae6f3459 initial coding
carl
parents:
diff changeset
4687 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
128cae6f3459 initial coding
carl
parents:
diff changeset
4688 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
128cae6f3459 initial coding
carl
parents:
diff changeset
4689
128cae6f3459 initial coding
carl
parents:
diff changeset
4690 # Transform the symbol file into the correct name.
128cae6f3459 initial coding
carl
parents:
diff changeset
4691 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4692 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4693 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4694 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
4695 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4696 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
4697 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4698 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4699 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4700 # We keep going just in case the user didn't refer to
128cae6f3459 initial coding
carl
parents:
diff changeset
4701 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
128cae6f3459 initial coding
carl
parents:
diff changeset
4702 # really was required.
128cae6f3459 initial coding
carl
parents:
diff changeset
4703
128cae6f3459 initial coding
carl
parents:
diff changeset
4704 # Nullify the symbol file.
128cae6f3459 initial coding
carl
parents:
diff changeset
4705 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4706 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4707 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4708
128cae6f3459 initial coding
carl
parents:
diff changeset
4709 # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
128cae6f3459 initial coding
carl
parents:
diff changeset
4710 # Also add -bnolibpath to the beginning of the link line, to clear the hardcoded runpath.
128cae6f3459 initial coding
carl
parents:
diff changeset
4711 # Otherwise, things like the -L path to libgcc.a are accidentally hardcoded by ld.
128cae6f3459 initial coding
carl
parents:
diff changeset
4712 # This does not apply on AIX for ia64, which uses a SysV linker.
128cae6f3459 initial coding
carl
parents:
diff changeset
4713 case "$host" in
128cae6f3459 initial coding
carl
parents:
diff changeset
4714 ia64-*-aix5*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4715 *-*-aix4* | *-*-aix5*)
128cae6f3459 initial coding
carl
parents:
diff changeset
4716 compile_command=`$echo "X$compile_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4717 finalize_command=`$echo "X$finalize_command $wl-brtl" | $Xsed -e "s/\$CC/\$CC $wl-bnolibpath/1"` ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4718 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4719
128cae6f3459 initial coding
carl
parents:
diff changeset
4720 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4721 # Replace the output file specification.
128cae6f3459 initial coding
carl
parents:
diff changeset
4722 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
128cae6f3459 initial coding
carl
parents:
diff changeset
4723 link_command="$compile_command$compile_rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4724
128cae6f3459 initial coding
carl
parents:
diff changeset
4725 # We have no uninstalled library dependencies, so finalize right now.
128cae6f3459 initial coding
carl
parents:
diff changeset
4726 $show "$link_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
4727 $run eval "$link_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
4728 status=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
4729
128cae6f3459 initial coding
carl
parents:
diff changeset
4730 # Delete the generated files.
128cae6f3459 initial coding
carl
parents:
diff changeset
4731 if test -n "$dlsyms"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4732 $show "$rm $output_objdir/${outputname}S.${objext}"
128cae6f3459 initial coding
carl
parents:
diff changeset
4733 $run $rm "$output_objdir/${outputname}S.${objext}"
128cae6f3459 initial coding
carl
parents:
diff changeset
4734 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4735
128cae6f3459 initial coding
carl
parents:
diff changeset
4736 exit $status
128cae6f3459 initial coding
carl
parents:
diff changeset
4737 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4738
128cae6f3459 initial coding
carl
parents:
diff changeset
4739 if test -n "$shlibpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4740 # We should set the shlibpath_var
128cae6f3459 initial coding
carl
parents:
diff changeset
4741 rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
4742 for dir in $temp_rpath; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4743 case $dir in
128cae6f3459 initial coding
carl
parents:
diff changeset
4744 [\\/]* | [A-Za-z]:[\\/]*)
128cae6f3459 initial coding
carl
parents:
diff changeset
4745 # Absolute path.
128cae6f3459 initial coding
carl
parents:
diff changeset
4746 rpath="$rpath$dir:"
128cae6f3459 initial coding
carl
parents:
diff changeset
4747 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4748 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
4749 # Relative path: add a thisdir entry.
128cae6f3459 initial coding
carl
parents:
diff changeset
4750 rpath="$rpath\$thisdir/$dir:"
128cae6f3459 initial coding
carl
parents:
diff changeset
4751 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4752 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4753 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4754 temp_rpath="$rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4755 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4756
128cae6f3459 initial coding
carl
parents:
diff changeset
4757 if test -n "$compile_shlibpath$finalize_shlibpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4758 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
4759 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4760 if test -n "$finalize_shlibpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4761 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
4762 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4763
128cae6f3459 initial coding
carl
parents:
diff changeset
4764 compile_var=
128cae6f3459 initial coding
carl
parents:
diff changeset
4765 finalize_var=
128cae6f3459 initial coding
carl
parents:
diff changeset
4766 if test -n "$runpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4767 if test -n "$perm_rpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4768 # We should set the runpath_var.
128cae6f3459 initial coding
carl
parents:
diff changeset
4769 rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
4770 for dir in $perm_rpath; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4771 rpath="$rpath$dir:"
128cae6f3459 initial coding
carl
parents:
diff changeset
4772 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4773 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
128cae6f3459 initial coding
carl
parents:
diff changeset
4774 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4775 if test -n "$finalize_perm_rpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4776 # We should set the runpath_var.
128cae6f3459 initial coding
carl
parents:
diff changeset
4777 rpath=
128cae6f3459 initial coding
carl
parents:
diff changeset
4778 for dir in $finalize_perm_rpath; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4779 rpath="$rpath$dir:"
128cae6f3459 initial coding
carl
parents:
diff changeset
4780 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4781 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
128cae6f3459 initial coding
carl
parents:
diff changeset
4782 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4783 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4784
128cae6f3459 initial coding
carl
parents:
diff changeset
4785 if test "$no_install" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4786 # We don't need to create a wrapper script.
128cae6f3459 initial coding
carl
parents:
diff changeset
4787 link_command="$compile_var$compile_command$compile_rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4788 # Replace the output file specification.
128cae6f3459 initial coding
carl
parents:
diff changeset
4789 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
128cae6f3459 initial coding
carl
parents:
diff changeset
4790 # Delete the old output file.
128cae6f3459 initial coding
carl
parents:
diff changeset
4791 $run $rm $output
128cae6f3459 initial coding
carl
parents:
diff changeset
4792 # Link the executable and exit
128cae6f3459 initial coding
carl
parents:
diff changeset
4793 $show "$link_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
4794 $run eval "$link_command" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4795 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
4796 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4797
128cae6f3459 initial coding
carl
parents:
diff changeset
4798 if test "$hardcode_action" = relink; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4799 # Fast installation is not supported
128cae6f3459 initial coding
carl
parents:
diff changeset
4800 link_command="$compile_var$compile_command$compile_rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4801 relink_command="$finalize_var$finalize_command$finalize_rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4802
128cae6f3459 initial coding
carl
parents:
diff changeset
4803 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4804 $echo "$modename: \`$output' will be relinked during installation" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
4805 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4806 if test "$fast_install" != no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4807 link_command="$finalize_var$compile_command$finalize_rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4808 if test "$fast_install" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4809 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
128cae6f3459 initial coding
carl
parents:
diff changeset
4810 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4811 # fast_install is set to needless
128cae6f3459 initial coding
carl
parents:
diff changeset
4812 relink_command=
128cae6f3459 initial coding
carl
parents:
diff changeset
4813 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4814 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4815 link_command="$compile_var$compile_command$compile_rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4816 relink_command="$finalize_var$finalize_command$finalize_rpath"
128cae6f3459 initial coding
carl
parents:
diff changeset
4817 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4818 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4819
128cae6f3459 initial coding
carl
parents:
diff changeset
4820 # Replace the output file specification.
128cae6f3459 initial coding
carl
parents:
diff changeset
4821 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
128cae6f3459 initial coding
carl
parents:
diff changeset
4822
128cae6f3459 initial coding
carl
parents:
diff changeset
4823 # Delete the old output files.
128cae6f3459 initial coding
carl
parents:
diff changeset
4824 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
128cae6f3459 initial coding
carl
parents:
diff changeset
4825
128cae6f3459 initial coding
carl
parents:
diff changeset
4826 $show "$link_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
4827 $run eval "$link_command" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
4828
128cae6f3459 initial coding
carl
parents:
diff changeset
4829 # Now create the wrapper script.
128cae6f3459 initial coding
carl
parents:
diff changeset
4830 $show "creating $output"
128cae6f3459 initial coding
carl
parents:
diff changeset
4831
128cae6f3459 initial coding
carl
parents:
diff changeset
4832 # Quote the relink command for shipping.
128cae6f3459 initial coding
carl
parents:
diff changeset
4833 if test -n "$relink_command"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4834 # Preserve any variables that may affect compiler behavior
128cae6f3459 initial coding
carl
parents:
diff changeset
4835 for var in $variables_saved_for_relink; do
128cae6f3459 initial coding
carl
parents:
diff changeset
4836 if eval test -z \"\${$var+set}\"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4837 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
4838 elif eval var_value=\$$var; test -z "$var_value"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4839 relink_command="$var=; export $var; $relink_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
4840 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4841 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4842 relink_command="$var=\"$var_value\"; export $var; $relink_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
4843 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4844 done
128cae6f3459 initial coding
carl
parents:
diff changeset
4845 relink_command="(cd `pwd`; $relink_command)"
128cae6f3459 initial coding
carl
parents:
diff changeset
4846 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4847 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4848
128cae6f3459 initial coding
carl
parents:
diff changeset
4849 # Quote $echo for shipping.
128cae6f3459 initial coding
carl
parents:
diff changeset
4850 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4851 case $0 in
128cae6f3459 initial coding
carl
parents:
diff changeset
4852 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
128cae6f3459 initial coding
carl
parents:
diff changeset
4853 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
128cae6f3459 initial coding
carl
parents:
diff changeset
4854 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4855 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4856 else
128cae6f3459 initial coding
carl
parents:
diff changeset
4857 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
4858 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
4859
128cae6f3459 initial coding
carl
parents:
diff changeset
4860 # Only actually do things if our run command is non-null.
128cae6f3459 initial coding
carl
parents:
diff changeset
4861 if test -z "$run"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
4862 # win32 will think the script is a binary if it has
128cae6f3459 initial coding
carl
parents:
diff changeset
4863 # a .exe suffix, so we strip it off here.
128cae6f3459 initial coding
carl
parents:
diff changeset
4864 case $output in
128cae6f3459 initial coding
carl
parents:
diff changeset
4865 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4866 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4867 # test for cygwin because mv fails w/o .exe extensions
128cae6f3459 initial coding
carl
parents:
diff changeset
4868 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
4869 *cygwin*)
128cae6f3459 initial coding
carl
parents:
diff changeset
4870 exeext=.exe
128cae6f3459 initial coding
carl
parents:
diff changeset
4871 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4872 *) exeext= ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
4873 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
4874 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
4875 *cygwin* | *mingw* )
128cae6f3459 initial coding
carl
parents:
diff changeset
4876 cwrappersource=`$echo ${objdir}/lt-${output}.c`
128cae6f3459 initial coding
carl
parents:
diff changeset
4877 cwrapper=`$echo ${output}.exe`
128cae6f3459 initial coding
carl
parents:
diff changeset
4878 $rm $cwrappersource $cwrapper
128cae6f3459 initial coding
carl
parents:
diff changeset
4879 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
128cae6f3459 initial coding
carl
parents:
diff changeset
4880
128cae6f3459 initial coding
carl
parents:
diff changeset
4881 cat > $cwrappersource <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
4882
128cae6f3459 initial coding
carl
parents:
diff changeset
4883 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
128cae6f3459 initial coding
carl
parents:
diff changeset
4884 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
128cae6f3459 initial coding
carl
parents:
diff changeset
4885
128cae6f3459 initial coding
carl
parents:
diff changeset
4886 The $output program cannot be directly executed until all the libtool
128cae6f3459 initial coding
carl
parents:
diff changeset
4887 libraries that it depends on are installed.
128cae6f3459 initial coding
carl
parents:
diff changeset
4888
128cae6f3459 initial coding
carl
parents:
diff changeset
4889 This wrapper executable should never be moved out of the build directory.
128cae6f3459 initial coding
carl
parents:
diff changeset
4890 If it is, it will not operate correctly.
128cae6f3459 initial coding
carl
parents:
diff changeset
4891
128cae6f3459 initial coding
carl
parents:
diff changeset
4892 Currently, it simply execs the wrapper *script* "/bin/sh $output",
128cae6f3459 initial coding
carl
parents:
diff changeset
4893 but could eventually absorb all of the scripts functionality and
128cae6f3459 initial coding
carl
parents:
diff changeset
4894 exec $objdir/$outputname directly.
128cae6f3459 initial coding
carl
parents:
diff changeset
4895 */
128cae6f3459 initial coding
carl
parents:
diff changeset
4896 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
4897 cat >> $cwrappersource<<"EOF"
128cae6f3459 initial coding
carl
parents:
diff changeset
4898 #include <stdio.h>
128cae6f3459 initial coding
carl
parents:
diff changeset
4899 #include <stdlib.h>
128cae6f3459 initial coding
carl
parents:
diff changeset
4900 #include <unistd.h>
128cae6f3459 initial coding
carl
parents:
diff changeset
4901 #include <malloc.h>
128cae6f3459 initial coding
carl
parents:
diff changeset
4902 #include <stdarg.h>
128cae6f3459 initial coding
carl
parents:
diff changeset
4903 #include <assert.h>
128cae6f3459 initial coding
carl
parents:
diff changeset
4904
128cae6f3459 initial coding
carl
parents:
diff changeset
4905 #if defined(PATH_MAX)
128cae6f3459 initial coding
carl
parents:
diff changeset
4906 # define LT_PATHMAX PATH_MAX
128cae6f3459 initial coding
carl
parents:
diff changeset
4907 #elif defined(MAXPATHLEN)
128cae6f3459 initial coding
carl
parents:
diff changeset
4908 # define LT_PATHMAX MAXPATHLEN
128cae6f3459 initial coding
carl
parents:
diff changeset
4909 #else
128cae6f3459 initial coding
carl
parents:
diff changeset
4910 # define LT_PATHMAX 1024
128cae6f3459 initial coding
carl
parents:
diff changeset
4911 #endif
128cae6f3459 initial coding
carl
parents:
diff changeset
4912
128cae6f3459 initial coding
carl
parents:
diff changeset
4913 #ifndef DIR_SEPARATOR
128cae6f3459 initial coding
carl
parents:
diff changeset
4914 #define DIR_SEPARATOR '/'
128cae6f3459 initial coding
carl
parents:
diff changeset
4915 #endif
128cae6f3459 initial coding
carl
parents:
diff changeset
4916
128cae6f3459 initial coding
carl
parents:
diff changeset
4917 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
128cae6f3459 initial coding
carl
parents:
diff changeset
4918 defined (__OS2__)
128cae6f3459 initial coding
carl
parents:
diff changeset
4919 #define HAVE_DOS_BASED_FILE_SYSTEM
128cae6f3459 initial coding
carl
parents:
diff changeset
4920 #ifndef DIR_SEPARATOR_2
128cae6f3459 initial coding
carl
parents:
diff changeset
4921 #define DIR_SEPARATOR_2 '\\'
128cae6f3459 initial coding
carl
parents:
diff changeset
4922 #endif
128cae6f3459 initial coding
carl
parents:
diff changeset
4923 #endif
128cae6f3459 initial coding
carl
parents:
diff changeset
4924
128cae6f3459 initial coding
carl
parents:
diff changeset
4925 #ifndef DIR_SEPARATOR_2
128cae6f3459 initial coding
carl
parents:
diff changeset
4926 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
128cae6f3459 initial coding
carl
parents:
diff changeset
4927 #else /* DIR_SEPARATOR_2 */
128cae6f3459 initial coding
carl
parents:
diff changeset
4928 # define IS_DIR_SEPARATOR(ch) \
128cae6f3459 initial coding
carl
parents:
diff changeset
4929 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
128cae6f3459 initial coding
carl
parents:
diff changeset
4930 #endif /* DIR_SEPARATOR_2 */
128cae6f3459 initial coding
carl
parents:
diff changeset
4931
128cae6f3459 initial coding
carl
parents:
diff changeset
4932 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
128cae6f3459 initial coding
carl
parents:
diff changeset
4933 #define XFREE(stale) do { \
128cae6f3459 initial coding
carl
parents:
diff changeset
4934 if (stale) { free ((void *) stale); stale = 0; } \
128cae6f3459 initial coding
carl
parents:
diff changeset
4935 } while (0)
128cae6f3459 initial coding
carl
parents:
diff changeset
4936
128cae6f3459 initial coding
carl
parents:
diff changeset
4937 const char *program_name = NULL;
128cae6f3459 initial coding
carl
parents:
diff changeset
4938
128cae6f3459 initial coding
carl
parents:
diff changeset
4939 void * xmalloc (size_t num);
128cae6f3459 initial coding
carl
parents:
diff changeset
4940 char * xstrdup (const char *string);
128cae6f3459 initial coding
carl
parents:
diff changeset
4941 char * basename (const char *name);
128cae6f3459 initial coding
carl
parents:
diff changeset
4942 char * fnqualify(const char *path);
128cae6f3459 initial coding
carl
parents:
diff changeset
4943 char * strendzap(char *str, const char *pat);
128cae6f3459 initial coding
carl
parents:
diff changeset
4944 void lt_fatal (const char *message, ...);
128cae6f3459 initial coding
carl
parents:
diff changeset
4945
128cae6f3459 initial coding
carl
parents:
diff changeset
4946 int
128cae6f3459 initial coding
carl
parents:
diff changeset
4947 main (int argc, char *argv[])
128cae6f3459 initial coding
carl
parents:
diff changeset
4948 {
128cae6f3459 initial coding
carl
parents:
diff changeset
4949 char **newargz;
128cae6f3459 initial coding
carl
parents:
diff changeset
4950 int i;
128cae6f3459 initial coding
carl
parents:
diff changeset
4951
128cae6f3459 initial coding
carl
parents:
diff changeset
4952 program_name = (char *) xstrdup ((char *) basename (argv[0]));
128cae6f3459 initial coding
carl
parents:
diff changeset
4953 newargz = XMALLOC(char *, argc+2);
128cae6f3459 initial coding
carl
parents:
diff changeset
4954 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
4955
128cae6f3459 initial coding
carl
parents:
diff changeset
4956 cat >> $cwrappersource <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
4957 newargz[0] = "$SHELL";
128cae6f3459 initial coding
carl
parents:
diff changeset
4958 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
4959
128cae6f3459 initial coding
carl
parents:
diff changeset
4960 cat >> $cwrappersource <<"EOF"
128cae6f3459 initial coding
carl
parents:
diff changeset
4961 newargz[1] = fnqualify(argv[0]);
128cae6f3459 initial coding
carl
parents:
diff changeset
4962 /* we know the script has the same name, without the .exe */
128cae6f3459 initial coding
carl
parents:
diff changeset
4963 /* so make sure newargz[1] doesn't end in .exe */
128cae6f3459 initial coding
carl
parents:
diff changeset
4964 strendzap(newargz[1],".exe");
128cae6f3459 initial coding
carl
parents:
diff changeset
4965 for (i = 1; i < argc; i++)
128cae6f3459 initial coding
carl
parents:
diff changeset
4966 newargz[i+1] = xstrdup(argv[i]);
128cae6f3459 initial coding
carl
parents:
diff changeset
4967 newargz[argc+1] = NULL;
128cae6f3459 initial coding
carl
parents:
diff changeset
4968 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
4969
128cae6f3459 initial coding
carl
parents:
diff changeset
4970 cat >> $cwrappersource <<EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
4971 execv("$SHELL",newargz);
128cae6f3459 initial coding
carl
parents:
diff changeset
4972 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
4973
128cae6f3459 initial coding
carl
parents:
diff changeset
4974 cat >> $cwrappersource <<"EOF"
128cae6f3459 initial coding
carl
parents:
diff changeset
4975 }
128cae6f3459 initial coding
carl
parents:
diff changeset
4976
128cae6f3459 initial coding
carl
parents:
diff changeset
4977 void *
128cae6f3459 initial coding
carl
parents:
diff changeset
4978 xmalloc (size_t num)
128cae6f3459 initial coding
carl
parents:
diff changeset
4979 {
128cae6f3459 initial coding
carl
parents:
diff changeset
4980 void * p = (void *) malloc (num);
128cae6f3459 initial coding
carl
parents:
diff changeset
4981 if (!p)
128cae6f3459 initial coding
carl
parents:
diff changeset
4982 lt_fatal ("Memory exhausted");
128cae6f3459 initial coding
carl
parents:
diff changeset
4983
128cae6f3459 initial coding
carl
parents:
diff changeset
4984 return p;
128cae6f3459 initial coding
carl
parents:
diff changeset
4985 }
128cae6f3459 initial coding
carl
parents:
diff changeset
4986
128cae6f3459 initial coding
carl
parents:
diff changeset
4987 char *
128cae6f3459 initial coding
carl
parents:
diff changeset
4988 xstrdup (const char *string)
128cae6f3459 initial coding
carl
parents:
diff changeset
4989 {
128cae6f3459 initial coding
carl
parents:
diff changeset
4990 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
128cae6f3459 initial coding
carl
parents:
diff changeset
4991 ;
128cae6f3459 initial coding
carl
parents:
diff changeset
4992 }
128cae6f3459 initial coding
carl
parents:
diff changeset
4993
128cae6f3459 initial coding
carl
parents:
diff changeset
4994 char *
128cae6f3459 initial coding
carl
parents:
diff changeset
4995 basename (const char *name)
128cae6f3459 initial coding
carl
parents:
diff changeset
4996 {
128cae6f3459 initial coding
carl
parents:
diff changeset
4997 const char *base;
128cae6f3459 initial coding
carl
parents:
diff changeset
4998
128cae6f3459 initial coding
carl
parents:
diff changeset
4999 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
128cae6f3459 initial coding
carl
parents:
diff changeset
5000 /* Skip over the disk name in MSDOS pathnames. */
128cae6f3459 initial coding
carl
parents:
diff changeset
5001 if (isalpha (name[0]) && name[1] == ':')
128cae6f3459 initial coding
carl
parents:
diff changeset
5002 name += 2;
128cae6f3459 initial coding
carl
parents:
diff changeset
5003 #endif
128cae6f3459 initial coding
carl
parents:
diff changeset
5004
128cae6f3459 initial coding
carl
parents:
diff changeset
5005 for (base = name; *name; name++)
128cae6f3459 initial coding
carl
parents:
diff changeset
5006 if (IS_DIR_SEPARATOR (*name))
128cae6f3459 initial coding
carl
parents:
diff changeset
5007 base = name + 1;
128cae6f3459 initial coding
carl
parents:
diff changeset
5008 return (char *) base;
128cae6f3459 initial coding
carl
parents:
diff changeset
5009 }
128cae6f3459 initial coding
carl
parents:
diff changeset
5010
128cae6f3459 initial coding
carl
parents:
diff changeset
5011 char *
128cae6f3459 initial coding
carl
parents:
diff changeset
5012 fnqualify(const char *path)
128cae6f3459 initial coding
carl
parents:
diff changeset
5013 {
128cae6f3459 initial coding
carl
parents:
diff changeset
5014 size_t size;
128cae6f3459 initial coding
carl
parents:
diff changeset
5015 char *p;
128cae6f3459 initial coding
carl
parents:
diff changeset
5016 char tmp[LT_PATHMAX + 1];
128cae6f3459 initial coding
carl
parents:
diff changeset
5017
128cae6f3459 initial coding
carl
parents:
diff changeset
5018 assert(path != NULL);
128cae6f3459 initial coding
carl
parents:
diff changeset
5019
128cae6f3459 initial coding
carl
parents:
diff changeset
5020 /* Is it qualified already? */
128cae6f3459 initial coding
carl
parents:
diff changeset
5021 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
128cae6f3459 initial coding
carl
parents:
diff changeset
5022 if (isalpha (path[0]) && path[1] == ':')
128cae6f3459 initial coding
carl
parents:
diff changeset
5023 return xstrdup (path);
128cae6f3459 initial coding
carl
parents:
diff changeset
5024 #endif
128cae6f3459 initial coding
carl
parents:
diff changeset
5025 if (IS_DIR_SEPARATOR (path[0]))
128cae6f3459 initial coding
carl
parents:
diff changeset
5026 return xstrdup (path);
128cae6f3459 initial coding
carl
parents:
diff changeset
5027
128cae6f3459 initial coding
carl
parents:
diff changeset
5028 /* prepend the current directory */
128cae6f3459 initial coding
carl
parents:
diff changeset
5029 /* doesn't handle '~' */
128cae6f3459 initial coding
carl
parents:
diff changeset
5030 if (getcwd (tmp, LT_PATHMAX) == NULL)
128cae6f3459 initial coding
carl
parents:
diff changeset
5031 lt_fatal ("getcwd failed");
128cae6f3459 initial coding
carl
parents:
diff changeset
5032 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
128cae6f3459 initial coding
carl
parents:
diff changeset
5033 p = XMALLOC(char, size);
128cae6f3459 initial coding
carl
parents:
diff changeset
5034 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
128cae6f3459 initial coding
carl
parents:
diff changeset
5035 return p;
128cae6f3459 initial coding
carl
parents:
diff changeset
5036 }
128cae6f3459 initial coding
carl
parents:
diff changeset
5037
128cae6f3459 initial coding
carl
parents:
diff changeset
5038 char *
128cae6f3459 initial coding
carl
parents:
diff changeset
5039 strendzap(char *str, const char *pat)
128cae6f3459 initial coding
carl
parents:
diff changeset
5040 {
128cae6f3459 initial coding
carl
parents:
diff changeset
5041 size_t len, patlen;
128cae6f3459 initial coding
carl
parents:
diff changeset
5042
128cae6f3459 initial coding
carl
parents:
diff changeset
5043 assert(str != NULL);
128cae6f3459 initial coding
carl
parents:
diff changeset
5044 assert(pat != NULL);
128cae6f3459 initial coding
carl
parents:
diff changeset
5045
128cae6f3459 initial coding
carl
parents:
diff changeset
5046 len = strlen(str);
128cae6f3459 initial coding
carl
parents:
diff changeset
5047 patlen = strlen(pat);
128cae6f3459 initial coding
carl
parents:
diff changeset
5048
128cae6f3459 initial coding
carl
parents:
diff changeset
5049 if (patlen <= len)
128cae6f3459 initial coding
carl
parents:
diff changeset
5050 {
128cae6f3459 initial coding
carl
parents:
diff changeset
5051 str += len - patlen;
128cae6f3459 initial coding
carl
parents:
diff changeset
5052 if (strcmp(str, pat) == 0)
128cae6f3459 initial coding
carl
parents:
diff changeset
5053 *str = '\0';
128cae6f3459 initial coding
carl
parents:
diff changeset
5054 }
128cae6f3459 initial coding
carl
parents:
diff changeset
5055 return str;
128cae6f3459 initial coding
carl
parents:
diff changeset
5056 }
128cae6f3459 initial coding
carl
parents:
diff changeset
5057
128cae6f3459 initial coding
carl
parents:
diff changeset
5058 static void
128cae6f3459 initial coding
carl
parents:
diff changeset
5059 lt_error_core (int exit_status, const char * mode,
128cae6f3459 initial coding
carl
parents:
diff changeset
5060 const char * message, va_list ap)
128cae6f3459 initial coding
carl
parents:
diff changeset
5061 {
128cae6f3459 initial coding
carl
parents:
diff changeset
5062 fprintf (stderr, "%s: %s: ", program_name, mode);
128cae6f3459 initial coding
carl
parents:
diff changeset
5063 vfprintf (stderr, message, ap);
128cae6f3459 initial coding
carl
parents:
diff changeset
5064 fprintf (stderr, ".\n");
128cae6f3459 initial coding
carl
parents:
diff changeset
5065
128cae6f3459 initial coding
carl
parents:
diff changeset
5066 if (exit_status >= 0)
128cae6f3459 initial coding
carl
parents:
diff changeset
5067 exit (exit_status);
128cae6f3459 initial coding
carl
parents:
diff changeset
5068 }
128cae6f3459 initial coding
carl
parents:
diff changeset
5069
128cae6f3459 initial coding
carl
parents:
diff changeset
5070 void
128cae6f3459 initial coding
carl
parents:
diff changeset
5071 lt_fatal (const char *message, ...)
128cae6f3459 initial coding
carl
parents:
diff changeset
5072 {
128cae6f3459 initial coding
carl
parents:
diff changeset
5073 va_list ap;
128cae6f3459 initial coding
carl
parents:
diff changeset
5074 va_start (ap, message);
128cae6f3459 initial coding
carl
parents:
diff changeset
5075 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
128cae6f3459 initial coding
carl
parents:
diff changeset
5076 va_end (ap);
128cae6f3459 initial coding
carl
parents:
diff changeset
5077 }
128cae6f3459 initial coding
carl
parents:
diff changeset
5078 EOF
128cae6f3459 initial coding
carl
parents:
diff changeset
5079 # we should really use a build-platform specific compiler
128cae6f3459 initial coding
carl
parents:
diff changeset
5080 # here, but OTOH, the wrappers (shell script and this C one)
128cae6f3459 initial coding
carl
parents:
diff changeset
5081 # are only useful if you want to execute the "real" binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
5082 # Since the "real" binary is built for $host, then this
128cae6f3459 initial coding
carl
parents:
diff changeset
5083 # wrapper might as well be built for $host, too.
128cae6f3459 initial coding
carl
parents:
diff changeset
5084 $run $LTCC -s -o $cwrapper $cwrappersource
128cae6f3459 initial coding
carl
parents:
diff changeset
5085 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5086 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5087 $rm $output
128cae6f3459 initial coding
carl
parents:
diff changeset
5088 trap "$rm $output; exit 1" 1 2 15
128cae6f3459 initial coding
carl
parents:
diff changeset
5089
128cae6f3459 initial coding
carl
parents:
diff changeset
5090 $echo > $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5091 #! $SHELL
128cae6f3459 initial coding
carl
parents:
diff changeset
5092
128cae6f3459 initial coding
carl
parents:
diff changeset
5093 # $output - temporary wrapper script for $objdir/$outputname
128cae6f3459 initial coding
carl
parents:
diff changeset
5094 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
128cae6f3459 initial coding
carl
parents:
diff changeset
5095 #
128cae6f3459 initial coding
carl
parents:
diff changeset
5096 # The $output program cannot be directly executed until all the libtool
128cae6f3459 initial coding
carl
parents:
diff changeset
5097 # libraries that it depends on are installed.
128cae6f3459 initial coding
carl
parents:
diff changeset
5098 #
128cae6f3459 initial coding
carl
parents:
diff changeset
5099 # This wrapper script should never be moved out of the build directory.
128cae6f3459 initial coding
carl
parents:
diff changeset
5100 # If it is, it will not operate correctly.
128cae6f3459 initial coding
carl
parents:
diff changeset
5101
128cae6f3459 initial coding
carl
parents:
diff changeset
5102 # Sed substitution that helps us do robust quoting. It backslashifies
128cae6f3459 initial coding
carl
parents:
diff changeset
5103 # metacharacters that are still active within double-quoted strings.
128cae6f3459 initial coding
carl
parents:
diff changeset
5104 Xsed='${SED} -e 1s/^X//'
128cae6f3459 initial coding
carl
parents:
diff changeset
5105 sed_quote_subst='$sed_quote_subst'
128cae6f3459 initial coding
carl
parents:
diff changeset
5106
128cae6f3459 initial coding
carl
parents:
diff changeset
5107 # The HP-UX ksh and POSIX shell print the target directory to stdout
128cae6f3459 initial coding
carl
parents:
diff changeset
5108 # if CDPATH is set.
128cae6f3459 initial coding
carl
parents:
diff changeset
5109 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5110
128cae6f3459 initial coding
carl
parents:
diff changeset
5111 relink_command=\"$relink_command\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5112
128cae6f3459 initial coding
carl
parents:
diff changeset
5113 # This environment variable determines our operation mode.
128cae6f3459 initial coding
carl
parents:
diff changeset
5114 if test \"\$libtool_install_magic\" = \"$magic\"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5115 # install mode needs the following variable:
128cae6f3459 initial coding
carl
parents:
diff changeset
5116 notinst_deplibs='$notinst_deplibs'
128cae6f3459 initial coding
carl
parents:
diff changeset
5117 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5118 # When we are sourced in execute mode, \$file and \$echo are already set.
128cae6f3459 initial coding
carl
parents:
diff changeset
5119 if test \"\$libtool_execute_magic\" != \"$magic\"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5120 echo=\"$qecho\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5121 file=\"\$0\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5122 # Make sure echo works.
128cae6f3459 initial coding
carl
parents:
diff changeset
5123 if test \"X\$1\" = X--no-reexec; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5124 # Discard the --no-reexec flag, and continue.
128cae6f3459 initial coding
carl
parents:
diff changeset
5125 shift
128cae6f3459 initial coding
carl
parents:
diff changeset
5126 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5127 # Yippee, \$echo works!
128cae6f3459 initial coding
carl
parents:
diff changeset
5128 :
128cae6f3459 initial coding
carl
parents:
diff changeset
5129 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5130 # Restart under the correct shell, and then maybe \$echo will work.
128cae6f3459 initial coding
carl
parents:
diff changeset
5131 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
128cae6f3459 initial coding
carl
parents:
diff changeset
5132 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5133 fi\
128cae6f3459 initial coding
carl
parents:
diff changeset
5134 "
128cae6f3459 initial coding
carl
parents:
diff changeset
5135 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5136
128cae6f3459 initial coding
carl
parents:
diff changeset
5137 # Find the directory that this script lives in.
128cae6f3459 initial coding
carl
parents:
diff changeset
5138 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
128cae6f3459 initial coding
carl
parents:
diff changeset
5139 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
128cae6f3459 initial coding
carl
parents:
diff changeset
5140
128cae6f3459 initial coding
carl
parents:
diff changeset
5141 # Follow symbolic links until we get to the real thisdir.
128cae6f3459 initial coding
carl
parents:
diff changeset
5142 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
128cae6f3459 initial coding
carl
parents:
diff changeset
5143 while test -n \"\$file\"; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5144 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
128cae6f3459 initial coding
carl
parents:
diff changeset
5145
128cae6f3459 initial coding
carl
parents:
diff changeset
5146 # If there was a directory component, then change thisdir.
128cae6f3459 initial coding
carl
parents:
diff changeset
5147 if test \"x\$destdir\" != \"x\$file\"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5148 case \"\$destdir\" in
128cae6f3459 initial coding
carl
parents:
diff changeset
5149 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5150 *) thisdir=\"\$thisdir/\$destdir\" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5151 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5152 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5153
128cae6f3459 initial coding
carl
parents:
diff changeset
5154 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
128cae6f3459 initial coding
carl
parents:
diff changeset
5155 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
128cae6f3459 initial coding
carl
parents:
diff changeset
5156 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5157
128cae6f3459 initial coding
carl
parents:
diff changeset
5158 # Try to get the absolute directory name.
128cae6f3459 initial coding
carl
parents:
diff changeset
5159 absdir=\`cd \"\$thisdir\" && pwd\`
128cae6f3459 initial coding
carl
parents:
diff changeset
5160 test -n \"\$absdir\" && thisdir=\"\$absdir\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5161 "
128cae6f3459 initial coding
carl
parents:
diff changeset
5162
128cae6f3459 initial coding
carl
parents:
diff changeset
5163 if test "$fast_install" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5164 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5165 program=lt-'$outputname'$exeext
128cae6f3459 initial coding
carl
parents:
diff changeset
5166 progdir=\"\$thisdir/$objdir\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5167
128cae6f3459 initial coding
carl
parents:
diff changeset
5168 if test ! -f \"\$progdir/\$program\" || \\
128cae6f3459 initial coding
carl
parents:
diff changeset
5169 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
128cae6f3459 initial coding
carl
parents:
diff changeset
5170 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5171
128cae6f3459 initial coding
carl
parents:
diff changeset
5172 file=\"\$\$-\$program\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5173
128cae6f3459 initial coding
carl
parents:
diff changeset
5174 if test ! -d \"\$progdir\"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5175 $mkdir \"\$progdir\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5176 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5177 $rm \"\$progdir/\$file\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5178 fi"
128cae6f3459 initial coding
carl
parents:
diff changeset
5179
128cae6f3459 initial coding
carl
parents:
diff changeset
5180 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5181
128cae6f3459 initial coding
carl
parents:
diff changeset
5182 # relink executable if necessary
128cae6f3459 initial coding
carl
parents:
diff changeset
5183 if test -n \"\$relink_command\"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5184 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
5185 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5186 $echo \"\$relink_command_output\" >&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5187 $rm \"\$progdir/\$file\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5188 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5189 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5190 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5191
128cae6f3459 initial coding
carl
parents:
diff changeset
5192 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
128cae6f3459 initial coding
carl
parents:
diff changeset
5193 { $rm \"\$progdir/\$program\";
128cae6f3459 initial coding
carl
parents:
diff changeset
5194 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
128cae6f3459 initial coding
carl
parents:
diff changeset
5195 $rm \"\$progdir/\$file\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5196 fi"
128cae6f3459 initial coding
carl
parents:
diff changeset
5197 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5198 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5199 program='$outputname'
128cae6f3459 initial coding
carl
parents:
diff changeset
5200 progdir=\"\$thisdir/$objdir\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5201 "
128cae6f3459 initial coding
carl
parents:
diff changeset
5202 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5203
128cae6f3459 initial coding
carl
parents:
diff changeset
5204 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5205
128cae6f3459 initial coding
carl
parents:
diff changeset
5206 if test -f \"\$progdir/\$program\"; then"
128cae6f3459 initial coding
carl
parents:
diff changeset
5207
128cae6f3459 initial coding
carl
parents:
diff changeset
5208 # Export our shlibpath_var if we have one.
128cae6f3459 initial coding
carl
parents:
diff changeset
5209 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5210 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5211 # Add our own library path to $shlibpath_var
128cae6f3459 initial coding
carl
parents:
diff changeset
5212 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5213
128cae6f3459 initial coding
carl
parents:
diff changeset
5214 # Some systems cannot cope with colon-terminated $shlibpath_var
128cae6f3459 initial coding
carl
parents:
diff changeset
5215 # The second colon is a workaround for a bug in BeOS R4 sed
128cae6f3459 initial coding
carl
parents:
diff changeset
5216 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
128cae6f3459 initial coding
carl
parents:
diff changeset
5217
128cae6f3459 initial coding
carl
parents:
diff changeset
5218 export $shlibpath_var
128cae6f3459 initial coding
carl
parents:
diff changeset
5219 "
128cae6f3459 initial coding
carl
parents:
diff changeset
5220 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5221
128cae6f3459 initial coding
carl
parents:
diff changeset
5222 # fixup the dll searchpath if we need to.
128cae6f3459 initial coding
carl
parents:
diff changeset
5223 if test -n "$dllsearchpath"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5224 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5225 # Add the dll search path components to the executable PATH
128cae6f3459 initial coding
carl
parents:
diff changeset
5226 PATH=$dllsearchpath:\$PATH
128cae6f3459 initial coding
carl
parents:
diff changeset
5227 "
128cae6f3459 initial coding
carl
parents:
diff changeset
5228 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5229
128cae6f3459 initial coding
carl
parents:
diff changeset
5230 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5231 if test \"\$libtool_execute_magic\" != \"$magic\"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5232 # Run the actual program with our arguments.
128cae6f3459 initial coding
carl
parents:
diff changeset
5233 "
128cae6f3459 initial coding
carl
parents:
diff changeset
5234 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
5235 # Backslashes separate directories on plain windows
128cae6f3459 initial coding
carl
parents:
diff changeset
5236 *-*-mingw | *-*-os2*)
128cae6f3459 initial coding
carl
parents:
diff changeset
5237 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5238 exec \$progdir\\\\\$program \${1+\"\$@\"}
128cae6f3459 initial coding
carl
parents:
diff changeset
5239 "
128cae6f3459 initial coding
carl
parents:
diff changeset
5240 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5241
128cae6f3459 initial coding
carl
parents:
diff changeset
5242 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
5243 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5244 exec \$progdir/\$program \${1+\"\$@\"}
128cae6f3459 initial coding
carl
parents:
diff changeset
5245 "
128cae6f3459 initial coding
carl
parents:
diff changeset
5246 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5247 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5248 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5249 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5250 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5251 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5252 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5253 # The program doesn't exist.
128cae6f3459 initial coding
carl
parents:
diff changeset
5254 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5255 \$echo \"This script is just a wrapper for \$program.\" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5256 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5257 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5258 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5259 fi\
128cae6f3459 initial coding
carl
parents:
diff changeset
5260 "
128cae6f3459 initial coding
carl
parents:
diff changeset
5261 chmod +x $output
128cae6f3459 initial coding
carl
parents:
diff changeset
5262 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5263 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
5264 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5265 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5266
128cae6f3459 initial coding
carl
parents:
diff changeset
5267 # See if we need to build an old-fashioned archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
5268 for oldlib in $oldlibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5269
128cae6f3459 initial coding
carl
parents:
diff changeset
5270 if test "$build_libtool_libs" = convenience; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5271 oldobjs="$libobjs_save"
128cae6f3459 initial coding
carl
parents:
diff changeset
5272 addlibs="$convenience"
128cae6f3459 initial coding
carl
parents:
diff changeset
5273 build_libtool_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
5274 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5275 if test "$build_libtool_libs" = module; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5276 oldobjs="$libobjs_save"
128cae6f3459 initial coding
carl
parents:
diff changeset
5277 build_libtool_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
5278 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5279 oldobjs="$old_deplibs $non_pic_objects"
128cae6f3459 initial coding
carl
parents:
diff changeset
5280 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5281 addlibs="$old_convenience"
128cae6f3459 initial coding
carl
parents:
diff changeset
5282 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5283
128cae6f3459 initial coding
carl
parents:
diff changeset
5284 if test -n "$addlibs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5285 gentop="$output_objdir/${outputname}x"
128cae6f3459 initial coding
carl
parents:
diff changeset
5286 $show "${rm}r $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
5287 $run ${rm}r "$gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
5288 $show "$mkdir $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
5289 $run $mkdir "$gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
5290 status=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
5291 if test "$status" -ne 0 && test ! -d "$gentop"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5292 exit $status
128cae6f3459 initial coding
carl
parents:
diff changeset
5293 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5294 generated="$generated $gentop"
128cae6f3459 initial coding
carl
parents:
diff changeset
5295
128cae6f3459 initial coding
carl
parents:
diff changeset
5296 # Add in members from convenience archives.
128cae6f3459 initial coding
carl
parents:
diff changeset
5297 for xlib in $addlibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5298 # Extract the objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
5299 case $xlib in
128cae6f3459 initial coding
carl
parents:
diff changeset
5300 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5301 *) xabs=`pwd`"/$xlib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5302 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5303 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5304 xdir="$gentop/$xlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
5305
128cae6f3459 initial coding
carl
parents:
diff changeset
5306 $show "${rm}r $xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
5307 $run ${rm}r "$xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
5308 $show "$mkdir $xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
5309 $run $mkdir "$xdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
5310 status=$?
128cae6f3459 initial coding
carl
parents:
diff changeset
5311 if test "$status" -ne 0 && test ! -d "$xdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5312 exit $status
128cae6f3459 initial coding
carl
parents:
diff changeset
5313 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5314 # We will extract separately just the conflicting names and we will no
128cae6f3459 initial coding
carl
parents:
diff changeset
5315 # longer touch any unique names. It is faster to leave these extract
128cae6f3459 initial coding
carl
parents:
diff changeset
5316 # automatically by $AR in one run.
128cae6f3459 initial coding
carl
parents:
diff changeset
5317 $show "(cd $xdir && $AR x $xabs)"
128cae6f3459 initial coding
carl
parents:
diff changeset
5318 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5319 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
128cae6f3459 initial coding
carl
parents:
diff changeset
5320 :
128cae6f3459 initial coding
carl
parents:
diff changeset
5321 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5322 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5323 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5324 $AR t "$xabs" | sort | uniq -cd | while read -r count name
128cae6f3459 initial coding
carl
parents:
diff changeset
5325 do
128cae6f3459 initial coding
carl
parents:
diff changeset
5326 i=1
128cae6f3459 initial coding
carl
parents:
diff changeset
5327 while test "$i" -le "$count"
128cae6f3459 initial coding
carl
parents:
diff changeset
5328 do
128cae6f3459 initial coding
carl
parents:
diff changeset
5329 # Put our $i before any first dot (extension)
128cae6f3459 initial coding
carl
parents:
diff changeset
5330 # Never overwrite any file
128cae6f3459 initial coding
carl
parents:
diff changeset
5331 name_to="$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
5332 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
128cae6f3459 initial coding
carl
parents:
diff changeset
5333 do
128cae6f3459 initial coding
carl
parents:
diff changeset
5334 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5335 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5336 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
128cae6f3459 initial coding
carl
parents:
diff changeset
5337 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5338 i=`expr $i + 1`
128cae6f3459 initial coding
carl
parents:
diff changeset
5339 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5340 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5341 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5342
128cae6f3459 initial coding
carl
parents:
diff changeset
5343 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
128cae6f3459 initial coding
carl
parents:
diff changeset
5344 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5345 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5346
128cae6f3459 initial coding
carl
parents:
diff changeset
5347 compiler_flags="$compiler_flags $add_flags"
128cae6f3459 initial coding
carl
parents:
diff changeset
5348
128cae6f3459 initial coding
carl
parents:
diff changeset
5349 # Do each command in the archive commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
5350 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5351 eval cmds=\"$old_archive_from_new_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5352 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5353 eval cmds=\"$old_archive_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5354
128cae6f3459 initial coding
carl
parents:
diff changeset
5355 if len=`expr "X$cmds" : ".*"` &&
128cae6f3459 initial coding
carl
parents:
diff changeset
5356 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5357 :
128cae6f3459 initial coding
carl
parents:
diff changeset
5358 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5359 # the command line is too long to link in one step, link in parts
128cae6f3459 initial coding
carl
parents:
diff changeset
5360 $echo "using piecewise archive linking..."
128cae6f3459 initial coding
carl
parents:
diff changeset
5361 save_RANLIB=$RANLIB
128cae6f3459 initial coding
carl
parents:
diff changeset
5362 RANLIB=:
128cae6f3459 initial coding
carl
parents:
diff changeset
5363 objlist=
128cae6f3459 initial coding
carl
parents:
diff changeset
5364 concat_cmds=
128cae6f3459 initial coding
carl
parents:
diff changeset
5365 save_oldobjs=$oldobjs
128cae6f3459 initial coding
carl
parents:
diff changeset
5366 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
128cae6f3459 initial coding
carl
parents:
diff changeset
5367 # encoded into archives. This makes 'ar r' malfunction in
128cae6f3459 initial coding
carl
parents:
diff changeset
5368 # this piecewise linking case whenever conflicting object
128cae6f3459 initial coding
carl
parents:
diff changeset
5369 # names appear in distinct ar calls; check, warn and compensate.
128cae6f3459 initial coding
carl
parents:
diff changeset
5370 if (for obj in $save_oldobjs
128cae6f3459 initial coding
carl
parents:
diff changeset
5371 do
128cae6f3459 initial coding
carl
parents:
diff changeset
5372 $echo "X$obj" | $Xsed -e 's%^.*/%%'
128cae6f3459 initial coding
carl
parents:
diff changeset
5373 done | sort | sort -uc >/dev/null 2>&1); then
128cae6f3459 initial coding
carl
parents:
diff changeset
5374 :
128cae6f3459 initial coding
carl
parents:
diff changeset
5375 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5376 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5377 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5378 AR_FLAGS=cq
128cae6f3459 initial coding
carl
parents:
diff changeset
5379 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5380 # Is there a better way of finding the last object in the list?
128cae6f3459 initial coding
carl
parents:
diff changeset
5381 for obj in $save_oldobjs
128cae6f3459 initial coding
carl
parents:
diff changeset
5382 do
128cae6f3459 initial coding
carl
parents:
diff changeset
5383 last_oldobj=$obj
128cae6f3459 initial coding
carl
parents:
diff changeset
5384 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5385 for obj in $save_oldobjs
128cae6f3459 initial coding
carl
parents:
diff changeset
5386 do
128cae6f3459 initial coding
carl
parents:
diff changeset
5387 oldobjs="$objlist $obj"
128cae6f3459 initial coding
carl
parents:
diff changeset
5388 objlist="$objlist $obj"
128cae6f3459 initial coding
carl
parents:
diff changeset
5389 eval test_cmds=\"$old_archive_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5390 if len=`expr "X$test_cmds" : ".*"` &&
128cae6f3459 initial coding
carl
parents:
diff changeset
5391 test "$len" -le "$max_cmd_len"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5392 :
128cae6f3459 initial coding
carl
parents:
diff changeset
5393 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5394 # the above command should be used before it gets too long
128cae6f3459 initial coding
carl
parents:
diff changeset
5395 oldobjs=$objlist
128cae6f3459 initial coding
carl
parents:
diff changeset
5396 if test "$obj" = "$last_oldobj" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5397 RANLIB=$save_RANLIB
128cae6f3459 initial coding
carl
parents:
diff changeset
5398 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5399 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
128cae6f3459 initial coding
carl
parents:
diff changeset
5400 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5401 objlist=
128cae6f3459 initial coding
carl
parents:
diff changeset
5402 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5403 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5404 RANLIB=$save_RANLIB
128cae6f3459 initial coding
carl
parents:
diff changeset
5405 oldobjs=$objlist
128cae6f3459 initial coding
carl
parents:
diff changeset
5406 if test "X$oldobjs" = "X" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5407 eval cmds=\"\$concat_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5408 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5409 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5410 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5411 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5412 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5413 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
5414 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5415 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
5416 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
5417 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5418 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5419 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
5420 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5421
128cae6f3459 initial coding
carl
parents:
diff changeset
5422 if test -n "$generated"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5423 $show "${rm}r$generated"
128cae6f3459 initial coding
carl
parents:
diff changeset
5424 $run ${rm}r$generated
128cae6f3459 initial coding
carl
parents:
diff changeset
5425 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5426
128cae6f3459 initial coding
carl
parents:
diff changeset
5427 # Now create the libtool archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
5428 case $output in
128cae6f3459 initial coding
carl
parents:
diff changeset
5429 *.la)
128cae6f3459 initial coding
carl
parents:
diff changeset
5430 old_library=
128cae6f3459 initial coding
carl
parents:
diff changeset
5431 test "$build_old_libs" = yes && old_library="$libname.$libext"
128cae6f3459 initial coding
carl
parents:
diff changeset
5432 $show "creating $output"
128cae6f3459 initial coding
carl
parents:
diff changeset
5433
128cae6f3459 initial coding
carl
parents:
diff changeset
5434 # Preserve any variables that may affect compiler behavior
128cae6f3459 initial coding
carl
parents:
diff changeset
5435 for var in $variables_saved_for_relink; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5436 if eval test -z \"\${$var+set}\"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5437 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
5438 elif eval var_value=\$$var; test -z "$var_value"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5439 relink_command="$var=; export $var; $relink_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
5440 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5441 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5442 relink_command="$var=\"$var_value\"; export $var; $relink_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
5443 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5444 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5445 # Quote the link command for shipping.
128cae6f3459 initial coding
carl
parents:
diff changeset
5446 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
128cae6f3459 initial coding
carl
parents:
diff changeset
5447 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5448 if test "$hardcode_automatic" = yes ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5449 relink_command=
128cae6f3459 initial coding
carl
parents:
diff changeset
5450 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5451 # Only create the output if not a dry run.
128cae6f3459 initial coding
carl
parents:
diff changeset
5452 if test -z "$run"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5453 for installed in no yes; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5454 if test "$installed" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5455 if test -z "$install_libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5456 break
128cae6f3459 initial coding
carl
parents:
diff changeset
5457 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5458 output="$output_objdir/$outputname"i
128cae6f3459 initial coding
carl
parents:
diff changeset
5459 # Replace all uninstalled libtool libraries with the installed ones
128cae6f3459 initial coding
carl
parents:
diff changeset
5460 newdependency_libs=
128cae6f3459 initial coding
carl
parents:
diff changeset
5461 for deplib in $dependency_libs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5462 case $deplib in
128cae6f3459 initial coding
carl
parents:
diff changeset
5463 *.la)
128cae6f3459 initial coding
carl
parents:
diff changeset
5464 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5465 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
128cae6f3459 initial coding
carl
parents:
diff changeset
5466 if test -z "$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5467 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5468 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5469 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5470 newdependency_libs="$newdependency_libs $libdir/$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
5471 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5472 *) newdependency_libs="$newdependency_libs $deplib" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5473 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5474 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5475 dependency_libs="$newdependency_libs"
128cae6f3459 initial coding
carl
parents:
diff changeset
5476 newdlfiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
5477 for lib in $dlfiles; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5478 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5479 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
128cae6f3459 initial coding
carl
parents:
diff changeset
5480 if test -z "$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5481 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5482 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5483 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5484 newdlfiles="$newdlfiles $libdir/$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
5485 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5486 dlfiles="$newdlfiles"
128cae6f3459 initial coding
carl
parents:
diff changeset
5487 newdlprefiles=
128cae6f3459 initial coding
carl
parents:
diff changeset
5488 for lib in $dlprefiles; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5489 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5490 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
128cae6f3459 initial coding
carl
parents:
diff changeset
5491 if test -z "$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5492 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5493 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5494 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5495 newdlprefiles="$newdlprefiles $libdir/$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
5496 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5497 dlprefiles="$newdlprefiles"
128cae6f3459 initial coding
carl
parents:
diff changeset
5498 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5499 $rm $output
128cae6f3459 initial coding
carl
parents:
diff changeset
5500 # place dlname in correct position for cygwin
128cae6f3459 initial coding
carl
parents:
diff changeset
5501 tdlname=$dlname
128cae6f3459 initial coding
carl
parents:
diff changeset
5502 case $host,$output,$installed,$module,$dlname in
128cae6f3459 initial coding
carl
parents:
diff changeset
5503 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5504 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5505 $echo > $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5506 # $outputname - a libtool library file
128cae6f3459 initial coding
carl
parents:
diff changeset
5507 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
128cae6f3459 initial coding
carl
parents:
diff changeset
5508 #
128cae6f3459 initial coding
carl
parents:
diff changeset
5509 # Please DO NOT delete this file!
128cae6f3459 initial coding
carl
parents:
diff changeset
5510 # It is necessary for linking the library.
128cae6f3459 initial coding
carl
parents:
diff changeset
5511
128cae6f3459 initial coding
carl
parents:
diff changeset
5512 # The name that we can dlopen(3).
128cae6f3459 initial coding
carl
parents:
diff changeset
5513 dlname='$tdlname'
128cae6f3459 initial coding
carl
parents:
diff changeset
5514
128cae6f3459 initial coding
carl
parents:
diff changeset
5515 # Names of this library.
128cae6f3459 initial coding
carl
parents:
diff changeset
5516 library_names='$library_names'
128cae6f3459 initial coding
carl
parents:
diff changeset
5517
128cae6f3459 initial coding
carl
parents:
diff changeset
5518 # The name of the static archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
5519 old_library='$old_library'
128cae6f3459 initial coding
carl
parents:
diff changeset
5520
128cae6f3459 initial coding
carl
parents:
diff changeset
5521 # Libraries that this one depends upon.
128cae6f3459 initial coding
carl
parents:
diff changeset
5522 dependency_libs='$dependency_libs'
128cae6f3459 initial coding
carl
parents:
diff changeset
5523
128cae6f3459 initial coding
carl
parents:
diff changeset
5524 # Version information for $libname.
128cae6f3459 initial coding
carl
parents:
diff changeset
5525 current=$current
128cae6f3459 initial coding
carl
parents:
diff changeset
5526 age=$age
128cae6f3459 initial coding
carl
parents:
diff changeset
5527 revision=$revision
128cae6f3459 initial coding
carl
parents:
diff changeset
5528
128cae6f3459 initial coding
carl
parents:
diff changeset
5529 # Is this an already installed library?
128cae6f3459 initial coding
carl
parents:
diff changeset
5530 installed=$installed
128cae6f3459 initial coding
carl
parents:
diff changeset
5531
128cae6f3459 initial coding
carl
parents:
diff changeset
5532 # Should we warn about portability when linking against -modules?
128cae6f3459 initial coding
carl
parents:
diff changeset
5533 shouldnotlink=$module
128cae6f3459 initial coding
carl
parents:
diff changeset
5534
128cae6f3459 initial coding
carl
parents:
diff changeset
5535 # Files to dlopen/dlpreopen
128cae6f3459 initial coding
carl
parents:
diff changeset
5536 dlopen='$dlfiles'
128cae6f3459 initial coding
carl
parents:
diff changeset
5537 dlpreopen='$dlprefiles'
128cae6f3459 initial coding
carl
parents:
diff changeset
5538
128cae6f3459 initial coding
carl
parents:
diff changeset
5539 # Directory that this library needs to be installed in:
128cae6f3459 initial coding
carl
parents:
diff changeset
5540 libdir='$install_libdir'"
128cae6f3459 initial coding
carl
parents:
diff changeset
5541 if test "$installed" = no && test "$need_relink" = yes && test "$fast_install" = no; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5542 $echo >> $output "\
128cae6f3459 initial coding
carl
parents:
diff changeset
5543 relink_command=\"$relink_command\""
128cae6f3459 initial coding
carl
parents:
diff changeset
5544 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5545 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5546 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5547
128cae6f3459 initial coding
carl
parents:
diff changeset
5548 # Do a symbolic link so that the libtool archive can be found in
128cae6f3459 initial coding
carl
parents:
diff changeset
5549 # LD_LIBRARY_PATH before the program is installed.
128cae6f3459 initial coding
carl
parents:
diff changeset
5550 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
128cae6f3459 initial coding
carl
parents:
diff changeset
5551 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5552 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5553 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5554 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
5555 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5556
128cae6f3459 initial coding
carl
parents:
diff changeset
5557 # libtool install mode
128cae6f3459 initial coding
carl
parents:
diff changeset
5558 install)
128cae6f3459 initial coding
carl
parents:
diff changeset
5559 modename="$modename: install"
128cae6f3459 initial coding
carl
parents:
diff changeset
5560
128cae6f3459 initial coding
carl
parents:
diff changeset
5561 # There may be an optional sh(1) argument at the beginning of
128cae6f3459 initial coding
carl
parents:
diff changeset
5562 # install_prog (especially on Windows NT).
128cae6f3459 initial coding
carl
parents:
diff changeset
5563 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
128cae6f3459 initial coding
carl
parents:
diff changeset
5564 # Allow the use of GNU shtool's install command.
128cae6f3459 initial coding
carl
parents:
diff changeset
5565 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5566 # Aesthetically quote it.
128cae6f3459 initial coding
carl
parents:
diff changeset
5567 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5568 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
5569 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
128cae6f3459 initial coding
carl
parents:
diff changeset
5570 arg="\"$arg\""
128cae6f3459 initial coding
carl
parents:
diff changeset
5571 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5572 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5573 install_prog="$arg "
128cae6f3459 initial coding
carl
parents:
diff changeset
5574 arg="$1"
128cae6f3459 initial coding
carl
parents:
diff changeset
5575 shift
128cae6f3459 initial coding
carl
parents:
diff changeset
5576 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5577 install_prog=
128cae6f3459 initial coding
carl
parents:
diff changeset
5578 arg="$nonopt"
128cae6f3459 initial coding
carl
parents:
diff changeset
5579 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5580
128cae6f3459 initial coding
carl
parents:
diff changeset
5581 # The real first argument should be the name of the installation program.
128cae6f3459 initial coding
carl
parents:
diff changeset
5582 # Aesthetically quote it.
128cae6f3459 initial coding
carl
parents:
diff changeset
5583 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5584 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
5585 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
128cae6f3459 initial coding
carl
parents:
diff changeset
5586 arg="\"$arg\""
128cae6f3459 initial coding
carl
parents:
diff changeset
5587 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5588 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5589 install_prog="$install_prog$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
5590
128cae6f3459 initial coding
carl
parents:
diff changeset
5591 # We need to accept at least all the BSD install flags.
128cae6f3459 initial coding
carl
parents:
diff changeset
5592 dest=
128cae6f3459 initial coding
carl
parents:
diff changeset
5593 files=
128cae6f3459 initial coding
carl
parents:
diff changeset
5594 opts=
128cae6f3459 initial coding
carl
parents:
diff changeset
5595 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
5596 install_type=
128cae6f3459 initial coding
carl
parents:
diff changeset
5597 isdir=no
128cae6f3459 initial coding
carl
parents:
diff changeset
5598 stripme=
128cae6f3459 initial coding
carl
parents:
diff changeset
5599 for arg
128cae6f3459 initial coding
carl
parents:
diff changeset
5600 do
128cae6f3459 initial coding
carl
parents:
diff changeset
5601 if test -n "$dest"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5602 files="$files $dest"
128cae6f3459 initial coding
carl
parents:
diff changeset
5603 dest="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
5604 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
5605 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5606
128cae6f3459 initial coding
carl
parents:
diff changeset
5607 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
5608 -d) isdir=yes ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5609 -f) prev="-f" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5610 -g) prev="-g" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5611 -m) prev="-m" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5612 -o) prev="-o" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5613 -s)
128cae6f3459 initial coding
carl
parents:
diff changeset
5614 stripme=" -s"
128cae6f3459 initial coding
carl
parents:
diff changeset
5615 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
5616 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5617 -*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5618
128cae6f3459 initial coding
carl
parents:
diff changeset
5619 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
5620 # If the previous option needed an argument, then skip it.
128cae6f3459 initial coding
carl
parents:
diff changeset
5621 if test -n "$prev"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5622 prev=
128cae6f3459 initial coding
carl
parents:
diff changeset
5623 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5624 dest="$arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
5625 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
5626 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5627 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5628 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5629
128cae6f3459 initial coding
carl
parents:
diff changeset
5630 # Aesthetically quote the argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
5631 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5632 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
5633 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
128cae6f3459 initial coding
carl
parents:
diff changeset
5634 arg="\"$arg\""
128cae6f3459 initial coding
carl
parents:
diff changeset
5635 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5636 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5637 install_prog="$install_prog $arg"
128cae6f3459 initial coding
carl
parents:
diff changeset
5638 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5639
128cae6f3459 initial coding
carl
parents:
diff changeset
5640 if test -z "$install_prog"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5641 $echo "$modename: you must specify an install program" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5642 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5643 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5644 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5645
128cae6f3459 initial coding
carl
parents:
diff changeset
5646 if test -n "$prev"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5647 $echo "$modename: the \`$prev' option requires an argument" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5648 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5649 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5650 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5651
128cae6f3459 initial coding
carl
parents:
diff changeset
5652 if test -z "$files"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5653 if test -z "$dest"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5654 $echo "$modename: no file or destination specified" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5655 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5656 $echo "$modename: you must specify a destination" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5657 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5658 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5659 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5660 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5661
128cae6f3459 initial coding
carl
parents:
diff changeset
5662 # Strip any trailing slash from the destination.
128cae6f3459 initial coding
carl
parents:
diff changeset
5663 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5664
128cae6f3459 initial coding
carl
parents:
diff changeset
5665 # Check to see that the destination is a directory.
128cae6f3459 initial coding
carl
parents:
diff changeset
5666 test -d "$dest" && isdir=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
5667 if test "$isdir" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5668 destdir="$dest"
128cae6f3459 initial coding
carl
parents:
diff changeset
5669 destname=
128cae6f3459 initial coding
carl
parents:
diff changeset
5670 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5671 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5672 test "X$destdir" = "X$dest" && destdir=.
128cae6f3459 initial coding
carl
parents:
diff changeset
5673 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5674
128cae6f3459 initial coding
carl
parents:
diff changeset
5675 # Not a directory, so check to see that there is only one file specified.
128cae6f3459 initial coding
carl
parents:
diff changeset
5676 set dummy $files
128cae6f3459 initial coding
carl
parents:
diff changeset
5677 if test "$#" -gt 2; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5678 $echo "$modename: \`$dest' is not a directory" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5679 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5680 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5681 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5682 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5683 case $destdir in
128cae6f3459 initial coding
carl
parents:
diff changeset
5684 [\\/]* | [A-Za-z]:[\\/]*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5685 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
5686 for file in $files; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5687 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
5688 *.lo) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5689 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
5690 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5691 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5692 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5693 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5694 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5695 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5696 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5697 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5698
128cae6f3459 initial coding
carl
parents:
diff changeset
5699 # This variable tells wrapper scripts just to set variables rather
128cae6f3459 initial coding
carl
parents:
diff changeset
5700 # than running their programs.
128cae6f3459 initial coding
carl
parents:
diff changeset
5701 libtool_install_magic="$magic"
128cae6f3459 initial coding
carl
parents:
diff changeset
5702
128cae6f3459 initial coding
carl
parents:
diff changeset
5703 staticlibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
5704 future_libdirs=
128cae6f3459 initial coding
carl
parents:
diff changeset
5705 current_libdirs=
128cae6f3459 initial coding
carl
parents:
diff changeset
5706 for file in $files; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5707
128cae6f3459 initial coding
carl
parents:
diff changeset
5708 # Do each installation.
128cae6f3459 initial coding
carl
parents:
diff changeset
5709 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
5710 *.$libext)
128cae6f3459 initial coding
carl
parents:
diff changeset
5711 # Do the static libraries later.
128cae6f3459 initial coding
carl
parents:
diff changeset
5712 staticlibs="$staticlibs $file"
128cae6f3459 initial coding
carl
parents:
diff changeset
5713 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5714
128cae6f3459 initial coding
carl
parents:
diff changeset
5715 *.la)
128cae6f3459 initial coding
carl
parents:
diff changeset
5716 # Check to see that this really is a libtool archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
5717 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
5718 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5719 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5720 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5721 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5722 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5723
128cae6f3459 initial coding
carl
parents:
diff changeset
5724 library_names=
128cae6f3459 initial coding
carl
parents:
diff changeset
5725 old_library=
128cae6f3459 initial coding
carl
parents:
diff changeset
5726 relink_command=
128cae6f3459 initial coding
carl
parents:
diff changeset
5727 # If there is no directory component, then add one.
128cae6f3459 initial coding
carl
parents:
diff changeset
5728 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
5729 */* | *\\*) . $file ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5730 *) . ./$file ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5731 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5732
128cae6f3459 initial coding
carl
parents:
diff changeset
5733 # Add the libdir to current_libdirs if it is the destination.
128cae6f3459 initial coding
carl
parents:
diff changeset
5734 if test "X$destdir" = "X$libdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5735 case "$current_libdirs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
5736 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5737 *) current_libdirs="$current_libdirs $libdir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5738 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5739 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5740 # Note the libdir as a future libdir.
128cae6f3459 initial coding
carl
parents:
diff changeset
5741 case "$future_libdirs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
5742 *" $libdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5743 *) future_libdirs="$future_libdirs $libdir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5744 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5745 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5746
128cae6f3459 initial coding
carl
parents:
diff changeset
5747 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
128cae6f3459 initial coding
carl
parents:
diff changeset
5748 test "X$dir" = "X$file/" && dir=
128cae6f3459 initial coding
carl
parents:
diff changeset
5749 dir="$dir$objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
5750
128cae6f3459 initial coding
carl
parents:
diff changeset
5751 if test -n "$relink_command"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5752 # Determine the prefix the user has applied to our future dir.
128cae6f3459 initial coding
carl
parents:
diff changeset
5753 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5754
128cae6f3459 initial coding
carl
parents:
diff changeset
5755 # Don't allow the user to place us outside of our expected
128cae6f3459 initial coding
carl
parents:
diff changeset
5756 # location b/c this prevents finding dependent libraries that
128cae6f3459 initial coding
carl
parents:
diff changeset
5757 # are installed to the same prefix.
128cae6f3459 initial coding
carl
parents:
diff changeset
5758 # At present, this check doesn't affect windows .dll's that
128cae6f3459 initial coding
carl
parents:
diff changeset
5759 # are installed into $libdir/../bin (currently, that works fine)
128cae6f3459 initial coding
carl
parents:
diff changeset
5760 # but it's something to keep an eye on.
128cae6f3459 initial coding
carl
parents:
diff changeset
5761 if test "$inst_prefix_dir" = "$destdir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5762 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5763 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5764 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5765
128cae6f3459 initial coding
carl
parents:
diff changeset
5766 if test -n "$inst_prefix_dir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5767 # Stick the inst_prefix_dir data into the link command.
128cae6f3459 initial coding
carl
parents:
diff changeset
5768 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5769 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5770 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5771 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5772
128cae6f3459 initial coding
carl
parents:
diff changeset
5773 $echo "$modename: warning: relinking \`$file'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5774 $show "$relink_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
5775 if $run eval "$relink_command"; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
5776 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5777 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5778 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5779 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5780 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5781
128cae6f3459 initial coding
carl
parents:
diff changeset
5782 # See the names of the shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
5783 set dummy $library_names
128cae6f3459 initial coding
carl
parents:
diff changeset
5784 if test -n "$2"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5785 realname="$2"
128cae6f3459 initial coding
carl
parents:
diff changeset
5786 shift
128cae6f3459 initial coding
carl
parents:
diff changeset
5787 shift
128cae6f3459 initial coding
carl
parents:
diff changeset
5788
128cae6f3459 initial coding
carl
parents:
diff changeset
5789 srcname="$realname"
128cae6f3459 initial coding
carl
parents:
diff changeset
5790 test -n "$relink_command" && srcname="$realname"T
128cae6f3459 initial coding
carl
parents:
diff changeset
5791
128cae6f3459 initial coding
carl
parents:
diff changeset
5792 # Install the shared library and build the symlinks.
128cae6f3459 initial coding
carl
parents:
diff changeset
5793 $show "$install_prog $dir/$srcname $destdir/$realname"
128cae6f3459 initial coding
carl
parents:
diff changeset
5794 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5795 if test -n "$stripme" && test -n "$striplib"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5796 $show "$striplib $destdir/$realname"
128cae6f3459 initial coding
carl
parents:
diff changeset
5797 $run eval "$striplib $destdir/$realname" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5798 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5799
128cae6f3459 initial coding
carl
parents:
diff changeset
5800 if test "$#" -gt 0; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5801 # Delete the old symlinks, and create new ones.
128cae6f3459 initial coding
carl
parents:
diff changeset
5802 for linkname
128cae6f3459 initial coding
carl
parents:
diff changeset
5803 do
128cae6f3459 initial coding
carl
parents:
diff changeset
5804 if test "$linkname" != "$realname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5805 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
128cae6f3459 initial coding
carl
parents:
diff changeset
5806 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
128cae6f3459 initial coding
carl
parents:
diff changeset
5807 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5808 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5809 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5810
128cae6f3459 initial coding
carl
parents:
diff changeset
5811 # Do each command in the postinstall commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
5812 lib="$destdir/$realname"
128cae6f3459 initial coding
carl
parents:
diff changeset
5813 eval cmds=\"$postinstall_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
5814 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
5815 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5816 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
5817 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
5818 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5819 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5820 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
5821 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5822
128cae6f3459 initial coding
carl
parents:
diff changeset
5823 # Install the pseudo-library for information purposes.
128cae6f3459 initial coding
carl
parents:
diff changeset
5824 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5825 instname="$dir/$name"i
128cae6f3459 initial coding
carl
parents:
diff changeset
5826 $show "$install_prog $instname $destdir/$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
5827 $run eval "$install_prog $instname $destdir/$name" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5828
128cae6f3459 initial coding
carl
parents:
diff changeset
5829 # Maybe install the static library, too.
128cae6f3459 initial coding
carl
parents:
diff changeset
5830 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
128cae6f3459 initial coding
carl
parents:
diff changeset
5831 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5832
128cae6f3459 initial coding
carl
parents:
diff changeset
5833 *.lo)
128cae6f3459 initial coding
carl
parents:
diff changeset
5834 # Install (i.e. copy) a libtool object.
128cae6f3459 initial coding
carl
parents:
diff changeset
5835
128cae6f3459 initial coding
carl
parents:
diff changeset
5836 # Figure out destination file name, if it wasn't already specified.
128cae6f3459 initial coding
carl
parents:
diff changeset
5837 if test -n "$destname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5838 destfile="$destdir/$destname"
128cae6f3459 initial coding
carl
parents:
diff changeset
5839 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5840 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5841 destfile="$destdir/$destfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
5842 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5843
128cae6f3459 initial coding
carl
parents:
diff changeset
5844 # Deduce the name of the destination old-style object file.
128cae6f3459 initial coding
carl
parents:
diff changeset
5845 case $destfile in
128cae6f3459 initial coding
carl
parents:
diff changeset
5846 *.lo)
128cae6f3459 initial coding
carl
parents:
diff changeset
5847 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5848 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5849 *.$objext)
128cae6f3459 initial coding
carl
parents:
diff changeset
5850 staticdest="$destfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
5851 destfile=
128cae6f3459 initial coding
carl
parents:
diff changeset
5852 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5853 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
5854 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5855 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5856 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5857 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5858 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5859
128cae6f3459 initial coding
carl
parents:
diff changeset
5860 # Install the libtool object if requested.
128cae6f3459 initial coding
carl
parents:
diff changeset
5861 if test -n "$destfile"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5862 $show "$install_prog $file $destfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
5863 $run eval "$install_prog $file $destfile" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5864 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5865
128cae6f3459 initial coding
carl
parents:
diff changeset
5866 # Install the old object if enabled.
128cae6f3459 initial coding
carl
parents:
diff changeset
5867 if test "$build_old_libs" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5868 # Deduce the name of the old-style object file.
128cae6f3459 initial coding
carl
parents:
diff changeset
5869 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5870
128cae6f3459 initial coding
carl
parents:
diff changeset
5871 $show "$install_prog $staticobj $staticdest"
128cae6f3459 initial coding
carl
parents:
diff changeset
5872 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
5873 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5874 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
5875 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5876
128cae6f3459 initial coding
carl
parents:
diff changeset
5877 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
5878 # Figure out destination file name, if it wasn't already specified.
128cae6f3459 initial coding
carl
parents:
diff changeset
5879 if test -n "$destname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5880 destfile="$destdir/$destname"
128cae6f3459 initial coding
carl
parents:
diff changeset
5881 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5882 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5883 destfile="$destdir/$destfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
5884 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5885
128cae6f3459 initial coding
carl
parents:
diff changeset
5886 # If the file is missing, and there is a .exe on the end, strip it
128cae6f3459 initial coding
carl
parents:
diff changeset
5887 # because it is most likely a libtool script we actually want to
128cae6f3459 initial coding
carl
parents:
diff changeset
5888 # install
128cae6f3459 initial coding
carl
parents:
diff changeset
5889 stripped_ext=""
128cae6f3459 initial coding
carl
parents:
diff changeset
5890 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
5891 *.exe)
128cae6f3459 initial coding
carl
parents:
diff changeset
5892 if test ! -f "$file"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5893 file=`$echo $file|${SED} 's,.exe$,,'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5894 stripped_ext=".exe"
128cae6f3459 initial coding
carl
parents:
diff changeset
5895 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5896 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5897 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5898
128cae6f3459 initial coding
carl
parents:
diff changeset
5899 # Do a test to see if this is really a libtool program.
128cae6f3459 initial coding
carl
parents:
diff changeset
5900 case $host in
128cae6f3459 initial coding
carl
parents:
diff changeset
5901 *cygwin*|*mingw*)
128cae6f3459 initial coding
carl
parents:
diff changeset
5902 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5903 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5904 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
5905 wrapper=$file
128cae6f3459 initial coding
carl
parents:
diff changeset
5906 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5907 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5908 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5909 notinst_deplibs=
128cae6f3459 initial coding
carl
parents:
diff changeset
5910 relink_command=
128cae6f3459 initial coding
carl
parents:
diff changeset
5911
128cae6f3459 initial coding
carl
parents:
diff changeset
5912 # To insure that "foo" is sourced, and not "foo.exe",
128cae6f3459 initial coding
carl
parents:
diff changeset
5913 # finese the cygwin/MSYS system by explicitly sourcing "foo."
128cae6f3459 initial coding
carl
parents:
diff changeset
5914 # which disallows the automatic-append-.exe behavior.
128cae6f3459 initial coding
carl
parents:
diff changeset
5915 case $build in
128cae6f3459 initial coding
carl
parents:
diff changeset
5916 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5917 *) wrapperdot=${wrapper} ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5918 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5919 # If there is no directory component, then add one.
128cae6f3459 initial coding
carl
parents:
diff changeset
5920 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
5921 */* | *\\*) . ${wrapperdot} ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5922 *) . ./${wrapperdot} ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5923 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5924
128cae6f3459 initial coding
carl
parents:
diff changeset
5925 # Check the variables that should have been set.
128cae6f3459 initial coding
carl
parents:
diff changeset
5926 if test -z "$notinst_deplibs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5927 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5928 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
5929 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5930
128cae6f3459 initial coding
carl
parents:
diff changeset
5931 finalize=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
5932 for lib in $notinst_deplibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
5933 # Check to see that each library is installed.
128cae6f3459 initial coding
carl
parents:
diff changeset
5934 libdir=
128cae6f3459 initial coding
carl
parents:
diff changeset
5935 if test -f "$lib"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5936 # If there is no directory component, then add one.
128cae6f3459 initial coding
carl
parents:
diff changeset
5937 case $lib in
128cae6f3459 initial coding
carl
parents:
diff changeset
5938 */* | *\\*) . $lib ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5939 *) . ./$lib ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5940 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5941 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5942 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
128cae6f3459 initial coding
carl
parents:
diff changeset
5943 if test -n "$libdir" && test ! -f "$libfile"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5944 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5945 finalize=no
128cae6f3459 initial coding
carl
parents:
diff changeset
5946 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5947 done
128cae6f3459 initial coding
carl
parents:
diff changeset
5948
128cae6f3459 initial coding
carl
parents:
diff changeset
5949 relink_command=
128cae6f3459 initial coding
carl
parents:
diff changeset
5950 # To insure that "foo" is sourced, and not "foo.exe",
128cae6f3459 initial coding
carl
parents:
diff changeset
5951 # finese the cygwin/MSYS system by explicitly sourcing "foo."
128cae6f3459 initial coding
carl
parents:
diff changeset
5952 # which disallows the automatic-append-.exe behavior.
128cae6f3459 initial coding
carl
parents:
diff changeset
5953 case $build in
128cae6f3459 initial coding
carl
parents:
diff changeset
5954 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5955 *) wrapperdot=${wrapper} ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5956 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5957 # If there is no directory component, then add one.
128cae6f3459 initial coding
carl
parents:
diff changeset
5958 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
5959 */* | *\\*) . ${wrapperdot} ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5960 *) . ./${wrapperdot} ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
5961 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
5962
128cae6f3459 initial coding
carl
parents:
diff changeset
5963 outputname=
128cae6f3459 initial coding
carl
parents:
diff changeset
5964 if test "$fast_install" = no && test -n "$relink_command"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5965 if test "$finalize" = yes && test -z "$run"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
5966 tmpdir="/tmp"
128cae6f3459 initial coding
carl
parents:
diff changeset
5967 test -n "$TMPDIR" && tmpdir="$TMPDIR"
128cae6f3459 initial coding
carl
parents:
diff changeset
5968 tmpdir="$tmpdir/libtool-$$"
128cae6f3459 initial coding
carl
parents:
diff changeset
5969 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
5970 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5971 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5972 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
5973 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5974 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5975 outputname="$tmpdir/$file"
128cae6f3459 initial coding
carl
parents:
diff changeset
5976 # Replace the output file specification.
128cae6f3459 initial coding
carl
parents:
diff changeset
5977 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
128cae6f3459 initial coding
carl
parents:
diff changeset
5978
128cae6f3459 initial coding
carl
parents:
diff changeset
5979 $show "$relink_command"
128cae6f3459 initial coding
carl
parents:
diff changeset
5980 if $run eval "$relink_command"; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
5981 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5982 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5983 ${rm}r "$tmpdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
5984 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
5985 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5986 file="$outputname"
128cae6f3459 initial coding
carl
parents:
diff changeset
5987 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5988 $echo "$modename: warning: cannot relink \`$file'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
5989 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5990 else
128cae6f3459 initial coding
carl
parents:
diff changeset
5991 # Install the binary that we compiled earlier.
128cae6f3459 initial coding
carl
parents:
diff changeset
5992 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
128cae6f3459 initial coding
carl
parents:
diff changeset
5993 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5994 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
5995
128cae6f3459 initial coding
carl
parents:
diff changeset
5996 # remove .exe since cygwin /usr/bin/install will append another
128cae6f3459 initial coding
carl
parents:
diff changeset
5997 # one anyways
128cae6f3459 initial coding
carl
parents:
diff changeset
5998 case $install_prog,$host in
128cae6f3459 initial coding
carl
parents:
diff changeset
5999 */usr/bin/install*,*cygwin*)
128cae6f3459 initial coding
carl
parents:
diff changeset
6000 case $file:$destfile in
128cae6f3459 initial coding
carl
parents:
diff changeset
6001 *.exe:*.exe)
128cae6f3459 initial coding
carl
parents:
diff changeset
6002 # this is ok
128cae6f3459 initial coding
carl
parents:
diff changeset
6003 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6004 *.exe:*)
128cae6f3459 initial coding
carl
parents:
diff changeset
6005 destfile=$destfile.exe
128cae6f3459 initial coding
carl
parents:
diff changeset
6006 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6007 *:*.exe)
128cae6f3459 initial coding
carl
parents:
diff changeset
6008 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
128cae6f3459 initial coding
carl
parents:
diff changeset
6009 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6010 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6011 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6012 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6013 $show "$install_prog$stripme $file $destfile"
128cae6f3459 initial coding
carl
parents:
diff changeset
6014 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
6015 test -n "$outputname" && ${rm}r "$tmpdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6016 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6017 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6018 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6019
128cae6f3459 initial coding
carl
parents:
diff changeset
6020 for file in $staticlibs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6021 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
6022
128cae6f3459 initial coding
carl
parents:
diff changeset
6023 # Set up the ranlib parameters.
128cae6f3459 initial coding
carl
parents:
diff changeset
6024 oldlib="$destdir/$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
6025
128cae6f3459 initial coding
carl
parents:
diff changeset
6026 $show "$install_prog $file $oldlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
6027 $run eval "$install_prog \$file \$oldlib" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
6028
128cae6f3459 initial coding
carl
parents:
diff changeset
6029 if test -n "$stripme" && test -n "$striplib"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6030 $show "$old_striplib $oldlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
6031 $run eval "$old_striplib $oldlib" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
6032 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6033
128cae6f3459 initial coding
carl
parents:
diff changeset
6034 # Do each command in the postinstall commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
6035 eval cmds=\"$old_postinstall_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
6036 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
6037 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6038 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6039 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
6040 $run eval "$cmd" || exit $?
128cae6f3459 initial coding
carl
parents:
diff changeset
6041 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6042 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6043 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6044
128cae6f3459 initial coding
carl
parents:
diff changeset
6045 if test -n "$future_libdirs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6046 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6047 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6048
128cae6f3459 initial coding
carl
parents:
diff changeset
6049 if test -n "$current_libdirs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6050 # Maybe just do a dry run.
128cae6f3459 initial coding
carl
parents:
diff changeset
6051 test -n "$run" && current_libdirs=" -n$current_libdirs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6052 exec_cmd='$SHELL $0 --finish$current_libdirs'
128cae6f3459 initial coding
carl
parents:
diff changeset
6053 else
128cae6f3459 initial coding
carl
parents:
diff changeset
6054 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
6055 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6056 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6057
128cae6f3459 initial coding
carl
parents:
diff changeset
6058 # libtool finish mode
128cae6f3459 initial coding
carl
parents:
diff changeset
6059 finish)
128cae6f3459 initial coding
carl
parents:
diff changeset
6060 modename="$modename: finish"
128cae6f3459 initial coding
carl
parents:
diff changeset
6061 libdirs="$nonopt"
128cae6f3459 initial coding
carl
parents:
diff changeset
6062 admincmds=
128cae6f3459 initial coding
carl
parents:
diff changeset
6063
128cae6f3459 initial coding
carl
parents:
diff changeset
6064 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6065 for dir
128cae6f3459 initial coding
carl
parents:
diff changeset
6066 do
128cae6f3459 initial coding
carl
parents:
diff changeset
6067 libdirs="$libdirs $dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6068 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6069
128cae6f3459 initial coding
carl
parents:
diff changeset
6070 for libdir in $libdirs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6071 if test -n "$finish_cmds"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6072 # Do each command in the finish commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
6073 eval cmds=\"$finish_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
6074 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
6075 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6076 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6077 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
6078 $run eval "$cmd" || admincmds="$admincmds
128cae6f3459 initial coding
carl
parents:
diff changeset
6079 $cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
6080 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6081 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6082 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6083 if test -n "$finish_eval"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6084 # Do the single finish_eval.
128cae6f3459 initial coding
carl
parents:
diff changeset
6085 eval cmds=\"$finish_eval\"
128cae6f3459 initial coding
carl
parents:
diff changeset
6086 $run eval "$cmds" || admincmds="$admincmds
128cae6f3459 initial coding
carl
parents:
diff changeset
6087 $cmds"
128cae6f3459 initial coding
carl
parents:
diff changeset
6088 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6089 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6090 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6091
128cae6f3459 initial coding
carl
parents:
diff changeset
6092 # Exit here if they wanted silent mode.
128cae6f3459 initial coding
carl
parents:
diff changeset
6093 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
6094
128cae6f3459 initial coding
carl
parents:
diff changeset
6095 $echo "----------------------------------------------------------------------"
128cae6f3459 initial coding
carl
parents:
diff changeset
6096 $echo "Libraries have been installed in:"
128cae6f3459 initial coding
carl
parents:
diff changeset
6097 for libdir in $libdirs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6098 $echo " $libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6099 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6100 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
6101 $echo "If you ever happen to want to link against installed libraries"
128cae6f3459 initial coding
carl
parents:
diff changeset
6102 $echo "in a given directory, LIBDIR, you must either use libtool, and"
128cae6f3459 initial coding
carl
parents:
diff changeset
6103 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
128cae6f3459 initial coding
carl
parents:
diff changeset
6104 $echo "flag during linking and do at least one of the following:"
128cae6f3459 initial coding
carl
parents:
diff changeset
6105 if test -n "$shlibpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6106 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
128cae6f3459 initial coding
carl
parents:
diff changeset
6107 $echo " during execution"
128cae6f3459 initial coding
carl
parents:
diff changeset
6108 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6109 if test -n "$runpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6110 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
128cae6f3459 initial coding
carl
parents:
diff changeset
6111 $echo " during linking"
128cae6f3459 initial coding
carl
parents:
diff changeset
6112 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6113 if test -n "$hardcode_libdir_flag_spec"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6114 libdir=LIBDIR
128cae6f3459 initial coding
carl
parents:
diff changeset
6115 eval flag=\"$hardcode_libdir_flag_spec\"
128cae6f3459 initial coding
carl
parents:
diff changeset
6116
128cae6f3459 initial coding
carl
parents:
diff changeset
6117 $echo " - use the \`$flag' linker flag"
128cae6f3459 initial coding
carl
parents:
diff changeset
6118 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6119 if test -n "$admincmds"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6120 $echo " - have your system administrator run these commands:$admincmds"
128cae6f3459 initial coding
carl
parents:
diff changeset
6121 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6122 if test -f /etc/ld.so.conf; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6123 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
128cae6f3459 initial coding
carl
parents:
diff changeset
6124 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6125 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
6126 $echo "See any operating system documentation about shared libraries for"
128cae6f3459 initial coding
carl
parents:
diff changeset
6127 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
128cae6f3459 initial coding
carl
parents:
diff changeset
6128 $echo "----------------------------------------------------------------------"
128cae6f3459 initial coding
carl
parents:
diff changeset
6129 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
6130 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6131
128cae6f3459 initial coding
carl
parents:
diff changeset
6132 # libtool execute mode
128cae6f3459 initial coding
carl
parents:
diff changeset
6133 execute)
128cae6f3459 initial coding
carl
parents:
diff changeset
6134 modename="$modename: execute"
128cae6f3459 initial coding
carl
parents:
diff changeset
6135
128cae6f3459 initial coding
carl
parents:
diff changeset
6136 # The first argument is the command name.
128cae6f3459 initial coding
carl
parents:
diff changeset
6137 cmd="$nonopt"
128cae6f3459 initial coding
carl
parents:
diff changeset
6138 if test -z "$cmd"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6139 $echo "$modename: you must specify a COMMAND" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6140 $echo "$help"
128cae6f3459 initial coding
carl
parents:
diff changeset
6141 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
6142 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6143
128cae6f3459 initial coding
carl
parents:
diff changeset
6144 # Handle -dlopen flags immediately.
128cae6f3459 initial coding
carl
parents:
diff changeset
6145 for file in $execute_dlfiles; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6146 if test ! -f "$file"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6147 $echo "$modename: \`$file' is not a file" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6148 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6149 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
6150 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6151
128cae6f3459 initial coding
carl
parents:
diff changeset
6152 dir=
128cae6f3459 initial coding
carl
parents:
diff changeset
6153 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
6154 *.la)
128cae6f3459 initial coding
carl
parents:
diff changeset
6155 # Check to see that this really is a libtool archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
6156 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
128cae6f3459 initial coding
carl
parents:
diff changeset
6157 else
128cae6f3459 initial coding
carl
parents:
diff changeset
6158 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6159 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6160 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
6161 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6162
128cae6f3459 initial coding
carl
parents:
diff changeset
6163 # Read the libtool library.
128cae6f3459 initial coding
carl
parents:
diff changeset
6164 dlname=
128cae6f3459 initial coding
carl
parents:
diff changeset
6165 library_names=
128cae6f3459 initial coding
carl
parents:
diff changeset
6166
128cae6f3459 initial coding
carl
parents:
diff changeset
6167 # If there is no directory component, then add one.
128cae6f3459 initial coding
carl
parents:
diff changeset
6168 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
6169 */* | *\\*) . $file ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6170 *) . ./$file ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6171 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6172
128cae6f3459 initial coding
carl
parents:
diff changeset
6173 # Skip this library if it cannot be dlopened.
128cae6f3459 initial coding
carl
parents:
diff changeset
6174 if test -z "$dlname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6175 # Warn if it was a shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
6176 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
128cae6f3459 initial coding
carl
parents:
diff changeset
6177 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
6178 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6179
128cae6f3459 initial coding
carl
parents:
diff changeset
6180 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
6181 test "X$dir" = "X$file" && dir=.
128cae6f3459 initial coding
carl
parents:
diff changeset
6182
128cae6f3459 initial coding
carl
parents:
diff changeset
6183 if test -f "$dir/$objdir/$dlname"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6184 dir="$dir/$objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6185 else
128cae6f3459 initial coding
carl
parents:
diff changeset
6186 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6187 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
6188 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6189 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6190
128cae6f3459 initial coding
carl
parents:
diff changeset
6191 *.lo)
128cae6f3459 initial coding
carl
parents:
diff changeset
6192 # Just add the directory containing the .lo file.
128cae6f3459 initial coding
carl
parents:
diff changeset
6193 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
6194 test "X$dir" = "X$file" && dir=.
128cae6f3459 initial coding
carl
parents:
diff changeset
6195 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6196
128cae6f3459 initial coding
carl
parents:
diff changeset
6197 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
6198 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6199 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
6200 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6201 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6202
128cae6f3459 initial coding
carl
parents:
diff changeset
6203 # Get the absolute pathname.
128cae6f3459 initial coding
carl
parents:
diff changeset
6204 absdir=`cd "$dir" && pwd`
128cae6f3459 initial coding
carl
parents:
diff changeset
6205 test -n "$absdir" && dir="$absdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6206
128cae6f3459 initial coding
carl
parents:
diff changeset
6207 # Now add the directory to shlibpath_var.
128cae6f3459 initial coding
carl
parents:
diff changeset
6208 if eval "test -z \"\$$shlibpath_var\""; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6209 eval "$shlibpath_var=\"\$dir\""
128cae6f3459 initial coding
carl
parents:
diff changeset
6210 else
128cae6f3459 initial coding
carl
parents:
diff changeset
6211 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
128cae6f3459 initial coding
carl
parents:
diff changeset
6212 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6213 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6214
128cae6f3459 initial coding
carl
parents:
diff changeset
6215 # This variable tells wrapper scripts just to set shlibpath_var
128cae6f3459 initial coding
carl
parents:
diff changeset
6216 # rather than running their programs.
128cae6f3459 initial coding
carl
parents:
diff changeset
6217 libtool_execute_magic="$magic"
128cae6f3459 initial coding
carl
parents:
diff changeset
6218
128cae6f3459 initial coding
carl
parents:
diff changeset
6219 # Check if any of the arguments is a wrapper script.
128cae6f3459 initial coding
carl
parents:
diff changeset
6220 args=
128cae6f3459 initial coding
carl
parents:
diff changeset
6221 for file
128cae6f3459 initial coding
carl
parents:
diff changeset
6222 do
128cae6f3459 initial coding
carl
parents:
diff changeset
6223 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
6224 -*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6225 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
6226 # Do a test to see if this is really a libtool program.
128cae6f3459 initial coding
carl
parents:
diff changeset
6227 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6228 # If there is no directory component, then add one.
128cae6f3459 initial coding
carl
parents:
diff changeset
6229 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
6230 */* | *\\*) . $file ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6231 *) . ./$file ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6232 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6233
128cae6f3459 initial coding
carl
parents:
diff changeset
6234 # Transform arg to wrapped name.
128cae6f3459 initial coding
carl
parents:
diff changeset
6235 file="$progdir/$program"
128cae6f3459 initial coding
carl
parents:
diff changeset
6236 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6237 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6238 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6239 # Quote arguments (to preserve shell metacharacters).
128cae6f3459 initial coding
carl
parents:
diff changeset
6240 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
128cae6f3459 initial coding
carl
parents:
diff changeset
6241 args="$args \"$file\""
128cae6f3459 initial coding
carl
parents:
diff changeset
6242 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6243
128cae6f3459 initial coding
carl
parents:
diff changeset
6244 if test -z "$run"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6245 if test -n "$shlibpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6246 # Export the shlibpath_var.
128cae6f3459 initial coding
carl
parents:
diff changeset
6247 eval "export $shlibpath_var"
128cae6f3459 initial coding
carl
parents:
diff changeset
6248 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6249
128cae6f3459 initial coding
carl
parents:
diff changeset
6250 # Restore saved environment variables
128cae6f3459 initial coding
carl
parents:
diff changeset
6251 if test "${save_LC_ALL+set}" = set; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6252 LC_ALL="$save_LC_ALL"; export LC_ALL
128cae6f3459 initial coding
carl
parents:
diff changeset
6253 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6254 if test "${save_LANG+set}" = set; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6255 LANG="$save_LANG"; export LANG
128cae6f3459 initial coding
carl
parents:
diff changeset
6256 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6257
128cae6f3459 initial coding
carl
parents:
diff changeset
6258 # Now prepare to actually exec the command.
128cae6f3459 initial coding
carl
parents:
diff changeset
6259 exec_cmd="\$cmd$args"
128cae6f3459 initial coding
carl
parents:
diff changeset
6260 else
128cae6f3459 initial coding
carl
parents:
diff changeset
6261 # Display what would be done.
128cae6f3459 initial coding
carl
parents:
diff changeset
6262 if test -n "$shlibpath_var"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6263 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
128cae6f3459 initial coding
carl
parents:
diff changeset
6264 $echo "export $shlibpath_var"
128cae6f3459 initial coding
carl
parents:
diff changeset
6265 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6266 $echo "$cmd$args"
128cae6f3459 initial coding
carl
parents:
diff changeset
6267 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
6268 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6269 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6270
128cae6f3459 initial coding
carl
parents:
diff changeset
6271 # libtool clean and uninstall mode
128cae6f3459 initial coding
carl
parents:
diff changeset
6272 clean | uninstall)
128cae6f3459 initial coding
carl
parents:
diff changeset
6273 modename="$modename: $mode"
128cae6f3459 initial coding
carl
parents:
diff changeset
6274 rm="$nonopt"
128cae6f3459 initial coding
carl
parents:
diff changeset
6275 files=
128cae6f3459 initial coding
carl
parents:
diff changeset
6276 rmforce=
128cae6f3459 initial coding
carl
parents:
diff changeset
6277 exit_status=0
128cae6f3459 initial coding
carl
parents:
diff changeset
6278
128cae6f3459 initial coding
carl
parents:
diff changeset
6279 # This variable tells wrapper scripts just to set variables rather
128cae6f3459 initial coding
carl
parents:
diff changeset
6280 # than running their programs.
128cae6f3459 initial coding
carl
parents:
diff changeset
6281 libtool_install_magic="$magic"
128cae6f3459 initial coding
carl
parents:
diff changeset
6282
128cae6f3459 initial coding
carl
parents:
diff changeset
6283 for arg
128cae6f3459 initial coding
carl
parents:
diff changeset
6284 do
128cae6f3459 initial coding
carl
parents:
diff changeset
6285 case $arg in
128cae6f3459 initial coding
carl
parents:
diff changeset
6286 -f) rm="$rm $arg"; rmforce=yes ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6287 -*) rm="$rm $arg" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6288 *) files="$files $arg" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6289 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6290 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6291
128cae6f3459 initial coding
carl
parents:
diff changeset
6292 if test -z "$rm"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6293 $echo "$modename: you must specify an RM program" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6294 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6295 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
6296 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6297
128cae6f3459 initial coding
carl
parents:
diff changeset
6298 rmdirs=
128cae6f3459 initial coding
carl
parents:
diff changeset
6299
128cae6f3459 initial coding
carl
parents:
diff changeset
6300 origobjdir="$objdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6301 for file in $files; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6302 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
6303 if test "X$dir" = "X$file"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6304 dir=.
128cae6f3459 initial coding
carl
parents:
diff changeset
6305 objdir="$origobjdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6306 else
128cae6f3459 initial coding
carl
parents:
diff changeset
6307 objdir="$dir/$origobjdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6308 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6309 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
128cae6f3459 initial coding
carl
parents:
diff changeset
6310 test "$mode" = uninstall && objdir="$dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6311
128cae6f3459 initial coding
carl
parents:
diff changeset
6312 # Remember objdir for removal later, being careful to avoid duplicates
128cae6f3459 initial coding
carl
parents:
diff changeset
6313 if test "$mode" = clean; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6314 case " $rmdirs " in
128cae6f3459 initial coding
carl
parents:
diff changeset
6315 *" $objdir "*) ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6316 *) rmdirs="$rmdirs $objdir" ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6317 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6318 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6319
128cae6f3459 initial coding
carl
parents:
diff changeset
6320 # Don't error if the file doesn't exist and rm -f was used.
128cae6f3459 initial coding
carl
parents:
diff changeset
6321 if (test -L "$file") >/dev/null 2>&1 \
128cae6f3459 initial coding
carl
parents:
diff changeset
6322 || (test -h "$file") >/dev/null 2>&1 \
128cae6f3459 initial coding
carl
parents:
diff changeset
6323 || test -f "$file"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6324 :
128cae6f3459 initial coding
carl
parents:
diff changeset
6325 elif test -d "$file"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6326 exit_status=1
128cae6f3459 initial coding
carl
parents:
diff changeset
6327 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
6328 elif test "$rmforce" = yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6329 continue
128cae6f3459 initial coding
carl
parents:
diff changeset
6330 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6331
128cae6f3459 initial coding
carl
parents:
diff changeset
6332 rmfiles="$file"
128cae6f3459 initial coding
carl
parents:
diff changeset
6333
128cae6f3459 initial coding
carl
parents:
diff changeset
6334 case $name in
128cae6f3459 initial coding
carl
parents:
diff changeset
6335 *.la)
128cae6f3459 initial coding
carl
parents:
diff changeset
6336 # Possibly a libtool archive, so verify it.
128cae6f3459 initial coding
carl
parents:
diff changeset
6337 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6338 . $dir/$name
128cae6f3459 initial coding
carl
parents:
diff changeset
6339
128cae6f3459 initial coding
carl
parents:
diff changeset
6340 # Delete the libtool libraries and symlinks.
128cae6f3459 initial coding
carl
parents:
diff changeset
6341 for n in $library_names; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6342 rmfiles="$rmfiles $objdir/$n"
128cae6f3459 initial coding
carl
parents:
diff changeset
6343 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6344 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
128cae6f3459 initial coding
carl
parents:
diff changeset
6345 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
128cae6f3459 initial coding
carl
parents:
diff changeset
6346
128cae6f3459 initial coding
carl
parents:
diff changeset
6347 if test "$mode" = uninstall; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6348 if test -n "$library_names"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6349 # Do each command in the postuninstall commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
6350 eval cmds=\"$postuninstall_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
6351 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
6352 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6353 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6354 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
6355 $run eval "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
6356 if test "$?" -ne 0 && test "$rmforce" != yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6357 exit_status=1
128cae6f3459 initial coding
carl
parents:
diff changeset
6358 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6359 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6360 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6361 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6362
128cae6f3459 initial coding
carl
parents:
diff changeset
6363 if test -n "$old_library"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6364 # Do each command in the old_postuninstall commands.
128cae6f3459 initial coding
carl
parents:
diff changeset
6365 eval cmds=\"$old_postuninstall_cmds\"
128cae6f3459 initial coding
carl
parents:
diff changeset
6366 save_ifs="$IFS"; IFS='~'
128cae6f3459 initial coding
carl
parents:
diff changeset
6367 for cmd in $cmds; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6368 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6369 $show "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
6370 $run eval "$cmd"
128cae6f3459 initial coding
carl
parents:
diff changeset
6371 if test "$?" -ne 0 && test "$rmforce" != yes; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6372 exit_status=1
128cae6f3459 initial coding
carl
parents:
diff changeset
6373 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6374 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6375 IFS="$save_ifs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6376 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6377 # FIXME: should reinstall the best remaining shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
6378 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6379 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6380 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6381
128cae6f3459 initial coding
carl
parents:
diff changeset
6382 *.lo)
128cae6f3459 initial coding
carl
parents:
diff changeset
6383 # Possibly a libtool object, so verify it.
128cae6f3459 initial coding
carl
parents:
diff changeset
6384 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6385
128cae6f3459 initial coding
carl
parents:
diff changeset
6386 # Read the .lo file
128cae6f3459 initial coding
carl
parents:
diff changeset
6387 . $dir/$name
128cae6f3459 initial coding
carl
parents:
diff changeset
6388
128cae6f3459 initial coding
carl
parents:
diff changeset
6389 # Add PIC object to the list of files to remove.
128cae6f3459 initial coding
carl
parents:
diff changeset
6390 if test -n "$pic_object" \
128cae6f3459 initial coding
carl
parents:
diff changeset
6391 && test "$pic_object" != none; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6392 rmfiles="$rmfiles $dir/$pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
6393 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6394
128cae6f3459 initial coding
carl
parents:
diff changeset
6395 # Add non-PIC object to the list of files to remove.
128cae6f3459 initial coding
carl
parents:
diff changeset
6396 if test -n "$non_pic_object" \
128cae6f3459 initial coding
carl
parents:
diff changeset
6397 && test "$non_pic_object" != none; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6398 rmfiles="$rmfiles $dir/$non_pic_object"
128cae6f3459 initial coding
carl
parents:
diff changeset
6399 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6400 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6401 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6402
128cae6f3459 initial coding
carl
parents:
diff changeset
6403 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
6404 if test "$mode" = clean ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6405 noexename=$name
128cae6f3459 initial coding
carl
parents:
diff changeset
6406 case $file in
128cae6f3459 initial coding
carl
parents:
diff changeset
6407 *.exe)
128cae6f3459 initial coding
carl
parents:
diff changeset
6408 file=`$echo $file|${SED} 's,.exe$,,'`
128cae6f3459 initial coding
carl
parents:
diff changeset
6409 noexename=`$echo $name|${SED} 's,.exe$,,'`
128cae6f3459 initial coding
carl
parents:
diff changeset
6410 # $file with .exe has already been added to rmfiles,
128cae6f3459 initial coding
carl
parents:
diff changeset
6411 # add $file without .exe
128cae6f3459 initial coding
carl
parents:
diff changeset
6412 rmfiles="$rmfiles $file"
128cae6f3459 initial coding
carl
parents:
diff changeset
6413 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6414 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6415 # Do a test to see if this is a libtool program.
128cae6f3459 initial coding
carl
parents:
diff changeset
6416 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6417 relink_command=
128cae6f3459 initial coding
carl
parents:
diff changeset
6418 . $dir/$noexename
128cae6f3459 initial coding
carl
parents:
diff changeset
6419
128cae6f3459 initial coding
carl
parents:
diff changeset
6420 # note $name still contains .exe if it was in $file originally
128cae6f3459 initial coding
carl
parents:
diff changeset
6421 # as does the version of $file that was added into $rmfiles
128cae6f3459 initial coding
carl
parents:
diff changeset
6422 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
128cae6f3459 initial coding
carl
parents:
diff changeset
6423 if test "$fast_install" = yes && test -n "$relink_command"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6424 rmfiles="$rmfiles $objdir/lt-$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
6425 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6426 if test "X$noexename" != "X$name" ; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6427 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
128cae6f3459 initial coding
carl
parents:
diff changeset
6428 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6429 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6430 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6431 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6432 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6433 $show "$rm $rmfiles"
128cae6f3459 initial coding
carl
parents:
diff changeset
6434 $run $rm $rmfiles || exit_status=1
128cae6f3459 initial coding
carl
parents:
diff changeset
6435 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6436 objdir="$origobjdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6437
128cae6f3459 initial coding
carl
parents:
diff changeset
6438 # Try to remove the ${objdir}s in the directories where we deleted files
128cae6f3459 initial coding
carl
parents:
diff changeset
6439 for dir in $rmdirs; do
128cae6f3459 initial coding
carl
parents:
diff changeset
6440 if test -d "$dir"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6441 $show "rmdir $dir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6442 $run rmdir $dir >/dev/null 2>&1
128cae6f3459 initial coding
carl
parents:
diff changeset
6443 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6444 done
128cae6f3459 initial coding
carl
parents:
diff changeset
6445
128cae6f3459 initial coding
carl
parents:
diff changeset
6446 exit $exit_status
128cae6f3459 initial coding
carl
parents:
diff changeset
6447 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6448
128cae6f3459 initial coding
carl
parents:
diff changeset
6449 "")
128cae6f3459 initial coding
carl
parents:
diff changeset
6450 $echo "$modename: you must specify a MODE" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6451 $echo "$generic_help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6452 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
6453 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6454 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6455
128cae6f3459 initial coding
carl
parents:
diff changeset
6456 if test -z "$exec_cmd"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6457 $echo "$modename: invalid operation mode \`$mode'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6458 $echo "$generic_help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6459 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
6460 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6461 fi # test -z "$show_help"
128cae6f3459 initial coding
carl
parents:
diff changeset
6462
128cae6f3459 initial coding
carl
parents:
diff changeset
6463 if test -n "$exec_cmd"; then
128cae6f3459 initial coding
carl
parents:
diff changeset
6464 eval exec $exec_cmd
128cae6f3459 initial coding
carl
parents:
diff changeset
6465 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
6466 fi
128cae6f3459 initial coding
carl
parents:
diff changeset
6467
128cae6f3459 initial coding
carl
parents:
diff changeset
6468 # We need to display help for each of the modes.
128cae6f3459 initial coding
carl
parents:
diff changeset
6469 case $mode in
128cae6f3459 initial coding
carl
parents:
diff changeset
6470 "") $echo \
128cae6f3459 initial coding
carl
parents:
diff changeset
6471 "Usage: $modename [OPTION]... [MODE-ARG]...
128cae6f3459 initial coding
carl
parents:
diff changeset
6472
128cae6f3459 initial coding
carl
parents:
diff changeset
6473 Provide generalized library-building support services.
128cae6f3459 initial coding
carl
parents:
diff changeset
6474
128cae6f3459 initial coding
carl
parents:
diff changeset
6475 --config show all configuration variables
128cae6f3459 initial coding
carl
parents:
diff changeset
6476 --debug enable verbose shell tracing
128cae6f3459 initial coding
carl
parents:
diff changeset
6477 -n, --dry-run display commands without modifying any files
128cae6f3459 initial coding
carl
parents:
diff changeset
6478 --features display basic configuration information and exit
128cae6f3459 initial coding
carl
parents:
diff changeset
6479 --finish same as \`--mode=finish'
128cae6f3459 initial coding
carl
parents:
diff changeset
6480 --help display this help message and exit
128cae6f3459 initial coding
carl
parents:
diff changeset
6481 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
128cae6f3459 initial coding
carl
parents:
diff changeset
6482 --quiet same as \`--silent'
128cae6f3459 initial coding
carl
parents:
diff changeset
6483 --silent don't print informational messages
128cae6f3459 initial coding
carl
parents:
diff changeset
6484 --tag=TAG use configuration variables from tag TAG
128cae6f3459 initial coding
carl
parents:
diff changeset
6485 --version print version information
128cae6f3459 initial coding
carl
parents:
diff changeset
6486
128cae6f3459 initial coding
carl
parents:
diff changeset
6487 MODE must be one of the following:
128cae6f3459 initial coding
carl
parents:
diff changeset
6488
128cae6f3459 initial coding
carl
parents:
diff changeset
6489 clean remove files from the build directory
128cae6f3459 initial coding
carl
parents:
diff changeset
6490 compile compile a source file into a libtool object
128cae6f3459 initial coding
carl
parents:
diff changeset
6491 execute automatically set library path, then run a program
128cae6f3459 initial coding
carl
parents:
diff changeset
6492 finish complete the installation of libtool libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
6493 install install libraries or executables
128cae6f3459 initial coding
carl
parents:
diff changeset
6494 link create a library or an executable
128cae6f3459 initial coding
carl
parents:
diff changeset
6495 uninstall remove libraries from an installed directory
128cae6f3459 initial coding
carl
parents:
diff changeset
6496
128cae6f3459 initial coding
carl
parents:
diff changeset
6497 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
128cae6f3459 initial coding
carl
parents:
diff changeset
6498 a more detailed description of MODE.
128cae6f3459 initial coding
carl
parents:
diff changeset
6499
128cae6f3459 initial coding
carl
parents:
diff changeset
6500 Report bugs to <bug-libtool@gnu.org>."
128cae6f3459 initial coding
carl
parents:
diff changeset
6501 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
6502 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6503
128cae6f3459 initial coding
carl
parents:
diff changeset
6504 clean)
128cae6f3459 initial coding
carl
parents:
diff changeset
6505 $echo \
128cae6f3459 initial coding
carl
parents:
diff changeset
6506 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
128cae6f3459 initial coding
carl
parents:
diff changeset
6507
128cae6f3459 initial coding
carl
parents:
diff changeset
6508 Remove files from the build directory.
128cae6f3459 initial coding
carl
parents:
diff changeset
6509
128cae6f3459 initial coding
carl
parents:
diff changeset
6510 RM is the name of the program to use to delete files associated with each FILE
128cae6f3459 initial coding
carl
parents:
diff changeset
6511 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
128cae6f3459 initial coding
carl
parents:
diff changeset
6512 to RM.
128cae6f3459 initial coding
carl
parents:
diff changeset
6513
128cae6f3459 initial coding
carl
parents:
diff changeset
6514 If FILE is a libtool library, object or program, all the files associated
128cae6f3459 initial coding
carl
parents:
diff changeset
6515 with it are deleted. Otherwise, only FILE itself is deleted using RM."
128cae6f3459 initial coding
carl
parents:
diff changeset
6516 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6517
128cae6f3459 initial coding
carl
parents:
diff changeset
6518 compile)
128cae6f3459 initial coding
carl
parents:
diff changeset
6519 $echo \
128cae6f3459 initial coding
carl
parents:
diff changeset
6520 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
128cae6f3459 initial coding
carl
parents:
diff changeset
6521
128cae6f3459 initial coding
carl
parents:
diff changeset
6522 Compile a source file into a libtool library object.
128cae6f3459 initial coding
carl
parents:
diff changeset
6523
128cae6f3459 initial coding
carl
parents:
diff changeset
6524 This mode accepts the following additional options:
128cae6f3459 initial coding
carl
parents:
diff changeset
6525
128cae6f3459 initial coding
carl
parents:
diff changeset
6526 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
128cae6f3459 initial coding
carl
parents:
diff changeset
6527 -prefer-pic try to building PIC objects only
128cae6f3459 initial coding
carl
parents:
diff changeset
6528 -prefer-non-pic try to building non-PIC objects only
128cae6f3459 initial coding
carl
parents:
diff changeset
6529 -static always build a \`.o' file suitable for static linking
128cae6f3459 initial coding
carl
parents:
diff changeset
6530
128cae6f3459 initial coding
carl
parents:
diff changeset
6531 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
128cae6f3459 initial coding
carl
parents:
diff changeset
6532 from the given SOURCEFILE.
128cae6f3459 initial coding
carl
parents:
diff changeset
6533
128cae6f3459 initial coding
carl
parents:
diff changeset
6534 The output file name is determined by removing the directory component from
128cae6f3459 initial coding
carl
parents:
diff changeset
6535 SOURCEFILE, then substituting the C source code suffix \`.c' with the
128cae6f3459 initial coding
carl
parents:
diff changeset
6536 library object suffix, \`.lo'."
128cae6f3459 initial coding
carl
parents:
diff changeset
6537 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6538
128cae6f3459 initial coding
carl
parents:
diff changeset
6539 execute)
128cae6f3459 initial coding
carl
parents:
diff changeset
6540 $echo \
128cae6f3459 initial coding
carl
parents:
diff changeset
6541 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
128cae6f3459 initial coding
carl
parents:
diff changeset
6542
128cae6f3459 initial coding
carl
parents:
diff changeset
6543 Automatically set library path, then run a program.
128cae6f3459 initial coding
carl
parents:
diff changeset
6544
128cae6f3459 initial coding
carl
parents:
diff changeset
6545 This mode accepts the following additional options:
128cae6f3459 initial coding
carl
parents:
diff changeset
6546
128cae6f3459 initial coding
carl
parents:
diff changeset
6547 -dlopen FILE add the directory containing FILE to the library path
128cae6f3459 initial coding
carl
parents:
diff changeset
6548
128cae6f3459 initial coding
carl
parents:
diff changeset
6549 This mode sets the library path environment variable according to \`-dlopen'
128cae6f3459 initial coding
carl
parents:
diff changeset
6550 flags.
128cae6f3459 initial coding
carl
parents:
diff changeset
6551
128cae6f3459 initial coding
carl
parents:
diff changeset
6552 If any of the ARGS are libtool executable wrappers, then they are translated
128cae6f3459 initial coding
carl
parents:
diff changeset
6553 into their corresponding uninstalled binary, and any of their required library
128cae6f3459 initial coding
carl
parents:
diff changeset
6554 directories are added to the library path.
128cae6f3459 initial coding
carl
parents:
diff changeset
6555
128cae6f3459 initial coding
carl
parents:
diff changeset
6556 Then, COMMAND is executed, with ARGS as arguments."
128cae6f3459 initial coding
carl
parents:
diff changeset
6557 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6558
128cae6f3459 initial coding
carl
parents:
diff changeset
6559 finish)
128cae6f3459 initial coding
carl
parents:
diff changeset
6560 $echo \
128cae6f3459 initial coding
carl
parents:
diff changeset
6561 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
128cae6f3459 initial coding
carl
parents:
diff changeset
6562
128cae6f3459 initial coding
carl
parents:
diff changeset
6563 Complete the installation of libtool libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6564
128cae6f3459 initial coding
carl
parents:
diff changeset
6565 Each LIBDIR is a directory that contains libtool libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6566
128cae6f3459 initial coding
carl
parents:
diff changeset
6567 The commands that this mode executes may require superuser privileges. Use
128cae6f3459 initial coding
carl
parents:
diff changeset
6568 the \`--dry-run' option if you just want to see what would be executed."
128cae6f3459 initial coding
carl
parents:
diff changeset
6569 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6570
128cae6f3459 initial coding
carl
parents:
diff changeset
6571 install)
128cae6f3459 initial coding
carl
parents:
diff changeset
6572 $echo \
128cae6f3459 initial coding
carl
parents:
diff changeset
6573 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
128cae6f3459 initial coding
carl
parents:
diff changeset
6574
128cae6f3459 initial coding
carl
parents:
diff changeset
6575 Install executables or libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6576
128cae6f3459 initial coding
carl
parents:
diff changeset
6577 INSTALL-COMMAND is the installation command. The first component should be
128cae6f3459 initial coding
carl
parents:
diff changeset
6578 either the \`install' or \`cp' program.
128cae6f3459 initial coding
carl
parents:
diff changeset
6579
128cae6f3459 initial coding
carl
parents:
diff changeset
6580 The rest of the components are interpreted as arguments to that command (only
128cae6f3459 initial coding
carl
parents:
diff changeset
6581 BSD-compatible install options are recognized)."
128cae6f3459 initial coding
carl
parents:
diff changeset
6582 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6583
128cae6f3459 initial coding
carl
parents:
diff changeset
6584 link)
128cae6f3459 initial coding
carl
parents:
diff changeset
6585 $echo \
128cae6f3459 initial coding
carl
parents:
diff changeset
6586 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
128cae6f3459 initial coding
carl
parents:
diff changeset
6587
128cae6f3459 initial coding
carl
parents:
diff changeset
6588 Link object files or libraries together to form another library, or to
128cae6f3459 initial coding
carl
parents:
diff changeset
6589 create an executable program.
128cae6f3459 initial coding
carl
parents:
diff changeset
6590
128cae6f3459 initial coding
carl
parents:
diff changeset
6591 LINK-COMMAND is a command using the C compiler that you would use to create
128cae6f3459 initial coding
carl
parents:
diff changeset
6592 a program from several object files.
128cae6f3459 initial coding
carl
parents:
diff changeset
6593
128cae6f3459 initial coding
carl
parents:
diff changeset
6594 The following components of LINK-COMMAND are treated specially:
128cae6f3459 initial coding
carl
parents:
diff changeset
6595
128cae6f3459 initial coding
carl
parents:
diff changeset
6596 -all-static do not do any dynamic linking at all
128cae6f3459 initial coding
carl
parents:
diff changeset
6597 -avoid-version do not add a version suffix if possible
128cae6f3459 initial coding
carl
parents:
diff changeset
6598 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
128cae6f3459 initial coding
carl
parents:
diff changeset
6599 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
128cae6f3459 initial coding
carl
parents:
diff changeset
6600 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
128cae6f3459 initial coding
carl
parents:
diff changeset
6601 -export-symbols SYMFILE
128cae6f3459 initial coding
carl
parents:
diff changeset
6602 try to export only the symbols listed in SYMFILE
128cae6f3459 initial coding
carl
parents:
diff changeset
6603 -export-symbols-regex REGEX
128cae6f3459 initial coding
carl
parents:
diff changeset
6604 try to export only the symbols matching REGEX
128cae6f3459 initial coding
carl
parents:
diff changeset
6605 -LLIBDIR search LIBDIR for required installed libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
6606 -lNAME OUTPUT-FILE requires the installed library libNAME
128cae6f3459 initial coding
carl
parents:
diff changeset
6607 -module build a library that can dlopened
128cae6f3459 initial coding
carl
parents:
diff changeset
6608 -no-fast-install disable the fast-install mode
128cae6f3459 initial coding
carl
parents:
diff changeset
6609 -no-install link a not-installable executable
128cae6f3459 initial coding
carl
parents:
diff changeset
6610 -no-undefined declare that a library does not refer to external symbols
128cae6f3459 initial coding
carl
parents:
diff changeset
6611 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
128cae6f3459 initial coding
carl
parents:
diff changeset
6612 -objectlist FILE Use a list of object files found in FILE to specify objects
128cae6f3459 initial coding
carl
parents:
diff changeset
6613 -release RELEASE specify package release information
128cae6f3459 initial coding
carl
parents:
diff changeset
6614 -rpath LIBDIR the created library will eventually be installed in LIBDIR
128cae6f3459 initial coding
carl
parents:
diff changeset
6615 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
6616 -static do not do any dynamic linking of libtool libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
6617 -version-info CURRENT[:REVISION[:AGE]]
128cae6f3459 initial coding
carl
parents:
diff changeset
6618 specify library version info [each variable defaults to 0]
128cae6f3459 initial coding
carl
parents:
diff changeset
6619
128cae6f3459 initial coding
carl
parents:
diff changeset
6620 All other options (arguments beginning with \`-') are ignored.
128cae6f3459 initial coding
carl
parents:
diff changeset
6621
128cae6f3459 initial coding
carl
parents:
diff changeset
6622 Every other argument is treated as a filename. Files ending in \`.la' are
128cae6f3459 initial coding
carl
parents:
diff changeset
6623 treated as uninstalled libtool libraries, other files are standard or library
128cae6f3459 initial coding
carl
parents:
diff changeset
6624 object files.
128cae6f3459 initial coding
carl
parents:
diff changeset
6625
128cae6f3459 initial coding
carl
parents:
diff changeset
6626 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
128cae6f3459 initial coding
carl
parents:
diff changeset
6627 only library objects (\`.lo' files) may be specified, and \`-rpath' is
128cae6f3459 initial coding
carl
parents:
diff changeset
6628 required, except when creating a convenience library.
128cae6f3459 initial coding
carl
parents:
diff changeset
6629
128cae6f3459 initial coding
carl
parents:
diff changeset
6630 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
128cae6f3459 initial coding
carl
parents:
diff changeset
6631 using \`ar' and \`ranlib', or on Windows using \`lib'.
128cae6f3459 initial coding
carl
parents:
diff changeset
6632
128cae6f3459 initial coding
carl
parents:
diff changeset
6633 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
128cae6f3459 initial coding
carl
parents:
diff changeset
6634 is created, otherwise an executable program is created."
128cae6f3459 initial coding
carl
parents:
diff changeset
6635 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6636
128cae6f3459 initial coding
carl
parents:
diff changeset
6637 uninstall)
128cae6f3459 initial coding
carl
parents:
diff changeset
6638 $echo \
128cae6f3459 initial coding
carl
parents:
diff changeset
6639 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
128cae6f3459 initial coding
carl
parents:
diff changeset
6640
128cae6f3459 initial coding
carl
parents:
diff changeset
6641 Remove libraries from an installation directory.
128cae6f3459 initial coding
carl
parents:
diff changeset
6642
128cae6f3459 initial coding
carl
parents:
diff changeset
6643 RM is the name of the program to use to delete files associated with each FILE
128cae6f3459 initial coding
carl
parents:
diff changeset
6644 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
128cae6f3459 initial coding
carl
parents:
diff changeset
6645 to RM.
128cae6f3459 initial coding
carl
parents:
diff changeset
6646
128cae6f3459 initial coding
carl
parents:
diff changeset
6647 If FILE is a libtool library, all the files associated with it are deleted.
128cae6f3459 initial coding
carl
parents:
diff changeset
6648 Otherwise, only FILE itself is deleted using RM."
128cae6f3459 initial coding
carl
parents:
diff changeset
6649 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6650
128cae6f3459 initial coding
carl
parents:
diff changeset
6651 *)
128cae6f3459 initial coding
carl
parents:
diff changeset
6652 $echo "$modename: invalid operation mode \`$mode'" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6653 $echo "$help" 1>&2
128cae6f3459 initial coding
carl
parents:
diff changeset
6654 exit 1
128cae6f3459 initial coding
carl
parents:
diff changeset
6655 ;;
128cae6f3459 initial coding
carl
parents:
diff changeset
6656 esac
128cae6f3459 initial coding
carl
parents:
diff changeset
6657
128cae6f3459 initial coding
carl
parents:
diff changeset
6658 $echo
128cae6f3459 initial coding
carl
parents:
diff changeset
6659 $echo "Try \`$modename --help' for more information about other modes."
128cae6f3459 initial coding
carl
parents:
diff changeset
6660
128cae6f3459 initial coding
carl
parents:
diff changeset
6661 exit 0
128cae6f3459 initial coding
carl
parents:
diff changeset
6662
128cae6f3459 initial coding
carl
parents:
diff changeset
6663 # The TAGs below are defined such that we never get into a situation
128cae6f3459 initial coding
carl
parents:
diff changeset
6664 # in which we disable both kinds of libraries. Given conflicting
128cae6f3459 initial coding
carl
parents:
diff changeset
6665 # choices, we go for a static library, that is the most portable,
128cae6f3459 initial coding
carl
parents:
diff changeset
6666 # since we can't tell whether shared libraries were disabled because
128cae6f3459 initial coding
carl
parents:
diff changeset
6667 # the user asked for that or because the platform doesn't support
128cae6f3459 initial coding
carl
parents:
diff changeset
6668 # them. This is particularly important on AIX, because we don't
128cae6f3459 initial coding
carl
parents:
diff changeset
6669 # support having both static and shared libraries enabled at the same
128cae6f3459 initial coding
carl
parents:
diff changeset
6670 # time on that platform, so we default to a shared-only configuration.
128cae6f3459 initial coding
carl
parents:
diff changeset
6671 # If a disable-shared tag is given, we'll fallback to a static-only
128cae6f3459 initial coding
carl
parents:
diff changeset
6672 # configuration. But we'll never go from static-only to shared-only.
128cae6f3459 initial coding
carl
parents:
diff changeset
6673
128cae6f3459 initial coding
carl
parents:
diff changeset
6674 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
128cae6f3459 initial coding
carl
parents:
diff changeset
6675 build_libtool_libs=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6676 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
6677 # ### END LIBTOOL TAG CONFIG: disable-shared
128cae6f3459 initial coding
carl
parents:
diff changeset
6678
128cae6f3459 initial coding
carl
parents:
diff changeset
6679 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
128cae6f3459 initial coding
carl
parents:
diff changeset
6680 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
128cae6f3459 initial coding
carl
parents:
diff changeset
6681 # ### END LIBTOOL TAG CONFIG: disable-static
128cae6f3459 initial coding
carl
parents:
diff changeset
6682
128cae6f3459 initial coding
carl
parents:
diff changeset
6683 # Local Variables:
128cae6f3459 initial coding
carl
parents:
diff changeset
6684 # mode:shell-script
128cae6f3459 initial coding
carl
parents:
diff changeset
6685 # sh-indentation:2
128cae6f3459 initial coding
carl
parents:
diff changeset
6686 # End:
128cae6f3459 initial coding
carl
parents:
diff changeset
6687 # ### BEGIN LIBTOOL TAG CONFIG: CXX
128cae6f3459 initial coding
carl
parents:
diff changeset
6688
128cae6f3459 initial coding
carl
parents:
diff changeset
6689 # Libtool was configured on host ns.five-ten-sg.com:
128cae6f3459 initial coding
carl
parents:
diff changeset
6690
128cae6f3459 initial coding
carl
parents:
diff changeset
6691 # Shell to use when invoking shell scripts.
128cae6f3459 initial coding
carl
parents:
diff changeset
6692 SHELL="/bin/sh"
128cae6f3459 initial coding
carl
parents:
diff changeset
6693
128cae6f3459 initial coding
carl
parents:
diff changeset
6694 # Whether or not to build shared libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6695 build_libtool_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
6696
128cae6f3459 initial coding
carl
parents:
diff changeset
6697 # Whether or not to build static libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6698 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
6699
128cae6f3459 initial coding
carl
parents:
diff changeset
6700 # Whether or not to add -lc for building shared libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6701 build_libtool_need_lc=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6702
128cae6f3459 initial coding
carl
parents:
diff changeset
6703 # Whether or not to disallow shared libs when runtime libs are static
128cae6f3459 initial coding
carl
parents:
diff changeset
6704 allow_libtool_libs_with_static_runtimes=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6705
128cae6f3459 initial coding
carl
parents:
diff changeset
6706 # Whether or not to optimize for fast installation.
128cae6f3459 initial coding
carl
parents:
diff changeset
6707 fast_install=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
6708
128cae6f3459 initial coding
carl
parents:
diff changeset
6709 # The host system.
128cae6f3459 initial coding
carl
parents:
diff changeset
6710 host_alias=
128cae6f3459 initial coding
carl
parents:
diff changeset
6711 host=i686-redhat-linux-gnu
128cae6f3459 initial coding
carl
parents:
diff changeset
6712
128cae6f3459 initial coding
carl
parents:
diff changeset
6713 # An echo program that does not interpret backslashes.
128cae6f3459 initial coding
carl
parents:
diff changeset
6714 echo="echo"
128cae6f3459 initial coding
carl
parents:
diff changeset
6715
128cae6f3459 initial coding
carl
parents:
diff changeset
6716 # The archiver.
128cae6f3459 initial coding
carl
parents:
diff changeset
6717 AR="ar"
128cae6f3459 initial coding
carl
parents:
diff changeset
6718 AR_FLAGS="cru"
128cae6f3459 initial coding
carl
parents:
diff changeset
6719
128cae6f3459 initial coding
carl
parents:
diff changeset
6720 # A C compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
6721 LTCC="gcc"
128cae6f3459 initial coding
carl
parents:
diff changeset
6722
128cae6f3459 initial coding
carl
parents:
diff changeset
6723 # A language-specific compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
6724 CC="g++"
128cae6f3459 initial coding
carl
parents:
diff changeset
6725
128cae6f3459 initial coding
carl
parents:
diff changeset
6726 # Is the compiler the GNU C compiler?
128cae6f3459 initial coding
carl
parents:
diff changeset
6727 with_gcc=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
6728
128cae6f3459 initial coding
carl
parents:
diff changeset
6729 # An ERE matcher.
128cae6f3459 initial coding
carl
parents:
diff changeset
6730 EGREP="grep -E"
128cae6f3459 initial coding
carl
parents:
diff changeset
6731
128cae6f3459 initial coding
carl
parents:
diff changeset
6732 # The linker used to build libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6733 LD="/usr/bin/ld"
128cae6f3459 initial coding
carl
parents:
diff changeset
6734
128cae6f3459 initial coding
carl
parents:
diff changeset
6735 # Whether we need hard or soft links.
128cae6f3459 initial coding
carl
parents:
diff changeset
6736 LN_S="ln -s"
128cae6f3459 initial coding
carl
parents:
diff changeset
6737
128cae6f3459 initial coding
carl
parents:
diff changeset
6738 # A BSD-compatible nm program.
128cae6f3459 initial coding
carl
parents:
diff changeset
6739 NM="/usr/bin/nm -B"
128cae6f3459 initial coding
carl
parents:
diff changeset
6740
128cae6f3459 initial coding
carl
parents:
diff changeset
6741 # A symbol stripping program
128cae6f3459 initial coding
carl
parents:
diff changeset
6742 STRIP="strip"
128cae6f3459 initial coding
carl
parents:
diff changeset
6743
128cae6f3459 initial coding
carl
parents:
diff changeset
6744 # Used to examine libraries when file_magic_cmd begins "file"
128cae6f3459 initial coding
carl
parents:
diff changeset
6745 MAGIC_CMD=file
128cae6f3459 initial coding
carl
parents:
diff changeset
6746
128cae6f3459 initial coding
carl
parents:
diff changeset
6747 # Used on cygwin: DLL creation program.
128cae6f3459 initial coding
carl
parents:
diff changeset
6748 DLLTOOL="dlltool"
128cae6f3459 initial coding
carl
parents:
diff changeset
6749
128cae6f3459 initial coding
carl
parents:
diff changeset
6750 # Used on cygwin: object dumper.
128cae6f3459 initial coding
carl
parents:
diff changeset
6751 OBJDUMP="objdump"
128cae6f3459 initial coding
carl
parents:
diff changeset
6752
128cae6f3459 initial coding
carl
parents:
diff changeset
6753 # Used on cygwin: assembler.
128cae6f3459 initial coding
carl
parents:
diff changeset
6754 AS="as"
128cae6f3459 initial coding
carl
parents:
diff changeset
6755
128cae6f3459 initial coding
carl
parents:
diff changeset
6756 # The name of the directory that contains temporary libtool files.
128cae6f3459 initial coding
carl
parents:
diff changeset
6757 objdir=.libs
128cae6f3459 initial coding
carl
parents:
diff changeset
6758
128cae6f3459 initial coding
carl
parents:
diff changeset
6759 # How to create reloadable object files.
128cae6f3459 initial coding
carl
parents:
diff changeset
6760 reload_flag=" -r"
128cae6f3459 initial coding
carl
parents:
diff changeset
6761 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
128cae6f3459 initial coding
carl
parents:
diff changeset
6762
128cae6f3459 initial coding
carl
parents:
diff changeset
6763 # How to pass a linker flag through the compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
6764 wl="-Wl,"
128cae6f3459 initial coding
carl
parents:
diff changeset
6765
128cae6f3459 initial coding
carl
parents:
diff changeset
6766 # Object file suffix (normally "o").
128cae6f3459 initial coding
carl
parents:
diff changeset
6767 objext="o"
128cae6f3459 initial coding
carl
parents:
diff changeset
6768
128cae6f3459 initial coding
carl
parents:
diff changeset
6769 # Old archive suffix (normally "a").
128cae6f3459 initial coding
carl
parents:
diff changeset
6770 libext="a"
128cae6f3459 initial coding
carl
parents:
diff changeset
6771
128cae6f3459 initial coding
carl
parents:
diff changeset
6772 # Shared library suffix (normally ".so").
128cae6f3459 initial coding
carl
parents:
diff changeset
6773 shrext_cmds='.so'
128cae6f3459 initial coding
carl
parents:
diff changeset
6774
128cae6f3459 initial coding
carl
parents:
diff changeset
6775 # Executable file suffix (normally "").
128cae6f3459 initial coding
carl
parents:
diff changeset
6776 exeext=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6777
128cae6f3459 initial coding
carl
parents:
diff changeset
6778 # Additional compiler flags for building library objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
6779 pic_flag=" -fPIC -DPIC"
128cae6f3459 initial coding
carl
parents:
diff changeset
6780 pic_mode=default
128cae6f3459 initial coding
carl
parents:
diff changeset
6781
128cae6f3459 initial coding
carl
parents:
diff changeset
6782 # What is the maximum length of a command?
128cae6f3459 initial coding
carl
parents:
diff changeset
6783 max_cmd_len=32768
128cae6f3459 initial coding
carl
parents:
diff changeset
6784
128cae6f3459 initial coding
carl
parents:
diff changeset
6785 # Does compiler simultaneously support -c and -o options?
128cae6f3459 initial coding
carl
parents:
diff changeset
6786 compiler_c_o="yes"
128cae6f3459 initial coding
carl
parents:
diff changeset
6787
128cae6f3459 initial coding
carl
parents:
diff changeset
6788 # Must we lock files when doing compilation ?
128cae6f3459 initial coding
carl
parents:
diff changeset
6789 need_locks="no"
128cae6f3459 initial coding
carl
parents:
diff changeset
6790
128cae6f3459 initial coding
carl
parents:
diff changeset
6791 # Do we need the lib prefix for modules?
128cae6f3459 initial coding
carl
parents:
diff changeset
6792 need_lib_prefix=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6793
128cae6f3459 initial coding
carl
parents:
diff changeset
6794 # Do we need a version for libraries?
128cae6f3459 initial coding
carl
parents:
diff changeset
6795 need_version=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6796
128cae6f3459 initial coding
carl
parents:
diff changeset
6797 # Whether dlopen is supported.
128cae6f3459 initial coding
carl
parents:
diff changeset
6798 dlopen_support=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
6799
128cae6f3459 initial coding
carl
parents:
diff changeset
6800 # Whether dlopen of programs is supported.
128cae6f3459 initial coding
carl
parents:
diff changeset
6801 dlopen_self=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
6802
128cae6f3459 initial coding
carl
parents:
diff changeset
6803 # Whether dlopen of statically linked programs is supported.
128cae6f3459 initial coding
carl
parents:
diff changeset
6804 dlopen_self_static=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
6805
128cae6f3459 initial coding
carl
parents:
diff changeset
6806 # Compiler flag to prevent dynamic linking.
128cae6f3459 initial coding
carl
parents:
diff changeset
6807 link_static_flag="-static"
128cae6f3459 initial coding
carl
parents:
diff changeset
6808
128cae6f3459 initial coding
carl
parents:
diff changeset
6809 # Compiler flag to turn off builtin functions.
128cae6f3459 initial coding
carl
parents:
diff changeset
6810 no_builtin_flag=" -fno-builtin"
128cae6f3459 initial coding
carl
parents:
diff changeset
6811
128cae6f3459 initial coding
carl
parents:
diff changeset
6812 # Compiler flag to allow reflexive dlopens.
128cae6f3459 initial coding
carl
parents:
diff changeset
6813 export_dynamic_flag_spec="\${wl}--export-dynamic"
128cae6f3459 initial coding
carl
parents:
diff changeset
6814
128cae6f3459 initial coding
carl
parents:
diff changeset
6815 # Compiler flag to generate shared objects directly from archives.
128cae6f3459 initial coding
carl
parents:
diff changeset
6816 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
128cae6f3459 initial coding
carl
parents:
diff changeset
6817
128cae6f3459 initial coding
carl
parents:
diff changeset
6818 # Compiler flag to generate thread-safe objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
6819 thread_safe_flag_spec=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6820
128cae6f3459 initial coding
carl
parents:
diff changeset
6821 # Library versioning type.
128cae6f3459 initial coding
carl
parents:
diff changeset
6822 version_type=linux
128cae6f3459 initial coding
carl
parents:
diff changeset
6823
128cae6f3459 initial coding
carl
parents:
diff changeset
6824 # Format of library name prefix.
128cae6f3459 initial coding
carl
parents:
diff changeset
6825 libname_spec="lib\$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
6826
128cae6f3459 initial coding
carl
parents:
diff changeset
6827 # List of archive names. First name is the real one, the rest are links.
128cae6f3459 initial coding
carl
parents:
diff changeset
6828 # The last name is the one that the linker finds with -lNAME.
128cae6f3459 initial coding
carl
parents:
diff changeset
6829 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
128cae6f3459 initial coding
carl
parents:
diff changeset
6830
128cae6f3459 initial coding
carl
parents:
diff changeset
6831 # The coded name of the library, if different from the real name.
128cae6f3459 initial coding
carl
parents:
diff changeset
6832 soname_spec="\${libname}\${release}\${shared_ext}\$major"
128cae6f3459 initial coding
carl
parents:
diff changeset
6833
128cae6f3459 initial coding
carl
parents:
diff changeset
6834 # Commands used to build and install an old-style archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
6835 RANLIB="ranlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
6836 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
6837 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
6838 old_postuninstall_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6839
128cae6f3459 initial coding
carl
parents:
diff changeset
6840 # Create an old-style archive from a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
6841 old_archive_from_new_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6842
128cae6f3459 initial coding
carl
parents:
diff changeset
6843 # Create a temporary old-style archive to link instead of a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
6844 old_archive_from_expsyms_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6845
128cae6f3459 initial coding
carl
parents:
diff changeset
6846 # Commands used to build and install a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
6847 archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
128cae6f3459 initial coding
carl
parents:
diff changeset
6848 archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
128cae6f3459 initial coding
carl
parents:
diff changeset
6849 postinstall_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6850 postuninstall_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6851
128cae6f3459 initial coding
carl
parents:
diff changeset
6852 # Commands used to build a loadable module (assumed same as above if empty)
128cae6f3459 initial coding
carl
parents:
diff changeset
6853 module_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6854 module_expsym_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6855
128cae6f3459 initial coding
carl
parents:
diff changeset
6856 # Commands to strip libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6857 old_striplib="strip --strip-debug"
128cae6f3459 initial coding
carl
parents:
diff changeset
6858 striplib="strip --strip-unneeded"
128cae6f3459 initial coding
carl
parents:
diff changeset
6859
128cae6f3459 initial coding
carl
parents:
diff changeset
6860 # Dependencies to place before the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
6861 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
6862 predep_objects="/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../crti.o /usr/lib/gcc/i386-redhat-linux/3.4.4/crtbeginS.o"
128cae6f3459 initial coding
carl
parents:
diff changeset
6863
128cae6f3459 initial coding
carl
parents:
diff changeset
6864 # Dependencies to place after the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
6865 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
6866 postdep_objects="/usr/lib/gcc/i386-redhat-linux/3.4.4/crtendS.o /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../crtn.o"
128cae6f3459 initial coding
carl
parents:
diff changeset
6867
128cae6f3459 initial coding
carl
parents:
diff changeset
6868 # Dependencies to place before the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
6869 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
6870 predeps=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6871
128cae6f3459 initial coding
carl
parents:
diff changeset
6872 # Dependencies to place after the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
6873 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
6874 postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s"
128cae6f3459 initial coding
carl
parents:
diff changeset
6875
128cae6f3459 initial coding
carl
parents:
diff changeset
6876 # The library search path used internally by the compiler when linking
128cae6f3459 initial coding
carl
parents:
diff changeset
6877 # a shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
6878 compiler_lib_search_path="-L/usr/lib/gcc/i386-redhat-linux/3.4.4 -L/usr/lib/gcc/i386-redhat-linux/3.4.4 -L/usr/lib/gcc/i386-redhat-linux/3.4.4/../../.."
128cae6f3459 initial coding
carl
parents:
diff changeset
6879
128cae6f3459 initial coding
carl
parents:
diff changeset
6880 # Method to check whether dependent libraries are shared objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
6881 deplibs_check_method="pass_all"
128cae6f3459 initial coding
carl
parents:
diff changeset
6882
128cae6f3459 initial coding
carl
parents:
diff changeset
6883 # Command to use when deplibs_check_method == file_magic.
128cae6f3459 initial coding
carl
parents:
diff changeset
6884 file_magic_cmd="\$MAGIC_CMD"
128cae6f3459 initial coding
carl
parents:
diff changeset
6885
128cae6f3459 initial coding
carl
parents:
diff changeset
6886 # Flag that allows shared libraries with undefined symbols to be built.
128cae6f3459 initial coding
carl
parents:
diff changeset
6887 allow_undefined_flag=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6888
128cae6f3459 initial coding
carl
parents:
diff changeset
6889 # Flag that forces no undefined symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
6890 no_undefined_flag=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6891
128cae6f3459 initial coding
carl
parents:
diff changeset
6892 # Commands used to finish a libtool library installation in a directory.
128cae6f3459 initial coding
carl
parents:
diff changeset
6893 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6894
128cae6f3459 initial coding
carl
parents:
diff changeset
6895 # Same as above, but a single script fragment to be evaled but not shown.
128cae6f3459 initial coding
carl
parents:
diff changeset
6896 finish_eval=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6897
128cae6f3459 initial coding
carl
parents:
diff changeset
6898 # Take the output of nm and produce a listing of raw symbols and C names.
128cae6f3459 initial coding
carl
parents:
diff changeset
6899 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
128cae6f3459 initial coding
carl
parents:
diff changeset
6900
128cae6f3459 initial coding
carl
parents:
diff changeset
6901 # Transform the output of nm in a proper C declaration
128cae6f3459 initial coding
carl
parents:
diff changeset
6902 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
128cae6f3459 initial coding
carl
parents:
diff changeset
6903
128cae6f3459 initial coding
carl
parents:
diff changeset
6904 # Transform the output of nm in a C name address pair
128cae6f3459 initial coding
carl
parents:
diff changeset
6905 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
128cae6f3459 initial coding
carl
parents:
diff changeset
6906
128cae6f3459 initial coding
carl
parents:
diff changeset
6907 # This is the shared library runtime path variable.
128cae6f3459 initial coding
carl
parents:
diff changeset
6908 runpath_var=LD_RUN_PATH
128cae6f3459 initial coding
carl
parents:
diff changeset
6909
128cae6f3459 initial coding
carl
parents:
diff changeset
6910 # This is the shared library path variable.
128cae6f3459 initial coding
carl
parents:
diff changeset
6911 shlibpath_var=LD_LIBRARY_PATH
128cae6f3459 initial coding
carl
parents:
diff changeset
6912
128cae6f3459 initial coding
carl
parents:
diff changeset
6913 # Is shlibpath searched before the hard-coded library search path?
128cae6f3459 initial coding
carl
parents:
diff changeset
6914 shlibpath_overrides_runpath=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6915
128cae6f3459 initial coding
carl
parents:
diff changeset
6916 # How to hardcode a shared library path into an executable.
128cae6f3459 initial coding
carl
parents:
diff changeset
6917 hardcode_action=immediate
128cae6f3459 initial coding
carl
parents:
diff changeset
6918
128cae6f3459 initial coding
carl
parents:
diff changeset
6919 # Whether we should hardcode library paths into libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6920 hardcode_into_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
6921
128cae6f3459 initial coding
carl
parents:
diff changeset
6922 # Flag to hardcode $libdir into a binary during linking.
128cae6f3459 initial coding
carl
parents:
diff changeset
6923 # This must work even if $libdir does not exist.
128cae6f3459 initial coding
carl
parents:
diff changeset
6924 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
6925
128cae6f3459 initial coding
carl
parents:
diff changeset
6926 # If ld is used when linking, flag to hardcode $libdir into
128cae6f3459 initial coding
carl
parents:
diff changeset
6927 # a binary during linking. This must work even if $libdir does
128cae6f3459 initial coding
carl
parents:
diff changeset
6928 # not exist.
128cae6f3459 initial coding
carl
parents:
diff changeset
6929 hardcode_libdir_flag_spec_ld=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6930
128cae6f3459 initial coding
carl
parents:
diff changeset
6931 # Whether we need a single -rpath flag with a separated argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
6932 hardcode_libdir_separator=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6933
128cae6f3459 initial coding
carl
parents:
diff changeset
6934 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
128cae6f3459 initial coding
carl
parents:
diff changeset
6935 # resulting binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
6936 hardcode_direct=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6937
128cae6f3459 initial coding
carl
parents:
diff changeset
6938 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
128cae6f3459 initial coding
carl
parents:
diff changeset
6939 # resulting binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
6940 hardcode_minus_L=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6941
128cae6f3459 initial coding
carl
parents:
diff changeset
6942 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
128cae6f3459 initial coding
carl
parents:
diff changeset
6943 # the resulting binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
6944 hardcode_shlibpath_var=
128cae6f3459 initial coding
carl
parents:
diff changeset
6945
128cae6f3459 initial coding
carl
parents:
diff changeset
6946 # Set to yes if building a shared library automatically hardcodes DIR into the library
128cae6f3459 initial coding
carl
parents:
diff changeset
6947 # and all subsequent libraries and executables linked against it.
128cae6f3459 initial coding
carl
parents:
diff changeset
6948 hardcode_automatic=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6949
128cae6f3459 initial coding
carl
parents:
diff changeset
6950 # Variables whose values should be saved in libtool wrapper scripts and
128cae6f3459 initial coding
carl
parents:
diff changeset
6951 # restored at relink time.
128cae6f3459 initial coding
carl
parents:
diff changeset
6952 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
128cae6f3459 initial coding
carl
parents:
diff changeset
6953
128cae6f3459 initial coding
carl
parents:
diff changeset
6954 # Whether libtool must link a program against all its dependency libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6955 link_all_deplibs=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
6956
128cae6f3459 initial coding
carl
parents:
diff changeset
6957 # Compile-time system search path for libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
6958 sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../ /lib/i386-redhat-linux/3.4.4/ /lib/ /usr/lib/i386-redhat-linux/3.4.4/ /usr/lib/"
128cae6f3459 initial coding
carl
parents:
diff changeset
6959
128cae6f3459 initial coding
carl
parents:
diff changeset
6960 # Run-time system search path for libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
6961 sys_lib_dlsearch_path_spec="/lib /usr/lib include ld.so.conf.d/*.conf /usr/lib/wine "
128cae6f3459 initial coding
carl
parents:
diff changeset
6962
128cae6f3459 initial coding
carl
parents:
diff changeset
6963 # Fix the shell variable $srcfile for the compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
6964 fix_srcfile_path=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6965
128cae6f3459 initial coding
carl
parents:
diff changeset
6966 # Set to yes if exported symbols are required.
128cae6f3459 initial coding
carl
parents:
diff changeset
6967 always_export_symbols=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6968
128cae6f3459 initial coding
carl
parents:
diff changeset
6969 # The commands to list exported symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
6970 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
128cae6f3459 initial coding
carl
parents:
diff changeset
6971
128cae6f3459 initial coding
carl
parents:
diff changeset
6972 # The commands to extract the exported symbol list from a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
6973 extract_expsyms_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6974
128cae6f3459 initial coding
carl
parents:
diff changeset
6975 # Symbols that should not be listed in the preloaded symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
6976 exclude_expsyms=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6977
128cae6f3459 initial coding
carl
parents:
diff changeset
6978 # Symbols that must always be exported.
128cae6f3459 initial coding
carl
parents:
diff changeset
6979 include_expsyms=""
128cae6f3459 initial coding
carl
parents:
diff changeset
6980
128cae6f3459 initial coding
carl
parents:
diff changeset
6981 # ### END LIBTOOL TAG CONFIG: CXX
128cae6f3459 initial coding
carl
parents:
diff changeset
6982
128cae6f3459 initial coding
carl
parents:
diff changeset
6983 # ### BEGIN LIBTOOL TAG CONFIG: F77
128cae6f3459 initial coding
carl
parents:
diff changeset
6984
128cae6f3459 initial coding
carl
parents:
diff changeset
6985 # Libtool was configured on host ns.five-ten-sg.com:
128cae6f3459 initial coding
carl
parents:
diff changeset
6986
128cae6f3459 initial coding
carl
parents:
diff changeset
6987 # Shell to use when invoking shell scripts.
128cae6f3459 initial coding
carl
parents:
diff changeset
6988 SHELL="/bin/sh"
128cae6f3459 initial coding
carl
parents:
diff changeset
6989
128cae6f3459 initial coding
carl
parents:
diff changeset
6990 # Whether or not to build shared libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6991 build_libtool_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
6992
128cae6f3459 initial coding
carl
parents:
diff changeset
6993 # Whether or not to build static libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6994 build_old_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
6995
128cae6f3459 initial coding
carl
parents:
diff changeset
6996 # Whether or not to add -lc for building shared libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
6997 build_libtool_need_lc=no
128cae6f3459 initial coding
carl
parents:
diff changeset
6998
128cae6f3459 initial coding
carl
parents:
diff changeset
6999 # Whether or not to disallow shared libs when runtime libs are static
128cae6f3459 initial coding
carl
parents:
diff changeset
7000 allow_libtool_libs_with_static_runtimes=no
128cae6f3459 initial coding
carl
parents:
diff changeset
7001
128cae6f3459 initial coding
carl
parents:
diff changeset
7002 # Whether or not to optimize for fast installation.
128cae6f3459 initial coding
carl
parents:
diff changeset
7003 fast_install=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
7004
128cae6f3459 initial coding
carl
parents:
diff changeset
7005 # The host system.
128cae6f3459 initial coding
carl
parents:
diff changeset
7006 host_alias=
128cae6f3459 initial coding
carl
parents:
diff changeset
7007 host=i686-redhat-linux-gnu
128cae6f3459 initial coding
carl
parents:
diff changeset
7008
128cae6f3459 initial coding
carl
parents:
diff changeset
7009 # An echo program that does not interpret backslashes.
128cae6f3459 initial coding
carl
parents:
diff changeset
7010 echo="echo"
128cae6f3459 initial coding
carl
parents:
diff changeset
7011
128cae6f3459 initial coding
carl
parents:
diff changeset
7012 # The archiver.
128cae6f3459 initial coding
carl
parents:
diff changeset
7013 AR="ar"
128cae6f3459 initial coding
carl
parents:
diff changeset
7014 AR_FLAGS="cru"
128cae6f3459 initial coding
carl
parents:
diff changeset
7015
128cae6f3459 initial coding
carl
parents:
diff changeset
7016 # A C compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
7017 LTCC="gcc"
128cae6f3459 initial coding
carl
parents:
diff changeset
7018
128cae6f3459 initial coding
carl
parents:
diff changeset
7019 # A language-specific compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
7020 CC="g77"
128cae6f3459 initial coding
carl
parents:
diff changeset
7021
128cae6f3459 initial coding
carl
parents:
diff changeset
7022 # Is the compiler the GNU C compiler?
128cae6f3459 initial coding
carl
parents:
diff changeset
7023 with_gcc=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
7024
128cae6f3459 initial coding
carl
parents:
diff changeset
7025 # An ERE matcher.
128cae6f3459 initial coding
carl
parents:
diff changeset
7026 EGREP="grep -E"
128cae6f3459 initial coding
carl
parents:
diff changeset
7027
128cae6f3459 initial coding
carl
parents:
diff changeset
7028 # The linker used to build libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
7029 LD="/usr/bin/ld"
128cae6f3459 initial coding
carl
parents:
diff changeset
7030
128cae6f3459 initial coding
carl
parents:
diff changeset
7031 # Whether we need hard or soft links.
128cae6f3459 initial coding
carl
parents:
diff changeset
7032 LN_S="ln -s"
128cae6f3459 initial coding
carl
parents:
diff changeset
7033
128cae6f3459 initial coding
carl
parents:
diff changeset
7034 # A BSD-compatible nm program.
128cae6f3459 initial coding
carl
parents:
diff changeset
7035 NM="/usr/bin/nm -B"
128cae6f3459 initial coding
carl
parents:
diff changeset
7036
128cae6f3459 initial coding
carl
parents:
diff changeset
7037 # A symbol stripping program
128cae6f3459 initial coding
carl
parents:
diff changeset
7038 STRIP="strip"
128cae6f3459 initial coding
carl
parents:
diff changeset
7039
128cae6f3459 initial coding
carl
parents:
diff changeset
7040 # Used to examine libraries when file_magic_cmd begins "file"
128cae6f3459 initial coding
carl
parents:
diff changeset
7041 MAGIC_CMD=file
128cae6f3459 initial coding
carl
parents:
diff changeset
7042
128cae6f3459 initial coding
carl
parents:
diff changeset
7043 # Used on cygwin: DLL creation program.
128cae6f3459 initial coding
carl
parents:
diff changeset
7044 DLLTOOL="dlltool"
128cae6f3459 initial coding
carl
parents:
diff changeset
7045
128cae6f3459 initial coding
carl
parents:
diff changeset
7046 # Used on cygwin: object dumper.
128cae6f3459 initial coding
carl
parents:
diff changeset
7047 OBJDUMP="objdump"
128cae6f3459 initial coding
carl
parents:
diff changeset
7048
128cae6f3459 initial coding
carl
parents:
diff changeset
7049 # Used on cygwin: assembler.
128cae6f3459 initial coding
carl
parents:
diff changeset
7050 AS="as"
128cae6f3459 initial coding
carl
parents:
diff changeset
7051
128cae6f3459 initial coding
carl
parents:
diff changeset
7052 # The name of the directory that contains temporary libtool files.
128cae6f3459 initial coding
carl
parents:
diff changeset
7053 objdir=.libs
128cae6f3459 initial coding
carl
parents:
diff changeset
7054
128cae6f3459 initial coding
carl
parents:
diff changeset
7055 # How to create reloadable object files.
128cae6f3459 initial coding
carl
parents:
diff changeset
7056 reload_flag=" -r"
128cae6f3459 initial coding
carl
parents:
diff changeset
7057 reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
128cae6f3459 initial coding
carl
parents:
diff changeset
7058
128cae6f3459 initial coding
carl
parents:
diff changeset
7059 # How to pass a linker flag through the compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
7060 wl="-Wl,"
128cae6f3459 initial coding
carl
parents:
diff changeset
7061
128cae6f3459 initial coding
carl
parents:
diff changeset
7062 # Object file suffix (normally "o").
128cae6f3459 initial coding
carl
parents:
diff changeset
7063 objext="o"
128cae6f3459 initial coding
carl
parents:
diff changeset
7064
128cae6f3459 initial coding
carl
parents:
diff changeset
7065 # Old archive suffix (normally "a").
128cae6f3459 initial coding
carl
parents:
diff changeset
7066 libext="a"
128cae6f3459 initial coding
carl
parents:
diff changeset
7067
128cae6f3459 initial coding
carl
parents:
diff changeset
7068 # Shared library suffix (normally ".so").
128cae6f3459 initial coding
carl
parents:
diff changeset
7069 shrext_cmds='.so'
128cae6f3459 initial coding
carl
parents:
diff changeset
7070
128cae6f3459 initial coding
carl
parents:
diff changeset
7071 # Executable file suffix (normally "").
128cae6f3459 initial coding
carl
parents:
diff changeset
7072 exeext=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7073
128cae6f3459 initial coding
carl
parents:
diff changeset
7074 # Additional compiler flags for building library objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
7075 pic_flag=" -fPIC"
128cae6f3459 initial coding
carl
parents:
diff changeset
7076 pic_mode=default
128cae6f3459 initial coding
carl
parents:
diff changeset
7077
128cae6f3459 initial coding
carl
parents:
diff changeset
7078 # What is the maximum length of a command?
128cae6f3459 initial coding
carl
parents:
diff changeset
7079 max_cmd_len=32768
128cae6f3459 initial coding
carl
parents:
diff changeset
7080
128cae6f3459 initial coding
carl
parents:
diff changeset
7081 # Does compiler simultaneously support -c and -o options?
128cae6f3459 initial coding
carl
parents:
diff changeset
7082 compiler_c_o="yes"
128cae6f3459 initial coding
carl
parents:
diff changeset
7083
128cae6f3459 initial coding
carl
parents:
diff changeset
7084 # Must we lock files when doing compilation ?
128cae6f3459 initial coding
carl
parents:
diff changeset
7085 need_locks="no"
128cae6f3459 initial coding
carl
parents:
diff changeset
7086
128cae6f3459 initial coding
carl
parents:
diff changeset
7087 # Do we need the lib prefix for modules?
128cae6f3459 initial coding
carl
parents:
diff changeset
7088 need_lib_prefix=no
128cae6f3459 initial coding
carl
parents:
diff changeset
7089
128cae6f3459 initial coding
carl
parents:
diff changeset
7090 # Do we need a version for libraries?
128cae6f3459 initial coding
carl
parents:
diff changeset
7091 need_version=no
128cae6f3459 initial coding
carl
parents:
diff changeset
7092
128cae6f3459 initial coding
carl
parents:
diff changeset
7093 # Whether dlopen is supported.
128cae6f3459 initial coding
carl
parents:
diff changeset
7094 dlopen_support=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
7095
128cae6f3459 initial coding
carl
parents:
diff changeset
7096 # Whether dlopen of programs is supported.
128cae6f3459 initial coding
carl
parents:
diff changeset
7097 dlopen_self=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
7098
128cae6f3459 initial coding
carl
parents:
diff changeset
7099 # Whether dlopen of statically linked programs is supported.
128cae6f3459 initial coding
carl
parents:
diff changeset
7100 dlopen_self_static=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
7101
128cae6f3459 initial coding
carl
parents:
diff changeset
7102 # Compiler flag to prevent dynamic linking.
128cae6f3459 initial coding
carl
parents:
diff changeset
7103 link_static_flag="-static"
128cae6f3459 initial coding
carl
parents:
diff changeset
7104
128cae6f3459 initial coding
carl
parents:
diff changeset
7105 # Compiler flag to turn off builtin functions.
128cae6f3459 initial coding
carl
parents:
diff changeset
7106 no_builtin_flag=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7107
128cae6f3459 initial coding
carl
parents:
diff changeset
7108 # Compiler flag to allow reflexive dlopens.
128cae6f3459 initial coding
carl
parents:
diff changeset
7109 export_dynamic_flag_spec="\${wl}--export-dynamic"
128cae6f3459 initial coding
carl
parents:
diff changeset
7110
128cae6f3459 initial coding
carl
parents:
diff changeset
7111 # Compiler flag to generate shared objects directly from archives.
128cae6f3459 initial coding
carl
parents:
diff changeset
7112 whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
128cae6f3459 initial coding
carl
parents:
diff changeset
7113
128cae6f3459 initial coding
carl
parents:
diff changeset
7114 # Compiler flag to generate thread-safe objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
7115 thread_safe_flag_spec=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7116
128cae6f3459 initial coding
carl
parents:
diff changeset
7117 # Library versioning type.
128cae6f3459 initial coding
carl
parents:
diff changeset
7118 version_type=linux
128cae6f3459 initial coding
carl
parents:
diff changeset
7119
128cae6f3459 initial coding
carl
parents:
diff changeset
7120 # Format of library name prefix.
128cae6f3459 initial coding
carl
parents:
diff changeset
7121 libname_spec="lib\$name"
128cae6f3459 initial coding
carl
parents:
diff changeset
7122
128cae6f3459 initial coding
carl
parents:
diff changeset
7123 # List of archive names. First name is the real one, the rest are links.
128cae6f3459 initial coding
carl
parents:
diff changeset
7124 # The last name is the one that the linker finds with -lNAME.
128cae6f3459 initial coding
carl
parents:
diff changeset
7125 library_names_spec="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}"
128cae6f3459 initial coding
carl
parents:
diff changeset
7126
128cae6f3459 initial coding
carl
parents:
diff changeset
7127 # The coded name of the library, if different from the real name.
128cae6f3459 initial coding
carl
parents:
diff changeset
7128 soname_spec="\${libname}\${release}\${shared_ext}\$major"
128cae6f3459 initial coding
carl
parents:
diff changeset
7129
128cae6f3459 initial coding
carl
parents:
diff changeset
7130 # Commands used to build and install an old-style archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
7131 RANLIB="ranlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
7132 old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
7133 old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
128cae6f3459 initial coding
carl
parents:
diff changeset
7134 old_postuninstall_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7135
128cae6f3459 initial coding
carl
parents:
diff changeset
7136 # Create an old-style archive from a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
7137 old_archive_from_new_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7138
128cae6f3459 initial coding
carl
parents:
diff changeset
7139 # Create a temporary old-style archive to link instead of a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
7140 old_archive_from_expsyms_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7141
128cae6f3459 initial coding
carl
parents:
diff changeset
7142 # Commands used to build and install a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
7143 archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
128cae6f3459 initial coding
carl
parents:
diff changeset
7144 archive_expsym_cmds="\$echo \\\"{ global:\\\" > \$output_objdir/\$libname.ver~
128cae6f3459 initial coding
carl
parents:
diff changeset
7145 cat \$export_symbols | sed -e \\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$output_objdir/\$libname.ver~
128cae6f3459 initial coding
carl
parents:
diff changeset
7146 \$echo \\\"local: *; };\\\" >> \$output_objdir/\$libname.ver~
128cae6f3459 initial coding
carl
parents:
diff changeset
7147 \$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib"
128cae6f3459 initial coding
carl
parents:
diff changeset
7148 postinstall_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7149 postuninstall_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7150
128cae6f3459 initial coding
carl
parents:
diff changeset
7151 # Commands used to build a loadable module (assumed same as above if empty)
128cae6f3459 initial coding
carl
parents:
diff changeset
7152 module_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7153 module_expsym_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7154
128cae6f3459 initial coding
carl
parents:
diff changeset
7155 # Commands to strip libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
7156 old_striplib="strip --strip-debug"
128cae6f3459 initial coding
carl
parents:
diff changeset
7157 striplib="strip --strip-unneeded"
128cae6f3459 initial coding
carl
parents:
diff changeset
7158
128cae6f3459 initial coding
carl
parents:
diff changeset
7159 # Dependencies to place before the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
7160 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
7161 predep_objects=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7162
128cae6f3459 initial coding
carl
parents:
diff changeset
7163 # Dependencies to place after the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
7164 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
7165 postdep_objects=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7166
128cae6f3459 initial coding
carl
parents:
diff changeset
7167 # Dependencies to place before the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
7168 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
7169 predeps=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7170
128cae6f3459 initial coding
carl
parents:
diff changeset
7171 # Dependencies to place after the objects being linked to create a
128cae6f3459 initial coding
carl
parents:
diff changeset
7172 # shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
7173 postdeps=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7174
128cae6f3459 initial coding
carl
parents:
diff changeset
7175 # The library search path used internally by the compiler when linking
128cae6f3459 initial coding
carl
parents:
diff changeset
7176 # a shared library.
128cae6f3459 initial coding
carl
parents:
diff changeset
7177 compiler_lib_search_path=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7178
128cae6f3459 initial coding
carl
parents:
diff changeset
7179 # Method to check whether dependent libraries are shared objects.
128cae6f3459 initial coding
carl
parents:
diff changeset
7180 deplibs_check_method="pass_all"
128cae6f3459 initial coding
carl
parents:
diff changeset
7181
128cae6f3459 initial coding
carl
parents:
diff changeset
7182 # Command to use when deplibs_check_method == file_magic.
128cae6f3459 initial coding
carl
parents:
diff changeset
7183 file_magic_cmd="\$MAGIC_CMD"
128cae6f3459 initial coding
carl
parents:
diff changeset
7184
128cae6f3459 initial coding
carl
parents:
diff changeset
7185 # Flag that allows shared libraries with undefined symbols to be built.
128cae6f3459 initial coding
carl
parents:
diff changeset
7186 allow_undefined_flag=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7187
128cae6f3459 initial coding
carl
parents:
diff changeset
7188 # Flag that forces no undefined symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
7189 no_undefined_flag=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7190
128cae6f3459 initial coding
carl
parents:
diff changeset
7191 # Commands used to finish a libtool library installation in a directory.
128cae6f3459 initial coding
carl
parents:
diff changeset
7192 finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
7193
128cae6f3459 initial coding
carl
parents:
diff changeset
7194 # Same as above, but a single script fragment to be evaled but not shown.
128cae6f3459 initial coding
carl
parents:
diff changeset
7195 finish_eval=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7196
128cae6f3459 initial coding
carl
parents:
diff changeset
7197 # Take the output of nm and produce a listing of raw symbols and C names.
128cae6f3459 initial coding
carl
parents:
diff changeset
7198 global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
128cae6f3459 initial coding
carl
parents:
diff changeset
7199
128cae6f3459 initial coding
carl
parents:
diff changeset
7200 # Transform the output of nm in a proper C declaration
128cae6f3459 initial coding
carl
parents:
diff changeset
7201 global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern int \\1;/p'"
128cae6f3459 initial coding
carl
parents:
diff changeset
7202
128cae6f3459 initial coding
carl
parents:
diff changeset
7203 # Transform the output of nm in a C name address pair
128cae6f3459 initial coding
carl
parents:
diff changeset
7204 global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (lt_ptr) 0},/p' -e 's/^[BCDEGRST] \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (lt_ptr) \\&\\2},/p'"
128cae6f3459 initial coding
carl
parents:
diff changeset
7205
128cae6f3459 initial coding
carl
parents:
diff changeset
7206 # This is the shared library runtime path variable.
128cae6f3459 initial coding
carl
parents:
diff changeset
7207 runpath_var=LD_RUN_PATH
128cae6f3459 initial coding
carl
parents:
diff changeset
7208
128cae6f3459 initial coding
carl
parents:
diff changeset
7209 # This is the shared library path variable.
128cae6f3459 initial coding
carl
parents:
diff changeset
7210 shlibpath_var=LD_LIBRARY_PATH
128cae6f3459 initial coding
carl
parents:
diff changeset
7211
128cae6f3459 initial coding
carl
parents:
diff changeset
7212 # Is shlibpath searched before the hard-coded library search path?
128cae6f3459 initial coding
carl
parents:
diff changeset
7213 shlibpath_overrides_runpath=no
128cae6f3459 initial coding
carl
parents:
diff changeset
7214
128cae6f3459 initial coding
carl
parents:
diff changeset
7215 # How to hardcode a shared library path into an executable.
128cae6f3459 initial coding
carl
parents:
diff changeset
7216 hardcode_action=immediate
128cae6f3459 initial coding
carl
parents:
diff changeset
7217
128cae6f3459 initial coding
carl
parents:
diff changeset
7218 # Whether we should hardcode library paths into libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
7219 hardcode_into_libs=yes
128cae6f3459 initial coding
carl
parents:
diff changeset
7220
128cae6f3459 initial coding
carl
parents:
diff changeset
7221 # Flag to hardcode $libdir into a binary during linking.
128cae6f3459 initial coding
carl
parents:
diff changeset
7222 # This must work even if $libdir does not exist.
128cae6f3459 initial coding
carl
parents:
diff changeset
7223 hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
128cae6f3459 initial coding
carl
parents:
diff changeset
7224
128cae6f3459 initial coding
carl
parents:
diff changeset
7225 # If ld is used when linking, flag to hardcode $libdir into
128cae6f3459 initial coding
carl
parents:
diff changeset
7226 # a binary during linking. This must work even if $libdir does
128cae6f3459 initial coding
carl
parents:
diff changeset
7227 # not exist.
128cae6f3459 initial coding
carl
parents:
diff changeset
7228 hardcode_libdir_flag_spec_ld=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7229
128cae6f3459 initial coding
carl
parents:
diff changeset
7230 # Whether we need a single -rpath flag with a separated argument.
128cae6f3459 initial coding
carl
parents:
diff changeset
7231 hardcode_libdir_separator=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7232
128cae6f3459 initial coding
carl
parents:
diff changeset
7233 # Set to yes if using DIR/libNAME during linking hardcodes DIR into the
128cae6f3459 initial coding
carl
parents:
diff changeset
7234 # resulting binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
7235 hardcode_direct=no
128cae6f3459 initial coding
carl
parents:
diff changeset
7236
128cae6f3459 initial coding
carl
parents:
diff changeset
7237 # Set to yes if using the -LDIR flag during linking hardcodes DIR into the
128cae6f3459 initial coding
carl
parents:
diff changeset
7238 # resulting binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
7239 hardcode_minus_L=no
128cae6f3459 initial coding
carl
parents:
diff changeset
7240
128cae6f3459 initial coding
carl
parents:
diff changeset
7241 # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
128cae6f3459 initial coding
carl
parents:
diff changeset
7242 # the resulting binary.
128cae6f3459 initial coding
carl
parents:
diff changeset
7243 hardcode_shlibpath_var=unsupported
128cae6f3459 initial coding
carl
parents:
diff changeset
7244
128cae6f3459 initial coding
carl
parents:
diff changeset
7245 # Set to yes if building a shared library automatically hardcodes DIR into the library
128cae6f3459 initial coding
carl
parents:
diff changeset
7246 # and all subsequent libraries and executables linked against it.
128cae6f3459 initial coding
carl
parents:
diff changeset
7247 hardcode_automatic=no
128cae6f3459 initial coding
carl
parents:
diff changeset
7248
128cae6f3459 initial coding
carl
parents:
diff changeset
7249 # Variables whose values should be saved in libtool wrapper scripts and
128cae6f3459 initial coding
carl
parents:
diff changeset
7250 # restored at relink time.
128cae6f3459 initial coding
carl
parents:
diff changeset
7251 variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
128cae6f3459 initial coding
carl
parents:
diff changeset
7252
128cae6f3459 initial coding
carl
parents:
diff changeset
7253 # Whether libtool must link a program against all its dependency libraries.
128cae6f3459 initial coding
carl
parents:
diff changeset
7254 link_all_deplibs=unknown
128cae6f3459 initial coding
carl
parents:
diff changeset
7255
128cae6f3459 initial coding
carl
parents:
diff changeset
7256 # Compile-time system search path for libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
7257 sys_lib_search_path_spec=" /usr/lib/gcc/i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../i386-redhat-linux/lib/i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../i386-redhat-linux/lib/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../i386-redhat-linux/3.4.4/ /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../ /lib/i386-redhat-linux/3.4.4/ /lib/ /usr/lib/i386-redhat-linux/3.4.4/ /usr/lib/"
128cae6f3459 initial coding
carl
parents:
diff changeset
7258
128cae6f3459 initial coding
carl
parents:
diff changeset
7259 # Run-time system search path for libraries
128cae6f3459 initial coding
carl
parents:
diff changeset
7260 sys_lib_dlsearch_path_spec="/lib /usr/lib include ld.so.conf.d/*.conf /usr/lib/wine "
128cae6f3459 initial coding
carl
parents:
diff changeset
7261
128cae6f3459 initial coding
carl
parents:
diff changeset
7262 # Fix the shell variable $srcfile for the compiler.
128cae6f3459 initial coding
carl
parents:
diff changeset
7263 fix_srcfile_path=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7264
128cae6f3459 initial coding
carl
parents:
diff changeset
7265 # Set to yes if exported symbols are required.
128cae6f3459 initial coding
carl
parents:
diff changeset
7266 always_export_symbols=no
128cae6f3459 initial coding
carl
parents:
diff changeset
7267
128cae6f3459 initial coding
carl
parents:
diff changeset
7268 # The commands to list exported symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
7269 export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols"
128cae6f3459 initial coding
carl
parents:
diff changeset
7270
128cae6f3459 initial coding
carl
parents:
diff changeset
7271 # The commands to extract the exported symbol list from a shared archive.
128cae6f3459 initial coding
carl
parents:
diff changeset
7272 extract_expsyms_cmds=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7273
128cae6f3459 initial coding
carl
parents:
diff changeset
7274 # Symbols that should not be listed in the preloaded symbols.
128cae6f3459 initial coding
carl
parents:
diff changeset
7275 exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
128cae6f3459 initial coding
carl
parents:
diff changeset
7276
128cae6f3459 initial coding
carl
parents:
diff changeset
7277 # Symbols that must always be exported.
128cae6f3459 initial coding
carl
parents:
diff changeset
7278 include_expsyms=""
128cae6f3459 initial coding
carl
parents:
diff changeset
7279
128cae6f3459 initial coding
carl
parents:
diff changeset
7280 # ### END LIBTOOL TAG CONFIG: F77
128cae6f3459 initial coding
carl
parents:
diff changeset
7281