annotate ltmain.sh @ 9:48880e61ce5e

better autoconf, changes for solaris portability
author carl
date Wed, 03 Jan 2007 22:28:27 -0800
parents 45c8592d5d13
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
45c8592d5d13 initial version
carl
parents:
diff changeset
1 # ltmain.sh - Provide generalized library-building support services.
45c8592d5d13 initial version
carl
parents:
diff changeset
2 # NOTE: Changing this file will not affect anything until you rerun configure.
45c8592d5d13 initial version
carl
parents:
diff changeset
3 #
45c8592d5d13 initial version
carl
parents:
diff changeset
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
45c8592d5d13 initial version
carl
parents:
diff changeset
5 # Free Software Foundation, Inc.
45c8592d5d13 initial version
carl
parents:
diff changeset
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
45c8592d5d13 initial version
carl
parents:
diff changeset
7 #
45c8592d5d13 initial version
carl
parents:
diff changeset
8 # This program is free software; you can redistribute it and/or modify
45c8592d5d13 initial version
carl
parents:
diff changeset
9 # it under the terms of the GNU General Public License as published by
45c8592d5d13 initial version
carl
parents:
diff changeset
10 # the Free Software Foundation; either version 2 of the License, or
45c8592d5d13 initial version
carl
parents:
diff changeset
11 # (at your option) any later version.
45c8592d5d13 initial version
carl
parents:
diff changeset
12 #
45c8592d5d13 initial version
carl
parents:
diff changeset
13 # This program is distributed in the hope that it will be useful, but
45c8592d5d13 initial version
carl
parents:
diff changeset
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
45c8592d5d13 initial version
carl
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
45c8592d5d13 initial version
carl
parents:
diff changeset
16 # General Public License for more details.
45c8592d5d13 initial version
carl
parents:
diff changeset
17 #
45c8592d5d13 initial version
carl
parents:
diff changeset
18 # You should have received a copy of the GNU General Public License
45c8592d5d13 initial version
carl
parents:
diff changeset
19 # along with this program; if not, write to the Free Software
45c8592d5d13 initial version
carl
parents:
diff changeset
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
45c8592d5d13 initial version
carl
parents:
diff changeset
21 #
45c8592d5d13 initial version
carl
parents:
diff changeset
22 # As a special exception to the GNU General Public License, if you
45c8592d5d13 initial version
carl
parents:
diff changeset
23 # distribute this file as part of a program that contains a
45c8592d5d13 initial version
carl
parents:
diff changeset
24 # configuration script generated by Autoconf, you may include it under
45c8592d5d13 initial version
carl
parents:
diff changeset
25 # the same distribution terms that you use for the rest of that program.
45c8592d5d13 initial version
carl
parents:
diff changeset
26
45c8592d5d13 initial version
carl
parents:
diff changeset
27 basename="s,^.*/,,g"
45c8592d5d13 initial version
carl
parents:
diff changeset
28
45c8592d5d13 initial version
carl
parents:
diff changeset
29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
45c8592d5d13 initial version
carl
parents:
diff changeset
30 # is ksh but when the shell is invoked as "sh" and the current value of
45c8592d5d13 initial version
carl
parents:
diff changeset
31 # the _XPG environment variable is not equal to 1 (one), the special
45c8592d5d13 initial version
carl
parents:
diff changeset
32 # positional parameter $0, within a function call, is the name of the
45c8592d5d13 initial version
carl
parents:
diff changeset
33 # function.
45c8592d5d13 initial version
carl
parents:
diff changeset
34 progpath="$0"
45c8592d5d13 initial version
carl
parents:
diff changeset
35
45c8592d5d13 initial version
carl
parents:
diff changeset
36 # RH: define SED for historic ltconfig's generated by Libtool 1.3
45c8592d5d13 initial version
carl
parents:
diff changeset
37 [ -z "$SED" ] && SED=sed
45c8592d5d13 initial version
carl
parents:
diff changeset
38
45c8592d5d13 initial version
carl
parents:
diff changeset
39 # The name of this program:
45c8592d5d13 initial version
carl
parents:
diff changeset
40 progname=`echo "$progpath" | $SED $basename`
45c8592d5d13 initial version
carl
parents:
diff changeset
41 modename="$progname"
45c8592d5d13 initial version
carl
parents:
diff changeset
42
45c8592d5d13 initial version
carl
parents:
diff changeset
43 # Global variables:
45c8592d5d13 initial version
carl
parents:
diff changeset
44 EXIT_SUCCESS=0
45c8592d5d13 initial version
carl
parents:
diff changeset
45 EXIT_FAILURE=1
45c8592d5d13 initial version
carl
parents:
diff changeset
46
45c8592d5d13 initial version
carl
parents:
diff changeset
47 PROGRAM=ltmain.sh
45c8592d5d13 initial version
carl
parents:
diff changeset
48 PACKAGE=libtool
45c8592d5d13 initial version
carl
parents:
diff changeset
49 VERSION=1.5.6
45c8592d5d13 initial version
carl
parents:
diff changeset
50 TIMESTAMP=" (1.1220.2.95 2004/04/11 05:50:42)"
45c8592d5d13 initial version
carl
parents:
diff changeset
51
45c8592d5d13 initial version
carl
parents:
diff changeset
52
45c8592d5d13 initial version
carl
parents:
diff changeset
53 # Check that we have a working $echo.
45c8592d5d13 initial version
carl
parents:
diff changeset
54 if test "X$1" = X--no-reexec; then
45c8592d5d13 initial version
carl
parents:
diff changeset
55 # Discard the --no-reexec flag, and continue.
45c8592d5d13 initial version
carl
parents:
diff changeset
56 shift
45c8592d5d13 initial version
carl
parents:
diff changeset
57 elif test "X$1" = X--fallback-echo; then
45c8592d5d13 initial version
carl
parents:
diff changeset
58 # Avoid inline document here, it may be left over
45c8592d5d13 initial version
carl
parents:
diff changeset
59 :
45c8592d5d13 initial version
carl
parents:
diff changeset
60 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
45c8592d5d13 initial version
carl
parents:
diff changeset
61 # Yippee, $echo works!
45c8592d5d13 initial version
carl
parents:
diff changeset
62 :
45c8592d5d13 initial version
carl
parents:
diff changeset
63 else
45c8592d5d13 initial version
carl
parents:
diff changeset
64 # Restart under the correct shell, and then maybe $echo will work.
45c8592d5d13 initial version
carl
parents:
diff changeset
65 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
45c8592d5d13 initial version
carl
parents:
diff changeset
66 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
67
45c8592d5d13 initial version
carl
parents:
diff changeset
68 if test "X$1" = X--fallback-echo; then
45c8592d5d13 initial version
carl
parents:
diff changeset
69 # used as fallback echo
45c8592d5d13 initial version
carl
parents:
diff changeset
70 shift
45c8592d5d13 initial version
carl
parents:
diff changeset
71 cat <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
72 $*
45c8592d5d13 initial version
carl
parents:
diff changeset
73 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
74 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
75 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
76
45c8592d5d13 initial version
carl
parents:
diff changeset
77 default_mode=
45c8592d5d13 initial version
carl
parents:
diff changeset
78 help="Try \`$progname --help' for more information."
45c8592d5d13 initial version
carl
parents:
diff changeset
79 magic="%%%MAGIC variable%%%"
45c8592d5d13 initial version
carl
parents:
diff changeset
80 mkdir="mkdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
81 mv="mv -f"
45c8592d5d13 initial version
carl
parents:
diff changeset
82 rm="rm -f"
45c8592d5d13 initial version
carl
parents:
diff changeset
83
45c8592d5d13 initial version
carl
parents:
diff changeset
84 # Sed substitution that helps us do robust quoting. It backslashifies
45c8592d5d13 initial version
carl
parents:
diff changeset
85 # metacharacters that are still active within double-quoted strings.
45c8592d5d13 initial version
carl
parents:
diff changeset
86 Xsed="${SED}"' -e 1s/^X//'
45c8592d5d13 initial version
carl
parents:
diff changeset
87 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
45c8592d5d13 initial version
carl
parents:
diff changeset
88 # test EBCDIC or ASCII
45c8592d5d13 initial version
carl
parents:
diff changeset
89 case `echo A|tr A '\301'` in
45c8592d5d13 initial version
carl
parents:
diff changeset
90 A) # EBCDIC based system
45c8592d5d13 initial version
carl
parents:
diff changeset
91 SP2NL="tr '\100' '\n'"
45c8592d5d13 initial version
carl
parents:
diff changeset
92 NL2SP="tr '\r\n' '\100\100'"
45c8592d5d13 initial version
carl
parents:
diff changeset
93 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
94 *) # Assume ASCII based system
45c8592d5d13 initial version
carl
parents:
diff changeset
95 SP2NL="tr '\040' '\012'"
45c8592d5d13 initial version
carl
parents:
diff changeset
96 NL2SP="tr '\015\012' '\040\040'"
45c8592d5d13 initial version
carl
parents:
diff changeset
97 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
98 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
99
45c8592d5d13 initial version
carl
parents:
diff changeset
100 # NLS nuisances.
45c8592d5d13 initial version
carl
parents:
diff changeset
101 # Only set LANG and LC_ALL to C if already set.
45c8592d5d13 initial version
carl
parents:
diff changeset
102 # These must not be set unconditionally because not all systems understand
45c8592d5d13 initial version
carl
parents:
diff changeset
103 # e.g. LANG=C (notably SCO).
45c8592d5d13 initial version
carl
parents:
diff changeset
104 # We save the old values to restore during execute mode.
45c8592d5d13 initial version
carl
parents:
diff changeset
105 if test "${LC_ALL+set}" = set; then
45c8592d5d13 initial version
carl
parents:
diff changeset
106 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
45c8592d5d13 initial version
carl
parents:
diff changeset
107 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
108 if test "${LANG+set}" = set; then
45c8592d5d13 initial version
carl
parents:
diff changeset
109 save_LANG="$LANG"; LANG=C; export LANG
45c8592d5d13 initial version
carl
parents:
diff changeset
110 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
111
45c8592d5d13 initial version
carl
parents:
diff changeset
112 # Make sure IFS has a sensible default
45c8592d5d13 initial version
carl
parents:
diff changeset
113 : ${IFS="
45c8592d5d13 initial version
carl
parents:
diff changeset
114 "}
45c8592d5d13 initial version
carl
parents:
diff changeset
115
45c8592d5d13 initial version
carl
parents:
diff changeset
116 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
117 $echo "$modename: not configured to build any kind of library" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
118 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
119 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
120 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
121
45c8592d5d13 initial version
carl
parents:
diff changeset
122 # Global variables.
45c8592d5d13 initial version
carl
parents:
diff changeset
123 mode=$default_mode
45c8592d5d13 initial version
carl
parents:
diff changeset
124 nonopt=
45c8592d5d13 initial version
carl
parents:
diff changeset
125 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
126 prevopt=
45c8592d5d13 initial version
carl
parents:
diff changeset
127 run=
45c8592d5d13 initial version
carl
parents:
diff changeset
128 show="$echo"
45c8592d5d13 initial version
carl
parents:
diff changeset
129 show_help=
45c8592d5d13 initial version
carl
parents:
diff changeset
130 execute_dlfiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
131 lo2o="s/\\.lo\$/.${objext}/"
45c8592d5d13 initial version
carl
parents:
diff changeset
132 o2lo="s/\\.${objext}\$/.lo/"
45c8592d5d13 initial version
carl
parents:
diff changeset
133
45c8592d5d13 initial version
carl
parents:
diff changeset
134 #####################################
45c8592d5d13 initial version
carl
parents:
diff changeset
135 # Shell function definitions:
45c8592d5d13 initial version
carl
parents:
diff changeset
136 # This seems to be the best place for them
45c8592d5d13 initial version
carl
parents:
diff changeset
137
45c8592d5d13 initial version
carl
parents:
diff changeset
138 # func_win32_libid arg
45c8592d5d13 initial version
carl
parents:
diff changeset
139 # return the library type of file 'arg'
45c8592d5d13 initial version
carl
parents:
diff changeset
140 #
45c8592d5d13 initial version
carl
parents:
diff changeset
141 # Need a lot of goo to handle *both* DLLs and import libs
45c8592d5d13 initial version
carl
parents:
diff changeset
142 # Has to be a shell function in order to 'eat' the argument
45c8592d5d13 initial version
carl
parents:
diff changeset
143 # that is supplied when $file_magic_command is called.
45c8592d5d13 initial version
carl
parents:
diff changeset
144 func_win32_libid () {
45c8592d5d13 initial version
carl
parents:
diff changeset
145 win32_libid_type="unknown"
45c8592d5d13 initial version
carl
parents:
diff changeset
146 win32_fileres=`file -L $1 2>/dev/null`
45c8592d5d13 initial version
carl
parents:
diff changeset
147 case $win32_fileres in
45c8592d5d13 initial version
carl
parents:
diff changeset
148 *ar\ archive\ import\ library*) # definitely import
45c8592d5d13 initial version
carl
parents:
diff changeset
149 win32_libid_type="x86 archive import"
45c8592d5d13 initial version
carl
parents:
diff changeset
150 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
151 *ar\ archive*) # could be an import, or static
45c8592d5d13 initial version
carl
parents:
diff changeset
152 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
45c8592d5d13 initial version
carl
parents:
diff changeset
153 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
154 win32_nmres=`eval $NM -f posix -A $1 | \
45c8592d5d13 initial version
carl
parents:
diff changeset
155 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
45c8592d5d13 initial version
carl
parents:
diff changeset
156 if test "X$win32_nmres" = "Ximport" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
157 win32_libid_type="x86 archive import"
45c8592d5d13 initial version
carl
parents:
diff changeset
158 else
45c8592d5d13 initial version
carl
parents:
diff changeset
159 win32_libid_type="x86 archive static"
45c8592d5d13 initial version
carl
parents:
diff changeset
160 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
161 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
162 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
163 *DLL*)
45c8592d5d13 initial version
carl
parents:
diff changeset
164 win32_libid_type="x86 DLL"
45c8592d5d13 initial version
carl
parents:
diff changeset
165 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
166 *executable*) # but shell scripts are "executable" too...
45c8592d5d13 initial version
carl
parents:
diff changeset
167 case $win32_fileres in
45c8592d5d13 initial version
carl
parents:
diff changeset
168 *MS\ Windows\ PE\ Intel*)
45c8592d5d13 initial version
carl
parents:
diff changeset
169 win32_libid_type="x86 DLL"
45c8592d5d13 initial version
carl
parents:
diff changeset
170 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
171 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
172 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
173 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
174 $echo $win32_libid_type
45c8592d5d13 initial version
carl
parents:
diff changeset
175 }
45c8592d5d13 initial version
carl
parents:
diff changeset
176
45c8592d5d13 initial version
carl
parents:
diff changeset
177
45c8592d5d13 initial version
carl
parents:
diff changeset
178 # func_infer_tag arg
45c8592d5d13 initial version
carl
parents:
diff changeset
179 # Infer tagged configuration to use if any are available and
45c8592d5d13 initial version
carl
parents:
diff changeset
180 # if one wasn't chosen via the "--tag" command line option.
45c8592d5d13 initial version
carl
parents:
diff changeset
181 # Only attempt this if the compiler in the base compile
45c8592d5d13 initial version
carl
parents:
diff changeset
182 # command doesn't match the default compiler.
45c8592d5d13 initial version
carl
parents:
diff changeset
183 # arg is usually of the form 'gcc ...'
45c8592d5d13 initial version
carl
parents:
diff changeset
184 func_infer_tag () {
45c8592d5d13 initial version
carl
parents:
diff changeset
185 if test -n "$available_tags" && test -z "$tagname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
186 CC_quoted=
45c8592d5d13 initial version
carl
parents:
diff changeset
187 for arg in $CC; do
45c8592d5d13 initial version
carl
parents:
diff changeset
188 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
189 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
190 arg="\"$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
191 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
192 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
193 CC_quoted="$CC_quoted $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
194 done
45c8592d5d13 initial version
carl
parents:
diff changeset
195 case $@ in
45c8592d5d13 initial version
carl
parents:
diff changeset
196 # Blanks in the command may have been stripped by the calling shell,
45c8592d5d13 initial version
carl
parents:
diff changeset
197 # but not from the CC environment variable when configure was run.
45c8592d5d13 initial version
carl
parents:
diff changeset
198 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
199 # Blanks at the start of $base_compile will cause this to fail
45c8592d5d13 initial version
carl
parents:
diff changeset
200 # if we don't check for them as well.
45c8592d5d13 initial version
carl
parents:
diff changeset
201 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
202 for z in $available_tags; do
45c8592d5d13 initial version
carl
parents:
diff changeset
203 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
45c8592d5d13 initial version
carl
parents:
diff changeset
204 # Evaluate the configuration.
45c8592d5d13 initial version
carl
parents:
diff changeset
205 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
45c8592d5d13 initial version
carl
parents:
diff changeset
206 CC_quoted=
45c8592d5d13 initial version
carl
parents:
diff changeset
207 for arg in $CC; do
45c8592d5d13 initial version
carl
parents:
diff changeset
208 # Double-quote args containing other shell metacharacters.
45c8592d5d13 initial version
carl
parents:
diff changeset
209 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
210 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
211 arg="\"$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
212 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
213 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
214 CC_quoted="$CC_quoted $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
215 done
45c8592d5d13 initial version
carl
parents:
diff changeset
216 case "$@ " in
45c8592d5d13 initial version
carl
parents:
diff changeset
217 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
45c8592d5d13 initial version
carl
parents:
diff changeset
218 # The compiler in the base compile command matches
45c8592d5d13 initial version
carl
parents:
diff changeset
219 # the one in the tagged configuration.
45c8592d5d13 initial version
carl
parents:
diff changeset
220 # Assume this is the tagged configuration we want.
45c8592d5d13 initial version
carl
parents:
diff changeset
221 tagname=$z
45c8592d5d13 initial version
carl
parents:
diff changeset
222 break
45c8592d5d13 initial version
carl
parents:
diff changeset
223 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
224 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
225 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
226 done
45c8592d5d13 initial version
carl
parents:
diff changeset
227 # If $tagname still isn't set, then no tagged configuration
45c8592d5d13 initial version
carl
parents:
diff changeset
228 # was found and let the user know that the "--tag" command
45c8592d5d13 initial version
carl
parents:
diff changeset
229 # line option must be used.
45c8592d5d13 initial version
carl
parents:
diff changeset
230 if test -z "$tagname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
231 $echo "$modename: unable to infer tagged configuration"
45c8592d5d13 initial version
carl
parents:
diff changeset
232 $echo "$modename: specify a tag with \`--tag'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
233 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
234 # else
45c8592d5d13 initial version
carl
parents:
diff changeset
235 # $echo "$modename: using $tagname tagged configuration"
45c8592d5d13 initial version
carl
parents:
diff changeset
236 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
237 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
238 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
239 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
240 }
45c8592d5d13 initial version
carl
parents:
diff changeset
241 # End of Shell function definitions
45c8592d5d13 initial version
carl
parents:
diff changeset
242 #####################################
45c8592d5d13 initial version
carl
parents:
diff changeset
243
45c8592d5d13 initial version
carl
parents:
diff changeset
244 # Darwin sucks
45c8592d5d13 initial version
carl
parents:
diff changeset
245 eval std_shrext=\"$shrext_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
246
45c8592d5d13 initial version
carl
parents:
diff changeset
247 # Parse our command line options once, thoroughly.
45c8592d5d13 initial version
carl
parents:
diff changeset
248 while test "$#" -gt 0
45c8592d5d13 initial version
carl
parents:
diff changeset
249 do
45c8592d5d13 initial version
carl
parents:
diff changeset
250 arg="$1"
45c8592d5d13 initial version
carl
parents:
diff changeset
251 shift
45c8592d5d13 initial version
carl
parents:
diff changeset
252
45c8592d5d13 initial version
carl
parents:
diff changeset
253 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
254 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
255 *) optarg= ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
256 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
257
45c8592d5d13 initial version
carl
parents:
diff changeset
258 # If the previous option needs an argument, assign it.
45c8592d5d13 initial version
carl
parents:
diff changeset
259 if test -n "$prev"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
260 case $prev in
45c8592d5d13 initial version
carl
parents:
diff changeset
261 execute_dlfiles)
45c8592d5d13 initial version
carl
parents:
diff changeset
262 execute_dlfiles="$execute_dlfiles $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
263 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
264 tag)
45c8592d5d13 initial version
carl
parents:
diff changeset
265 tagname="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
266 preserve_args="${preserve_args}=$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
267
45c8592d5d13 initial version
carl
parents:
diff changeset
268 # Check whether tagname contains only valid characters
45c8592d5d13 initial version
carl
parents:
diff changeset
269 case $tagname in
45c8592d5d13 initial version
carl
parents:
diff changeset
270 *[!-_A-Za-z0-9,/]*)
45c8592d5d13 initial version
carl
parents:
diff changeset
271 $echo "$progname: invalid tag name: $tagname" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
272 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
273 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
274 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
275
45c8592d5d13 initial version
carl
parents:
diff changeset
276 case $tagname in
45c8592d5d13 initial version
carl
parents:
diff changeset
277 CC)
45c8592d5d13 initial version
carl
parents:
diff changeset
278 # Don't test for the "default" C tag, as we know, it's there, but
45c8592d5d13 initial version
carl
parents:
diff changeset
279 # not specially marked.
45c8592d5d13 initial version
carl
parents:
diff changeset
280 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
281 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
282 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
45c8592d5d13 initial version
carl
parents:
diff changeset
283 taglist="$taglist $tagname"
45c8592d5d13 initial version
carl
parents:
diff changeset
284 # Evaluate the configuration.
45c8592d5d13 initial version
carl
parents:
diff changeset
285 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
45c8592d5d13 initial version
carl
parents:
diff changeset
286 else
45c8592d5d13 initial version
carl
parents:
diff changeset
287 $echo "$progname: ignoring unknown tag $tagname" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
288 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
289 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
290 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
291 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
292 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
293 eval "$prev=\$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
294 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
295 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
296
45c8592d5d13 initial version
carl
parents:
diff changeset
297 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
298 prevopt=
45c8592d5d13 initial version
carl
parents:
diff changeset
299 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
300 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
301
45c8592d5d13 initial version
carl
parents:
diff changeset
302 # Have we seen a non-optional argument yet?
45c8592d5d13 initial version
carl
parents:
diff changeset
303 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
304 --help)
45c8592d5d13 initial version
carl
parents:
diff changeset
305 show_help=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
306 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
307
45c8592d5d13 initial version
carl
parents:
diff changeset
308 --version)
45c8592d5d13 initial version
carl
parents:
diff changeset
309 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
45c8592d5d13 initial version
carl
parents:
diff changeset
310 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
311 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
45c8592d5d13 initial version
carl
parents:
diff changeset
312 $echo "This is free software; see the source for copying conditions. There is NO"
45c8592d5d13 initial version
carl
parents:
diff changeset
313 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
45c8592d5d13 initial version
carl
parents:
diff changeset
314 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
315 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
316
45c8592d5d13 initial version
carl
parents:
diff changeset
317 --config)
45c8592d5d13 initial version
carl
parents:
diff changeset
318 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
45c8592d5d13 initial version
carl
parents:
diff changeset
319 # Now print the configurations for the tags.
45c8592d5d13 initial version
carl
parents:
diff changeset
320 for tagname in $taglist; do
45c8592d5d13 initial version
carl
parents:
diff changeset
321 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
322 done
45c8592d5d13 initial version
carl
parents:
diff changeset
323 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
324 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
325
45c8592d5d13 initial version
carl
parents:
diff changeset
326 --debug)
45c8592d5d13 initial version
carl
parents:
diff changeset
327 $echo "$progname: enabling shell trace mode"
45c8592d5d13 initial version
carl
parents:
diff changeset
328 set -x
45c8592d5d13 initial version
carl
parents:
diff changeset
329 preserve_args="$preserve_args $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
330 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
331
45c8592d5d13 initial version
carl
parents:
diff changeset
332 --dry-run | -n)
45c8592d5d13 initial version
carl
parents:
diff changeset
333 run=:
45c8592d5d13 initial version
carl
parents:
diff changeset
334 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
335
45c8592d5d13 initial version
carl
parents:
diff changeset
336 --features)
45c8592d5d13 initial version
carl
parents:
diff changeset
337 $echo "host: $host"
45c8592d5d13 initial version
carl
parents:
diff changeset
338 if test "$build_libtool_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
339 $echo "enable shared libraries"
45c8592d5d13 initial version
carl
parents:
diff changeset
340 else
45c8592d5d13 initial version
carl
parents:
diff changeset
341 $echo "disable shared libraries"
45c8592d5d13 initial version
carl
parents:
diff changeset
342 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
343 if test "$build_old_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
344 $echo "enable static libraries"
45c8592d5d13 initial version
carl
parents:
diff changeset
345 else
45c8592d5d13 initial version
carl
parents:
diff changeset
346 $echo "disable static libraries"
45c8592d5d13 initial version
carl
parents:
diff changeset
347 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
348 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
349 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
350
45c8592d5d13 initial version
carl
parents:
diff changeset
351 --finish) mode="finish" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
352
45c8592d5d13 initial version
carl
parents:
diff changeset
353 --mode) prevopt="--mode" prev=mode ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
354 --mode=*) mode="$optarg" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
355
45c8592d5d13 initial version
carl
parents:
diff changeset
356 --preserve-dup-deps) duplicate_deps="yes" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
357
45c8592d5d13 initial version
carl
parents:
diff changeset
358 --quiet | --silent)
45c8592d5d13 initial version
carl
parents:
diff changeset
359 show=:
45c8592d5d13 initial version
carl
parents:
diff changeset
360 preserve_args="$preserve_args $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
361 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
362
45c8592d5d13 initial version
carl
parents:
diff changeset
363 --tag) prevopt="--tag" prev=tag ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
364 --tag=*)
45c8592d5d13 initial version
carl
parents:
diff changeset
365 set tag "$optarg" ${1+"$@"}
45c8592d5d13 initial version
carl
parents:
diff changeset
366 shift
45c8592d5d13 initial version
carl
parents:
diff changeset
367 prev=tag
45c8592d5d13 initial version
carl
parents:
diff changeset
368 preserve_args="$preserve_args --tag"
45c8592d5d13 initial version
carl
parents:
diff changeset
369 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
370
45c8592d5d13 initial version
carl
parents:
diff changeset
371 -dlopen)
45c8592d5d13 initial version
carl
parents:
diff changeset
372 prevopt="-dlopen"
45c8592d5d13 initial version
carl
parents:
diff changeset
373 prev=execute_dlfiles
45c8592d5d13 initial version
carl
parents:
diff changeset
374 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
375
45c8592d5d13 initial version
carl
parents:
diff changeset
376 -*)
45c8592d5d13 initial version
carl
parents:
diff changeset
377 $echo "$modename: unrecognized option \`$arg'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
378 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
379 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
380 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
381
45c8592d5d13 initial version
carl
parents:
diff changeset
382 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
383 nonopt="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
384 break
45c8592d5d13 initial version
carl
parents:
diff changeset
385 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
386 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
387 done
45c8592d5d13 initial version
carl
parents:
diff changeset
388
45c8592d5d13 initial version
carl
parents:
diff changeset
389 if test -n "$prevopt"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
390 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
391 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
392 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
393 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
394
45c8592d5d13 initial version
carl
parents:
diff changeset
395 # If this variable is set in any of the actions, the command in it
45c8592d5d13 initial version
carl
parents:
diff changeset
396 # will be execed at the end. This prevents here-documents from being
45c8592d5d13 initial version
carl
parents:
diff changeset
397 # left over by shells.
45c8592d5d13 initial version
carl
parents:
diff changeset
398 exec_cmd=
45c8592d5d13 initial version
carl
parents:
diff changeset
399
45c8592d5d13 initial version
carl
parents:
diff changeset
400 if test -z "$show_help"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
401
45c8592d5d13 initial version
carl
parents:
diff changeset
402 # Infer the operation mode.
45c8592d5d13 initial version
carl
parents:
diff changeset
403 if test -z "$mode"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
404 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
405 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
406 case $nonopt in
45c8592d5d13 initial version
carl
parents:
diff changeset
407 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
45c8592d5d13 initial version
carl
parents:
diff changeset
408 mode=link
45c8592d5d13 initial version
carl
parents:
diff changeset
409 for arg
45c8592d5d13 initial version
carl
parents:
diff changeset
410 do
45c8592d5d13 initial version
carl
parents:
diff changeset
411 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
412 -c)
45c8592d5d13 initial version
carl
parents:
diff changeset
413 mode=compile
45c8592d5d13 initial version
carl
parents:
diff changeset
414 break
45c8592d5d13 initial version
carl
parents:
diff changeset
415 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
416 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
417 done
45c8592d5d13 initial version
carl
parents:
diff changeset
418 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
419 *db | *dbx | *strace | *truss)
45c8592d5d13 initial version
carl
parents:
diff changeset
420 mode=execute
45c8592d5d13 initial version
carl
parents:
diff changeset
421 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
422 *install*|cp|mv)
45c8592d5d13 initial version
carl
parents:
diff changeset
423 mode=install
45c8592d5d13 initial version
carl
parents:
diff changeset
424 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
425 *rm)
45c8592d5d13 initial version
carl
parents:
diff changeset
426 mode=uninstall
45c8592d5d13 initial version
carl
parents:
diff changeset
427 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
428 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
429 # If we have no mode, but dlfiles were specified, then do execute mode.
45c8592d5d13 initial version
carl
parents:
diff changeset
430 test -n "$execute_dlfiles" && mode=execute
45c8592d5d13 initial version
carl
parents:
diff changeset
431
45c8592d5d13 initial version
carl
parents:
diff changeset
432 # Just use the default operation mode.
45c8592d5d13 initial version
carl
parents:
diff changeset
433 if test -z "$mode"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
434 if test -n "$nonopt"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
435 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
436 else
45c8592d5d13 initial version
carl
parents:
diff changeset
437 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
438 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
439 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
440 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
441 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
442 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
443
45c8592d5d13 initial version
carl
parents:
diff changeset
444 # Only execute mode is allowed to have -dlopen flags.
45c8592d5d13 initial version
carl
parents:
diff changeset
445 if test -n "$execute_dlfiles" && test "$mode" != execute; then
45c8592d5d13 initial version
carl
parents:
diff changeset
446 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
447 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
448 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
449 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
450
45c8592d5d13 initial version
carl
parents:
diff changeset
451 # Change the help message to a mode-specific one.
45c8592d5d13 initial version
carl
parents:
diff changeset
452 generic_help="$help"
45c8592d5d13 initial version
carl
parents:
diff changeset
453 help="Try \`$modename --help --mode=$mode' for more information."
45c8592d5d13 initial version
carl
parents:
diff changeset
454
45c8592d5d13 initial version
carl
parents:
diff changeset
455 # These modes are in order of execution frequency so that they run quickly.
45c8592d5d13 initial version
carl
parents:
diff changeset
456 case $mode in
45c8592d5d13 initial version
carl
parents:
diff changeset
457 # libtool compile mode
45c8592d5d13 initial version
carl
parents:
diff changeset
458 compile)
45c8592d5d13 initial version
carl
parents:
diff changeset
459 modename="$modename: compile"
45c8592d5d13 initial version
carl
parents:
diff changeset
460 # Get the compilation command and the source file.
45c8592d5d13 initial version
carl
parents:
diff changeset
461 base_compile=
45c8592d5d13 initial version
carl
parents:
diff changeset
462 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
463 suppress_opt=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
464 suppress_output=
45c8592d5d13 initial version
carl
parents:
diff changeset
465 arg_mode=normal
45c8592d5d13 initial version
carl
parents:
diff changeset
466 libobj=
45c8592d5d13 initial version
carl
parents:
diff changeset
467 later=
45c8592d5d13 initial version
carl
parents:
diff changeset
468
45c8592d5d13 initial version
carl
parents:
diff changeset
469 for arg
45c8592d5d13 initial version
carl
parents:
diff changeset
470 do
45c8592d5d13 initial version
carl
parents:
diff changeset
471 case "$arg_mode" in
45c8592d5d13 initial version
carl
parents:
diff changeset
472 arg )
45c8592d5d13 initial version
carl
parents:
diff changeset
473 # do not "continue". Instead, add this to base_compile
45c8592d5d13 initial version
carl
parents:
diff changeset
474 lastarg="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
475 arg_mode=normal
45c8592d5d13 initial version
carl
parents:
diff changeset
476 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
477
45c8592d5d13 initial version
carl
parents:
diff changeset
478 target )
45c8592d5d13 initial version
carl
parents:
diff changeset
479 libobj="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
480 arg_mode=normal
45c8592d5d13 initial version
carl
parents:
diff changeset
481 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
482 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
483
45c8592d5d13 initial version
carl
parents:
diff changeset
484 normal )
45c8592d5d13 initial version
carl
parents:
diff changeset
485 # Accept any command-line options.
45c8592d5d13 initial version
carl
parents:
diff changeset
486 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
487 -o)
45c8592d5d13 initial version
carl
parents:
diff changeset
488 if test -n "$libobj" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
489 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
490 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
491 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
492 arg_mode=target
45c8592d5d13 initial version
carl
parents:
diff changeset
493 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
494 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
495
45c8592d5d13 initial version
carl
parents:
diff changeset
496 -static | -prefer-pic | -prefer-non-pic)
45c8592d5d13 initial version
carl
parents:
diff changeset
497 later="$later $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
498 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
499 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
500
45c8592d5d13 initial version
carl
parents:
diff changeset
501 -no-suppress)
45c8592d5d13 initial version
carl
parents:
diff changeset
502 suppress_opt=no
45c8592d5d13 initial version
carl
parents:
diff changeset
503 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
504 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
505
45c8592d5d13 initial version
carl
parents:
diff changeset
506 -Xcompiler)
45c8592d5d13 initial version
carl
parents:
diff changeset
507 arg_mode=arg # the next one goes into the "base_compile" arg list
45c8592d5d13 initial version
carl
parents:
diff changeset
508 continue # The current "srcfile" will either be retained or
45c8592d5d13 initial version
carl
parents:
diff changeset
509 ;; # replaced later. I would guess that would be a bug.
45c8592d5d13 initial version
carl
parents:
diff changeset
510
45c8592d5d13 initial version
carl
parents:
diff changeset
511 -Wc,*)
45c8592d5d13 initial version
carl
parents:
diff changeset
512 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
45c8592d5d13 initial version
carl
parents:
diff changeset
513 lastarg=
45c8592d5d13 initial version
carl
parents:
diff changeset
514 save_ifs="$IFS"; IFS=','
45c8592d5d13 initial version
carl
parents:
diff changeset
515 for arg in $args; do
45c8592d5d13 initial version
carl
parents:
diff changeset
516 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
517
45c8592d5d13 initial version
carl
parents:
diff changeset
518 # Double-quote args containing other shell metacharacters.
45c8592d5d13 initial version
carl
parents:
diff changeset
519 # Many Bourne shells cannot handle close brackets correctly
45c8592d5d13 initial version
carl
parents:
diff changeset
520 # in scan sets, so we specify it separately.
45c8592d5d13 initial version
carl
parents:
diff changeset
521 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
522 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
523 arg="\"$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
524 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
525 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
526 lastarg="$lastarg $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
527 done
45c8592d5d13 initial version
carl
parents:
diff changeset
528 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
529 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
45c8592d5d13 initial version
carl
parents:
diff changeset
530
45c8592d5d13 initial version
carl
parents:
diff changeset
531 # Add the arguments to base_compile.
45c8592d5d13 initial version
carl
parents:
diff changeset
532 base_compile="$base_compile $lastarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
533 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
534 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
535
45c8592d5d13 initial version
carl
parents:
diff changeset
536 * )
45c8592d5d13 initial version
carl
parents:
diff changeset
537 # Accept the current argument as the source file.
45c8592d5d13 initial version
carl
parents:
diff changeset
538 # The previous "srcfile" becomes the current argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
539 #
45c8592d5d13 initial version
carl
parents:
diff changeset
540 lastarg="$srcfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
541 srcfile="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
542 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
543 esac # case $arg
45c8592d5d13 initial version
carl
parents:
diff changeset
544 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
545 esac # case $arg_mode
45c8592d5d13 initial version
carl
parents:
diff changeset
546
45c8592d5d13 initial version
carl
parents:
diff changeset
547 # Aesthetically quote the previous argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
548 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
549
45c8592d5d13 initial version
carl
parents:
diff changeset
550 case $lastarg in
45c8592d5d13 initial version
carl
parents:
diff changeset
551 # Double-quote args containing other shell metacharacters.
45c8592d5d13 initial version
carl
parents:
diff changeset
552 # Many Bourne shells cannot handle close brackets correctly
45c8592d5d13 initial version
carl
parents:
diff changeset
553 # in scan sets, so we specify it separately.
45c8592d5d13 initial version
carl
parents:
diff changeset
554 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
555 lastarg="\"$lastarg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
556 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
557 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
558
45c8592d5d13 initial version
carl
parents:
diff changeset
559 base_compile="$base_compile $lastarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
560 done # for arg
45c8592d5d13 initial version
carl
parents:
diff changeset
561
45c8592d5d13 initial version
carl
parents:
diff changeset
562 case $arg_mode in
45c8592d5d13 initial version
carl
parents:
diff changeset
563 arg)
45c8592d5d13 initial version
carl
parents:
diff changeset
564 $echo "$modename: you must specify an argument for -Xcompile"
45c8592d5d13 initial version
carl
parents:
diff changeset
565 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
566 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
567 target)
45c8592d5d13 initial version
carl
parents:
diff changeset
568 $echo "$modename: you must specify a target with \`-o'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
569 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
570 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
571 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
572 # Get the name of the library object.
45c8592d5d13 initial version
carl
parents:
diff changeset
573 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
574 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
575 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
576
45c8592d5d13 initial version
carl
parents:
diff changeset
577 # Recognize several different file suffixes.
45c8592d5d13 initial version
carl
parents:
diff changeset
578 # If the user specifies -o file.o, it is replaced with file.lo
45c8592d5d13 initial version
carl
parents:
diff changeset
579 xform='[cCFSifmso]'
45c8592d5d13 initial version
carl
parents:
diff changeset
580 case $libobj in
45c8592d5d13 initial version
carl
parents:
diff changeset
581 *.ada) xform=ada ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
582 *.adb) xform=adb ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
583 *.ads) xform=ads ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
584 *.asm) xform=asm ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
585 *.c++) xform=c++ ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
586 *.cc) xform=cc ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
587 *.ii) xform=ii ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
588 *.class) xform=class ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
589 *.cpp) xform=cpp ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
590 *.cxx) xform=cxx ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
591 *.f90) xform=f90 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
592 *.for) xform=for ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
593 *.java) xform=java ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
594 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
595
45c8592d5d13 initial version
carl
parents:
diff changeset
596 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
45c8592d5d13 initial version
carl
parents:
diff changeset
597
45c8592d5d13 initial version
carl
parents:
diff changeset
598 case $libobj in
45c8592d5d13 initial version
carl
parents:
diff changeset
599 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
600 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
601 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
602 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
603 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
604 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
605
45c8592d5d13 initial version
carl
parents:
diff changeset
606 func_infer_tag $base_compile
45c8592d5d13 initial version
carl
parents:
diff changeset
607
45c8592d5d13 initial version
carl
parents:
diff changeset
608 for arg in $later; do
45c8592d5d13 initial version
carl
parents:
diff changeset
609 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
610 -static)
45c8592d5d13 initial version
carl
parents:
diff changeset
611 build_old_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
612 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
613 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
614
45c8592d5d13 initial version
carl
parents:
diff changeset
615 -prefer-pic)
45c8592d5d13 initial version
carl
parents:
diff changeset
616 pic_mode=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
617 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
618 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
619
45c8592d5d13 initial version
carl
parents:
diff changeset
620 -prefer-non-pic)
45c8592d5d13 initial version
carl
parents:
diff changeset
621 pic_mode=no
45c8592d5d13 initial version
carl
parents:
diff changeset
622 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
623 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
624 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
625 done
45c8592d5d13 initial version
carl
parents:
diff changeset
626
45c8592d5d13 initial version
carl
parents:
diff changeset
627 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
628 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
629 if test "X$xdir" = "X$obj"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
630 xdir=
45c8592d5d13 initial version
carl
parents:
diff changeset
631 else
45c8592d5d13 initial version
carl
parents:
diff changeset
632 xdir=$xdir/
45c8592d5d13 initial version
carl
parents:
diff changeset
633 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
634 lobj=${xdir}$objdir/$objname
45c8592d5d13 initial version
carl
parents:
diff changeset
635
45c8592d5d13 initial version
carl
parents:
diff changeset
636 if test -z "$base_compile"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
637 $echo "$modename: you must specify a compilation command" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
638 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
639 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
640 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
641
45c8592d5d13 initial version
carl
parents:
diff changeset
642 # Delete any leftover library objects.
45c8592d5d13 initial version
carl
parents:
diff changeset
643 if test "$build_old_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
644 removelist="$obj $lobj $libobj ${libobj}T"
45c8592d5d13 initial version
carl
parents:
diff changeset
645 else
45c8592d5d13 initial version
carl
parents:
diff changeset
646 removelist="$lobj $libobj ${libobj}T"
45c8592d5d13 initial version
carl
parents:
diff changeset
647 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
648
45c8592d5d13 initial version
carl
parents:
diff changeset
649 $run $rm $removelist
45c8592d5d13 initial version
carl
parents:
diff changeset
650 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
45c8592d5d13 initial version
carl
parents:
diff changeset
651
45c8592d5d13 initial version
carl
parents:
diff changeset
652 # On Cygwin there's no "real" PIC flag so we must build both object types
45c8592d5d13 initial version
carl
parents:
diff changeset
653 case $host_os in
45c8592d5d13 initial version
carl
parents:
diff changeset
654 cygwin* | mingw* | pw32* | os2*)
45c8592d5d13 initial version
carl
parents:
diff changeset
655 pic_mode=default
45c8592d5d13 initial version
carl
parents:
diff changeset
656 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
657 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
658 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
45c8592d5d13 initial version
carl
parents:
diff changeset
659 # non-PIC code in shared libraries is not supported
45c8592d5d13 initial version
carl
parents:
diff changeset
660 pic_mode=default
45c8592d5d13 initial version
carl
parents:
diff changeset
661 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
662
45c8592d5d13 initial version
carl
parents:
diff changeset
663 # Calculate the filename of the output object if compiler does
45c8592d5d13 initial version
carl
parents:
diff changeset
664 # not support -o with -c
45c8592d5d13 initial version
carl
parents:
diff changeset
665 if test "$compiler_c_o" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
666 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
45c8592d5d13 initial version
carl
parents:
diff changeset
667 lockfile="$output_obj.lock"
45c8592d5d13 initial version
carl
parents:
diff changeset
668 removelist="$removelist $output_obj $lockfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
669 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
45c8592d5d13 initial version
carl
parents:
diff changeset
670 else
45c8592d5d13 initial version
carl
parents:
diff changeset
671 output_obj=
45c8592d5d13 initial version
carl
parents:
diff changeset
672 need_locks=no
45c8592d5d13 initial version
carl
parents:
diff changeset
673 lockfile=
45c8592d5d13 initial version
carl
parents:
diff changeset
674 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
675
45c8592d5d13 initial version
carl
parents:
diff changeset
676 # Lock this critical section if it is needed
45c8592d5d13 initial version
carl
parents:
diff changeset
677 # We use this script file to make the link, it avoids creating a new file
45c8592d5d13 initial version
carl
parents:
diff changeset
678 if test "$need_locks" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
679 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
45c8592d5d13 initial version
carl
parents:
diff changeset
680 $show "Waiting for $lockfile to be removed"
45c8592d5d13 initial version
carl
parents:
diff changeset
681 sleep 2
45c8592d5d13 initial version
carl
parents:
diff changeset
682 done
45c8592d5d13 initial version
carl
parents:
diff changeset
683 elif test "$need_locks" = warn; then
45c8592d5d13 initial version
carl
parents:
diff changeset
684 if test -f "$lockfile"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
685 $echo "\
45c8592d5d13 initial version
carl
parents:
diff changeset
686 *** ERROR, $lockfile exists and contains:
45c8592d5d13 initial version
carl
parents:
diff changeset
687 `cat $lockfile 2>/dev/null`
45c8592d5d13 initial version
carl
parents:
diff changeset
688
45c8592d5d13 initial version
carl
parents:
diff changeset
689 This indicates that another process is trying to use the same
45c8592d5d13 initial version
carl
parents:
diff changeset
690 temporary object file, and libtool could not work around it because
45c8592d5d13 initial version
carl
parents:
diff changeset
691 your compiler does not support \`-c' and \`-o' together. If you
45c8592d5d13 initial version
carl
parents:
diff changeset
692 repeat this compilation, it may succeed, by chance, but you had better
45c8592d5d13 initial version
carl
parents:
diff changeset
693 avoid parallel builds (make -j) in this platform, or get a better
45c8592d5d13 initial version
carl
parents:
diff changeset
694 compiler."
45c8592d5d13 initial version
carl
parents:
diff changeset
695
45c8592d5d13 initial version
carl
parents:
diff changeset
696 $run $rm $removelist
45c8592d5d13 initial version
carl
parents:
diff changeset
697 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
698 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
699 $echo $srcfile > "$lockfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
700 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
701
45c8592d5d13 initial version
carl
parents:
diff changeset
702 if test -n "$fix_srcfile_path"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
703 eval srcfile=\"$fix_srcfile_path\"
45c8592d5d13 initial version
carl
parents:
diff changeset
704 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
705
45c8592d5d13 initial version
carl
parents:
diff changeset
706 $run $rm "$libobj" "${libobj}T"
45c8592d5d13 initial version
carl
parents:
diff changeset
707
45c8592d5d13 initial version
carl
parents:
diff changeset
708 # Create a libtool object file (analogous to a ".la" file),
45c8592d5d13 initial version
carl
parents:
diff changeset
709 # but don't create it if we're doing a dry run.
45c8592d5d13 initial version
carl
parents:
diff changeset
710 test -z "$run" && cat > ${libobj}T <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
711 # $libobj - a libtool object file
45c8592d5d13 initial version
carl
parents:
diff changeset
712 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
45c8592d5d13 initial version
carl
parents:
diff changeset
713 #
45c8592d5d13 initial version
carl
parents:
diff changeset
714 # Please DO NOT delete this file!
45c8592d5d13 initial version
carl
parents:
diff changeset
715 # It is necessary for linking the library.
45c8592d5d13 initial version
carl
parents:
diff changeset
716
45c8592d5d13 initial version
carl
parents:
diff changeset
717 # Name of the PIC object.
45c8592d5d13 initial version
carl
parents:
diff changeset
718 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
719
45c8592d5d13 initial version
carl
parents:
diff changeset
720 # Only build a PIC object if we are building libtool libraries.
45c8592d5d13 initial version
carl
parents:
diff changeset
721 if test "$build_libtool_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
722 # Without this assignment, base_compile gets emptied.
45c8592d5d13 initial version
carl
parents:
diff changeset
723 fbsd_hideous_sh_bug=$base_compile
45c8592d5d13 initial version
carl
parents:
diff changeset
724
45c8592d5d13 initial version
carl
parents:
diff changeset
725 if test "$pic_mode" != no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
726 command="$base_compile $srcfile $pic_flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
727 else
45c8592d5d13 initial version
carl
parents:
diff changeset
728 # Don't build PIC code
45c8592d5d13 initial version
carl
parents:
diff changeset
729 command="$base_compile $srcfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
730 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
731
45c8592d5d13 initial version
carl
parents:
diff changeset
732 if test ! -d "${xdir}$objdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
733 $show "$mkdir ${xdir}$objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
734 $run $mkdir ${xdir}$objdir
45c8592d5d13 initial version
carl
parents:
diff changeset
735 status=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
736 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
737 exit $status
45c8592d5d13 initial version
carl
parents:
diff changeset
738 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
739 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
740
45c8592d5d13 initial version
carl
parents:
diff changeset
741 if test -z "$output_obj"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
742 # Place PIC objects in $objdir
45c8592d5d13 initial version
carl
parents:
diff changeset
743 command="$command -o $lobj"
45c8592d5d13 initial version
carl
parents:
diff changeset
744 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
745
45c8592d5d13 initial version
carl
parents:
diff changeset
746 $run $rm "$lobj" "$output_obj"
45c8592d5d13 initial version
carl
parents:
diff changeset
747
45c8592d5d13 initial version
carl
parents:
diff changeset
748 $show "$command"
45c8592d5d13 initial version
carl
parents:
diff changeset
749 if $run eval "$command"; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
750 else
45c8592d5d13 initial version
carl
parents:
diff changeset
751 test -n "$output_obj" && $run $rm $removelist
45c8592d5d13 initial version
carl
parents:
diff changeset
752 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
753 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
754
45c8592d5d13 initial version
carl
parents:
diff changeset
755 if test "$need_locks" = warn &&
45c8592d5d13 initial version
carl
parents:
diff changeset
756 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
757 $echo "\
45c8592d5d13 initial version
carl
parents:
diff changeset
758 *** ERROR, $lockfile contains:
45c8592d5d13 initial version
carl
parents:
diff changeset
759 `cat $lockfile 2>/dev/null`
45c8592d5d13 initial version
carl
parents:
diff changeset
760
45c8592d5d13 initial version
carl
parents:
diff changeset
761 but it should contain:
45c8592d5d13 initial version
carl
parents:
diff changeset
762 $srcfile
45c8592d5d13 initial version
carl
parents:
diff changeset
763
45c8592d5d13 initial version
carl
parents:
diff changeset
764 This indicates that another process is trying to use the same
45c8592d5d13 initial version
carl
parents:
diff changeset
765 temporary object file, and libtool could not work around it because
45c8592d5d13 initial version
carl
parents:
diff changeset
766 your compiler does not support \`-c' and \`-o' together. If you
45c8592d5d13 initial version
carl
parents:
diff changeset
767 repeat this compilation, it may succeed, by chance, but you had better
45c8592d5d13 initial version
carl
parents:
diff changeset
768 avoid parallel builds (make -j) in this platform, or get a better
45c8592d5d13 initial version
carl
parents:
diff changeset
769 compiler."
45c8592d5d13 initial version
carl
parents:
diff changeset
770
45c8592d5d13 initial version
carl
parents:
diff changeset
771 $run $rm $removelist
45c8592d5d13 initial version
carl
parents:
diff changeset
772 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
773 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
774
45c8592d5d13 initial version
carl
parents:
diff changeset
775 # Just move the object if needed, then go on to compile the next one
45c8592d5d13 initial version
carl
parents:
diff changeset
776 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
777 $show "$mv $output_obj $lobj"
45c8592d5d13 initial version
carl
parents:
diff changeset
778 if $run $mv $output_obj $lobj; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
779 else
45c8592d5d13 initial version
carl
parents:
diff changeset
780 error=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
781 $run $rm $removelist
45c8592d5d13 initial version
carl
parents:
diff changeset
782 exit $error
45c8592d5d13 initial version
carl
parents:
diff changeset
783 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
784 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
785
45c8592d5d13 initial version
carl
parents:
diff changeset
786 # Append the name of the PIC object to the libtool object file.
45c8592d5d13 initial version
carl
parents:
diff changeset
787 test -z "$run" && cat >> ${libobj}T <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
788 pic_object='$objdir/$objname'
45c8592d5d13 initial version
carl
parents:
diff changeset
789
45c8592d5d13 initial version
carl
parents:
diff changeset
790 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
791
45c8592d5d13 initial version
carl
parents:
diff changeset
792 # Allow error messages only from the first compilation.
45c8592d5d13 initial version
carl
parents:
diff changeset
793 if test "$suppress_opt" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
794 suppress_output=' >/dev/null 2>&1'
45c8592d5d13 initial version
carl
parents:
diff changeset
795 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
796 else
45c8592d5d13 initial version
carl
parents:
diff changeset
797 # No PIC object so indicate it doesn't exist in the libtool
45c8592d5d13 initial version
carl
parents:
diff changeset
798 # object file.
45c8592d5d13 initial version
carl
parents:
diff changeset
799 test -z "$run" && cat >> ${libobj}T <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
800 pic_object=none
45c8592d5d13 initial version
carl
parents:
diff changeset
801
45c8592d5d13 initial version
carl
parents:
diff changeset
802 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
803 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
804
45c8592d5d13 initial version
carl
parents:
diff changeset
805 # Only build a position-dependent object if we build old libraries.
45c8592d5d13 initial version
carl
parents:
diff changeset
806 if test "$build_old_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
807 if test "$pic_mode" != yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
808 # Don't build PIC code
45c8592d5d13 initial version
carl
parents:
diff changeset
809 command="$base_compile $srcfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
810 else
45c8592d5d13 initial version
carl
parents:
diff changeset
811 command="$base_compile $srcfile $pic_flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
812 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
813 if test "$compiler_c_o" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
814 command="$command -o $obj"
45c8592d5d13 initial version
carl
parents:
diff changeset
815 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
816
45c8592d5d13 initial version
carl
parents:
diff changeset
817 # Suppress compiler output if we already did a PIC compilation.
45c8592d5d13 initial version
carl
parents:
diff changeset
818 command="$command$suppress_output"
45c8592d5d13 initial version
carl
parents:
diff changeset
819 $run $rm "$obj" "$output_obj"
45c8592d5d13 initial version
carl
parents:
diff changeset
820 $show "$command"
45c8592d5d13 initial version
carl
parents:
diff changeset
821 if $run eval "$command"; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
822 else
45c8592d5d13 initial version
carl
parents:
diff changeset
823 $run $rm $removelist
45c8592d5d13 initial version
carl
parents:
diff changeset
824 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
825 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
826
45c8592d5d13 initial version
carl
parents:
diff changeset
827 if test "$need_locks" = warn &&
45c8592d5d13 initial version
carl
parents:
diff changeset
828 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
829 $echo "\
45c8592d5d13 initial version
carl
parents:
diff changeset
830 *** ERROR, $lockfile contains:
45c8592d5d13 initial version
carl
parents:
diff changeset
831 `cat $lockfile 2>/dev/null`
45c8592d5d13 initial version
carl
parents:
diff changeset
832
45c8592d5d13 initial version
carl
parents:
diff changeset
833 but it should contain:
45c8592d5d13 initial version
carl
parents:
diff changeset
834 $srcfile
45c8592d5d13 initial version
carl
parents:
diff changeset
835
45c8592d5d13 initial version
carl
parents:
diff changeset
836 This indicates that another process is trying to use the same
45c8592d5d13 initial version
carl
parents:
diff changeset
837 temporary object file, and libtool could not work around it because
45c8592d5d13 initial version
carl
parents:
diff changeset
838 your compiler does not support \`-c' and \`-o' together. If you
45c8592d5d13 initial version
carl
parents:
diff changeset
839 repeat this compilation, it may succeed, by chance, but you had better
45c8592d5d13 initial version
carl
parents:
diff changeset
840 avoid parallel builds (make -j) in this platform, or get a better
45c8592d5d13 initial version
carl
parents:
diff changeset
841 compiler."
45c8592d5d13 initial version
carl
parents:
diff changeset
842
45c8592d5d13 initial version
carl
parents:
diff changeset
843 $run $rm $removelist
45c8592d5d13 initial version
carl
parents:
diff changeset
844 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
845 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
846
45c8592d5d13 initial version
carl
parents:
diff changeset
847 # Just move the object if needed
45c8592d5d13 initial version
carl
parents:
diff changeset
848 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
849 $show "$mv $output_obj $obj"
45c8592d5d13 initial version
carl
parents:
diff changeset
850 if $run $mv $output_obj $obj; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
851 else
45c8592d5d13 initial version
carl
parents:
diff changeset
852 error=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
853 $run $rm $removelist
45c8592d5d13 initial version
carl
parents:
diff changeset
854 exit $error
45c8592d5d13 initial version
carl
parents:
diff changeset
855 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
856 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
857
45c8592d5d13 initial version
carl
parents:
diff changeset
858 # Append the name of the non-PIC object the libtool object file.
45c8592d5d13 initial version
carl
parents:
diff changeset
859 # Only append if the libtool object file exists.
45c8592d5d13 initial version
carl
parents:
diff changeset
860 test -z "$run" && cat >> ${libobj}T <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
861 # Name of the non-PIC object.
45c8592d5d13 initial version
carl
parents:
diff changeset
862 non_pic_object='$objname'
45c8592d5d13 initial version
carl
parents:
diff changeset
863
45c8592d5d13 initial version
carl
parents:
diff changeset
864 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
865 else
45c8592d5d13 initial version
carl
parents:
diff changeset
866 # Append the name of the non-PIC object the libtool object file.
45c8592d5d13 initial version
carl
parents:
diff changeset
867 # Only append if the libtool object file exists.
45c8592d5d13 initial version
carl
parents:
diff changeset
868 test -z "$run" && cat >> ${libobj}T <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
869 # Name of the non-PIC object.
45c8592d5d13 initial version
carl
parents:
diff changeset
870 non_pic_object=none
45c8592d5d13 initial version
carl
parents:
diff changeset
871
45c8592d5d13 initial version
carl
parents:
diff changeset
872 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
873 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
874
45c8592d5d13 initial version
carl
parents:
diff changeset
875 $run $mv "${libobj}T" "${libobj}"
45c8592d5d13 initial version
carl
parents:
diff changeset
876
45c8592d5d13 initial version
carl
parents:
diff changeset
877 # Unlock the critical section if it was locked
45c8592d5d13 initial version
carl
parents:
diff changeset
878 if test "$need_locks" != no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
879 $run $rm "$lockfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
880 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
881
45c8592d5d13 initial version
carl
parents:
diff changeset
882 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
883 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
884
45c8592d5d13 initial version
carl
parents:
diff changeset
885 # libtool link mode
45c8592d5d13 initial version
carl
parents:
diff changeset
886 link | relink)
45c8592d5d13 initial version
carl
parents:
diff changeset
887 modename="$modename: link"
45c8592d5d13 initial version
carl
parents:
diff changeset
888 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
889 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
45c8592d5d13 initial version
carl
parents:
diff changeset
890 # It is impossible to link a dll without this setting, and
45c8592d5d13 initial version
carl
parents:
diff changeset
891 # we shouldn't force the makefile maintainer to figure out
45c8592d5d13 initial version
carl
parents:
diff changeset
892 # which system we are compiling for in order to pass an extra
45c8592d5d13 initial version
carl
parents:
diff changeset
893 # flag for every libtool invocation.
45c8592d5d13 initial version
carl
parents:
diff changeset
894 # allow_undefined=no
45c8592d5d13 initial version
carl
parents:
diff changeset
895
45c8592d5d13 initial version
carl
parents:
diff changeset
896 # FIXME: Unfortunately, there are problems with the above when trying
45c8592d5d13 initial version
carl
parents:
diff changeset
897 # to make a dll which has undefined symbols, in which case not
45c8592d5d13 initial version
carl
parents:
diff changeset
898 # even a static library is built. For now, we need to specify
45c8592d5d13 initial version
carl
parents:
diff changeset
899 # -no-undefined on the libtool link line when we can be certain
45c8592d5d13 initial version
carl
parents:
diff changeset
900 # that all symbols are satisfied, otherwise we get a static library.
45c8592d5d13 initial version
carl
parents:
diff changeset
901 allow_undefined=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
902 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
903 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
904 allow_undefined=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
905 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
906 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
907 libtool_args="$nonopt"
45c8592d5d13 initial version
carl
parents:
diff changeset
908 base_compile="$nonopt $@"
45c8592d5d13 initial version
carl
parents:
diff changeset
909 compile_command="$nonopt"
45c8592d5d13 initial version
carl
parents:
diff changeset
910 finalize_command="$nonopt"
45c8592d5d13 initial version
carl
parents:
diff changeset
911
45c8592d5d13 initial version
carl
parents:
diff changeset
912 compile_rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
913 finalize_rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
914 compile_shlibpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
915 finalize_shlibpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
916 convenience=
45c8592d5d13 initial version
carl
parents:
diff changeset
917 old_convenience=
45c8592d5d13 initial version
carl
parents:
diff changeset
918 deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
919 old_deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
920 compiler_flags=
45c8592d5d13 initial version
carl
parents:
diff changeset
921 linker_flags=
45c8592d5d13 initial version
carl
parents:
diff changeset
922 dllsearchpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
923 lib_search_path=`pwd`
45c8592d5d13 initial version
carl
parents:
diff changeset
924 inst_prefix_dir=
45c8592d5d13 initial version
carl
parents:
diff changeset
925
45c8592d5d13 initial version
carl
parents:
diff changeset
926 avoid_version=no
45c8592d5d13 initial version
carl
parents:
diff changeset
927 dlfiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
928 dlprefiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
929 dlself=no
45c8592d5d13 initial version
carl
parents:
diff changeset
930 export_dynamic=no
45c8592d5d13 initial version
carl
parents:
diff changeset
931 export_symbols=
45c8592d5d13 initial version
carl
parents:
diff changeset
932 export_symbols_regex=
45c8592d5d13 initial version
carl
parents:
diff changeset
933 generated=
45c8592d5d13 initial version
carl
parents:
diff changeset
934 libobjs=
45c8592d5d13 initial version
carl
parents:
diff changeset
935 ltlibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
936 module=no
45c8592d5d13 initial version
carl
parents:
diff changeset
937 no_install=no
45c8592d5d13 initial version
carl
parents:
diff changeset
938 objs=
45c8592d5d13 initial version
carl
parents:
diff changeset
939 non_pic_objects=
45c8592d5d13 initial version
carl
parents:
diff changeset
940 precious_files_regex=
45c8592d5d13 initial version
carl
parents:
diff changeset
941 prefer_static_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
942 preload=no
45c8592d5d13 initial version
carl
parents:
diff changeset
943 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
944 prevarg=
45c8592d5d13 initial version
carl
parents:
diff changeset
945 release=
45c8592d5d13 initial version
carl
parents:
diff changeset
946 rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
947 xrpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
948 perm_rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
949 temp_rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
950 thread_safe=no
45c8592d5d13 initial version
carl
parents:
diff changeset
951 vinfo=
45c8592d5d13 initial version
carl
parents:
diff changeset
952 vinfo_number=no
45c8592d5d13 initial version
carl
parents:
diff changeset
953
45c8592d5d13 initial version
carl
parents:
diff changeset
954 func_infer_tag $base_compile
45c8592d5d13 initial version
carl
parents:
diff changeset
955
45c8592d5d13 initial version
carl
parents:
diff changeset
956 # We need to know -static, to get the right output filenames.
45c8592d5d13 initial version
carl
parents:
diff changeset
957 for arg
45c8592d5d13 initial version
carl
parents:
diff changeset
958 do
45c8592d5d13 initial version
carl
parents:
diff changeset
959 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
960 -all-static | -static)
45c8592d5d13 initial version
carl
parents:
diff changeset
961 if test "X$arg" = "X-all-static"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
962 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
963 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
964 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
965 if test -n "$link_static_flag"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
966 dlopen_self=$dlopen_self_static
45c8592d5d13 initial version
carl
parents:
diff changeset
967 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
968 else
45c8592d5d13 initial version
carl
parents:
diff changeset
969 if test -z "$pic_flag" && test -n "$link_static_flag"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
970 dlopen_self=$dlopen_self_static
45c8592d5d13 initial version
carl
parents:
diff changeset
971 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
972 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
973 build_libtool_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
974 build_old_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
975 prefer_static_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
976 break
45c8592d5d13 initial version
carl
parents:
diff changeset
977 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
978 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
979 done
45c8592d5d13 initial version
carl
parents:
diff changeset
980
45c8592d5d13 initial version
carl
parents:
diff changeset
981 # See if our shared archives depend on static archives.
45c8592d5d13 initial version
carl
parents:
diff changeset
982 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
983
45c8592d5d13 initial version
carl
parents:
diff changeset
984 # Go through the arguments, transforming them on the way.
45c8592d5d13 initial version
carl
parents:
diff changeset
985 while test "$#" -gt 0; do
45c8592d5d13 initial version
carl
parents:
diff changeset
986 arg="$1"
45c8592d5d13 initial version
carl
parents:
diff changeset
987 shift
45c8592d5d13 initial version
carl
parents:
diff changeset
988 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
989 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
990 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
45c8592d5d13 initial version
carl
parents:
diff changeset
991 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
992 *) qarg=$arg ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
993 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
994 libtool_args="$libtool_args $qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
995
45c8592d5d13 initial version
carl
parents:
diff changeset
996 # If the previous option needs an argument, assign it.
45c8592d5d13 initial version
carl
parents:
diff changeset
997 if test -n "$prev"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
998 case $prev in
45c8592d5d13 initial version
carl
parents:
diff changeset
999 output)
45c8592d5d13 initial version
carl
parents:
diff changeset
1000 compile_command="$compile_command @OUTPUT@"
45c8592d5d13 initial version
carl
parents:
diff changeset
1001 finalize_command="$finalize_command @OUTPUT@"
45c8592d5d13 initial version
carl
parents:
diff changeset
1002 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1003 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1004
45c8592d5d13 initial version
carl
parents:
diff changeset
1005 case $prev in
45c8592d5d13 initial version
carl
parents:
diff changeset
1006 dlfiles|dlprefiles)
45c8592d5d13 initial version
carl
parents:
diff changeset
1007 if test "$preload" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1008 # Add the symbol object into the linking commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
1009 compile_command="$compile_command @SYMFILE@"
45c8592d5d13 initial version
carl
parents:
diff changeset
1010 finalize_command="$finalize_command @SYMFILE@"
45c8592d5d13 initial version
carl
parents:
diff changeset
1011 preload=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1012 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1013 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
1014 *.la | *.lo) ;; # We handle these cases below.
45c8592d5d13 initial version
carl
parents:
diff changeset
1015 force)
45c8592d5d13 initial version
carl
parents:
diff changeset
1016 if test "$dlself" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1017 dlself=needless
45c8592d5d13 initial version
carl
parents:
diff changeset
1018 export_dynamic=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1019 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1020 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1021 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1022 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1023 self)
45c8592d5d13 initial version
carl
parents:
diff changeset
1024 if test "$prev" = dlprefiles; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1025 dlself=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1026 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1027 dlself=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1028 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1029 dlself=needless
45c8592d5d13 initial version
carl
parents:
diff changeset
1030 export_dynamic=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1031 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1032 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1033 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1034 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1035 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1036 if test "$prev" = dlfiles; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1037 dlfiles="$dlfiles $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1038 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1039 dlprefiles="$dlprefiles $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1040 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1041 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1042 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1043 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1044 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1045 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1046 expsyms)
45c8592d5d13 initial version
carl
parents:
diff changeset
1047 export_symbols="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1048 if test ! -f "$arg"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1049 $echo "$modename: symbol file \`$arg' does not exist"
45c8592d5d13 initial version
carl
parents:
diff changeset
1050 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1051 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1052 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1053 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1054 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1055 expsyms_regex)
45c8592d5d13 initial version
carl
parents:
diff changeset
1056 export_symbols_regex="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1057 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1058 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1059 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1060 inst_prefix)
45c8592d5d13 initial version
carl
parents:
diff changeset
1061 inst_prefix_dir="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1062 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1063 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1064 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1065 precious_regex)
45c8592d5d13 initial version
carl
parents:
diff changeset
1066 precious_files_regex="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1067 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1068 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1069 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1070 release)
45c8592d5d13 initial version
carl
parents:
diff changeset
1071 release="-$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1072 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1073 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1074 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1075 objectlist)
45c8592d5d13 initial version
carl
parents:
diff changeset
1076 if test -f "$arg"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1077 save_arg=$arg
45c8592d5d13 initial version
carl
parents:
diff changeset
1078 moreargs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1079 for fil in `cat $save_arg`
45c8592d5d13 initial version
carl
parents:
diff changeset
1080 do
45c8592d5d13 initial version
carl
parents:
diff changeset
1081 # moreargs="$moreargs $fil"
45c8592d5d13 initial version
carl
parents:
diff changeset
1082 arg=$fil
45c8592d5d13 initial version
carl
parents:
diff changeset
1083 # A libtool-controlled object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1084
45c8592d5d13 initial version
carl
parents:
diff changeset
1085 # Check to see that this really is a libtool object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1086 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1087 pic_object=
45c8592d5d13 initial version
carl
parents:
diff changeset
1088 non_pic_object=
45c8592d5d13 initial version
carl
parents:
diff changeset
1089
45c8592d5d13 initial version
carl
parents:
diff changeset
1090 # Read the .lo file
45c8592d5d13 initial version
carl
parents:
diff changeset
1091 # If there is no directory component, then add one.
45c8592d5d13 initial version
carl
parents:
diff changeset
1092 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
1093 */* | *\\*) . $arg ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1094 *) . ./$arg ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1095 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1096
45c8592d5d13 initial version
carl
parents:
diff changeset
1097 if test -z "$pic_object" || \
45c8592d5d13 initial version
carl
parents:
diff changeset
1098 test -z "$non_pic_object" ||
45c8592d5d13 initial version
carl
parents:
diff changeset
1099 test "$pic_object" = none && \
45c8592d5d13 initial version
carl
parents:
diff changeset
1100 test "$non_pic_object" = none; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1101 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1102 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1103 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1104
45c8592d5d13 initial version
carl
parents:
diff changeset
1105 # Extract subdirectory from the argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
1106 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1107 if test "X$xdir" = "X$arg"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1108 xdir=
45c8592d5d13 initial version
carl
parents:
diff changeset
1109 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1110 xdir="$xdir/"
45c8592d5d13 initial version
carl
parents:
diff changeset
1111 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1112
45c8592d5d13 initial version
carl
parents:
diff changeset
1113 if test "$pic_object" != none; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1114 # Prepend the subdirectory the object is found in.
45c8592d5d13 initial version
carl
parents:
diff changeset
1115 pic_object="$xdir$pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1116
45c8592d5d13 initial version
carl
parents:
diff changeset
1117 if test "$prev" = dlfiles; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1118 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1119 dlfiles="$dlfiles $pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1120 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1121 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1122 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1123 # If libtool objects are unsupported, then we need to preload.
45c8592d5d13 initial version
carl
parents:
diff changeset
1124 prev=dlprefiles
45c8592d5d13 initial version
carl
parents:
diff changeset
1125 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1126 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1127
45c8592d5d13 initial version
carl
parents:
diff changeset
1128 # CHECK ME: I think I busted this. -Ossama
45c8592d5d13 initial version
carl
parents:
diff changeset
1129 if test "$prev" = dlprefiles; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1130 # Preload the old-style object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1131 dlprefiles="$dlprefiles $pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1132 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1133 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1134
45c8592d5d13 initial version
carl
parents:
diff changeset
1135 # A PIC object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1136 libobjs="$libobjs $pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1137 arg="$pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1138 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1139
45c8592d5d13 initial version
carl
parents:
diff changeset
1140 # Non-PIC object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1141 if test "$non_pic_object" != none; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1142 # Prepend the subdirectory the object is found in.
45c8592d5d13 initial version
carl
parents:
diff changeset
1143 non_pic_object="$xdir$non_pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1144
45c8592d5d13 initial version
carl
parents:
diff changeset
1145 # A standard non-PIC object
45c8592d5d13 initial version
carl
parents:
diff changeset
1146 non_pic_objects="$non_pic_objects $non_pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1147 if test -z "$pic_object" || test "$pic_object" = none ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1148 arg="$non_pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1149 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1150 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1151 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1152 # Only an error if not doing a dry-run.
45c8592d5d13 initial version
carl
parents:
diff changeset
1153 if test -z "$run"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1154 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1155 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1156 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1157 # Dry-run case.
45c8592d5d13 initial version
carl
parents:
diff changeset
1158
45c8592d5d13 initial version
carl
parents:
diff changeset
1159 # Extract subdirectory from the argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
1160 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1161 if test "X$xdir" = "X$arg"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1162 xdir=
45c8592d5d13 initial version
carl
parents:
diff changeset
1163 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1164 xdir="$xdir/"
45c8592d5d13 initial version
carl
parents:
diff changeset
1165 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1166
45c8592d5d13 initial version
carl
parents:
diff changeset
1167 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
45c8592d5d13 initial version
carl
parents:
diff changeset
1168 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
45c8592d5d13 initial version
carl
parents:
diff changeset
1169 libobjs="$libobjs $pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1170 non_pic_objects="$non_pic_objects $non_pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1171 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1172 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1173 done
45c8592d5d13 initial version
carl
parents:
diff changeset
1174 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1175 $echo "$modename: link input file \`$save_arg' does not exist"
45c8592d5d13 initial version
carl
parents:
diff changeset
1176 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1177 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1178 arg=$save_arg
45c8592d5d13 initial version
carl
parents:
diff changeset
1179 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1180 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1181 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1182 rpath | xrpath)
45c8592d5d13 initial version
carl
parents:
diff changeset
1183 # We need an absolute path.
45c8592d5d13 initial version
carl
parents:
diff changeset
1184 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
1185 [\\/]* | [A-Za-z]:[\\/]*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1186 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1187 $echo "$modename: only absolute run-paths are allowed" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1188 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1189 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1190 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1191 if test "$prev" = rpath; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1192 case "$rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
1193 *" $arg "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1194 *) rpath="$rpath $arg" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1195 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1196 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1197 case "$xrpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
1198 *" $arg "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1199 *) xrpath="$xrpath $arg" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1200 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1201 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1202 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1203 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1204 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1205 xcompiler)
45c8592d5d13 initial version
carl
parents:
diff changeset
1206 compiler_flags="$compiler_flags $qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1207 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1208 compile_command="$compile_command $qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1209 finalize_command="$finalize_command $qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1210 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1211 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1212 xlinker)
45c8592d5d13 initial version
carl
parents:
diff changeset
1213 linker_flags="$linker_flags $qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1214 compiler_flags="$compiler_flags $wl$qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1215 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1216 compile_command="$compile_command $wl$qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1217 finalize_command="$finalize_command $wl$qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1218 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1219 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1220 xcclinker)
45c8592d5d13 initial version
carl
parents:
diff changeset
1221 linker_flags="$linker_flags $qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1222 compiler_flags="$compiler_flags $qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1223 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1224 compile_command="$compile_command $qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1225 finalize_command="$finalize_command $qarg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1226 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1227 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1228 shrext)
45c8592d5d13 initial version
carl
parents:
diff changeset
1229 shrext_cmds="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1230 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1231 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1232 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1233 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1234 eval "$prev=\"\$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
1235 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1236 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1237 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1238 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1239 fi # test -n "$prev"
45c8592d5d13 initial version
carl
parents:
diff changeset
1240
45c8592d5d13 initial version
carl
parents:
diff changeset
1241 prevarg="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1242
45c8592d5d13 initial version
carl
parents:
diff changeset
1243 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
1244 -all-static)
45c8592d5d13 initial version
carl
parents:
diff changeset
1245 if test -n "$link_static_flag"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1246 compile_command="$compile_command $link_static_flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
1247 finalize_command="$finalize_command $link_static_flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
1248 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1249 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1250 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1251
45c8592d5d13 initial version
carl
parents:
diff changeset
1252 -allow-undefined)
45c8592d5d13 initial version
carl
parents:
diff changeset
1253 # FIXME: remove this flag sometime in the future.
45c8592d5d13 initial version
carl
parents:
diff changeset
1254 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1255 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1256 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1257
45c8592d5d13 initial version
carl
parents:
diff changeset
1258 -avoid-version)
45c8592d5d13 initial version
carl
parents:
diff changeset
1259 avoid_version=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1260 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1261 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1262
45c8592d5d13 initial version
carl
parents:
diff changeset
1263 -dlopen)
45c8592d5d13 initial version
carl
parents:
diff changeset
1264 prev=dlfiles
45c8592d5d13 initial version
carl
parents:
diff changeset
1265 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1266 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1267
45c8592d5d13 initial version
carl
parents:
diff changeset
1268 -dlpreopen)
45c8592d5d13 initial version
carl
parents:
diff changeset
1269 prev=dlprefiles
45c8592d5d13 initial version
carl
parents:
diff changeset
1270 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1271 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1272
45c8592d5d13 initial version
carl
parents:
diff changeset
1273 -export-dynamic)
45c8592d5d13 initial version
carl
parents:
diff changeset
1274 export_dynamic=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1275 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1276 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1277
45c8592d5d13 initial version
carl
parents:
diff changeset
1278 -export-symbols | -export-symbols-regex)
45c8592d5d13 initial version
carl
parents:
diff changeset
1279 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1280 $echo "$modename: more than one -exported-symbols argument is not allowed"
45c8592d5d13 initial version
carl
parents:
diff changeset
1281 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1282 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1283 if test "X$arg" = "X-export-symbols"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1284 prev=expsyms
45c8592d5d13 initial version
carl
parents:
diff changeset
1285 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1286 prev=expsyms_regex
45c8592d5d13 initial version
carl
parents:
diff changeset
1287 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1288 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1289 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1290
45c8592d5d13 initial version
carl
parents:
diff changeset
1291 -inst-prefix-dir)
45c8592d5d13 initial version
carl
parents:
diff changeset
1292 prev=inst_prefix
45c8592d5d13 initial version
carl
parents:
diff changeset
1293 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1294 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1295
45c8592d5d13 initial version
carl
parents:
diff changeset
1296 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
45c8592d5d13 initial version
carl
parents:
diff changeset
1297 # so, if we see these flags be careful not to treat them like -L
45c8592d5d13 initial version
carl
parents:
diff changeset
1298 -L[A-Z][A-Z]*:*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1299 case $with_gcc/$host in
45c8592d5d13 initial version
carl
parents:
diff changeset
1300 no/*-*-irix* | /*-*-irix*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1301 compile_command="$compile_command $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1302 finalize_command="$finalize_command $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1303 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1304 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1305 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1306 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1307
45c8592d5d13 initial version
carl
parents:
diff changeset
1308 -L*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1309 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1310 # We need an absolute path.
45c8592d5d13 initial version
carl
parents:
diff changeset
1311 case $dir in
45c8592d5d13 initial version
carl
parents:
diff changeset
1312 [\\/]* | [A-Za-z]:[\\/]*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1313 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1314 absdir=`cd "$dir" && pwd`
45c8592d5d13 initial version
carl
parents:
diff changeset
1315 if test -z "$absdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1316 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1317 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1318 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1319 dir="$absdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
1320 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1321 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1322 case "$deplibs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
1323 *" -L$dir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1324 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1325 deplibs="$deplibs -L$dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
1326 lib_search_path="$lib_search_path $dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
1327 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1328 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1329 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
1330 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1331 case :$dllsearchpath: in
45c8592d5d13 initial version
carl
parents:
diff changeset
1332 *":$dir:"*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1333 *) dllsearchpath="$dllsearchpath:$dir";;
45c8592d5d13 initial version
carl
parents:
diff changeset
1334 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1335 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1336 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1337 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1338 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1339
45c8592d5d13 initial version
carl
parents:
diff changeset
1340 -l*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1341 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1342 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
1343 *-*-cygwin* | *-*-pw32* | *-*-beos*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1344 # These systems don't actually have a C or math library (as such)
45c8592d5d13 initial version
carl
parents:
diff changeset
1345 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1346 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1347 *-*-mingw* | *-*-os2*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1348 # These systems don't actually have a C library (as such)
45c8592d5d13 initial version
carl
parents:
diff changeset
1349 test "X$arg" = "X-lc" && continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1350 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1351 *-*-openbsd* | *-*-freebsd*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1352 # Do not include libc due to us having libc/libc_r.
45c8592d5d13 initial version
carl
parents:
diff changeset
1353 test "X$arg" = "X-lc" && continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1354 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1355 *-*-rhapsody* | *-*-darwin1.[012])
45c8592d5d13 initial version
carl
parents:
diff changeset
1356 # Rhapsody C and math libraries are in the System framework
45c8592d5d13 initial version
carl
parents:
diff changeset
1357 deplibs="$deplibs -framework System"
45c8592d5d13 initial version
carl
parents:
diff changeset
1358 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1359 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1360 elif test "X$arg" = "X-lc_r"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1361 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
1362 *-*-openbsd* | *-*-freebsd*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1363 # Do not include libc_r directly, use -pthread flag.
45c8592d5d13 initial version
carl
parents:
diff changeset
1364 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1365 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1366 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1367 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1368 deplibs="$deplibs $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1369 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1370 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1371
45c8592d5d13 initial version
carl
parents:
diff changeset
1372 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
45c8592d5d13 initial version
carl
parents:
diff changeset
1373 deplibs="$deplibs $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1374 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1375 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1376
45c8592d5d13 initial version
carl
parents:
diff changeset
1377 -module)
45c8592d5d13 initial version
carl
parents:
diff changeset
1378 module=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1379 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1380 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1381
45c8592d5d13 initial version
carl
parents:
diff changeset
1382 # gcc -m* arguments should be passed to the linker via $compiler_flags
45c8592d5d13 initial version
carl
parents:
diff changeset
1383 # in order to pass architecture information to the linker
45c8592d5d13 initial version
carl
parents:
diff changeset
1384 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
45c8592d5d13 initial version
carl
parents:
diff changeset
1385 # but this is not reliable with gcc because gcc may use -mfoo to
45c8592d5d13 initial version
carl
parents:
diff changeset
1386 # select a different linker, different libraries, etc, while
45c8592d5d13 initial version
carl
parents:
diff changeset
1387 # -Wl,-mfoo simply passes -mfoo to the linker.
45c8592d5d13 initial version
carl
parents:
diff changeset
1388 -m*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1389 # Unknown arguments in both finalize_command and compile_command need
45c8592d5d13 initial version
carl
parents:
diff changeset
1390 # to be aesthetically quoted because they are evaled later.
45c8592d5d13 initial version
carl
parents:
diff changeset
1391 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
1392 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
1393 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
1394 arg="\"$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
1395 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1396 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1397 compile_command="$compile_command $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1398 finalize_command="$finalize_command $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1399 if test "$with_gcc" = "yes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1400 compiler_flags="$compiler_flags $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1401 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1402 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1403 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1404
45c8592d5d13 initial version
carl
parents:
diff changeset
1405 -shrext)
45c8592d5d13 initial version
carl
parents:
diff changeset
1406 prev=shrext
45c8592d5d13 initial version
carl
parents:
diff changeset
1407 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1408 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1409
45c8592d5d13 initial version
carl
parents:
diff changeset
1410 -no-fast-install)
45c8592d5d13 initial version
carl
parents:
diff changeset
1411 fast_install=no
45c8592d5d13 initial version
carl
parents:
diff changeset
1412 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1413 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1414
45c8592d5d13 initial version
carl
parents:
diff changeset
1415 -no-install)
45c8592d5d13 initial version
carl
parents:
diff changeset
1416 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
1417 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1418 # The PATH hackery in wrapper scripts is required on Windows
45c8592d5d13 initial version
carl
parents:
diff changeset
1419 # in order for the loader to find any dlls it needs.
45c8592d5d13 initial version
carl
parents:
diff changeset
1420 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1421 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1422 fast_install=no
45c8592d5d13 initial version
carl
parents:
diff changeset
1423 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1424 *) no_install=yes ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1425 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1426 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1427 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1428
45c8592d5d13 initial version
carl
parents:
diff changeset
1429 -no-undefined)
45c8592d5d13 initial version
carl
parents:
diff changeset
1430 allow_undefined=no
45c8592d5d13 initial version
carl
parents:
diff changeset
1431 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1432 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1433
45c8592d5d13 initial version
carl
parents:
diff changeset
1434 -objectlist)
45c8592d5d13 initial version
carl
parents:
diff changeset
1435 prev=objectlist
45c8592d5d13 initial version
carl
parents:
diff changeset
1436 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1437 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1438
45c8592d5d13 initial version
carl
parents:
diff changeset
1439 -o) prev=output ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1440
45c8592d5d13 initial version
carl
parents:
diff changeset
1441 -precious-files-regex)
45c8592d5d13 initial version
carl
parents:
diff changeset
1442 prev=precious_regex
45c8592d5d13 initial version
carl
parents:
diff changeset
1443 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1444 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1445
45c8592d5d13 initial version
carl
parents:
diff changeset
1446 -release)
45c8592d5d13 initial version
carl
parents:
diff changeset
1447 prev=release
45c8592d5d13 initial version
carl
parents:
diff changeset
1448 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1449 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1450
45c8592d5d13 initial version
carl
parents:
diff changeset
1451 -rpath)
45c8592d5d13 initial version
carl
parents:
diff changeset
1452 prev=rpath
45c8592d5d13 initial version
carl
parents:
diff changeset
1453 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1454 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1455
45c8592d5d13 initial version
carl
parents:
diff changeset
1456 -R)
45c8592d5d13 initial version
carl
parents:
diff changeset
1457 prev=xrpath
45c8592d5d13 initial version
carl
parents:
diff changeset
1458 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1459 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1460
45c8592d5d13 initial version
carl
parents:
diff changeset
1461 -R*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1462 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1463 # We need an absolute path.
45c8592d5d13 initial version
carl
parents:
diff changeset
1464 case $dir in
45c8592d5d13 initial version
carl
parents:
diff changeset
1465 [\\/]* | [A-Za-z]:[\\/]*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1466 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1467 $echo "$modename: only absolute run-paths are allowed" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1468 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1469 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1470 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1471 case "$xrpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
1472 *" $dir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1473 *) xrpath="$xrpath $dir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1474 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1475 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1476 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1477
45c8592d5d13 initial version
carl
parents:
diff changeset
1478 -static)
45c8592d5d13 initial version
carl
parents:
diff changeset
1479 # The effects of -static are defined in a previous loop.
45c8592d5d13 initial version
carl
parents:
diff changeset
1480 # We used to do the same as -all-static on platforms that
45c8592d5d13 initial version
carl
parents:
diff changeset
1481 # didn't have a PIC flag, but the assumption that the effects
45c8592d5d13 initial version
carl
parents:
diff changeset
1482 # would be equivalent was wrong. It would break on at least
45c8592d5d13 initial version
carl
parents:
diff changeset
1483 # Digital Unix and AIX.
45c8592d5d13 initial version
carl
parents:
diff changeset
1484 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1485 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1486
45c8592d5d13 initial version
carl
parents:
diff changeset
1487 -thread-safe)
45c8592d5d13 initial version
carl
parents:
diff changeset
1488 thread_safe=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1489 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1490 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1491
45c8592d5d13 initial version
carl
parents:
diff changeset
1492 -version-info)
45c8592d5d13 initial version
carl
parents:
diff changeset
1493 prev=vinfo
45c8592d5d13 initial version
carl
parents:
diff changeset
1494 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1495 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1496 -version-number)
45c8592d5d13 initial version
carl
parents:
diff changeset
1497 prev=vinfo
45c8592d5d13 initial version
carl
parents:
diff changeset
1498 vinfo_number=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1499 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1500 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1501
45c8592d5d13 initial version
carl
parents:
diff changeset
1502 -Wc,*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1503 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1504 arg=
45c8592d5d13 initial version
carl
parents:
diff changeset
1505 save_ifs="$IFS"; IFS=','
45c8592d5d13 initial version
carl
parents:
diff changeset
1506 for flag in $args; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1507 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1508 case $flag in
45c8592d5d13 initial version
carl
parents:
diff changeset
1509 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
1510 flag="\"$flag\""
45c8592d5d13 initial version
carl
parents:
diff changeset
1511 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1512 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1513 arg="$arg $wl$flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
1514 compiler_flags="$compiler_flags $flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
1515 done
45c8592d5d13 initial version
carl
parents:
diff changeset
1516 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1517 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
45c8592d5d13 initial version
carl
parents:
diff changeset
1518 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1519
45c8592d5d13 initial version
carl
parents:
diff changeset
1520 -Wl,*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1521 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1522 arg=
45c8592d5d13 initial version
carl
parents:
diff changeset
1523 save_ifs="$IFS"; IFS=','
45c8592d5d13 initial version
carl
parents:
diff changeset
1524 for flag in $args; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1525 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1526 case $flag in
45c8592d5d13 initial version
carl
parents:
diff changeset
1527 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
1528 flag="\"$flag\""
45c8592d5d13 initial version
carl
parents:
diff changeset
1529 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1530 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1531 arg="$arg $wl$flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
1532 compiler_flags="$compiler_flags $wl$flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
1533 linker_flags="$linker_flags $flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
1534 done
45c8592d5d13 initial version
carl
parents:
diff changeset
1535 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1536 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
45c8592d5d13 initial version
carl
parents:
diff changeset
1537 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1538
45c8592d5d13 initial version
carl
parents:
diff changeset
1539 -Xcompiler)
45c8592d5d13 initial version
carl
parents:
diff changeset
1540 prev=xcompiler
45c8592d5d13 initial version
carl
parents:
diff changeset
1541 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1542 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1543
45c8592d5d13 initial version
carl
parents:
diff changeset
1544 -Xlinker)
45c8592d5d13 initial version
carl
parents:
diff changeset
1545 prev=xlinker
45c8592d5d13 initial version
carl
parents:
diff changeset
1546 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1547 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1548
45c8592d5d13 initial version
carl
parents:
diff changeset
1549 -XCClinker)
45c8592d5d13 initial version
carl
parents:
diff changeset
1550 prev=xcclinker
45c8592d5d13 initial version
carl
parents:
diff changeset
1551 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1552 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1553
45c8592d5d13 initial version
carl
parents:
diff changeset
1554 # Some other compiler flag.
45c8592d5d13 initial version
carl
parents:
diff changeset
1555 -* | +*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1556 # Unknown arguments in both finalize_command and compile_command need
45c8592d5d13 initial version
carl
parents:
diff changeset
1557 # to be aesthetically quoted because they are evaled later.
45c8592d5d13 initial version
carl
parents:
diff changeset
1558 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
1559 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
1560 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
1561 arg="\"$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
1562 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1563 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1564 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1565
45c8592d5d13 initial version
carl
parents:
diff changeset
1566 *.$objext)
45c8592d5d13 initial version
carl
parents:
diff changeset
1567 # A standard object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1568 objs="$objs $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1569 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1570
45c8592d5d13 initial version
carl
parents:
diff changeset
1571 *.lo)
45c8592d5d13 initial version
carl
parents:
diff changeset
1572 # A libtool-controlled object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1573
45c8592d5d13 initial version
carl
parents:
diff changeset
1574 # Check to see that this really is a libtool object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1575 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1576 pic_object=
45c8592d5d13 initial version
carl
parents:
diff changeset
1577 non_pic_object=
45c8592d5d13 initial version
carl
parents:
diff changeset
1578
45c8592d5d13 initial version
carl
parents:
diff changeset
1579 # Read the .lo file
45c8592d5d13 initial version
carl
parents:
diff changeset
1580 # If there is no directory component, then add one.
45c8592d5d13 initial version
carl
parents:
diff changeset
1581 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
1582 */* | *\\*) . $arg ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1583 *) . ./$arg ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1584 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1585
45c8592d5d13 initial version
carl
parents:
diff changeset
1586 if test -z "$pic_object" || \
45c8592d5d13 initial version
carl
parents:
diff changeset
1587 test -z "$non_pic_object" ||
45c8592d5d13 initial version
carl
parents:
diff changeset
1588 test "$pic_object" = none && \
45c8592d5d13 initial version
carl
parents:
diff changeset
1589 test "$non_pic_object" = none; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1590 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1591 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1592 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1593
45c8592d5d13 initial version
carl
parents:
diff changeset
1594 # Extract subdirectory from the argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
1595 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1596 if test "X$xdir" = "X$arg"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1597 xdir=
45c8592d5d13 initial version
carl
parents:
diff changeset
1598 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1599 xdir="$xdir/"
45c8592d5d13 initial version
carl
parents:
diff changeset
1600 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1601
45c8592d5d13 initial version
carl
parents:
diff changeset
1602 if test "$pic_object" != none; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1603 # Prepend the subdirectory the object is found in.
45c8592d5d13 initial version
carl
parents:
diff changeset
1604 pic_object="$xdir$pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1605
45c8592d5d13 initial version
carl
parents:
diff changeset
1606 if test "$prev" = dlfiles; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1607 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1608 dlfiles="$dlfiles $pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1609 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1610 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1611 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1612 # If libtool objects are unsupported, then we need to preload.
45c8592d5d13 initial version
carl
parents:
diff changeset
1613 prev=dlprefiles
45c8592d5d13 initial version
carl
parents:
diff changeset
1614 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1615 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1616
45c8592d5d13 initial version
carl
parents:
diff changeset
1617 # CHECK ME: I think I busted this. -Ossama
45c8592d5d13 initial version
carl
parents:
diff changeset
1618 if test "$prev" = dlprefiles; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1619 # Preload the old-style object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1620 dlprefiles="$dlprefiles $pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1621 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1622 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1623
45c8592d5d13 initial version
carl
parents:
diff changeset
1624 # A PIC object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1625 libobjs="$libobjs $pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1626 arg="$pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1627 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1628
45c8592d5d13 initial version
carl
parents:
diff changeset
1629 # Non-PIC object.
45c8592d5d13 initial version
carl
parents:
diff changeset
1630 if test "$non_pic_object" != none; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1631 # Prepend the subdirectory the object is found in.
45c8592d5d13 initial version
carl
parents:
diff changeset
1632 non_pic_object="$xdir$non_pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1633
45c8592d5d13 initial version
carl
parents:
diff changeset
1634 # A standard non-PIC object
45c8592d5d13 initial version
carl
parents:
diff changeset
1635 non_pic_objects="$non_pic_objects $non_pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1636 if test -z "$pic_object" || test "$pic_object" = none ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1637 arg="$non_pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1638 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1639 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1640 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1641 # Only an error if not doing a dry-run.
45c8592d5d13 initial version
carl
parents:
diff changeset
1642 if test -z "$run"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1643 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1644 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1645 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1646 # Dry-run case.
45c8592d5d13 initial version
carl
parents:
diff changeset
1647
45c8592d5d13 initial version
carl
parents:
diff changeset
1648 # Extract subdirectory from the argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
1649 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1650 if test "X$xdir" = "X$arg"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1651 xdir=
45c8592d5d13 initial version
carl
parents:
diff changeset
1652 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1653 xdir="$xdir/"
45c8592d5d13 initial version
carl
parents:
diff changeset
1654 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1655
45c8592d5d13 initial version
carl
parents:
diff changeset
1656 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
45c8592d5d13 initial version
carl
parents:
diff changeset
1657 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
45c8592d5d13 initial version
carl
parents:
diff changeset
1658 libobjs="$libobjs $pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1659 non_pic_objects="$non_pic_objects $non_pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
1660 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1661 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1662 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1663
45c8592d5d13 initial version
carl
parents:
diff changeset
1664 *.$libext)
45c8592d5d13 initial version
carl
parents:
diff changeset
1665 # An archive.
45c8592d5d13 initial version
carl
parents:
diff changeset
1666 deplibs="$deplibs $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1667 old_deplibs="$old_deplibs $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1668 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1669 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1670
45c8592d5d13 initial version
carl
parents:
diff changeset
1671 *.la)
45c8592d5d13 initial version
carl
parents:
diff changeset
1672 # A libtool-controlled library.
45c8592d5d13 initial version
carl
parents:
diff changeset
1673
45c8592d5d13 initial version
carl
parents:
diff changeset
1674 if test "$prev" = dlfiles; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1675 # This library was specified with -dlopen.
45c8592d5d13 initial version
carl
parents:
diff changeset
1676 dlfiles="$dlfiles $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1677 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1678 elif test "$prev" = dlprefiles; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1679 # The library was specified with -dlpreopen.
45c8592d5d13 initial version
carl
parents:
diff changeset
1680 dlprefiles="$dlprefiles $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1681 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
1682 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1683 deplibs="$deplibs $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1684 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1685 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1686 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1687
45c8592d5d13 initial version
carl
parents:
diff changeset
1688 # Some other compiler argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
1689 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1690 # Unknown arguments in both finalize_command and compile_command need
45c8592d5d13 initial version
carl
parents:
diff changeset
1691 # to be aesthetically quoted because they are evaled later.
45c8592d5d13 initial version
carl
parents:
diff changeset
1692 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
1693 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
1694 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
45c8592d5d13 initial version
carl
parents:
diff changeset
1695 arg="\"$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
1696 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1697 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1698 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1699 esac # arg
45c8592d5d13 initial version
carl
parents:
diff changeset
1700
45c8592d5d13 initial version
carl
parents:
diff changeset
1701 # Now actually substitute the argument into the commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
1702 if test -n "$arg"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1703 compile_command="$compile_command $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1704 finalize_command="$finalize_command $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1705 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1706 done # argument parsing loop
45c8592d5d13 initial version
carl
parents:
diff changeset
1707
45c8592d5d13 initial version
carl
parents:
diff changeset
1708 if test -n "$prev"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1709 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1710 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1711 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1712 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1713
45c8592d5d13 initial version
carl
parents:
diff changeset
1714 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1715 eval arg=\"$export_dynamic_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
1716 compile_command="$compile_command $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1717 finalize_command="$finalize_command $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
1718 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1719
45c8592d5d13 initial version
carl
parents:
diff changeset
1720 oldlibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1721 # calculate the name of the file, without its directory
45c8592d5d13 initial version
carl
parents:
diff changeset
1722 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1723 libobjs_save="$libobjs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1724
45c8592d5d13 initial version
carl
parents:
diff changeset
1725 if test -n "$shlibpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1726 # get the directories listed in $shlibpath_var
45c8592d5d13 initial version
carl
parents:
diff changeset
1727 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
45c8592d5d13 initial version
carl
parents:
diff changeset
1728 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1729 shlib_search_path=
45c8592d5d13 initial version
carl
parents:
diff changeset
1730 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1731 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
1732 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
1733
45c8592d5d13 initial version
carl
parents:
diff changeset
1734 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1735 if test "X$output_objdir" = "X$output"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1736 output_objdir="$objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
1737 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1738 output_objdir="$output_objdir/$objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
1739 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1740 # Create the object directory.
45c8592d5d13 initial version
carl
parents:
diff changeset
1741 if test ! -d "$output_objdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1742 $show "$mkdir $output_objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
1743 $run $mkdir $output_objdir
45c8592d5d13 initial version
carl
parents:
diff changeset
1744 status=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
1745 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1746 exit $status
45c8592d5d13 initial version
carl
parents:
diff changeset
1747 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1748 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1749
45c8592d5d13 initial version
carl
parents:
diff changeset
1750 # Determine the type of output
45c8592d5d13 initial version
carl
parents:
diff changeset
1751 case $output in
45c8592d5d13 initial version
carl
parents:
diff changeset
1752 "")
45c8592d5d13 initial version
carl
parents:
diff changeset
1753 $echo "$modename: you must specify an output file" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1754 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1755 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1756 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1757 *.$libext) linkmode=oldlib ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1758 *.lo | *.$objext) linkmode=obj ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1759 *.la) linkmode=lib ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1760 *) linkmode=prog ;; # Anything else should be a program.
45c8592d5d13 initial version
carl
parents:
diff changeset
1761 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1762
45c8592d5d13 initial version
carl
parents:
diff changeset
1763 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
1764 *cygwin* | *mingw* | *pw32*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1765 # don't eliminate duplications in $postdeps and $predeps
45c8592d5d13 initial version
carl
parents:
diff changeset
1766 duplicate_compiler_generated_deps=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1767 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1768 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1769 duplicate_compiler_generated_deps=$duplicate_deps
45c8592d5d13 initial version
carl
parents:
diff changeset
1770 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1771 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1772 specialdeplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1773
45c8592d5d13 initial version
carl
parents:
diff changeset
1774 libs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1775 # Find all interdependent deplibs by searching for libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
1776 # that are linked more than once (e.g. -la -lb -la)
45c8592d5d13 initial version
carl
parents:
diff changeset
1777 for deplib in $deplibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1778 if test "X$duplicate_deps" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1779 case "$libs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
1780 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1781 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1782 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1783 libs="$libs $deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
1784 done
45c8592d5d13 initial version
carl
parents:
diff changeset
1785
45c8592d5d13 initial version
carl
parents:
diff changeset
1786 if test "$linkmode" = lib; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1787 libs="$predeps $libs $compiler_lib_search_path $postdeps"
45c8592d5d13 initial version
carl
parents:
diff changeset
1788
45c8592d5d13 initial version
carl
parents:
diff changeset
1789 # Compute libraries that are listed more than once in $predeps
45c8592d5d13 initial version
carl
parents:
diff changeset
1790 # $postdeps and mark them as special (i.e., whose duplicates are
45c8592d5d13 initial version
carl
parents:
diff changeset
1791 # not to be eliminated).
45c8592d5d13 initial version
carl
parents:
diff changeset
1792 pre_post_deps=
45c8592d5d13 initial version
carl
parents:
diff changeset
1793 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1794 for pre_post_dep in $predeps $postdeps; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1795 case "$pre_post_deps " in
45c8592d5d13 initial version
carl
parents:
diff changeset
1796 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1797 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1798 pre_post_deps="$pre_post_deps $pre_post_dep"
45c8592d5d13 initial version
carl
parents:
diff changeset
1799 done
45c8592d5d13 initial version
carl
parents:
diff changeset
1800 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1801 pre_post_deps=
45c8592d5d13 initial version
carl
parents:
diff changeset
1802 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1803
45c8592d5d13 initial version
carl
parents:
diff changeset
1804 deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1805 newdependency_libs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1806 newlib_search_path=
45c8592d5d13 initial version
carl
parents:
diff changeset
1807 need_relink=no # whether we're linking any uninstalled libtool libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
1808 notinst_deplibs= # not-installed libtool libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
1809 notinst_path= # paths that contain not-installed libtool libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
1810 case $linkmode in
45c8592d5d13 initial version
carl
parents:
diff changeset
1811 lib)
45c8592d5d13 initial version
carl
parents:
diff changeset
1812 passes="conv link"
45c8592d5d13 initial version
carl
parents:
diff changeset
1813 for file in $dlfiles $dlprefiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1814 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
1815 *.la) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1816 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1817 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1818 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
1819 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1820 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1821 done
45c8592d5d13 initial version
carl
parents:
diff changeset
1822 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1823 prog)
45c8592d5d13 initial version
carl
parents:
diff changeset
1824 compile_deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1825 finalize_deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1826 alldeplibs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
1827 newdlfiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
1828 newdlprefiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
1829 passes="conv scan dlopen dlpreopen link"
45c8592d5d13 initial version
carl
parents:
diff changeset
1830 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1831 *) passes="conv"
45c8592d5d13 initial version
carl
parents:
diff changeset
1832 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1833 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1834 for pass in $passes; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1835 if test "$linkmode,$pass" = "lib,link" ||
45c8592d5d13 initial version
carl
parents:
diff changeset
1836 test "$linkmode,$pass" = "prog,scan"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1837 libs="$deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1838 deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1839 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1840 if test "$linkmode" = prog; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1841 case $pass in
45c8592d5d13 initial version
carl
parents:
diff changeset
1842 dlopen) libs="$dlfiles" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1843 dlpreopen) libs="$dlprefiles" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1844 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1845 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1846 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1847 if test "$pass" = dlopen; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1848 # Collect dlpreopened libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
1849 save_deplibs="$deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1850 deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
1851 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1852 for deplib in $libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1853 lib=
45c8592d5d13 initial version
carl
parents:
diff changeset
1854 found=no
45c8592d5d13 initial version
carl
parents:
diff changeset
1855 case $deplib in
45c8592d5d13 initial version
carl
parents:
diff changeset
1856 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
45c8592d5d13 initial version
carl
parents:
diff changeset
1857 if test "$linkmode,$pass" = "prog,link"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1858 compile_deplibs="$deplib $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1859 finalize_deplibs="$deplib $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1860 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1861 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1862 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1863 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1864 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1865 -l*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1866 if test "$linkmode" != lib && test "$linkmode" != prog; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1867 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1868 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1869 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1870 if test "$pass" = conv; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1871 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1872 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1873 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1874 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1875 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1876 for search_ext in .la $std_shrext .so .a; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1877 # Search the libtool library
45c8592d5d13 initial version
carl
parents:
diff changeset
1878 lib="$searchdir/lib${name}${search_ext}"
45c8592d5d13 initial version
carl
parents:
diff changeset
1879 if test -f "$lib"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1880 if test "$search_ext" = ".la"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1881 found=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
1882 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1883 found=no
45c8592d5d13 initial version
carl
parents:
diff changeset
1884 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1885 break 2
45c8592d5d13 initial version
carl
parents:
diff changeset
1886 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1887 done
45c8592d5d13 initial version
carl
parents:
diff changeset
1888 done
45c8592d5d13 initial version
carl
parents:
diff changeset
1889 if test "$found" != yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1890 # deplib doesn't seem to be a libtool library
45c8592d5d13 initial version
carl
parents:
diff changeset
1891 if test "$linkmode,$pass" = "prog,link"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1892 compile_deplibs="$deplib $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1893 finalize_deplibs="$deplib $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1894 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1895 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1896 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1897 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1898 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1899 else # deplib is a libtool library
45c8592d5d13 initial version
carl
parents:
diff changeset
1900 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
45c8592d5d13 initial version
carl
parents:
diff changeset
1901 # We need to do some special things here, and not later.
45c8592d5d13 initial version
carl
parents:
diff changeset
1902 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1903 case " $predeps $postdeps " in
45c8592d5d13 initial version
carl
parents:
diff changeset
1904 *" $deplib "*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1905 if (${SED} -e '2q' $lib |
45c8592d5d13 initial version
carl
parents:
diff changeset
1906 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1907 library_names=
45c8592d5d13 initial version
carl
parents:
diff changeset
1908 old_library=
45c8592d5d13 initial version
carl
parents:
diff changeset
1909 case $lib in
45c8592d5d13 initial version
carl
parents:
diff changeset
1910 */* | *\\*) . $lib ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1911 *) . ./$lib ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1912 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1913 for l in $old_library $library_names; do
45c8592d5d13 initial version
carl
parents:
diff changeset
1914 ll="$l"
45c8592d5d13 initial version
carl
parents:
diff changeset
1915 done
45c8592d5d13 initial version
carl
parents:
diff changeset
1916 if test "X$ll" = "X$old_library" ; then # only static version available
45c8592d5d13 initial version
carl
parents:
diff changeset
1917 found=no
45c8592d5d13 initial version
carl
parents:
diff changeset
1918 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1919 test "X$ladir" = "X$lib" && ladir="."
45c8592d5d13 initial version
carl
parents:
diff changeset
1920 lib=$ladir/$old_library
45c8592d5d13 initial version
carl
parents:
diff changeset
1921 if test "$linkmode,$pass" = "prog,link"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1922 compile_deplibs="$deplib $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1923 finalize_deplibs="$deplib $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1924 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1925 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1926 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1927 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1928 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1929 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1930 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1931 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1932 *) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1933 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1934 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1935 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1936 ;; # -l
45c8592d5d13 initial version
carl
parents:
diff changeset
1937 -L*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1938 case $linkmode in
45c8592d5d13 initial version
carl
parents:
diff changeset
1939 lib)
45c8592d5d13 initial version
carl
parents:
diff changeset
1940 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1941 test "$pass" = conv && continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1942 newdependency_libs="$deplib $newdependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1943 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1944 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1945 prog)
45c8592d5d13 initial version
carl
parents:
diff changeset
1946 if test "$pass" = conv; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1947 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1948 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1949 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1950 if test "$pass" = scan; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1951 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1952 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1953 compile_deplibs="$deplib $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1954 finalize_deplibs="$deplib $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1955 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1956 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1957 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1958 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
1959 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
1960 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1961 esac # linkmode
45c8592d5d13 initial version
carl
parents:
diff changeset
1962 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1963 ;; # -L
45c8592d5d13 initial version
carl
parents:
diff changeset
1964 -R*)
45c8592d5d13 initial version
carl
parents:
diff changeset
1965 if test "$pass" = link; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1966 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
1967 # Make sure the xrpath contains only unique directories.
45c8592d5d13 initial version
carl
parents:
diff changeset
1968 case "$xrpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
1969 *" $dir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1970 *) xrpath="$xrpath $dir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1971 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
1972 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1973 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1974 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1975 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1976 *.la) lib="$deplib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
1977 *.$libext)
45c8592d5d13 initial version
carl
parents:
diff changeset
1978 if test "$pass" = conv; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1979 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1980 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1981 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1982 case $linkmode in
45c8592d5d13 initial version
carl
parents:
diff changeset
1983 lib)
45c8592d5d13 initial version
carl
parents:
diff changeset
1984 if test "$deplibs_check_method" != pass_all; then
45c8592d5d13 initial version
carl
parents:
diff changeset
1985 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
1986 $echo "*** Warning: Trying to link with static lib archive $deplib."
45c8592d5d13 initial version
carl
parents:
diff changeset
1987 $echo "*** I have the capability to make that library automatically link in when"
45c8592d5d13 initial version
carl
parents:
diff changeset
1988 $echo "*** you link to this library. But I can only do this if you have a"
45c8592d5d13 initial version
carl
parents:
diff changeset
1989 $echo "*** shared version of the library, which you do not appear to have"
45c8592d5d13 initial version
carl
parents:
diff changeset
1990 $echo "*** because the file extensions .$libext of this argument makes me believe"
45c8592d5d13 initial version
carl
parents:
diff changeset
1991 $echo "*** that it is just a static archive that I should not used here."
45c8592d5d13 initial version
carl
parents:
diff changeset
1992 else
45c8592d5d13 initial version
carl
parents:
diff changeset
1993 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
1994 $echo "*** Warning: Linking the shared library $output against the"
45c8592d5d13 initial version
carl
parents:
diff changeset
1995 $echo "*** static library $deplib is not portable!"
45c8592d5d13 initial version
carl
parents:
diff changeset
1996 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
1997 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
1998 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
1999 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2000 prog)
45c8592d5d13 initial version
carl
parents:
diff changeset
2001 if test "$pass" != link; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2002 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2003 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2004 compile_deplibs="$deplib $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2005 finalize_deplibs="$deplib $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2006 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2007 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
2008 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2009 esac # linkmode
45c8592d5d13 initial version
carl
parents:
diff changeset
2010 ;; # *.$libext
45c8592d5d13 initial version
carl
parents:
diff changeset
2011 *.lo | *.$objext)
45c8592d5d13 initial version
carl
parents:
diff changeset
2012 if test "$pass" = conv; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2013 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2014 elif test "$linkmode" = prog; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2015 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2016 # If there is no dlopen support or we're linking statically,
45c8592d5d13 initial version
carl
parents:
diff changeset
2017 # we need to preload.
45c8592d5d13 initial version
carl
parents:
diff changeset
2018 newdlprefiles="$newdlprefiles $deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2019 compile_deplibs="$deplib $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2020 finalize_deplibs="$deplib $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2021 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2022 newdlfiles="$newdlfiles $deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2023 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2024 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2025 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
2026 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2027 %DEPLIBS%)
45c8592d5d13 initial version
carl
parents:
diff changeset
2028 alldeplibs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
2029 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
2030 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2031 esac # case $deplib
45c8592d5d13 initial version
carl
parents:
diff changeset
2032 if test "$found" = yes || test -f "$lib"; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
2033 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2034 $echo "$modename: cannot find the library \`$lib'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2035 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2036 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2037
45c8592d5d13 initial version
carl
parents:
diff changeset
2038 # Check to see that this really is a libtool archive.
45c8592d5d13 initial version
carl
parents:
diff changeset
2039 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
2040 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2041 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2042 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2043 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2044
45c8592d5d13 initial version
carl
parents:
diff changeset
2045 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
2046 test "X$ladir" = "X$lib" && ladir="."
45c8592d5d13 initial version
carl
parents:
diff changeset
2047
45c8592d5d13 initial version
carl
parents:
diff changeset
2048 dlname=
45c8592d5d13 initial version
carl
parents:
diff changeset
2049 dlopen=
45c8592d5d13 initial version
carl
parents:
diff changeset
2050 dlpreopen=
45c8592d5d13 initial version
carl
parents:
diff changeset
2051 libdir=
45c8592d5d13 initial version
carl
parents:
diff changeset
2052 library_names=
45c8592d5d13 initial version
carl
parents:
diff changeset
2053 old_library=
45c8592d5d13 initial version
carl
parents:
diff changeset
2054 # If the library was installed with an old release of libtool,
45c8592d5d13 initial version
carl
parents:
diff changeset
2055 # it will not redefine variables installed, or shouldnotlink
45c8592d5d13 initial version
carl
parents:
diff changeset
2056 installed=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
2057 shouldnotlink=no
45c8592d5d13 initial version
carl
parents:
diff changeset
2058
45c8592d5d13 initial version
carl
parents:
diff changeset
2059 # Read the .la file
45c8592d5d13 initial version
carl
parents:
diff changeset
2060 case $lib in
45c8592d5d13 initial version
carl
parents:
diff changeset
2061 */* | *\\*) . $lib ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2062 *) . ./$lib ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2063 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2064
45c8592d5d13 initial version
carl
parents:
diff changeset
2065 if test "$linkmode,$pass" = "lib,link" ||
45c8592d5d13 initial version
carl
parents:
diff changeset
2066 test "$linkmode,$pass" = "prog,scan" ||
45c8592d5d13 initial version
carl
parents:
diff changeset
2067 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2068 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
45c8592d5d13 initial version
carl
parents:
diff changeset
2069 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
45c8592d5d13 initial version
carl
parents:
diff changeset
2070 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2071
45c8592d5d13 initial version
carl
parents:
diff changeset
2072 if test "$pass" = conv; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2073 # Only check for convenience libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
2074 deplibs="$lib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2075 if test -z "$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2076 if test -z "$old_library"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2077 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2078 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2079 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2080 # It is a libtool convenience library, so add in its objects.
45c8592d5d13 initial version
carl
parents:
diff changeset
2081 convenience="$convenience $ladir/$objdir/$old_library"
45c8592d5d13 initial version
carl
parents:
diff changeset
2082 old_convenience="$old_convenience $ladir/$objdir/$old_library"
45c8592d5d13 initial version
carl
parents:
diff changeset
2083 tmp_libs=
45c8592d5d13 initial version
carl
parents:
diff changeset
2084 for deplib in $dependency_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2085 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2086 if test "X$duplicate_deps" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2087 case "$tmp_libs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2088 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2089 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2090 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2091 tmp_libs="$tmp_libs $deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2092 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2093 elif test "$linkmode" != prog && test "$linkmode" != lib; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2094 $echo "$modename: \`$lib' is not a convenience library" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2095 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2096 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2097 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
2098 fi # $pass = conv
45c8592d5d13 initial version
carl
parents:
diff changeset
2099
45c8592d5d13 initial version
carl
parents:
diff changeset
2100
45c8592d5d13 initial version
carl
parents:
diff changeset
2101 # Get the name of the library we link against.
45c8592d5d13 initial version
carl
parents:
diff changeset
2102 linklib=
45c8592d5d13 initial version
carl
parents:
diff changeset
2103 for l in $old_library $library_names; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2104 linklib="$l"
45c8592d5d13 initial version
carl
parents:
diff changeset
2105 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2106 if test -z "$linklib"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2107 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2108 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2109 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2110
45c8592d5d13 initial version
carl
parents:
diff changeset
2111 # This library was specified with -dlopen.
45c8592d5d13 initial version
carl
parents:
diff changeset
2112 if test "$pass" = dlopen; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2113 if test -z "$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2114 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2115 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2116 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2117 if test -z "$dlname" ||
45c8592d5d13 initial version
carl
parents:
diff changeset
2118 test "$dlopen_support" != yes ||
45c8592d5d13 initial version
carl
parents:
diff changeset
2119 test "$build_libtool_libs" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2120 # If there is no dlname, no dlopen support or we're linking
45c8592d5d13 initial version
carl
parents:
diff changeset
2121 # statically, we need to preload. We also need to preload any
45c8592d5d13 initial version
carl
parents:
diff changeset
2122 # dependent libraries so libltdl's deplib preloader doesn't
45c8592d5d13 initial version
carl
parents:
diff changeset
2123 # bomb out in the load deplibs phase.
45c8592d5d13 initial version
carl
parents:
diff changeset
2124 dlprefiles="$dlprefiles $lib $dependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2125 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2126 newdlfiles="$newdlfiles $lib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2127 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2128 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
2129 fi # $pass = dlopen
45c8592d5d13 initial version
carl
parents:
diff changeset
2130
45c8592d5d13 initial version
carl
parents:
diff changeset
2131 # We need an absolute path.
45c8592d5d13 initial version
carl
parents:
diff changeset
2132 case $ladir in
45c8592d5d13 initial version
carl
parents:
diff changeset
2133 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2134 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2135 abs_ladir=`cd "$ladir" && pwd`
45c8592d5d13 initial version
carl
parents:
diff changeset
2136 if test -z "$abs_ladir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2137 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2138 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2139 abs_ladir="$ladir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2140 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2141 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2142 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2143 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
2144
45c8592d5d13 initial version
carl
parents:
diff changeset
2145 # Find the relevant object directory and library name.
45c8592d5d13 initial version
carl
parents:
diff changeset
2146 if test "X$installed" = Xyes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2147 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2148 $echo "$modename: warning: library \`$lib' was moved." 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2149 dir="$ladir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2150 absdir="$abs_ladir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2151 libdir="$abs_ladir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2152 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2153 dir="$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2154 absdir="$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2155 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2156 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2157 dir="$ladir/$objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2158 absdir="$abs_ladir/$objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2159 # Remove this search path later
45c8592d5d13 initial version
carl
parents:
diff changeset
2160 notinst_path="$notinst_path $abs_ladir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2161 fi # $installed = yes
45c8592d5d13 initial version
carl
parents:
diff changeset
2162 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
2163
45c8592d5d13 initial version
carl
parents:
diff changeset
2164 # This library was specified with -dlpreopen.
45c8592d5d13 initial version
carl
parents:
diff changeset
2165 if test "$pass" = dlpreopen; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2166 if test -z "$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2167 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2168 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2169 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2170 # Prefer using a static library (so that no silly _DYNAMIC symbols
45c8592d5d13 initial version
carl
parents:
diff changeset
2171 # are required to link).
45c8592d5d13 initial version
carl
parents:
diff changeset
2172 if test -n "$old_library"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2173 newdlprefiles="$newdlprefiles $dir/$old_library"
45c8592d5d13 initial version
carl
parents:
diff changeset
2174 # Otherwise, use the dlname, so that lt_dlopen finds it.
45c8592d5d13 initial version
carl
parents:
diff changeset
2175 elif test -n "$dlname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2176 newdlprefiles="$newdlprefiles $dir/$dlname"
45c8592d5d13 initial version
carl
parents:
diff changeset
2177 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2178 newdlprefiles="$newdlprefiles $dir/$linklib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2179 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2180 fi # $pass = dlpreopen
45c8592d5d13 initial version
carl
parents:
diff changeset
2181
45c8592d5d13 initial version
carl
parents:
diff changeset
2182 if test -z "$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2183 # Link the convenience library
45c8592d5d13 initial version
carl
parents:
diff changeset
2184 if test "$linkmode" = lib; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2185 deplibs="$dir/$old_library $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2186 elif test "$linkmode,$pass" = "prog,link"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2187 compile_deplibs="$dir/$old_library $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2188 finalize_deplibs="$dir/$old_library $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2189 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2190 deplibs="$lib $deplibs" # used for prog,scan pass
45c8592d5d13 initial version
carl
parents:
diff changeset
2191 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2192 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
2193 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2194
45c8592d5d13 initial version
carl
parents:
diff changeset
2195
45c8592d5d13 initial version
carl
parents:
diff changeset
2196 if test "$linkmode" = prog && test "$pass" != link; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2197 newlib_search_path="$newlib_search_path $ladir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2198 deplibs="$lib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2199
45c8592d5d13 initial version
carl
parents:
diff changeset
2200 linkalldeplibs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
2201 if test "$link_all_deplibs" != no || test -z "$library_names" ||
45c8592d5d13 initial version
carl
parents:
diff changeset
2202 test "$build_libtool_libs" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2203 linkalldeplibs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
2204 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2205
45c8592d5d13 initial version
carl
parents:
diff changeset
2206 tmp_libs=
45c8592d5d13 initial version
carl
parents:
diff changeset
2207 for deplib in $dependency_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2208 case $deplib in
45c8592d5d13 initial version
carl
parents:
diff changeset
2209 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
45c8592d5d13 initial version
carl
parents:
diff changeset
2210 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2211 # Need to link against all dependency_libs?
45c8592d5d13 initial version
carl
parents:
diff changeset
2212 if test "$linkalldeplibs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2213 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2214 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2215 # Need to hardcode shared library paths
45c8592d5d13 initial version
carl
parents:
diff changeset
2216 # or/and link against static libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
2217 newdependency_libs="$deplib $newdependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2218 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2219 if test "X$duplicate_deps" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2220 case "$tmp_libs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2221 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2222 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2223 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2224 tmp_libs="$tmp_libs $deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2225 done # for deplib
45c8592d5d13 initial version
carl
parents:
diff changeset
2226 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
2227 fi # $linkmode = prog...
45c8592d5d13 initial version
carl
parents:
diff changeset
2228
45c8592d5d13 initial version
carl
parents:
diff changeset
2229 if test "$linkmode,$pass" = "prog,link"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2230 if test -n "$library_names" &&
45c8592d5d13 initial version
carl
parents:
diff changeset
2231 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2232 # We need to hardcode the library path
45c8592d5d13 initial version
carl
parents:
diff changeset
2233 if test -n "$shlibpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2234 # Make sure the rpath contains only unique directories.
45c8592d5d13 initial version
carl
parents:
diff changeset
2235 case "$temp_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2236 *" $dir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2237 *" $absdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2238 *) temp_rpath="$temp_rpath $dir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2239 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2240 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2241
45c8592d5d13 initial version
carl
parents:
diff changeset
2242 # Hardcode the library path.
45c8592d5d13 initial version
carl
parents:
diff changeset
2243 # Skip directories that are in the system default run-time
45c8592d5d13 initial version
carl
parents:
diff changeset
2244 # search path.
45c8592d5d13 initial version
carl
parents:
diff changeset
2245 case " $sys_lib_dlsearch_path " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2246 *" $absdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2247 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2248 case "$compile_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2249 *" $absdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2250 *) compile_rpath="$compile_rpath $absdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2251 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2252 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2253 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2254 case " $sys_lib_dlsearch_path " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2255 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2256 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2257 case "$finalize_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2258 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2259 *) finalize_rpath="$finalize_rpath $libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2260 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2261 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2262 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2263 fi # $linkmode,$pass = prog,link...
45c8592d5d13 initial version
carl
parents:
diff changeset
2264
45c8592d5d13 initial version
carl
parents:
diff changeset
2265 if test "$alldeplibs" = yes &&
45c8592d5d13 initial version
carl
parents:
diff changeset
2266 { test "$deplibs_check_method" = pass_all ||
45c8592d5d13 initial version
carl
parents:
diff changeset
2267 { test "$build_libtool_libs" = yes &&
45c8592d5d13 initial version
carl
parents:
diff changeset
2268 test -n "$library_names"; }; }; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2269 # We only need to search for static libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
2270 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
2271 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2272 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2273
45c8592d5d13 initial version
carl
parents:
diff changeset
2274 link_static=no # Whether the deplib will be linked statically
45c8592d5d13 initial version
carl
parents:
diff changeset
2275 if test -n "$library_names" &&
45c8592d5d13 initial version
carl
parents:
diff changeset
2276 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2277 if test "$installed" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2278 notinst_deplibs="$notinst_deplibs $lib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2279 need_relink=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
2280 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2281 # This is a shared library
45c8592d5d13 initial version
carl
parents:
diff changeset
2282
45c8592d5d13 initial version
carl
parents:
diff changeset
2283 # Warn about portability, can't link against -module's on
45c8592d5d13 initial version
carl
parents:
diff changeset
2284 # some systems (darwin)
45c8592d5d13 initial version
carl
parents:
diff changeset
2285 if test "$shouldnotlink" = yes && test "$pass" = link ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2286 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
2287 if test "$linkmode" = prog; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2288 $echo "*** Warning: Linking the executable $output against the loadable module"
45c8592d5d13 initial version
carl
parents:
diff changeset
2289 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2290 $echo "*** Warning: Linking the shared library $output against the loadable module"
45c8592d5d13 initial version
carl
parents:
diff changeset
2291 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2292 $echo "*** $linklib is not portable!"
45c8592d5d13 initial version
carl
parents:
diff changeset
2293 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2294 if test "$linkmode" = lib &&
45c8592d5d13 initial version
carl
parents:
diff changeset
2295 test "$hardcode_into_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2296 # Hardcode the library path.
45c8592d5d13 initial version
carl
parents:
diff changeset
2297 # Skip directories that are in the system default run-time
45c8592d5d13 initial version
carl
parents:
diff changeset
2298 # search path.
45c8592d5d13 initial version
carl
parents:
diff changeset
2299 case " $sys_lib_dlsearch_path " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2300 *" $absdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2301 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2302 case "$compile_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2303 *" $absdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2304 *) compile_rpath="$compile_rpath $absdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2305 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2306 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2307 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2308 case " $sys_lib_dlsearch_path " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2309 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2310 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2311 case "$finalize_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2312 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2313 *) finalize_rpath="$finalize_rpath $libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2314 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2315 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2316 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2317 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2318
45c8592d5d13 initial version
carl
parents:
diff changeset
2319 if test -n "$old_archive_from_expsyms_cmds"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2320 # figure out the soname
45c8592d5d13 initial version
carl
parents:
diff changeset
2321 set dummy $library_names
45c8592d5d13 initial version
carl
parents:
diff changeset
2322 realname="$2"
45c8592d5d13 initial version
carl
parents:
diff changeset
2323 shift; shift
45c8592d5d13 initial version
carl
parents:
diff changeset
2324 libname=`eval \\$echo \"$libname_spec\"`
45c8592d5d13 initial version
carl
parents:
diff changeset
2325 # use dlname if we got it. it's perfectly good, no?
45c8592d5d13 initial version
carl
parents:
diff changeset
2326 if test -n "$dlname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2327 soname="$dlname"
45c8592d5d13 initial version
carl
parents:
diff changeset
2328 elif test -n "$soname_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2329 # bleh windows
45c8592d5d13 initial version
carl
parents:
diff changeset
2330 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
2331 *cygwin* | mingw*)
45c8592d5d13 initial version
carl
parents:
diff changeset
2332 major=`expr $current - $age`
45c8592d5d13 initial version
carl
parents:
diff changeset
2333 versuffix="-$major"
45c8592d5d13 initial version
carl
parents:
diff changeset
2334 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2335 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2336 eval soname=\"$soname_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
2337 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2338 soname="$realname"
45c8592d5d13 initial version
carl
parents:
diff changeset
2339 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2340
45c8592d5d13 initial version
carl
parents:
diff changeset
2341 # Make a new name for the extract_expsyms_cmds to use
45c8592d5d13 initial version
carl
parents:
diff changeset
2342 soroot="$soname"
45c8592d5d13 initial version
carl
parents:
diff changeset
2343 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
45c8592d5d13 initial version
carl
parents:
diff changeset
2344 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
45c8592d5d13 initial version
carl
parents:
diff changeset
2345
45c8592d5d13 initial version
carl
parents:
diff changeset
2346 # If the library has no export list, then create one now
45c8592d5d13 initial version
carl
parents:
diff changeset
2347 if test -f "$output_objdir/$soname-def"; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
2348 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2349 $show "extracting exported symbol list from \`$soname'"
45c8592d5d13 initial version
carl
parents:
diff changeset
2350 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
2351 cmds=$extract_expsyms_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
2352 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2353 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2354 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
2355 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
2356 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
2357 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2358 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2359 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2360
45c8592d5d13 initial version
carl
parents:
diff changeset
2361 # Create $newlib
45c8592d5d13 initial version
carl
parents:
diff changeset
2362 if test -f "$output_objdir/$newlib"; then :; else
45c8592d5d13 initial version
carl
parents:
diff changeset
2363 $show "generating import library for \`$soname'"
45c8592d5d13 initial version
carl
parents:
diff changeset
2364 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
2365 cmds=$old_archive_from_expsyms_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
2366 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2367 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2368 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
2369 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
2370 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
2371 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2372 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2373 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2374 # make sure the library variables are pointing to the new library
45c8592d5d13 initial version
carl
parents:
diff changeset
2375 dir=$output_objdir
45c8592d5d13 initial version
carl
parents:
diff changeset
2376 linklib=$newlib
45c8592d5d13 initial version
carl
parents:
diff changeset
2377 fi # test -n "$old_archive_from_expsyms_cmds"
45c8592d5d13 initial version
carl
parents:
diff changeset
2378
45c8592d5d13 initial version
carl
parents:
diff changeset
2379 if test "$linkmode" = prog || test "$mode" != relink; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2380 add_shlibpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
2381 add_dir=
45c8592d5d13 initial version
carl
parents:
diff changeset
2382 add=
45c8592d5d13 initial version
carl
parents:
diff changeset
2383 lib_linked=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
2384 case $hardcode_action in
45c8592d5d13 initial version
carl
parents:
diff changeset
2385 immediate | unsupported)
45c8592d5d13 initial version
carl
parents:
diff changeset
2386 if test "$hardcode_direct" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2387 add="$dir/$linklib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2388 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
2389 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2390 *-*-darwin* )
45c8592d5d13 initial version
carl
parents:
diff changeset
2391 # if the lib is a module then we can not link against
45c8592d5d13 initial version
carl
parents:
diff changeset
2392 # it, someone is ignoring the new warnings I added
45c8592d5d13 initial version
carl
parents:
diff changeset
2393 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2394 $echo "** Warning, lib $linklib is a module, not a shared library"
45c8592d5d13 initial version
carl
parents:
diff changeset
2395 if test -z "$old_library" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2396 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
2397 $echo "** And there doesn't seem to be a static archive available"
45c8592d5d13 initial version
carl
parents:
diff changeset
2398 $echo "** The link will probably fail, sorry"
45c8592d5d13 initial version
carl
parents:
diff changeset
2399 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2400 add="$dir/$old_library"
45c8592d5d13 initial version
carl
parents:
diff changeset
2401 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2402 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2403 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2404 elif test "$hardcode_minus_L" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2405 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
2406 *-*-sunos*) add_shlibpath="$dir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2407 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2408 add_dir="-L$dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2409 add="-l$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
2410 elif test "$hardcode_shlibpath_var" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2411 add_shlibpath="$dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2412 add="-l$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
2413 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2414 lib_linked=no
45c8592d5d13 initial version
carl
parents:
diff changeset
2415 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2416 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2417 relink)
45c8592d5d13 initial version
carl
parents:
diff changeset
2418 if test "$hardcode_direct" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2419 add="$dir/$linklib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2420 elif test "$hardcode_minus_L" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2421 add_dir="-L$dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2422 # Try looking first in the location we're being installed to.
45c8592d5d13 initial version
carl
parents:
diff changeset
2423 if test -n "$inst_prefix_dir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2424 case "$libdir" in
45c8592d5d13 initial version
carl
parents:
diff changeset
2425 [\\/]*)
45c8592d5d13 initial version
carl
parents:
diff changeset
2426 add_dir="$add_dir -L$inst_prefix_dir$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2427 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2428 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2429 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2430 add="-l$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
2431 elif test "$hardcode_shlibpath_var" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2432 add_shlibpath="$dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2433 add="-l$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
2434 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2435 lib_linked=no
45c8592d5d13 initial version
carl
parents:
diff changeset
2436 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2437 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2438 *) lib_linked=no ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2439 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2440
45c8592d5d13 initial version
carl
parents:
diff changeset
2441 if test "$lib_linked" != yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2442 $echo "$modename: configuration error: unsupported hardcode properties"
45c8592d5d13 initial version
carl
parents:
diff changeset
2443 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2444 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2445
45c8592d5d13 initial version
carl
parents:
diff changeset
2446 if test -n "$add_shlibpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2447 case :$compile_shlibpath: in
45c8592d5d13 initial version
carl
parents:
diff changeset
2448 *":$add_shlibpath:"*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2449 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2450 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2451 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2452 if test "$linkmode" = prog; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2453 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2454 test -n "$add" && compile_deplibs="$add $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2455 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2456 test -n "$add_dir" && deplibs="$add_dir $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2457 test -n "$add" && deplibs="$add $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2458 if test "$hardcode_direct" != yes && \
45c8592d5d13 initial version
carl
parents:
diff changeset
2459 test "$hardcode_minus_L" != yes && \
45c8592d5d13 initial version
carl
parents:
diff changeset
2460 test "$hardcode_shlibpath_var" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2461 case :$finalize_shlibpath: in
45c8592d5d13 initial version
carl
parents:
diff changeset
2462 *":$libdir:"*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2463 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2464 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2465 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2466 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2467 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2468
45c8592d5d13 initial version
carl
parents:
diff changeset
2469 if test "$linkmode" = prog || test "$mode" = relink; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2470 add_shlibpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
2471 add_dir=
45c8592d5d13 initial version
carl
parents:
diff changeset
2472 add=
45c8592d5d13 initial version
carl
parents:
diff changeset
2473 # Finalize command for both is simple: just hardcode it.
45c8592d5d13 initial version
carl
parents:
diff changeset
2474 if test "$hardcode_direct" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2475 add="$libdir/$linklib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2476 elif test "$hardcode_minus_L" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2477 add_dir="-L$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2478 add="-l$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
2479 elif test "$hardcode_shlibpath_var" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2480 case :$finalize_shlibpath: in
45c8592d5d13 initial version
carl
parents:
diff changeset
2481 *":$libdir:"*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2482 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2483 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2484 add="-l$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
2485 elif test "$hardcode_automatic" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2486 if test -n "$inst_prefix_dir" &&
45c8592d5d13 initial version
carl
parents:
diff changeset
2487 test -f "$inst_prefix_dir$libdir/$linklib" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2488 add="$inst_prefix_dir$libdir/$linklib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2489 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2490 add="$libdir/$linklib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2491 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2492 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2493 # We cannot seem to hardcode it, guess we'll fake it.
45c8592d5d13 initial version
carl
parents:
diff changeset
2494 add_dir="-L$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2495 # Try looking first in the location we're being installed to.
45c8592d5d13 initial version
carl
parents:
diff changeset
2496 if test -n "$inst_prefix_dir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2497 case "$libdir" in
45c8592d5d13 initial version
carl
parents:
diff changeset
2498 [\\/]*)
45c8592d5d13 initial version
carl
parents:
diff changeset
2499 add_dir="$add_dir -L$inst_prefix_dir$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2500 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2501 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2502 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2503 add="-l$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
2504 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2505
45c8592d5d13 initial version
carl
parents:
diff changeset
2506 if test "$linkmode" = prog; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2507 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2508 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2509 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2510 test -n "$add_dir" && deplibs="$add_dir $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2511 test -n "$add" && deplibs="$add $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2512 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2513 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2514 elif test "$linkmode" = prog; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2515 # Here we assume that one of hardcode_direct or hardcode_minus_L
45c8592d5d13 initial version
carl
parents:
diff changeset
2516 # is not unsupported. This is valid on all known static and
45c8592d5d13 initial version
carl
parents:
diff changeset
2517 # shared platforms.
45c8592d5d13 initial version
carl
parents:
diff changeset
2518 if test "$hardcode_direct" != unsupported; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2519 test -n "$old_library" && linklib="$old_library"
45c8592d5d13 initial version
carl
parents:
diff changeset
2520 compile_deplibs="$dir/$linklib $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2521 finalize_deplibs="$dir/$linklib $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2522 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2523 compile_deplibs="-l$name -L$dir $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2524 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2525 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2526 elif test "$build_libtool_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2527 # Not a shared library
45c8592d5d13 initial version
carl
parents:
diff changeset
2528 if test "$deplibs_check_method" != pass_all; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2529 # We're trying link a shared library against a static one
45c8592d5d13 initial version
carl
parents:
diff changeset
2530 # but the system doesn't support it.
45c8592d5d13 initial version
carl
parents:
diff changeset
2531
45c8592d5d13 initial version
carl
parents:
diff changeset
2532 # Just print a warning and add the library to dependency_libs so
45c8592d5d13 initial version
carl
parents:
diff changeset
2533 # that the program can be linked against the static library.
45c8592d5d13 initial version
carl
parents:
diff changeset
2534 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
2535 $echo "*** Warning: This system can not link to static lib archive $lib."
45c8592d5d13 initial version
carl
parents:
diff changeset
2536 $echo "*** I have the capability to make that library automatically link in when"
45c8592d5d13 initial version
carl
parents:
diff changeset
2537 $echo "*** you link to this library. But I can only do this if you have a"
45c8592d5d13 initial version
carl
parents:
diff changeset
2538 $echo "*** shared version of the library, which you do not appear to have."
45c8592d5d13 initial version
carl
parents:
diff changeset
2539 if test "$module" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2540 $echo "*** But as you try to build a module library, libtool will still create "
45c8592d5d13 initial version
carl
parents:
diff changeset
2541 $echo "*** a static module, that should work as long as the dlopening application"
45c8592d5d13 initial version
carl
parents:
diff changeset
2542 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
45c8592d5d13 initial version
carl
parents:
diff changeset
2543 if test -z "$global_symbol_pipe"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2544 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
2545 $echo "*** However, this would only work if libtool was able to extract symbol"
45c8592d5d13 initial version
carl
parents:
diff changeset
2546 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
45c8592d5d13 initial version
carl
parents:
diff changeset
2547 $echo "*** not find such a program. So, this module is probably useless."
45c8592d5d13 initial version
carl
parents:
diff changeset
2548 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
45c8592d5d13 initial version
carl
parents:
diff changeset
2549 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2550 if test "$build_old_libs" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2551 build_libtool_libs=module
45c8592d5d13 initial version
carl
parents:
diff changeset
2552 build_old_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
2553 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2554 build_libtool_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
2555 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2556 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2557 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2558 convenience="$convenience $dir/$old_library"
45c8592d5d13 initial version
carl
parents:
diff changeset
2559 old_convenience="$old_convenience $dir/$old_library"
45c8592d5d13 initial version
carl
parents:
diff changeset
2560 deplibs="$dir/$old_library $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2561 link_static=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
2562 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2563 fi # link shared/static library?
45c8592d5d13 initial version
carl
parents:
diff changeset
2564
45c8592d5d13 initial version
carl
parents:
diff changeset
2565 if test "$linkmode" = lib; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2566 if test -n "$dependency_libs" &&
45c8592d5d13 initial version
carl
parents:
diff changeset
2567 { test "$hardcode_into_libs" != yes ||
45c8592d5d13 initial version
carl
parents:
diff changeset
2568 test "$build_old_libs" = yes ||
45c8592d5d13 initial version
carl
parents:
diff changeset
2569 test "$link_static" = yes; }; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2570 # Extract -R from dependency_libs
45c8592d5d13 initial version
carl
parents:
diff changeset
2571 temp_deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
2572 for libdir in $dependency_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2573 case $libdir in
45c8592d5d13 initial version
carl
parents:
diff changeset
2574 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
2575 case " $xrpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2576 *" $temp_xrpath "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2577 *) xrpath="$xrpath $temp_xrpath";;
45c8592d5d13 initial version
carl
parents:
diff changeset
2578 esac;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2579 *) temp_deplibs="$temp_deplibs $libdir";;
45c8592d5d13 initial version
carl
parents:
diff changeset
2580 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2581 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2582 dependency_libs="$temp_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2583 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2584
45c8592d5d13 initial version
carl
parents:
diff changeset
2585 newlib_search_path="$newlib_search_path $absdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2586 # Link against this library
45c8592d5d13 initial version
carl
parents:
diff changeset
2587 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2588 # ... and its dependency_libs
45c8592d5d13 initial version
carl
parents:
diff changeset
2589 tmp_libs=
45c8592d5d13 initial version
carl
parents:
diff changeset
2590 for deplib in $dependency_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2591 newdependency_libs="$deplib $newdependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2592 if test "X$duplicate_deps" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2593 case "$tmp_libs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2594 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2595 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2596 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2597 tmp_libs="$tmp_libs $deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2598 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2599
45c8592d5d13 initial version
carl
parents:
diff changeset
2600 if test "$link_all_deplibs" != no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2601 # Add the search paths of all dependency libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
2602 for deplib in $dependency_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2603 case $deplib in
45c8592d5d13 initial version
carl
parents:
diff changeset
2604 -L*) path="$deplib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2605 *.la)
45c8592d5d13 initial version
carl
parents:
diff changeset
2606 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
2607 test "X$dir" = "X$deplib" && dir="."
45c8592d5d13 initial version
carl
parents:
diff changeset
2608 # We need an absolute path.
45c8592d5d13 initial version
carl
parents:
diff changeset
2609 case $dir in
45c8592d5d13 initial version
carl
parents:
diff changeset
2610 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2611 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2612 absdir=`cd "$dir" && pwd`
45c8592d5d13 initial version
carl
parents:
diff changeset
2613 if test -z "$absdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2614 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2615 absdir="$dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2616 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2617 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2618 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2619 if grep "^installed=no" $deplib > /dev/null; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2620 path="$absdir/$objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2621 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2622 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
45c8592d5d13 initial version
carl
parents:
diff changeset
2623 if test -z "$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2624 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2625 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2626 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2627 if test "$absdir" != "$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2628 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2629 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2630 path="$absdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
2631 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2632 depdepl=
45c8592d5d13 initial version
carl
parents:
diff changeset
2633 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
2634 *-*-darwin*)
45c8592d5d13 initial version
carl
parents:
diff changeset
2635 # we do not want to link against static libs,
45c8592d5d13 initial version
carl
parents:
diff changeset
2636 # but need to link against shared
45c8592d5d13 initial version
carl
parents:
diff changeset
2637 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
45c8592d5d13 initial version
carl
parents:
diff changeset
2638 if test -n "$deplibrary_names" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2639 for tmp in $deplibrary_names ; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2640 depdepl=$tmp
45c8592d5d13 initial version
carl
parents:
diff changeset
2641 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2642 if test -f "$path/$depdepl" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2643 depdepl="$path/$depdepl"
45c8592d5d13 initial version
carl
parents:
diff changeset
2644 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2645 # do not add paths which are already there
45c8592d5d13 initial version
carl
parents:
diff changeset
2646 case " $newlib_search_path " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2647 *" $path "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2648 *) newlib_search_path="$newlib_search_path $path";;
45c8592d5d13 initial version
carl
parents:
diff changeset
2649 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2650 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2651 path=""
45c8592d5d13 initial version
carl
parents:
diff changeset
2652 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2653 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2654 path="-L$path"
45c8592d5d13 initial version
carl
parents:
diff changeset
2655 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2656 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2657 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2658 -l*)
45c8592d5d13 initial version
carl
parents:
diff changeset
2659 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
2660 *-*-darwin*)
45c8592d5d13 initial version
carl
parents:
diff changeset
2661 # Again, we only want to link against shared libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
2662 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
45c8592d5d13 initial version
carl
parents:
diff changeset
2663 for tmp in $newlib_search_path ; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2664 if test -f "$tmp/lib$tmp_libs.dylib" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2665 eval depdepl="$tmp/lib$tmp_libs.dylib"
45c8592d5d13 initial version
carl
parents:
diff changeset
2666 break
45c8592d5d13 initial version
carl
parents:
diff changeset
2667 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2668 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2669 path=""
45c8592d5d13 initial version
carl
parents:
diff changeset
2670 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2671 *) continue ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2672 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2673 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2674 *) continue ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2675 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2676 case " $deplibs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2677 *" $depdepl "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2678 *) deplibs="$depdepl $deplibs" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2679 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2680 case " $deplibs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2681 *" $path "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2682 *) deplibs="$deplibs $path" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2683 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2684 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2685 fi # link_all_deplibs != no
45c8592d5d13 initial version
carl
parents:
diff changeset
2686 fi # linkmode = lib
45c8592d5d13 initial version
carl
parents:
diff changeset
2687 done # for deplib in $libs
45c8592d5d13 initial version
carl
parents:
diff changeset
2688 dependency_libs="$newdependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2689 if test "$pass" = dlpreopen; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2690 # Link the dlpreopened libraries before other libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
2691 for deplib in $save_deplibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2692 deplibs="$deplib $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2693 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2694 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2695 if test "$pass" != dlopen; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2696 if test "$pass" != conv; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2697 # Make sure lib_search_path contains only unique directories.
45c8592d5d13 initial version
carl
parents:
diff changeset
2698 lib_search_path=
45c8592d5d13 initial version
carl
parents:
diff changeset
2699 for dir in $newlib_search_path; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2700 case "$lib_search_path " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2701 *" $dir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2702 *) lib_search_path="$lib_search_path $dir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2703 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2704 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2705 newlib_search_path=
45c8592d5d13 initial version
carl
parents:
diff changeset
2706 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2707
45c8592d5d13 initial version
carl
parents:
diff changeset
2708 if test "$linkmode,$pass" != "prog,link"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2709 vars="deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2710 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2711 vars="compile_deplibs finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2712 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2713 for var in $vars dependency_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2714 # Add libraries to $var in reverse order
45c8592d5d13 initial version
carl
parents:
diff changeset
2715 eval tmp_libs=\"\$$var\"
45c8592d5d13 initial version
carl
parents:
diff changeset
2716 new_libs=
45c8592d5d13 initial version
carl
parents:
diff changeset
2717 for deplib in $tmp_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2718 # FIXME: Pedantically, this is the right thing to do, so
45c8592d5d13 initial version
carl
parents:
diff changeset
2719 # that some nasty dependency loop isn't accidentally
45c8592d5d13 initial version
carl
parents:
diff changeset
2720 # broken:
45c8592d5d13 initial version
carl
parents:
diff changeset
2721 #new_libs="$deplib $new_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2722 # Pragmatically, this seems to cause very few problems in
45c8592d5d13 initial version
carl
parents:
diff changeset
2723 # practice:
45c8592d5d13 initial version
carl
parents:
diff changeset
2724 case $deplib in
45c8592d5d13 initial version
carl
parents:
diff changeset
2725 -L*) new_libs="$deplib $new_libs" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2726 -R*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2727 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2728 # And here is the reason: when a library appears more
45c8592d5d13 initial version
carl
parents:
diff changeset
2729 # than once as an explicit dependence of a library, or
45c8592d5d13 initial version
carl
parents:
diff changeset
2730 # is implicitly linked in more than once by the
45c8592d5d13 initial version
carl
parents:
diff changeset
2731 # compiler, it is considered special, and multiple
45c8592d5d13 initial version
carl
parents:
diff changeset
2732 # occurrences thereof are not removed. Compare this
45c8592d5d13 initial version
carl
parents:
diff changeset
2733 # with having the same library being listed as a
45c8592d5d13 initial version
carl
parents:
diff changeset
2734 # dependency of multiple other libraries: in this case,
45c8592d5d13 initial version
carl
parents:
diff changeset
2735 # we know (pedantically, we assume) the library does not
45c8592d5d13 initial version
carl
parents:
diff changeset
2736 # need to be listed more than once, so we keep only the
45c8592d5d13 initial version
carl
parents:
diff changeset
2737 # last copy. This is not always right, but it is rare
45c8592d5d13 initial version
carl
parents:
diff changeset
2738 # enough that we require users that really mean to play
45c8592d5d13 initial version
carl
parents:
diff changeset
2739 # such unportable linking tricks to link the library
45c8592d5d13 initial version
carl
parents:
diff changeset
2740 # using -Wl,-lname, so that libtool does not consider it
45c8592d5d13 initial version
carl
parents:
diff changeset
2741 # for duplicate removal.
45c8592d5d13 initial version
carl
parents:
diff changeset
2742 case " $specialdeplibs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2743 *" $deplib "*) new_libs="$deplib $new_libs" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2744 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2745 case " $new_libs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2746 *" $deplib "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2747 *) new_libs="$deplib $new_libs" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2748 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2749 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2750 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2751 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2752 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2753 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2754 tmp_libs=
45c8592d5d13 initial version
carl
parents:
diff changeset
2755 for deplib in $new_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2756 case $deplib in
45c8592d5d13 initial version
carl
parents:
diff changeset
2757 -L*)
45c8592d5d13 initial version
carl
parents:
diff changeset
2758 case " $tmp_libs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2759 *" $deplib "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2760 *) tmp_libs="$tmp_libs $deplib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2761 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2762 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2763 *) tmp_libs="$tmp_libs $deplib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2764 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2765 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2766 eval $var=\"$tmp_libs\"
45c8592d5d13 initial version
carl
parents:
diff changeset
2767 done # for var
45c8592d5d13 initial version
carl
parents:
diff changeset
2768 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2769 # Last step: remove runtime libs from dependency_libs
45c8592d5d13 initial version
carl
parents:
diff changeset
2770 # (they stay in deplibs)
45c8592d5d13 initial version
carl
parents:
diff changeset
2771 tmp_libs=
45c8592d5d13 initial version
carl
parents:
diff changeset
2772 for i in $dependency_libs ; do
45c8592d5d13 initial version
carl
parents:
diff changeset
2773 case " $predeps $postdeps $compiler_lib_search_path " in
45c8592d5d13 initial version
carl
parents:
diff changeset
2774 *" $i "*)
45c8592d5d13 initial version
carl
parents:
diff changeset
2775 i=""
45c8592d5d13 initial version
carl
parents:
diff changeset
2776 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2777 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2778 if test -n "$i" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2779 tmp_libs="$tmp_libs $i"
45c8592d5d13 initial version
carl
parents:
diff changeset
2780 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2781 done
45c8592d5d13 initial version
carl
parents:
diff changeset
2782 dependency_libs=$tmp_libs
45c8592d5d13 initial version
carl
parents:
diff changeset
2783 done # for pass
45c8592d5d13 initial version
carl
parents:
diff changeset
2784 if test "$linkmode" = prog; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2785 dlfiles="$newdlfiles"
45c8592d5d13 initial version
carl
parents:
diff changeset
2786 dlprefiles="$newdlprefiles"
45c8592d5d13 initial version
carl
parents:
diff changeset
2787 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2788
45c8592d5d13 initial version
carl
parents:
diff changeset
2789 case $linkmode in
45c8592d5d13 initial version
carl
parents:
diff changeset
2790 oldlib)
45c8592d5d13 initial version
carl
parents:
diff changeset
2791 if test -n "$deplibs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2792 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2793 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2794
45c8592d5d13 initial version
carl
parents:
diff changeset
2795 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2796 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2797 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2798
45c8592d5d13 initial version
carl
parents:
diff changeset
2799 if test -n "$rpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2800 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2801 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2802
45c8592d5d13 initial version
carl
parents:
diff changeset
2803 if test -n "$xrpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2804 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2805 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2806
45c8592d5d13 initial version
carl
parents:
diff changeset
2807 if test -n "$vinfo"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2808 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2809 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2810
45c8592d5d13 initial version
carl
parents:
diff changeset
2811 if test -n "$release"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2812 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2813 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2814
45c8592d5d13 initial version
carl
parents:
diff changeset
2815 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2816 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2817 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2818
45c8592d5d13 initial version
carl
parents:
diff changeset
2819 # Now set the variables for building old libraries.
45c8592d5d13 initial version
carl
parents:
diff changeset
2820 build_libtool_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
2821 oldlibs="$output"
45c8592d5d13 initial version
carl
parents:
diff changeset
2822 objs="$objs$old_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2823 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2824
45c8592d5d13 initial version
carl
parents:
diff changeset
2825 lib)
45c8592d5d13 initial version
carl
parents:
diff changeset
2826 # Make sure we only generate libraries of the form `libNAME.la'.
45c8592d5d13 initial version
carl
parents:
diff changeset
2827 case $outputname in
45c8592d5d13 initial version
carl
parents:
diff changeset
2828 lib*)
45c8592d5d13 initial version
carl
parents:
diff changeset
2829 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
2830 eval shared_ext=\"$shrext_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
2831 eval libname=\"$libname_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
2832 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2833 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2834 if test "$module" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2835 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2836 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2837 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2838 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2839 if test "$need_lib_prefix" != no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2840 # Add the "lib" prefix for modules if required
45c8592d5d13 initial version
carl
parents:
diff changeset
2841 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
2842 eval shared_ext=\"$shrext_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
2843 eval libname=\"$libname_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
2844 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2845 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
45c8592d5d13 initial version
carl
parents:
diff changeset
2846 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2847 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2848 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2849
45c8592d5d13 initial version
carl
parents:
diff changeset
2850 if test -n "$objs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2851 if test "$deplibs_check_method" != pass_all; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2852 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
45c8592d5d13 initial version
carl
parents:
diff changeset
2853 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2854 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2855 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
2856 $echo "*** Warning: Linking the shared library $output against the non-libtool"
45c8592d5d13 initial version
carl
parents:
diff changeset
2857 $echo "*** objects $objs is not portable!"
45c8592d5d13 initial version
carl
parents:
diff changeset
2858 libobjs="$libobjs $objs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2859 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2860 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2861
45c8592d5d13 initial version
carl
parents:
diff changeset
2862 if test "$dlself" != no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2863 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2864 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2865
45c8592d5d13 initial version
carl
parents:
diff changeset
2866 set dummy $rpath
45c8592d5d13 initial version
carl
parents:
diff changeset
2867 if test "$#" -gt 2; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2868 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2869 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2870 install_libdir="$2"
45c8592d5d13 initial version
carl
parents:
diff changeset
2871
45c8592d5d13 initial version
carl
parents:
diff changeset
2872 oldlibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
2873 if test -z "$rpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2874 if test "$build_libtool_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2875 # Building a libtool convenience library.
45c8592d5d13 initial version
carl
parents:
diff changeset
2876 # Some compilers have problems with a `.al' extension so
45c8592d5d13 initial version
carl
parents:
diff changeset
2877 # convenience libraries should have the same extension an
45c8592d5d13 initial version
carl
parents:
diff changeset
2878 # archive normally would.
45c8592d5d13 initial version
carl
parents:
diff changeset
2879 oldlibs="$output_objdir/$libname.$libext $oldlibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2880 build_libtool_libs=convenience
45c8592d5d13 initial version
carl
parents:
diff changeset
2881 build_old_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
2882 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2883
45c8592d5d13 initial version
carl
parents:
diff changeset
2884 if test -n "$vinfo"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2885 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2886 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2887
45c8592d5d13 initial version
carl
parents:
diff changeset
2888 if test -n "$release"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2889 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2890 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2891 else
45c8592d5d13 initial version
carl
parents:
diff changeset
2892
45c8592d5d13 initial version
carl
parents:
diff changeset
2893 # Parse the version information argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
2894 save_ifs="$IFS"; IFS=':'
45c8592d5d13 initial version
carl
parents:
diff changeset
2895 set dummy $vinfo 0 0 0
45c8592d5d13 initial version
carl
parents:
diff changeset
2896 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
2897
45c8592d5d13 initial version
carl
parents:
diff changeset
2898 if test -n "$8"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2899 $echo "$modename: too many parameters to \`-version-info'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2900 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2901 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2902 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2903
45c8592d5d13 initial version
carl
parents:
diff changeset
2904 # convert absolute version numbers to libtool ages
45c8592d5d13 initial version
carl
parents:
diff changeset
2905 # this retains compatibility with .la files and attempts
45c8592d5d13 initial version
carl
parents:
diff changeset
2906 # to make the code below a bit more comprehensible
45c8592d5d13 initial version
carl
parents:
diff changeset
2907
45c8592d5d13 initial version
carl
parents:
diff changeset
2908 case $vinfo_number in
45c8592d5d13 initial version
carl
parents:
diff changeset
2909 yes)
45c8592d5d13 initial version
carl
parents:
diff changeset
2910 number_major="$2"
45c8592d5d13 initial version
carl
parents:
diff changeset
2911 number_minor="$3"
45c8592d5d13 initial version
carl
parents:
diff changeset
2912 number_revision="$4"
45c8592d5d13 initial version
carl
parents:
diff changeset
2913 #
45c8592d5d13 initial version
carl
parents:
diff changeset
2914 # There are really only two kinds -- those that
45c8592d5d13 initial version
carl
parents:
diff changeset
2915 # use the current revision as the major version
45c8592d5d13 initial version
carl
parents:
diff changeset
2916 # and those that subtract age and use age as
45c8592d5d13 initial version
carl
parents:
diff changeset
2917 # a minor version. But, then there is irix
45c8592d5d13 initial version
carl
parents:
diff changeset
2918 # which has an extra 1 added just for fun
45c8592d5d13 initial version
carl
parents:
diff changeset
2919 #
45c8592d5d13 initial version
carl
parents:
diff changeset
2920 case $version_type in
45c8592d5d13 initial version
carl
parents:
diff changeset
2921 darwin|linux|osf|windows)
45c8592d5d13 initial version
carl
parents:
diff changeset
2922 current=`expr $number_major + $number_minor`
45c8592d5d13 initial version
carl
parents:
diff changeset
2923 age="$number_minor"
45c8592d5d13 initial version
carl
parents:
diff changeset
2924 revision="$number_revision"
45c8592d5d13 initial version
carl
parents:
diff changeset
2925 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2926 freebsd-aout|freebsd-elf|sunos)
45c8592d5d13 initial version
carl
parents:
diff changeset
2927 current="$number_major"
45c8592d5d13 initial version
carl
parents:
diff changeset
2928 revision="$number_minor"
45c8592d5d13 initial version
carl
parents:
diff changeset
2929 age="0"
45c8592d5d13 initial version
carl
parents:
diff changeset
2930 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2931 irix|nonstopux)
45c8592d5d13 initial version
carl
parents:
diff changeset
2932 current=`expr $number_major + $number_minor - 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
2933 age="$number_minor"
45c8592d5d13 initial version
carl
parents:
diff changeset
2934 revision="$number_minor"
45c8592d5d13 initial version
carl
parents:
diff changeset
2935 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2936 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2937 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2938 no)
45c8592d5d13 initial version
carl
parents:
diff changeset
2939 current="$2"
45c8592d5d13 initial version
carl
parents:
diff changeset
2940 revision="$3"
45c8592d5d13 initial version
carl
parents:
diff changeset
2941 age="$4"
45c8592d5d13 initial version
carl
parents:
diff changeset
2942 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2943 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2944
45c8592d5d13 initial version
carl
parents:
diff changeset
2945 # Check that each of the things are valid numbers.
45c8592d5d13 initial version
carl
parents:
diff changeset
2946 case $current in
45c8592d5d13 initial version
carl
parents:
diff changeset
2947 [0-9]*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2948 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2949 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2950 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2951 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2952 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2953 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2954
45c8592d5d13 initial version
carl
parents:
diff changeset
2955 case $revision in
45c8592d5d13 initial version
carl
parents:
diff changeset
2956 [0-9]*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2957 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2958 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2959 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2960 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2961 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2962 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2963
45c8592d5d13 initial version
carl
parents:
diff changeset
2964 case $age in
45c8592d5d13 initial version
carl
parents:
diff changeset
2965 [0-9]*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2966 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
2967 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2968 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2969 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2970 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2971 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
2972
45c8592d5d13 initial version
carl
parents:
diff changeset
2973 if test "$age" -gt "$current"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
2974 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2975 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
2976 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
2977 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
2978
45c8592d5d13 initial version
carl
parents:
diff changeset
2979 # Calculate the version variables.
45c8592d5d13 initial version
carl
parents:
diff changeset
2980 major=
45c8592d5d13 initial version
carl
parents:
diff changeset
2981 versuffix=
45c8592d5d13 initial version
carl
parents:
diff changeset
2982 verstring=
45c8592d5d13 initial version
carl
parents:
diff changeset
2983 case $version_type in
45c8592d5d13 initial version
carl
parents:
diff changeset
2984 none) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2985
45c8592d5d13 initial version
carl
parents:
diff changeset
2986 darwin)
45c8592d5d13 initial version
carl
parents:
diff changeset
2987 # Like Linux, but with the current version available in
45c8592d5d13 initial version
carl
parents:
diff changeset
2988 # verstring for coding it into the library header
45c8592d5d13 initial version
carl
parents:
diff changeset
2989 major=.`expr $current - $age`
45c8592d5d13 initial version
carl
parents:
diff changeset
2990 versuffix="$major.$age.$revision"
45c8592d5d13 initial version
carl
parents:
diff changeset
2991 # Darwin ld doesn't like 0 for these options...
45c8592d5d13 initial version
carl
parents:
diff changeset
2992 minor_current=`expr $current + 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
2993 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
45c8592d5d13 initial version
carl
parents:
diff changeset
2994 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
2995
45c8592d5d13 initial version
carl
parents:
diff changeset
2996 freebsd-aout)
45c8592d5d13 initial version
carl
parents:
diff changeset
2997 major=".$current"
45c8592d5d13 initial version
carl
parents:
diff changeset
2998 versuffix=".$current.$revision";
45c8592d5d13 initial version
carl
parents:
diff changeset
2999 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3000
45c8592d5d13 initial version
carl
parents:
diff changeset
3001 freebsd-elf)
45c8592d5d13 initial version
carl
parents:
diff changeset
3002 major=".$current"
45c8592d5d13 initial version
carl
parents:
diff changeset
3003 versuffix=".$current";
45c8592d5d13 initial version
carl
parents:
diff changeset
3004 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3005
45c8592d5d13 initial version
carl
parents:
diff changeset
3006 irix | nonstopux)
45c8592d5d13 initial version
carl
parents:
diff changeset
3007 major=`expr $current - $age + 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
3008
45c8592d5d13 initial version
carl
parents:
diff changeset
3009 case $version_type in
45c8592d5d13 initial version
carl
parents:
diff changeset
3010 nonstopux) verstring_prefix=nonstopux ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3011 *) verstring_prefix=sgi ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3012 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3013 verstring="$verstring_prefix$major.$revision"
45c8592d5d13 initial version
carl
parents:
diff changeset
3014
45c8592d5d13 initial version
carl
parents:
diff changeset
3015 # Add in all the interfaces that we are compatible with.
45c8592d5d13 initial version
carl
parents:
diff changeset
3016 loop=$revision
45c8592d5d13 initial version
carl
parents:
diff changeset
3017 while test "$loop" -ne 0; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3018 iface=`expr $revision - $loop`
45c8592d5d13 initial version
carl
parents:
diff changeset
3019 loop=`expr $loop - 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
3020 verstring="$verstring_prefix$major.$iface:$verstring"
45c8592d5d13 initial version
carl
parents:
diff changeset
3021 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3022
45c8592d5d13 initial version
carl
parents:
diff changeset
3023 # Before this point, $major must not contain `.'.
45c8592d5d13 initial version
carl
parents:
diff changeset
3024 major=.$major
45c8592d5d13 initial version
carl
parents:
diff changeset
3025 versuffix="$major.$revision"
45c8592d5d13 initial version
carl
parents:
diff changeset
3026 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3027
45c8592d5d13 initial version
carl
parents:
diff changeset
3028 linux)
45c8592d5d13 initial version
carl
parents:
diff changeset
3029 major=.`expr $current - $age`
45c8592d5d13 initial version
carl
parents:
diff changeset
3030 versuffix="$major.$age.$revision"
45c8592d5d13 initial version
carl
parents:
diff changeset
3031 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3032
45c8592d5d13 initial version
carl
parents:
diff changeset
3033 osf)
45c8592d5d13 initial version
carl
parents:
diff changeset
3034 major=.`expr $current - $age`
45c8592d5d13 initial version
carl
parents:
diff changeset
3035 versuffix=".$current.$age.$revision"
45c8592d5d13 initial version
carl
parents:
diff changeset
3036 verstring="$current.$age.$revision"
45c8592d5d13 initial version
carl
parents:
diff changeset
3037
45c8592d5d13 initial version
carl
parents:
diff changeset
3038 # Add in all the interfaces that we are compatible with.
45c8592d5d13 initial version
carl
parents:
diff changeset
3039 loop=$age
45c8592d5d13 initial version
carl
parents:
diff changeset
3040 while test "$loop" -ne 0; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3041 iface=`expr $current - $loop`
45c8592d5d13 initial version
carl
parents:
diff changeset
3042 loop=`expr $loop - 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
3043 verstring="$verstring:${iface}.0"
45c8592d5d13 initial version
carl
parents:
diff changeset
3044 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3045
45c8592d5d13 initial version
carl
parents:
diff changeset
3046 # Make executables depend on our current version.
45c8592d5d13 initial version
carl
parents:
diff changeset
3047 verstring="$verstring:${current}.0"
45c8592d5d13 initial version
carl
parents:
diff changeset
3048 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3049
45c8592d5d13 initial version
carl
parents:
diff changeset
3050 sunos)
45c8592d5d13 initial version
carl
parents:
diff changeset
3051 major=".$current"
45c8592d5d13 initial version
carl
parents:
diff changeset
3052 versuffix=".$current.$revision"
45c8592d5d13 initial version
carl
parents:
diff changeset
3053 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3054
45c8592d5d13 initial version
carl
parents:
diff changeset
3055 windows)
45c8592d5d13 initial version
carl
parents:
diff changeset
3056 # Use '-' rather than '.', since we only want one
45c8592d5d13 initial version
carl
parents:
diff changeset
3057 # extension on DOS 8.3 filesystems.
45c8592d5d13 initial version
carl
parents:
diff changeset
3058 major=`expr $current - $age`
45c8592d5d13 initial version
carl
parents:
diff changeset
3059 versuffix="-$major"
45c8592d5d13 initial version
carl
parents:
diff changeset
3060 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3061
45c8592d5d13 initial version
carl
parents:
diff changeset
3062 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
3063 $echo "$modename: unknown library version type \`$version_type'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3064 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3065 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
3066 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3067 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3068
45c8592d5d13 initial version
carl
parents:
diff changeset
3069 # Clear the version info if we defaulted, and they specified a release.
45c8592d5d13 initial version
carl
parents:
diff changeset
3070 if test -z "$vinfo" && test -n "$release"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3071 major=
45c8592d5d13 initial version
carl
parents:
diff changeset
3072 case $version_type in
45c8592d5d13 initial version
carl
parents:
diff changeset
3073 darwin)
45c8592d5d13 initial version
carl
parents:
diff changeset
3074 # we can't check for "0.0" in archive_cmds due to quoting
45c8592d5d13 initial version
carl
parents:
diff changeset
3075 # problems, so we reset it completely
45c8592d5d13 initial version
carl
parents:
diff changeset
3076 verstring=
45c8592d5d13 initial version
carl
parents:
diff changeset
3077 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3078 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
3079 verstring="0.0"
45c8592d5d13 initial version
carl
parents:
diff changeset
3080 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3081 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3082 if test "$need_version" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3083 versuffix=
45c8592d5d13 initial version
carl
parents:
diff changeset
3084 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3085 versuffix=".0.0"
45c8592d5d13 initial version
carl
parents:
diff changeset
3086 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3087 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3088
45c8592d5d13 initial version
carl
parents:
diff changeset
3089 # Remove version info from name if versioning should be avoided
45c8592d5d13 initial version
carl
parents:
diff changeset
3090 if test "$avoid_version" = yes && test "$need_version" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3091 major=
45c8592d5d13 initial version
carl
parents:
diff changeset
3092 versuffix=
45c8592d5d13 initial version
carl
parents:
diff changeset
3093 verstring=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3094 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3095
45c8592d5d13 initial version
carl
parents:
diff changeset
3096 # Check to see if the archive will have undefined symbols.
45c8592d5d13 initial version
carl
parents:
diff changeset
3097 if test "$allow_undefined" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3098 if test "$allow_undefined_flag" = unsupported; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3099 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3100 build_libtool_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
3101 build_old_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
3102 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3103 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3104 # Don't allow undefined symbols.
45c8592d5d13 initial version
carl
parents:
diff changeset
3105 allow_undefined_flag="$no_undefined_flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
3106 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3107 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3108
45c8592d5d13 initial version
carl
parents:
diff changeset
3109 if test "$mode" != relink; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3110 # Remove our outputs, but don't remove object files since they
45c8592d5d13 initial version
carl
parents:
diff changeset
3111 # may have been created when compiling PIC objects.
45c8592d5d13 initial version
carl
parents:
diff changeset
3112 removelist=
45c8592d5d13 initial version
carl
parents:
diff changeset
3113 tempremovelist=`$echo "$output_objdir/*"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3114 for p in $tempremovelist; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3115 case $p in
45c8592d5d13 initial version
carl
parents:
diff changeset
3116 *.$objext)
45c8592d5d13 initial version
carl
parents:
diff changeset
3117 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3118 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3119 if test "X$precious_files_regex" != "X"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3120 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
45c8592d5d13 initial version
carl
parents:
diff changeset
3121 then
45c8592d5d13 initial version
carl
parents:
diff changeset
3122 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
3123 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3124 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3125 removelist="$removelist $p"
45c8592d5d13 initial version
carl
parents:
diff changeset
3126 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3127 *) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3128 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3129 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3130 if test -n "$removelist"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3131 $show "${rm}r $removelist"
45c8592d5d13 initial version
carl
parents:
diff changeset
3132 $run ${rm}r $removelist
45c8592d5d13 initial version
carl
parents:
diff changeset
3133 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3134 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3135
45c8592d5d13 initial version
carl
parents:
diff changeset
3136 # Now set the variables for building old libraries.
45c8592d5d13 initial version
carl
parents:
diff changeset
3137 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3138 oldlibs="$oldlibs $output_objdir/$libname.$libext"
45c8592d5d13 initial version
carl
parents:
diff changeset
3139
45c8592d5d13 initial version
carl
parents:
diff changeset
3140 # Transform .lo files to .o files.
45c8592d5d13 initial version
carl
parents:
diff changeset
3141 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
45c8592d5d13 initial version
carl
parents:
diff changeset
3142 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3143
45c8592d5d13 initial version
carl
parents:
diff changeset
3144 # Eliminate all temporary directories.
45c8592d5d13 initial version
carl
parents:
diff changeset
3145 for path in $notinst_path; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3146 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
45c8592d5d13 initial version
carl
parents:
diff changeset
3147 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
45c8592d5d13 initial version
carl
parents:
diff changeset
3148 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
45c8592d5d13 initial version
carl
parents:
diff changeset
3149 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3150
45c8592d5d13 initial version
carl
parents:
diff changeset
3151 if test -n "$xrpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3152 # If the user specified any rpath flags, then add them.
45c8592d5d13 initial version
carl
parents:
diff changeset
3153 temp_xrpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
3154 for libdir in $xrpath; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3155 temp_xrpath="$temp_xrpath -R$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
3156 case "$finalize_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
3157 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3158 *) finalize_rpath="$finalize_rpath $libdir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3159 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3160 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3161 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3162 dependency_libs="$temp_xrpath $dependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3163 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3164 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3165
45c8592d5d13 initial version
carl
parents:
diff changeset
3166 # Make sure dlfiles contains only unique files that won't be dlpreopened
45c8592d5d13 initial version
carl
parents:
diff changeset
3167 old_dlfiles="$dlfiles"
45c8592d5d13 initial version
carl
parents:
diff changeset
3168 dlfiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
3169 for lib in $old_dlfiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3170 case " $dlprefiles $dlfiles " in
45c8592d5d13 initial version
carl
parents:
diff changeset
3171 *" $lib "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3172 *) dlfiles="$dlfiles $lib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3173 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3174 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3175
45c8592d5d13 initial version
carl
parents:
diff changeset
3176 # Make sure dlprefiles contains only unique files
45c8592d5d13 initial version
carl
parents:
diff changeset
3177 old_dlprefiles="$dlprefiles"
45c8592d5d13 initial version
carl
parents:
diff changeset
3178 dlprefiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
3179 for lib in $old_dlprefiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3180 case "$dlprefiles " in
45c8592d5d13 initial version
carl
parents:
diff changeset
3181 *" $lib "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3182 *) dlprefiles="$dlprefiles $lib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3183 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3184 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3185
45c8592d5d13 initial version
carl
parents:
diff changeset
3186 if test "$build_libtool_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3187 if test -n "$rpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3188 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
3189 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3190 # these systems don't actually have a c library (as such)!
45c8592d5d13 initial version
carl
parents:
diff changeset
3191 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3192 *-*-rhapsody* | *-*-darwin1.[012])
45c8592d5d13 initial version
carl
parents:
diff changeset
3193 # Rhapsody C library is in the System framework
45c8592d5d13 initial version
carl
parents:
diff changeset
3194 deplibs="$deplibs -framework System"
45c8592d5d13 initial version
carl
parents:
diff changeset
3195 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3196 *-*-netbsd*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3197 # Don't link with libc until the a.out ld.so is fixed.
45c8592d5d13 initial version
carl
parents:
diff changeset
3198 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3199 *-*-openbsd* | *-*-freebsd*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3200 # Do not include libc due to us having libc/libc_r.
45c8592d5d13 initial version
carl
parents:
diff changeset
3201 test "X$arg" = "X-lc" && continue
45c8592d5d13 initial version
carl
parents:
diff changeset
3202 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3203 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
3204 # Add libc to deplibs on all other systems if necessary.
45c8592d5d13 initial version
carl
parents:
diff changeset
3205 if test "$build_libtool_need_lc" = "yes"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3206 deplibs="$deplibs -lc"
45c8592d5d13 initial version
carl
parents:
diff changeset
3207 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3208 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3209 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3210 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3211
45c8592d5d13 initial version
carl
parents:
diff changeset
3212 # Transform deplibs into only deplibs that can be linked in shared.
45c8592d5d13 initial version
carl
parents:
diff changeset
3213 name_save=$name
45c8592d5d13 initial version
carl
parents:
diff changeset
3214 libname_save=$libname
45c8592d5d13 initial version
carl
parents:
diff changeset
3215 release_save=$release
45c8592d5d13 initial version
carl
parents:
diff changeset
3216 versuffix_save=$versuffix
45c8592d5d13 initial version
carl
parents:
diff changeset
3217 major_save=$major
45c8592d5d13 initial version
carl
parents:
diff changeset
3218 # I'm not sure if I'm treating the release correctly. I think
45c8592d5d13 initial version
carl
parents:
diff changeset
3219 # release should show up in the -l (ie -lgmp5) so we don't want to
45c8592d5d13 initial version
carl
parents:
diff changeset
3220 # add it in twice. Is that correct?
45c8592d5d13 initial version
carl
parents:
diff changeset
3221 release=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3222 versuffix=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3223 major=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3224 newdeplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
3225 droppeddeps=no
45c8592d5d13 initial version
carl
parents:
diff changeset
3226 case $deplibs_check_method in
45c8592d5d13 initial version
carl
parents:
diff changeset
3227 pass_all)
45c8592d5d13 initial version
carl
parents:
diff changeset
3228 # Don't check for shared/static. Everything works.
45c8592d5d13 initial version
carl
parents:
diff changeset
3229 # This might be a little naive. We might want to check
45c8592d5d13 initial version
carl
parents:
diff changeset
3230 # whether the library exists or not. But this is on
45c8592d5d13 initial version
carl
parents:
diff changeset
3231 # osf3 & osf4 and I'm not really sure... Just
45c8592d5d13 initial version
carl
parents:
diff changeset
3232 # implementing what was already the behavior.
45c8592d5d13 initial version
carl
parents:
diff changeset
3233 newdeplibs=$deplibs
45c8592d5d13 initial version
carl
parents:
diff changeset
3234 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3235 test_compile)
45c8592d5d13 initial version
carl
parents:
diff changeset
3236 # This code stresses the "libraries are programs" paradigm to its
45c8592d5d13 initial version
carl
parents:
diff changeset
3237 # limits. Maybe even breaks it. We compile a program, linking it
45c8592d5d13 initial version
carl
parents:
diff changeset
3238 # against the deplibs as a proxy for the library. Then we can check
45c8592d5d13 initial version
carl
parents:
diff changeset
3239 # whether they linked in statically or dynamically with ldd.
45c8592d5d13 initial version
carl
parents:
diff changeset
3240 $rm conftest.c
45c8592d5d13 initial version
carl
parents:
diff changeset
3241 cat > conftest.c <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
3242 int main() { return 0; }
45c8592d5d13 initial version
carl
parents:
diff changeset
3243 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
3244 $rm conftest
45c8592d5d13 initial version
carl
parents:
diff changeset
3245 $LTCC -o conftest conftest.c $deplibs
45c8592d5d13 initial version
carl
parents:
diff changeset
3246 if test "$?" -eq 0 ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3247 ldd_output=`ldd conftest`
45c8592d5d13 initial version
carl
parents:
diff changeset
3248 for i in $deplibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3249 name="`expr $i : '-l\(.*\)'`"
45c8592d5d13 initial version
carl
parents:
diff changeset
3250 # If $name is empty we are operating on a -L argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
3251 if test "$name" != "" && test "$name" -ne "0"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3252 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3253 case " $predeps $postdeps " in
45c8592d5d13 initial version
carl
parents:
diff changeset
3254 *" $i "*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3255 newdeplibs="$newdeplibs $i"
45c8592d5d13 initial version
carl
parents:
diff changeset
3256 i=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3257 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3258 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3259 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3260 if test -n "$i" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3261 libname=`eval \\$echo \"$libname_spec\"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3262 deplib_matches=`eval \\$echo \"$library_names_spec\"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3263 set dummy $deplib_matches
45c8592d5d13 initial version
carl
parents:
diff changeset
3264 deplib_match=$2
45c8592d5d13 initial version
carl
parents:
diff changeset
3265 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3266 newdeplibs="$newdeplibs $i"
45c8592d5d13 initial version
carl
parents:
diff changeset
3267 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3268 droppeddeps=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
3269 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
3270 $echo "*** Warning: dynamic linker does not accept needed library $i."
45c8592d5d13 initial version
carl
parents:
diff changeset
3271 $echo "*** I have the capability to make that library automatically link in when"
45c8592d5d13 initial version
carl
parents:
diff changeset
3272 $echo "*** you link to this library. But I can only do this if you have a"
45c8592d5d13 initial version
carl
parents:
diff changeset
3273 $echo "*** shared version of the library, which I believe you do not have"
45c8592d5d13 initial version
carl
parents:
diff changeset
3274 $echo "*** because a test_compile did reveal that the linker did not use it for"
45c8592d5d13 initial version
carl
parents:
diff changeset
3275 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
45c8592d5d13 initial version
carl
parents:
diff changeset
3276 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3277 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3278 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3279 newdeplibs="$newdeplibs $i"
45c8592d5d13 initial version
carl
parents:
diff changeset
3280 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3281 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3282 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3283 # Error occurred in the first compile. Let's try to salvage
45c8592d5d13 initial version
carl
parents:
diff changeset
3284 # the situation: Compile a separate program for each library.
45c8592d5d13 initial version
carl
parents:
diff changeset
3285 for i in $deplibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3286 name="`expr $i : '-l\(.*\)'`"
45c8592d5d13 initial version
carl
parents:
diff changeset
3287 # If $name is empty we are operating on a -L argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
3288 if test "$name" != "" && test "$name" != "0"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3289 $rm conftest
45c8592d5d13 initial version
carl
parents:
diff changeset
3290 $LTCC -o conftest conftest.c $i
45c8592d5d13 initial version
carl
parents:
diff changeset
3291 # Did it work?
45c8592d5d13 initial version
carl
parents:
diff changeset
3292 if test "$?" -eq 0 ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3293 ldd_output=`ldd conftest`
45c8592d5d13 initial version
carl
parents:
diff changeset
3294 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3295 case " $predeps $postdeps " in
45c8592d5d13 initial version
carl
parents:
diff changeset
3296 *" $i "*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3297 newdeplibs="$newdeplibs $i"
45c8592d5d13 initial version
carl
parents:
diff changeset
3298 i=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3299 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3300 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3301 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3302 if test -n "$i" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3303 libname=`eval \\$echo \"$libname_spec\"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3304 deplib_matches=`eval \\$echo \"$library_names_spec\"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3305 set dummy $deplib_matches
45c8592d5d13 initial version
carl
parents:
diff changeset
3306 deplib_match=$2
45c8592d5d13 initial version
carl
parents:
diff changeset
3307 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3308 newdeplibs="$newdeplibs $i"
45c8592d5d13 initial version
carl
parents:
diff changeset
3309 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3310 droppeddeps=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
3311 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
3312 $echo "*** Warning: dynamic linker does not accept needed library $i."
45c8592d5d13 initial version
carl
parents:
diff changeset
3313 $echo "*** I have the capability to make that library automatically link in when"
45c8592d5d13 initial version
carl
parents:
diff changeset
3314 $echo "*** you link to this library. But I can only do this if you have a"
45c8592d5d13 initial version
carl
parents:
diff changeset
3315 $echo "*** shared version of the library, which you do not appear to have"
45c8592d5d13 initial version
carl
parents:
diff changeset
3316 $echo "*** because a test_compile did reveal that the linker did not use this one"
45c8592d5d13 initial version
carl
parents:
diff changeset
3317 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
45c8592d5d13 initial version
carl
parents:
diff changeset
3318 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3319 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3320 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3321 droppeddeps=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
3322 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
3323 $echo "*** Warning! Library $i is needed by this library but I was not able to"
45c8592d5d13 initial version
carl
parents:
diff changeset
3324 $echo "*** make it link in! You will probably need to install it or some"
45c8592d5d13 initial version
carl
parents:
diff changeset
3325 $echo "*** library that it depends on before this library will be fully"
45c8592d5d13 initial version
carl
parents:
diff changeset
3326 $echo "*** functional. Installing it before continuing would be even better."
45c8592d5d13 initial version
carl
parents:
diff changeset
3327 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3328 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3329 newdeplibs="$newdeplibs $i"
45c8592d5d13 initial version
carl
parents:
diff changeset
3330 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3331 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3332 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3333 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3334 file_magic*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3335 set dummy $deplibs_check_method
45c8592d5d13 initial version
carl
parents:
diff changeset
3336 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3337 for a_deplib in $deplibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3338 name="`expr $a_deplib : '-l\(.*\)'`"
45c8592d5d13 initial version
carl
parents:
diff changeset
3339 # If $name is empty we are operating on a -L argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
3340 if test "$name" != "" && test "$name" != "0"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3341 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3342 case " $predeps $postdeps " in
45c8592d5d13 initial version
carl
parents:
diff changeset
3343 *" $a_deplib "*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3344 newdeplibs="$newdeplibs $a_deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3345 a_deplib=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3346 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3347 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3348 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3349 if test -n "$a_deplib" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3350 libname=`eval \\$echo \"$libname_spec\"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3351 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3352 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
45c8592d5d13 initial version
carl
parents:
diff changeset
3353 for potent_lib in $potential_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3354 # Follow soft links.
45c8592d5d13 initial version
carl
parents:
diff changeset
3355 if ls -lLd "$potent_lib" 2>/dev/null \
45c8592d5d13 initial version
carl
parents:
diff changeset
3356 | grep " -> " >/dev/null; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3357 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
3358 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3359 # The statement above tries to avoid entering an
45c8592d5d13 initial version
carl
parents:
diff changeset
3360 # endless loop below, in case of cyclic links.
45c8592d5d13 initial version
carl
parents:
diff changeset
3361 # We might still enter an endless loop, since a link
45c8592d5d13 initial version
carl
parents:
diff changeset
3362 # loop can be closed while we follow links,
45c8592d5d13 initial version
carl
parents:
diff changeset
3363 # but so what?
45c8592d5d13 initial version
carl
parents:
diff changeset
3364 potlib="$potent_lib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3365 while test -h "$potlib" 2>/dev/null; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3366 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
45c8592d5d13 initial version
carl
parents:
diff changeset
3367 case $potliblink in
45c8592d5d13 initial version
carl
parents:
diff changeset
3368 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
45c8592d5d13 initial version
carl
parents:
diff changeset
3369 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
45c8592d5d13 initial version
carl
parents:
diff changeset
3370 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3371 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3372 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
45c8592d5d13 initial version
carl
parents:
diff changeset
3373 | ${SED} 10q \
45c8592d5d13 initial version
carl
parents:
diff changeset
3374 | $EGREP "$file_magic_regex" > /dev/null; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3375 newdeplibs="$newdeplibs $a_deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3376 a_deplib=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3377 break 2
45c8592d5d13 initial version
carl
parents:
diff changeset
3378 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3379 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3380 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3381 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3382 if test -n "$a_deplib" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3383 droppeddeps=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
3384 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
3385 $echo "*** Warning: linker path does not have real file for library $a_deplib."
45c8592d5d13 initial version
carl
parents:
diff changeset
3386 $echo "*** I have the capability to make that library automatically link in when"
45c8592d5d13 initial version
carl
parents:
diff changeset
3387 $echo "*** you link to this library. But I can only do this if you have a"
45c8592d5d13 initial version
carl
parents:
diff changeset
3388 $echo "*** shared version of the library, which you do not appear to have"
45c8592d5d13 initial version
carl
parents:
diff changeset
3389 $echo "*** because I did check the linker path looking for a file starting"
45c8592d5d13 initial version
carl
parents:
diff changeset
3390 if test -z "$potlib" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3391 $echo "*** with $libname but no candidates were found. (...for file magic test)"
45c8592d5d13 initial version
carl
parents:
diff changeset
3392 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3393 $echo "*** with $libname and none of the candidates passed a file format test"
45c8592d5d13 initial version
carl
parents:
diff changeset
3394 $echo "*** using a file magic. Last file checked: $potlib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3395 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3396 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3397 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3398 # Add a -L argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
3399 newdeplibs="$newdeplibs $a_deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3400 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3401 done # Gone through all deplibs.
45c8592d5d13 initial version
carl
parents:
diff changeset
3402 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3403 match_pattern*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3404 set dummy $deplibs_check_method
45c8592d5d13 initial version
carl
parents:
diff changeset
3405 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3406 for a_deplib in $deplibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3407 name="`expr $a_deplib : '-l\(.*\)'`"
45c8592d5d13 initial version
carl
parents:
diff changeset
3408 # If $name is empty we are operating on a -L argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
3409 if test -n "$name" && test "$name" != "0"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3410 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3411 case " $predeps $postdeps " in
45c8592d5d13 initial version
carl
parents:
diff changeset
3412 *" $a_deplib "*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3413 newdeplibs="$newdeplibs $a_deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3414 a_deplib=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3415 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3416 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3417 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3418 if test -n "$a_deplib" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3419 libname=`eval \\$echo \"$libname_spec\"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3420 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3421 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
45c8592d5d13 initial version
carl
parents:
diff changeset
3422 for potent_lib in $potential_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3423 potlib="$potent_lib" # see symlink-check above in file_magic test
45c8592d5d13 initial version
carl
parents:
diff changeset
3424 if eval $echo \"$potent_lib\" 2>/dev/null \
45c8592d5d13 initial version
carl
parents:
diff changeset
3425 | ${SED} 10q \
45c8592d5d13 initial version
carl
parents:
diff changeset
3426 | $EGREP "$match_pattern_regex" > /dev/null; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3427 newdeplibs="$newdeplibs $a_deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3428 a_deplib=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3429 break 2
45c8592d5d13 initial version
carl
parents:
diff changeset
3430 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3431 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3432 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3433 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3434 if test -n "$a_deplib" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3435 droppeddeps=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
3436 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
3437 $echo "*** Warning: linker path does not have real file for library $a_deplib."
45c8592d5d13 initial version
carl
parents:
diff changeset
3438 $echo "*** I have the capability to make that library automatically link in when"
45c8592d5d13 initial version
carl
parents:
diff changeset
3439 $echo "*** you link to this library. But I can only do this if you have a"
45c8592d5d13 initial version
carl
parents:
diff changeset
3440 $echo "*** shared version of the library, which you do not appear to have"
45c8592d5d13 initial version
carl
parents:
diff changeset
3441 $echo "*** because I did check the linker path looking for a file starting"
45c8592d5d13 initial version
carl
parents:
diff changeset
3442 if test -z "$potlib" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3443 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
45c8592d5d13 initial version
carl
parents:
diff changeset
3444 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3445 $echo "*** with $libname and none of the candidates passed a file format test"
45c8592d5d13 initial version
carl
parents:
diff changeset
3446 $echo "*** using a regex pattern. Last file checked: $potlib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3447 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3448 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3449 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3450 # Add a -L argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
3451 newdeplibs="$newdeplibs $a_deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3452 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3453 done # Gone through all deplibs.
45c8592d5d13 initial version
carl
parents:
diff changeset
3454 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3455 none | unknown | *)
45c8592d5d13 initial version
carl
parents:
diff changeset
3456 newdeplibs=""
45c8592d5d13 initial version
carl
parents:
diff changeset
3457 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
45c8592d5d13 initial version
carl
parents:
diff changeset
3458 -e 's/ -[LR][^ ]*//g'`
45c8592d5d13 initial version
carl
parents:
diff changeset
3459 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3460 for i in $predeps $postdeps ; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3461 # can't use Xsed below, because $i might contain '/'
45c8592d5d13 initial version
carl
parents:
diff changeset
3462 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3463 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3464 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3465 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
45c8592d5d13 initial version
carl
parents:
diff changeset
3466 | grep . >/dev/null; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3467 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
3468 if test "X$deplibs_check_method" = "Xnone"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3469 $echo "*** Warning: inter-library dependencies are not supported in this platform."
45c8592d5d13 initial version
carl
parents:
diff changeset
3470 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3471 $echo "*** Warning: inter-library dependencies are not known to be supported."
45c8592d5d13 initial version
carl
parents:
diff changeset
3472 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3473 $echo "*** All declared inter-library dependencies are being dropped."
45c8592d5d13 initial version
carl
parents:
diff changeset
3474 droppeddeps=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
3475 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3476 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3477 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3478 versuffix=$versuffix_save
45c8592d5d13 initial version
carl
parents:
diff changeset
3479 major=$major_save
45c8592d5d13 initial version
carl
parents:
diff changeset
3480 release=$release_save
45c8592d5d13 initial version
carl
parents:
diff changeset
3481 libname=$libname_save
45c8592d5d13 initial version
carl
parents:
diff changeset
3482 name=$name_save
45c8592d5d13 initial version
carl
parents:
diff changeset
3483
45c8592d5d13 initial version
carl
parents:
diff changeset
3484 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
3485 *-*-rhapsody* | *-*-darwin1.[012])
45c8592d5d13 initial version
carl
parents:
diff changeset
3486 # On Rhapsody replace the C library is the System framework
45c8592d5d13 initial version
carl
parents:
diff changeset
3487 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
45c8592d5d13 initial version
carl
parents:
diff changeset
3488 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3489 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3490
45c8592d5d13 initial version
carl
parents:
diff changeset
3491 if test "$droppeddeps" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3492 if test "$module" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3493 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
3494 $echo "*** Warning: libtool could not satisfy all declared inter-library"
45c8592d5d13 initial version
carl
parents:
diff changeset
3495 $echo "*** dependencies of module $libname. Therefore, libtool will create"
45c8592d5d13 initial version
carl
parents:
diff changeset
3496 $echo "*** a static module, that should work as long as the dlopening"
45c8592d5d13 initial version
carl
parents:
diff changeset
3497 $echo "*** application is linked with the -dlopen flag."
45c8592d5d13 initial version
carl
parents:
diff changeset
3498 if test -z "$global_symbol_pipe"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3499 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
3500 $echo "*** However, this would only work if libtool was able to extract symbol"
45c8592d5d13 initial version
carl
parents:
diff changeset
3501 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
45c8592d5d13 initial version
carl
parents:
diff changeset
3502 $echo "*** not find such a program. So, this module is probably useless."
45c8592d5d13 initial version
carl
parents:
diff changeset
3503 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
45c8592d5d13 initial version
carl
parents:
diff changeset
3504 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3505 if test "$build_old_libs" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3506 oldlibs="$output_objdir/$libname.$libext"
45c8592d5d13 initial version
carl
parents:
diff changeset
3507 build_libtool_libs=module
45c8592d5d13 initial version
carl
parents:
diff changeset
3508 build_old_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
3509 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3510 build_libtool_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
3511 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3512 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3513 $echo "*** The inter-library dependencies that have been dropped here will be"
45c8592d5d13 initial version
carl
parents:
diff changeset
3514 $echo "*** automatically added whenever a program is linked with this library"
45c8592d5d13 initial version
carl
parents:
diff changeset
3515 $echo "*** or is declared to -dlopen it."
45c8592d5d13 initial version
carl
parents:
diff changeset
3516
45c8592d5d13 initial version
carl
parents:
diff changeset
3517 if test "$allow_undefined" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3518 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
3519 $echo "*** Since this library must not contain undefined symbols,"
45c8592d5d13 initial version
carl
parents:
diff changeset
3520 $echo "*** because either the platform does not support them or"
45c8592d5d13 initial version
carl
parents:
diff changeset
3521 $echo "*** it was explicitly requested with -no-undefined,"
45c8592d5d13 initial version
carl
parents:
diff changeset
3522 $echo "*** libtool will only create a static version of it."
45c8592d5d13 initial version
carl
parents:
diff changeset
3523 if test "$build_old_libs" = no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3524 oldlibs="$output_objdir/$libname.$libext"
45c8592d5d13 initial version
carl
parents:
diff changeset
3525 build_libtool_libs=module
45c8592d5d13 initial version
carl
parents:
diff changeset
3526 build_old_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
3527 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3528 build_libtool_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
3529 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3530 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3531 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3532 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3533 # Done checking deplibs!
45c8592d5d13 initial version
carl
parents:
diff changeset
3534 deplibs=$newdeplibs
45c8592d5d13 initial version
carl
parents:
diff changeset
3535 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3536
45c8592d5d13 initial version
carl
parents:
diff changeset
3537 # All the library-specific variables (install_libdir is set above).
45c8592d5d13 initial version
carl
parents:
diff changeset
3538 library_names=
45c8592d5d13 initial version
carl
parents:
diff changeset
3539 old_library=
45c8592d5d13 initial version
carl
parents:
diff changeset
3540 dlname=
45c8592d5d13 initial version
carl
parents:
diff changeset
3541
45c8592d5d13 initial version
carl
parents:
diff changeset
3542 # Test again, we may have decided not to build it any more
45c8592d5d13 initial version
carl
parents:
diff changeset
3543 if test "$build_libtool_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3544 if test "$hardcode_into_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3545 # Hardcode the library paths
45c8592d5d13 initial version
carl
parents:
diff changeset
3546 hardcode_libdirs=
45c8592d5d13 initial version
carl
parents:
diff changeset
3547 dep_rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
3548 rpath="$finalize_rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
3549 test "$mode" != relink && rpath="$compile_rpath$rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
3550 for libdir in $rpath; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3551 if test -n "$hardcode_libdir_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3552 if test -n "$hardcode_libdir_separator"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3553 if test -z "$hardcode_libdirs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3554 hardcode_libdirs="$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
3555 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3556 # Just accumulate the unique libdirs.
45c8592d5d13 initial version
carl
parents:
diff changeset
3557 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
45c8592d5d13 initial version
carl
parents:
diff changeset
3558 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
45c8592d5d13 initial version
carl
parents:
diff changeset
3559 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3560 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
3561 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
3562 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3563 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3564 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3565 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3566 eval flag=\"$hardcode_libdir_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3567 dep_rpath="$dep_rpath $flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
3568 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3569 elif test -n "$runpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3570 case "$perm_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
3571 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3572 *) perm_rpath="$perm_rpath $libdir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3573 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3574 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3575 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3576 # Substitute the hardcoded libdirs into the rpath.
45c8592d5d13 initial version
carl
parents:
diff changeset
3577 if test -n "$hardcode_libdir_separator" &&
45c8592d5d13 initial version
carl
parents:
diff changeset
3578 test -n "$hardcode_libdirs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3579 libdir="$hardcode_libdirs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3580 if test -n "$hardcode_libdir_flag_spec_ld"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3581 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3582 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3583 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3584 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3585 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3586 if test -n "$runpath_var" && test -n "$perm_rpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3587 # We should set the runpath_var.
45c8592d5d13 initial version
carl
parents:
diff changeset
3588 rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
3589 for dir in $perm_rpath; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3590 rpath="$rpath$dir:"
45c8592d5d13 initial version
carl
parents:
diff changeset
3591 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3592 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
45c8592d5d13 initial version
carl
parents:
diff changeset
3593 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3594 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3595 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3596
45c8592d5d13 initial version
carl
parents:
diff changeset
3597 shlibpath="$finalize_shlibpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
3598 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
3599 if test -n "$shlibpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3600 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
45c8592d5d13 initial version
carl
parents:
diff changeset
3601 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3602
45c8592d5d13 initial version
carl
parents:
diff changeset
3603 # Get the real and link names of the library.
45c8592d5d13 initial version
carl
parents:
diff changeset
3604 eval shared_ext=\"$shrext_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3605 eval library_names=\"$library_names_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3606 set dummy $library_names
45c8592d5d13 initial version
carl
parents:
diff changeset
3607 realname="$2"
45c8592d5d13 initial version
carl
parents:
diff changeset
3608 shift; shift
45c8592d5d13 initial version
carl
parents:
diff changeset
3609
45c8592d5d13 initial version
carl
parents:
diff changeset
3610 if test -n "$soname_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3611 eval soname=\"$soname_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3612 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3613 soname="$realname"
45c8592d5d13 initial version
carl
parents:
diff changeset
3614 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3615 if test -z "$dlname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3616 dlname=$soname
45c8592d5d13 initial version
carl
parents:
diff changeset
3617 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3618
45c8592d5d13 initial version
carl
parents:
diff changeset
3619 lib="$output_objdir/$realname"
45c8592d5d13 initial version
carl
parents:
diff changeset
3620 for link
45c8592d5d13 initial version
carl
parents:
diff changeset
3621 do
45c8592d5d13 initial version
carl
parents:
diff changeset
3622 linknames="$linknames $link"
45c8592d5d13 initial version
carl
parents:
diff changeset
3623 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3624
45c8592d5d13 initial version
carl
parents:
diff changeset
3625 # Use standard objects if they are pic
45c8592d5d13 initial version
carl
parents:
diff changeset
3626 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
45c8592d5d13 initial version
carl
parents:
diff changeset
3627
45c8592d5d13 initial version
carl
parents:
diff changeset
3628 # Prepare the list of exported symbols
45c8592d5d13 initial version
carl
parents:
diff changeset
3629 if test -z "$export_symbols"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3630 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3631 $show "generating symbol list for \`$libname.la'"
45c8592d5d13 initial version
carl
parents:
diff changeset
3632 export_symbols="$output_objdir/$libname.exp"
45c8592d5d13 initial version
carl
parents:
diff changeset
3633 $run $rm $export_symbols
45c8592d5d13 initial version
carl
parents:
diff changeset
3634 cmds=$export_symbols_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
3635 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
3636 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3637 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3638 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3639 if len=`expr "X$cmd" : ".*"` &&
45c8592d5d13 initial version
carl
parents:
diff changeset
3640 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3641 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
3642 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
3643 skipped_export=false
45c8592d5d13 initial version
carl
parents:
diff changeset
3644 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3645 # The command line is too long to execute in one step.
45c8592d5d13 initial version
carl
parents:
diff changeset
3646 $show "using reloadable object file for export list..."
45c8592d5d13 initial version
carl
parents:
diff changeset
3647 skipped_export=:
45c8592d5d13 initial version
carl
parents:
diff changeset
3648 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3649 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3650 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3651 if test -n "$export_symbols_regex"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3652 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
45c8592d5d13 initial version
carl
parents:
diff changeset
3653 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
45c8592d5d13 initial version
carl
parents:
diff changeset
3654 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
45c8592d5d13 initial version
carl
parents:
diff changeset
3655 $run eval '$mv "${export_symbols}T" "$export_symbols"'
45c8592d5d13 initial version
carl
parents:
diff changeset
3656 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3657 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3658 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3659
45c8592d5d13 initial version
carl
parents:
diff changeset
3660 if test -n "$export_symbols" && test -n "$include_expsyms"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3661 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
45c8592d5d13 initial version
carl
parents:
diff changeset
3662 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3663
45c8592d5d13 initial version
carl
parents:
diff changeset
3664 tmp_deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
3665 for test_deplib in $deplibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3666 case " $convenience " in
45c8592d5d13 initial version
carl
parents:
diff changeset
3667 *" $test_deplib "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3668 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
3669 tmp_deplibs="$tmp_deplibs $test_deplib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3670 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3671 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3672 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3673 deplibs="$tmp_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3674
45c8592d5d13 initial version
carl
parents:
diff changeset
3675 if test -n "$convenience"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3676 if test -n "$whole_archive_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3677 save_libobjs=$libobjs
45c8592d5d13 initial version
carl
parents:
diff changeset
3678 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3679 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3680 gentop="$output_objdir/${outputname}x"
45c8592d5d13 initial version
carl
parents:
diff changeset
3681 $show "${rm}r $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3682 $run ${rm}r "$gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3683 $show "$mkdir $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3684 $run $mkdir "$gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3685 status=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
3686 if test "$status" -ne 0 && test ! -d "$gentop"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3687 exit $status
45c8592d5d13 initial version
carl
parents:
diff changeset
3688 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3689 generated="$generated $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3690
45c8592d5d13 initial version
carl
parents:
diff changeset
3691 for xlib in $convenience; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3692 # Extract the objects.
45c8592d5d13 initial version
carl
parents:
diff changeset
3693 case $xlib in
45c8592d5d13 initial version
carl
parents:
diff changeset
3694 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3695 *) xabs=`pwd`"/$xlib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3696 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3697 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
3698 xdir="$gentop/$xlib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3699
45c8592d5d13 initial version
carl
parents:
diff changeset
3700 $show "${rm}r $xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
3701 $run ${rm}r "$xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
3702 $show "$mkdir $xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
3703 $run $mkdir "$xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
3704 status=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
3705 if test "$status" -ne 0 && test ! -d "$xdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3706 exit $status
45c8592d5d13 initial version
carl
parents:
diff changeset
3707 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3708 # We will extract separately just the conflicting names and we will no
45c8592d5d13 initial version
carl
parents:
diff changeset
3709 # longer touch any unique names. It is faster to leave these extract
45c8592d5d13 initial version
carl
parents:
diff changeset
3710 # automatically by $AR in one run.
45c8592d5d13 initial version
carl
parents:
diff changeset
3711 $show "(cd $xdir && $AR x $xabs)"
45c8592d5d13 initial version
carl
parents:
diff changeset
3712 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
3713 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
45c8592d5d13 initial version
carl
parents:
diff changeset
3714 :
45c8592d5d13 initial version
carl
parents:
diff changeset
3715 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3716 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3717 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3718 $AR t "$xabs" | sort | uniq -cd | while read -r count name
45c8592d5d13 initial version
carl
parents:
diff changeset
3719 do
45c8592d5d13 initial version
carl
parents:
diff changeset
3720 i=1
45c8592d5d13 initial version
carl
parents:
diff changeset
3721 while test "$i" -le "$count"
45c8592d5d13 initial version
carl
parents:
diff changeset
3722 do
45c8592d5d13 initial version
carl
parents:
diff changeset
3723 # Put our $i before any first dot (extension)
45c8592d5d13 initial version
carl
parents:
diff changeset
3724 # Never overwrite any file
45c8592d5d13 initial version
carl
parents:
diff changeset
3725 name_to="$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
3726 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
45c8592d5d13 initial version
carl
parents:
diff changeset
3727 do
45c8592d5d13 initial version
carl
parents:
diff changeset
3728 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3729 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3730 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
45c8592d5d13 initial version
carl
parents:
diff changeset
3731 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
3732 i=`expr $i + 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
3733 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3734 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3735 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3736
45c8592d5d13 initial version
carl
parents:
diff changeset
3737 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
45c8592d5d13 initial version
carl
parents:
diff changeset
3738 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3739 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3740 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3741
45c8592d5d13 initial version
carl
parents:
diff changeset
3742 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3743 eval flag=\"$thread_safe_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3744 linker_flags="$linker_flags $flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
3745 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3746
45c8592d5d13 initial version
carl
parents:
diff changeset
3747 # Make a backup of the uninstalled library when relinking
45c8592d5d13 initial version
carl
parents:
diff changeset
3748 if test "$mode" = relink; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3749 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
3750 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3751
45c8592d5d13 initial version
carl
parents:
diff changeset
3752 # Do each of the archive commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
3753 if test "$module" = yes && test -n "$module_cmds" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3754 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3755 eval test_cmds=\"$module_expsym_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3756 cmds=$module_expsym_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
3757 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3758 eval test_cmds=\"$module_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3759 cmds=$module_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
3760 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3761 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3762 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3763 eval test_cmds=\"$archive_expsym_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3764 cmds=$archive_expsym_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
3765 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3766 eval test_cmds=\"$archive_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3767 cmds=$archive_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
3768 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3769 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3770
45c8592d5d13 initial version
carl
parents:
diff changeset
3771 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
45c8592d5d13 initial version
carl
parents:
diff changeset
3772 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3773 :
45c8592d5d13 initial version
carl
parents:
diff changeset
3774 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3775 # The command line is too long to link in one step, link piecewise.
45c8592d5d13 initial version
carl
parents:
diff changeset
3776 $echo "creating reloadable object files..."
45c8592d5d13 initial version
carl
parents:
diff changeset
3777
45c8592d5d13 initial version
carl
parents:
diff changeset
3778 # Save the value of $output and $libobjs because we want to
45c8592d5d13 initial version
carl
parents:
diff changeset
3779 # use them later. If we have whole_archive_flag_spec, we
45c8592d5d13 initial version
carl
parents:
diff changeset
3780 # want to use save_libobjs as it was before
45c8592d5d13 initial version
carl
parents:
diff changeset
3781 # whole_archive_flag_spec was expanded, because we can't
45c8592d5d13 initial version
carl
parents:
diff changeset
3782 # assume the linker understands whole_archive_flag_spec.
45c8592d5d13 initial version
carl
parents:
diff changeset
3783 # This may have to be revisited, in case too many
45c8592d5d13 initial version
carl
parents:
diff changeset
3784 # convenience libraries get linked in and end up exceeding
45c8592d5d13 initial version
carl
parents:
diff changeset
3785 # the spec.
45c8592d5d13 initial version
carl
parents:
diff changeset
3786 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3787 save_libobjs=$libobjs
45c8592d5d13 initial version
carl
parents:
diff changeset
3788 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3789 save_output=$output
45c8592d5d13 initial version
carl
parents:
diff changeset
3790
45c8592d5d13 initial version
carl
parents:
diff changeset
3791 # Clear the reloadable object creation command queue and
45c8592d5d13 initial version
carl
parents:
diff changeset
3792 # initialize k to one.
45c8592d5d13 initial version
carl
parents:
diff changeset
3793 test_cmds=
45c8592d5d13 initial version
carl
parents:
diff changeset
3794 concat_cmds=
45c8592d5d13 initial version
carl
parents:
diff changeset
3795 objlist=
45c8592d5d13 initial version
carl
parents:
diff changeset
3796 delfiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
3797 last_robj=
45c8592d5d13 initial version
carl
parents:
diff changeset
3798 k=1
45c8592d5d13 initial version
carl
parents:
diff changeset
3799 output=$output_objdir/$save_output-${k}.$objext
45c8592d5d13 initial version
carl
parents:
diff changeset
3800 # Loop over the list of objects to be linked.
45c8592d5d13 initial version
carl
parents:
diff changeset
3801 for obj in $save_libobjs
45c8592d5d13 initial version
carl
parents:
diff changeset
3802 do
45c8592d5d13 initial version
carl
parents:
diff changeset
3803 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3804 if test "X$objlist" = X ||
45c8592d5d13 initial version
carl
parents:
diff changeset
3805 { len=`expr "X$test_cmds" : ".*"` &&
45c8592d5d13 initial version
carl
parents:
diff changeset
3806 test "$len" -le "$max_cmd_len"; }; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3807 objlist="$objlist $obj"
45c8592d5d13 initial version
carl
parents:
diff changeset
3808 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3809 # The command $test_cmds is almost too long, add a
45c8592d5d13 initial version
carl
parents:
diff changeset
3810 # command to the queue.
45c8592d5d13 initial version
carl
parents:
diff changeset
3811 if test "$k" -eq 1 ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3812 # The first file doesn't have a previous command to add.
45c8592d5d13 initial version
carl
parents:
diff changeset
3813 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3814 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3815 # All subsequent reloadable object files will link in
45c8592d5d13 initial version
carl
parents:
diff changeset
3816 # the last one created.
45c8592d5d13 initial version
carl
parents:
diff changeset
3817 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3818 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3819 last_robj=$output_objdir/$save_output-${k}.$objext
45c8592d5d13 initial version
carl
parents:
diff changeset
3820 k=`expr $k + 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
3821 output=$output_objdir/$save_output-${k}.$objext
45c8592d5d13 initial version
carl
parents:
diff changeset
3822 objlist=$obj
45c8592d5d13 initial version
carl
parents:
diff changeset
3823 len=1
45c8592d5d13 initial version
carl
parents:
diff changeset
3824 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3825 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3826 # Handle the remaining objects by creating one last
45c8592d5d13 initial version
carl
parents:
diff changeset
3827 # reloadable object file. All subsequent reloadable object
45c8592d5d13 initial version
carl
parents:
diff changeset
3828 # files will link in the last one created.
45c8592d5d13 initial version
carl
parents:
diff changeset
3829 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
45c8592d5d13 initial version
carl
parents:
diff changeset
3830 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3831
45c8592d5d13 initial version
carl
parents:
diff changeset
3832 if ${skipped_export-false}; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3833 $show "generating symbol list for \`$libname.la'"
45c8592d5d13 initial version
carl
parents:
diff changeset
3834 export_symbols="$output_objdir/$libname.exp"
45c8592d5d13 initial version
carl
parents:
diff changeset
3835 $run $rm $export_symbols
45c8592d5d13 initial version
carl
parents:
diff changeset
3836 libobjs=$output
45c8592d5d13 initial version
carl
parents:
diff changeset
3837 # Append the command to create the export file.
45c8592d5d13 initial version
carl
parents:
diff changeset
3838 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3839 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3840
45c8592d5d13 initial version
carl
parents:
diff changeset
3841 # Set up a command to remove the reloadale object files
45c8592d5d13 initial version
carl
parents:
diff changeset
3842 # after they are used.
45c8592d5d13 initial version
carl
parents:
diff changeset
3843 i=0
45c8592d5d13 initial version
carl
parents:
diff changeset
3844 while test "$i" -lt "$k"
45c8592d5d13 initial version
carl
parents:
diff changeset
3845 do
45c8592d5d13 initial version
carl
parents:
diff changeset
3846 i=`expr $i + 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
3847 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
45c8592d5d13 initial version
carl
parents:
diff changeset
3848 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3849
45c8592d5d13 initial version
carl
parents:
diff changeset
3850 $echo "creating a temporary reloadable object file: $output"
45c8592d5d13 initial version
carl
parents:
diff changeset
3851
45c8592d5d13 initial version
carl
parents:
diff changeset
3852 # Loop through the commands generated above and execute them.
45c8592d5d13 initial version
carl
parents:
diff changeset
3853 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
3854 for cmd in $concat_cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3855 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3856 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
3857 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
3858 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3859 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3860
45c8592d5d13 initial version
carl
parents:
diff changeset
3861 libobjs=$output
45c8592d5d13 initial version
carl
parents:
diff changeset
3862 # Restore the value of output.
45c8592d5d13 initial version
carl
parents:
diff changeset
3863 output=$save_output
45c8592d5d13 initial version
carl
parents:
diff changeset
3864
45c8592d5d13 initial version
carl
parents:
diff changeset
3865 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3866 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3867 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3868 # Expand the library linking commands again to reset the
45c8592d5d13 initial version
carl
parents:
diff changeset
3869 # value of $libobjs for piecewise linking.
45c8592d5d13 initial version
carl
parents:
diff changeset
3870
45c8592d5d13 initial version
carl
parents:
diff changeset
3871 # Do each of the archive commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
3872 if test "$module" = yes && test -n "$module_cmds" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3873 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3874 cmds=$module_expsym_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
3875 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3876 cmds=$module_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
3877 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3878 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3879 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3880 cmds=$archive_expsym_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
3881 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3882 cmds=$archive_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
3883 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3884 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3885
45c8592d5d13 initial version
carl
parents:
diff changeset
3886 # Append the command to remove the reloadable object files
45c8592d5d13 initial version
carl
parents:
diff changeset
3887 # to the just-reset $cmds.
45c8592d5d13 initial version
carl
parents:
diff changeset
3888 eval cmds=\"\$cmds~\$rm $delfiles\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3889 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3890 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
3891 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3892 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3893 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3894 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
3895 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
3896 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3897 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
3898
45c8592d5d13 initial version
carl
parents:
diff changeset
3899 # Restore the uninstalled library and exit
45c8592d5d13 initial version
carl
parents:
diff changeset
3900 if test "$mode" = relink; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3901 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
3902 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
3903 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3904
45c8592d5d13 initial version
carl
parents:
diff changeset
3905 # Create links to the real library.
45c8592d5d13 initial version
carl
parents:
diff changeset
3906 for linkname in $linknames; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3907 if test "$realname" != "$linkname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3908 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
45c8592d5d13 initial version
carl
parents:
diff changeset
3909 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
3910 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3911 done
45c8592d5d13 initial version
carl
parents:
diff changeset
3912
45c8592d5d13 initial version
carl
parents:
diff changeset
3913 # If -module or -export-dynamic was specified, set the dlname.
45c8592d5d13 initial version
carl
parents:
diff changeset
3914 if test "$module" = yes || test "$export_dynamic" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3915 # On all known operating systems, these are identical.
45c8592d5d13 initial version
carl
parents:
diff changeset
3916 dlname="$soname"
45c8592d5d13 initial version
carl
parents:
diff changeset
3917 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3918 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3919 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3920
45c8592d5d13 initial version
carl
parents:
diff changeset
3921 obj)
45c8592d5d13 initial version
carl
parents:
diff changeset
3922 if test -n "$deplibs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3923 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3924 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3925
45c8592d5d13 initial version
carl
parents:
diff changeset
3926 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3927 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3928 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3929
45c8592d5d13 initial version
carl
parents:
diff changeset
3930 if test -n "$rpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3931 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3932 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3933
45c8592d5d13 initial version
carl
parents:
diff changeset
3934 if test -n "$xrpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3935 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3936 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3937
45c8592d5d13 initial version
carl
parents:
diff changeset
3938 if test -n "$vinfo"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3939 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3940 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3941
45c8592d5d13 initial version
carl
parents:
diff changeset
3942 if test -n "$release"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3943 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3944 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3945
45c8592d5d13 initial version
carl
parents:
diff changeset
3946 case $output in
45c8592d5d13 initial version
carl
parents:
diff changeset
3947 *.lo)
45c8592d5d13 initial version
carl
parents:
diff changeset
3948 if test -n "$objs$old_deplibs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3949 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
3950 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
3951 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3952 libobj="$output"
45c8592d5d13 initial version
carl
parents:
diff changeset
3953 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
45c8592d5d13 initial version
carl
parents:
diff changeset
3954 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3955 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
3956 libobj=
45c8592d5d13 initial version
carl
parents:
diff changeset
3957 obj="$output"
45c8592d5d13 initial version
carl
parents:
diff changeset
3958 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3959 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3960
45c8592d5d13 initial version
carl
parents:
diff changeset
3961 # Delete the old objects.
45c8592d5d13 initial version
carl
parents:
diff changeset
3962 $run $rm $obj $libobj
45c8592d5d13 initial version
carl
parents:
diff changeset
3963
45c8592d5d13 initial version
carl
parents:
diff changeset
3964 # Objects from convenience libraries. This assumes
45c8592d5d13 initial version
carl
parents:
diff changeset
3965 # single-version convenience libraries. Whenever we create
45c8592d5d13 initial version
carl
parents:
diff changeset
3966 # different ones for PIC/non-PIC, this we'll have to duplicate
45c8592d5d13 initial version
carl
parents:
diff changeset
3967 # the extraction.
45c8592d5d13 initial version
carl
parents:
diff changeset
3968 reload_conv_objs=
45c8592d5d13 initial version
carl
parents:
diff changeset
3969 gentop=
45c8592d5d13 initial version
carl
parents:
diff changeset
3970 # reload_cmds runs $LD directly, so let us get rid of
45c8592d5d13 initial version
carl
parents:
diff changeset
3971 # -Wl from whole_archive_flag_spec
45c8592d5d13 initial version
carl
parents:
diff changeset
3972 wl=
45c8592d5d13 initial version
carl
parents:
diff changeset
3973
45c8592d5d13 initial version
carl
parents:
diff changeset
3974 if test -n "$convenience"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3975 if test -n "$whole_archive_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3976 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
3977 else
45c8592d5d13 initial version
carl
parents:
diff changeset
3978 gentop="$output_objdir/${obj}x"
45c8592d5d13 initial version
carl
parents:
diff changeset
3979 $show "${rm}r $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3980 $run ${rm}r "$gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3981 $show "$mkdir $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3982 $run $mkdir "$gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3983 status=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
3984 if test "$status" -ne 0 && test ! -d "$gentop"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
3985 exit $status
45c8592d5d13 initial version
carl
parents:
diff changeset
3986 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
3987 generated="$generated $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
3988
45c8592d5d13 initial version
carl
parents:
diff changeset
3989 for xlib in $convenience; do
45c8592d5d13 initial version
carl
parents:
diff changeset
3990 # Extract the objects.
45c8592d5d13 initial version
carl
parents:
diff changeset
3991 case $xlib in
45c8592d5d13 initial version
carl
parents:
diff changeset
3992 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3993 *) xabs=`pwd`"/$xlib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
3994 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
3995 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
3996 xdir="$gentop/$xlib"
45c8592d5d13 initial version
carl
parents:
diff changeset
3997
45c8592d5d13 initial version
carl
parents:
diff changeset
3998 $show "${rm}r $xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
3999 $run ${rm}r "$xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
4000 $show "$mkdir $xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
4001 $run $mkdir "$xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
4002 status=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
4003 if test "$status" -ne 0 && test ! -d "$xdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4004 exit $status
45c8592d5d13 initial version
carl
parents:
diff changeset
4005 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4006 # We will extract separately just the conflicting names and we will no
45c8592d5d13 initial version
carl
parents:
diff changeset
4007 # longer touch any unique names. It is faster to leave these extract
45c8592d5d13 initial version
carl
parents:
diff changeset
4008 # automatically by $AR in one run.
45c8592d5d13 initial version
carl
parents:
diff changeset
4009 $show "(cd $xdir && $AR x $xabs)"
45c8592d5d13 initial version
carl
parents:
diff changeset
4010 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
4011 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
45c8592d5d13 initial version
carl
parents:
diff changeset
4012 :
45c8592d5d13 initial version
carl
parents:
diff changeset
4013 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4014 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4015 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4016 $AR t "$xabs" | sort | uniq -cd | while read -r count name
45c8592d5d13 initial version
carl
parents:
diff changeset
4017 do
45c8592d5d13 initial version
carl
parents:
diff changeset
4018 i=1
45c8592d5d13 initial version
carl
parents:
diff changeset
4019 while test "$i" -le "$count"
45c8592d5d13 initial version
carl
parents:
diff changeset
4020 do
45c8592d5d13 initial version
carl
parents:
diff changeset
4021 # Put our $i before any first dot (extension)
45c8592d5d13 initial version
carl
parents:
diff changeset
4022 # Never overwrite any file
45c8592d5d13 initial version
carl
parents:
diff changeset
4023 name_to="$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
4024 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
45c8592d5d13 initial version
carl
parents:
diff changeset
4025 do
45c8592d5d13 initial version
carl
parents:
diff changeset
4026 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
45c8592d5d13 initial version
carl
parents:
diff changeset
4027 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4028 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
45c8592d5d13 initial version
carl
parents:
diff changeset
4029 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
4030 i=`expr $i + 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
4031 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4032 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4033 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4034
45c8592d5d13 initial version
carl
parents:
diff changeset
4035 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
45c8592d5d13 initial version
carl
parents:
diff changeset
4036 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4037 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4038 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4039
45c8592d5d13 initial version
carl
parents:
diff changeset
4040 # Create the old-style object.
45c8592d5d13 initial version
carl
parents:
diff changeset
4041 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
45c8592d5d13 initial version
carl
parents:
diff changeset
4042
45c8592d5d13 initial version
carl
parents:
diff changeset
4043 output="$obj"
45c8592d5d13 initial version
carl
parents:
diff changeset
4044 cmds=$reload_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
4045 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
4046 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4047 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
4048 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4049 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
4050 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
4051 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4052 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
4053
45c8592d5d13 initial version
carl
parents:
diff changeset
4054 # Exit if we aren't doing a library object file.
45c8592d5d13 initial version
carl
parents:
diff changeset
4055 if test -z "$libobj"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4056 if test -n "$gentop"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4057 $show "${rm}r $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
4058 $run ${rm}r $gentop
45c8592d5d13 initial version
carl
parents:
diff changeset
4059 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4060
45c8592d5d13 initial version
carl
parents:
diff changeset
4061 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
4062 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4063
45c8592d5d13 initial version
carl
parents:
diff changeset
4064 if test "$build_libtool_libs" != yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4065 if test -n "$gentop"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4066 $show "${rm}r $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
4067 $run ${rm}r $gentop
45c8592d5d13 initial version
carl
parents:
diff changeset
4068 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4069
45c8592d5d13 initial version
carl
parents:
diff changeset
4070 # Create an invalid libtool object if no PIC, so that we don't
45c8592d5d13 initial version
carl
parents:
diff changeset
4071 # accidentally link it into a program.
45c8592d5d13 initial version
carl
parents:
diff changeset
4072 # $show "echo timestamp > $libobj"
45c8592d5d13 initial version
carl
parents:
diff changeset
4073 # $run eval "echo timestamp > $libobj" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
4074 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
4075 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4076
45c8592d5d13 initial version
carl
parents:
diff changeset
4077 if test -n "$pic_flag" || test "$pic_mode" != default; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4078 # Only do commands if we really have different PIC objects.
45c8592d5d13 initial version
carl
parents:
diff changeset
4079 reload_objs="$libobjs $reload_conv_objs"
45c8592d5d13 initial version
carl
parents:
diff changeset
4080 output="$libobj"
45c8592d5d13 initial version
carl
parents:
diff changeset
4081 cmds=$reload_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
4082 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
4083 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4084 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
4085 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4086 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
4087 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
4088 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4089 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
4090 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4091
45c8592d5d13 initial version
carl
parents:
diff changeset
4092 if test -n "$gentop"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4093 $show "${rm}r $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
4094 $run ${rm}r $gentop
45c8592d5d13 initial version
carl
parents:
diff changeset
4095 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4096
45c8592d5d13 initial version
carl
parents:
diff changeset
4097 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
4098 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4099
45c8592d5d13 initial version
carl
parents:
diff changeset
4100 prog)
45c8592d5d13 initial version
carl
parents:
diff changeset
4101 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
4102 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4103 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4104 if test -n "$vinfo"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4105 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4106 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4107
45c8592d5d13 initial version
carl
parents:
diff changeset
4108 if test -n "$release"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4109 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4110 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4111
45c8592d5d13 initial version
carl
parents:
diff changeset
4112 if test "$preload" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4113 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
45c8592d5d13 initial version
carl
parents:
diff changeset
4114 test "$dlopen_self_static" = unknown; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4115 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
45c8592d5d13 initial version
carl
parents:
diff changeset
4116 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4117 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4118
45c8592d5d13 initial version
carl
parents:
diff changeset
4119 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
4120 *-*-rhapsody* | *-*-darwin1.[012])
45c8592d5d13 initial version
carl
parents:
diff changeset
4121 # On Rhapsody replace the C library is the System framework
45c8592d5d13 initial version
carl
parents:
diff changeset
4122 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
45c8592d5d13 initial version
carl
parents:
diff changeset
4123 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
45c8592d5d13 initial version
carl
parents:
diff changeset
4124 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4125 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4126
45c8592d5d13 initial version
carl
parents:
diff changeset
4127 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
4128 *darwin*)
45c8592d5d13 initial version
carl
parents:
diff changeset
4129 # Don't allow lazy linking, it breaks C++ global constructors
45c8592d5d13 initial version
carl
parents:
diff changeset
4130 if test "$tagname" = CXX ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4131 compile_command="$compile_command ${wl}-bind_at_load"
45c8592d5d13 initial version
carl
parents:
diff changeset
4132 finalize_command="$finalize_command ${wl}-bind_at_load"
45c8592d5d13 initial version
carl
parents:
diff changeset
4133 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4134 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4135 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4136
45c8592d5d13 initial version
carl
parents:
diff changeset
4137 compile_command="$compile_command $compile_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
4138 finalize_command="$finalize_command $finalize_deplibs"
45c8592d5d13 initial version
carl
parents:
diff changeset
4139
45c8592d5d13 initial version
carl
parents:
diff changeset
4140 if test -n "$rpath$xrpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4141 # If the user specified any rpath flags, then add them.
45c8592d5d13 initial version
carl
parents:
diff changeset
4142 for libdir in $rpath $xrpath; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4143 # This is the magic to use -rpath.
45c8592d5d13 initial version
carl
parents:
diff changeset
4144 case "$finalize_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
4145 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4146 *) finalize_rpath="$finalize_rpath $libdir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4147 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4148 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4149 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4150
45c8592d5d13 initial version
carl
parents:
diff changeset
4151 # Now hardcode the library paths
45c8592d5d13 initial version
carl
parents:
diff changeset
4152 rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
4153 hardcode_libdirs=
45c8592d5d13 initial version
carl
parents:
diff changeset
4154 for libdir in $compile_rpath $finalize_rpath; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4155 if test -n "$hardcode_libdir_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4156 if test -n "$hardcode_libdir_separator"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4157 if test -z "$hardcode_libdirs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4158 hardcode_libdirs="$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
4159 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4160 # Just accumulate the unique libdirs.
45c8592d5d13 initial version
carl
parents:
diff changeset
4161 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
45c8592d5d13 initial version
carl
parents:
diff changeset
4162 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
45c8592d5d13 initial version
carl
parents:
diff changeset
4163 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4164 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
4165 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
4166 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4167 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4168 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4169 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4170 eval flag=\"$hardcode_libdir_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4171 rpath="$rpath $flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
4172 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4173 elif test -n "$runpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4174 case "$perm_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
4175 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4176 *) perm_rpath="$perm_rpath $libdir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4177 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4178 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4179 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
4180 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
45c8592d5d13 initial version
carl
parents:
diff changeset
4181 case :$dllsearchpath: in
45c8592d5d13 initial version
carl
parents:
diff changeset
4182 *":$libdir:"*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4183 *) dllsearchpath="$dllsearchpath:$libdir";;
45c8592d5d13 initial version
carl
parents:
diff changeset
4184 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4185 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4186 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4187 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4188 # Substitute the hardcoded libdirs into the rpath.
45c8592d5d13 initial version
carl
parents:
diff changeset
4189 if test -n "$hardcode_libdir_separator" &&
45c8592d5d13 initial version
carl
parents:
diff changeset
4190 test -n "$hardcode_libdirs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4191 libdir="$hardcode_libdirs"
45c8592d5d13 initial version
carl
parents:
diff changeset
4192 eval rpath=\" $hardcode_libdir_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4193 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4194 compile_rpath="$rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4195
45c8592d5d13 initial version
carl
parents:
diff changeset
4196 rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
4197 hardcode_libdirs=
45c8592d5d13 initial version
carl
parents:
diff changeset
4198 for libdir in $finalize_rpath; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4199 if test -n "$hardcode_libdir_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4200 if test -n "$hardcode_libdir_separator"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4201 if test -z "$hardcode_libdirs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4202 hardcode_libdirs="$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
4203 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4204 # Just accumulate the unique libdirs.
45c8592d5d13 initial version
carl
parents:
diff changeset
4205 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
45c8592d5d13 initial version
carl
parents:
diff changeset
4206 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
45c8592d5d13 initial version
carl
parents:
diff changeset
4207 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4208 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
4209 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
4210 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4211 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4212 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4213 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4214 eval flag=\"$hardcode_libdir_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4215 rpath="$rpath $flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
4216 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4217 elif test -n "$runpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4218 case "$finalize_perm_rpath " in
45c8592d5d13 initial version
carl
parents:
diff changeset
4219 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4220 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4221 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4222 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4223 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4224 # Substitute the hardcoded libdirs into the rpath.
45c8592d5d13 initial version
carl
parents:
diff changeset
4225 if test -n "$hardcode_libdir_separator" &&
45c8592d5d13 initial version
carl
parents:
diff changeset
4226 test -n "$hardcode_libdirs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4227 libdir="$hardcode_libdirs"
45c8592d5d13 initial version
carl
parents:
diff changeset
4228 eval rpath=\" $hardcode_libdir_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4229 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4230 finalize_rpath="$rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4231
45c8592d5d13 initial version
carl
parents:
diff changeset
4232 if test -n "$libobjs" && test "$build_old_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4233 # Transform all the library objects into standard objects.
45c8592d5d13 initial version
carl
parents:
diff changeset
4234 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
45c8592d5d13 initial version
carl
parents:
diff changeset
4235 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
45c8592d5d13 initial version
carl
parents:
diff changeset
4236 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4237
45c8592d5d13 initial version
carl
parents:
diff changeset
4238 dlsyms=
45c8592d5d13 initial version
carl
parents:
diff changeset
4239 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4240 if test -n "$NM" && test -n "$global_symbol_pipe"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4241 dlsyms="${outputname}S.c"
45c8592d5d13 initial version
carl
parents:
diff changeset
4242 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4243 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4244 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4245 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4246
45c8592d5d13 initial version
carl
parents:
diff changeset
4247 if test -n "$dlsyms"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4248 case $dlsyms in
45c8592d5d13 initial version
carl
parents:
diff changeset
4249 "") ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4250 *.c)
45c8592d5d13 initial version
carl
parents:
diff changeset
4251 # Discover the nlist of each of the dlfiles.
45c8592d5d13 initial version
carl
parents:
diff changeset
4252 nlist="$output_objdir/${outputname}.nm"
45c8592d5d13 initial version
carl
parents:
diff changeset
4253
45c8592d5d13 initial version
carl
parents:
diff changeset
4254 $show "$rm $nlist ${nlist}S ${nlist}T"
45c8592d5d13 initial version
carl
parents:
diff changeset
4255 $run $rm "$nlist" "${nlist}S" "${nlist}T"
45c8592d5d13 initial version
carl
parents:
diff changeset
4256
45c8592d5d13 initial version
carl
parents:
diff changeset
4257 # Parse the name list into a source file.
45c8592d5d13 initial version
carl
parents:
diff changeset
4258 $show "creating $output_objdir/$dlsyms"
45c8592d5d13 initial version
carl
parents:
diff changeset
4259
45c8592d5d13 initial version
carl
parents:
diff changeset
4260 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4261 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
45c8592d5d13 initial version
carl
parents:
diff changeset
4262 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
45c8592d5d13 initial version
carl
parents:
diff changeset
4263
45c8592d5d13 initial version
carl
parents:
diff changeset
4264 #ifdef __cplusplus
45c8592d5d13 initial version
carl
parents:
diff changeset
4265 extern \"C\" {
45c8592d5d13 initial version
carl
parents:
diff changeset
4266 #endif
45c8592d5d13 initial version
carl
parents:
diff changeset
4267
45c8592d5d13 initial version
carl
parents:
diff changeset
4268 /* Prevent the only kind of declaration conflicts we can make. */
45c8592d5d13 initial version
carl
parents:
diff changeset
4269 #define lt_preloaded_symbols some_other_symbol
45c8592d5d13 initial version
carl
parents:
diff changeset
4270
45c8592d5d13 initial version
carl
parents:
diff changeset
4271 /* External symbol declarations for the compiler. */\
45c8592d5d13 initial version
carl
parents:
diff changeset
4272 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4273
45c8592d5d13 initial version
carl
parents:
diff changeset
4274 if test "$dlself" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4275 $show "generating symbol list for \`$output'"
45c8592d5d13 initial version
carl
parents:
diff changeset
4276
45c8592d5d13 initial version
carl
parents:
diff changeset
4277 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
45c8592d5d13 initial version
carl
parents:
diff changeset
4278
45c8592d5d13 initial version
carl
parents:
diff changeset
4279 # Add our own program objects to the symbol list.
45c8592d5d13 initial version
carl
parents:
diff changeset
4280 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
45c8592d5d13 initial version
carl
parents:
diff changeset
4281 for arg in $progfiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4282 $show "extracting global C symbols from \`$arg'"
45c8592d5d13 initial version
carl
parents:
diff changeset
4283 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
45c8592d5d13 initial version
carl
parents:
diff changeset
4284 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4285
45c8592d5d13 initial version
carl
parents:
diff changeset
4286 if test -n "$exclude_expsyms"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4287 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
45c8592d5d13 initial version
carl
parents:
diff changeset
4288 $run eval '$mv "$nlist"T "$nlist"'
45c8592d5d13 initial version
carl
parents:
diff changeset
4289 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4290
45c8592d5d13 initial version
carl
parents:
diff changeset
4291 if test -n "$export_symbols_regex"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4292 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
45c8592d5d13 initial version
carl
parents:
diff changeset
4293 $run eval '$mv "$nlist"T "$nlist"'
45c8592d5d13 initial version
carl
parents:
diff changeset
4294 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4295
45c8592d5d13 initial version
carl
parents:
diff changeset
4296 # Prepare the list of exported symbols
45c8592d5d13 initial version
carl
parents:
diff changeset
4297 if test -z "$export_symbols"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4298 export_symbols="$output_objdir/$output.exp"
45c8592d5d13 initial version
carl
parents:
diff changeset
4299 $run $rm $export_symbols
45c8592d5d13 initial version
carl
parents:
diff changeset
4300 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
45c8592d5d13 initial version
carl
parents:
diff changeset
4301 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4302 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
45c8592d5d13 initial version
carl
parents:
diff changeset
4303 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
45c8592d5d13 initial version
carl
parents:
diff changeset
4304 $run eval 'mv "$nlist"T "$nlist"'
45c8592d5d13 initial version
carl
parents:
diff changeset
4305 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4306 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4307
45c8592d5d13 initial version
carl
parents:
diff changeset
4308 for arg in $dlprefiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4309 $show "extracting global C symbols from \`$arg'"
45c8592d5d13 initial version
carl
parents:
diff changeset
4310 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
4311 $run eval '$echo ": $name " >> "$nlist"'
45c8592d5d13 initial version
carl
parents:
diff changeset
4312 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
45c8592d5d13 initial version
carl
parents:
diff changeset
4313 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4314
45c8592d5d13 initial version
carl
parents:
diff changeset
4315 if test -z "$run"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4316 # Make sure we have at least an empty file.
45c8592d5d13 initial version
carl
parents:
diff changeset
4317 test -f "$nlist" || : > "$nlist"
45c8592d5d13 initial version
carl
parents:
diff changeset
4318
45c8592d5d13 initial version
carl
parents:
diff changeset
4319 if test -n "$exclude_expsyms"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4320 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
45c8592d5d13 initial version
carl
parents:
diff changeset
4321 $mv "$nlist"T "$nlist"
45c8592d5d13 initial version
carl
parents:
diff changeset
4322 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4323
45c8592d5d13 initial version
carl
parents:
diff changeset
4324 # Try sorting and uniquifying the output.
45c8592d5d13 initial version
carl
parents:
diff changeset
4325 if grep -v "^: " < "$nlist" |
45c8592d5d13 initial version
carl
parents:
diff changeset
4326 if sort -k 3 </dev/null >/dev/null 2>&1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4327 sort -k 3
45c8592d5d13 initial version
carl
parents:
diff changeset
4328 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4329 sort +2
45c8592d5d13 initial version
carl
parents:
diff changeset
4330 fi |
45c8592d5d13 initial version
carl
parents:
diff changeset
4331 uniq > "$nlist"S; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4332 :
45c8592d5d13 initial version
carl
parents:
diff changeset
4333 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4334 grep -v "^: " < "$nlist" > "$nlist"S
45c8592d5d13 initial version
carl
parents:
diff changeset
4335 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4336
45c8592d5d13 initial version
carl
parents:
diff changeset
4337 if test -f "$nlist"S; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4338 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
45c8592d5d13 initial version
carl
parents:
diff changeset
4339 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4340 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
45c8592d5d13 initial version
carl
parents:
diff changeset
4341 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4342
45c8592d5d13 initial version
carl
parents:
diff changeset
4343 $echo >> "$output_objdir/$dlsyms" "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4344
45c8592d5d13 initial version
carl
parents:
diff changeset
4345 #undef lt_preloaded_symbols
45c8592d5d13 initial version
carl
parents:
diff changeset
4346
45c8592d5d13 initial version
carl
parents:
diff changeset
4347 #if defined (__STDC__) && __STDC__
45c8592d5d13 initial version
carl
parents:
diff changeset
4348 # define lt_ptr void *
45c8592d5d13 initial version
carl
parents:
diff changeset
4349 #else
45c8592d5d13 initial version
carl
parents:
diff changeset
4350 # define lt_ptr char *
45c8592d5d13 initial version
carl
parents:
diff changeset
4351 # define const
45c8592d5d13 initial version
carl
parents:
diff changeset
4352 #endif
45c8592d5d13 initial version
carl
parents:
diff changeset
4353
45c8592d5d13 initial version
carl
parents:
diff changeset
4354 /* The mapping between symbol names and symbols. */
45c8592d5d13 initial version
carl
parents:
diff changeset
4355 const struct {
45c8592d5d13 initial version
carl
parents:
diff changeset
4356 const char *name;
45c8592d5d13 initial version
carl
parents:
diff changeset
4357 lt_ptr address;
45c8592d5d13 initial version
carl
parents:
diff changeset
4358 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4359 lt_preloaded_symbols[] =
45c8592d5d13 initial version
carl
parents:
diff changeset
4360 {\
45c8592d5d13 initial version
carl
parents:
diff changeset
4361 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4362
45c8592d5d13 initial version
carl
parents:
diff changeset
4363 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
45c8592d5d13 initial version
carl
parents:
diff changeset
4364
45c8592d5d13 initial version
carl
parents:
diff changeset
4365 $echo >> "$output_objdir/$dlsyms" "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4366 {0, (lt_ptr) 0}
45c8592d5d13 initial version
carl
parents:
diff changeset
4367 };
45c8592d5d13 initial version
carl
parents:
diff changeset
4368
45c8592d5d13 initial version
carl
parents:
diff changeset
4369 /* This works around a problem in FreeBSD linker */
45c8592d5d13 initial version
carl
parents:
diff changeset
4370 #ifdef FREEBSD_WORKAROUND
45c8592d5d13 initial version
carl
parents:
diff changeset
4371 static const void *lt_preloaded_setup() {
45c8592d5d13 initial version
carl
parents:
diff changeset
4372 return lt_preloaded_symbols;
45c8592d5d13 initial version
carl
parents:
diff changeset
4373 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4374 #endif
45c8592d5d13 initial version
carl
parents:
diff changeset
4375
45c8592d5d13 initial version
carl
parents:
diff changeset
4376 #ifdef __cplusplus
45c8592d5d13 initial version
carl
parents:
diff changeset
4377 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4378 #endif\
45c8592d5d13 initial version
carl
parents:
diff changeset
4379 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4380 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4381
45c8592d5d13 initial version
carl
parents:
diff changeset
4382 pic_flag_for_symtable=
45c8592d5d13 initial version
carl
parents:
diff changeset
4383 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
4384 # compiling the symbol table file with pic_flag works around
45c8592d5d13 initial version
carl
parents:
diff changeset
4385 # a FreeBSD bug that causes programs to crash when -lm is
45c8592d5d13 initial version
carl
parents:
diff changeset
4386 # linked before any other PIC object. But we must not use
45c8592d5d13 initial version
carl
parents:
diff changeset
4387 # pic_flag when linking with -static. The problem exists in
45c8592d5d13 initial version
carl
parents:
diff changeset
4388 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
45c8592d5d13 initial version
carl
parents:
diff changeset
4389 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
45c8592d5d13 initial version
carl
parents:
diff changeset
4390 case "$compile_command " in
45c8592d5d13 initial version
carl
parents:
diff changeset
4391 *" -static "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4392 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
45c8592d5d13 initial version
carl
parents:
diff changeset
4393 esac;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4394 *-*-hpux*)
45c8592d5d13 initial version
carl
parents:
diff changeset
4395 case "$compile_command " in
45c8592d5d13 initial version
carl
parents:
diff changeset
4396 *" -static "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4397 *) pic_flag_for_symtable=" $pic_flag";;
45c8592d5d13 initial version
carl
parents:
diff changeset
4398 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4399 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4400
45c8592d5d13 initial version
carl
parents:
diff changeset
4401 # Now compile the dynamic symbol file.
45c8592d5d13 initial version
carl
parents:
diff changeset
4402 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
45c8592d5d13 initial version
carl
parents:
diff changeset
4403 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
4404
45c8592d5d13 initial version
carl
parents:
diff changeset
4405 # Clean up the generated files.
45c8592d5d13 initial version
carl
parents:
diff changeset
4406 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
45c8592d5d13 initial version
carl
parents:
diff changeset
4407 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
45c8592d5d13 initial version
carl
parents:
diff changeset
4408
45c8592d5d13 initial version
carl
parents:
diff changeset
4409 # Transform the symbol file into the correct name.
45c8592d5d13 initial version
carl
parents:
diff changeset
4410 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
45c8592d5d13 initial version
carl
parents:
diff changeset
4411 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
45c8592d5d13 initial version
carl
parents:
diff changeset
4412 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4413 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
4414 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4415 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
4416 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4417 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4418 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4419 # We keep going just in case the user didn't refer to
45c8592d5d13 initial version
carl
parents:
diff changeset
4420 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
45c8592d5d13 initial version
carl
parents:
diff changeset
4421 # really was required.
45c8592d5d13 initial version
carl
parents:
diff changeset
4422
45c8592d5d13 initial version
carl
parents:
diff changeset
4423 # Nullify the symbol file.
45c8592d5d13 initial version
carl
parents:
diff changeset
4424 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
45c8592d5d13 initial version
carl
parents:
diff changeset
4425 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
45c8592d5d13 initial version
carl
parents:
diff changeset
4426 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4427
45c8592d5d13 initial version
carl
parents:
diff changeset
4428 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4429 # Replace the output file specification.
45c8592d5d13 initial version
carl
parents:
diff changeset
4430 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
45c8592d5d13 initial version
carl
parents:
diff changeset
4431 link_command="$compile_command$compile_rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4432
45c8592d5d13 initial version
carl
parents:
diff changeset
4433 # We have no uninstalled library dependencies, so finalize right now.
45c8592d5d13 initial version
carl
parents:
diff changeset
4434 $show "$link_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
4435 $run eval "$link_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
4436 status=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
4437
45c8592d5d13 initial version
carl
parents:
diff changeset
4438 # Delete the generated files.
45c8592d5d13 initial version
carl
parents:
diff changeset
4439 if test -n "$dlsyms"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4440 $show "$rm $output_objdir/${outputname}S.${objext}"
45c8592d5d13 initial version
carl
parents:
diff changeset
4441 $run $rm "$output_objdir/${outputname}S.${objext}"
45c8592d5d13 initial version
carl
parents:
diff changeset
4442 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4443
45c8592d5d13 initial version
carl
parents:
diff changeset
4444 exit $status
45c8592d5d13 initial version
carl
parents:
diff changeset
4445 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4446
45c8592d5d13 initial version
carl
parents:
diff changeset
4447 if test -n "$shlibpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4448 # We should set the shlibpath_var
45c8592d5d13 initial version
carl
parents:
diff changeset
4449 rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
4450 for dir in $temp_rpath; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4451 case $dir in
45c8592d5d13 initial version
carl
parents:
diff changeset
4452 [\\/]* | [A-Za-z]:[\\/]*)
45c8592d5d13 initial version
carl
parents:
diff changeset
4453 # Absolute path.
45c8592d5d13 initial version
carl
parents:
diff changeset
4454 rpath="$rpath$dir:"
45c8592d5d13 initial version
carl
parents:
diff changeset
4455 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4456 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
4457 # Relative path: add a thisdir entry.
45c8592d5d13 initial version
carl
parents:
diff changeset
4458 rpath="$rpath\$thisdir/$dir:"
45c8592d5d13 initial version
carl
parents:
diff changeset
4459 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4460 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4461 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4462 temp_rpath="$rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4463 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4464
45c8592d5d13 initial version
carl
parents:
diff changeset
4465 if test -n "$compile_shlibpath$finalize_shlibpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4466 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
4467 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4468 if test -n "$finalize_shlibpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4469 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
4470 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4471
45c8592d5d13 initial version
carl
parents:
diff changeset
4472 compile_var=
45c8592d5d13 initial version
carl
parents:
diff changeset
4473 finalize_var=
45c8592d5d13 initial version
carl
parents:
diff changeset
4474 if test -n "$runpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4475 if test -n "$perm_rpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4476 # We should set the runpath_var.
45c8592d5d13 initial version
carl
parents:
diff changeset
4477 rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
4478 for dir in $perm_rpath; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4479 rpath="$rpath$dir:"
45c8592d5d13 initial version
carl
parents:
diff changeset
4480 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4481 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
45c8592d5d13 initial version
carl
parents:
diff changeset
4482 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4483 if test -n "$finalize_perm_rpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4484 # We should set the runpath_var.
45c8592d5d13 initial version
carl
parents:
diff changeset
4485 rpath=
45c8592d5d13 initial version
carl
parents:
diff changeset
4486 for dir in $finalize_perm_rpath; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4487 rpath="$rpath$dir:"
45c8592d5d13 initial version
carl
parents:
diff changeset
4488 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4489 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
45c8592d5d13 initial version
carl
parents:
diff changeset
4490 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4491 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4492
45c8592d5d13 initial version
carl
parents:
diff changeset
4493 if test "$no_install" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4494 # We don't need to create a wrapper script.
45c8592d5d13 initial version
carl
parents:
diff changeset
4495 link_command="$compile_var$compile_command$compile_rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4496 # Replace the output file specification.
45c8592d5d13 initial version
carl
parents:
diff changeset
4497 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
45c8592d5d13 initial version
carl
parents:
diff changeset
4498 # Delete the old output file.
45c8592d5d13 initial version
carl
parents:
diff changeset
4499 $run $rm $output
45c8592d5d13 initial version
carl
parents:
diff changeset
4500 # Link the executable and exit
45c8592d5d13 initial version
carl
parents:
diff changeset
4501 $show "$link_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
4502 $run eval "$link_command" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
4503 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
4504 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4505
45c8592d5d13 initial version
carl
parents:
diff changeset
4506 if test "$hardcode_action" = relink; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4507 # Fast installation is not supported
45c8592d5d13 initial version
carl
parents:
diff changeset
4508 link_command="$compile_var$compile_command$compile_rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4509 relink_command="$finalize_var$finalize_command$finalize_rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4510
45c8592d5d13 initial version
carl
parents:
diff changeset
4511 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4512 $echo "$modename: \`$output' will be relinked during installation" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4513 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4514 if test "$fast_install" != no; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4515 link_command="$finalize_var$compile_command$finalize_rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4516 if test "$fast_install" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4517 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
45c8592d5d13 initial version
carl
parents:
diff changeset
4518 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4519 # fast_install is set to needless
45c8592d5d13 initial version
carl
parents:
diff changeset
4520 relink_command=
45c8592d5d13 initial version
carl
parents:
diff changeset
4521 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4522 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4523 link_command="$compile_var$compile_command$compile_rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4524 relink_command="$finalize_var$finalize_command$finalize_rpath"
45c8592d5d13 initial version
carl
parents:
diff changeset
4525 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4526 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4527
45c8592d5d13 initial version
carl
parents:
diff changeset
4528 # Replace the output file specification.
45c8592d5d13 initial version
carl
parents:
diff changeset
4529 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
45c8592d5d13 initial version
carl
parents:
diff changeset
4530
45c8592d5d13 initial version
carl
parents:
diff changeset
4531 # Delete the old output files.
45c8592d5d13 initial version
carl
parents:
diff changeset
4532 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
45c8592d5d13 initial version
carl
parents:
diff changeset
4533
45c8592d5d13 initial version
carl
parents:
diff changeset
4534 $show "$link_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
4535 $run eval "$link_command" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
4536
45c8592d5d13 initial version
carl
parents:
diff changeset
4537 # Now create the wrapper script.
45c8592d5d13 initial version
carl
parents:
diff changeset
4538 $show "creating $output"
45c8592d5d13 initial version
carl
parents:
diff changeset
4539
45c8592d5d13 initial version
carl
parents:
diff changeset
4540 # Quote the relink command for shipping.
45c8592d5d13 initial version
carl
parents:
diff changeset
4541 if test -n "$relink_command"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4542 # Preserve any variables that may affect compiler behavior
45c8592d5d13 initial version
carl
parents:
diff changeset
4543 for var in $variables_saved_for_relink; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4544 if eval test -z \"\${$var+set}\"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4545 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
4546 elif eval var_value=\$$var; test -z "$var_value"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4547 relink_command="$var=; export $var; $relink_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
4548 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4549 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
4550 relink_command="$var=\"$var_value\"; export $var; $relink_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
4551 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4552 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4553 relink_command="(cd `pwd`; $relink_command)"
45c8592d5d13 initial version
carl
parents:
diff changeset
4554 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
4555 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4556
45c8592d5d13 initial version
carl
parents:
diff changeset
4557 # Quote $echo for shipping.
45c8592d5d13 initial version
carl
parents:
diff changeset
4558 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4559 case $progpath in
45c8592d5d13 initial version
carl
parents:
diff changeset
4560 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
45c8592d5d13 initial version
carl
parents:
diff changeset
4561 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
45c8592d5d13 initial version
carl
parents:
diff changeset
4562 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4563 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
4564 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4565 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
4566 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4567
45c8592d5d13 initial version
carl
parents:
diff changeset
4568 # Only actually do things if our run command is non-null.
45c8592d5d13 initial version
carl
parents:
diff changeset
4569 if test -z "$run"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4570 # win32 will think the script is a binary if it has
45c8592d5d13 initial version
carl
parents:
diff changeset
4571 # a .exe suffix, so we strip it off here.
45c8592d5d13 initial version
carl
parents:
diff changeset
4572 case $output in
45c8592d5d13 initial version
carl
parents:
diff changeset
4573 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4574 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4575 # test for cygwin because mv fails w/o .exe extensions
45c8592d5d13 initial version
carl
parents:
diff changeset
4576 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
4577 *cygwin*)
45c8592d5d13 initial version
carl
parents:
diff changeset
4578 exeext=.exe
45c8592d5d13 initial version
carl
parents:
diff changeset
4579 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4580 *) exeext= ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4581 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4582 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
4583 *cygwin* | *mingw* )
45c8592d5d13 initial version
carl
parents:
diff changeset
4584 cwrappersource=`$echo ${objdir}/lt-${output}.c`
45c8592d5d13 initial version
carl
parents:
diff changeset
4585 cwrapper=`$echo ${output}.exe`
45c8592d5d13 initial version
carl
parents:
diff changeset
4586 $rm $cwrappersource $cwrapper
45c8592d5d13 initial version
carl
parents:
diff changeset
4587 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
45c8592d5d13 initial version
carl
parents:
diff changeset
4588
45c8592d5d13 initial version
carl
parents:
diff changeset
4589 cat > $cwrappersource <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
4590
45c8592d5d13 initial version
carl
parents:
diff changeset
4591 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
45c8592d5d13 initial version
carl
parents:
diff changeset
4592 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
45c8592d5d13 initial version
carl
parents:
diff changeset
4593
45c8592d5d13 initial version
carl
parents:
diff changeset
4594 The $output program cannot be directly executed until all the libtool
45c8592d5d13 initial version
carl
parents:
diff changeset
4595 libraries that it depends on are installed.
45c8592d5d13 initial version
carl
parents:
diff changeset
4596
45c8592d5d13 initial version
carl
parents:
diff changeset
4597 This wrapper executable should never be moved out of the build directory.
45c8592d5d13 initial version
carl
parents:
diff changeset
4598 If it is, it will not operate correctly.
45c8592d5d13 initial version
carl
parents:
diff changeset
4599
45c8592d5d13 initial version
carl
parents:
diff changeset
4600 Currently, it simply execs the wrapper *script* "/bin/sh $output",
45c8592d5d13 initial version
carl
parents:
diff changeset
4601 but could eventually absorb all of the scripts functionality and
45c8592d5d13 initial version
carl
parents:
diff changeset
4602 exec $objdir/$outputname directly.
45c8592d5d13 initial version
carl
parents:
diff changeset
4603 */
45c8592d5d13 initial version
carl
parents:
diff changeset
4604 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
4605 cat >> $cwrappersource<<"EOF"
45c8592d5d13 initial version
carl
parents:
diff changeset
4606 #include <stdio.h>
45c8592d5d13 initial version
carl
parents:
diff changeset
4607 #include <stdlib.h>
45c8592d5d13 initial version
carl
parents:
diff changeset
4608 #include <unistd.h>
45c8592d5d13 initial version
carl
parents:
diff changeset
4609 #include <malloc.h>
45c8592d5d13 initial version
carl
parents:
diff changeset
4610 #include <stdarg.h>
45c8592d5d13 initial version
carl
parents:
diff changeset
4611 #include <assert.h>
45c8592d5d13 initial version
carl
parents:
diff changeset
4612
45c8592d5d13 initial version
carl
parents:
diff changeset
4613 #if defined(PATH_MAX)
45c8592d5d13 initial version
carl
parents:
diff changeset
4614 # define LT_PATHMAX PATH_MAX
45c8592d5d13 initial version
carl
parents:
diff changeset
4615 #elif defined(MAXPATHLEN)
45c8592d5d13 initial version
carl
parents:
diff changeset
4616 # define LT_PATHMAX MAXPATHLEN
45c8592d5d13 initial version
carl
parents:
diff changeset
4617 #else
45c8592d5d13 initial version
carl
parents:
diff changeset
4618 # define LT_PATHMAX 1024
45c8592d5d13 initial version
carl
parents:
diff changeset
4619 #endif
45c8592d5d13 initial version
carl
parents:
diff changeset
4620
45c8592d5d13 initial version
carl
parents:
diff changeset
4621 #ifndef DIR_SEPARATOR
45c8592d5d13 initial version
carl
parents:
diff changeset
4622 #define DIR_SEPARATOR '/'
45c8592d5d13 initial version
carl
parents:
diff changeset
4623 #endif
45c8592d5d13 initial version
carl
parents:
diff changeset
4624
45c8592d5d13 initial version
carl
parents:
diff changeset
4625 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
45c8592d5d13 initial version
carl
parents:
diff changeset
4626 defined (__OS2__)
45c8592d5d13 initial version
carl
parents:
diff changeset
4627 #define HAVE_DOS_BASED_FILE_SYSTEM
45c8592d5d13 initial version
carl
parents:
diff changeset
4628 #ifndef DIR_SEPARATOR_2
45c8592d5d13 initial version
carl
parents:
diff changeset
4629 #define DIR_SEPARATOR_2 '\\'
45c8592d5d13 initial version
carl
parents:
diff changeset
4630 #endif
45c8592d5d13 initial version
carl
parents:
diff changeset
4631 #endif
45c8592d5d13 initial version
carl
parents:
diff changeset
4632
45c8592d5d13 initial version
carl
parents:
diff changeset
4633 #ifndef DIR_SEPARATOR_2
45c8592d5d13 initial version
carl
parents:
diff changeset
4634 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
45c8592d5d13 initial version
carl
parents:
diff changeset
4635 #else /* DIR_SEPARATOR_2 */
45c8592d5d13 initial version
carl
parents:
diff changeset
4636 # define IS_DIR_SEPARATOR(ch) \
45c8592d5d13 initial version
carl
parents:
diff changeset
4637 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
45c8592d5d13 initial version
carl
parents:
diff changeset
4638 #endif /* DIR_SEPARATOR_2 */
45c8592d5d13 initial version
carl
parents:
diff changeset
4639
45c8592d5d13 initial version
carl
parents:
diff changeset
4640 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
45c8592d5d13 initial version
carl
parents:
diff changeset
4641 #define XFREE(stale) do { \
45c8592d5d13 initial version
carl
parents:
diff changeset
4642 if (stale) { free ((void *) stale); stale = 0; } \
45c8592d5d13 initial version
carl
parents:
diff changeset
4643 } while (0)
45c8592d5d13 initial version
carl
parents:
diff changeset
4644
45c8592d5d13 initial version
carl
parents:
diff changeset
4645 const char *program_name = NULL;
45c8592d5d13 initial version
carl
parents:
diff changeset
4646
45c8592d5d13 initial version
carl
parents:
diff changeset
4647 void * xmalloc (size_t num);
45c8592d5d13 initial version
carl
parents:
diff changeset
4648 char * xstrdup (const char *string);
45c8592d5d13 initial version
carl
parents:
diff changeset
4649 char * basename (const char *name);
45c8592d5d13 initial version
carl
parents:
diff changeset
4650 char * fnqualify(const char *path);
45c8592d5d13 initial version
carl
parents:
diff changeset
4651 char * strendzap(char *str, const char *pat);
45c8592d5d13 initial version
carl
parents:
diff changeset
4652 void lt_fatal (const char *message, ...);
45c8592d5d13 initial version
carl
parents:
diff changeset
4653
45c8592d5d13 initial version
carl
parents:
diff changeset
4654 int
45c8592d5d13 initial version
carl
parents:
diff changeset
4655 main (int argc, char *argv[])
45c8592d5d13 initial version
carl
parents:
diff changeset
4656 {
45c8592d5d13 initial version
carl
parents:
diff changeset
4657 char **newargz;
45c8592d5d13 initial version
carl
parents:
diff changeset
4658 int i;
45c8592d5d13 initial version
carl
parents:
diff changeset
4659
45c8592d5d13 initial version
carl
parents:
diff changeset
4660 program_name = (char *) xstrdup ((char *) basename (argv[0]));
45c8592d5d13 initial version
carl
parents:
diff changeset
4661 newargz = XMALLOC(char *, argc+2);
45c8592d5d13 initial version
carl
parents:
diff changeset
4662 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
4663
45c8592d5d13 initial version
carl
parents:
diff changeset
4664 cat >> $cwrappersource <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
4665 newargz[0] = "$SHELL";
45c8592d5d13 initial version
carl
parents:
diff changeset
4666 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
4667
45c8592d5d13 initial version
carl
parents:
diff changeset
4668 cat >> $cwrappersource <<"EOF"
45c8592d5d13 initial version
carl
parents:
diff changeset
4669 newargz[1] = fnqualify(argv[0]);
45c8592d5d13 initial version
carl
parents:
diff changeset
4670 /* we know the script has the same name, without the .exe */
45c8592d5d13 initial version
carl
parents:
diff changeset
4671 /* so make sure newargz[1] doesn't end in .exe */
45c8592d5d13 initial version
carl
parents:
diff changeset
4672 strendzap(newargz[1],".exe");
45c8592d5d13 initial version
carl
parents:
diff changeset
4673 for (i = 1; i < argc; i++)
45c8592d5d13 initial version
carl
parents:
diff changeset
4674 newargz[i+1] = xstrdup(argv[i]);
45c8592d5d13 initial version
carl
parents:
diff changeset
4675 newargz[argc+1] = NULL;
45c8592d5d13 initial version
carl
parents:
diff changeset
4676 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
4677
45c8592d5d13 initial version
carl
parents:
diff changeset
4678 cat >> $cwrappersource <<EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
4679 execv("$SHELL",newargz);
45c8592d5d13 initial version
carl
parents:
diff changeset
4680 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
4681
45c8592d5d13 initial version
carl
parents:
diff changeset
4682 cat >> $cwrappersource <<"EOF"
45c8592d5d13 initial version
carl
parents:
diff changeset
4683 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4684
45c8592d5d13 initial version
carl
parents:
diff changeset
4685 void *
45c8592d5d13 initial version
carl
parents:
diff changeset
4686 xmalloc (size_t num)
45c8592d5d13 initial version
carl
parents:
diff changeset
4687 {
45c8592d5d13 initial version
carl
parents:
diff changeset
4688 void * p = (void *) malloc (num);
45c8592d5d13 initial version
carl
parents:
diff changeset
4689 if (!p)
45c8592d5d13 initial version
carl
parents:
diff changeset
4690 lt_fatal ("Memory exhausted");
45c8592d5d13 initial version
carl
parents:
diff changeset
4691
45c8592d5d13 initial version
carl
parents:
diff changeset
4692 return p;
45c8592d5d13 initial version
carl
parents:
diff changeset
4693 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4694
45c8592d5d13 initial version
carl
parents:
diff changeset
4695 char *
45c8592d5d13 initial version
carl
parents:
diff changeset
4696 xstrdup (const char *string)
45c8592d5d13 initial version
carl
parents:
diff changeset
4697 {
45c8592d5d13 initial version
carl
parents:
diff changeset
4698 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
45c8592d5d13 initial version
carl
parents:
diff changeset
4699 ;
45c8592d5d13 initial version
carl
parents:
diff changeset
4700 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4701
45c8592d5d13 initial version
carl
parents:
diff changeset
4702 char *
45c8592d5d13 initial version
carl
parents:
diff changeset
4703 basename (const char *name)
45c8592d5d13 initial version
carl
parents:
diff changeset
4704 {
45c8592d5d13 initial version
carl
parents:
diff changeset
4705 const char *base;
45c8592d5d13 initial version
carl
parents:
diff changeset
4706
45c8592d5d13 initial version
carl
parents:
diff changeset
4707 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
45c8592d5d13 initial version
carl
parents:
diff changeset
4708 /* Skip over the disk name in MSDOS pathnames. */
45c8592d5d13 initial version
carl
parents:
diff changeset
4709 if (isalpha (name[0]) && name[1] == ':')
45c8592d5d13 initial version
carl
parents:
diff changeset
4710 name += 2;
45c8592d5d13 initial version
carl
parents:
diff changeset
4711 #endif
45c8592d5d13 initial version
carl
parents:
diff changeset
4712
45c8592d5d13 initial version
carl
parents:
diff changeset
4713 for (base = name; *name; name++)
45c8592d5d13 initial version
carl
parents:
diff changeset
4714 if (IS_DIR_SEPARATOR (*name))
45c8592d5d13 initial version
carl
parents:
diff changeset
4715 base = name + 1;
45c8592d5d13 initial version
carl
parents:
diff changeset
4716 return (char *) base;
45c8592d5d13 initial version
carl
parents:
diff changeset
4717 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4718
45c8592d5d13 initial version
carl
parents:
diff changeset
4719 char *
45c8592d5d13 initial version
carl
parents:
diff changeset
4720 fnqualify(const char *path)
45c8592d5d13 initial version
carl
parents:
diff changeset
4721 {
45c8592d5d13 initial version
carl
parents:
diff changeset
4722 size_t size;
45c8592d5d13 initial version
carl
parents:
diff changeset
4723 char *p;
45c8592d5d13 initial version
carl
parents:
diff changeset
4724 char tmp[LT_PATHMAX + 1];
45c8592d5d13 initial version
carl
parents:
diff changeset
4725
45c8592d5d13 initial version
carl
parents:
diff changeset
4726 assert(path != NULL);
45c8592d5d13 initial version
carl
parents:
diff changeset
4727
45c8592d5d13 initial version
carl
parents:
diff changeset
4728 /* Is it qualified already? */
45c8592d5d13 initial version
carl
parents:
diff changeset
4729 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
45c8592d5d13 initial version
carl
parents:
diff changeset
4730 if (isalpha (path[0]) && path[1] == ':')
45c8592d5d13 initial version
carl
parents:
diff changeset
4731 return xstrdup (path);
45c8592d5d13 initial version
carl
parents:
diff changeset
4732 #endif
45c8592d5d13 initial version
carl
parents:
diff changeset
4733 if (IS_DIR_SEPARATOR (path[0]))
45c8592d5d13 initial version
carl
parents:
diff changeset
4734 return xstrdup (path);
45c8592d5d13 initial version
carl
parents:
diff changeset
4735
45c8592d5d13 initial version
carl
parents:
diff changeset
4736 /* prepend the current directory */
45c8592d5d13 initial version
carl
parents:
diff changeset
4737 /* doesn't handle '~' */
45c8592d5d13 initial version
carl
parents:
diff changeset
4738 if (getcwd (tmp, LT_PATHMAX) == NULL)
45c8592d5d13 initial version
carl
parents:
diff changeset
4739 lt_fatal ("getcwd failed");
45c8592d5d13 initial version
carl
parents:
diff changeset
4740 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
45c8592d5d13 initial version
carl
parents:
diff changeset
4741 p = XMALLOC(char, size);
45c8592d5d13 initial version
carl
parents:
diff changeset
4742 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
45c8592d5d13 initial version
carl
parents:
diff changeset
4743 return p;
45c8592d5d13 initial version
carl
parents:
diff changeset
4744 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4745
45c8592d5d13 initial version
carl
parents:
diff changeset
4746 char *
45c8592d5d13 initial version
carl
parents:
diff changeset
4747 strendzap(char *str, const char *pat)
45c8592d5d13 initial version
carl
parents:
diff changeset
4748 {
45c8592d5d13 initial version
carl
parents:
diff changeset
4749 size_t len, patlen;
45c8592d5d13 initial version
carl
parents:
diff changeset
4750
45c8592d5d13 initial version
carl
parents:
diff changeset
4751 assert(str != NULL);
45c8592d5d13 initial version
carl
parents:
diff changeset
4752 assert(pat != NULL);
45c8592d5d13 initial version
carl
parents:
diff changeset
4753
45c8592d5d13 initial version
carl
parents:
diff changeset
4754 len = strlen(str);
45c8592d5d13 initial version
carl
parents:
diff changeset
4755 patlen = strlen(pat);
45c8592d5d13 initial version
carl
parents:
diff changeset
4756
45c8592d5d13 initial version
carl
parents:
diff changeset
4757 if (patlen <= len)
45c8592d5d13 initial version
carl
parents:
diff changeset
4758 {
45c8592d5d13 initial version
carl
parents:
diff changeset
4759 str += len - patlen;
45c8592d5d13 initial version
carl
parents:
diff changeset
4760 if (strcmp(str, pat) == 0)
45c8592d5d13 initial version
carl
parents:
diff changeset
4761 *str = '\0';
45c8592d5d13 initial version
carl
parents:
diff changeset
4762 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4763 return str;
45c8592d5d13 initial version
carl
parents:
diff changeset
4764 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4765
45c8592d5d13 initial version
carl
parents:
diff changeset
4766 static void
45c8592d5d13 initial version
carl
parents:
diff changeset
4767 lt_error_core (int exit_status, const char * mode,
45c8592d5d13 initial version
carl
parents:
diff changeset
4768 const char * message, va_list ap)
45c8592d5d13 initial version
carl
parents:
diff changeset
4769 {
45c8592d5d13 initial version
carl
parents:
diff changeset
4770 fprintf (stderr, "%s: %s: ", program_name, mode);
45c8592d5d13 initial version
carl
parents:
diff changeset
4771 vfprintf (stderr, message, ap);
45c8592d5d13 initial version
carl
parents:
diff changeset
4772 fprintf (stderr, ".\n");
45c8592d5d13 initial version
carl
parents:
diff changeset
4773
45c8592d5d13 initial version
carl
parents:
diff changeset
4774 if (exit_status >= 0)
45c8592d5d13 initial version
carl
parents:
diff changeset
4775 exit (exit_status);
45c8592d5d13 initial version
carl
parents:
diff changeset
4776 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4777
45c8592d5d13 initial version
carl
parents:
diff changeset
4778 void
45c8592d5d13 initial version
carl
parents:
diff changeset
4779 lt_fatal (const char *message, ...)
45c8592d5d13 initial version
carl
parents:
diff changeset
4780 {
45c8592d5d13 initial version
carl
parents:
diff changeset
4781 va_list ap;
45c8592d5d13 initial version
carl
parents:
diff changeset
4782 va_start (ap, message);
45c8592d5d13 initial version
carl
parents:
diff changeset
4783 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
45c8592d5d13 initial version
carl
parents:
diff changeset
4784 va_end (ap);
45c8592d5d13 initial version
carl
parents:
diff changeset
4785 }
45c8592d5d13 initial version
carl
parents:
diff changeset
4786 EOF
45c8592d5d13 initial version
carl
parents:
diff changeset
4787 # we should really use a build-platform specific compiler
45c8592d5d13 initial version
carl
parents:
diff changeset
4788 # here, but OTOH, the wrappers (shell script and this C one)
45c8592d5d13 initial version
carl
parents:
diff changeset
4789 # are only useful if you want to execute the "real" binary.
45c8592d5d13 initial version
carl
parents:
diff changeset
4790 # Since the "real" binary is built for $host, then this
45c8592d5d13 initial version
carl
parents:
diff changeset
4791 # wrapper might as well be built for $host, too.
45c8592d5d13 initial version
carl
parents:
diff changeset
4792 $run $LTCC -s -o $cwrapper $cwrappersource
45c8592d5d13 initial version
carl
parents:
diff changeset
4793 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4794 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4795 $rm $output
45c8592d5d13 initial version
carl
parents:
diff changeset
4796 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
45c8592d5d13 initial version
carl
parents:
diff changeset
4797
45c8592d5d13 initial version
carl
parents:
diff changeset
4798 $echo > $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4799 #! $SHELL
45c8592d5d13 initial version
carl
parents:
diff changeset
4800
45c8592d5d13 initial version
carl
parents:
diff changeset
4801 # $output - temporary wrapper script for $objdir/$outputname
45c8592d5d13 initial version
carl
parents:
diff changeset
4802 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
45c8592d5d13 initial version
carl
parents:
diff changeset
4803 #
45c8592d5d13 initial version
carl
parents:
diff changeset
4804 # The $output program cannot be directly executed until all the libtool
45c8592d5d13 initial version
carl
parents:
diff changeset
4805 # libraries that it depends on are installed.
45c8592d5d13 initial version
carl
parents:
diff changeset
4806 #
45c8592d5d13 initial version
carl
parents:
diff changeset
4807 # This wrapper script should never be moved out of the build directory.
45c8592d5d13 initial version
carl
parents:
diff changeset
4808 # If it is, it will not operate correctly.
45c8592d5d13 initial version
carl
parents:
diff changeset
4809
45c8592d5d13 initial version
carl
parents:
diff changeset
4810 # Sed substitution that helps us do robust quoting. It backslashifies
45c8592d5d13 initial version
carl
parents:
diff changeset
4811 # metacharacters that are still active within double-quoted strings.
45c8592d5d13 initial version
carl
parents:
diff changeset
4812 Xsed='${SED} -e 1s/^X//'
45c8592d5d13 initial version
carl
parents:
diff changeset
4813 sed_quote_subst='$sed_quote_subst'
45c8592d5d13 initial version
carl
parents:
diff changeset
4814
45c8592d5d13 initial version
carl
parents:
diff changeset
4815 # The HP-UX ksh and POSIX shell print the target directory to stdout
45c8592d5d13 initial version
carl
parents:
diff changeset
4816 # if CDPATH is set.
45c8592d5d13 initial version
carl
parents:
diff changeset
4817 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4818
45c8592d5d13 initial version
carl
parents:
diff changeset
4819 relink_command=\"$relink_command\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4820
45c8592d5d13 initial version
carl
parents:
diff changeset
4821 # This environment variable determines our operation mode.
45c8592d5d13 initial version
carl
parents:
diff changeset
4822 if test \"\$libtool_install_magic\" = \"$magic\"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4823 # install mode needs the following variable:
45c8592d5d13 initial version
carl
parents:
diff changeset
4824 notinst_deplibs='$notinst_deplibs'
45c8592d5d13 initial version
carl
parents:
diff changeset
4825 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4826 # When we are sourced in execute mode, \$file and \$echo are already set.
45c8592d5d13 initial version
carl
parents:
diff changeset
4827 if test \"\$libtool_execute_magic\" != \"$magic\"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4828 echo=\"$qecho\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4829 file=\"\$0\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4830 # Make sure echo works.
45c8592d5d13 initial version
carl
parents:
diff changeset
4831 if test \"X\$1\" = X--no-reexec; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4832 # Discard the --no-reexec flag, and continue.
45c8592d5d13 initial version
carl
parents:
diff changeset
4833 shift
45c8592d5d13 initial version
carl
parents:
diff changeset
4834 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4835 # Yippee, \$echo works!
45c8592d5d13 initial version
carl
parents:
diff changeset
4836 :
45c8592d5d13 initial version
carl
parents:
diff changeset
4837 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4838 # Restart under the correct shell, and then maybe \$echo will work.
45c8592d5d13 initial version
carl
parents:
diff changeset
4839 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
45c8592d5d13 initial version
carl
parents:
diff changeset
4840 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4841 fi\
45c8592d5d13 initial version
carl
parents:
diff changeset
4842 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4843 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4844
45c8592d5d13 initial version
carl
parents:
diff changeset
4845 # Find the directory that this script lives in.
45c8592d5d13 initial version
carl
parents:
diff changeset
4846 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
45c8592d5d13 initial version
carl
parents:
diff changeset
4847 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
45c8592d5d13 initial version
carl
parents:
diff changeset
4848
45c8592d5d13 initial version
carl
parents:
diff changeset
4849 # Follow symbolic links until we get to the real thisdir.
45c8592d5d13 initial version
carl
parents:
diff changeset
4850 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
45c8592d5d13 initial version
carl
parents:
diff changeset
4851 while test -n \"\$file\"; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4852 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
45c8592d5d13 initial version
carl
parents:
diff changeset
4853
45c8592d5d13 initial version
carl
parents:
diff changeset
4854 # If there was a directory component, then change thisdir.
45c8592d5d13 initial version
carl
parents:
diff changeset
4855 if test \"x\$destdir\" != \"x\$file\"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4856 case \"\$destdir\" in
45c8592d5d13 initial version
carl
parents:
diff changeset
4857 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4858 *) thisdir=\"\$thisdir/\$destdir\" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4859 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4860 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4861
45c8592d5d13 initial version
carl
parents:
diff changeset
4862 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
45c8592d5d13 initial version
carl
parents:
diff changeset
4863 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
45c8592d5d13 initial version
carl
parents:
diff changeset
4864 done
45c8592d5d13 initial version
carl
parents:
diff changeset
4865
45c8592d5d13 initial version
carl
parents:
diff changeset
4866 # Try to get the absolute directory name.
45c8592d5d13 initial version
carl
parents:
diff changeset
4867 absdir=\`cd \"\$thisdir\" && pwd\`
45c8592d5d13 initial version
carl
parents:
diff changeset
4868 test -n \"\$absdir\" && thisdir=\"\$absdir\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4869 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4870
45c8592d5d13 initial version
carl
parents:
diff changeset
4871 if test "$fast_install" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4872 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4873 program=lt-'$outputname'$exeext
45c8592d5d13 initial version
carl
parents:
diff changeset
4874 progdir=\"\$thisdir/$objdir\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4875
45c8592d5d13 initial version
carl
parents:
diff changeset
4876 if test ! -f \"\$progdir/\$program\" || \\
45c8592d5d13 initial version
carl
parents:
diff changeset
4877 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
45c8592d5d13 initial version
carl
parents:
diff changeset
4878 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4879
45c8592d5d13 initial version
carl
parents:
diff changeset
4880 file=\"\$\$-\$program\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4881
45c8592d5d13 initial version
carl
parents:
diff changeset
4882 if test ! -d \"\$progdir\"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4883 $mkdir \"\$progdir\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4884 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4885 $rm \"\$progdir/\$file\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4886 fi"
45c8592d5d13 initial version
carl
parents:
diff changeset
4887
45c8592d5d13 initial version
carl
parents:
diff changeset
4888 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4889
45c8592d5d13 initial version
carl
parents:
diff changeset
4890 # relink executable if necessary
45c8592d5d13 initial version
carl
parents:
diff changeset
4891 if test -n \"\$relink_command\"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4892 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
4893 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4894 $echo \"\$relink_command_output\" >&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4895 $rm \"\$progdir/\$file\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4896 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
4897 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4898 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4899
45c8592d5d13 initial version
carl
parents:
diff changeset
4900 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
45c8592d5d13 initial version
carl
parents:
diff changeset
4901 { $rm \"\$progdir/\$program\";
45c8592d5d13 initial version
carl
parents:
diff changeset
4902 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
45c8592d5d13 initial version
carl
parents:
diff changeset
4903 $rm \"\$progdir/\$file\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4904 fi"
45c8592d5d13 initial version
carl
parents:
diff changeset
4905 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4906 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4907 program='$outputname'
45c8592d5d13 initial version
carl
parents:
diff changeset
4908 progdir=\"\$thisdir/$objdir\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4909 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4910 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4911
45c8592d5d13 initial version
carl
parents:
diff changeset
4912 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4913
45c8592d5d13 initial version
carl
parents:
diff changeset
4914 if test -f \"\$progdir/\$program\"; then"
45c8592d5d13 initial version
carl
parents:
diff changeset
4915
45c8592d5d13 initial version
carl
parents:
diff changeset
4916 # Export our shlibpath_var if we have one.
45c8592d5d13 initial version
carl
parents:
diff changeset
4917 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4918 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4919 # Add our own library path to $shlibpath_var
45c8592d5d13 initial version
carl
parents:
diff changeset
4920 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4921
45c8592d5d13 initial version
carl
parents:
diff changeset
4922 # Some systems cannot cope with colon-terminated $shlibpath_var
45c8592d5d13 initial version
carl
parents:
diff changeset
4923 # The second colon is a workaround for a bug in BeOS R4 sed
45c8592d5d13 initial version
carl
parents:
diff changeset
4924 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
45c8592d5d13 initial version
carl
parents:
diff changeset
4925
45c8592d5d13 initial version
carl
parents:
diff changeset
4926 export $shlibpath_var
45c8592d5d13 initial version
carl
parents:
diff changeset
4927 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4928 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4929
45c8592d5d13 initial version
carl
parents:
diff changeset
4930 # fixup the dll searchpath if we need to.
45c8592d5d13 initial version
carl
parents:
diff changeset
4931 if test -n "$dllsearchpath"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4932 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4933 # Add the dll search path components to the executable PATH
45c8592d5d13 initial version
carl
parents:
diff changeset
4934 PATH=$dllsearchpath:\$PATH
45c8592d5d13 initial version
carl
parents:
diff changeset
4935 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4936 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4937
45c8592d5d13 initial version
carl
parents:
diff changeset
4938 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4939 if test \"\$libtool_execute_magic\" != \"$magic\"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4940 # Run the actual program with our arguments.
45c8592d5d13 initial version
carl
parents:
diff changeset
4941 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4942 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
4943 # Backslashes separate directories on plain windows
45c8592d5d13 initial version
carl
parents:
diff changeset
4944 *-*-mingw | *-*-os2*)
45c8592d5d13 initial version
carl
parents:
diff changeset
4945 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4946 exec \$progdir\\\\\$program \${1+\"\$@\"}
45c8592d5d13 initial version
carl
parents:
diff changeset
4947 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4948 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4949
45c8592d5d13 initial version
carl
parents:
diff changeset
4950 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
4951 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4952 exec \$progdir/\$program \${1+\"\$@\"}
45c8592d5d13 initial version
carl
parents:
diff changeset
4953 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4954 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4955 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4956 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
4957 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
45c8592d5d13 initial version
carl
parents:
diff changeset
4958 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
4959 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4960 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4961 # The program doesn't exist.
45c8592d5d13 initial version
carl
parents:
diff changeset
4962 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4963 \$echo \"This script is just a wrapper for \$program.\" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4964 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
4965 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
4966 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4967 fi\
45c8592d5d13 initial version
carl
parents:
diff changeset
4968 "
45c8592d5d13 initial version
carl
parents:
diff changeset
4969 chmod +x $output
45c8592d5d13 initial version
carl
parents:
diff changeset
4970 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4971 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
4972 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
4973 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
4974
45c8592d5d13 initial version
carl
parents:
diff changeset
4975 # See if we need to build an old-fashioned archive.
45c8592d5d13 initial version
carl
parents:
diff changeset
4976 for oldlib in $oldlibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
4977
45c8592d5d13 initial version
carl
parents:
diff changeset
4978 if test "$build_libtool_libs" = convenience; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4979 oldobjs="$libobjs_save"
45c8592d5d13 initial version
carl
parents:
diff changeset
4980 addlibs="$convenience"
45c8592d5d13 initial version
carl
parents:
diff changeset
4981 build_libtool_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
4982 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4983 if test "$build_libtool_libs" = module; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4984 oldobjs="$libobjs_save"
45c8592d5d13 initial version
carl
parents:
diff changeset
4985 build_libtool_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
4986 else
45c8592d5d13 initial version
carl
parents:
diff changeset
4987 oldobjs="$old_deplibs $non_pic_objects"
45c8592d5d13 initial version
carl
parents:
diff changeset
4988 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4989 addlibs="$old_convenience"
45c8592d5d13 initial version
carl
parents:
diff changeset
4990 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
4991
45c8592d5d13 initial version
carl
parents:
diff changeset
4992 if test -n "$addlibs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
4993 gentop="$output_objdir/${outputname}x"
45c8592d5d13 initial version
carl
parents:
diff changeset
4994 $show "${rm}r $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
4995 $run ${rm}r "$gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
4996 $show "$mkdir $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
4997 $run $mkdir "$gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
4998 status=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
4999 if test "$status" -ne 0 && test ! -d "$gentop"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5000 exit $status
45c8592d5d13 initial version
carl
parents:
diff changeset
5001 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5002 generated="$generated $gentop"
45c8592d5d13 initial version
carl
parents:
diff changeset
5003
45c8592d5d13 initial version
carl
parents:
diff changeset
5004 # Add in members from convenience archives.
45c8592d5d13 initial version
carl
parents:
diff changeset
5005 for xlib in $addlibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5006 # Extract the objects.
45c8592d5d13 initial version
carl
parents:
diff changeset
5007 case $xlib in
45c8592d5d13 initial version
carl
parents:
diff changeset
5008 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5009 *) xabs=`pwd`"/$xlib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5010 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5011 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5012 xdir="$gentop/$xlib"
45c8592d5d13 initial version
carl
parents:
diff changeset
5013
45c8592d5d13 initial version
carl
parents:
diff changeset
5014 $show "${rm}r $xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5015 $run ${rm}r "$xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5016 $show "$mkdir $xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5017 $run $mkdir "$xdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5018 status=$?
45c8592d5d13 initial version
carl
parents:
diff changeset
5019 if test "$status" -ne 0 && test ! -d "$xdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5020 exit $status
45c8592d5d13 initial version
carl
parents:
diff changeset
5021 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5022 # We will extract separately just the conflicting names and we will no
45c8592d5d13 initial version
carl
parents:
diff changeset
5023 # longer touch any unique names. It is faster to leave these extract
45c8592d5d13 initial version
carl
parents:
diff changeset
5024 # automatically by $AR in one run.
45c8592d5d13 initial version
carl
parents:
diff changeset
5025 $show "(cd $xdir && $AR x $xabs)"
45c8592d5d13 initial version
carl
parents:
diff changeset
5026 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5027 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
45c8592d5d13 initial version
carl
parents:
diff changeset
5028 :
45c8592d5d13 initial version
carl
parents:
diff changeset
5029 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5030 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5031 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5032 $AR t "$xabs" | sort | uniq -cd | while read -r count name
45c8592d5d13 initial version
carl
parents:
diff changeset
5033 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5034 i=1
45c8592d5d13 initial version
carl
parents:
diff changeset
5035 while test "$i" -le "$count"
45c8592d5d13 initial version
carl
parents:
diff changeset
5036 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5037 # Put our $i before any first dot (extension)
45c8592d5d13 initial version
carl
parents:
diff changeset
5038 # Never overwrite any file
45c8592d5d13 initial version
carl
parents:
diff changeset
5039 name_to="$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
5040 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
45c8592d5d13 initial version
carl
parents:
diff changeset
5041 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5042 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5043 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5044 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
45c8592d5d13 initial version
carl
parents:
diff changeset
5045 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5046 i=`expr $i + 1`
45c8592d5d13 initial version
carl
parents:
diff changeset
5047 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5048 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5049 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5050
45c8592d5d13 initial version
carl
parents:
diff changeset
5051 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
45c8592d5d13 initial version
carl
parents:
diff changeset
5052 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5053 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5054
45c8592d5d13 initial version
carl
parents:
diff changeset
5055 # Do each command in the archive commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
5056 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5057 cmds=$old_archive_from_new_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
5058 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5059 eval cmds=\"$old_archive_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5060
45c8592d5d13 initial version
carl
parents:
diff changeset
5061 if len=`expr "X$cmds" : ".*"` &&
45c8592d5d13 initial version
carl
parents:
diff changeset
5062 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5063 cmds=$old_archive_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
5064 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5065 # the command line is too long to link in one step, link in parts
45c8592d5d13 initial version
carl
parents:
diff changeset
5066 $echo "using piecewise archive linking..."
45c8592d5d13 initial version
carl
parents:
diff changeset
5067 save_RANLIB=$RANLIB
45c8592d5d13 initial version
carl
parents:
diff changeset
5068 RANLIB=:
45c8592d5d13 initial version
carl
parents:
diff changeset
5069 objlist=
45c8592d5d13 initial version
carl
parents:
diff changeset
5070 concat_cmds=
45c8592d5d13 initial version
carl
parents:
diff changeset
5071 save_oldobjs=$oldobjs
45c8592d5d13 initial version
carl
parents:
diff changeset
5072 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
45c8592d5d13 initial version
carl
parents:
diff changeset
5073 # encoded into archives. This makes 'ar r' malfunction in
45c8592d5d13 initial version
carl
parents:
diff changeset
5074 # this piecewise linking case whenever conflicting object
45c8592d5d13 initial version
carl
parents:
diff changeset
5075 # names appear in distinct ar calls; check, warn and compensate.
45c8592d5d13 initial version
carl
parents:
diff changeset
5076 if (for obj in $save_oldobjs
45c8592d5d13 initial version
carl
parents:
diff changeset
5077 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5078 $echo "X$obj" | $Xsed -e 's%^.*/%%'
45c8592d5d13 initial version
carl
parents:
diff changeset
5079 done | sort | sort -uc >/dev/null 2>&1); then
45c8592d5d13 initial version
carl
parents:
diff changeset
5080 :
45c8592d5d13 initial version
carl
parents:
diff changeset
5081 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5082 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5083 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5084 AR_FLAGS=cq
45c8592d5d13 initial version
carl
parents:
diff changeset
5085 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5086 # Is there a better way of finding the last object in the list?
45c8592d5d13 initial version
carl
parents:
diff changeset
5087 for obj in $save_oldobjs
45c8592d5d13 initial version
carl
parents:
diff changeset
5088 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5089 last_oldobj=$obj
45c8592d5d13 initial version
carl
parents:
diff changeset
5090 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5091 for obj in $save_oldobjs
45c8592d5d13 initial version
carl
parents:
diff changeset
5092 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5093 oldobjs="$objlist $obj"
45c8592d5d13 initial version
carl
parents:
diff changeset
5094 objlist="$objlist $obj"
45c8592d5d13 initial version
carl
parents:
diff changeset
5095 eval test_cmds=\"$old_archive_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5096 if len=`expr "X$test_cmds" : ".*"` &&
45c8592d5d13 initial version
carl
parents:
diff changeset
5097 test "$len" -le "$max_cmd_len"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5098 :
45c8592d5d13 initial version
carl
parents:
diff changeset
5099 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5100 # the above command should be used before it gets too long
45c8592d5d13 initial version
carl
parents:
diff changeset
5101 oldobjs=$objlist
45c8592d5d13 initial version
carl
parents:
diff changeset
5102 if test "$obj" = "$last_oldobj" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5103 RANLIB=$save_RANLIB
45c8592d5d13 initial version
carl
parents:
diff changeset
5104 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5105 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
45c8592d5d13 initial version
carl
parents:
diff changeset
5106 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5107 objlist=
45c8592d5d13 initial version
carl
parents:
diff changeset
5108 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5109 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5110 RANLIB=$save_RANLIB
45c8592d5d13 initial version
carl
parents:
diff changeset
5111 oldobjs=$objlist
45c8592d5d13 initial version
carl
parents:
diff changeset
5112 if test "X$oldobjs" = "X" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5113 eval cmds=\"\$concat_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5114 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5115 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5116 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5117 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5118 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5119 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
5120 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5121 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5122 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5123 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
5124 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5125 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5126 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5127 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5128
45c8592d5d13 initial version
carl
parents:
diff changeset
5129 if test -n "$generated"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5130 $show "${rm}r$generated"
45c8592d5d13 initial version
carl
parents:
diff changeset
5131 $run ${rm}r$generated
45c8592d5d13 initial version
carl
parents:
diff changeset
5132 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5133
45c8592d5d13 initial version
carl
parents:
diff changeset
5134 # Now create the libtool archive.
45c8592d5d13 initial version
carl
parents:
diff changeset
5135 case $output in
45c8592d5d13 initial version
carl
parents:
diff changeset
5136 *.la)
45c8592d5d13 initial version
carl
parents:
diff changeset
5137 old_library=
45c8592d5d13 initial version
carl
parents:
diff changeset
5138 test "$build_old_libs" = yes && old_library="$libname.$libext"
45c8592d5d13 initial version
carl
parents:
diff changeset
5139 $show "creating $output"
45c8592d5d13 initial version
carl
parents:
diff changeset
5140
45c8592d5d13 initial version
carl
parents:
diff changeset
5141 # Preserve any variables that may affect compiler behavior
45c8592d5d13 initial version
carl
parents:
diff changeset
5142 for var in $variables_saved_for_relink; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5143 if eval test -z \"\${$var+set}\"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5144 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
5145 elif eval var_value=\$$var; test -z "$var_value"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5146 relink_command="$var=; export $var; $relink_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
5147 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5148 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5149 relink_command="$var=\"$var_value\"; export $var; $relink_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
5150 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5151 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5152 # Quote the link command for shipping.
45c8592d5d13 initial version
carl
parents:
diff changeset
5153 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
45c8592d5d13 initial version
carl
parents:
diff changeset
5154 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5155 if test "$hardcode_automatic" = yes ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5156 relink_command=
45c8592d5d13 initial version
carl
parents:
diff changeset
5157 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5158
45c8592d5d13 initial version
carl
parents:
diff changeset
5159
45c8592d5d13 initial version
carl
parents:
diff changeset
5160 # Only create the output if not a dry run.
45c8592d5d13 initial version
carl
parents:
diff changeset
5161 if test -z "$run"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5162 for installed in no yes; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5163 if test "$installed" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5164 if test -z "$install_libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5165 break
45c8592d5d13 initial version
carl
parents:
diff changeset
5166 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5167 output="$output_objdir/$outputname"i
45c8592d5d13 initial version
carl
parents:
diff changeset
5168 # Replace all uninstalled libtool libraries with the installed ones
45c8592d5d13 initial version
carl
parents:
diff changeset
5169 newdependency_libs=
45c8592d5d13 initial version
carl
parents:
diff changeset
5170 for deplib in $dependency_libs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5171 case $deplib in
45c8592d5d13 initial version
carl
parents:
diff changeset
5172 *.la)
45c8592d5d13 initial version
carl
parents:
diff changeset
5173 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5174 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
45c8592d5d13 initial version
carl
parents:
diff changeset
5175 if test -z "$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5176 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5177 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5178 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5179 newdependency_libs="$newdependency_libs $libdir/$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
5180 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5181 *) newdependency_libs="$newdependency_libs $deplib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5182 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5183 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5184 dependency_libs="$newdependency_libs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5185 newdlfiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
5186 for lib in $dlfiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5187 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5188 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
45c8592d5d13 initial version
carl
parents:
diff changeset
5189 if test -z "$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5190 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5191 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5192 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5193 newdlfiles="$newdlfiles $libdir/$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
5194 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5195 dlfiles="$newdlfiles"
45c8592d5d13 initial version
carl
parents:
diff changeset
5196 newdlprefiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
5197 for lib in $dlprefiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5198 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5199 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
45c8592d5d13 initial version
carl
parents:
diff changeset
5200 if test -z "$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5201 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5202 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5203 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5204 newdlprefiles="$newdlprefiles $libdir/$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
5205 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5206 dlprefiles="$newdlprefiles"
45c8592d5d13 initial version
carl
parents:
diff changeset
5207 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5208 newdlfiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
5209 for lib in $dlfiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5210 case $lib in
45c8592d5d13 initial version
carl
parents:
diff changeset
5211 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5212 *) abs=`pwd`"/$lib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5213 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5214 newdlfiles="$newdlfiles $abs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5215 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5216 dlfiles="$newdlfiles"
45c8592d5d13 initial version
carl
parents:
diff changeset
5217 newdlprefiles=
45c8592d5d13 initial version
carl
parents:
diff changeset
5218 for lib in $dlprefiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5219 case $lib in
45c8592d5d13 initial version
carl
parents:
diff changeset
5220 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5221 *) abs=`pwd`"/$lib" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5222 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5223 newdlprefiles="$newdlprefiles $abs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5224 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5225 dlprefiles="$newdlprefiles"
45c8592d5d13 initial version
carl
parents:
diff changeset
5226 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5227 $rm $output
45c8592d5d13 initial version
carl
parents:
diff changeset
5228 # place dlname in correct position for cygwin
45c8592d5d13 initial version
carl
parents:
diff changeset
5229 tdlname=$dlname
45c8592d5d13 initial version
carl
parents:
diff changeset
5230 case $host,$output,$installed,$module,$dlname in
45c8592d5d13 initial version
carl
parents:
diff changeset
5231 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5232 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5233 $echo > $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
5234 # $outputname - a libtool library file
45c8592d5d13 initial version
carl
parents:
diff changeset
5235 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
45c8592d5d13 initial version
carl
parents:
diff changeset
5236 #
45c8592d5d13 initial version
carl
parents:
diff changeset
5237 # Please DO NOT delete this file!
45c8592d5d13 initial version
carl
parents:
diff changeset
5238 # It is necessary for linking the library.
45c8592d5d13 initial version
carl
parents:
diff changeset
5239
45c8592d5d13 initial version
carl
parents:
diff changeset
5240 # The name that we can dlopen(3).
45c8592d5d13 initial version
carl
parents:
diff changeset
5241 dlname='$tdlname'
45c8592d5d13 initial version
carl
parents:
diff changeset
5242
45c8592d5d13 initial version
carl
parents:
diff changeset
5243 # Names of this library.
45c8592d5d13 initial version
carl
parents:
diff changeset
5244 library_names='$library_names'
45c8592d5d13 initial version
carl
parents:
diff changeset
5245
45c8592d5d13 initial version
carl
parents:
diff changeset
5246 # The name of the static archive.
45c8592d5d13 initial version
carl
parents:
diff changeset
5247 old_library='$old_library'
45c8592d5d13 initial version
carl
parents:
diff changeset
5248
45c8592d5d13 initial version
carl
parents:
diff changeset
5249 # Libraries that this one depends upon.
45c8592d5d13 initial version
carl
parents:
diff changeset
5250 dependency_libs='$dependency_libs'
45c8592d5d13 initial version
carl
parents:
diff changeset
5251
45c8592d5d13 initial version
carl
parents:
diff changeset
5252 # Version information for $libname.
45c8592d5d13 initial version
carl
parents:
diff changeset
5253 current=$current
45c8592d5d13 initial version
carl
parents:
diff changeset
5254 age=$age
45c8592d5d13 initial version
carl
parents:
diff changeset
5255 revision=$revision
45c8592d5d13 initial version
carl
parents:
diff changeset
5256
45c8592d5d13 initial version
carl
parents:
diff changeset
5257 # Is this an already installed library?
45c8592d5d13 initial version
carl
parents:
diff changeset
5258 installed=$installed
45c8592d5d13 initial version
carl
parents:
diff changeset
5259
45c8592d5d13 initial version
carl
parents:
diff changeset
5260 # Should we warn about portability when linking against -modules?
45c8592d5d13 initial version
carl
parents:
diff changeset
5261 shouldnotlink=$module
45c8592d5d13 initial version
carl
parents:
diff changeset
5262
45c8592d5d13 initial version
carl
parents:
diff changeset
5263 # Files to dlopen/dlpreopen
45c8592d5d13 initial version
carl
parents:
diff changeset
5264 dlopen='$dlfiles'
45c8592d5d13 initial version
carl
parents:
diff changeset
5265 dlpreopen='$dlprefiles'
45c8592d5d13 initial version
carl
parents:
diff changeset
5266
45c8592d5d13 initial version
carl
parents:
diff changeset
5267 # Directory that this library needs to be installed in:
45c8592d5d13 initial version
carl
parents:
diff changeset
5268 libdir='$install_libdir'"
45c8592d5d13 initial version
carl
parents:
diff changeset
5269 if test "$installed" = no && test "$need_relink" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5270 $echo >> $output "\
45c8592d5d13 initial version
carl
parents:
diff changeset
5271 relink_command=\"$relink_command\""
45c8592d5d13 initial version
carl
parents:
diff changeset
5272 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5273 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5274 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5275
45c8592d5d13 initial version
carl
parents:
diff changeset
5276 # Do a symbolic link so that the libtool archive can be found in
45c8592d5d13 initial version
carl
parents:
diff changeset
5277 # LD_LIBRARY_PATH before the program is installed.
45c8592d5d13 initial version
carl
parents:
diff changeset
5278 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
45c8592d5d13 initial version
carl
parents:
diff changeset
5279 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5280 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5281 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5282 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
5283 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5284
45c8592d5d13 initial version
carl
parents:
diff changeset
5285 # libtool install mode
45c8592d5d13 initial version
carl
parents:
diff changeset
5286 install)
45c8592d5d13 initial version
carl
parents:
diff changeset
5287 modename="$modename: install"
45c8592d5d13 initial version
carl
parents:
diff changeset
5288
45c8592d5d13 initial version
carl
parents:
diff changeset
5289 # There may be an optional sh(1) argument at the beginning of
45c8592d5d13 initial version
carl
parents:
diff changeset
5290 # install_prog (especially on Windows NT).
45c8592d5d13 initial version
carl
parents:
diff changeset
5291 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
45c8592d5d13 initial version
carl
parents:
diff changeset
5292 # Allow the use of GNU shtool's install command.
45c8592d5d13 initial version
carl
parents:
diff changeset
5293 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5294 # Aesthetically quote it.
45c8592d5d13 initial version
carl
parents:
diff changeset
5295 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5296 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
5297 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
45c8592d5d13 initial version
carl
parents:
diff changeset
5298 arg="\"$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
5299 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5300 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5301 install_prog="$arg "
45c8592d5d13 initial version
carl
parents:
diff changeset
5302 arg="$1"
45c8592d5d13 initial version
carl
parents:
diff changeset
5303 shift
45c8592d5d13 initial version
carl
parents:
diff changeset
5304 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5305 install_prog=
45c8592d5d13 initial version
carl
parents:
diff changeset
5306 arg="$nonopt"
45c8592d5d13 initial version
carl
parents:
diff changeset
5307 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5308
45c8592d5d13 initial version
carl
parents:
diff changeset
5309 # The real first argument should be the name of the installation program.
45c8592d5d13 initial version
carl
parents:
diff changeset
5310 # Aesthetically quote it.
45c8592d5d13 initial version
carl
parents:
diff changeset
5311 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5312 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
5313 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
45c8592d5d13 initial version
carl
parents:
diff changeset
5314 arg="\"$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
5315 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5316 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5317 install_prog="$install_prog$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
5318
45c8592d5d13 initial version
carl
parents:
diff changeset
5319 # We need to accept at least all the BSD install flags.
45c8592d5d13 initial version
carl
parents:
diff changeset
5320 dest=
45c8592d5d13 initial version
carl
parents:
diff changeset
5321 files=
45c8592d5d13 initial version
carl
parents:
diff changeset
5322 opts=
45c8592d5d13 initial version
carl
parents:
diff changeset
5323 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
5324 install_type=
45c8592d5d13 initial version
carl
parents:
diff changeset
5325 isdir=no
45c8592d5d13 initial version
carl
parents:
diff changeset
5326 stripme=
45c8592d5d13 initial version
carl
parents:
diff changeset
5327 for arg
45c8592d5d13 initial version
carl
parents:
diff changeset
5328 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5329 if test -n "$dest"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5330 files="$files $dest"
45c8592d5d13 initial version
carl
parents:
diff changeset
5331 dest="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
5332 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
5333 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5334
45c8592d5d13 initial version
carl
parents:
diff changeset
5335 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
5336 -d) isdir=yes ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5337 -f) prev="-f" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5338 -g) prev="-g" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5339 -m) prev="-m" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5340 -o) prev="-o" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5341 -s)
45c8592d5d13 initial version
carl
parents:
diff changeset
5342 stripme=" -s"
45c8592d5d13 initial version
carl
parents:
diff changeset
5343 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
5344 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5345 -*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5346
45c8592d5d13 initial version
carl
parents:
diff changeset
5347 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
5348 # If the previous option needed an argument, then skip it.
45c8592d5d13 initial version
carl
parents:
diff changeset
5349 if test -n "$prev"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5350 prev=
45c8592d5d13 initial version
carl
parents:
diff changeset
5351 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5352 dest="$arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
5353 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
5354 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5355 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5356 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5357
45c8592d5d13 initial version
carl
parents:
diff changeset
5358 # Aesthetically quote the argument.
45c8592d5d13 initial version
carl
parents:
diff changeset
5359 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5360 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
5361 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
45c8592d5d13 initial version
carl
parents:
diff changeset
5362 arg="\"$arg\""
45c8592d5d13 initial version
carl
parents:
diff changeset
5363 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5364 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5365 install_prog="$install_prog $arg"
45c8592d5d13 initial version
carl
parents:
diff changeset
5366 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5367
45c8592d5d13 initial version
carl
parents:
diff changeset
5368 if test -z "$install_prog"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5369 $echo "$modename: you must specify an install program" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5370 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5371 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5372 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5373
45c8592d5d13 initial version
carl
parents:
diff changeset
5374 if test -n "$prev"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5375 $echo "$modename: the \`$prev' option requires an argument" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5376 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5377 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5378 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5379
45c8592d5d13 initial version
carl
parents:
diff changeset
5380 if test -z "$files"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5381 if test -z "$dest"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5382 $echo "$modename: no file or destination specified" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5383 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5384 $echo "$modename: you must specify a destination" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5385 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5386 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5387 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5388 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5389
45c8592d5d13 initial version
carl
parents:
diff changeset
5390 # Strip any trailing slash from the destination.
45c8592d5d13 initial version
carl
parents:
diff changeset
5391 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5392
45c8592d5d13 initial version
carl
parents:
diff changeset
5393 # Check to see that the destination is a directory.
45c8592d5d13 initial version
carl
parents:
diff changeset
5394 test -d "$dest" && isdir=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
5395 if test "$isdir" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5396 destdir="$dest"
45c8592d5d13 initial version
carl
parents:
diff changeset
5397 destname=
45c8592d5d13 initial version
carl
parents:
diff changeset
5398 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5399 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5400 test "X$destdir" = "X$dest" && destdir=.
45c8592d5d13 initial version
carl
parents:
diff changeset
5401 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5402
45c8592d5d13 initial version
carl
parents:
diff changeset
5403 # Not a directory, so check to see that there is only one file specified.
45c8592d5d13 initial version
carl
parents:
diff changeset
5404 set dummy $files
45c8592d5d13 initial version
carl
parents:
diff changeset
5405 if test "$#" -gt 2; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5406 $echo "$modename: \`$dest' is not a directory" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5407 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5408 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5409 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5410 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5411 case $destdir in
45c8592d5d13 initial version
carl
parents:
diff changeset
5412 [\\/]* | [A-Za-z]:[\\/]*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5413 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
5414 for file in $files; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5415 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5416 *.lo) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5417 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
5418 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5419 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5420 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5421 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5422 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5423 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5424 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5425 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5426
45c8592d5d13 initial version
carl
parents:
diff changeset
5427 # This variable tells wrapper scripts just to set variables rather
45c8592d5d13 initial version
carl
parents:
diff changeset
5428 # than running their programs.
45c8592d5d13 initial version
carl
parents:
diff changeset
5429 libtool_install_magic="$magic"
45c8592d5d13 initial version
carl
parents:
diff changeset
5430
45c8592d5d13 initial version
carl
parents:
diff changeset
5431 staticlibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
5432 future_libdirs=
45c8592d5d13 initial version
carl
parents:
diff changeset
5433 current_libdirs=
45c8592d5d13 initial version
carl
parents:
diff changeset
5434 for file in $files; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5435
45c8592d5d13 initial version
carl
parents:
diff changeset
5436 # Do each installation.
45c8592d5d13 initial version
carl
parents:
diff changeset
5437 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5438 *.$libext)
45c8592d5d13 initial version
carl
parents:
diff changeset
5439 # Do the static libraries later.
45c8592d5d13 initial version
carl
parents:
diff changeset
5440 staticlibs="$staticlibs $file"
45c8592d5d13 initial version
carl
parents:
diff changeset
5441 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5442
45c8592d5d13 initial version
carl
parents:
diff changeset
5443 *.la)
45c8592d5d13 initial version
carl
parents:
diff changeset
5444 # Check to see that this really is a libtool archive.
45c8592d5d13 initial version
carl
parents:
diff changeset
5445 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
5446 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5447 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5448 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5449 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5450 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5451
45c8592d5d13 initial version
carl
parents:
diff changeset
5452 library_names=
45c8592d5d13 initial version
carl
parents:
diff changeset
5453 old_library=
45c8592d5d13 initial version
carl
parents:
diff changeset
5454 relink_command=
45c8592d5d13 initial version
carl
parents:
diff changeset
5455 # If there is no directory component, then add one.
45c8592d5d13 initial version
carl
parents:
diff changeset
5456 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5457 */* | *\\*) . $file ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5458 *) . ./$file ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5459 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5460
45c8592d5d13 initial version
carl
parents:
diff changeset
5461 # Add the libdir to current_libdirs if it is the destination.
45c8592d5d13 initial version
carl
parents:
diff changeset
5462 if test "X$destdir" = "X$libdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5463 case "$current_libdirs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
5464 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5465 *) current_libdirs="$current_libdirs $libdir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5466 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5467 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5468 # Note the libdir as a future libdir.
45c8592d5d13 initial version
carl
parents:
diff changeset
5469 case "$future_libdirs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
5470 *" $libdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5471 *) future_libdirs="$future_libdirs $libdir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5472 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5473 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5474
45c8592d5d13 initial version
carl
parents:
diff changeset
5475 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
45c8592d5d13 initial version
carl
parents:
diff changeset
5476 test "X$dir" = "X$file/" && dir=
45c8592d5d13 initial version
carl
parents:
diff changeset
5477 dir="$dir$objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5478
45c8592d5d13 initial version
carl
parents:
diff changeset
5479 if test -n "$relink_command"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5480 # Determine the prefix the user has applied to our future dir.
45c8592d5d13 initial version
carl
parents:
diff changeset
5481 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5482
45c8592d5d13 initial version
carl
parents:
diff changeset
5483 # Don't allow the user to place us outside of our expected
45c8592d5d13 initial version
carl
parents:
diff changeset
5484 # location b/c this prevents finding dependent libraries that
45c8592d5d13 initial version
carl
parents:
diff changeset
5485 # are installed to the same prefix.
45c8592d5d13 initial version
carl
parents:
diff changeset
5486 # At present, this check doesn't affect windows .dll's that
45c8592d5d13 initial version
carl
parents:
diff changeset
5487 # are installed into $libdir/../bin (currently, that works fine)
45c8592d5d13 initial version
carl
parents:
diff changeset
5488 # but it's something to keep an eye on.
45c8592d5d13 initial version
carl
parents:
diff changeset
5489 if test "$inst_prefix_dir" = "$destdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5490 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5491 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5492 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5493
45c8592d5d13 initial version
carl
parents:
diff changeset
5494 if test -n "$inst_prefix_dir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5495 # Stick the inst_prefix_dir data into the link command.
45c8592d5d13 initial version
carl
parents:
diff changeset
5496 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5497 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5498 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5499 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5500
45c8592d5d13 initial version
carl
parents:
diff changeset
5501 $echo "$modename: warning: relinking \`$file'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5502 $show "$relink_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
5503 if $run eval "$relink_command"; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
5504 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5505 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5506 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5507 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5508 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5509
45c8592d5d13 initial version
carl
parents:
diff changeset
5510 # See the names of the shared library.
45c8592d5d13 initial version
carl
parents:
diff changeset
5511 set dummy $library_names
45c8592d5d13 initial version
carl
parents:
diff changeset
5512 if test -n "$2"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5513 realname="$2"
45c8592d5d13 initial version
carl
parents:
diff changeset
5514 shift
45c8592d5d13 initial version
carl
parents:
diff changeset
5515 shift
45c8592d5d13 initial version
carl
parents:
diff changeset
5516
45c8592d5d13 initial version
carl
parents:
diff changeset
5517 srcname="$realname"
45c8592d5d13 initial version
carl
parents:
diff changeset
5518 test -n "$relink_command" && srcname="$realname"T
45c8592d5d13 initial version
carl
parents:
diff changeset
5519
45c8592d5d13 initial version
carl
parents:
diff changeset
5520 # Install the shared library and build the symlinks.
45c8592d5d13 initial version
carl
parents:
diff changeset
5521 $show "$install_prog $dir/$srcname $destdir/$realname"
45c8592d5d13 initial version
carl
parents:
diff changeset
5522 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5523 if test -n "$stripme" && test -n "$striplib"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5524 $show "$striplib $destdir/$realname"
45c8592d5d13 initial version
carl
parents:
diff changeset
5525 $run eval "$striplib $destdir/$realname" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5526 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5527
45c8592d5d13 initial version
carl
parents:
diff changeset
5528 if test "$#" -gt 0; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5529 # Delete the old symlinks, and create new ones.
45c8592d5d13 initial version
carl
parents:
diff changeset
5530 for linkname
45c8592d5d13 initial version
carl
parents:
diff changeset
5531 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5532 if test "$linkname" != "$realname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5533 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
45c8592d5d13 initial version
carl
parents:
diff changeset
5534 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
45c8592d5d13 initial version
carl
parents:
diff changeset
5535 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5536 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5537 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5538
45c8592d5d13 initial version
carl
parents:
diff changeset
5539 # Do each command in the postinstall commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
5540 lib="$destdir/$realname"
45c8592d5d13 initial version
carl
parents:
diff changeset
5541 cmds=$postinstall_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
5542 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
5543 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5544 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5545 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5546 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
5547 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5548 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5549 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5550 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5551
45c8592d5d13 initial version
carl
parents:
diff changeset
5552 # Install the pseudo-library for information purposes.
45c8592d5d13 initial version
carl
parents:
diff changeset
5553 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5554 instname="$dir/$name"i
45c8592d5d13 initial version
carl
parents:
diff changeset
5555 $show "$install_prog $instname $destdir/$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
5556 $run eval "$install_prog $instname $destdir/$name" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5557
45c8592d5d13 initial version
carl
parents:
diff changeset
5558 # Maybe install the static library, too.
45c8592d5d13 initial version
carl
parents:
diff changeset
5559 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
45c8592d5d13 initial version
carl
parents:
diff changeset
5560 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5561
45c8592d5d13 initial version
carl
parents:
diff changeset
5562 *.lo)
45c8592d5d13 initial version
carl
parents:
diff changeset
5563 # Install (i.e. copy) a libtool object.
45c8592d5d13 initial version
carl
parents:
diff changeset
5564
45c8592d5d13 initial version
carl
parents:
diff changeset
5565 # Figure out destination file name, if it wasn't already specified.
45c8592d5d13 initial version
carl
parents:
diff changeset
5566 if test -n "$destname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5567 destfile="$destdir/$destname"
45c8592d5d13 initial version
carl
parents:
diff changeset
5568 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5569 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5570 destfile="$destdir/$destfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
5571 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5572
45c8592d5d13 initial version
carl
parents:
diff changeset
5573 # Deduce the name of the destination old-style object file.
45c8592d5d13 initial version
carl
parents:
diff changeset
5574 case $destfile in
45c8592d5d13 initial version
carl
parents:
diff changeset
5575 *.lo)
45c8592d5d13 initial version
carl
parents:
diff changeset
5576 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5577 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5578 *.$objext)
45c8592d5d13 initial version
carl
parents:
diff changeset
5579 staticdest="$destfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
5580 destfile=
45c8592d5d13 initial version
carl
parents:
diff changeset
5581 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5582 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
5583 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5584 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5585 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5586 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5587 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5588
45c8592d5d13 initial version
carl
parents:
diff changeset
5589 # Install the libtool object if requested.
45c8592d5d13 initial version
carl
parents:
diff changeset
5590 if test -n "$destfile"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5591 $show "$install_prog $file $destfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
5592 $run eval "$install_prog $file $destfile" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5593 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5594
45c8592d5d13 initial version
carl
parents:
diff changeset
5595 # Install the old object if enabled.
45c8592d5d13 initial version
carl
parents:
diff changeset
5596 if test "$build_old_libs" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5597 # Deduce the name of the old-style object file.
45c8592d5d13 initial version
carl
parents:
diff changeset
5598 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5599
45c8592d5d13 initial version
carl
parents:
diff changeset
5600 $show "$install_prog $staticobj $staticdest"
45c8592d5d13 initial version
carl
parents:
diff changeset
5601 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5602 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5603 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
5604 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5605
45c8592d5d13 initial version
carl
parents:
diff changeset
5606 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
5607 # Figure out destination file name, if it wasn't already specified.
45c8592d5d13 initial version
carl
parents:
diff changeset
5608 if test -n "$destname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5609 destfile="$destdir/$destname"
45c8592d5d13 initial version
carl
parents:
diff changeset
5610 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5611 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5612 destfile="$destdir/$destfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
5613 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5614
45c8592d5d13 initial version
carl
parents:
diff changeset
5615 # If the file is missing, and there is a .exe on the end, strip it
45c8592d5d13 initial version
carl
parents:
diff changeset
5616 # because it is most likely a libtool script we actually want to
45c8592d5d13 initial version
carl
parents:
diff changeset
5617 # install
45c8592d5d13 initial version
carl
parents:
diff changeset
5618 stripped_ext=""
45c8592d5d13 initial version
carl
parents:
diff changeset
5619 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5620 *.exe)
45c8592d5d13 initial version
carl
parents:
diff changeset
5621 if test ! -f "$file"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5622 file=`$echo $file|${SED} 's,.exe$,,'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5623 stripped_ext=".exe"
45c8592d5d13 initial version
carl
parents:
diff changeset
5624 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5625 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5626 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5627
45c8592d5d13 initial version
carl
parents:
diff changeset
5628 # Do a test to see if this is really a libtool program.
45c8592d5d13 initial version
carl
parents:
diff changeset
5629 case $host in
45c8592d5d13 initial version
carl
parents:
diff changeset
5630 *cygwin*|*mingw*)
45c8592d5d13 initial version
carl
parents:
diff changeset
5631 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5632 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5633 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
5634 wrapper=$file
45c8592d5d13 initial version
carl
parents:
diff changeset
5635 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5636 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5637 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5638 notinst_deplibs=
45c8592d5d13 initial version
carl
parents:
diff changeset
5639 relink_command=
45c8592d5d13 initial version
carl
parents:
diff changeset
5640
45c8592d5d13 initial version
carl
parents:
diff changeset
5641 # To insure that "foo" is sourced, and not "foo.exe",
45c8592d5d13 initial version
carl
parents:
diff changeset
5642 # finese the cygwin/MSYS system by explicitly sourcing "foo."
45c8592d5d13 initial version
carl
parents:
diff changeset
5643 # which disallows the automatic-append-.exe behavior.
45c8592d5d13 initial version
carl
parents:
diff changeset
5644 case $build in
45c8592d5d13 initial version
carl
parents:
diff changeset
5645 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5646 *) wrapperdot=${wrapper} ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5647 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5648 # If there is no directory component, then add one.
45c8592d5d13 initial version
carl
parents:
diff changeset
5649 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5650 */* | *\\*) . ${wrapperdot} ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5651 *) . ./${wrapperdot} ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5652 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5653
45c8592d5d13 initial version
carl
parents:
diff changeset
5654 # Check the variables that should have been set.
45c8592d5d13 initial version
carl
parents:
diff changeset
5655 if test -z "$notinst_deplibs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5656 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5657 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5658 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5659
45c8592d5d13 initial version
carl
parents:
diff changeset
5660 finalize=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
5661 for lib in $notinst_deplibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5662 # Check to see that each library is installed.
45c8592d5d13 initial version
carl
parents:
diff changeset
5663 libdir=
45c8592d5d13 initial version
carl
parents:
diff changeset
5664 if test -f "$lib"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5665 # If there is no directory component, then add one.
45c8592d5d13 initial version
carl
parents:
diff changeset
5666 case $lib in
45c8592d5d13 initial version
carl
parents:
diff changeset
5667 */* | *\\*) . $lib ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5668 *) . ./$lib ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5669 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5670 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5671 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
45c8592d5d13 initial version
carl
parents:
diff changeset
5672 if test -n "$libdir" && test ! -f "$libfile"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5673 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5674 finalize=no
45c8592d5d13 initial version
carl
parents:
diff changeset
5675 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5676 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5677
45c8592d5d13 initial version
carl
parents:
diff changeset
5678 relink_command=
45c8592d5d13 initial version
carl
parents:
diff changeset
5679 # To insure that "foo" is sourced, and not "foo.exe",
45c8592d5d13 initial version
carl
parents:
diff changeset
5680 # finese the cygwin/MSYS system by explicitly sourcing "foo."
45c8592d5d13 initial version
carl
parents:
diff changeset
5681 # which disallows the automatic-append-.exe behavior.
45c8592d5d13 initial version
carl
parents:
diff changeset
5682 case $build in
45c8592d5d13 initial version
carl
parents:
diff changeset
5683 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5684 *) wrapperdot=${wrapper} ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5685 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5686 # If there is no directory component, then add one.
45c8592d5d13 initial version
carl
parents:
diff changeset
5687 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5688 */* | *\\*) . ${wrapperdot} ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5689 *) . ./${wrapperdot} ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5690 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5691
45c8592d5d13 initial version
carl
parents:
diff changeset
5692 outputname=
45c8592d5d13 initial version
carl
parents:
diff changeset
5693 if test "$fast_install" = no && test -n "$relink_command"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5694 if test "$finalize" = yes && test -z "$run"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5695 tmpdir="/tmp"
45c8592d5d13 initial version
carl
parents:
diff changeset
5696 test -n "$TMPDIR" && tmpdir="$TMPDIR"
45c8592d5d13 initial version
carl
parents:
diff changeset
5697 tmpdir="$tmpdir/libtool-$$"
45c8592d5d13 initial version
carl
parents:
diff changeset
5698 save_umask=`umask`
45c8592d5d13 initial version
carl
parents:
diff changeset
5699 umask 0077
45c8592d5d13 initial version
carl
parents:
diff changeset
5700 if $mkdir "$tmpdir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5701 umask $save_umask
45c8592d5d13 initial version
carl
parents:
diff changeset
5702 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5703 umask $save_umask
45c8592d5d13 initial version
carl
parents:
diff changeset
5704 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5705 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
5706 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5707 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5708 outputname="$tmpdir/$file"
45c8592d5d13 initial version
carl
parents:
diff changeset
5709 # Replace the output file specification.
45c8592d5d13 initial version
carl
parents:
diff changeset
5710 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5711
45c8592d5d13 initial version
carl
parents:
diff changeset
5712 $show "$relink_command"
45c8592d5d13 initial version
carl
parents:
diff changeset
5713 if $run eval "$relink_command"; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
5714 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5715 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5716 ${rm}r "$tmpdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5717 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
5718 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5719 file="$outputname"
45c8592d5d13 initial version
carl
parents:
diff changeset
5720 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5721 $echo "$modename: warning: cannot relink \`$file'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5722 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5723 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5724 # Install the binary that we compiled earlier.
45c8592d5d13 initial version
carl
parents:
diff changeset
5725 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5726 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5727 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5728
45c8592d5d13 initial version
carl
parents:
diff changeset
5729 # remove .exe since cygwin /usr/bin/install will append another
45c8592d5d13 initial version
carl
parents:
diff changeset
5730 # one anyways
45c8592d5d13 initial version
carl
parents:
diff changeset
5731 case $install_prog,$host in
45c8592d5d13 initial version
carl
parents:
diff changeset
5732 */usr/bin/install*,*cygwin*)
45c8592d5d13 initial version
carl
parents:
diff changeset
5733 case $file:$destfile in
45c8592d5d13 initial version
carl
parents:
diff changeset
5734 *.exe:*.exe)
45c8592d5d13 initial version
carl
parents:
diff changeset
5735 # this is ok
45c8592d5d13 initial version
carl
parents:
diff changeset
5736 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5737 *.exe:*)
45c8592d5d13 initial version
carl
parents:
diff changeset
5738 destfile=$destfile.exe
45c8592d5d13 initial version
carl
parents:
diff changeset
5739 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5740 *:*.exe)
45c8592d5d13 initial version
carl
parents:
diff changeset
5741 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5742 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5743 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5744 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5745 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5746 $show "$install_prog$stripme $file $destfile"
45c8592d5d13 initial version
carl
parents:
diff changeset
5747 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5748 test -n "$outputname" && ${rm}r "$tmpdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5749 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5750 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5751 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5752
45c8592d5d13 initial version
carl
parents:
diff changeset
5753 for file in $staticlibs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5754 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5755
45c8592d5d13 initial version
carl
parents:
diff changeset
5756 # Set up the ranlib parameters.
45c8592d5d13 initial version
carl
parents:
diff changeset
5757 oldlib="$destdir/$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
5758
45c8592d5d13 initial version
carl
parents:
diff changeset
5759 $show "$install_prog $file $oldlib"
45c8592d5d13 initial version
carl
parents:
diff changeset
5760 $run eval "$install_prog \$file \$oldlib" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5761
45c8592d5d13 initial version
carl
parents:
diff changeset
5762 if test -n "$stripme" && test -n "$old_striplib"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5763 $show "$old_striplib $oldlib"
45c8592d5d13 initial version
carl
parents:
diff changeset
5764 $run eval "$old_striplib $oldlib" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5765 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5766
45c8592d5d13 initial version
carl
parents:
diff changeset
5767 # Do each command in the postinstall commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
5768 cmds=$old_postinstall_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
5769 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
5770 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5771 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5772 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5773 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
5774 $run eval "$cmd" || exit $?
45c8592d5d13 initial version
carl
parents:
diff changeset
5775 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5776 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5777 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5778
45c8592d5d13 initial version
carl
parents:
diff changeset
5779 if test -n "$future_libdirs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5780 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5781 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5782
45c8592d5d13 initial version
carl
parents:
diff changeset
5783 if test -n "$current_libdirs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5784 # Maybe just do a dry run.
45c8592d5d13 initial version
carl
parents:
diff changeset
5785 test -n "$run" && current_libdirs=" -n$current_libdirs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5786 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
45c8592d5d13 initial version
carl
parents:
diff changeset
5787 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5788 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
5789 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5790 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5791
45c8592d5d13 initial version
carl
parents:
diff changeset
5792 # libtool finish mode
45c8592d5d13 initial version
carl
parents:
diff changeset
5793 finish)
45c8592d5d13 initial version
carl
parents:
diff changeset
5794 modename="$modename: finish"
45c8592d5d13 initial version
carl
parents:
diff changeset
5795 libdirs="$nonopt"
45c8592d5d13 initial version
carl
parents:
diff changeset
5796 admincmds=
45c8592d5d13 initial version
carl
parents:
diff changeset
5797
45c8592d5d13 initial version
carl
parents:
diff changeset
5798 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5799 for dir
45c8592d5d13 initial version
carl
parents:
diff changeset
5800 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5801 libdirs="$libdirs $dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5802 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5803
45c8592d5d13 initial version
carl
parents:
diff changeset
5804 for libdir in $libdirs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5805 if test -n "$finish_cmds"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5806 # Do each command in the finish commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
5807 cmds=$finish_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
5808 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
5809 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5810 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5811 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5812 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
5813 $run eval "$cmd" || admincmds="$admincmds
45c8592d5d13 initial version
carl
parents:
diff changeset
5814 $cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
5815 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5816 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
5817 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5818 if test -n "$finish_eval"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5819 # Do the single finish_eval.
45c8592d5d13 initial version
carl
parents:
diff changeset
5820 eval cmds=\"$finish_eval\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5821 $run eval "$cmds" || admincmds="$admincmds
45c8592d5d13 initial version
carl
parents:
diff changeset
5822 $cmds"
45c8592d5d13 initial version
carl
parents:
diff changeset
5823 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5824 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5825 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5826
45c8592d5d13 initial version
carl
parents:
diff changeset
5827 # Exit here if they wanted silent mode.
45c8592d5d13 initial version
carl
parents:
diff changeset
5828 test "$show" = : && exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
5829
45c8592d5d13 initial version
carl
parents:
diff changeset
5830 $echo "----------------------------------------------------------------------"
45c8592d5d13 initial version
carl
parents:
diff changeset
5831 $echo "Libraries have been installed in:"
45c8592d5d13 initial version
carl
parents:
diff changeset
5832 for libdir in $libdirs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5833 $echo " $libdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5834 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5835 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
5836 $echo "If you ever happen to want to link against installed libraries"
45c8592d5d13 initial version
carl
parents:
diff changeset
5837 $echo "in a given directory, LIBDIR, you must either use libtool, and"
45c8592d5d13 initial version
carl
parents:
diff changeset
5838 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
45c8592d5d13 initial version
carl
parents:
diff changeset
5839 $echo "flag during linking and do at least one of the following:"
45c8592d5d13 initial version
carl
parents:
diff changeset
5840 if test -n "$shlibpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5841 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
45c8592d5d13 initial version
carl
parents:
diff changeset
5842 $echo " during execution"
45c8592d5d13 initial version
carl
parents:
diff changeset
5843 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5844 if test -n "$runpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5845 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
45c8592d5d13 initial version
carl
parents:
diff changeset
5846 $echo " during linking"
45c8592d5d13 initial version
carl
parents:
diff changeset
5847 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5848 if test -n "$hardcode_libdir_flag_spec"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5849 libdir=LIBDIR
45c8592d5d13 initial version
carl
parents:
diff changeset
5850 eval flag=\"$hardcode_libdir_flag_spec\"
45c8592d5d13 initial version
carl
parents:
diff changeset
5851
45c8592d5d13 initial version
carl
parents:
diff changeset
5852 $echo " - use the \`$flag' linker flag"
45c8592d5d13 initial version
carl
parents:
diff changeset
5853 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5854 if test -n "$admincmds"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5855 $echo " - have your system administrator run these commands:$admincmds"
45c8592d5d13 initial version
carl
parents:
diff changeset
5856 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5857 if test -f /etc/ld.so.conf; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5858 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
45c8592d5d13 initial version
carl
parents:
diff changeset
5859 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5860 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
5861 $echo "See any operating system documentation about shared libraries for"
45c8592d5d13 initial version
carl
parents:
diff changeset
5862 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
45c8592d5d13 initial version
carl
parents:
diff changeset
5863 $echo "----------------------------------------------------------------------"
45c8592d5d13 initial version
carl
parents:
diff changeset
5864 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
5865 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5866
45c8592d5d13 initial version
carl
parents:
diff changeset
5867 # libtool execute mode
45c8592d5d13 initial version
carl
parents:
diff changeset
5868 execute)
45c8592d5d13 initial version
carl
parents:
diff changeset
5869 modename="$modename: execute"
45c8592d5d13 initial version
carl
parents:
diff changeset
5870
45c8592d5d13 initial version
carl
parents:
diff changeset
5871 # The first argument is the command name.
45c8592d5d13 initial version
carl
parents:
diff changeset
5872 cmd="$nonopt"
45c8592d5d13 initial version
carl
parents:
diff changeset
5873 if test -z "$cmd"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5874 $echo "$modename: you must specify a COMMAND" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5875 $echo "$help"
45c8592d5d13 initial version
carl
parents:
diff changeset
5876 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5877 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5878
45c8592d5d13 initial version
carl
parents:
diff changeset
5879 # Handle -dlopen flags immediately.
45c8592d5d13 initial version
carl
parents:
diff changeset
5880 for file in $execute_dlfiles; do
45c8592d5d13 initial version
carl
parents:
diff changeset
5881 if test ! -f "$file"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5882 $echo "$modename: \`$file' is not a file" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5883 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5884 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5885 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5886
45c8592d5d13 initial version
carl
parents:
diff changeset
5887 dir=
45c8592d5d13 initial version
carl
parents:
diff changeset
5888 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5889 *.la)
45c8592d5d13 initial version
carl
parents:
diff changeset
5890 # Check to see that this really is a libtool archive.
45c8592d5d13 initial version
carl
parents:
diff changeset
5891 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
45c8592d5d13 initial version
carl
parents:
diff changeset
5892 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5893 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5894 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5895 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5896 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5897
45c8592d5d13 initial version
carl
parents:
diff changeset
5898 # Read the libtool library.
45c8592d5d13 initial version
carl
parents:
diff changeset
5899 dlname=
45c8592d5d13 initial version
carl
parents:
diff changeset
5900 library_names=
45c8592d5d13 initial version
carl
parents:
diff changeset
5901
45c8592d5d13 initial version
carl
parents:
diff changeset
5902 # If there is no directory component, then add one.
45c8592d5d13 initial version
carl
parents:
diff changeset
5903 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5904 */* | *\\*) . $file ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5905 *) . ./$file ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5906 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5907
45c8592d5d13 initial version
carl
parents:
diff changeset
5908 # Skip this library if it cannot be dlopened.
45c8592d5d13 initial version
carl
parents:
diff changeset
5909 if test -z "$dlname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5910 # Warn if it was a shared library.
45c8592d5d13 initial version
carl
parents:
diff changeset
5911 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
45c8592d5d13 initial version
carl
parents:
diff changeset
5912 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
5913 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5914
45c8592d5d13 initial version
carl
parents:
diff changeset
5915 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5916 test "X$dir" = "X$file" && dir=.
45c8592d5d13 initial version
carl
parents:
diff changeset
5917
45c8592d5d13 initial version
carl
parents:
diff changeset
5918 if test -f "$dir/$objdir/$dlname"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5919 dir="$dir/$objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5920 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5921 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5922 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
5923 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5924 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5925
45c8592d5d13 initial version
carl
parents:
diff changeset
5926 *.lo)
45c8592d5d13 initial version
carl
parents:
diff changeset
5927 # Just add the directory containing the .lo file.
45c8592d5d13 initial version
carl
parents:
diff changeset
5928 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
5929 test "X$dir" = "X$file" && dir=.
45c8592d5d13 initial version
carl
parents:
diff changeset
5930 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5931
45c8592d5d13 initial version
carl
parents:
diff changeset
5932 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
5933 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
5934 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
5935 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5936 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5937
45c8592d5d13 initial version
carl
parents:
diff changeset
5938 # Get the absolute pathname.
45c8592d5d13 initial version
carl
parents:
diff changeset
5939 absdir=`cd "$dir" && pwd`
45c8592d5d13 initial version
carl
parents:
diff changeset
5940 test -n "$absdir" && dir="$absdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
5941
45c8592d5d13 initial version
carl
parents:
diff changeset
5942 # Now add the directory to shlibpath_var.
45c8592d5d13 initial version
carl
parents:
diff changeset
5943 if eval "test -z \"\$$shlibpath_var\""; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5944 eval "$shlibpath_var=\"\$dir\""
45c8592d5d13 initial version
carl
parents:
diff changeset
5945 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5946 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
45c8592d5d13 initial version
carl
parents:
diff changeset
5947 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5948 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5949
45c8592d5d13 initial version
carl
parents:
diff changeset
5950 # This variable tells wrapper scripts just to set shlibpath_var
45c8592d5d13 initial version
carl
parents:
diff changeset
5951 # rather than running their programs.
45c8592d5d13 initial version
carl
parents:
diff changeset
5952 libtool_execute_magic="$magic"
45c8592d5d13 initial version
carl
parents:
diff changeset
5953
45c8592d5d13 initial version
carl
parents:
diff changeset
5954 # Check if any of the arguments is a wrapper script.
45c8592d5d13 initial version
carl
parents:
diff changeset
5955 args=
45c8592d5d13 initial version
carl
parents:
diff changeset
5956 for file
45c8592d5d13 initial version
carl
parents:
diff changeset
5957 do
45c8592d5d13 initial version
carl
parents:
diff changeset
5958 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5959 -*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5960 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
5961 # Do a test to see if this is really a libtool program.
45c8592d5d13 initial version
carl
parents:
diff changeset
5962 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5963 # If there is no directory component, then add one.
45c8592d5d13 initial version
carl
parents:
diff changeset
5964 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
5965 */* | *\\*) . $file ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5966 *) . ./$file ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5967 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5968
45c8592d5d13 initial version
carl
parents:
diff changeset
5969 # Transform arg to wrapped name.
45c8592d5d13 initial version
carl
parents:
diff changeset
5970 file="$progdir/$program"
45c8592d5d13 initial version
carl
parents:
diff changeset
5971 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5972 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
5973 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
5974 # Quote arguments (to preserve shell metacharacters).
45c8592d5d13 initial version
carl
parents:
diff changeset
5975 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
45c8592d5d13 initial version
carl
parents:
diff changeset
5976 args="$args \"$file\""
45c8592d5d13 initial version
carl
parents:
diff changeset
5977 done
45c8592d5d13 initial version
carl
parents:
diff changeset
5978
45c8592d5d13 initial version
carl
parents:
diff changeset
5979 if test -z "$run"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5980 if test -n "$shlibpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5981 # Export the shlibpath_var.
45c8592d5d13 initial version
carl
parents:
diff changeset
5982 eval "export $shlibpath_var"
45c8592d5d13 initial version
carl
parents:
diff changeset
5983 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5984
45c8592d5d13 initial version
carl
parents:
diff changeset
5985 # Restore saved environment variables
45c8592d5d13 initial version
carl
parents:
diff changeset
5986 if test "${save_LC_ALL+set}" = set; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5987 LC_ALL="$save_LC_ALL"; export LC_ALL
45c8592d5d13 initial version
carl
parents:
diff changeset
5988 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5989 if test "${save_LANG+set}" = set; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5990 LANG="$save_LANG"; export LANG
45c8592d5d13 initial version
carl
parents:
diff changeset
5991 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
5992
45c8592d5d13 initial version
carl
parents:
diff changeset
5993 # Now prepare to actually exec the command.
45c8592d5d13 initial version
carl
parents:
diff changeset
5994 exec_cmd="\$cmd$args"
45c8592d5d13 initial version
carl
parents:
diff changeset
5995 else
45c8592d5d13 initial version
carl
parents:
diff changeset
5996 # Display what would be done.
45c8592d5d13 initial version
carl
parents:
diff changeset
5997 if test -n "$shlibpath_var"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
5998 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
45c8592d5d13 initial version
carl
parents:
diff changeset
5999 $echo "export $shlibpath_var"
45c8592d5d13 initial version
carl
parents:
diff changeset
6000 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6001 $echo "$cmd$args"
45c8592d5d13 initial version
carl
parents:
diff changeset
6002 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
6003 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6004 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6005
45c8592d5d13 initial version
carl
parents:
diff changeset
6006 # libtool clean and uninstall mode
45c8592d5d13 initial version
carl
parents:
diff changeset
6007 clean | uninstall)
45c8592d5d13 initial version
carl
parents:
diff changeset
6008 modename="$modename: $mode"
45c8592d5d13 initial version
carl
parents:
diff changeset
6009 rm="$nonopt"
45c8592d5d13 initial version
carl
parents:
diff changeset
6010 files=
45c8592d5d13 initial version
carl
parents:
diff changeset
6011 rmforce=
45c8592d5d13 initial version
carl
parents:
diff changeset
6012 exit_status=0
45c8592d5d13 initial version
carl
parents:
diff changeset
6013
45c8592d5d13 initial version
carl
parents:
diff changeset
6014 # This variable tells wrapper scripts just to set variables rather
45c8592d5d13 initial version
carl
parents:
diff changeset
6015 # than running their programs.
45c8592d5d13 initial version
carl
parents:
diff changeset
6016 libtool_install_magic="$magic"
45c8592d5d13 initial version
carl
parents:
diff changeset
6017
45c8592d5d13 initial version
carl
parents:
diff changeset
6018 for arg
45c8592d5d13 initial version
carl
parents:
diff changeset
6019 do
45c8592d5d13 initial version
carl
parents:
diff changeset
6020 case $arg in
45c8592d5d13 initial version
carl
parents:
diff changeset
6021 -f) rm="$rm $arg"; rmforce=yes ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6022 -*) rm="$rm $arg" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6023 *) files="$files $arg" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6024 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
6025 done
45c8592d5d13 initial version
carl
parents:
diff changeset
6026
45c8592d5d13 initial version
carl
parents:
diff changeset
6027 if test -z "$rm"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6028 $echo "$modename: you must specify an RM program" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
6029 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
6030 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
6031 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6032
45c8592d5d13 initial version
carl
parents:
diff changeset
6033 rmdirs=
45c8592d5d13 initial version
carl
parents:
diff changeset
6034
45c8592d5d13 initial version
carl
parents:
diff changeset
6035 origobjdir="$objdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
6036 for file in $files; do
45c8592d5d13 initial version
carl
parents:
diff changeset
6037 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
6038 if test "X$dir" = "X$file"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6039 dir=.
45c8592d5d13 initial version
carl
parents:
diff changeset
6040 objdir="$origobjdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
6041 else
45c8592d5d13 initial version
carl
parents:
diff changeset
6042 objdir="$dir/$origobjdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
6043 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6044 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
45c8592d5d13 initial version
carl
parents:
diff changeset
6045 test "$mode" = uninstall && objdir="$dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
6046
45c8592d5d13 initial version
carl
parents:
diff changeset
6047 # Remember objdir for removal later, being careful to avoid duplicates
45c8592d5d13 initial version
carl
parents:
diff changeset
6048 if test "$mode" = clean; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6049 case " $rmdirs " in
45c8592d5d13 initial version
carl
parents:
diff changeset
6050 *" $objdir "*) ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6051 *) rmdirs="$rmdirs $objdir" ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6052 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
6053 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6054
45c8592d5d13 initial version
carl
parents:
diff changeset
6055 # Don't error if the file doesn't exist and rm -f was used.
45c8592d5d13 initial version
carl
parents:
diff changeset
6056 if (test -L "$file") >/dev/null 2>&1 \
45c8592d5d13 initial version
carl
parents:
diff changeset
6057 || (test -h "$file") >/dev/null 2>&1 \
45c8592d5d13 initial version
carl
parents:
diff changeset
6058 || test -f "$file"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6059 :
45c8592d5d13 initial version
carl
parents:
diff changeset
6060 elif test -d "$file"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6061 exit_status=1
45c8592d5d13 initial version
carl
parents:
diff changeset
6062 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
6063 elif test "$rmforce" = yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6064 continue
45c8592d5d13 initial version
carl
parents:
diff changeset
6065 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6066
45c8592d5d13 initial version
carl
parents:
diff changeset
6067 rmfiles="$file"
45c8592d5d13 initial version
carl
parents:
diff changeset
6068
45c8592d5d13 initial version
carl
parents:
diff changeset
6069 case $name in
45c8592d5d13 initial version
carl
parents:
diff changeset
6070 *.la)
45c8592d5d13 initial version
carl
parents:
diff changeset
6071 # Possibly a libtool archive, so verify it.
45c8592d5d13 initial version
carl
parents:
diff changeset
6072 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6073 . $dir/$name
45c8592d5d13 initial version
carl
parents:
diff changeset
6074
45c8592d5d13 initial version
carl
parents:
diff changeset
6075 # Delete the libtool libraries and symlinks.
45c8592d5d13 initial version
carl
parents:
diff changeset
6076 for n in $library_names; do
45c8592d5d13 initial version
carl
parents:
diff changeset
6077 rmfiles="$rmfiles $objdir/$n"
45c8592d5d13 initial version
carl
parents:
diff changeset
6078 done
45c8592d5d13 initial version
carl
parents:
diff changeset
6079 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
45c8592d5d13 initial version
carl
parents:
diff changeset
6080 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
45c8592d5d13 initial version
carl
parents:
diff changeset
6081
45c8592d5d13 initial version
carl
parents:
diff changeset
6082 if test "$mode" = uninstall; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6083 if test -n "$library_names"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6084 # Do each command in the postuninstall commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
6085 cmds=$postuninstall_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
6086 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
6087 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
6088 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
6089 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
6090 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
6091 $run eval "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
6092 if test "$?" -ne 0 && test "$rmforce" != yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6093 exit_status=1
45c8592d5d13 initial version
carl
parents:
diff changeset
6094 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6095 done
45c8592d5d13 initial version
carl
parents:
diff changeset
6096 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
6097 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6098
45c8592d5d13 initial version
carl
parents:
diff changeset
6099 if test -n "$old_library"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6100 # Do each command in the old_postuninstall commands.
45c8592d5d13 initial version
carl
parents:
diff changeset
6101 cmds=$old_postuninstall_cmds
45c8592d5d13 initial version
carl
parents:
diff changeset
6102 save_ifs="$IFS"; IFS='~'
45c8592d5d13 initial version
carl
parents:
diff changeset
6103 for cmd in $cmds; do
45c8592d5d13 initial version
carl
parents:
diff changeset
6104 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
6105 eval cmd=\"$cmd\"
45c8592d5d13 initial version
carl
parents:
diff changeset
6106 $show "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
6107 $run eval "$cmd"
45c8592d5d13 initial version
carl
parents:
diff changeset
6108 if test "$?" -ne 0 && test "$rmforce" != yes; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6109 exit_status=1
45c8592d5d13 initial version
carl
parents:
diff changeset
6110 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6111 done
45c8592d5d13 initial version
carl
parents:
diff changeset
6112 IFS="$save_ifs"
45c8592d5d13 initial version
carl
parents:
diff changeset
6113 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6114 # FIXME: should reinstall the best remaining shared library.
45c8592d5d13 initial version
carl
parents:
diff changeset
6115 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6116 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6117 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6118
45c8592d5d13 initial version
carl
parents:
diff changeset
6119 *.lo)
45c8592d5d13 initial version
carl
parents:
diff changeset
6120 # Possibly a libtool object, so verify it.
45c8592d5d13 initial version
carl
parents:
diff changeset
6121 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6122
45c8592d5d13 initial version
carl
parents:
diff changeset
6123 # Read the .lo file
45c8592d5d13 initial version
carl
parents:
diff changeset
6124 . $dir/$name
45c8592d5d13 initial version
carl
parents:
diff changeset
6125
45c8592d5d13 initial version
carl
parents:
diff changeset
6126 # Add PIC object to the list of files to remove.
45c8592d5d13 initial version
carl
parents:
diff changeset
6127 if test -n "$pic_object" \
45c8592d5d13 initial version
carl
parents:
diff changeset
6128 && test "$pic_object" != none; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6129 rmfiles="$rmfiles $dir/$pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
6130 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6131
45c8592d5d13 initial version
carl
parents:
diff changeset
6132 # Add non-PIC object to the list of files to remove.
45c8592d5d13 initial version
carl
parents:
diff changeset
6133 if test -n "$non_pic_object" \
45c8592d5d13 initial version
carl
parents:
diff changeset
6134 && test "$non_pic_object" != none; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6135 rmfiles="$rmfiles $dir/$non_pic_object"
45c8592d5d13 initial version
carl
parents:
diff changeset
6136 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6137 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6138 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6139
45c8592d5d13 initial version
carl
parents:
diff changeset
6140 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
6141 if test "$mode" = clean ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6142 noexename=$name
45c8592d5d13 initial version
carl
parents:
diff changeset
6143 case $file in
45c8592d5d13 initial version
carl
parents:
diff changeset
6144 *.exe)
45c8592d5d13 initial version
carl
parents:
diff changeset
6145 file=`$echo $file|${SED} 's,.exe$,,'`
45c8592d5d13 initial version
carl
parents:
diff changeset
6146 noexename=`$echo $name|${SED} 's,.exe$,,'`
45c8592d5d13 initial version
carl
parents:
diff changeset
6147 # $file with .exe has already been added to rmfiles,
45c8592d5d13 initial version
carl
parents:
diff changeset
6148 # add $file without .exe
45c8592d5d13 initial version
carl
parents:
diff changeset
6149 rmfiles="$rmfiles $file"
45c8592d5d13 initial version
carl
parents:
diff changeset
6150 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6151 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
6152 # Do a test to see if this is a libtool program.
45c8592d5d13 initial version
carl
parents:
diff changeset
6153 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6154 relink_command=
45c8592d5d13 initial version
carl
parents:
diff changeset
6155 . $dir/$noexename
45c8592d5d13 initial version
carl
parents:
diff changeset
6156
45c8592d5d13 initial version
carl
parents:
diff changeset
6157 # note $name still contains .exe if it was in $file originally
45c8592d5d13 initial version
carl
parents:
diff changeset
6158 # as does the version of $file that was added into $rmfiles
45c8592d5d13 initial version
carl
parents:
diff changeset
6159 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
45c8592d5d13 initial version
carl
parents:
diff changeset
6160 if test "$fast_install" = yes && test -n "$relink_command"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6161 rmfiles="$rmfiles $objdir/lt-$name"
45c8592d5d13 initial version
carl
parents:
diff changeset
6162 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6163 if test "X$noexename" != "X$name" ; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6164 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
45c8592d5d13 initial version
carl
parents:
diff changeset
6165 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6166 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6167 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6168 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6169 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
6170 $show "$rm $rmfiles"
45c8592d5d13 initial version
carl
parents:
diff changeset
6171 $run $rm $rmfiles || exit_status=1
45c8592d5d13 initial version
carl
parents:
diff changeset
6172 done
45c8592d5d13 initial version
carl
parents:
diff changeset
6173 objdir="$origobjdir"
45c8592d5d13 initial version
carl
parents:
diff changeset
6174
45c8592d5d13 initial version
carl
parents:
diff changeset
6175 # Try to remove the ${objdir}s in the directories where we deleted files
45c8592d5d13 initial version
carl
parents:
diff changeset
6176 for dir in $rmdirs; do
45c8592d5d13 initial version
carl
parents:
diff changeset
6177 if test -d "$dir"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6178 $show "rmdir $dir"
45c8592d5d13 initial version
carl
parents:
diff changeset
6179 $run rmdir $dir >/dev/null 2>&1
45c8592d5d13 initial version
carl
parents:
diff changeset
6180 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6181 done
45c8592d5d13 initial version
carl
parents:
diff changeset
6182
45c8592d5d13 initial version
carl
parents:
diff changeset
6183 exit $exit_status
45c8592d5d13 initial version
carl
parents:
diff changeset
6184 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6185
45c8592d5d13 initial version
carl
parents:
diff changeset
6186 "")
45c8592d5d13 initial version
carl
parents:
diff changeset
6187 $echo "$modename: you must specify a MODE" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
6188 $echo "$generic_help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
6189 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
6190 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6191 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
6192
45c8592d5d13 initial version
carl
parents:
diff changeset
6193 if test -z "$exec_cmd"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6194 $echo "$modename: invalid operation mode \`$mode'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
6195 $echo "$generic_help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
6196 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
6197 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6198 fi # test -z "$show_help"
45c8592d5d13 initial version
carl
parents:
diff changeset
6199
45c8592d5d13 initial version
carl
parents:
diff changeset
6200 if test -n "$exec_cmd"; then
45c8592d5d13 initial version
carl
parents:
diff changeset
6201 eval exec $exec_cmd
45c8592d5d13 initial version
carl
parents:
diff changeset
6202 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
6203 fi
45c8592d5d13 initial version
carl
parents:
diff changeset
6204
45c8592d5d13 initial version
carl
parents:
diff changeset
6205 # We need to display help for each of the modes.
45c8592d5d13 initial version
carl
parents:
diff changeset
6206 case $mode in
45c8592d5d13 initial version
carl
parents:
diff changeset
6207 "") $echo \
45c8592d5d13 initial version
carl
parents:
diff changeset
6208 "Usage: $modename [OPTION]... [MODE-ARG]...
45c8592d5d13 initial version
carl
parents:
diff changeset
6209
45c8592d5d13 initial version
carl
parents:
diff changeset
6210 Provide generalized library-building support services.
45c8592d5d13 initial version
carl
parents:
diff changeset
6211
45c8592d5d13 initial version
carl
parents:
diff changeset
6212 --config show all configuration variables
45c8592d5d13 initial version
carl
parents:
diff changeset
6213 --debug enable verbose shell tracing
45c8592d5d13 initial version
carl
parents:
diff changeset
6214 -n, --dry-run display commands without modifying any files
45c8592d5d13 initial version
carl
parents:
diff changeset
6215 --features display basic configuration information and exit
45c8592d5d13 initial version
carl
parents:
diff changeset
6216 --finish same as \`--mode=finish'
45c8592d5d13 initial version
carl
parents:
diff changeset
6217 --help display this help message and exit
45c8592d5d13 initial version
carl
parents:
diff changeset
6218 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
45c8592d5d13 initial version
carl
parents:
diff changeset
6219 --quiet same as \`--silent'
45c8592d5d13 initial version
carl
parents:
diff changeset
6220 --silent don't print informational messages
45c8592d5d13 initial version
carl
parents:
diff changeset
6221 --tag=TAG use configuration variables from tag TAG
45c8592d5d13 initial version
carl
parents:
diff changeset
6222 --version print version information
45c8592d5d13 initial version
carl
parents:
diff changeset
6223
45c8592d5d13 initial version
carl
parents:
diff changeset
6224 MODE must be one of the following:
45c8592d5d13 initial version
carl
parents:
diff changeset
6225
45c8592d5d13 initial version
carl
parents:
diff changeset
6226 clean remove files from the build directory
45c8592d5d13 initial version
carl
parents:
diff changeset
6227 compile compile a source file into a libtool object
45c8592d5d13 initial version
carl
parents:
diff changeset
6228 execute automatically set library path, then run a program
45c8592d5d13 initial version
carl
parents:
diff changeset
6229 finish complete the installation of libtool libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
6230 install install libraries or executables
45c8592d5d13 initial version
carl
parents:
diff changeset
6231 link create a library or an executable
45c8592d5d13 initial version
carl
parents:
diff changeset
6232 uninstall remove libraries from an installed directory
45c8592d5d13 initial version
carl
parents:
diff changeset
6233
45c8592d5d13 initial version
carl
parents:
diff changeset
6234 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
45c8592d5d13 initial version
carl
parents:
diff changeset
6235 a more detailed description of MODE.
45c8592d5d13 initial version
carl
parents:
diff changeset
6236
45c8592d5d13 initial version
carl
parents:
diff changeset
6237 Report bugs to <bug-libtool@gnu.org>."
45c8592d5d13 initial version
carl
parents:
diff changeset
6238 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
6239 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6240
45c8592d5d13 initial version
carl
parents:
diff changeset
6241 clean)
45c8592d5d13 initial version
carl
parents:
diff changeset
6242 $echo \
45c8592d5d13 initial version
carl
parents:
diff changeset
6243 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
45c8592d5d13 initial version
carl
parents:
diff changeset
6244
45c8592d5d13 initial version
carl
parents:
diff changeset
6245 Remove files from the build directory.
45c8592d5d13 initial version
carl
parents:
diff changeset
6246
45c8592d5d13 initial version
carl
parents:
diff changeset
6247 RM is the name of the program to use to delete files associated with each FILE
45c8592d5d13 initial version
carl
parents:
diff changeset
6248 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
45c8592d5d13 initial version
carl
parents:
diff changeset
6249 to RM.
45c8592d5d13 initial version
carl
parents:
diff changeset
6250
45c8592d5d13 initial version
carl
parents:
diff changeset
6251 If FILE is a libtool library, object or program, all the files associated
45c8592d5d13 initial version
carl
parents:
diff changeset
6252 with it are deleted. Otherwise, only FILE itself is deleted using RM."
45c8592d5d13 initial version
carl
parents:
diff changeset
6253 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6254
45c8592d5d13 initial version
carl
parents:
diff changeset
6255 compile)
45c8592d5d13 initial version
carl
parents:
diff changeset
6256 $echo \
45c8592d5d13 initial version
carl
parents:
diff changeset
6257 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
45c8592d5d13 initial version
carl
parents:
diff changeset
6258
45c8592d5d13 initial version
carl
parents:
diff changeset
6259 Compile a source file into a libtool library object.
45c8592d5d13 initial version
carl
parents:
diff changeset
6260
45c8592d5d13 initial version
carl
parents:
diff changeset
6261 This mode accepts the following additional options:
45c8592d5d13 initial version
carl
parents:
diff changeset
6262
45c8592d5d13 initial version
carl
parents:
diff changeset
6263 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
45c8592d5d13 initial version
carl
parents:
diff changeset
6264 -prefer-pic try to building PIC objects only
45c8592d5d13 initial version
carl
parents:
diff changeset
6265 -prefer-non-pic try to building non-PIC objects only
45c8592d5d13 initial version
carl
parents:
diff changeset
6266 -static always build a \`.o' file suitable for static linking
45c8592d5d13 initial version
carl
parents:
diff changeset
6267
45c8592d5d13 initial version
carl
parents:
diff changeset
6268 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
45c8592d5d13 initial version
carl
parents:
diff changeset
6269 from the given SOURCEFILE.
45c8592d5d13 initial version
carl
parents:
diff changeset
6270
45c8592d5d13 initial version
carl
parents:
diff changeset
6271 The output file name is determined by removing the directory component from
45c8592d5d13 initial version
carl
parents:
diff changeset
6272 SOURCEFILE, then substituting the C source code suffix \`.c' with the
45c8592d5d13 initial version
carl
parents:
diff changeset
6273 library object suffix, \`.lo'."
45c8592d5d13 initial version
carl
parents:
diff changeset
6274 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6275
45c8592d5d13 initial version
carl
parents:
diff changeset
6276 execute)
45c8592d5d13 initial version
carl
parents:
diff changeset
6277 $echo \
45c8592d5d13 initial version
carl
parents:
diff changeset
6278 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
45c8592d5d13 initial version
carl
parents:
diff changeset
6279
45c8592d5d13 initial version
carl
parents:
diff changeset
6280 Automatically set library path, then run a program.
45c8592d5d13 initial version
carl
parents:
diff changeset
6281
45c8592d5d13 initial version
carl
parents:
diff changeset
6282 This mode accepts the following additional options:
45c8592d5d13 initial version
carl
parents:
diff changeset
6283
45c8592d5d13 initial version
carl
parents:
diff changeset
6284 -dlopen FILE add the directory containing FILE to the library path
45c8592d5d13 initial version
carl
parents:
diff changeset
6285
45c8592d5d13 initial version
carl
parents:
diff changeset
6286 This mode sets the library path environment variable according to \`-dlopen'
45c8592d5d13 initial version
carl
parents:
diff changeset
6287 flags.
45c8592d5d13 initial version
carl
parents:
diff changeset
6288
45c8592d5d13 initial version
carl
parents:
diff changeset
6289 If any of the ARGS are libtool executable wrappers, then they are translated
45c8592d5d13 initial version
carl
parents:
diff changeset
6290 into their corresponding uninstalled binary, and any of their required library
45c8592d5d13 initial version
carl
parents:
diff changeset
6291 directories are added to the library path.
45c8592d5d13 initial version
carl
parents:
diff changeset
6292
45c8592d5d13 initial version
carl
parents:
diff changeset
6293 Then, COMMAND is executed, with ARGS as arguments."
45c8592d5d13 initial version
carl
parents:
diff changeset
6294 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6295
45c8592d5d13 initial version
carl
parents:
diff changeset
6296 finish)
45c8592d5d13 initial version
carl
parents:
diff changeset
6297 $echo \
45c8592d5d13 initial version
carl
parents:
diff changeset
6298 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
45c8592d5d13 initial version
carl
parents:
diff changeset
6299
45c8592d5d13 initial version
carl
parents:
diff changeset
6300 Complete the installation of libtool libraries.
45c8592d5d13 initial version
carl
parents:
diff changeset
6301
45c8592d5d13 initial version
carl
parents:
diff changeset
6302 Each LIBDIR is a directory that contains libtool libraries.
45c8592d5d13 initial version
carl
parents:
diff changeset
6303
45c8592d5d13 initial version
carl
parents:
diff changeset
6304 The commands that this mode executes may require superuser privileges. Use
45c8592d5d13 initial version
carl
parents:
diff changeset
6305 the \`--dry-run' option if you just want to see what would be executed."
45c8592d5d13 initial version
carl
parents:
diff changeset
6306 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6307
45c8592d5d13 initial version
carl
parents:
diff changeset
6308 install)
45c8592d5d13 initial version
carl
parents:
diff changeset
6309 $echo \
45c8592d5d13 initial version
carl
parents:
diff changeset
6310 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
45c8592d5d13 initial version
carl
parents:
diff changeset
6311
45c8592d5d13 initial version
carl
parents:
diff changeset
6312 Install executables or libraries.
45c8592d5d13 initial version
carl
parents:
diff changeset
6313
45c8592d5d13 initial version
carl
parents:
diff changeset
6314 INSTALL-COMMAND is the installation command. The first component should be
45c8592d5d13 initial version
carl
parents:
diff changeset
6315 either the \`install' or \`cp' program.
45c8592d5d13 initial version
carl
parents:
diff changeset
6316
45c8592d5d13 initial version
carl
parents:
diff changeset
6317 The rest of the components are interpreted as arguments to that command (only
45c8592d5d13 initial version
carl
parents:
diff changeset
6318 BSD-compatible install options are recognized)."
45c8592d5d13 initial version
carl
parents:
diff changeset
6319 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6320
45c8592d5d13 initial version
carl
parents:
diff changeset
6321 link)
45c8592d5d13 initial version
carl
parents:
diff changeset
6322 $echo \
45c8592d5d13 initial version
carl
parents:
diff changeset
6323 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
45c8592d5d13 initial version
carl
parents:
diff changeset
6324
45c8592d5d13 initial version
carl
parents:
diff changeset
6325 Link object files or libraries together to form another library, or to
45c8592d5d13 initial version
carl
parents:
diff changeset
6326 create an executable program.
45c8592d5d13 initial version
carl
parents:
diff changeset
6327
45c8592d5d13 initial version
carl
parents:
diff changeset
6328 LINK-COMMAND is a command using the C compiler that you would use to create
45c8592d5d13 initial version
carl
parents:
diff changeset
6329 a program from several object files.
45c8592d5d13 initial version
carl
parents:
diff changeset
6330
45c8592d5d13 initial version
carl
parents:
diff changeset
6331 The following components of LINK-COMMAND are treated specially:
45c8592d5d13 initial version
carl
parents:
diff changeset
6332
45c8592d5d13 initial version
carl
parents:
diff changeset
6333 -all-static do not do any dynamic linking at all
45c8592d5d13 initial version
carl
parents:
diff changeset
6334 -avoid-version do not add a version suffix if possible
45c8592d5d13 initial version
carl
parents:
diff changeset
6335 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
45c8592d5d13 initial version
carl
parents:
diff changeset
6336 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
45c8592d5d13 initial version
carl
parents:
diff changeset
6337 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
45c8592d5d13 initial version
carl
parents:
diff changeset
6338 -export-symbols SYMFILE
45c8592d5d13 initial version
carl
parents:
diff changeset
6339 try to export only the symbols listed in SYMFILE
45c8592d5d13 initial version
carl
parents:
diff changeset
6340 -export-symbols-regex REGEX
45c8592d5d13 initial version
carl
parents:
diff changeset
6341 try to export only the symbols matching REGEX
45c8592d5d13 initial version
carl
parents:
diff changeset
6342 -LLIBDIR search LIBDIR for required installed libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
6343 -lNAME OUTPUT-FILE requires the installed library libNAME
45c8592d5d13 initial version
carl
parents:
diff changeset
6344 -module build a library that can dlopened
45c8592d5d13 initial version
carl
parents:
diff changeset
6345 -no-fast-install disable the fast-install mode
45c8592d5d13 initial version
carl
parents:
diff changeset
6346 -no-install link a not-installable executable
45c8592d5d13 initial version
carl
parents:
diff changeset
6347 -no-undefined declare that a library does not refer to external symbols
45c8592d5d13 initial version
carl
parents:
diff changeset
6348 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
45c8592d5d13 initial version
carl
parents:
diff changeset
6349 -objectlist FILE Use a list of object files found in FILE to specify objects
45c8592d5d13 initial version
carl
parents:
diff changeset
6350 -precious-files-regex REGEX
45c8592d5d13 initial version
carl
parents:
diff changeset
6351 don't remove output files matching REGEX
45c8592d5d13 initial version
carl
parents:
diff changeset
6352 -release RELEASE specify package release information
45c8592d5d13 initial version
carl
parents:
diff changeset
6353 -rpath LIBDIR the created library will eventually be installed in LIBDIR
45c8592d5d13 initial version
carl
parents:
diff changeset
6354 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
6355 -static do not do any dynamic linking of libtool libraries
45c8592d5d13 initial version
carl
parents:
diff changeset
6356 -version-info CURRENT[:REVISION[:AGE]]
45c8592d5d13 initial version
carl
parents:
diff changeset
6357 specify library version info [each variable defaults to 0]
45c8592d5d13 initial version
carl
parents:
diff changeset
6358
45c8592d5d13 initial version
carl
parents:
diff changeset
6359 All other options (arguments beginning with \`-') are ignored.
45c8592d5d13 initial version
carl
parents:
diff changeset
6360
45c8592d5d13 initial version
carl
parents:
diff changeset
6361 Every other argument is treated as a filename. Files ending in \`.la' are
45c8592d5d13 initial version
carl
parents:
diff changeset
6362 treated as uninstalled libtool libraries, other files are standard or library
45c8592d5d13 initial version
carl
parents:
diff changeset
6363 object files.
45c8592d5d13 initial version
carl
parents:
diff changeset
6364
45c8592d5d13 initial version
carl
parents:
diff changeset
6365 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
45c8592d5d13 initial version
carl
parents:
diff changeset
6366 only library objects (\`.lo' files) may be specified, and \`-rpath' is
45c8592d5d13 initial version
carl
parents:
diff changeset
6367 required, except when creating a convenience library.
45c8592d5d13 initial version
carl
parents:
diff changeset
6368
45c8592d5d13 initial version
carl
parents:
diff changeset
6369 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
45c8592d5d13 initial version
carl
parents:
diff changeset
6370 using \`ar' and \`ranlib', or on Windows using \`lib'.
45c8592d5d13 initial version
carl
parents:
diff changeset
6371
45c8592d5d13 initial version
carl
parents:
diff changeset
6372 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
45c8592d5d13 initial version
carl
parents:
diff changeset
6373 is created, otherwise an executable program is created."
45c8592d5d13 initial version
carl
parents:
diff changeset
6374 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6375
45c8592d5d13 initial version
carl
parents:
diff changeset
6376 uninstall)
45c8592d5d13 initial version
carl
parents:
diff changeset
6377 $echo \
45c8592d5d13 initial version
carl
parents:
diff changeset
6378 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
45c8592d5d13 initial version
carl
parents:
diff changeset
6379
45c8592d5d13 initial version
carl
parents:
diff changeset
6380 Remove libraries from an installation directory.
45c8592d5d13 initial version
carl
parents:
diff changeset
6381
45c8592d5d13 initial version
carl
parents:
diff changeset
6382 RM is the name of the program to use to delete files associated with each FILE
45c8592d5d13 initial version
carl
parents:
diff changeset
6383 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
45c8592d5d13 initial version
carl
parents:
diff changeset
6384 to RM.
45c8592d5d13 initial version
carl
parents:
diff changeset
6385
45c8592d5d13 initial version
carl
parents:
diff changeset
6386 If FILE is a libtool library, all the files associated with it are deleted.
45c8592d5d13 initial version
carl
parents:
diff changeset
6387 Otherwise, only FILE itself is deleted using RM."
45c8592d5d13 initial version
carl
parents:
diff changeset
6388 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6389
45c8592d5d13 initial version
carl
parents:
diff changeset
6390 *)
45c8592d5d13 initial version
carl
parents:
diff changeset
6391 $echo "$modename: invalid operation mode \`$mode'" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
6392 $echo "$help" 1>&2
45c8592d5d13 initial version
carl
parents:
diff changeset
6393 exit $EXIT_FAILURE
45c8592d5d13 initial version
carl
parents:
diff changeset
6394 ;;
45c8592d5d13 initial version
carl
parents:
diff changeset
6395 esac
45c8592d5d13 initial version
carl
parents:
diff changeset
6396
45c8592d5d13 initial version
carl
parents:
diff changeset
6397 $echo
45c8592d5d13 initial version
carl
parents:
diff changeset
6398 $echo "Try \`$modename --help' for more information about other modes."
45c8592d5d13 initial version
carl
parents:
diff changeset
6399
45c8592d5d13 initial version
carl
parents:
diff changeset
6400 exit $EXIT_SUCCESS
45c8592d5d13 initial version
carl
parents:
diff changeset
6401
45c8592d5d13 initial version
carl
parents:
diff changeset
6402 # The TAGs below are defined such that we never get into a situation
45c8592d5d13 initial version
carl
parents:
diff changeset
6403 # in which we disable both kinds of libraries. Given conflicting
45c8592d5d13 initial version
carl
parents:
diff changeset
6404 # choices, we go for a static library, that is the most portable,
45c8592d5d13 initial version
carl
parents:
diff changeset
6405 # since we can't tell whether shared libraries were disabled because
45c8592d5d13 initial version
carl
parents:
diff changeset
6406 # the user asked for that or because the platform doesn't support
45c8592d5d13 initial version
carl
parents:
diff changeset
6407 # them. This is particularly important on AIX, because we don't
45c8592d5d13 initial version
carl
parents:
diff changeset
6408 # support having both static and shared libraries enabled at the same
45c8592d5d13 initial version
carl
parents:
diff changeset
6409 # time on that platform, so we default to a shared-only configuration.
45c8592d5d13 initial version
carl
parents:
diff changeset
6410 # If a disable-shared tag is given, we'll fallback to a static-only
45c8592d5d13 initial version
carl
parents:
diff changeset
6411 # configuration. But we'll never go from static-only to shared-only.
45c8592d5d13 initial version
carl
parents:
diff changeset
6412
45c8592d5d13 initial version
carl
parents:
diff changeset
6413 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
45c8592d5d13 initial version
carl
parents:
diff changeset
6414 build_libtool_libs=no
45c8592d5d13 initial version
carl
parents:
diff changeset
6415 build_old_libs=yes
45c8592d5d13 initial version
carl
parents:
diff changeset
6416 # ### END LIBTOOL TAG CONFIG: disable-shared
45c8592d5d13 initial version
carl
parents:
diff changeset
6417
45c8592d5d13 initial version
carl
parents:
diff changeset
6418 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
45c8592d5d13 initial version
carl
parents:
diff changeset
6419 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
45c8592d5d13 initial version
carl
parents:
diff changeset
6420 # ### END LIBTOOL TAG CONFIG: disable-static
45c8592d5d13 initial version
carl
parents:
diff changeset
6421
45c8592d5d13 initial version
carl
parents:
diff changeset
6422 # Local Variables:
45c8592d5d13 initial version
carl
parents:
diff changeset
6423 # mode:shell-script
45c8592d5d13 initial version
carl
parents:
diff changeset
6424 # sh-indentation:2
45c8592d5d13 initial version
carl
parents:
diff changeset
6425 # End: