annotate ltmain.sh @ 11:ec508fe218b9 trunk

[svn] - Tone generator plugin.
author nenolod
date Mon, 24 Oct 2005 14:19:02 -0700
parents cb178e5ad177
children 82fa2e996291
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1 # ltmain.sh - Provide generalized library-building support services.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2 # NOTE: Changing this file will not affect anything until you rerun configure.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5 # Free Software Foundation, Inc.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
7 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
8 # This program is free software; you can redistribute it and/or modify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
9 # it under the terms of the GNU General Public License as published by
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 # the Free Software Foundation; either version 2 of the License, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 # (at your option) any later version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
12 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
13 # This program is distributed in the hope that it will be useful, but
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 # General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 # You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 # along with this program; if not, write to the Free Software
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
22 # As a special exception to the GNU General Public License, if you
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 # distribute this file as part of a program that contains a
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24 # configuration script generated by Autoconf, you may include it under
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 # the same distribution terms that you use for the rest of that program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 basename="s,^.*/,,g"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
29 # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30 # is ksh but when the shell is invoked as "sh" and the current value of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 # the _XPG environment variable is not equal to 1 (one), the special
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 # positional parameter $0, within a function call, is the name of the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33 # function.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34 progpath="$0"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
35
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
36 # The name of this program:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
37 progname=`echo "$progpath" | $SED $basename`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
38 modename="$progname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
39
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
40 # Global variables:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
41 EXIT_SUCCESS=0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
42 EXIT_FAILURE=1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
43
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
44 PROGRAM=ltmain.sh
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
45 PACKAGE=libtool
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
46 VERSION=1.5.10
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
47 TIMESTAMP=" (1.1220.2.130 2004/09/19 12:13:49)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
48
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
49 # See if we are running on zsh, and set the options which allow our
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50 # commands through without removal of \ escapes.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
51 if test -n "${ZSH_VERSION+set}" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
52 setopt NO_GLOB_SUBST
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
53 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
54
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
55 # Check that we have a working $echo.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
56 if test "X$1" = X--no-reexec; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
57 # Discard the --no-reexec flag, and continue.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
58 shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
59 elif test "X$1" = X--fallback-echo; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
60 # Avoid inline document here, it may be left over
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
61 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
62 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
63 # Yippee, $echo works!
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
64 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
65 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
66 # Restart under the correct shell, and then maybe $echo will work.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
67 exec $SHELL "$progpath" --no-reexec ${1+"$@"}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
68 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70 if test "X$1" = X--fallback-echo; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
71 # used as fallback echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
72 shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
73 cat <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
74 $*
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
75 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
76 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
77 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
78
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
79 default_mode=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
80 help="Try \`$progname --help' for more information."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
81 magic="%%%MAGIC variable%%%"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
82 mkdir="mkdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
83 mv="mv -f"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
84 rm="rm -f"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
85
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
86 # Sed substitution that helps us do robust quoting. It backslashifies
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
87 # metacharacters that are still active within double-quoted strings.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
88 Xsed="${SED}"' -e 1s/^X//'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
89 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
90 # test EBCDIC or ASCII
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 case `echo A|tr A '\301'` in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 A) # EBCDIC based system
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 SP2NL="tr '\100' '\n'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
94 NL2SP="tr '\r\n' '\100\100'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
95 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
96 *) # Assume ASCII based system
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
97 SP2NL="tr '\040' '\012'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
98 NL2SP="tr '\015\012' '\040\040'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
99 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
100 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
101
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
102 # NLS nuisances.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
103 # Only set LANG and LC_ALL to C if already set.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
104 # These must not be set unconditionally because not all systems understand
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
105 # e.g. LANG=C (notably SCO).
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
106 # We save the old values to restore during execute mode.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
107 if test "${LC_ALL+set}" = set; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
108 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
109 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
110 if test "${LANG+set}" = set; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
111 save_LANG="$LANG"; LANG=C; export LANG
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
112 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
113
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
114 # Make sure IFS has a sensible default
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
115 : ${IFS="
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
116 "}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
118 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
119 $echo "$modename: not configured to build any kind of library" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
120 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
121 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
122 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
123
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
124 # Global variables.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
125 mode=$default_mode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
126 nonopt=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
127 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
128 prevopt=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
129 run=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
130 show="$echo"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
131 show_help=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
132 execute_dlfiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
133 lo2o="s/\\.lo\$/.${objext}/"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
134 o2lo="s/\\.${objext}\$/.lo/"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
135
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
136 #####################################
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
137 # Shell function definitions:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
138 # This seems to be the best place for them
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
139
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
140 # func_win32_libid arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
141 # return the library type of file 'arg'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
142 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
143 # Need a lot of goo to handle *both* DLLs and import libs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
144 # Has to be a shell function in order to 'eat' the argument
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
145 # that is supplied when $file_magic_command is called.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
146 func_win32_libid () {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
147 win32_libid_type="unknown"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
148 win32_fileres=`file -L $1 2>/dev/null`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
149 case $win32_fileres in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
150 *ar\ archive\ import\ library*) # definitely import
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
151 win32_libid_type="x86 archive import"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
152 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
153 *ar\ archive*) # could be an import, or static
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
154 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
155 $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
156 win32_nmres=`eval $NM -f posix -A $1 | \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
157 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
158 if test "X$win32_nmres" = "Ximport" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
159 win32_libid_type="x86 archive import"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
160 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
161 win32_libid_type="x86 archive static"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
162 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
163 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
164 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
165 *DLL*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
166 win32_libid_type="x86 DLL"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
167 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
168 *executable*) # but shell scripts are "executable" too...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
169 case $win32_fileres in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
170 *MS\ Windows\ PE\ Intel*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
171 win32_libid_type="x86 DLL"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
172 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
173 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
174 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
175 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
176 $echo $win32_libid_type
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
177 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
178
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
179
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
180 # func_infer_tag arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
181 # Infer tagged configuration to use if any are available and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
182 # if one wasn't chosen via the "--tag" command line option.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
183 # Only attempt this if the compiler in the base compile
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
184 # command doesn't match the default compiler.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
185 # arg is usually of the form 'gcc ...'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
186 func_infer_tag () {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
187 if test -n "$available_tags" && test -z "$tagname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
188 CC_quoted=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
189 for arg in $CC; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
190 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
191 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
192 arg="\"$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
193 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
194 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
195 CC_quoted="$CC_quoted $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
196 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
197 case $@ in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
198 # Blanks in the command may have been stripped by the calling shell,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
199 # but not from the CC environment variable when configure was run.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
200 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
201 # Blanks at the start of $base_compile will cause this to fail
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
202 # if we don't check for them as well.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
203 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
204 for z in $available_tags; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
205 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
206 # Evaluate the configuration.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
207 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
208 CC_quoted=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
209 for arg in $CC; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
210 # Double-quote args containing other shell metacharacters.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
211 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
212 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
213 arg="\"$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
214 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
215 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
216 CC_quoted="$CC_quoted $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
217 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
218 case "$@ " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
219 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
220 # The compiler in the base compile command matches
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
221 # the one in the tagged configuration.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
222 # Assume this is the tagged configuration we want.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
223 tagname=$z
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
224 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
225 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
226 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
227 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
228 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
229 # If $tagname still isn't set, then no tagged configuration
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
230 # was found and let the user know that the "--tag" command
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
231 # line option must be used.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
232 if test -z "$tagname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
233 $echo "$modename: unable to infer tagged configuration"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
234 $echo "$modename: specify a tag with \`--tag'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
235 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
236 # else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
237 # $echo "$modename: using $tagname tagged configuration"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
238 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
239 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
240 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
241 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
242 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
243
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
244
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
245 # func_extract_archives gentop oldlib ...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
246 func_extract_archives () {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
247 my_gentop="$1"; shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
248 my_oldlibs=${1+"$@"}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
249 my_oldobjs=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
250 my_xlib=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
251 my_xabs=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
252 my_xdir=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
253 my_status=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
254
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
255 $show "${rm}r $my_gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
256 $run ${rm}r "$my_gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
257 $show "$mkdir $my_gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
258 $run $mkdir "$my_gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
259 my_status=$?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
260 if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
261 exit $my_status
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
262 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
263
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
264 for my_xlib in $my_oldlibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
265 # Extract the objects.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
266 case $my_xlib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
267 [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
268 *) my_xabs=`pwd`"/$my_xlib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
269 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
270 my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
271 my_xdir="$my_gentop/$my_xlib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
272
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
273 $show "${rm}r $my_xdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
274 $run ${rm}r "$my_xdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
275 $show "$mkdir $my_xdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
276 $run $mkdir "$my_xdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
277 status=$?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
278 if test "$status" -ne 0 && test ! -d "$my_xdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
279 exit $status
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
280 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
281 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
282 *-darwin*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
283 $show "Extracting $my_xabs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
284 # Do not bother doing anything if just a dry run
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
285 if test -z "$run"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
286 darwin_orig_dir=`pwd`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
287 cd $my_xdir || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
288 darwin_archive=$my_xabs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
289 darwin_curdir=`pwd`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
290 darwin_base_archive=`basename $darwin_archive`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
291 darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
292 if test -n "$darwin_arches"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
293 darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
294 darwin_arch=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
295 $show "$darwin_base_archive has multiple architectures $darwin_arches"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
296 for darwin_arch in $darwin_arches ; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
297 mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
298 lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
299 # Remove the table of contents from the thin files.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
300 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF 2>/dev/null || true
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
301 $AR -d "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" __.SYMDEF\ SORTED 2>/dev/null || true
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
302 cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
303 $AR -xo "${darwin_base_archive}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
304 rm "${darwin_base_archive}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
305 cd "$darwin_curdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
306 done # $darwin_arches
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
307 ## Okay now we have a bunch of thin objects, gotta fatten them up :)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
308 darwin_filelist=`find unfat-$$ -type f | xargs basename | sort -u | $NL2SP`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
309 darwin_file=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
310 darwin_files=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
311 for darwin_file in $darwin_filelist; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
312 darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
313 lipo -create -output "$darwin_file" $darwin_files
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
314 done # $darwin_filelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
315 rm -rf unfat-$$
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
316 cd "$darwin_orig_dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
317 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
318 cd $darwin_orig_dir
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
319 (cd $my_xdir && $AR x $my_xabs) || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
320 fi # $darwin_arches
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
321 fi # $run
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
322 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
323 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
324 # We will extract separately just the conflicting names and we will
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
325 # no longer touch any unique names. It is faster to leave these
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
326 # extract automatically by $AR in one run.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
327 $show "(cd $my_xdir && $AR x $my_xabs)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
328 $run eval "(cd \$my_xdir && $AR x \$my_xabs)" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
329 if ($AR t "$my_xabs" | sort | sort -uc >/dev/null 2>&1); then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
330 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
331 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
332 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
333 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
334 $AR t "$my_xabs" | sort | uniq -cd | while read -r count name
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
335 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
336 i=1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
337 while test "$i" -le "$count"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
338 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
339 # Put our $i before any first dot (extension)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
340 # Never overwrite any file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
341 name_to="$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
342 while test "X$name_to" = "X$name" || test -f "$my_xdir/$name_to"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
343 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
344 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
345 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
346 $show "(cd $my_xdir && $AR xN $i $my_xabs '$name' && $mv '$name' '$name_to')"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
347 $run eval "(cd \$my_xdir && $AR xN $i \$my_xabs '$name' && $mv '$name' '$name_to')" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
348 i=`expr $i + 1`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
349 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
350 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
351 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
352 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
353 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
354 my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
355 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
356
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
357 func_extract_archives_result="$my_oldobjs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
358 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
359 # End of Shell function definitions
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
360 #####################################
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
361
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
362 # Darwin sucks
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
363 eval std_shrext=\"$shrext_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
364
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
365 # Parse our command line options once, thoroughly.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
366 while test "$#" -gt 0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
367 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
368 arg="$1"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
369 shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
370
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
371 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
372 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
373 *) optarg= ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
374 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
375
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
376 # If the previous option needs an argument, assign it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
377 if test -n "$prev"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
378 case $prev in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
379 execute_dlfiles)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
380 execute_dlfiles="$execute_dlfiles $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
381 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
382 tag)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
383 tagname="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
384 preserve_args="${preserve_args}=$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
385
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
386 # Check whether tagname contains only valid characters
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
387 case $tagname in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
388 *[!-_A-Za-z0-9,/]*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
389 $echo "$progname: invalid tag name: $tagname" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
390 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
391 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
392 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
393
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
394 case $tagname in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
395 CC)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
396 # Don't test for the "default" C tag, as we know, it's there, but
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
397 # not specially marked.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
398 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
399 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
400 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
401 taglist="$taglist $tagname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
402 # Evaluate the configuration.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
403 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
404 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
405 $echo "$progname: ignoring unknown tag $tagname" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
406 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
407 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
408 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
409 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
410 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
411 eval "$prev=\$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
412 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
413 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
414
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
415 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
416 prevopt=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
417 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
418 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
419
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
420 # Have we seen a non-optional argument yet?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
421 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
422 --help)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
423 show_help=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
424 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
425
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
426 --version)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
427 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
428 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
429 $echo "Copyright (C) 2003 Free Software Foundation, Inc."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
430 $echo "This is free software; see the source for copying conditions. There is NO"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
431 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
432 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
433 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
434
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
435 --config)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
436 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
437 # Now print the configurations for the tags.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
438 for tagname in $taglist; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
439 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
440 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
441 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
442 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
443
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
444 --debug)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
445 $echo "$progname: enabling shell trace mode"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
446 set -x
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
447 preserve_args="$preserve_args $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
448 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
449
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
450 --dry-run | -n)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
451 run=:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
452 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
453
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
454 --features)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
455 $echo "host: $host"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
456 if test "$build_libtool_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
457 $echo "enable shared libraries"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
458 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
459 $echo "disable shared libraries"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
460 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
461 if test "$build_old_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
462 $echo "enable static libraries"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
463 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
464 $echo "disable static libraries"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
465 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
466 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
467 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
468
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
469 --finish) mode="finish" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
470
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
471 --mode) prevopt="--mode" prev=mode ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
472 --mode=*) mode="$optarg" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
473
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
474 --preserve-dup-deps) duplicate_deps="yes" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
475
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
476 --quiet | --silent)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
477 show=:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
478 preserve_args="$preserve_args $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
479 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
480
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
481 --tag) prevopt="--tag" prev=tag ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
482 --tag=*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
483 set tag "$optarg" ${1+"$@"}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
484 shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
485 prev=tag
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
486 preserve_args="$preserve_args --tag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
487 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
488
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
489 -dlopen)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
490 prevopt="-dlopen"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
491 prev=execute_dlfiles
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
492 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
493
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
494 -*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
495 $echo "$modename: unrecognized option \`$arg'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
496 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
497 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
498 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
499
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
500 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
501 nonopt="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
502 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
503 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
504 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
505 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
506
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
507 if test -n "$prevopt"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
508 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
509 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
510 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
511 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
512
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
513 # If this variable is set in any of the actions, the command in it
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
514 # will be execed at the end. This prevents here-documents from being
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
515 # left over by shells.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
516 exec_cmd=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
517
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
518 if test -z "$show_help"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
519
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
520 # Infer the operation mode.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
521 if test -z "$mode"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
522 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
523 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
524 case $nonopt in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
525 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
526 mode=link
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
527 for arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
528 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
529 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
530 -c)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
531 mode=compile
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
532 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
533 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
534 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
535 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
536 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
537 *db | *dbx | *strace | *truss)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
538 mode=execute
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
539 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
540 *install*|cp|mv)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
541 mode=install
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
542 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
543 *rm)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
544 mode=uninstall
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
545 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
546 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
547 # If we have no mode, but dlfiles were specified, then do execute mode.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
548 test -n "$execute_dlfiles" && mode=execute
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
549
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
550 # Just use the default operation mode.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
551 if test -z "$mode"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
552 if test -n "$nonopt"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
553 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
554 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
555 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
556 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
557 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
558 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
559 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
560 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
561
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
562 # Only execute mode is allowed to have -dlopen flags.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
563 if test -n "$execute_dlfiles" && test "$mode" != execute; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
564 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
565 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
566 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
567 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
568
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
569 # Change the help message to a mode-specific one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
570 generic_help="$help"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
571 help="Try \`$modename --help --mode=$mode' for more information."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
572
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
573 # These modes are in order of execution frequency so that they run quickly.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
574 case $mode in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
575 # libtool compile mode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
576 compile)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
577 modename="$modename: compile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
578 # Get the compilation command and the source file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
579 base_compile=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
580 srcfile="$nonopt" # always keep a non-empty value in "srcfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
581 suppress_opt=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
582 suppress_output=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
583 arg_mode=normal
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
584 libobj=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
585 later=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
586
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
587 for arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
588 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
589 case "$arg_mode" in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
590 arg )
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
591 # do not "continue". Instead, add this to base_compile
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
592 lastarg="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
593 arg_mode=normal
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
594 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
595
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
596 target )
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
597 libobj="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
598 arg_mode=normal
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
599 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
600 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
601
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
602 normal )
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
603 # Accept any command-line options.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
604 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
605 -o)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
606 if test -n "$libobj" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
607 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
608 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
609 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
610 arg_mode=target
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
611 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
612 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
613
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
614 -static | -prefer-pic | -prefer-non-pic)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
615 later="$later $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
616 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
617 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
618
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
619 -no-suppress)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
620 suppress_opt=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
621 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
622 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
623
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
624 -Xcompiler)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
625 arg_mode=arg # the next one goes into the "base_compile" arg list
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
626 continue # The current "srcfile" will either be retained or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
627 ;; # replaced later. I would guess that would be a bug.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
628
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
629 -Wc,*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
630 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
631 lastarg=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
632 save_ifs="$IFS"; IFS=','
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
633 for arg in $args; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
634 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
635
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
636 # Double-quote args containing other shell metacharacters.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
637 # Many Bourne shells cannot handle close brackets correctly
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
638 # in scan sets, so we specify it separately.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
639 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
640 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
641 arg="\"$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
642 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
643 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
644 lastarg="$lastarg $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
645 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
646 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
647 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
648
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
649 # Add the arguments to base_compile.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
650 base_compile="$base_compile $lastarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
651 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
652 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
653
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
654 * )
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
655 # Accept the current argument as the source file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
656 # The previous "srcfile" becomes the current argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
657 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
658 lastarg="$srcfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
659 srcfile="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
660 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
661 esac # case $arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
662 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
663 esac # case $arg_mode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
664
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
665 # Aesthetically quote the previous argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
666 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
667
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
668 case $lastarg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
669 # Double-quote args containing other shell metacharacters.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
670 # Many Bourne shells cannot handle close brackets correctly
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
671 # in scan sets, so we specify it separately.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
672 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
673 lastarg="\"$lastarg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
674 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
675 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
676
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
677 base_compile="$base_compile $lastarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
678 done # for arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
679
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
680 case $arg_mode in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
681 arg)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
682 $echo "$modename: you must specify an argument for -Xcompile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
683 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
684 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
685 target)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
686 $echo "$modename: you must specify a target with \`-o'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
687 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
688 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
689 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
690 # Get the name of the library object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
691 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
692 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
693 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
694
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
695 # Recognize several different file suffixes.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
696 # If the user specifies -o file.o, it is replaced with file.lo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
697 xform='[cCFSifmso]'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
698 case $libobj in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
699 *.ada) xform=ada ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
700 *.adb) xform=adb ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
701 *.ads) xform=ads ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
702 *.asm) xform=asm ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
703 *.c++) xform=c++ ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
704 *.cc) xform=cc ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
705 *.ii) xform=ii ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
706 *.class) xform=class ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
707 *.cpp) xform=cpp ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
708 *.cxx) xform=cxx ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
709 *.f90) xform=f90 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
710 *.for) xform=for ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
711 *.java) xform=java ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
712 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
713
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
714 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
715
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
716 case $libobj in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
717 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
718 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
719 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
720 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
721 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
722 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
723
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
724 func_infer_tag $base_compile
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
725
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
726 for arg in $later; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
727 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
728 -static)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
729 build_old_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
730 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
731 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
732
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
733 -prefer-pic)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
734 pic_mode=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
735 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
736 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
737
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
738 -prefer-non-pic)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
739 pic_mode=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
740 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
741 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
742 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
743 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
744
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
745 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
746 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
747 if test "X$xdir" = "X$obj"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
748 xdir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
749 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
750 xdir=$xdir/
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
751 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
752 lobj=${xdir}$objdir/$objname
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
753
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
754 if test -z "$base_compile"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
755 $echo "$modename: you must specify a compilation command" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
756 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
757 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
758 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
759
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
760 # Delete any leftover library objects.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
761 if test "$build_old_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
762 removelist="$obj $lobj $libobj ${libobj}T"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
763 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
764 removelist="$lobj $libobj ${libobj}T"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
765 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
766
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
767 $run $rm $removelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
768 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
769
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
770 # On Cygwin there's no "real" PIC flag so we must build both object types
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
771 case $host_os in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
772 cygwin* | mingw* | pw32* | os2*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
773 pic_mode=default
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
774 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
775 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
776 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
777 # non-PIC code in shared libraries is not supported
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
778 pic_mode=default
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
779 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
780
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
781 # Calculate the filename of the output object if compiler does
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
782 # not support -o with -c
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
783 if test "$compiler_c_o" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
784 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
785 lockfile="$output_obj.lock"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
786 removelist="$removelist $output_obj $lockfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
787 trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
788 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
789 output_obj=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
790 need_locks=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
791 lockfile=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
792 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
793
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
794 # Lock this critical section if it is needed
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
795 # We use this script file to make the link, it avoids creating a new file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
796 if test "$need_locks" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
797 until $run ln "$progpath" "$lockfile" 2>/dev/null; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
798 $show "Waiting for $lockfile to be removed"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
799 sleep 2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
800 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
801 elif test "$need_locks" = warn; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
802 if test -f "$lockfile"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
803 $echo "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
804 *** ERROR, $lockfile exists and contains:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
805 `cat $lockfile 2>/dev/null`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
806
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
807 This indicates that another process is trying to use the same
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
808 temporary object file, and libtool could not work around it because
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
809 your compiler does not support \`-c' and \`-o' together. If you
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
810 repeat this compilation, it may succeed, by chance, but you had better
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
811 avoid parallel builds (make -j) in this platform, or get a better
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
812 compiler."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
813
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
814 $run $rm $removelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
815 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
816 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
817 $echo $srcfile > "$lockfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
818 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
819
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
820 if test -n "$fix_srcfile_path"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
821 eval srcfile=\"$fix_srcfile_path\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
822 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
823
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
824 $run $rm "$libobj" "${libobj}T"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
825
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
826 # Create a libtool object file (analogous to a ".la" file),
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
827 # but don't create it if we're doing a dry run.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
828 test -z "$run" && cat > ${libobj}T <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
829 # $libobj - a libtool object file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
830 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
831 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
832 # Please DO NOT delete this file!
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
833 # It is necessary for linking the library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
834
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
835 # Name of the PIC object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
836 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
837
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
838 # Only build a PIC object if we are building libtool libraries.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
839 if test "$build_libtool_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
840 # Without this assignment, base_compile gets emptied.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
841 fbsd_hideous_sh_bug=$base_compile
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
842
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
843 if test "$pic_mode" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
844 command="$base_compile $srcfile $pic_flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
845 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
846 # Don't build PIC code
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
847 command="$base_compile $srcfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
848 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
849
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
850 if test ! -d "${xdir}$objdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
851 $show "$mkdir ${xdir}$objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
852 $run $mkdir ${xdir}$objdir
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
853 status=$?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
854 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
855 exit $status
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
856 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
857 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
858
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
859 if test -z "$output_obj"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
860 # Place PIC objects in $objdir
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
861 command="$command -o $lobj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
862 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
863
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
864 $run $rm "$lobj" "$output_obj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
865
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
866 $show "$command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
867 if $run eval "$command"; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
868 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
869 test -n "$output_obj" && $run $rm $removelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
870 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
871 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
872
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
873 if test "$need_locks" = warn &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
874 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
875 $echo "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
876 *** ERROR, $lockfile contains:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
877 `cat $lockfile 2>/dev/null`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
878
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
879 but it should contain:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
880 $srcfile
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
881
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
882 This indicates that another process is trying to use the same
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
883 temporary object file, and libtool could not work around it because
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
884 your compiler does not support \`-c' and \`-o' together. If you
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
885 repeat this compilation, it may succeed, by chance, but you had better
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
886 avoid parallel builds (make -j) in this platform, or get a better
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
887 compiler."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
888
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
889 $run $rm $removelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
890 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
891 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
892
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
893 # Just move the object if needed, then go on to compile the next one
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
894 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
895 $show "$mv $output_obj $lobj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
896 if $run $mv $output_obj $lobj; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
897 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
898 error=$?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
899 $run $rm $removelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
900 exit $error
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
901 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
902 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
903
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
904 # Append the name of the PIC object to the libtool object file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
905 test -z "$run" && cat >> ${libobj}T <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
906 pic_object='$objdir/$objname'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
907
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
908 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
909
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
910 # Allow error messages only from the first compilation.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
911 if test "$suppress_opt" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
912 suppress_output=' >/dev/null 2>&1'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
913 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
914 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
915 # No PIC object so indicate it doesn't exist in the libtool
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
916 # object file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
917 test -z "$run" && cat >> ${libobj}T <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
918 pic_object=none
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
919
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
920 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
921 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
922
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
923 # Only build a position-dependent object if we build old libraries.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
924 if test "$build_old_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
925 if test "$pic_mode" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
926 # Don't build PIC code
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
927 command="$base_compile $srcfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
928 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
929 command="$base_compile $srcfile $pic_flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
930 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
931 if test "$compiler_c_o" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
932 command="$command -o $obj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
933 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
934
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
935 # Suppress compiler output if we already did a PIC compilation.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
936 command="$command$suppress_output"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
937 $run $rm "$obj" "$output_obj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
938 $show "$command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
939 if $run eval "$command"; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
940 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
941 $run $rm $removelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
942 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
943 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
944
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
945 if test "$need_locks" = warn &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
946 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
947 $echo "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
948 *** ERROR, $lockfile contains:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
949 `cat $lockfile 2>/dev/null`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
950
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
951 but it should contain:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
952 $srcfile
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
953
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
954 This indicates that another process is trying to use the same
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
955 temporary object file, and libtool could not work around it because
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
956 your compiler does not support \`-c' and \`-o' together. If you
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
957 repeat this compilation, it may succeed, by chance, but you had better
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
958 avoid parallel builds (make -j) in this platform, or get a better
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
959 compiler."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
960
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
961 $run $rm $removelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
962 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
963 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
964
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
965 # Just move the object if needed
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
966 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
967 $show "$mv $output_obj $obj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
968 if $run $mv $output_obj $obj; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
969 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
970 error=$?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
971 $run $rm $removelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
972 exit $error
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
973 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
974 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
975
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
976 # Append the name of the non-PIC object the libtool object file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
977 # Only append if the libtool object file exists.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
978 test -z "$run" && cat >> ${libobj}T <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
979 # Name of the non-PIC object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
980 non_pic_object='$objname'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
981
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
982 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
983 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
984 # Append the name of the non-PIC object the libtool object file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
985 # Only append if the libtool object file exists.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
986 test -z "$run" && cat >> ${libobj}T <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
987 # Name of the non-PIC object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
988 non_pic_object=none
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
989
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
990 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
991 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
992
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
993 $run $mv "${libobj}T" "${libobj}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
994
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
995 # Unlock the critical section if it was locked
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
996 if test "$need_locks" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
997 $run $rm "$lockfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
998 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
999
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1000 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1001 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1002
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1003 # libtool link mode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1004 link | relink)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1005 modename="$modename: link"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1006 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1007 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1008 # It is impossible to link a dll without this setting, and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1009 # we shouldn't force the makefile maintainer to figure out
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1010 # which system we are compiling for in order to pass an extra
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1011 # flag for every libtool invocation.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1012 # allow_undefined=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1013
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1014 # FIXME: Unfortunately, there are problems with the above when trying
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1015 # to make a dll which has undefined symbols, in which case not
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1016 # even a static library is built. For now, we need to specify
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1017 # -no-undefined on the libtool link line when we can be certain
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1018 # that all symbols are satisfied, otherwise we get a static library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1019 allow_undefined=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1020 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1021 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1022 allow_undefined=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1023 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1024 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1025 libtool_args="$nonopt"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1026 base_compile="$nonopt $@"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1027 compile_command="$nonopt"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1028 finalize_command="$nonopt"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1029
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1030 compile_rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1031 finalize_rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1032 compile_shlibpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1033 finalize_shlibpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1034 convenience=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1035 old_convenience=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1036 deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1037 old_deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1038 compiler_flags=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1039 linker_flags=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1040 dllsearchpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1041 lib_search_path=`pwd`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1042 inst_prefix_dir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1043
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1044 avoid_version=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1045 dlfiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1046 dlprefiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1047 dlself=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1048 export_dynamic=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1049 export_symbols=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1050 export_symbols_regex=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1051 generated=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1052 libobjs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1053 ltlibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1054 module=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1055 no_install=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1056 objs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1057 non_pic_objects=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1058 precious_files_regex=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1059 prefer_static_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1060 preload=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1061 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1062 prevarg=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1063 release=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1064 rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1065 xrpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1066 perm_rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1067 temp_rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1068 thread_safe=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1069 vinfo=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1070 vinfo_number=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1071
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1072 func_infer_tag $base_compile
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1073
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1074 # We need to know -static, to get the right output filenames.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1075 for arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1076 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1077 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1078 -all-static | -static)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1079 if test "X$arg" = "X-all-static"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1080 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1081 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1082 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1083 if test -n "$link_static_flag"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1084 dlopen_self=$dlopen_self_static
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1085 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1086 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1087 if test -z "$pic_flag" && test -n "$link_static_flag"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1088 dlopen_self=$dlopen_self_static
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1089 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1090 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1091 build_libtool_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1092 build_old_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1093 prefer_static_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1094 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1095 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1096 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1097 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1098
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1099 # See if our shared archives depend on static archives.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1100 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1101
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1102 # Go through the arguments, transforming them on the way.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1103 while test "$#" -gt 0; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1104 arg="$1"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1105 shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1106 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1107 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1108 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1109 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1110 *) qarg=$arg ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1111 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1112 libtool_args="$libtool_args $qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1113
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1114 # If the previous option needs an argument, assign it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1115 if test -n "$prev"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1116 case $prev in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1117 output)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1118 compile_command="$compile_command @OUTPUT@"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1119 finalize_command="$finalize_command @OUTPUT@"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1120 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1121 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1122
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1123 case $prev in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1124 dlfiles|dlprefiles)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1125 if test "$preload" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1126 # Add the symbol object into the linking commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1127 compile_command="$compile_command @SYMFILE@"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1128 finalize_command="$finalize_command @SYMFILE@"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1129 preload=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1130 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1131 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1132 *.la | *.lo) ;; # We handle these cases below.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1133 force)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1134 if test "$dlself" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1135 dlself=needless
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1136 export_dynamic=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1137 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1138 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1139 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1140 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1141 self)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1142 if test "$prev" = dlprefiles; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1143 dlself=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1144 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1145 dlself=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1146 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1147 dlself=needless
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1148 export_dynamic=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1149 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1150 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1151 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1152 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1153 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1154 if test "$prev" = dlfiles; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1155 dlfiles="$dlfiles $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1156 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1157 dlprefiles="$dlprefiles $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1158 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1159 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1160 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1161 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1162 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1163 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1164 expsyms)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1165 export_symbols="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1166 if test ! -f "$arg"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1167 $echo "$modename: symbol file \`$arg' does not exist"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1168 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1169 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1170 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1171 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1172 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1173 expsyms_regex)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1174 export_symbols_regex="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1175 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1176 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1177 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1178 inst_prefix)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1179 inst_prefix_dir="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1180 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1181 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1182 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1183 precious_regex)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1184 precious_files_regex="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1185 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1186 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1187 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1188 release)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1189 release="-$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1190 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1191 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1192 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1193 objectlist)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1194 if test -f "$arg"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1195 save_arg=$arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1196 moreargs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1197 for fil in `cat $save_arg`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1198 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1199 # moreargs="$moreargs $fil"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1200 arg=$fil
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1201 # A libtool-controlled object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1202
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1203 # Check to see that this really is a libtool object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1204 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1205 pic_object=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1206 non_pic_object=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1207
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1208 # Read the .lo file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1209 # If there is no directory component, then add one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1210 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1211 */* | *\\*) . $arg ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1212 *) . ./$arg ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1213 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1214
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1215 if test -z "$pic_object" || \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1216 test -z "$non_pic_object" ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1217 test "$pic_object" = none && \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1218 test "$non_pic_object" = none; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1219 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1220 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1221 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1222
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1223 # Extract subdirectory from the argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1224 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1225 if test "X$xdir" = "X$arg"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1226 xdir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1227 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1228 xdir="$xdir/"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1229 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1230
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1231 if test "$pic_object" != none; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1232 # Prepend the subdirectory the object is found in.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1233 pic_object="$xdir$pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1234
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1235 if test "$prev" = dlfiles; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1236 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1237 dlfiles="$dlfiles $pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1238 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1239 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1240 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1241 # If libtool objects are unsupported, then we need to preload.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1242 prev=dlprefiles
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1243 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1244 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1245
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1246 # CHECK ME: I think I busted this. -Ossama
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1247 if test "$prev" = dlprefiles; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1248 # Preload the old-style object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1249 dlprefiles="$dlprefiles $pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1250 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1251 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1252
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1253 # A PIC object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1254 libobjs="$libobjs $pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1255 arg="$pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1256 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1257
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1258 # Non-PIC object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1259 if test "$non_pic_object" != none; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1260 # Prepend the subdirectory the object is found in.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1261 non_pic_object="$xdir$non_pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1262
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1263 # A standard non-PIC object
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1264 non_pic_objects="$non_pic_objects $non_pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1265 if test -z "$pic_object" || test "$pic_object" = none ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1266 arg="$non_pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1267 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1268 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1269 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1270 # Only an error if not doing a dry-run.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1271 if test -z "$run"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1272 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1273 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1274 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1275 # Dry-run case.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1276
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1277 # Extract subdirectory from the argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1278 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1279 if test "X$xdir" = "X$arg"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1280 xdir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1281 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1282 xdir="$xdir/"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1283 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1284
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1285 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1286 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1287 libobjs="$libobjs $pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1288 non_pic_objects="$non_pic_objects $non_pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1289 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1290 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1291 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1292 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1293 $echo "$modename: link input file \`$save_arg' does not exist"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1294 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1295 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1296 arg=$save_arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1297 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1298 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1299 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1300 rpath | xrpath)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1301 # We need an absolute path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1302 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1303 [\\/]* | [A-Za-z]:[\\/]*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1304 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1305 $echo "$modename: only absolute run-paths are allowed" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1306 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1307 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1308 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1309 if test "$prev" = rpath; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1310 case "$rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1311 *" $arg "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1312 *) rpath="$rpath $arg" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1313 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1314 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1315 case "$xrpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1316 *" $arg "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1317 *) xrpath="$xrpath $arg" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1318 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1319 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1320 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1321 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1322 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1323 xcompiler)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1324 compiler_flags="$compiler_flags $qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1325 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1326 compile_command="$compile_command $qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1327 finalize_command="$finalize_command $qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1328 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1329 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1330 xlinker)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1331 linker_flags="$linker_flags $qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1332 compiler_flags="$compiler_flags $wl$qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1333 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1334 compile_command="$compile_command $wl$qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1335 finalize_command="$finalize_command $wl$qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1336 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1337 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1338 xcclinker)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1339 linker_flags="$linker_flags $qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1340 compiler_flags="$compiler_flags $qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1341 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1342 compile_command="$compile_command $qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1343 finalize_command="$finalize_command $qarg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1344 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1345 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1346 shrext)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1347 shrext_cmds="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1348 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1349 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1350 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1351 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1352 eval "$prev=\"\$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1353 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1354 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1355 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1356 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1357 fi # test -n "$prev"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1358
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1359 prevarg="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1360
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1361 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1362 -all-static)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1363 if test -n "$link_static_flag"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1364 compile_command="$compile_command $link_static_flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1365 finalize_command="$finalize_command $link_static_flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1366 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1367 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1368 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1369
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1370 -allow-undefined)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1371 # FIXME: remove this flag sometime in the future.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1372 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1373 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1374 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1375
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1376 -avoid-version)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1377 avoid_version=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1378 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1379 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1380
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1381 -dlopen)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1382 prev=dlfiles
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1383 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1384 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1385
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1386 -dlpreopen)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1387 prev=dlprefiles
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1388 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1389 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1390
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1391 -export-dynamic)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1392 export_dynamic=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1393 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1394 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1395
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1396 -export-symbols | -export-symbols-regex)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1397 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1398 $echo "$modename: more than one -exported-symbols argument is not allowed"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1399 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1400 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1401 if test "X$arg" = "X-export-symbols"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1402 prev=expsyms
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1403 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1404 prev=expsyms_regex
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1405 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1406 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1407 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1408
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1409 -inst-prefix-dir)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1410 prev=inst_prefix
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1411 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1412 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1413
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1414 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1415 # so, if we see these flags be careful not to treat them like -L
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1416 -L[A-Z][A-Z]*:*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1417 case $with_gcc/$host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1418 no/*-*-irix* | /*-*-irix*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1419 compile_command="$compile_command $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1420 finalize_command="$finalize_command $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1421 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1422 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1423 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1424 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1425
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1426 -L*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1427 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1428 # We need an absolute path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1429 case $dir in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1430 [\\/]* | [A-Za-z]:[\\/]*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1431 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1432 absdir=`cd "$dir" && pwd`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1433 if test -z "$absdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1434 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1435 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1436 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1437 dir="$absdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1438 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1439 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1440 case "$deplibs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1441 *" -L$dir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1442 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1443 deplibs="$deplibs -L$dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1444 lib_search_path="$lib_search_path $dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1445 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1446 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1447 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1448 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1449 case :$dllsearchpath: in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1450 *":$dir:"*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1451 *) dllsearchpath="$dllsearchpath:$dir";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1452 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1453 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1454 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1455 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1456 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1457
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1458 -l*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1459 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1460 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1461 *-*-cygwin* | *-*-pw32* | *-*-beos*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1462 # These systems don't actually have a C or math library (as such)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1463 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1464 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1465 *-*-mingw* | *-*-os2*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1466 # These systems don't actually have a C library (as such)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1467 test "X$arg" = "X-lc" && continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1468 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1469 *-*-openbsd* | *-*-freebsd*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1470 # Do not include libc due to us having libc/libc_r.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1471 test "X$arg" = "X-lc" && continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1472 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1473 *-*-rhapsody* | *-*-darwin1.[012])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1474 # Rhapsody C and math libraries are in the System framework
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1475 deplibs="$deplibs -framework System"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1476 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1477 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1478 elif test "X$arg" = "X-lc_r"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1479 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1480 *-*-openbsd* | *-*-freebsd4*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1481 # Do not include libc_r directly, use -pthread flag.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1482 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1483 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1484 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1485 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1486 deplibs="$deplibs $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1487 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1488 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1489
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1490 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1491 deplibs="$deplibs $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1492 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1493 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1494
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1495 -module)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1496 module=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1497 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1498 *-*-freebsd*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1499 # Do not build the useless static library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1500 build_old_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1501 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1502 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1503 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1504 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1505
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1506 # gcc -m* arguments should be passed to the linker via $compiler_flags
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1507 # in order to pass architecture information to the linker
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1508 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1509 # but this is not reliable with gcc because gcc may use -mfoo to
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1510 # select a different linker, different libraries, etc, while
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1511 # -Wl,-mfoo simply passes -mfoo to the linker.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1512 -m*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1513 # Unknown arguments in both finalize_command and compile_command need
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1514 # to be aesthetically quoted because they are evaled later.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1515 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1516 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1517 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1518 arg="\"$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1519 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1520 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1521 compile_command="$compile_command $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1522 finalize_command="$finalize_command $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1523 if test "$with_gcc" = "yes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1524 compiler_flags="$compiler_flags $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1525 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1526 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1527 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1528
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1529 -shrext)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1530 prev=shrext
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1531 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1532 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1533
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1534 -no-fast-install)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1535 fast_install=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1536 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1537 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1538
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1539 -no-install)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1540 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1541 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1542 # The PATH hackery in wrapper scripts is required on Windows
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1543 # in order for the loader to find any dlls it needs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1544 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1545 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1546 fast_install=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1547 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1548 *) no_install=yes ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1549 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1550 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1551 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1552
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1553 -no-undefined)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1554 allow_undefined=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1555 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1556 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1557
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1558 -objectlist)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1559 prev=objectlist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1560 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1561 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1562
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1563 -o) prev=output ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1564
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1565 -precious-files-regex)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1566 prev=precious_regex
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1567 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1568 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1569
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1570 -release)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1571 prev=release
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1572 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1573 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1574
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1575 -rpath)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1576 prev=rpath
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1577 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1578 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1579
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1580 -R)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1581 prev=xrpath
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1582 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1583 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1584
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1585 -R*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1586 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1587 # We need an absolute path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1588 case $dir in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1589 [\\/]* | [A-Za-z]:[\\/]*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1590 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1591 $echo "$modename: only absolute run-paths are allowed" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1592 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1593 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1594 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1595 case "$xrpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1596 *" $dir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1597 *) xrpath="$xrpath $dir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1598 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1599 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1600 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1601
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1602 -static)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1603 # The effects of -static are defined in a previous loop.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1604 # We used to do the same as -all-static on platforms that
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1605 # didn't have a PIC flag, but the assumption that the effects
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1606 # would be equivalent was wrong. It would break on at least
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1607 # Digital Unix and AIX.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1608 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1609 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1610
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1611 -thread-safe)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1612 thread_safe=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1613 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1614 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1615
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1616 -version-info)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1617 prev=vinfo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1618 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1619 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1620 -version-number)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1621 prev=vinfo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1622 vinfo_number=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1623 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1624 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1625
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1626 -Wc,*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1627 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1628 arg=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1629 save_ifs="$IFS"; IFS=','
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1630 for flag in $args; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1631 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1632 case $flag in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1633 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1634 flag="\"$flag\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1635 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1636 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1637 arg="$arg $wl$flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1638 compiler_flags="$compiler_flags $flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1639 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1640 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1641 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1642 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1643
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1644 -Wl,*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1645 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1646 arg=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1647 save_ifs="$IFS"; IFS=','
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1648 for flag in $args; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1649 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1650 case $flag in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1651 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1652 flag="\"$flag\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1653 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1654 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1655 arg="$arg $wl$flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1656 compiler_flags="$compiler_flags $wl$flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1657 linker_flags="$linker_flags $flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1658 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1659 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1660 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1661 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1662
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1663 -Xcompiler)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1664 prev=xcompiler
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1665 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1666 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1667
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1668 -Xlinker)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1669 prev=xlinker
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1670 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1671 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1672
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1673 -XCClinker)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1674 prev=xcclinker
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1675 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1676 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1677
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1678 # Some other compiler flag.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1679 -* | +*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1680 # Unknown arguments in both finalize_command and compile_command need
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1681 # to be aesthetically quoted because they are evaled later.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1682 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1683 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1684 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1685 arg="\"$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1686 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1687 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1688 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1689
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1690 *.$objext)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1691 # A standard object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1692 objs="$objs $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1693 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1694
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1695 *.lo)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1696 # A libtool-controlled object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1697
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1698 # Check to see that this really is a libtool object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1699 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1700 pic_object=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1701 non_pic_object=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1702
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1703 # Read the .lo file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1704 # If there is no directory component, then add one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1705 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1706 */* | *\\*) . $arg ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1707 *) . ./$arg ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1708 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1709
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1710 if test -z "$pic_object" || \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1711 test -z "$non_pic_object" ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1712 test "$pic_object" = none && \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1713 test "$non_pic_object" = none; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1714 $echo "$modename: cannot find name of object for \`$arg'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1715 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1716 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1717
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1718 # Extract subdirectory from the argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1719 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1720 if test "X$xdir" = "X$arg"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1721 xdir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1722 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1723 xdir="$xdir/"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1724 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1725
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1726 if test "$pic_object" != none; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1727 # Prepend the subdirectory the object is found in.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1728 pic_object="$xdir$pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1729
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1730 if test "$prev" = dlfiles; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1731 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1732 dlfiles="$dlfiles $pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1733 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1734 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1735 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1736 # If libtool objects are unsupported, then we need to preload.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1737 prev=dlprefiles
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1738 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1739 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1740
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1741 # CHECK ME: I think I busted this. -Ossama
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1742 if test "$prev" = dlprefiles; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1743 # Preload the old-style object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1744 dlprefiles="$dlprefiles $pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1745 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1746 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1747
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1748 # A PIC object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1749 libobjs="$libobjs $pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1750 arg="$pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1751 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1752
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1753 # Non-PIC object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1754 if test "$non_pic_object" != none; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1755 # Prepend the subdirectory the object is found in.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1756 non_pic_object="$xdir$non_pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1757
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1758 # A standard non-PIC object
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1759 non_pic_objects="$non_pic_objects $non_pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1760 if test -z "$pic_object" || test "$pic_object" = none ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1761 arg="$non_pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1762 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1763 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1764 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1765 # Only an error if not doing a dry-run.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1766 if test -z "$run"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1767 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1768 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1769 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1770 # Dry-run case.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1771
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1772 # Extract subdirectory from the argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1773 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1774 if test "X$xdir" = "X$arg"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1775 xdir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1776 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1777 xdir="$xdir/"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1778 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1779
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1780 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1781 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1782 libobjs="$libobjs $pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1783 non_pic_objects="$non_pic_objects $non_pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1784 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1785 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1786 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1787
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1788 *.$libext)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1789 # An archive.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1790 deplibs="$deplibs $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1791 old_deplibs="$old_deplibs $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1792 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1793 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1794
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1795 *.la)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1796 # A libtool-controlled library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1797
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1798 if test "$prev" = dlfiles; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1799 # This library was specified with -dlopen.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1800 dlfiles="$dlfiles $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1801 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1802 elif test "$prev" = dlprefiles; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1803 # The library was specified with -dlpreopen.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1804 dlprefiles="$dlprefiles $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1805 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1806 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1807 deplibs="$deplibs $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1808 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1809 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1810 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1811
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1812 # Some other compiler argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1813 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1814 # Unknown arguments in both finalize_command and compile_command need
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1815 # to be aesthetically quoted because they are evaled later.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1816 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1817 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1818 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1819 arg="\"$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1820 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1821 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1822 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1823 esac # arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1824
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1825 # Now actually substitute the argument into the commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1826 if test -n "$arg"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1827 compile_command="$compile_command $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1828 finalize_command="$finalize_command $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1829 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1830 done # argument parsing loop
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1831
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1832 if test -n "$prev"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1833 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1834 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1835 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1836 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1837
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1838 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1839 eval arg=\"$export_dynamic_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1840 compile_command="$compile_command $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1841 finalize_command="$finalize_command $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1842 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1843
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1844 oldlibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1845 # calculate the name of the file, without its directory
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1846 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1847 libobjs_save="$libobjs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1848
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1849 if test -n "$shlibpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1850 # get the directories listed in $shlibpath_var
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1851 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1852 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1853 shlib_search_path=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1854 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1855 eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1856 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1857
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1858 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1859 if test "X$output_objdir" = "X$output"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1860 output_objdir="$objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1861 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1862 output_objdir="$output_objdir/$objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1863 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1864 # Create the object directory.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1865 if test ! -d "$output_objdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1866 $show "$mkdir $output_objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1867 $run $mkdir $output_objdir
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1868 status=$?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1869 if test "$status" -ne 0 && test ! -d "$output_objdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1870 exit $status
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1871 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1872 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1873
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1874 # Determine the type of output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1875 case $output in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1876 "")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1877 $echo "$modename: you must specify an output file" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1878 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1879 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1880 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1881 *.$libext) linkmode=oldlib ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1882 *.lo | *.$objext) linkmode=obj ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1883 *.la) linkmode=lib ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1884 *) linkmode=prog ;; # Anything else should be a program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1885 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1886
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1887 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1888 *cygwin* | *mingw* | *pw32*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1889 # don't eliminate duplications in $postdeps and $predeps
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1890 duplicate_compiler_generated_deps=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1891 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1892 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1893 duplicate_compiler_generated_deps=$duplicate_deps
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1894 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1895 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1896 specialdeplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1897
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1898 libs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1899 # Find all interdependent deplibs by searching for libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1900 # that are linked more than once (e.g. -la -lb -la)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1901 for deplib in $deplibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1902 if test "X$duplicate_deps" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1903 case "$libs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1904 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1905 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1906 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1907 libs="$libs $deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1908 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1909
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1910 if test "$linkmode" = lib; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1911 libs="$predeps $libs $compiler_lib_search_path $postdeps"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1912
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1913 # Compute libraries that are listed more than once in $predeps
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1914 # $postdeps and mark them as special (i.e., whose duplicates are
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1915 # not to be eliminated).
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1916 pre_post_deps=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1917 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1918 for pre_post_dep in $predeps $postdeps; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1919 case "$pre_post_deps " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1920 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1921 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1922 pre_post_deps="$pre_post_deps $pre_post_dep"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1923 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1924 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1925 pre_post_deps=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1926 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1927
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1928 deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1929 newdependency_libs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1930 newlib_search_path=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1931 need_relink=no # whether we're linking any uninstalled libtool libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1932 notinst_deplibs= # not-installed libtool libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1933 notinst_path= # paths that contain not-installed libtool libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1934 case $linkmode in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1935 lib)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1936 passes="conv link"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1937 for file in $dlfiles $dlprefiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1938 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1939 *.la) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1940 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1941 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1942 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1943 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1944 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1945 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1946 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1947 prog)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1948 compile_deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1949 finalize_deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1950 alldeplibs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1951 newdlfiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1952 newdlprefiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1953 passes="conv scan dlopen dlpreopen link"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1954 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1955 *) passes="conv"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1956 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1957 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1958 for pass in $passes; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1959 if test "$linkmode,$pass" = "lib,link" ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1960 test "$linkmode,$pass" = "prog,scan"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1961 libs="$deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1962 deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1963 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1964 if test "$linkmode" = prog; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1965 case $pass in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1966 dlopen) libs="$dlfiles" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1967 dlpreopen) libs="$dlprefiles" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1968 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1969 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1970 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1971 if test "$pass" = dlopen; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1972 # Collect dlpreopened libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1973 save_deplibs="$deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1974 deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1975 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1976 for deplib in $libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1977 lib=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1978 found=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1979 case $deplib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1980 -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1981 if test "$linkmode,$pass" = "prog,link"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1982 compile_deplibs="$deplib $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1983 finalize_deplibs="$deplib $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1984 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1985 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1986 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1987 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1988 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1989 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1990 -l*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1991 if test "$linkmode" != lib && test "$linkmode" != prog; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1992 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1993 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1994 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1995 if test "$pass" = conv; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1996 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1997 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1998 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
1999 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2000 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2001 for search_ext in .la $std_shrext .so .a; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2002 # Search the libtool library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2003 lib="$searchdir/lib${name}${search_ext}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2004 if test -f "$lib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2005 if test "$search_ext" = ".la"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2006 found=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2007 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2008 found=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2009 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2010 break 2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2011 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2012 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2013 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2014 if test "$found" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2015 # deplib doesn't seem to be a libtool library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2016 if test "$linkmode,$pass" = "prog,link"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2017 compile_deplibs="$deplib $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2018 finalize_deplibs="$deplib $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2019 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2020 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2021 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2022 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2023 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2024 else # deplib is a libtool library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2025 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2026 # We need to do some special things here, and not later.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2027 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2028 case " $predeps $postdeps " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2029 *" $deplib "*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2030 if (${SED} -e '2q' $lib |
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2031 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2032 library_names=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2033 old_library=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2034 case $lib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2035 */* | *\\*) . $lib ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2036 *) . ./$lib ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2037 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2038 for l in $old_library $library_names; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2039 ll="$l"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2040 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2041 if test "X$ll" = "X$old_library" ; then # only static version available
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2042 found=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2043 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2044 test "X$ladir" = "X$lib" && ladir="."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2045 lib=$ladir/$old_library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2046 if test "$linkmode,$pass" = "prog,link"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2047 compile_deplibs="$deplib $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2048 finalize_deplibs="$deplib $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2049 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2050 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2051 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2052 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2053 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2054 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2055 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2056 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2057 *) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2058 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2059 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2060 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2061 ;; # -l
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2062 -L*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2063 case $linkmode in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2064 lib)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2065 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2066 test "$pass" = conv && continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2067 newdependency_libs="$deplib $newdependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2068 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2069 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2070 prog)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2071 if test "$pass" = conv; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2072 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2073 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2074 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2075 if test "$pass" = scan; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2076 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2077 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2078 compile_deplibs="$deplib $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2079 finalize_deplibs="$deplib $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2080 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2081 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2082 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2083 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2084 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2085 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2086 esac # linkmode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2087 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2088 ;; # -L
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2089 -R*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2090 if test "$pass" = link; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2091 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2092 # Make sure the xrpath contains only unique directories.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2093 case "$xrpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2094 *" $dir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2095 *) xrpath="$xrpath $dir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2096 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2097 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2098 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2099 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2100 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2101 *.la) lib="$deplib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2102 *.$libext)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2103 if test "$pass" = conv; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2104 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2105 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2106 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2107 case $linkmode in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2108 lib)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2109 valid_a_lib=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2110 case $deplibs_check_method in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2111 match_pattern*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2112 set dummy $deplibs_check_method
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2113 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2114 if eval $echo \"$deplib\" 2>/dev/null \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2115 | $SED 10q \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2116 | $EGREP "$match_pattern_regex" > /dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2117 valid_a_lib=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2118 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2119 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2120 pass_all)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2121 valid_a_lib=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2122 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2123 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2124 if test "$valid_a_lib" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2125 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2126 $echo "*** Warning: Trying to link with static lib archive $deplib."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2127 $echo "*** I have the capability to make that library automatically link in when"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2128 $echo "*** you link to this library. But I can only do this if you have a"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2129 $echo "*** shared version of the library, which you do not appear to have"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2130 $echo "*** because the file extensions .$libext of this argument makes me believe"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2131 $echo "*** that it is just a static archive that I should not used here."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2132 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2133 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2134 $echo "*** Warning: Linking the shared library $output against the"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2135 $echo "*** static library $deplib is not portable!"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2136 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2137 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2138 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2139 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2140 prog)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2141 if test "$pass" != link; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2142 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2143 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2144 compile_deplibs="$deplib $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2145 finalize_deplibs="$deplib $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2146 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2147 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2148 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2149 esac # linkmode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2150 ;; # *.$libext
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2151 *.lo | *.$objext)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2152 if test "$pass" = conv; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2153 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2154 elif test "$linkmode" = prog; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2155 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2156 # If there is no dlopen support or we're linking statically,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2157 # we need to preload.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2158 newdlprefiles="$newdlprefiles $deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2159 compile_deplibs="$deplib $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2160 finalize_deplibs="$deplib $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2161 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2162 newdlfiles="$newdlfiles $deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2163 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2164 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2165 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2166 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2167 %DEPLIBS%)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2168 alldeplibs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2169 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2170 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2171 esac # case $deplib
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2172 if test "$found" = yes || test -f "$lib"; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2173 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2174 $echo "$modename: cannot find the library \`$lib'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2175 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2176 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2177
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2178 # Check to see that this really is a libtool archive.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2179 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2180 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2181 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2182 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2183 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2184
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2185 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2186 test "X$ladir" = "X$lib" && ladir="."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2187
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2188 dlname=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2189 dlopen=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2190 dlpreopen=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2191 libdir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2192 library_names=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2193 old_library=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2194 # If the library was installed with an old release of libtool,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2195 # it will not redefine variables installed, or shouldnotlink
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2196 installed=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2197 shouldnotlink=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2198
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2199 # Read the .la file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2200 case $lib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2201 */* | *\\*) . $lib ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2202 *) . ./$lib ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2203 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2204
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2205 if test "$linkmode,$pass" = "lib,link" ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2206 test "$linkmode,$pass" = "prog,scan" ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2207 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2208 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2209 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2210 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2211
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2212 if test "$pass" = conv; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2213 # Only check for convenience libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2214 deplibs="$lib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2215 if test -z "$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2216 if test -z "$old_library"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2217 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2218 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2219 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2220 # It is a libtool convenience library, so add in its objects.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2221 convenience="$convenience $ladir/$objdir/$old_library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2222 old_convenience="$old_convenience $ladir/$objdir/$old_library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2223 tmp_libs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2224 for deplib in $dependency_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2225 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2226 if test "X$duplicate_deps" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2227 case "$tmp_libs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2228 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2229 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2230 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2231 tmp_libs="$tmp_libs $deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2232 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2233 elif test "$linkmode" != prog && test "$linkmode" != lib; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2234 $echo "$modename: \`$lib' is not a convenience library" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2235 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2236 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2237 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2238 fi # $pass = conv
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2239
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2240
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2241 # Get the name of the library we link against.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2242 linklib=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2243 for l in $old_library $library_names; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2244 linklib="$l"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2245 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2246 if test -z "$linklib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2247 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2248 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2249 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2250
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2251 # This library was specified with -dlopen.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2252 if test "$pass" = dlopen; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2253 if test -z "$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2254 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2255 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2256 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2257 if test -z "$dlname" ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2258 test "$dlopen_support" != yes ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2259 test "$build_libtool_libs" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2260 # If there is no dlname, no dlopen support or we're linking
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2261 # statically, we need to preload. We also need to preload any
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2262 # dependent libraries so libltdl's deplib preloader doesn't
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2263 # bomb out in the load deplibs phase.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2264 dlprefiles="$dlprefiles $lib $dependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2265 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2266 newdlfiles="$newdlfiles $lib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2267 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2268 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2269 fi # $pass = dlopen
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2270
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2271 # We need an absolute path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2272 case $ladir in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2273 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2274 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2275 abs_ladir=`cd "$ladir" && pwd`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2276 if test -z "$abs_ladir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2277 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2278 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2279 abs_ladir="$ladir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2280 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2281 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2282 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2283 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2284
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2285 # Find the relevant object directory and library name.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2286 if test "X$installed" = Xyes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2287 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2288 $echo "$modename: warning: library \`$lib' was moved." 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2289 dir="$ladir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2290 absdir="$abs_ladir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2291 libdir="$abs_ladir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2292 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2293 dir="$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2294 absdir="$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2295 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2296 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2297 if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2298 dir="$ladir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2299 absdir="$abs_ladir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2300 # Remove this search path later
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2301 notinst_path="$notinst_path $abs_ladir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2302 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2303 dir="$ladir/$objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2304 absdir="$abs_ladir/$objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2305 # Remove this search path later
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2306 notinst_path="$notinst_path $abs_ladir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2307 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2308 fi # $installed = yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2309 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2310
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2311 # This library was specified with -dlpreopen.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2312 if test "$pass" = dlpreopen; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2313 if test -z "$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2314 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2315 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2316 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2317 # Prefer using a static library (so that no silly _DYNAMIC symbols
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2318 # are required to link).
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2319 if test -n "$old_library"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2320 newdlprefiles="$newdlprefiles $dir/$old_library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2321 # Otherwise, use the dlname, so that lt_dlopen finds it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2322 elif test -n "$dlname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2323 newdlprefiles="$newdlprefiles $dir/$dlname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2324 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2325 newdlprefiles="$newdlprefiles $dir/$linklib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2326 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2327 fi # $pass = dlpreopen
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2328
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2329 if test -z "$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2330 # Link the convenience library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2331 if test "$linkmode" = lib; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2332 deplibs="$dir/$old_library $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2333 elif test "$linkmode,$pass" = "prog,link"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2334 compile_deplibs="$dir/$old_library $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2335 finalize_deplibs="$dir/$old_library $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2336 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2337 deplibs="$lib $deplibs" # used for prog,scan pass
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2338 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2339 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2340 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2341
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2342
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2343 if test "$linkmode" = prog && test "$pass" != link; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2344 newlib_search_path="$newlib_search_path $ladir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2345 deplibs="$lib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2346
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2347 linkalldeplibs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2348 if test "$link_all_deplibs" != no || test -z "$library_names" ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2349 test "$build_libtool_libs" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2350 linkalldeplibs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2351 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2352
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2353 tmp_libs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2354 for deplib in $dependency_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2355 case $deplib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2356 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2357 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2358 # Need to link against all dependency_libs?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2359 if test "$linkalldeplibs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2360 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2361 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2362 # Need to hardcode shared library paths
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2363 # or/and link against static libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2364 newdependency_libs="$deplib $newdependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2365 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2366 if test "X$duplicate_deps" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2367 case "$tmp_libs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2368 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2369 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2370 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2371 tmp_libs="$tmp_libs $deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2372 done # for deplib
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2373 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2374 fi # $linkmode = prog...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2375
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2376 if test "$linkmode,$pass" = "prog,link"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2377 if test -n "$library_names" &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2378 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2379 # We need to hardcode the library path
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2380 if test -n "$shlibpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2381 # Make sure the rpath contains only unique directories.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2382 case "$temp_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2383 *" $dir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2384 *" $absdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2385 *) temp_rpath="$temp_rpath $dir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2386 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2387 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2388
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2389 # Hardcode the library path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2390 # Skip directories that are in the system default run-time
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2391 # search path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2392 case " $sys_lib_dlsearch_path " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2393 *" $absdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2394 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2395 case "$compile_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2396 *" $absdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2397 *) compile_rpath="$compile_rpath $absdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2398 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2399 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2400 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2401 case " $sys_lib_dlsearch_path " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2402 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2403 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2404 case "$finalize_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2405 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2406 *) finalize_rpath="$finalize_rpath $libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2407 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2408 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2409 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2410 fi # $linkmode,$pass = prog,link...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2411
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2412 if test "$alldeplibs" = yes &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2413 { test "$deplibs_check_method" = pass_all ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2414 { test "$build_libtool_libs" = yes &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2415 test -n "$library_names"; }; }; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2416 # We only need to search for static libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2417 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2418 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2419 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2420
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2421 link_static=no # Whether the deplib will be linked statically
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2422 if test -n "$library_names" &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2423 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2424 if test "$installed" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2425 notinst_deplibs="$notinst_deplibs $lib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2426 need_relink=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2427 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2428 # This is a shared library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2429
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2430 # Warn about portability, can't link against -module's on
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2431 # some systems (darwin)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2432 if test "$shouldnotlink" = yes && test "$pass" = link ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2433 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2434 if test "$linkmode" = prog; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2435 $echo "*** Warning: Linking the executable $output against the loadable module"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2436 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2437 $echo "*** Warning: Linking the shared library $output against the loadable module"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2438 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2439 $echo "*** $linklib is not portable!"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2440 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2441 if test "$linkmode" = lib &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2442 test "$hardcode_into_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2443 # Hardcode the library path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2444 # Skip directories that are in the system default run-time
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2445 # search path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2446 case " $sys_lib_dlsearch_path " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2447 *" $absdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2448 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2449 case "$compile_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2450 *" $absdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2451 *) compile_rpath="$compile_rpath $absdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2452 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2453 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2454 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2455 case " $sys_lib_dlsearch_path " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2456 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2457 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2458 case "$finalize_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2459 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2460 *) finalize_rpath="$finalize_rpath $libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2461 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2462 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2463 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2464 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2465
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2466 if test -n "$old_archive_from_expsyms_cmds"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2467 # figure out the soname
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2468 set dummy $library_names
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2469 realname="$2"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2470 shift; shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2471 libname=`eval \\$echo \"$libname_spec\"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2472 # use dlname if we got it. it's perfectly good, no?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2473 if test -n "$dlname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2474 soname="$dlname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2475 elif test -n "$soname_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2476 # bleh windows
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2477 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2478 *cygwin* | mingw*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2479 major=`expr $current - $age`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2480 versuffix="-$major"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2481 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2482 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2483 eval soname=\"$soname_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2484 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2485 soname="$realname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2486 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2487
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2488 # Make a new name for the extract_expsyms_cmds to use
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2489 soroot="$soname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2490 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2491 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2492
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2493 # If the library has no export list, then create one now
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2494 if test -f "$output_objdir/$soname-def"; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2495 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2496 $show "extracting exported symbol list from \`$soname'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2497 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2498 cmds=$extract_expsyms_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2499 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2500 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2501 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2502 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2503 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2504 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2505 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2506 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2507
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2508 # Create $newlib
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2509 if test -f "$output_objdir/$newlib"; then :; else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2510 $show "generating import library for \`$soname'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2511 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2512 cmds=$old_archive_from_expsyms_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2513 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2514 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2515 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2516 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2517 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2518 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2519 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2520 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2521 # make sure the library variables are pointing to the new library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2522 dir=$output_objdir
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2523 linklib=$newlib
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2524 fi # test -n "$old_archive_from_expsyms_cmds"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2525
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2526 if test "$linkmode" = prog || test "$mode" != relink; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2527 add_shlibpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2528 add_dir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2529 add=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2530 lib_linked=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2531 case $hardcode_action in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2532 immediate | unsupported)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2533 if test "$hardcode_direct" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2534 add="$dir/$linklib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2535 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2536 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2537 *-*-darwin* )
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2538 # if the lib is a module then we can not link against
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2539 # it, someone is ignoring the new warnings I added
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2540 if /usr/bin/file -L $add 2> /dev/null | $EGREP "bundle" >/dev/null ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2541 $echo "** Warning, lib $linklib is a module, not a shared library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2542 if test -z "$old_library" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2543 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2544 $echo "** And there doesn't seem to be a static archive available"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2545 $echo "** The link will probably fail, sorry"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2546 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2547 add="$dir/$old_library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2548 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2549 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2550 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2551 elif test "$hardcode_minus_L" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2552 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2553 *-*-sunos*) add_shlibpath="$dir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2554 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2555 add_dir="-L$dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2556 add="-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2557 elif test "$hardcode_shlibpath_var" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2558 add_shlibpath="$dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2559 add="-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2560 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2561 lib_linked=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2562 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2563 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2564 relink)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2565 if test "$hardcode_direct" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2566 add="$dir/$linklib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2567 elif test "$hardcode_minus_L" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2568 add_dir="-L$dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2569 # Try looking first in the location we're being installed to.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2570 if test -n "$inst_prefix_dir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2571 case "$libdir" in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2572 [\\/]*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2573 add_dir="$add_dir -L$inst_prefix_dir$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2574 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2575 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2576 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2577 add="-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2578 elif test "$hardcode_shlibpath_var" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2579 add_shlibpath="$dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2580 add="-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2581 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2582 lib_linked=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2583 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2584 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2585 *) lib_linked=no ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2586 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2587
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2588 if test "$lib_linked" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2589 $echo "$modename: configuration error: unsupported hardcode properties"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2590 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2591 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2592
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2593 if test -n "$add_shlibpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2594 case :$compile_shlibpath: in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2595 *":$add_shlibpath:"*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2596 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2597 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2598 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2599 if test "$linkmode" = prog; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2600 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2601 test -n "$add" && compile_deplibs="$add $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2602 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2603 test -n "$add_dir" && deplibs="$add_dir $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2604 test -n "$add" && deplibs="$add $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2605 if test "$hardcode_direct" != yes && \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2606 test "$hardcode_minus_L" != yes && \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2607 test "$hardcode_shlibpath_var" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2608 case :$finalize_shlibpath: in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2609 *":$libdir:"*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2610 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2611 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2612 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2613 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2614 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2615
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2616 if test "$linkmode" = prog || test "$mode" = relink; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2617 add_shlibpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2618 add_dir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2619 add=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2620 # Finalize command for both is simple: just hardcode it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2621 if test "$hardcode_direct" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2622 add="$libdir/$linklib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2623 elif test "$hardcode_minus_L" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2624 add_dir="-L$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2625 add="-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2626 elif test "$hardcode_shlibpath_var" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2627 case :$finalize_shlibpath: in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2628 *":$libdir:"*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2629 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2630 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2631 add="-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2632 elif test "$hardcode_automatic" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2633 if test -n "$inst_prefix_dir" &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2634 test -f "$inst_prefix_dir$libdir/$linklib" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2635 add="$inst_prefix_dir$libdir/$linklib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2636 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2637 add="$libdir/$linklib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2638 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2639 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2640 # We cannot seem to hardcode it, guess we'll fake it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2641 add_dir="-L$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2642 # Try looking first in the location we're being installed to.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2643 if test -n "$inst_prefix_dir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2644 case "$libdir" in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2645 [\\/]*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2646 add_dir="$add_dir -L$inst_prefix_dir$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2647 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2648 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2649 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2650 add="-l$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2651 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2652
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2653 if test "$linkmode" = prog; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2654 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2655 test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2656 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2657 test -n "$add_dir" && deplibs="$add_dir $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2658 test -n "$add" && deplibs="$add $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2659 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2660 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2661 elif test "$linkmode" = prog; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2662 # Here we assume that one of hardcode_direct or hardcode_minus_L
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2663 # is not unsupported. This is valid on all known static and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2664 # shared platforms.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2665 if test "$hardcode_direct" != unsupported; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2666 test -n "$old_library" && linklib="$old_library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2667 compile_deplibs="$dir/$linklib $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2668 finalize_deplibs="$dir/$linklib $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2669 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2670 compile_deplibs="-l$name -L$dir $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2671 finalize_deplibs="-l$name -L$dir $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2672 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2673 elif test "$build_libtool_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2674 # Not a shared library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2675 if test "$deplibs_check_method" != pass_all; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2676 # We're trying link a shared library against a static one
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2677 # but the system doesn't support it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2678
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2679 # Just print a warning and add the library to dependency_libs so
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2680 # that the program can be linked against the static library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2681 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2682 $echo "*** Warning: This system can not link to static lib archive $lib."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2683 $echo "*** I have the capability to make that library automatically link in when"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2684 $echo "*** you link to this library. But I can only do this if you have a"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2685 $echo "*** shared version of the library, which you do not appear to have."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2686 if test "$module" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2687 $echo "*** But as you try to build a module library, libtool will still create "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2688 $echo "*** a static module, that should work as long as the dlopening application"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2689 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2690 if test -z "$global_symbol_pipe"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2691 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2692 $echo "*** However, this would only work if libtool was able to extract symbol"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2693 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2694 $echo "*** not find such a program. So, this module is probably useless."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2695 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2696 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2697 if test "$build_old_libs" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2698 build_libtool_libs=module
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2699 build_old_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2700 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2701 build_libtool_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2702 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2703 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2704 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2705 convenience="$convenience $dir/$old_library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2706 old_convenience="$old_convenience $dir/$old_library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2707 deplibs="$dir/$old_library $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2708 link_static=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2709 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2710 fi # link shared/static library?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2711
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2712 if test "$linkmode" = lib; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2713 if test -n "$dependency_libs" &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2714 { test "$hardcode_into_libs" != yes ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2715 test "$build_old_libs" = yes ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2716 test "$link_static" = yes; }; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2717 # Extract -R from dependency_libs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2718 temp_deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2719 for libdir in $dependency_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2720 case $libdir in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2721 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2722 case " $xrpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2723 *" $temp_xrpath "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2724 *) xrpath="$xrpath $temp_xrpath";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2725 esac;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2726 *) temp_deplibs="$temp_deplibs $libdir";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2727 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2728 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2729 dependency_libs="$temp_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2730 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2731
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2732 newlib_search_path="$newlib_search_path $absdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2733 # Link against this library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2734 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2735 # ... and its dependency_libs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2736 tmp_libs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2737 for deplib in $dependency_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2738 newdependency_libs="$deplib $newdependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2739 if test "X$duplicate_deps" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2740 case "$tmp_libs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2741 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2742 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2743 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2744 tmp_libs="$tmp_libs $deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2745 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2746
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2747 if test "$link_all_deplibs" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2748 # Add the search paths of all dependency libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2749 for deplib in $dependency_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2750 case $deplib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2751 -L*) path="$deplib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2752 *.la)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2753 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2754 test "X$dir" = "X$deplib" && dir="."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2755 # We need an absolute path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2756 case $dir in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2757 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2758 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2759 absdir=`cd "$dir" && pwd`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2760 if test -z "$absdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2761 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2762 absdir="$dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2763 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2764 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2765 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2766 if grep "^installed=no" $deplib > /dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2767 path="$absdir/$objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2768 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2769 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2770 if test -z "$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2771 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2772 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2773 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2774 if test "$absdir" != "$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2775 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2776 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2777 path="$absdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2778 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2779 depdepl=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2780 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2781 *-*-darwin*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2782 # we do not want to link against static libs,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2783 # but need to link against shared
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2784 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2785 if test -n "$deplibrary_names" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2786 for tmp in $deplibrary_names ; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2787 depdepl=$tmp
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2788 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2789 if test -f "$path/$depdepl" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2790 depdepl="$path/$depdepl"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2791 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2792 # do not add paths which are already there
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2793 case " $newlib_search_path " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2794 *" $path "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2795 *) newlib_search_path="$newlib_search_path $path";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2796 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2797 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2798 path=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2799 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2800 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2801 path="-L$path"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2802 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2803 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2804 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2805 -l*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2806 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2807 *-*-darwin*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2808 # Again, we only want to link against shared libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2809 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2810 for tmp in $newlib_search_path ; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2811 if test -f "$tmp/lib$tmp_libs.dylib" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2812 eval depdepl="$tmp/lib$tmp_libs.dylib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2813 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2814 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2815 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2816 path=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2817 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2818 *) continue ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2819 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2820 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2821 *) continue ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2822 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2823 case " $deplibs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2824 *" $depdepl "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2825 *) deplibs="$depdepl $deplibs" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2826 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2827 case " $deplibs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2828 *" $path "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2829 *) deplibs="$deplibs $path" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2830 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2831 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2832 fi # link_all_deplibs != no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2833 fi # linkmode = lib
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2834 done # for deplib in $libs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2835 dependency_libs="$newdependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2836 if test "$pass" = dlpreopen; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2837 # Link the dlpreopened libraries before other libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2838 for deplib in $save_deplibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2839 deplibs="$deplib $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2840 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2841 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2842 if test "$pass" != dlopen; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2843 if test "$pass" != conv; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2844 # Make sure lib_search_path contains only unique directories.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2845 lib_search_path=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2846 for dir in $newlib_search_path; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2847 case "$lib_search_path " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2848 *" $dir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2849 *) lib_search_path="$lib_search_path $dir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2850 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2851 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2852 newlib_search_path=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2853 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2854
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2855 if test "$linkmode,$pass" != "prog,link"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2856 vars="deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2857 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2858 vars="compile_deplibs finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2859 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2860 for var in $vars dependency_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2861 # Add libraries to $var in reverse order
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2862 eval tmp_libs=\"\$$var\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2863 new_libs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2864 for deplib in $tmp_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2865 # FIXME: Pedantically, this is the right thing to do, so
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2866 # that some nasty dependency loop isn't accidentally
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2867 # broken:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2868 #new_libs="$deplib $new_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2869 # Pragmatically, this seems to cause very few problems in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2870 # practice:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2871 case $deplib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2872 -L*) new_libs="$deplib $new_libs" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2873 -R*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2874 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2875 # And here is the reason: when a library appears more
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2876 # than once as an explicit dependence of a library, or
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2877 # is implicitly linked in more than once by the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2878 # compiler, it is considered special, and multiple
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2879 # occurrences thereof are not removed. Compare this
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2880 # with having the same library being listed as a
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2881 # dependency of multiple other libraries: in this case,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2882 # we know (pedantically, we assume) the library does not
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2883 # need to be listed more than once, so we keep only the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2884 # last copy. This is not always right, but it is rare
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2885 # enough that we require users that really mean to play
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2886 # such unportable linking tricks to link the library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2887 # using -Wl,-lname, so that libtool does not consider it
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2888 # for duplicate removal.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2889 case " $specialdeplibs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2890 *" $deplib "*) new_libs="$deplib $new_libs" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2891 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2892 case " $new_libs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2893 *" $deplib "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2894 *) new_libs="$deplib $new_libs" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2895 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2896 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2897 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2898 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2899 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2900 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2901 tmp_libs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2902 for deplib in $new_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2903 case $deplib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2904 -L*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2905 case " $tmp_libs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2906 *" $deplib "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2907 *) tmp_libs="$tmp_libs $deplib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2908 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2909 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2910 *) tmp_libs="$tmp_libs $deplib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2911 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2912 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2913 eval $var=\"$tmp_libs\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2914 done # for var
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2915 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2916 # Last step: remove runtime libs from dependency_libs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2917 # (they stay in deplibs)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2918 tmp_libs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2919 for i in $dependency_libs ; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2920 case " $predeps $postdeps $compiler_lib_search_path " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2921 *" $i "*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2922 i=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2923 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2924 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2925 if test -n "$i" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2926 tmp_libs="$tmp_libs $i"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2927 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2928 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2929 dependency_libs=$tmp_libs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2930 done # for pass
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2931 if test "$linkmode" = prog; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2932 dlfiles="$newdlfiles"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2933 dlprefiles="$newdlprefiles"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2934 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2935
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2936 case $linkmode in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2937 oldlib)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2938 if test -n "$deplibs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2939 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2940 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2941
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2942 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2943 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2944 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2945
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2946 if test -n "$rpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2947 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2948 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2949
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2950 if test -n "$xrpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2951 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2952 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2953
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2954 if test -n "$vinfo"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2955 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2956 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2957
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2958 if test -n "$release"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2959 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2960 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2961
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2962 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2963 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2964 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2965
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2966 # Now set the variables for building old libraries.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2967 build_libtool_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2968 oldlibs="$output"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2969 objs="$objs$old_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2970 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2971
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2972 lib)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2973 # Make sure we only generate libraries of the form `libNAME.la'.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2974 case $outputname in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2975 lib*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2976 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2977 eval shared_ext=\"$shrext_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2978 eval libname=\"$libname_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2979 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2980 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2981 if test "$module" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2982 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2983 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2984 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2985 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2986 if test "$need_lib_prefix" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2987 # Add the "lib" prefix for modules if required
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2988 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2989 eval shared_ext=\"$shrext_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2990 eval libname=\"$libname_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2991 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2992 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2993 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2994 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2995 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2996
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2997 if test -n "$objs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2998 if test "$deplibs_check_method" != pass_all; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
2999 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3000 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3001 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3002 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3003 $echo "*** Warning: Linking the shared library $output against the non-libtool"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3004 $echo "*** objects $objs is not portable!"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3005 libobjs="$libobjs $objs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3006 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3007 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3008
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3009 if test "$dlself" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3010 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3011 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3012
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3013 set dummy $rpath
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3014 if test "$#" -gt 2; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3015 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3016 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3017 install_libdir="$2"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3018
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3019 oldlibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3020 if test -z "$rpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3021 if test "$build_libtool_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3022 # Building a libtool convenience library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3023 # Some compilers have problems with a `.al' extension so
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3024 # convenience libraries should have the same extension an
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3025 # archive normally would.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3026 oldlibs="$output_objdir/$libname.$libext $oldlibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3027 build_libtool_libs=convenience
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3028 build_old_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3029 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3030
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3031 if test -n "$vinfo"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3032 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3033 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3034
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3035 if test -n "$release"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3036 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3037 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3038 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3039
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3040 # Parse the version information argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3041 save_ifs="$IFS"; IFS=':'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3042 set dummy $vinfo 0 0 0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3043 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3044
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3045 if test -n "$8"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3046 $echo "$modename: too many parameters to \`-version-info'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3047 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3048 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3049 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3050
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3051 # convert absolute version numbers to libtool ages
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3052 # this retains compatibility with .la files and attempts
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3053 # to make the code below a bit more comprehensible
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3054
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3055 case $vinfo_number in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3056 yes)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3057 number_major="$2"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3058 number_minor="$3"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3059 number_revision="$4"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3060 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3061 # There are really only two kinds -- those that
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3062 # use the current revision as the major version
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3063 # and those that subtract age and use age as
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3064 # a minor version. But, then there is irix
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3065 # which has an extra 1 added just for fun
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3066 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3067 case $version_type in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3068 darwin|linux|osf|windows)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3069 current=`expr $number_major + $number_minor`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3070 age="$number_minor"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3071 revision="$number_revision"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3072 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3073 freebsd-aout|freebsd-elf|sunos)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3074 current="$number_major"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3075 revision="$number_minor"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3076 age="0"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3077 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3078 irix|nonstopux)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3079 current=`expr $number_major + $number_minor - 1`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3080 age="$number_minor"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3081 revision="$number_minor"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3082 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3083 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3084 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3085 no)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3086 current="$2"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3087 revision="$3"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3088 age="$4"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3089 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3090 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3091
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3092 # Check that each of the things are valid numbers.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3093 case $current in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3094 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3095 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3096 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3097 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3098 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3099 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3100 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3101
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3102 case $revision in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3103 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3104 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3105 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3106 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3107 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3108 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3109 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3110
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3111 case $age in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3112 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3113 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3114 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3115 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3116 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3117 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3118 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3119
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3120 if test "$age" -gt "$current"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3121 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3122 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3123 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3124 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3125
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3126 # Calculate the version variables.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3127 major=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3128 versuffix=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3129 verstring=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3130 case $version_type in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3131 none) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3132
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3133 darwin)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3134 # Like Linux, but with the current version available in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3135 # verstring for coding it into the library header
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3136 major=.`expr $current - $age`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3137 versuffix="$major.$age.$revision"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3138 # Darwin ld doesn't like 0 for these options...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3139 minor_current=`expr $current + 1`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3140 verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3141 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3142
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3143 freebsd-aout)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3144 major=".$current"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3145 versuffix=".$current.$revision";
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3146 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3147
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3148 freebsd-elf)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3149 major=".$current"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3150 versuffix=".$current";
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3151 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3152
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3153 irix | nonstopux)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3154 major=`expr $current - $age + 1`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3155
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3156 case $version_type in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3157 nonstopux) verstring_prefix=nonstopux ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3158 *) verstring_prefix=sgi ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3159 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3160 verstring="$verstring_prefix$major.$revision"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3161
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3162 # Add in all the interfaces that we are compatible with.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3163 loop=$revision
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3164 while test "$loop" -ne 0; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3165 iface=`expr $revision - $loop`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3166 loop=`expr $loop - 1`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3167 verstring="$verstring_prefix$major.$iface:$verstring"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3168 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3169
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3170 # Before this point, $major must not contain `.'.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3171 major=.$major
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3172 versuffix="$major.$revision"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3173 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3174
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3175 linux)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3176 major=.`expr $current - $age`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3177 versuffix="$major.$age.$revision"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3178 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3179
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3180 osf)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3181 major=.`expr $current - $age`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3182 versuffix=".$current.$age.$revision"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3183 verstring="$current.$age.$revision"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3184
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3185 # Add in all the interfaces that we are compatible with.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3186 loop=$age
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3187 while test "$loop" -ne 0; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3188 iface=`expr $current - $loop`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3189 loop=`expr $loop - 1`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3190 verstring="$verstring:${iface}.0"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3191 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3192
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3193 # Make executables depend on our current version.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3194 verstring="$verstring:${current}.0"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3195 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3196
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3197 sunos)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3198 major=".$current"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3199 versuffix=".$current.$revision"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3200 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3201
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3202 windows)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3203 # Use '-' rather than '.', since we only want one
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3204 # extension on DOS 8.3 filesystems.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3205 major=`expr $current - $age`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3206 versuffix="-$major"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3207 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3208
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3209 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3210 $echo "$modename: unknown library version type \`$version_type'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3211 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3212 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3213 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3214 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3215
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3216 # Clear the version info if we defaulted, and they specified a release.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3217 if test -z "$vinfo" && test -n "$release"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3218 major=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3219 case $version_type in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3220 darwin)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3221 # we can't check for "0.0" in archive_cmds due to quoting
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3222 # problems, so we reset it completely
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3223 verstring=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3224 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3225 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3226 verstring="0.0"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3227 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3228 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3229 if test "$need_version" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3230 versuffix=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3231 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3232 versuffix=".0.0"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3233 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3234 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3235
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3236 # Remove version info from name if versioning should be avoided
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3237 if test "$avoid_version" = yes && test "$need_version" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3238 major=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3239 versuffix=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3240 verstring=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3241 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3242
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3243 # Check to see if the archive will have undefined symbols.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3244 if test "$allow_undefined" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3245 if test "$allow_undefined_flag" = unsupported; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3246 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3247 build_libtool_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3248 build_old_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3249 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3250 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3251 # Don't allow undefined symbols.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3252 allow_undefined_flag="$no_undefined_flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3253 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3254 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3255
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3256 if test "$mode" != relink; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3257 # Remove our outputs, but don't remove object files since they
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3258 # may have been created when compiling PIC objects.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3259 removelist=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3260 tempremovelist=`$echo "$output_objdir/*"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3261 for p in $tempremovelist; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3262 case $p in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3263 *.$objext)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3264 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3265 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3266 if test "X$precious_files_regex" != "X"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3267 if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3268 then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3269 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3270 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3271 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3272 removelist="$removelist $p"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3273 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3274 *) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3275 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3276 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3277 if test -n "$removelist"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3278 $show "${rm}r $removelist"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3279 $run ${rm}r $removelist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3280 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3281 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3282
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3283 # Now set the variables for building old libraries.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3284 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3285 oldlibs="$oldlibs $output_objdir/$libname.$libext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3286
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3287 # Transform .lo files to .o files.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3288 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3289 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3290
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3291 # Eliminate all temporary directories.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3292 for path in $notinst_path; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3293 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3294 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3295 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3296 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3297
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3298 if test -n "$xrpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3299 # If the user specified any rpath flags, then add them.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3300 temp_xrpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3301 for libdir in $xrpath; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3302 temp_xrpath="$temp_xrpath -R$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3303 case "$finalize_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3304 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3305 *) finalize_rpath="$finalize_rpath $libdir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3306 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3307 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3308 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3309 dependency_libs="$temp_xrpath $dependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3310 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3311 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3312
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3313 # Make sure dlfiles contains only unique files that won't be dlpreopened
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3314 old_dlfiles="$dlfiles"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3315 dlfiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3316 for lib in $old_dlfiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3317 case " $dlprefiles $dlfiles " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3318 *" $lib "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3319 *) dlfiles="$dlfiles $lib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3320 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3321 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3322
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3323 # Make sure dlprefiles contains only unique files
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3324 old_dlprefiles="$dlprefiles"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3325 dlprefiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3326 for lib in $old_dlprefiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3327 case "$dlprefiles " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3328 *" $lib "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3329 *) dlprefiles="$dlprefiles $lib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3330 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3331 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3332
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3333 if test "$build_libtool_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3334 if test -n "$rpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3335 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3336 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3337 # these systems don't actually have a c library (as such)!
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3338 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3339 *-*-rhapsody* | *-*-darwin1.[012])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3340 # Rhapsody C library is in the System framework
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3341 deplibs="$deplibs -framework System"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3342 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3343 *-*-netbsd*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3344 # Don't link with libc until the a.out ld.so is fixed.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3345 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3346 *-*-openbsd* | *-*-freebsd*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3347 # Do not include libc due to us having libc/libc_r.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3348 test "X$arg" = "X-lc" && continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3349 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3350 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3351 # Add libc to deplibs on all other systems if necessary.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3352 if test "$build_libtool_need_lc" = "yes"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3353 deplibs="$deplibs -lc"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3354 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3355 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3356 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3357 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3358
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3359 # Transform deplibs into only deplibs that can be linked in shared.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3360 name_save=$name
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3361 libname_save=$libname
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3362 release_save=$release
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3363 versuffix_save=$versuffix
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3364 major_save=$major
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3365 # I'm not sure if I'm treating the release correctly. I think
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3366 # release should show up in the -l (ie -lgmp5) so we don't want to
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3367 # add it in twice. Is that correct?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3368 release=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3369 versuffix=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3370 major=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3371 newdeplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3372 droppeddeps=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3373 case $deplibs_check_method in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3374 pass_all)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3375 # Don't check for shared/static. Everything works.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3376 # This might be a little naive. We might want to check
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3377 # whether the library exists or not. But this is on
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3378 # osf3 & osf4 and I'm not really sure... Just
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3379 # implementing what was already the behavior.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3380 newdeplibs=$deplibs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3381 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3382 test_compile)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3383 # This code stresses the "libraries are programs" paradigm to its
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3384 # limits. Maybe even breaks it. We compile a program, linking it
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3385 # against the deplibs as a proxy for the library. Then we can check
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3386 # whether they linked in statically or dynamically with ldd.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3387 $rm conftest.c
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3388 cat > conftest.c <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3389 int main() { return 0; }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3390 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3391 $rm conftest
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3392 $LTCC -o conftest conftest.c $deplibs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3393 if test "$?" -eq 0 ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3394 ldd_output=`ldd conftest`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3395 for i in $deplibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3396 name="`expr $i : '-l\(.*\)'`"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3397 # If $name is empty we are operating on a -L argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3398 if test "$name" != "" && test "$name" -ne "0"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3399 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3400 case " $predeps $postdeps " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3401 *" $i "*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3402 newdeplibs="$newdeplibs $i"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3403 i=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3404 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3405 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3406 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3407 if test -n "$i" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3408 libname=`eval \\$echo \"$libname_spec\"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3409 deplib_matches=`eval \\$echo \"$library_names_spec\"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3410 set dummy $deplib_matches
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3411 deplib_match=$2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3412 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3413 newdeplibs="$newdeplibs $i"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3414 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3415 droppeddeps=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3416 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3417 $echo "*** Warning: dynamic linker does not accept needed library $i."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3418 $echo "*** I have the capability to make that library automatically link in when"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3419 $echo "*** you link to this library. But I can only do this if you have a"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3420 $echo "*** shared version of the library, which I believe you do not have"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3421 $echo "*** because a test_compile did reveal that the linker did not use it for"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3422 $echo "*** its dynamic dependency list that programs get resolved with at runtime."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3423 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3424 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3425 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3426 newdeplibs="$newdeplibs $i"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3427 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3428 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3429 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3430 # Error occurred in the first compile. Let's try to salvage
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3431 # the situation: Compile a separate program for each library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3432 for i in $deplibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3433 name="`expr $i : '-l\(.*\)'`"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3434 # If $name is empty we are operating on a -L argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3435 if test "$name" != "" && test "$name" != "0"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3436 $rm conftest
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3437 $LTCC -o conftest conftest.c $i
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3438 # Did it work?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3439 if test "$?" -eq 0 ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3440 ldd_output=`ldd conftest`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3441 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3442 case " $predeps $postdeps " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3443 *" $i "*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3444 newdeplibs="$newdeplibs $i"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3445 i=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3446 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3447 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3448 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3449 if test -n "$i" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3450 libname=`eval \\$echo \"$libname_spec\"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3451 deplib_matches=`eval \\$echo \"$library_names_spec\"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3452 set dummy $deplib_matches
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3453 deplib_match=$2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3454 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3455 newdeplibs="$newdeplibs $i"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3456 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3457 droppeddeps=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3458 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3459 $echo "*** Warning: dynamic linker does not accept needed library $i."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3460 $echo "*** I have the capability to make that library automatically link in when"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3461 $echo "*** you link to this library. But I can only do this if you have a"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3462 $echo "*** shared version of the library, which you do not appear to have"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3463 $echo "*** because a test_compile did reveal that the linker did not use this one"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3464 $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3465 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3466 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3467 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3468 droppeddeps=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3469 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3470 $echo "*** Warning! Library $i is needed by this library but I was not able to"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3471 $echo "*** make it link in! You will probably need to install it or some"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3472 $echo "*** library that it depends on before this library will be fully"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3473 $echo "*** functional. Installing it before continuing would be even better."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3474 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3475 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3476 newdeplibs="$newdeplibs $i"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3477 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3478 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3479 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3480 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3481 file_magic*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3482 set dummy $deplibs_check_method
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3483 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3484 for a_deplib in $deplibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3485 name="`expr $a_deplib : '-l\(.*\)'`"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3486 # If $name is empty we are operating on a -L argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3487 if test "$name" != "" && test "$name" != "0"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3488 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3489 case " $predeps $postdeps " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3490 *" $a_deplib "*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3491 newdeplibs="$newdeplibs $a_deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3492 a_deplib=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3493 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3494 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3495 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3496 if test -n "$a_deplib" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3497 libname=`eval \\$echo \"$libname_spec\"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3498 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3499 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3500 for potent_lib in $potential_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3501 # Follow soft links.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3502 if ls -lLd "$potent_lib" 2>/dev/null \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3503 | grep " -> " >/dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3504 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3505 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3506 # The statement above tries to avoid entering an
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3507 # endless loop below, in case of cyclic links.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3508 # We might still enter an endless loop, since a link
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3509 # loop can be closed while we follow links,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3510 # but so what?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3511 potlib="$potent_lib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3512 while test -h "$potlib" 2>/dev/null; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3513 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3514 case $potliblink in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3515 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3516 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3517 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3518 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3519 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3520 | ${SED} 10q \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3521 | $EGREP "$file_magic_regex" > /dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3522 newdeplibs="$newdeplibs $a_deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3523 a_deplib=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3524 break 2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3525 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3526 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3527 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3528 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3529 if test -n "$a_deplib" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3530 droppeddeps=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3531 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3532 $echo "*** Warning: linker path does not have real file for library $a_deplib."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3533 $echo "*** I have the capability to make that library automatically link in when"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3534 $echo "*** you link to this library. But I can only do this if you have a"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3535 $echo "*** shared version of the library, which you do not appear to have"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3536 $echo "*** because I did check the linker path looking for a file starting"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3537 if test -z "$potlib" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3538 $echo "*** with $libname but no candidates were found. (...for file magic test)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3539 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3540 $echo "*** with $libname and none of the candidates passed a file format test"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3541 $echo "*** using a file magic. Last file checked: $potlib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3542 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3543 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3544 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3545 # Add a -L argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3546 newdeplibs="$newdeplibs $a_deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3547 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3548 done # Gone through all deplibs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3549 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3550 match_pattern*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3551 set dummy $deplibs_check_method
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3552 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3553 for a_deplib in $deplibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3554 name="`expr $a_deplib : '-l\(.*\)'`"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3555 # If $name is empty we are operating on a -L argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3556 if test -n "$name" && test "$name" != "0"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3557 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3558 case " $predeps $postdeps " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3559 *" $a_deplib "*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3560 newdeplibs="$newdeplibs $a_deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3561 a_deplib=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3562 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3563 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3564 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3565 if test -n "$a_deplib" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3566 libname=`eval \\$echo \"$libname_spec\"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3567 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3568 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3569 for potent_lib in $potential_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3570 potlib="$potent_lib" # see symlink-check above in file_magic test
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3571 if eval $echo \"$potent_lib\" 2>/dev/null \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3572 | ${SED} 10q \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3573 | $EGREP "$match_pattern_regex" > /dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3574 newdeplibs="$newdeplibs $a_deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3575 a_deplib=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3576 break 2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3577 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3578 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3579 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3580 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3581 if test -n "$a_deplib" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3582 droppeddeps=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3583 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3584 $echo "*** Warning: linker path does not have real file for library $a_deplib."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3585 $echo "*** I have the capability to make that library automatically link in when"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3586 $echo "*** you link to this library. But I can only do this if you have a"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3587 $echo "*** shared version of the library, which you do not appear to have"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3588 $echo "*** because I did check the linker path looking for a file starting"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3589 if test -z "$potlib" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3590 $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3591 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3592 $echo "*** with $libname and none of the candidates passed a file format test"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3593 $echo "*** using a regex pattern. Last file checked: $potlib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3594 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3595 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3596 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3597 # Add a -L argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3598 newdeplibs="$newdeplibs $a_deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3599 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3600 done # Gone through all deplibs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3601 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3602 none | unknown | *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3603 newdeplibs=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3604 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3605 -e 's/ -[LR][^ ]*//g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3606 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3607 for i in $predeps $postdeps ; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3608 # can't use Xsed below, because $i might contain '/'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3609 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3610 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3611 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3612 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3613 | grep . >/dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3614 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3615 if test "X$deplibs_check_method" = "Xnone"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3616 $echo "*** Warning: inter-library dependencies are not supported in this platform."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3617 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3618 $echo "*** Warning: inter-library dependencies are not known to be supported."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3619 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3620 $echo "*** All declared inter-library dependencies are being dropped."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3621 droppeddeps=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3622 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3623 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3624 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3625 versuffix=$versuffix_save
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3626 major=$major_save
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3627 release=$release_save
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3628 libname=$libname_save
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3629 name=$name_save
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3630
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3631 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3632 *-*-rhapsody* | *-*-darwin1.[012])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3633 # On Rhapsody replace the C library is the System framework
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3634 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3635 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3636 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3637
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3638 if test "$droppeddeps" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3639 if test "$module" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3640 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3641 $echo "*** Warning: libtool could not satisfy all declared inter-library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3642 $echo "*** dependencies of module $libname. Therefore, libtool will create"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3643 $echo "*** a static module, that should work as long as the dlopening"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3644 $echo "*** application is linked with the -dlopen flag."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3645 if test -z "$global_symbol_pipe"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3646 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3647 $echo "*** However, this would only work if libtool was able to extract symbol"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3648 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3649 $echo "*** not find such a program. So, this module is probably useless."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3650 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3651 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3652 if test "$build_old_libs" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3653 oldlibs="$output_objdir/$libname.$libext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3654 build_libtool_libs=module
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3655 build_old_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3656 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3657 build_libtool_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3658 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3659 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3660 $echo "*** The inter-library dependencies that have been dropped here will be"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3661 $echo "*** automatically added whenever a program is linked with this library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3662 $echo "*** or is declared to -dlopen it."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3663
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3664 if test "$allow_undefined" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3665 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3666 $echo "*** Since this library must not contain undefined symbols,"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3667 $echo "*** because either the platform does not support them or"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3668 $echo "*** it was explicitly requested with -no-undefined,"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3669 $echo "*** libtool will only create a static version of it."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3670 if test "$build_old_libs" = no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3671 oldlibs="$output_objdir/$libname.$libext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3672 build_libtool_libs=module
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3673 build_old_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3674 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3675 build_libtool_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3676 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3677 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3678 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3679 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3680 # Done checking deplibs!
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3681 deplibs=$newdeplibs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3682 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3683
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3684 # All the library-specific variables (install_libdir is set above).
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3685 library_names=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3686 old_library=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3687 dlname=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3688
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3689 # Test again, we may have decided not to build it any more
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3690 if test "$build_libtool_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3691 if test "$hardcode_into_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3692 # Hardcode the library paths
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3693 hardcode_libdirs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3694 dep_rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3695 rpath="$finalize_rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3696 test "$mode" != relink && rpath="$compile_rpath$rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3697 for libdir in $rpath; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3698 if test -n "$hardcode_libdir_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3699 if test -n "$hardcode_libdir_separator"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3700 if test -z "$hardcode_libdirs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3701 hardcode_libdirs="$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3702 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3703 # Just accumulate the unique libdirs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3704 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3705 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3706 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3707 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3708 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3709 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3710 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3711 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3712 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3713 eval flag=\"$hardcode_libdir_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3714 dep_rpath="$dep_rpath $flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3715 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3716 elif test -n "$runpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3717 case "$perm_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3718 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3719 *) perm_rpath="$perm_rpath $libdir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3720 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3721 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3722 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3723 # Substitute the hardcoded libdirs into the rpath.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3724 if test -n "$hardcode_libdir_separator" &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3725 test -n "$hardcode_libdirs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3726 libdir="$hardcode_libdirs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3727 if test -n "$hardcode_libdir_flag_spec_ld"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3728 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3729 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3730 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3731 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3732 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3733 if test -n "$runpath_var" && test -n "$perm_rpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3734 # We should set the runpath_var.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3735 rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3736 for dir in $perm_rpath; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3737 rpath="$rpath$dir:"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3738 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3739 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3740 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3741 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3742 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3743
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3744 shlibpath="$finalize_shlibpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3745 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3746 if test -n "$shlibpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3747 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3748 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3749
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3750 # Get the real and link names of the library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3751 eval shared_ext=\"$shrext_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3752 eval library_names=\"$library_names_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3753 set dummy $library_names
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3754 realname="$2"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3755 shift; shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3756
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3757 if test -n "$soname_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3758 eval soname=\"$soname_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3759 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3760 soname="$realname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3761 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3762 if test -z "$dlname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3763 dlname=$soname
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3764 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3765
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3766 lib="$output_objdir/$realname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3767 for link
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3768 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3769 linknames="$linknames $link"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3770 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3771
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3772 # Use standard objects if they are pic
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3773 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3774
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3775 # Prepare the list of exported symbols
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3776 if test -z "$export_symbols"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3777 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3778 $show "generating symbol list for \`$libname.la'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3779 export_symbols="$output_objdir/$libname.exp"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3780 $run $rm $export_symbols
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3781 cmds=$export_symbols_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3782 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3783 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3784 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3785 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3786 if len=`expr "X$cmd" : ".*"` &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3787 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3788 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3789 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3790 skipped_export=false
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3791 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3792 # The command line is too long to execute in one step.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3793 $show "using reloadable object file for export list..."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3794 skipped_export=:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3795 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3796 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3797 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3798 if test -n "$export_symbols_regex"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3799 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3800 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3801 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3802 $run eval '$mv "${export_symbols}T" "$export_symbols"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3803 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3804 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3805 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3806
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3807 if test -n "$export_symbols" && test -n "$include_expsyms"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3808 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3809 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3810
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3811 tmp_deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3812 for test_deplib in $deplibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3813 case " $convenience " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3814 *" $test_deplib "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3815 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3816 tmp_deplibs="$tmp_deplibs $test_deplib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3817 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3818 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3819 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3820 deplibs="$tmp_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3821
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3822 if test -n "$convenience"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3823 if test -n "$whole_archive_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3824 save_libobjs=$libobjs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3825 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3826 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3827 gentop="$output_objdir/${outputname}x"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3828 generated="$generated $gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3829
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3830 func_extract_archives $gentop $convenience
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3831 libobjs="$libobjs $func_extract_archives_result"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3832 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3833 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3834
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3835 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3836 eval flag=\"$thread_safe_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3837 linker_flags="$linker_flags $flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3838 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3839
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3840 # Make a backup of the uninstalled library when relinking
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3841 if test "$mode" = relink; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3842 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3843 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3844
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3845 # Do each of the archive commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3846 if test "$module" = yes && test -n "$module_cmds" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3847 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3848 eval test_cmds=\"$module_expsym_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3849 cmds=$module_expsym_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3850 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3851 eval test_cmds=\"$module_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3852 cmds=$module_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3853 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3854 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3855 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3856 eval test_cmds=\"$archive_expsym_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3857 cmds=$archive_expsym_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3858 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3859 eval test_cmds=\"$archive_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3860 cmds=$archive_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3861 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3862 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3863
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3864 if test "X$skipped_export" != "X:" && len=`expr "X$test_cmds" : ".*"` &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3865 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3866 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3867 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3868 # The command line is too long to link in one step, link piecewise.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3869 $echo "creating reloadable object files..."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3870
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3871 # Save the value of $output and $libobjs because we want to
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3872 # use them later. If we have whole_archive_flag_spec, we
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3873 # want to use save_libobjs as it was before
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3874 # whole_archive_flag_spec was expanded, because we can't
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3875 # assume the linker understands whole_archive_flag_spec.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3876 # This may have to be revisited, in case too many
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3877 # convenience libraries get linked in and end up exceeding
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3878 # the spec.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3879 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3880 save_libobjs=$libobjs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3881 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3882 save_output=$output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3883
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3884 # Clear the reloadable object creation command queue and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3885 # initialize k to one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3886 test_cmds=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3887 concat_cmds=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3888 objlist=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3889 delfiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3890 last_robj=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3891 k=1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3892 output=$output_objdir/$save_output-${k}.$objext
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3893 # Loop over the list of objects to be linked.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3894 for obj in $save_libobjs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3895 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3896 eval test_cmds=\"$reload_cmds $objlist $last_robj\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3897 if test "X$objlist" = X ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3898 { len=`expr "X$test_cmds" : ".*"` &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3899 test "$len" -le "$max_cmd_len"; }; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3900 objlist="$objlist $obj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3901 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3902 # The command $test_cmds is almost too long, add a
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3903 # command to the queue.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3904 if test "$k" -eq 1 ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3905 # The first file doesn't have a previous command to add.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3906 eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3907 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3908 # All subsequent reloadable object files will link in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3909 # the last one created.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3910 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3911 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3912 last_robj=$output_objdir/$save_output-${k}.$objext
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3913 k=`expr $k + 1`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3914 output=$output_objdir/$save_output-${k}.$objext
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3915 objlist=$obj
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3916 len=1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3917 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3918 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3919 # Handle the remaining objects by creating one last
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3920 # reloadable object file. All subsequent reloadable object
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3921 # files will link in the last one created.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3922 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3923 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3924
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3925 if ${skipped_export-false}; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3926 $show "generating symbol list for \`$libname.la'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3927 export_symbols="$output_objdir/$libname.exp"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3928 $run $rm $export_symbols
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3929 libobjs=$output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3930 # Append the command to create the export file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3931 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3932 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3933
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3934 # Set up a command to remove the reloadale object files
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3935 # after they are used.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3936 i=0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3937 while test "$i" -lt "$k"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3938 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3939 i=`expr $i + 1`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3940 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3941 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3942
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3943 $echo "creating a temporary reloadable object file: $output"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3944
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3945 # Loop through the commands generated above and execute them.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3946 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3947 for cmd in $concat_cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3948 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3949 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3950 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3951 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3952 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3953
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3954 libobjs=$output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3955 # Restore the value of output.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3956 output=$save_output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3957
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3958 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3959 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3960 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3961 # Expand the library linking commands again to reset the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3962 # value of $libobjs for piecewise linking.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3963
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3964 # Do each of the archive commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3965 if test "$module" = yes && test -n "$module_cmds" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3966 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3967 cmds=$module_expsym_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3968 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3969 cmds=$module_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3970 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3971 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3972 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3973 cmds=$archive_expsym_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3974 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3975 cmds=$archive_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3976 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3977 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3978
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3979 # Append the command to remove the reloadable object files
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3980 # to the just-reset $cmds.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3981 eval cmds=\"\$cmds~\$rm $delfiles\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3982 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3983 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3984 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3985 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3986 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3987 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3988 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3989 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3990 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3991
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3992 # Restore the uninstalled library and exit
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3993 if test "$mode" = relink; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3994 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3995 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3996 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3997
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3998 # Create links to the real library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
3999 for linkname in $linknames; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4000 if test "$realname" != "$linkname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4001 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4002 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4003 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4004 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4005
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4006 # If -module or -export-dynamic was specified, set the dlname.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4007 if test "$module" = yes || test "$export_dynamic" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4008 # On all known operating systems, these are identical.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4009 dlname="$soname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4010 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4011 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4012 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4013
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4014 obj)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4015 if test -n "$deplibs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4016 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4017 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4018
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4019 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4020 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4021 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4022
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4023 if test -n "$rpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4024 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4025 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4026
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4027 if test -n "$xrpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4028 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4029 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4030
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4031 if test -n "$vinfo"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4032 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4033 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4034
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4035 if test -n "$release"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4036 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4037 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4038
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4039 case $output in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4040 *.lo)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4041 if test -n "$objs$old_deplibs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4042 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4043 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4044 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4045 libobj="$output"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4046 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4047 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4048 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4049 libobj=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4050 obj="$output"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4051 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4052 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4053
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4054 # Delete the old objects.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4055 $run $rm $obj $libobj
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4056
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4057 # Objects from convenience libraries. This assumes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4058 # single-version convenience libraries. Whenever we create
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4059 # different ones for PIC/non-PIC, this we'll have to duplicate
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4060 # the extraction.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4061 reload_conv_objs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4062 gentop=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4063 # reload_cmds runs $LD directly, so let us get rid of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4064 # -Wl from whole_archive_flag_spec
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4065 wl=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4066
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4067 if test -n "$convenience"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4068 if test -n "$whole_archive_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4069 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4070 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4071 gentop="$output_objdir/${obj}x"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4072 generated="$generated $gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4073
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4074 func_extract_archives $gentop $convenience
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4075 reload_conv_objs="$reload_objs $func_extract_archives_result"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4076 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4077 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4078
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4079 # Create the old-style object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4080 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
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4081
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4082 output="$obj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4083 cmds=$reload_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4084 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4085 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4086 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4087 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4088 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4089 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4090 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4091 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4092
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4093 # Exit if we aren't doing a library object file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4094 if test -z "$libobj"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4095 if test -n "$gentop"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4096 $show "${rm}r $gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4097 $run ${rm}r $gentop
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4098 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4099
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4100 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4101 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4102
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4103 if test "$build_libtool_libs" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4104 if test -n "$gentop"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4105 $show "${rm}r $gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4106 $run ${rm}r $gentop
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4107 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4108
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4109 # Create an invalid libtool object if no PIC, so that we don't
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4110 # accidentally link it into a program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4111 # $show "echo timestamp > $libobj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4112 # $run eval "echo timestamp > $libobj" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4113 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4114 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4115
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4116 if test -n "$pic_flag" || test "$pic_mode" != default; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4117 # Only do commands if we really have different PIC objects.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4118 reload_objs="$libobjs $reload_conv_objs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4119 output="$libobj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4120 cmds=$reload_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4121 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4122 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4123 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4124 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4125 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4126 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4127 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4128 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4129 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4130
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4131 if test -n "$gentop"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4132 $show "${rm}r $gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4133 $run ${rm}r $gentop
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4134 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4135
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4136 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4137 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4138
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4139 prog)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4140 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4141 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4142 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4143 if test -n "$vinfo"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4144 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4145 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4146
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4147 if test -n "$release"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4148 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4149 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4150
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4151 if test "$preload" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4152 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4153 test "$dlopen_self_static" = unknown; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4154 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4155 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4156 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4157
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4158 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4159 *-*-rhapsody* | *-*-darwin1.[012])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4160 # On Rhapsody replace the C library is the System framework
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4161 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4162 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4163 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4164 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4165
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4166 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4167 *darwin*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4168 # Don't allow lazy linking, it breaks C++ global constructors
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4169 if test "$tagname" = CXX ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4170 compile_command="$compile_command ${wl}-bind_at_load"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4171 finalize_command="$finalize_command ${wl}-bind_at_load"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4172 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4173 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4174 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4175
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4176 compile_command="$compile_command $compile_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4177 finalize_command="$finalize_command $finalize_deplibs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4178
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4179 if test -n "$rpath$xrpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4180 # If the user specified any rpath flags, then add them.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4181 for libdir in $rpath $xrpath; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4182 # This is the magic to use -rpath.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4183 case "$finalize_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4184 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4185 *) finalize_rpath="$finalize_rpath $libdir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4186 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4187 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4188 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4189
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4190 # Now hardcode the library paths
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4191 rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4192 hardcode_libdirs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4193 for libdir in $compile_rpath $finalize_rpath; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4194 if test -n "$hardcode_libdir_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4195 if test -n "$hardcode_libdir_separator"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4196 if test -z "$hardcode_libdirs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4197 hardcode_libdirs="$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4198 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4199 # Just accumulate the unique libdirs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4200 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4201 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4202 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4203 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4204 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4205 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4206 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4207 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4208 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4209 eval flag=\"$hardcode_libdir_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4210 rpath="$rpath $flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4211 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4212 elif test -n "$runpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4213 case "$perm_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4214 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4215 *) perm_rpath="$perm_rpath $libdir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4216 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4217 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4218 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4219 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4220 case :$dllsearchpath: in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4221 *":$libdir:"*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4222 *) dllsearchpath="$dllsearchpath:$libdir";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4223 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4224 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4225 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4226 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4227 # Substitute the hardcoded libdirs into the rpath.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4228 if test -n "$hardcode_libdir_separator" &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4229 test -n "$hardcode_libdirs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4230 libdir="$hardcode_libdirs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4231 eval rpath=\" $hardcode_libdir_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4232 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4233 compile_rpath="$rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4234
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4235 rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4236 hardcode_libdirs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4237 for libdir in $finalize_rpath; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4238 if test -n "$hardcode_libdir_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4239 if test -n "$hardcode_libdir_separator"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4240 if test -z "$hardcode_libdirs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4241 hardcode_libdirs="$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4242 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4243 # Just accumulate the unique libdirs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4244 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4245 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4246 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4247 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4248 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4249 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4250 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4251 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4252 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4253 eval flag=\"$hardcode_libdir_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4254 rpath="$rpath $flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4255 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4256 elif test -n "$runpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4257 case "$finalize_perm_rpath " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4258 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4259 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4260 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4261 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4262 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4263 # Substitute the hardcoded libdirs into the rpath.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4264 if test -n "$hardcode_libdir_separator" &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4265 test -n "$hardcode_libdirs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4266 libdir="$hardcode_libdirs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4267 eval rpath=\" $hardcode_libdir_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4268 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4269 finalize_rpath="$rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4270
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4271 if test -n "$libobjs" && test "$build_old_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4272 # Transform all the library objects into standard objects.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4273 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4274 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4275 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4276
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4277 dlsyms=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4278 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4279 if test -n "$NM" && test -n "$global_symbol_pipe"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4280 dlsyms="${outputname}S.c"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4281 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4282 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4283 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4284 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4285
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4286 if test -n "$dlsyms"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4287 case $dlsyms in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4288 "") ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4289 *.c)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4290 # Discover the nlist of each of the dlfiles.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4291 nlist="$output_objdir/${outputname}.nm"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4292
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4293 $show "$rm $nlist ${nlist}S ${nlist}T"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4294 $run $rm "$nlist" "${nlist}S" "${nlist}T"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4295
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4296 # Parse the name list into a source file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4297 $show "creating $output_objdir/$dlsyms"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4298
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4299 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4300 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4301 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4302
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4303 #ifdef __cplusplus
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4304 extern \"C\" {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4305 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4306
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4307 /* Prevent the only kind of declaration conflicts we can make. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4308 #define lt_preloaded_symbols some_other_symbol
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4309
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4310 /* External symbol declarations for the compiler. */\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4311 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4312
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4313 if test "$dlself" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4314 $show "generating symbol list for \`$output'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4315
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4316 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4317
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4318 # Add our own program objects to the symbol list.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4319 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4320 for arg in $progfiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4321 $show "extracting global C symbols from \`$arg'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4322 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4323 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4324
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4325 if test -n "$exclude_expsyms"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4326 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4327 $run eval '$mv "$nlist"T "$nlist"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4328 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4329
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4330 if test -n "$export_symbols_regex"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4331 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4332 $run eval '$mv "$nlist"T "$nlist"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4333 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4334
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4335 # Prepare the list of exported symbols
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4336 if test -z "$export_symbols"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4337 export_symbols="$output_objdir/$output.exp"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4338 $run $rm $export_symbols
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4339 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4340 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4341 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4342 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4343 $run eval 'mv "$nlist"T "$nlist"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4344 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4345 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4346
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4347 for arg in $dlprefiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4348 $show "extracting global C symbols from \`$arg'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4349 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4350 $run eval '$echo ": $name " >> "$nlist"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4351 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4352 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4353
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4354 if test -z "$run"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4355 # Make sure we have at least an empty file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4356 test -f "$nlist" || : > "$nlist"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4357
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4358 if test -n "$exclude_expsyms"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4359 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4360 $mv "$nlist"T "$nlist"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4361 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4362
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4363 # Try sorting and uniquifying the output.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4364 if grep -v "^: " < "$nlist" |
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4365 if sort -k 3 </dev/null >/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4366 sort -k 3
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4367 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4368 sort +2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4369 fi |
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4370 uniq > "$nlist"S; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4371 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4372 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4373 grep -v "^: " < "$nlist" > "$nlist"S
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4374 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4375
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4376 if test -f "$nlist"S; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4377 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4378 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4379 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4380 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4381
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4382 $echo >> "$output_objdir/$dlsyms" "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4383
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4384 #undef lt_preloaded_symbols
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4385
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4386 #if defined (__STDC__) && __STDC__
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4387 # define lt_ptr void *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4388 #else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4389 # define lt_ptr char *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4390 # define const
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4391 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4392
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4393 /* The mapping between symbol names and symbols. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4394 const struct {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4395 const char *name;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4396 lt_ptr address;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4397 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4398 lt_preloaded_symbols[] =
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4399 {\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4400 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4401
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4402 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4403
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4404 $echo >> "$output_objdir/$dlsyms" "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4405 {0, (lt_ptr) 0}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4406 };
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4407
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4408 /* This works around a problem in FreeBSD linker */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4409 #ifdef FREEBSD_WORKAROUND
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4410 static const void *lt_preloaded_setup() {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4411 return lt_preloaded_symbols;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4412 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4413 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4414
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4415 #ifdef __cplusplus
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4416 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4417 #endif\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4418 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4419 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4420
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4421 pic_flag_for_symtable=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4422 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4423 # compiling the symbol table file with pic_flag works around
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4424 # a FreeBSD bug that causes programs to crash when -lm is
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4425 # linked before any other PIC object. But we must not use
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4426 # pic_flag when linking with -static. The problem exists in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4427 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4428 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4429 case "$compile_command " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4430 *" -static "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4431 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4432 esac;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4433 *-*-hpux*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4434 case "$compile_command " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4435 *" -static "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4436 *) pic_flag_for_symtable=" $pic_flag";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4437 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4438 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4439
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4440 # Now compile the dynamic symbol file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4441 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4442 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4443
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4444 # Clean up the generated files.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4445 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4446 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4447
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4448 # Transform the symbol file into the correct name.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4449 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4450 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4451 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4452 *-*-freebsd*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4453 # FreeBSD doesn't need this...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4454 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4455 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4456 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4457 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4458 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4459 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4460 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4461 # We keep going just in case the user didn't refer to
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4462 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4463 # really was required.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4464
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4465 # Nullify the symbol file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4466 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4467 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4468 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4469
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4470 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4471 # Replace the output file specification.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4472 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4473 link_command="$compile_command$compile_rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4474
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4475 # We have no uninstalled library dependencies, so finalize right now.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4476 $show "$link_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4477 $run eval "$link_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4478 status=$?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4479
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4480 # Delete the generated files.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4481 if test -n "$dlsyms"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4482 $show "$rm $output_objdir/${outputname}S.${objext}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4483 $run $rm "$output_objdir/${outputname}S.${objext}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4484 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4485
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4486 exit $status
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4487 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4488
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4489 if test -n "$shlibpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4490 # We should set the shlibpath_var
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4491 rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4492 for dir in $temp_rpath; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4493 case $dir in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4494 [\\/]* | [A-Za-z]:[\\/]*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4495 # Absolute path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4496 rpath="$rpath$dir:"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4497 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4498 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4499 # Relative path: add a thisdir entry.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4500 rpath="$rpath\$thisdir/$dir:"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4501 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4502 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4503 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4504 temp_rpath="$rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4505 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4506
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4507 if test -n "$compile_shlibpath$finalize_shlibpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4508 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4509 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4510 if test -n "$finalize_shlibpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4511 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4512 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4513
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4514 compile_var=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4515 finalize_var=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4516 if test -n "$runpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4517 if test -n "$perm_rpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4518 # We should set the runpath_var.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4519 rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4520 for dir in $perm_rpath; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4521 rpath="$rpath$dir:"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4522 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4523 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4524 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4525 if test -n "$finalize_perm_rpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4526 # We should set the runpath_var.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4527 rpath=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4528 for dir in $finalize_perm_rpath; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4529 rpath="$rpath$dir:"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4530 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4531 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4532 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4533 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4534
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4535 if test "$no_install" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4536 # We don't need to create a wrapper script.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4537 link_command="$compile_var$compile_command$compile_rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4538 # Replace the output file specification.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4539 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4540 # Delete the old output file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4541 $run $rm $output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4542 # Link the executable and exit
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4543 $show "$link_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4544 $run eval "$link_command" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4545 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4546 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4547
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4548 if test "$hardcode_action" = relink; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4549 # Fast installation is not supported
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4550 link_command="$compile_var$compile_command$compile_rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4551 relink_command="$finalize_var$finalize_command$finalize_rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4552
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4553 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4554 $echo "$modename: \`$output' will be relinked during installation" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4555 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4556 if test "$fast_install" != no; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4557 link_command="$finalize_var$compile_command$finalize_rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4558 if test "$fast_install" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4559 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4560 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4561 # fast_install is set to needless
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4562 relink_command=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4563 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4564 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4565 link_command="$compile_var$compile_command$compile_rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4566 relink_command="$finalize_var$finalize_command$finalize_rpath"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4567 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4568 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4569
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4570 # Replace the output file specification.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4571 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4572
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4573 # Delete the old output files.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4574 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4575
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4576 $show "$link_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4577 $run eval "$link_command" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4578
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4579 # Now create the wrapper script.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4580 $show "creating $output"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4581
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4582 # Quote the relink command for shipping.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4583 if test -n "$relink_command"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4584 # Preserve any variables that may affect compiler behavior
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4585 for var in $variables_saved_for_relink; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4586 if eval test -z \"\${$var+set}\"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4587 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4588 elif eval var_value=\$$var; test -z "$var_value"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4589 relink_command="$var=; export $var; $relink_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4590 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4591 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4592 relink_command="$var=\"$var_value\"; export $var; $relink_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4593 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4594 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4595 relink_command="(cd `pwd`; $relink_command)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4596 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4597 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4598
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4599 # Quote $echo for shipping.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4600 if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4601 case $progpath in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4602 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4603 *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4604 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4605 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4606 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4607 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4608 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4609
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4610 # Only actually do things if our run command is non-null.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4611 if test -z "$run"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4612 # win32 will think the script is a binary if it has
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4613 # a .exe suffix, so we strip it off here.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4614 case $output in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4615 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4616 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4617 # test for cygwin because mv fails w/o .exe extensions
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4618 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4619 *cygwin*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4620 exeext=.exe
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4621 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4622 *) exeext= ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4623 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4624 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4625 *cygwin* | *mingw* )
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4626 cwrappersource=`$echo ${objdir}/lt-${output}.c`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4627 cwrapper=`$echo ${output}.exe`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4628 $rm $cwrappersource $cwrapper
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4629 trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4630
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4631 cat > $cwrappersource <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4632
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4633 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4634 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4635
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4636 The $output program cannot be directly executed until all the libtool
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4637 libraries that it depends on are installed.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4638
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4639 This wrapper executable should never be moved out of the build directory.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4640 If it is, it will not operate correctly.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4641
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4642 Currently, it simply execs the wrapper *script* "/bin/sh $output",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4643 but could eventually absorb all of the scripts functionality and
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4644 exec $objdir/$outputname directly.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4645 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4646 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4647 cat >> $cwrappersource<<"EOF"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4648 #include <stdio.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4649 #include <stdlib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4650 #include <unistd.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4651 #include <malloc.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4652 #include <stdarg.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4653 #include <assert.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4654
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4655 #if defined(PATH_MAX)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4656 # define LT_PATHMAX PATH_MAX
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4657 #elif defined(MAXPATHLEN)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4658 # define LT_PATHMAX MAXPATHLEN
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4659 #else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4660 # define LT_PATHMAX 1024
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4661 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4662
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4663 #ifndef DIR_SEPARATOR
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4664 #define DIR_SEPARATOR '/'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4665 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4666
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4667 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4668 defined (__OS2__)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4669 #define HAVE_DOS_BASED_FILE_SYSTEM
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4670 #ifndef DIR_SEPARATOR_2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4671 #define DIR_SEPARATOR_2 '\\'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4672 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4673 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4674
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4675 #ifndef DIR_SEPARATOR_2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4676 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4677 #else /* DIR_SEPARATOR_2 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4678 # define IS_DIR_SEPARATOR(ch) \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4679 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4680 #endif /* DIR_SEPARATOR_2 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4681
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4682 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4683 #define XFREE(stale) do { \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4684 if (stale) { free ((void *) stale); stale = 0; } \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4685 } while (0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4686
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4687 const char *program_name = NULL;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4688
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4689 void * xmalloc (size_t num);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4690 char * xstrdup (const char *string);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4691 char * basename (const char *name);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4692 char * fnqualify(const char *path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4693 char * strendzap(char *str, const char *pat);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4694 void lt_fatal (const char *message, ...);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4695
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4696 int
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4697 main (int argc, char *argv[])
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4698 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4699 char **newargz;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4700 int i;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4701
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4702 program_name = (char *) xstrdup ((char *) basename (argv[0]));
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4703 newargz = XMALLOC(char *, argc+2);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4704 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4705
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4706 cat >> $cwrappersource <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4707 newargz[0] = "$SHELL";
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4708 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4709
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4710 cat >> $cwrappersource <<"EOF"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4711 newargz[1] = fnqualify(argv[0]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4712 /* we know the script has the same name, without the .exe */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4713 /* so make sure newargz[1] doesn't end in .exe */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4714 strendzap(newargz[1],".exe");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4715 for (i = 1; i < argc; i++)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4716 newargz[i+1] = xstrdup(argv[i]);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4717 newargz[argc+1] = NULL;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4718 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4719
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4720 cat >> $cwrappersource <<EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4721 execv("$SHELL",newargz);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4722 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4723
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4724 cat >> $cwrappersource <<"EOF"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4725 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4726
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4727 void *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4728 xmalloc (size_t num)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4729 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4730 void * p = (void *) malloc (num);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4731 if (!p)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4732 lt_fatal ("Memory exhausted");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4733
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4734 return p;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4735 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4736
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4737 char *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4738 xstrdup (const char *string)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4739 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4740 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4741 ;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4742 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4743
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4744 char *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4745 basename (const char *name)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4746 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4747 const char *base;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4748
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4749 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4750 /* Skip over the disk name in MSDOS pathnames. */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4751 if (isalpha (name[0]) && name[1] == ':')
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4752 name += 2;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4753 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4754
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4755 for (base = name; *name; name++)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4756 if (IS_DIR_SEPARATOR (*name))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4757 base = name + 1;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4758 return (char *) base;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4759 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4760
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4761 char *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4762 fnqualify(const char *path)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4763 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4764 size_t size;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4765 char *p;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4766 char tmp[LT_PATHMAX + 1];
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4767
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4768 assert(path != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4769
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4770 /* Is it qualified already? */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4771 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4772 if (isalpha (path[0]) && path[1] == ':')
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4773 return xstrdup (path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4774 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4775 if (IS_DIR_SEPARATOR (path[0]))
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4776 return xstrdup (path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4777
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4778 /* prepend the current directory */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4779 /* doesn't handle '~' */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4780 if (getcwd (tmp, LT_PATHMAX) == NULL)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4781 lt_fatal ("getcwd failed");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4782 size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4783 p = XMALLOC(char, size);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4784 sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4785 return p;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4786 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4787
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4788 char *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4789 strendzap(char *str, const char *pat)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4790 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4791 size_t len, patlen;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4792
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4793 assert(str != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4794 assert(pat != NULL);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4795
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4796 len = strlen(str);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4797 patlen = strlen(pat);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4798
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4799 if (patlen <= len)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4800 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4801 str += len - patlen;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4802 if (strcmp(str, pat) == 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4803 *str = '\0';
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4804 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4805 return str;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4806 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4807
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4808 static void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4809 lt_error_core (int exit_status, const char * mode,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4810 const char * message, va_list ap)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4811 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4812 fprintf (stderr, "%s: %s: ", program_name, mode);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4813 vfprintf (stderr, message, ap);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4814 fprintf (stderr, ".\n");
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4815
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4816 if (exit_status >= 0)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4817 exit (exit_status);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4818 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4819
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4820 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4821 lt_fatal (const char *message, ...)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4822 {
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4823 va_list ap;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4824 va_start (ap, message);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4825 lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4826 va_end (ap);
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4827 }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4828 EOF
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4829 # we should really use a build-platform specific compiler
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4830 # here, but OTOH, the wrappers (shell script and this C one)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4831 # are only useful if you want to execute the "real" binary.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4832 # Since the "real" binary is built for $host, then this
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4833 # wrapper might as well be built for $host, too.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4834 $run $LTCC -s -o $cwrapper $cwrappersource
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4835 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4836 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4837 $rm $output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4838 trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4839
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4840 $echo > $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4841 #! $SHELL
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4842
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4843 # $output - temporary wrapper script for $objdir/$outputname
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4844 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4845 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4846 # The $output program cannot be directly executed until all the libtool
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4847 # libraries that it depends on are installed.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4848 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4849 # This wrapper script should never be moved out of the build directory.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4850 # If it is, it will not operate correctly.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4851
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4852 # Sed substitution that helps us do robust quoting. It backslashifies
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4853 # metacharacters that are still active within double-quoted strings.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4854 Xsed='${SED} -e 1s/^X//'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4855 sed_quote_subst='$sed_quote_subst'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4856
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4857 # The HP-UX ksh and POSIX shell print the target directory to stdout
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4858 # if CDPATH is set.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4859 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4860
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4861 relink_command=\"$relink_command\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4862
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4863 # This environment variable determines our operation mode.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4864 if test \"\$libtool_install_magic\" = \"$magic\"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4865 # install mode needs the following variable:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4866 notinst_deplibs='$notinst_deplibs'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4867 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4868 # When we are sourced in execute mode, \$file and \$echo are already set.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4869 if test \"\$libtool_execute_magic\" != \"$magic\"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4870 echo=\"$qecho\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4871 file=\"\$0\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4872 # Make sure echo works.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4873 if test \"X\$1\" = X--no-reexec; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4874 # Discard the --no-reexec flag, and continue.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4875 shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4876 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4877 # Yippee, \$echo works!
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4878 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4879 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4880 # Restart under the correct shell, and then maybe \$echo will work.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4881 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4882 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4883 fi\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4884 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4885 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4886
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4887 # Find the directory that this script lives in.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4888 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4889 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4890
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4891 # Follow symbolic links until we get to the real thisdir.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4892 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4893 while test -n \"\$file\"; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4894 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4895
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4896 # If there was a directory component, then change thisdir.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4897 if test \"x\$destdir\" != \"x\$file\"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4898 case \"\$destdir\" in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4899 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4900 *) thisdir=\"\$thisdir/\$destdir\" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4901 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4902 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4903
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4904 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4905 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4906 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4907
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4908 # Try to get the absolute directory name.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4909 absdir=\`cd \"\$thisdir\" && pwd\`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4910 test -n \"\$absdir\" && thisdir=\"\$absdir\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4911 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4912
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4913 if test "$fast_install" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4914 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4915 program=lt-'$outputname'$exeext
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4916 progdir=\"\$thisdir/$objdir\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4917
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4918 if test ! -f \"\$progdir/\$program\" || \\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4919 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4920 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4921
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4922 file=\"\$\$-\$program\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4923
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4924 if test ! -d \"\$progdir\"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4925 $mkdir \"\$progdir\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4926 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4927 $rm \"\$progdir/\$file\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4928 fi"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4929
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4930 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4931
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4932 # relink executable if necessary
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4933 if test -n \"\$relink_command\"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4934 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4935 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4936 $echo \"\$relink_command_output\" >&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4937 $rm \"\$progdir/\$file\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4938 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4939 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4940 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4941
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4942 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4943 { $rm \"\$progdir/\$program\";
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4944 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4945 $rm \"\$progdir/\$file\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4946 fi"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4947 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4948 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4949 program='$outputname'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4950 progdir=\"\$thisdir/$objdir\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4951 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4952 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4953
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4954 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4955
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4956 if test -f \"\$progdir/\$program\"; then"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4957
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4958 # Export our shlibpath_var if we have one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4959 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4960 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4961 # Add our own library path to $shlibpath_var
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4962 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4963
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4964 # Some systems cannot cope with colon-terminated $shlibpath_var
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4965 # The second colon is a workaround for a bug in BeOS R4 sed
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4966 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4967
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4968 export $shlibpath_var
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4969 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4970 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4971
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4972 # fixup the dll searchpath if we need to.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4973 if test -n "$dllsearchpath"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4974 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4975 # Add the dll search path components to the executable PATH
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4976 PATH=$dllsearchpath:\$PATH
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4977 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4978 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4979
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4980 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4981 if test \"\$libtool_execute_magic\" != \"$magic\"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4982 # Run the actual program with our arguments.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4983 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4984 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4985 # Backslashes separate directories on plain windows
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4986 *-*-mingw | *-*-os2*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4987 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4988 exec \$progdir\\\\\$program \${1+\"\$@\"}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4989 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4990 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4991
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4992 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4993 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4994 exec \$progdir/\$program \${1+\"\$@\"}
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4995 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4996 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4997 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4998 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
4999 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5000 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5001 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5002 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5003 # The program doesn't exist.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5004 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5005 \$echo \"This script is just a wrapper for \$program.\" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5006 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5007 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5008 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5009 fi\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5010 "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5011 chmod +x $output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5012 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5013 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5014 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5015 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5016
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5017 # See if we need to build an old-fashioned archive.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5018 for oldlib in $oldlibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5019
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5020 if test "$build_libtool_libs" = convenience; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5021 oldobjs="$libobjs_save"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5022 addlibs="$convenience"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5023 build_libtool_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5024 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5025 if test "$build_libtool_libs" = module; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5026 oldobjs="$libobjs_save"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5027 build_libtool_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5028 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5029 oldobjs="$old_deplibs $non_pic_objects"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5030 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5031 addlibs="$old_convenience"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5032 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5033
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5034 if test -n "$addlibs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5035 gentop="$output_objdir/${outputname}x"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5036 generated="$generated $gentop"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5037
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5038 func_extract_archives $gentop $addlibs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5039 oldobjs="$oldobjs $func_extract_archives_result"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5040 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5041
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5042 # Do each command in the archive commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5043 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5044 cmds=$old_archive_from_new_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5045 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5046 eval cmds=\"$old_archive_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5047
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5048 if len=`expr "X$cmds" : ".*"` &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5049 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5050 cmds=$old_archive_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5051 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5052 # the command line is too long to link in one step, link in parts
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5053 $echo "using piecewise archive linking..."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5054 save_RANLIB=$RANLIB
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5055 RANLIB=:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5056 objlist=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5057 concat_cmds=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5058 save_oldobjs=$oldobjs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5059 # GNU ar 2.10+ was changed to match POSIX; thus no paths are
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5060 # encoded into archives. This makes 'ar r' malfunction in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5061 # this piecewise linking case whenever conflicting object
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5062 # names appear in distinct ar calls; check, warn and compensate.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5063 if (for obj in $save_oldobjs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5064 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5065 $echo "X$obj" | $Xsed -e 's%^.*/%%'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5066 done | sort | sort -uc >/dev/null 2>&1); then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5067 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5068 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5069 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5070 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5071 AR_FLAGS=cq
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5072 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5073 # Is there a better way of finding the last object in the list?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5074 for obj in $save_oldobjs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5075 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5076 last_oldobj=$obj
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5077 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5078 for obj in $save_oldobjs
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5079 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5080 oldobjs="$objlist $obj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5081 objlist="$objlist $obj"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5082 eval test_cmds=\"$old_archive_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5083 if len=`expr "X$test_cmds" : ".*"` &&
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5084 test "$len" -le "$max_cmd_len"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5085 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5086 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5087 # the above command should be used before it gets too long
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5088 oldobjs=$objlist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5089 if test "$obj" = "$last_oldobj" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5090 RANLIB=$save_RANLIB
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5091 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5092 test -z "$concat_cmds" || concat_cmds=$concat_cmds~
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5093 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5094 objlist=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5095 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5096 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5097 RANLIB=$save_RANLIB
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5098 oldobjs=$objlist
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5099 if test "X$oldobjs" = "X" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5100 eval cmds=\"\$concat_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5101 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5102 eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5103 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5104 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5105 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5106 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5107 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5108 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5109 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5110 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5111 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5112 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5113 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5114 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5115
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5116 if test -n "$generated"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5117 $show "${rm}r$generated"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5118 $run ${rm}r$generated
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5119 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5120
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5121 # Now create the libtool archive.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5122 case $output in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5123 *.la)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5124 old_library=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5125 test "$build_old_libs" = yes && old_library="$libname.$libext"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5126 $show "creating $output"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5127
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5128 # Preserve any variables that may affect compiler behavior
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5129 for var in $variables_saved_for_relink; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5130 if eval test -z \"\${$var+set}\"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5131 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5132 elif eval var_value=\$$var; test -z "$var_value"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5133 relink_command="$var=; export $var; $relink_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5134 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5135 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5136 relink_command="$var=\"$var_value\"; export $var; $relink_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5137 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5138 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5139 # Quote the link command for shipping.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5140 relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5141 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5142 if test "$hardcode_automatic" = yes ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5143 relink_command=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5144 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5145
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5146
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5147 # Only create the output if not a dry run.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5148 if test -z "$run"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5149 for installed in no yes; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5150 if test "$installed" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5151 if test -z "$install_libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5152 break
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5153 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5154 output="$output_objdir/$outputname"i
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5155 # Replace all uninstalled libtool libraries with the installed ones
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5156 newdependency_libs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5157 for deplib in $dependency_libs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5158 case $deplib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5159 *.la)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5160 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5161 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5162 if test -z "$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5163 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5164 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5165 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5166 newdependency_libs="$newdependency_libs $libdir/$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5167 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5168 *) newdependency_libs="$newdependency_libs $deplib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5169 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5170 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5171 dependency_libs="$newdependency_libs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5172 newdlfiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5173 for lib in $dlfiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5174 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5175 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5176 if test -z "$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5177 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5178 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5179 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5180 newdlfiles="$newdlfiles $libdir/$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5181 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5182 dlfiles="$newdlfiles"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5183 newdlprefiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5184 for lib in $dlprefiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5185 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5186 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5187 if test -z "$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5188 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5189 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5190 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5191 newdlprefiles="$newdlprefiles $libdir/$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5192 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5193 dlprefiles="$newdlprefiles"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5194 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5195 newdlfiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5196 for lib in $dlfiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5197 case $lib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5198 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5199 *) abs=`pwd`"/$lib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5200 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5201 newdlfiles="$newdlfiles $abs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5202 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5203 dlfiles="$newdlfiles"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5204 newdlprefiles=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5205 for lib in $dlprefiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5206 case $lib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5207 [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5208 *) abs=`pwd`"/$lib" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5209 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5210 newdlprefiles="$newdlprefiles $abs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5211 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5212 dlprefiles="$newdlprefiles"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5213 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5214 $rm $output
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5215 # place dlname in correct position for cygwin
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5216 tdlname=$dlname
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5217 case $host,$output,$installed,$module,$dlname in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5218 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5219 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5220 $echo > $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5221 # $outputname - a libtool library file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5222 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5223 #
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5224 # Please DO NOT delete this file!
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5225 # It is necessary for linking the library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5226
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5227 # The name that we can dlopen(3).
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5228 dlname='$tdlname'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5229
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5230 # Names of this library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5231 library_names='$library_names'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5232
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5233 # The name of the static archive.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5234 old_library='$old_library'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5235
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5236 # Libraries that this one depends upon.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5237 dependency_libs='$dependency_libs'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5238
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5239 # Version information for $libname.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5240 current=$current
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5241 age=$age
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5242 revision=$revision
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5243
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5244 # Is this an already installed library?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5245 installed=$installed
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5246
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5247 # Should we warn about portability when linking against -modules?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5248 shouldnotlink=$module
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5249
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5250 # Files to dlopen/dlpreopen
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5251 dlopen='$dlfiles'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5252 dlpreopen='$dlprefiles'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5253
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5254 # Directory that this library needs to be installed in:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5255 libdir='$install_libdir'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5256 if test "$installed" = no && test "$need_relink" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5257 $echo >> $output "\
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5258 relink_command=\"$relink_command\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5259 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5260 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5261 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5262
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5263 # Do a symbolic link so that the libtool archive can be found in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5264 # LD_LIBRARY_PATH before the program is installed.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5265 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5266 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5267 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5268 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5269 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5270 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5271
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5272 # libtool install mode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5273 install)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5274 modename="$modename: install"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5275
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5276 # There may be an optional sh(1) argument at the beginning of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5277 # install_prog (especially on Windows NT).
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5278 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5279 # Allow the use of GNU shtool's install command.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5280 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5281 # Aesthetically quote it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5282 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5283 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5284 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5285 arg="\"$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5286 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5287 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5288 install_prog="$arg "
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5289 arg="$1"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5290 shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5291 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5292 install_prog=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5293 arg="$nonopt"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5294 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5295
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5296 # The real first argument should be the name of the installation program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5297 # Aesthetically quote it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5298 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5299 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5300 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5301 arg="\"$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5302 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5303 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5304 install_prog="$install_prog$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5305
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5306 # We need to accept at least all the BSD install flags.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5307 dest=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5308 files=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5309 opts=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5310 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5311 install_type=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5312 isdir=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5313 stripme=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5314 for arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5315 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5316 if test -n "$dest"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5317 files="$files $dest"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5318 dest="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5319 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5320 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5321
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5322 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5323 -d) isdir=yes ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5324 -f) prev="-f" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5325 -g) prev="-g" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5326 -m) prev="-m" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5327 -o) prev="-o" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5328 -s)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5329 stripme=" -s"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5330 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5331 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5332 -*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5333
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5334 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5335 # If the previous option needed an argument, then skip it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5336 if test -n "$prev"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5337 prev=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5338 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5339 dest="$arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5340 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5341 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5342 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5343 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5344
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5345 # Aesthetically quote the argument.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5346 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5347 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5348 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5349 arg="\"$arg\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5350 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5351 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5352 install_prog="$install_prog $arg"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5353 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5354
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5355 if test -z "$install_prog"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5356 $echo "$modename: you must specify an install program" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5357 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5358 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5359 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5360
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5361 if test -n "$prev"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5362 $echo "$modename: the \`$prev' option requires an argument" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5363 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5364 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5365 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5366
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5367 if test -z "$files"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5368 if test -z "$dest"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5369 $echo "$modename: no file or destination specified" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5370 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5371 $echo "$modename: you must specify a destination" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5372 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5373 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5374 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5375 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5376
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5377 # Strip any trailing slash from the destination.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5378 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5379
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5380 # Check to see that the destination is a directory.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5381 test -d "$dest" && isdir=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5382 if test "$isdir" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5383 destdir="$dest"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5384 destname=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5385 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5386 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5387 test "X$destdir" = "X$dest" && destdir=.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5388 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5389
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5390 # Not a directory, so check to see that there is only one file specified.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5391 set dummy $files
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5392 if test "$#" -gt 2; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5393 $echo "$modename: \`$dest' is not a directory" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5394 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5395 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5396 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5397 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5398 case $destdir in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5399 [\\/]* | [A-Za-z]:[\\/]*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5400 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5401 for file in $files; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5402 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5403 *.lo) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5404 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5405 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5406 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5407 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5408 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5409 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5410 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5411 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5412 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5413
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5414 # This variable tells wrapper scripts just to set variables rather
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5415 # than running their programs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5416 libtool_install_magic="$magic"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5417
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5418 staticlibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5419 future_libdirs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5420 current_libdirs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5421 for file in $files; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5422
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5423 # Do each installation.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5424 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5425 *.$libext)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5426 # Do the static libraries later.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5427 staticlibs="$staticlibs $file"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5428 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5429
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5430 *.la)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5431 # Check to see that this really is a libtool archive.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5432 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5433 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5434 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5435 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5436 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5437 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5438
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5439 library_names=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5440 old_library=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5441 relink_command=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5442 # If there is no directory component, then add one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5443 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5444 */* | *\\*) . $file ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5445 *) . ./$file ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5446 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5447
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5448 # Add the libdir to current_libdirs if it is the destination.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5449 if test "X$destdir" = "X$libdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5450 case "$current_libdirs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5451 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5452 *) current_libdirs="$current_libdirs $libdir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5453 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5454 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5455 # Note the libdir as a future libdir.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5456 case "$future_libdirs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5457 *" $libdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5458 *) future_libdirs="$future_libdirs $libdir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5459 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5460 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5461
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5462 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5463 test "X$dir" = "X$file/" && dir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5464 dir="$dir$objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5465
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5466 if test -n "$relink_command"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5467 # Determine the prefix the user has applied to our future dir.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5468 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5469
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5470 # Don't allow the user to place us outside of our expected
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5471 # location b/c this prevents finding dependent libraries that
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5472 # are installed to the same prefix.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5473 # At present, this check doesn't affect windows .dll's that
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5474 # are installed into $libdir/../bin (currently, that works fine)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5475 # but it's something to keep an eye on.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5476 if test "$inst_prefix_dir" = "$destdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5477 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5478 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5479 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5480
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5481 if test -n "$inst_prefix_dir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5482 # Stick the inst_prefix_dir data into the link command.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5483 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5484 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5485 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5486 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5487
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5488 $echo "$modename: warning: relinking \`$file'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5489 $show "$relink_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5490 if $run eval "$relink_command"; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5491 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5492 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5493 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5494 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5495 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5496
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5497 # See the names of the shared library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5498 set dummy $library_names
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5499 if test -n "$2"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5500 realname="$2"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5501 shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5502 shift
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5503
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5504 srcname="$realname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5505 test -n "$relink_command" && srcname="$realname"T
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5506
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5507 # Install the shared library and build the symlinks.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5508 $show "$install_prog $dir/$srcname $destdir/$realname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5509 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5510 if test -n "$stripme" && test -n "$striplib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5511 $show "$striplib $destdir/$realname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5512 $run eval "$striplib $destdir/$realname" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5513 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5514
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5515 if test "$#" -gt 0; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5516 # Delete the old symlinks, and create new ones.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5517 for linkname
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5518 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5519 if test "$linkname" != "$realname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5520 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5521 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5522 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5523 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5524 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5525
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5526 # Do each command in the postinstall commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5527 lib="$destdir/$realname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5528 cmds=$postinstall_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5529 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5530 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5531 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5532 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5533 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5534 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5535 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5536 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5537 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5538
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5539 # Install the pseudo-library for information purposes.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5540 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5541 *-*-freebsd*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5542 # Do not install the useless pseudo-library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5543 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5544 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5545 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5546 instname="$dir/$name"i
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5547 $show "$install_prog $instname $destdir/$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5548 $run eval "$install_prog $instname $destdir/$name" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5549 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5550 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5551
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5552 # Maybe install the static library, too.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5553 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5554 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5555
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5556 *.lo)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5557 # Install (i.e. copy) a libtool object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5558
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5559 # Figure out destination file name, if it wasn't already specified.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5560 if test -n "$destname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5561 destfile="$destdir/$destname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5562 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5563 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5564 destfile="$destdir/$destfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5565 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5566
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5567 # Deduce the name of the destination old-style object file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5568 case $destfile in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5569 *.lo)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5570 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5571 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5572 *.$objext)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5573 staticdest="$destfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5574 destfile=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5575 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5576 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5577 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5578 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5579 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5580 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5581 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5582
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5583 # Install the libtool object if requested.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5584 if test -n "$destfile"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5585 $show "$install_prog $file $destfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5586 $run eval "$install_prog $file $destfile" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5587 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5588
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5589 # Install the old object if enabled.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5590 if test "$build_old_libs" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5591 # Deduce the name of the old-style object file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5592 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5593
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5594 $show "$install_prog $staticobj $staticdest"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5595 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5596 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5597 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5598 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5599
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5600 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5601 # Figure out destination file name, if it wasn't already specified.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5602 if test -n "$destname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5603 destfile="$destdir/$destname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5604 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5605 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5606 destfile="$destdir/$destfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5607 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5608
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5609 # If the file is missing, and there is a .exe on the end, strip it
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5610 # because it is most likely a libtool script we actually want to
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5611 # install
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5612 stripped_ext=""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5613 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5614 *.exe)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5615 if test ! -f "$file"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5616 file=`$echo $file|${SED} 's,.exe$,,'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5617 stripped_ext=".exe"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5618 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5619 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5620 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5621
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5622 # Do a test to see if this is really a libtool program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5623 case $host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5624 *cygwin*|*mingw*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5625 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5626 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5627 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5628 wrapper=$file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5629 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5630 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5631 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5632 notinst_deplibs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5633 relink_command=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5634
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5635 # To insure that "foo" is sourced, and not "foo.exe",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5636 # finese the cygwin/MSYS system by explicitly sourcing "foo."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5637 # which disallows the automatic-append-.exe behavior.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5638 case $build in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5639 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5640 *) wrapperdot=${wrapper} ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5641 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5642 # If there is no directory component, then add one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5643 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5644 */* | *\\*) . ${wrapperdot} ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5645 *) . ./${wrapperdot} ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5646 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5647
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5648 # Check the variables that should have been set.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5649 if test -z "$notinst_deplibs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5650 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5651 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5652 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5653
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5654 finalize=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5655 for lib in $notinst_deplibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5656 # Check to see that each library is installed.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5657 libdir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5658 if test -f "$lib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5659 # If there is no directory component, then add one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5660 case $lib in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5661 */* | *\\*) . $lib ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5662 *) . ./$lib ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5663 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5664 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5665 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5666 if test -n "$libdir" && test ! -f "$libfile"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5667 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5668 finalize=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5669 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5670 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5671
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5672 relink_command=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5673 # To insure that "foo" is sourced, and not "foo.exe",
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5674 # finese the cygwin/MSYS system by explicitly sourcing "foo."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5675 # which disallows the automatic-append-.exe behavior.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5676 case $build in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5677 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5678 *) wrapperdot=${wrapper} ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5679 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5680 # If there is no directory component, then add one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5681 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5682 */* | *\\*) . ${wrapperdot} ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5683 *) . ./${wrapperdot} ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5684 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5685
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5686 outputname=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5687 if test "$fast_install" = no && test -n "$relink_command"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5688 if test "$finalize" = yes && test -z "$run"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5689 tmpdir="/tmp"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5690 test -n "$TMPDIR" && tmpdir="$TMPDIR"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5691 tmpdir="$tmpdir/libtool-$$"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5692 save_umask=`umask`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5693 umask 0077
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5694 if $mkdir "$tmpdir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5695 umask $save_umask
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5696 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5697 umask $save_umask
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5698 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5699 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5700 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5701 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5702 outputname="$tmpdir/$file"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5703 # Replace the output file specification.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5704 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5705
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5706 $show "$relink_command"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5707 if $run eval "$relink_command"; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5708 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5709 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5710 ${rm}r "$tmpdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5711 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5712 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5713 file="$outputname"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5714 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5715 $echo "$modename: warning: cannot relink \`$file'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5716 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5717 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5718 # Install the binary that we compiled earlier.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5719 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5720 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5721 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5722
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5723 # remove .exe since cygwin /usr/bin/install will append another
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5724 # one anyways
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5725 case $install_prog,$host in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5726 */usr/bin/install*,*cygwin*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5727 case $file:$destfile in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5728 *.exe:*.exe)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5729 # this is ok
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5730 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5731 *.exe:*)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5732 destfile=$destfile.exe
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5733 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5734 *:*.exe)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5735 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5736 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5737 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5738 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5739 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5740 $show "$install_prog$stripme $file $destfile"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5741 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5742 test -n "$outputname" && ${rm}r "$tmpdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5743 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5744 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5745 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5746
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5747 for file in $staticlibs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5748 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5749
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5750 # Set up the ranlib parameters.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5751 oldlib="$destdir/$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5752
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5753 $show "$install_prog $file $oldlib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5754 $run eval "$install_prog \$file \$oldlib" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5755
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5756 if test -n "$stripme" && test -n "$old_striplib"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5757 $show "$old_striplib $oldlib"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5758 $run eval "$old_striplib $oldlib" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5759 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5760
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5761 # Do each command in the postinstall commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5762 cmds=$old_postinstall_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5763 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5764 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5765 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5766 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5767 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5768 $run eval "$cmd" || exit $?
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5769 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5770 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5771 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5772
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5773 if test -n "$future_libdirs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5774 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5775 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5776
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5777 if test -n "$current_libdirs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5778 # Maybe just do a dry run.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5779 test -n "$run" && current_libdirs=" -n$current_libdirs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5780 exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5781 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5782 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5783 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5784 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5785
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5786 # libtool finish mode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5787 finish)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5788 modename="$modename: finish"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5789 libdirs="$nonopt"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5790 admincmds=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5791
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5792 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5793 for dir
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5794 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5795 libdirs="$libdirs $dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5796 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5797
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5798 for libdir in $libdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5799 if test -n "$finish_cmds"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5800 # Do each command in the finish commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5801 cmds=$finish_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5802 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5803 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5804 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5805 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5806 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5807 $run eval "$cmd" || admincmds="$admincmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5808 $cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5809 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5810 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5811 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5812 if test -n "$finish_eval"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5813 # Do the single finish_eval.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5814 eval cmds=\"$finish_eval\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5815 $run eval "$cmds" || admincmds="$admincmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5816 $cmds"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5817 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5818 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5819 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5820
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5821 # Exit here if they wanted silent mode.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5822 test "$show" = : && exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5823
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5824 $echo "----------------------------------------------------------------------"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5825 $echo "Libraries have been installed in:"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5826 for libdir in $libdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5827 $echo " $libdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5828 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5829 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5830 $echo "If you ever happen to want to link against installed libraries"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5831 $echo "in a given directory, LIBDIR, you must either use libtool, and"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5832 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5833 $echo "flag during linking and do at least one of the following:"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5834 if test -n "$shlibpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5835 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5836 $echo " during execution"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5837 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5838 if test -n "$runpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5839 $echo " - add LIBDIR to the \`$runpath_var' environment variable"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5840 $echo " during linking"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5841 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5842 if test -n "$hardcode_libdir_flag_spec"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5843 libdir=LIBDIR
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5844 eval flag=\"$hardcode_libdir_flag_spec\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5845
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5846 $echo " - use the \`$flag' linker flag"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5847 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5848 if test -n "$admincmds"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5849 $echo " - have your system administrator run these commands:$admincmds"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5850 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5851 if test -f /etc/ld.so.conf; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5852 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5853 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5854 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5855 $echo "See any operating system documentation about shared libraries for"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5856 $echo "more information, such as the ld(1) and ld.so(8) manual pages."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5857 $echo "----------------------------------------------------------------------"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5858 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5859 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5860
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5861 # libtool execute mode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5862 execute)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5863 modename="$modename: execute"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5864
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5865 # The first argument is the command name.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5866 cmd="$nonopt"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5867 if test -z "$cmd"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5868 $echo "$modename: you must specify a COMMAND" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5869 $echo "$help"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5870 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5871 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5872
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5873 # Handle -dlopen flags immediately.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5874 for file in $execute_dlfiles; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5875 if test ! -f "$file"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5876 $echo "$modename: \`$file' is not a file" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5877 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5878 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5879 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5880
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5881 dir=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5882 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5883 *.la)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5884 # Check to see that this really is a libtool archive.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5885 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5886 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5887 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5888 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5889 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5890 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5891
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5892 # Read the libtool library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5893 dlname=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5894 library_names=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5895
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5896 # If there is no directory component, then add one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5897 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5898 */* | *\\*) . $file ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5899 *) . ./$file ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5900 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5901
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5902 # Skip this library if it cannot be dlopened.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5903 if test -z "$dlname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5904 # Warn if it was a shared library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5905 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5906 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5907 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5908
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5909 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5910 test "X$dir" = "X$file" && dir=.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5911
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5912 if test -f "$dir/$objdir/$dlname"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5913 dir="$dir/$objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5914 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5915 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5916 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5917 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5918 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5919
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5920 *.lo)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5921 # Just add the directory containing the .lo file.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5922 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5923 test "X$dir" = "X$file" && dir=.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5924 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5925
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5926 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5927 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5928 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5929 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5930 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5931
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5932 # Get the absolute pathname.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5933 absdir=`cd "$dir" && pwd`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5934 test -n "$absdir" && dir="$absdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5935
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5936 # Now add the directory to shlibpath_var.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5937 if eval "test -z \"\$$shlibpath_var\""; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5938 eval "$shlibpath_var=\"\$dir\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5939 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5940 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5941 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5942 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5943
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5944 # This variable tells wrapper scripts just to set shlibpath_var
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5945 # rather than running their programs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5946 libtool_execute_magic="$magic"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5947
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5948 # Check if any of the arguments is a wrapper script.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5949 args=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5950 for file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5951 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5952 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5953 -*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5954 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5955 # Do a test to see if this is really a libtool program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5956 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5957 # If there is no directory component, then add one.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5958 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5959 */* | *\\*) . $file ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5960 *) . ./$file ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5961 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5962
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5963 # Transform arg to wrapped name.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5964 file="$progdir/$program"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5965 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5966 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5967 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5968 # Quote arguments (to preserve shell metacharacters).
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5969 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5970 args="$args \"$file\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5971 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5972
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5973 if test -z "$run"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5974 if test -n "$shlibpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5975 # Export the shlibpath_var.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5976 eval "export $shlibpath_var"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5977 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5978
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5979 # Restore saved environment variables
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5980 if test "${save_LC_ALL+set}" = set; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5981 LC_ALL="$save_LC_ALL"; export LC_ALL
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5982 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5983 if test "${save_LANG+set}" = set; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5984 LANG="$save_LANG"; export LANG
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5985 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5986
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5987 # Now prepare to actually exec the command.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5988 exec_cmd="\$cmd$args"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5989 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5990 # Display what would be done.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5991 if test -n "$shlibpath_var"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5992 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5993 $echo "export $shlibpath_var"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5994 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5995 $echo "$cmd$args"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5996 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5997 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5998 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
5999
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6000 # libtool clean and uninstall mode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6001 clean | uninstall)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6002 modename="$modename: $mode"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6003 rm="$nonopt"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6004 files=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6005 rmforce=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6006 exit_status=0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6007
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6008 # This variable tells wrapper scripts just to set variables rather
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6009 # than running their programs.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6010 libtool_install_magic="$magic"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6011
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6012 for arg
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6013 do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6014 case $arg in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6015 -f) rm="$rm $arg"; rmforce=yes ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6016 -*) rm="$rm $arg" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6017 *) files="$files $arg" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6018 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6019 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6020
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6021 if test -z "$rm"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6022 $echo "$modename: you must specify an RM program" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6023 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6024 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6025 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6026
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6027 rmdirs=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6028
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6029 origobjdir="$objdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6030 for file in $files; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6031 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6032 if test "X$dir" = "X$file"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6033 dir=.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6034 objdir="$origobjdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6035 else
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6036 objdir="$dir/$origobjdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6037 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6038 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6039 test "$mode" = uninstall && objdir="$dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6040
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6041 # Remember objdir for removal later, being careful to avoid duplicates
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6042 if test "$mode" = clean; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6043 case " $rmdirs " in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6044 *" $objdir "*) ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6045 *) rmdirs="$rmdirs $objdir" ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6046 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6047 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6048
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6049 # Don't error if the file doesn't exist and rm -f was used.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6050 if (test -L "$file") >/dev/null 2>&1 \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6051 || (test -h "$file") >/dev/null 2>&1 \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6052 || test -f "$file"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6053 :
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6054 elif test -d "$file"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6055 exit_status=1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6056 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6057 elif test "$rmforce" = yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6058 continue
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6059 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6060
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6061 rmfiles="$file"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6062
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6063 case $name in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6064 *.la)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6065 # Possibly a libtool archive, so verify it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6066 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6067 . $dir/$name
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6068
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6069 # Delete the libtool libraries and symlinks.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6070 for n in $library_names; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6071 rmfiles="$rmfiles $objdir/$n"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6072 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6073 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6074 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6075
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6076 if test "$mode" = uninstall; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6077 if test -n "$library_names"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6078 # Do each command in the postuninstall commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6079 cmds=$postuninstall_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6080 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6081 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6082 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6083 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6084 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6085 $run eval "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6086 if test "$?" -ne 0 && test "$rmforce" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6087 exit_status=1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6088 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6089 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6090 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6091 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6092
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6093 if test -n "$old_library"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6094 # Do each command in the old_postuninstall commands.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6095 cmds=$old_postuninstall_cmds
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6096 save_ifs="$IFS"; IFS='~'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6097 for cmd in $cmds; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6098 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6099 eval cmd=\"$cmd\"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6100 $show "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6101 $run eval "$cmd"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6102 if test "$?" -ne 0 && test "$rmforce" != yes; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6103 exit_status=1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6104 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6105 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6106 IFS="$save_ifs"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6107 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6108 # FIXME: should reinstall the best remaining shared library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6109 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6110 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6111 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6112
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6113 *.lo)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6114 # Possibly a libtool object, so verify it.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6115 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6116
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6117 # Read the .lo file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6118 . $dir/$name
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6119
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6120 # Add PIC object to the list of files to remove.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6121 if test -n "$pic_object" \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6122 && test "$pic_object" != none; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6123 rmfiles="$rmfiles $dir/$pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6124 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6125
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6126 # Add non-PIC object to the list of files to remove.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6127 if test -n "$non_pic_object" \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6128 && test "$non_pic_object" != none; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6129 rmfiles="$rmfiles $dir/$non_pic_object"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6130 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6131 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6132 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6133
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6134 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6135 if test "$mode" = clean ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6136 noexename=$name
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6137 case $file in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6138 *.exe)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6139 file=`$echo $file|${SED} 's,.exe$,,'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6140 noexename=`$echo $name|${SED} 's,.exe$,,'`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6141 # $file with .exe has already been added to rmfiles,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6142 # add $file without .exe
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6143 rmfiles="$rmfiles $file"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6144 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6145 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6146 # Do a test to see if this is a libtool program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6147 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6148 relink_command=
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6149 . $dir/$noexename
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6150
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6151 # note $name still contains .exe if it was in $file originally
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6152 # as does the version of $file that was added into $rmfiles
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6153 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6154 if test "$fast_install" = yes && test -n "$relink_command"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6155 rmfiles="$rmfiles $objdir/lt-$name"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6156 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6157 if test "X$noexename" != "X$name" ; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6158 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6159 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6160 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6161 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6162 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6163 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6164 $show "$rm $rmfiles"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6165 $run $rm $rmfiles || exit_status=1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6166 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6167 objdir="$origobjdir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6168
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6169 # Try to remove the ${objdir}s in the directories where we deleted files
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6170 for dir in $rmdirs; do
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6171 if test -d "$dir"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6172 $show "rmdir $dir"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6173 $run rmdir $dir >/dev/null 2>&1
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6174 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6175 done
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6176
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6177 exit $exit_status
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6178 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6179
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6180 "")
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6181 $echo "$modename: you must specify a MODE" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6182 $echo "$generic_help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6183 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6184 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6185 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6186
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6187 if test -z "$exec_cmd"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6188 $echo "$modename: invalid operation mode \`$mode'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6189 $echo "$generic_help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6190 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6191 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6192 fi # test -z "$show_help"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6193
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6194 if test -n "$exec_cmd"; then
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6195 eval exec $exec_cmd
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6196 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6197 fi
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6198
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6199 # We need to display help for each of the modes.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6200 case $mode in
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6201 "") $echo \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6202 "Usage: $modename [OPTION]... [MODE-ARG]...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6203
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6204 Provide generalized library-building support services.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6205
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6206 --config show all configuration variables
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6207 --debug enable verbose shell tracing
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6208 -n, --dry-run display commands without modifying any files
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6209 --features display basic configuration information and exit
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6210 --finish same as \`--mode=finish'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6211 --help display this help message and exit
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6212 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6213 --quiet same as \`--silent'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6214 --silent don't print informational messages
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6215 --tag=TAG use configuration variables from tag TAG
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6216 --version print version information
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6217
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6218 MODE must be one of the following:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6219
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6220 clean remove files from the build directory
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6221 compile compile a source file into a libtool object
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6222 execute automatically set library path, then run a program
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6223 finish complete the installation of libtool libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6224 install install libraries or executables
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6225 link create a library or an executable
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6226 uninstall remove libraries from an installed directory
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6227
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6228 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6229 a more detailed description of MODE.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6230
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6231 Report bugs to <bug-libtool@gnu.org>."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6232 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6233 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6234
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6235 clean)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6236 $echo \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6237 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6238
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6239 Remove files from the build directory.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6240
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6241 RM is the name of the program to use to delete files associated with each FILE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6242 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6243 to RM.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6244
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6245 If FILE is a libtool library, object or program, all the files associated
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6246 with it are deleted. Otherwise, only FILE itself is deleted using RM."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6247 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6248
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6249 compile)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6250 $echo \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6251 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6252
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6253 Compile a source file into a libtool library object.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6254
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6255 This mode accepts the following additional options:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6256
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6257 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6258 -prefer-pic try to building PIC objects only
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6259 -prefer-non-pic try to building non-PIC objects only
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6260 -static always build a \`.o' file suitable for static linking
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6261
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6262 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6263 from the given SOURCEFILE.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6264
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6265 The output file name is determined by removing the directory component from
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6266 SOURCEFILE, then substituting the C source code suffix \`.c' with the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6267 library object suffix, \`.lo'."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6268 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6269
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6270 execute)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6271 $echo \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6272 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6273
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6274 Automatically set library path, then run a program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6275
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6276 This mode accepts the following additional options:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6277
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6278 -dlopen FILE add the directory containing FILE to the library path
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6279
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6280 This mode sets the library path environment variable according to \`-dlopen'
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6281 flags.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6282
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6283 If any of the ARGS are libtool executable wrappers, then they are translated
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6284 into their corresponding uninstalled binary, and any of their required library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6285 directories are added to the library path.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6286
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6287 Then, COMMAND is executed, with ARGS as arguments."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6288 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6289
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6290 finish)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6291 $echo \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6292 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6293
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6294 Complete the installation of libtool libraries.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6295
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6296 Each LIBDIR is a directory that contains libtool libraries.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6297
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6298 The commands that this mode executes may require superuser privileges. Use
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6299 the \`--dry-run' option if you just want to see what would be executed."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6300 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6301
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6302 install)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6303 $echo \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6304 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6305
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6306 Install executables or libraries.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6307
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6308 INSTALL-COMMAND is the installation command. The first component should be
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6309 either the \`install' or \`cp' program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6310
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6311 The rest of the components are interpreted as arguments to that command (only
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6312 BSD-compatible install options are recognized)."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6313 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6314
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6315 link)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6316 $echo \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6317 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6318
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6319 Link object files or libraries together to form another library, or to
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6320 create an executable program.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6321
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6322 LINK-COMMAND is a command using the C compiler that you would use to create
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6323 a program from several object files.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6324
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6325 The following components of LINK-COMMAND are treated specially:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6326
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6327 -all-static do not do any dynamic linking at all
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6328 -avoid-version do not add a version suffix if possible
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6329 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6330 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6331 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6332 -export-symbols SYMFILE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6333 try to export only the symbols listed in SYMFILE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6334 -export-symbols-regex REGEX
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6335 try to export only the symbols matching REGEX
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6336 -LLIBDIR search LIBDIR for required installed libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6337 -lNAME OUTPUT-FILE requires the installed library libNAME
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6338 -module build a library that can dlopened
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6339 -no-fast-install disable the fast-install mode
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6340 -no-install link a not-installable executable
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6341 -no-undefined declare that a library does not refer to external symbols
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6342 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6343 -objectlist FILE Use a list of object files found in FILE to specify objects
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6344 -precious-files-regex REGEX
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6345 don't remove output files matching REGEX
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6346 -release RELEASE specify package release information
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6347 -rpath LIBDIR the created library will eventually be installed in LIBDIR
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6348 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6349 -static do not do any dynamic linking of libtool libraries
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6350 -version-info CURRENT[:REVISION[:AGE]]
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6351 specify library version info [each variable defaults to 0]
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6352
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6353 All other options (arguments beginning with \`-') are ignored.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6354
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6355 Every other argument is treated as a filename. Files ending in \`.la' are
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6356 treated as uninstalled libtool libraries, other files are standard or library
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6357 object files.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6358
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6359 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6360 only library objects (\`.lo' files) may be specified, and \`-rpath' is
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6361 required, except when creating a convenience library.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6362
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6363 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6364 using \`ar' and \`ranlib', or on Windows using \`lib'.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6365
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6366 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6367 is created, otherwise an executable program is created."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6368 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6369
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6370 uninstall)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6371 $echo \
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6372 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6373
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6374 Remove libraries from an installation directory.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6375
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6376 RM is the name of the program to use to delete files associated with each FILE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6377 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6378 to RM.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6379
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6380 If FILE is a libtool library, all the files associated with it are deleted.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6381 Otherwise, only FILE itself is deleted using RM."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6382 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6383
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6384 *)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6385 $echo "$modename: invalid operation mode \`$mode'" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6386 $echo "$help" 1>&2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6387 exit $EXIT_FAILURE
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6388 ;;
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6389 esac
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6390
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6391 $echo
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6392 $echo "Try \`$modename --help' for more information about other modes."
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6393
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6394 exit $EXIT_SUCCESS
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6395
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6396 # The TAGs below are defined such that we never get into a situation
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6397 # in which we disable both kinds of libraries. Given conflicting
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6398 # choices, we go for a static library, that is the most portable,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6399 # since we can't tell whether shared libraries were disabled because
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6400 # the user asked for that or because the platform doesn't support
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6401 # them. This is particularly important on AIX, because we don't
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6402 # support having both static and shared libraries enabled at the same
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6403 # time on that platform, so we default to a shared-only configuration.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6404 # If a disable-shared tag is given, we'll fallback to a static-only
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6405 # configuration. But we'll never go from static-only to shared-only.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6406
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6407 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6408 build_libtool_libs=no
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6409 build_old_libs=yes
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6410 # ### END LIBTOOL TAG CONFIG: disable-shared
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6411
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6412 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6413 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6414 # ### END LIBTOOL TAG CONFIG: disable-static
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6415
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6416 # Local Variables:
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6417 # mode:shell-script
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6418 # sh-indentation:2
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
6419 # End: