annotate ltmain.sh @ 1078:3819a5a377b2

[gaim-migrate @ 1088] ha, aren't i stupid committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 09 Nov 2000 10:54:24 +0000
parents 494816c30ca7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 # ltmain.sh - Provide generalized library-building support services.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 # NOTE: Changing this file will not affect anything until you rerun ltconfig.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 # Copyright (C) 1996-1999 Free Software Foundation, Inc.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 # This program is free software; you can redistribute it and/or modify
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 # it under the terms of the GNU General Public License as published by
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 # the Free Software Foundation; either version 2 of the License, or
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 # (at your option) any later version.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 # This program is distributed in the hope that it will be useful, but
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 # General Public License for more details.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
16 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
17 # You should have received a copy of the GNU General Public License
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18 # along with this program; if not, write to the Free Software
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 # As a special exception to the GNU General Public License, if you
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
22 # distribute this file as part of a program that contains a
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
23 # configuration script generated by Autoconf, you may include it under
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
24 # the same distribution terms that you use for the rest of that program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 # Check that we have a working $echo.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 if test "X$1" = X--no-reexec; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 # Discard the --no-reexec flag, and continue.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 elif test "X$1" = X--fallback-echo; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31 # Avoid inline document here, it may be left over
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
32 :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 # Yippee, $echo works!
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
36 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
37 # Restart under the correct shell, and then maybe $echo will work.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38 exec $SHELL "$0" --no-reexec ${1+"$@"}
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
39 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 if test "X$1" = X--fallback-echo; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 # used as fallback echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43 shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44 cat <<EOF
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45 $*
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 EOF
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
49
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
50 # The name of this program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
51 progname=`$echo "$0" | sed 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
52 modename="$progname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
53
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
54 # Constants.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
55 PROGRAM=ltmain.sh
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
56 PACKAGE=libtool
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
57 VERSION=1.3
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58 TIMESTAMP=" (1.385.2.117 1999/04/29 13:07:13)"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
59
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
60 default_mode=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
61 help="Try \`$progname --help' for more information."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
62 magic="%%%MAGIC variable%%%"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
63 mkdir="mkdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 mv="mv -f"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65 rm="rm -f"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67 # Sed substitution that helps us do robust quoting. It backslashifies
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 # metacharacters that are still active within double-quoted strings.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69 Xsed='sed -e 1s/^X//'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
70 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
71 SP2NL='tr \040 \012'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
72 NL2SP='tr \012 \040'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
73
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
74 # NLS nuisances.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
75 # Only set LANG and LC_ALL to C if already set.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76 # These must not be set unconditionally because not all systems understand
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
77 # e.g. LANG=C (notably SCO).
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78 # We save the old values to restore during execute mode.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79 if test "${LC_ALL+set}" = set; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
80 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82 if test "${LANG+set}" = set; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
83 save_LANG="$LANG"; LANG=C; export LANG
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
84 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
85
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
86 if test "$LTCONFIG_VERSION" != "$VERSION"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87 echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
93 echo "$modename: not configured to build any kind of library" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
94 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
95 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
96 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
97
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
98 # Global variables.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
99 mode=$default_mode
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
100 nonopt=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
101 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
102 prevopt=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
103 run=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
104 show="$echo"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
105 show_help=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
106 execute_dlfiles=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
107 lo2o="s/\\.lo\$/.${objext}/"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
108 o2lo="s/\\.${objext}\$/.lo/"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
109
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
110 # Parse our command line options once, thoroughly.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
111 while test $# -gt 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
112 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
113 arg="$1"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
114 shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
115
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
116 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
117 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
118 *) optarg= ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
119 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
120
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
121 # If the previous option needs an argument, assign it.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
122 if test -n "$prev"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
123 case "$prev" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
124 execute_dlfiles)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
125 eval "$prev=\"\$$prev \$arg\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
126 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
127 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
128 eval "$prev=\$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
129 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
130 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
131
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
132 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
133 prevopt=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
134 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
135 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
136
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
137 # Have we seen a non-optional argument yet?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
138 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
139 --help)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
140 show_help=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
141 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
142
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
143 --version)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
144 echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
145 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
146 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
147
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
148 --config)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
149 sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
150 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
151 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
152
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
153 --debug)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
154 echo "$progname: enabling shell trace mode"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
155 set -x
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
156 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
157
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
158 --dry-run | -n)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
159 run=:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
160 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
161
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
162 --features)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
163 echo "host: $host"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
164 if test "$build_libtool_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
165 echo "enable shared libraries"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
166 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
167 echo "disable shared libraries"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
168 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
169 if test "$build_old_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
170 echo "enable static libraries"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
171 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
172 echo "disable static libraries"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
173 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
174 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
175 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
176
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
177 --finish) mode="finish" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
178
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
179 --mode) prevopt="--mode" prev=mode ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
180 --mode=*) mode="$optarg" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
181
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
182 --quiet | --silent)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
183 show=:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
184 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
185
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
186 -dlopen)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
187 prevopt="-dlopen"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
188 prev=execute_dlfiles
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
189 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
190
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
191 -*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
192 $echo "$modename: unrecognized option \`$arg'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
193 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
194 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
195 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
196
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
197 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
198 nonopt="$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
199 break
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
200 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
201 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
202 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
203
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
204 if test -n "$prevopt"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
205 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
206 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
207 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
208 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
209
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
210 if test -z "$show_help"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
211
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
212 # Infer the operation mode.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
213 if test -z "$mode"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
214 case "$nonopt" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
215 *cc | *++ | gcc* | *-gcc*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
216 mode=link
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
217 for arg
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
218 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
219 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
220 -c)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
221 mode=compile
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
222 break
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
223 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
224 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
225 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
226 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
227 *db | *dbx | *strace | *truss)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
228 mode=execute
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
229 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
230 *install*|cp|mv)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
231 mode=install
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
232 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
233 *rm)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
234 mode=uninstall
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
235 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
236 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
237 # If we have no mode, but dlfiles were specified, then do execute mode.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
238 test -n "$execute_dlfiles" && mode=execute
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
239
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
240 # Just use the default operation mode.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
241 if test -z "$mode"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
242 if test -n "$nonopt"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
243 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
244 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
245 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
246 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
247 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
248 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
249 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
250 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
251
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
252 # Only execute mode is allowed to have -dlopen flags.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
253 if test -n "$execute_dlfiles" && test "$mode" != execute; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
254 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
255 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
256 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
257 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
258
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
259 # Change the help message to a mode-specific one.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
260 generic_help="$help"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
261 help="Try \`$modename --help --mode=$mode' for more information."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
262
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
263 # These modes are in order of execution frequency so that they run quickly.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
264 case "$mode" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
265 # libtool compile mode
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
266 compile)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
267 modename="$modename: compile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
268 # Get the compilation command and the source file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
269 base_compile=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
270 lastarg=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
271 srcfile="$nonopt"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
272 suppress_output=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
273
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
274 user_target=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
275 for arg
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
276 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
277 # Accept any command-line options.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
278 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
279 -o)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
280 if test "$user_target" != "no"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
281 $echo "$modename: you cannot specify \`-o' more than once" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
282 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
283 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
284 user_target=next
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
285 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
286
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
287 -static)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
288 build_old_libs=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
289 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
290 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
291 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
292
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
293 case "$user_target" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
294 next)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
295 # The next one is the -o target name
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
296 user_target=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
297 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
298 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
299 yes)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
300 # We got the output file
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
301 user_target=set
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
302 libobj="$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
303 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
304 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
305 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
306
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
307 # Accept the current argument as the source file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
308 lastarg="$srcfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
309 srcfile="$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
310
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
311 # Aesthetically quote the previous argument.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
312
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
313 # Backslashify any backslashes, double quotes, and dollar signs.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
314 # These are the only characters that are still specially
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
315 # interpreted inside of double-quoted scrings.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
316 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
317
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
318 # Double-quote args containing other shell metacharacters.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
319 # Many Bourne shells cannot handle close brackets correctly in scan
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
320 # sets, so we specify it separately.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
321 case "$lastarg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
322 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
323 lastarg="\"$lastarg\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
324 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
325 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
326
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
327 # Add the previous argument to base_compile.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
328 if test -z "$base_compile"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
329 base_compile="$lastarg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
330 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
331 base_compile="$base_compile $lastarg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
332 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
333 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
334
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
335 case "$user_target" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
336 set)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
337 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
338 no)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
339 # Get the name of the library object.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
340 libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
341 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
342 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
343 $echo "$modename: you must specify a target with \`-o'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
344 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
345 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
346 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
347
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
348 # Recognize several different file suffixes.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
349 # If the user specifies -o file.o, it is replaced with file.lo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
350 xform='[cCFSfmso]'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
351 case "$libobj" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
352 *.ada) xform=ada ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
353 *.adb) xform=adb ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
354 *.ads) xform=ads ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
355 *.asm) xform=asm ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
356 *.c++) xform=c++ ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
357 *.cc) xform=cc ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
358 *.cpp) xform=cpp ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
359 *.cxx) xform=cxx ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
360 *.f90) xform=f90 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
361 *.for) xform=for ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
362 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
363
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
364 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
365
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
366 case "$libobj" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
367 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
368 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
369 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
370 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
371 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
372 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
373
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
374 if test -z "$base_compile"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
375 $echo "$modename: you must specify a compilation command" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
376 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
377 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
378 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
379
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
380 # Delete any leftover library objects.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
381 if test "$build_old_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
382 removelist="$obj $libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
383 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
384 removelist="$libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
385 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
386
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
387 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
388 trap "$run $rm $removelist; exit 1" 1 2 15
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
389
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
390 # Calculate the filename of the output object if compiler does
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
391 # not support -o with -c
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
392 if test "$compiler_c_o" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
393 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
394 lockfile="$output_obj.lock"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
395 removelist="$removelist $output_obj $lockfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
396 trap "$run $rm $removelist; exit 1" 1 2 15
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
397 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
398 need_locks=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
399 lockfile=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
400 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
401
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
402 # Lock this critical section if it is needed
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
403 # We use this script file to make the link, it avoids creating a new file
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
404 if test "$need_locks" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
405 until ln "$0" "$lockfile" 2>/dev/null; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
406 $show "Waiting for $lockfile to be removed"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
407 sleep 2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
408 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
409 elif test "$need_locks" = warn; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
410 if test -f "$lockfile"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
411 echo "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
412 *** ERROR, $lockfile exists and contains:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
413 `cat $lockfile 2>/dev/null`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
414
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
415 This indicates that another process is trying to use the same
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
416 temporary object file, and libtool could not work around it because
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
417 your compiler does not support \`-c' and \`-o' together. If you
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
418 repeat this compilation, it may succeed, by chance, but you had better
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
419 avoid parallel builds (make -j) in this platform, or get a better
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
420 compiler."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
421
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
422 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
423 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
424 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
425 echo $srcfile > "$lockfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
426 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
427
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
428 if test -n "$fix_srcfile_path"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
429 eval srcfile=\"$fix_srcfile_path\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
430 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
431
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
432 # Only build a PIC object if we are building libtool libraries.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
433 if test "$build_libtool_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
434 # Without this assignment, base_compile gets emptied.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
435 fbsd_hideous_sh_bug=$base_compile
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
436
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
437 # All platforms use -DPIC, to notify preprocessed assembler code.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
438 command="$base_compile $pic_flag -DPIC $srcfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
439 if test "$build_old_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
440 lo_libobj="$libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
441 dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
442 if test "X$dir" = "X$libobj"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
443 dir="$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
444 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
445 dir="$dir/$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
446 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
447 libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
448
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
449 if test -d "$dir"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
450 $show "$rm $libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
451 $run $rm $libobj
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
452 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
453 $show "$mkdir $dir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
454 $run $mkdir $dir
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
455 status=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
456 if test $status -ne 0 && test ! -d $dir; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
457 exit $status
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
458 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
459 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
460 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
461 if test "$compiler_o_lo" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
462 output_obj="$libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
463 command="$command -o $output_obj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
464 elif test "$compiler_c_o" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
465 output_obj="$obj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
466 command="$command -o $output_obj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
467 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
468
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
469 $show "$command"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
470 if $run eval "$command"; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
471 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
472 test -n "$output_obj" && $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
473 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
474 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
475
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
476 if test "$need_locks" = warn &&
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
477 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
478 echo "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
479 *** ERROR, $lockfile contains:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
480 `cat $lockfile 2>/dev/null`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
481
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
482 but it should contain:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
483 $srcfile
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
484
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
485 This indicates that another process is trying to use the same
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
486 temporary object file, and libtool could not work around it because
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
487 your compiler does not support \`-c' and \`-o' together. If you
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
488 repeat this compilation, it may succeed, by chance, but you had better
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
489 avoid parallel builds (make -j) in this platform, or get a better
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
490 compiler."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
491
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
492 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
493 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
494 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
495
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
496 # Just move the object if needed, then go on to compile the next one
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
497 if test x"$output_obj" != x"$libobj"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
498 $show "$mv $output_obj $libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
499 if $run $mv $output_obj $libobj; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
500 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
501 error=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
502 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
503 exit $error
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
504 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
505 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
506
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
507 # If we have no pic_flag, then copy the object into place and finish.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
508 if test -z "$pic_flag" && test "$build_old_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
509 # Rename the .lo from within objdir to obj
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
510 if test -f $obj; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
511 $show $rm $obj
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
512 $run $rm $obj
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
513 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
514
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
515 $show "$mv $libobj $obj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
516 if $run $mv $libobj $obj; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
517 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
518 error=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
519 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
520 exit $error
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
521 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
522
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
523 # Now arrange that obj and lo_libobj become the same file
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
524 $show "$LN_S $obj $lo_libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
525 if $run $LN_S $obj $lo_libobj; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
526 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
527 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
528 error=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
529 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
530 exit $error
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
531 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
532 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
533
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
534 # Allow error messages only from the first compilation.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
535 suppress_output=' >/dev/null 2>&1'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
536 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
537
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
538 # Only build a position-dependent object if we build old libraries.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
539 if test "$build_old_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
540 command="$base_compile $srcfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
541 if test "$compiler_c_o" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
542 command="$command -o $obj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
543 output_obj="$obj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
544 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
545
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
546 # Suppress compiler output if we already did a PIC compilation.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
547 command="$command$suppress_output"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
548 $show "$command"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
549 if $run eval "$command"; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
550 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
551 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
552 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
553 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
554
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
555 if test "$need_locks" = warn &&
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
556 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
557 echo "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
558 *** ERROR, $lockfile contains:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
559 `cat $lockfile 2>/dev/null`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
560
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
561 but it should contain:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
562 $srcfile
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
563
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
564 This indicates that another process is trying to use the same
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
565 temporary object file, and libtool could not work around it because
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
566 your compiler does not support \`-c' and \`-o' together. If you
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
567 repeat this compilation, it may succeed, by chance, but you had better
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
568 avoid parallel builds (make -j) in this platform, or get a better
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
569 compiler."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
570
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
571 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
572 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
573 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
574
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
575 # Just move the object if needed
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
576 if test x"$output_obj" != x"$obj"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
577 $show "$mv $output_obj $obj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
578 if $run $mv $output_obj $obj; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
579 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
580 error=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
581 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
582 exit $error
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
583 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
584 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
585
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
586 # Create an invalid libtool object if no PIC, so that we do not
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
587 # accidentally link it into a program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
588 if test "$build_libtool_libs" != yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
589 $show "echo timestamp > $libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
590 $run eval "echo timestamp > \$libobj" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
591 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
592 # Move the .lo from within objdir
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
593 $show "$mv $libobj $lo_libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
594 if $run $mv $libobj $lo_libobj; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
595 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
596 error=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
597 $run $rm $removelist
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
598 exit $error
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
599 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
600 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
601 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
602
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
603 # Unlock the critical section if it was locked
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
604 if test "$need_locks" != no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
605 $rm "$lockfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
606 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
607
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
608 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
609 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
610
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
611 # libtool link mode
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
612 link)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
613 modename="$modename: link"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
614 C_compiler="$CC" # save it, to compile generated C sources
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
615 CC="$nonopt"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
616 case "$host" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
617 *-*-cygwin* | *-*-mingw* | *-*-os2*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
618 # It is impossible to link a dll without this setting, and
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
619 # we shouldn't force the makefile maintainer to figure out
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
620 # which system we are compiling for in order to pass an extra
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
621 # flag for every libtool invokation.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
622 # allow_undefined=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
623
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
624 # FIXME: Unfortunately, there are problems with the above when trying
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
625 # to make a dll which has undefined symbols, in which case not
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
626 # even a static library is built. For now, we need to specify
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
627 # -no-undefined on the libtool link line when we can be certain
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
628 # that all symbols are satisfied, otherwise we get a static library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
629 allow_undefined=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
630
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
631 # This is a source program that is used to create dlls on Windows
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
632 # Don't remove nor modify the starting and closing comments
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
633 # /* ltdll.c starts here */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
634 # #define WIN32_LEAN_AND_MEAN
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
635 # #include <windows.h>
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
636 # #undef WIN32_LEAN_AND_MEAN
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
637 # #include <stdio.h>
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
638 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
639 # #ifdef __cplusplus
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
640 # extern "C" {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
641 # #endif
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
642 # BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
643 # #ifdef __cplusplus
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
644 # }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
645 # #endif
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
646 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
647 # #include <cygwin/cygwin_dll.h>
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
648 # DECLARE_CYGWIN_DLL( DllMain );
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
649 # HINSTANCE __hDllInstance_base;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
650 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
651 # BOOL APIENTRY
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
652 # DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
653 # {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
654 # __hDllInstance_base = hInst;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
655 # return TRUE;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
656 # }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
657 # /* ltdll.c ends here */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
658 # This is a source program that is used to create import libraries
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
659 # on Windows for dlls which lack them. Don't remove nor modify the
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
660 # starting and closing comments
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
661 # /* impgen.c starts here */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
662 # /* Copyright (C) 1999 Free Software Foundation, Inc.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
663 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
664 # This file is part of GNU libtool.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
665 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
666 # This program is free software; you can redistribute it and/or modify
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
667 # it under the terms of the GNU General Public License as published by
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
668 # the Free Software Foundation; either version 2 of the License, or
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
669 # (at your option) any later version.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
670 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
671 # This program is distributed in the hope that it will be useful,
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
672 # but WITHOUT ANY WARRANTY; without even the implied warranty of
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
673 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
674 # GNU General Public License for more details.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
675 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
676 # You should have received a copy of the GNU General Public License
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
677 # along with this program; if not, write to the Free Software
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
678 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
679 # */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
680 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
681 # #include <stdio.h> /* for printf() */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
682 # #include <unistd.h> /* for open(), lseek(), read() */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
683 # #include <fcntl.h> /* for O_RDONLY, O_BINARY */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
684 # #include <string.h> /* for strdup() */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
685 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
686 # static unsigned int
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
687 # pe_get16 (fd, offset)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
688 # int fd;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
689 # int offset;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
690 # {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
691 # unsigned char b[2];
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
692 # lseek (fd, offset, SEEK_SET);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
693 # read (fd, b, 2);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
694 # return b[0] + (b[1]<<8);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
695 # }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
696 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
697 # static unsigned int
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
698 # pe_get32 (fd, offset)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
699 # int fd;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
700 # int offset;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
701 # {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
702 # unsigned char b[4];
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
703 # lseek (fd, offset, SEEK_SET);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
704 # read (fd, b, 4);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
705 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
706 # }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
707 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
708 # static unsigned int
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
709 # pe_as32 (ptr)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
710 # void *ptr;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
711 # {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
712 # unsigned char *b = ptr;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
713 # return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
714 # }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
715 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
716 # int
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
717 # main (argc, argv)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
718 # int argc;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
719 # char *argv[];
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
720 # {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
721 # int dll;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
722 # unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
723 # unsigned long export_rva, export_size, nsections, secptr, expptr;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
724 # unsigned long name_rvas, nexp;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
725 # unsigned char *expdata, *erva;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
726 # char *filename, *dll_name;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
727 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
728 # filename = argv[1];
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
729 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
730 # dll = open(filename, O_RDONLY|O_BINARY);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
731 # if (!dll)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
732 # return 1;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
733 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
734 # dll_name = filename;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
735 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
736 # for (i=0; filename[i]; i++)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
737 # if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
738 # dll_name = filename + i +1;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
739 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
740 # pe_header_offset = pe_get32 (dll, 0x3c);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
741 # opthdr_ofs = pe_header_offset + 4 + 20;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
742 # num_entries = pe_get32 (dll, opthdr_ofs + 92);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
743 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
744 # if (num_entries < 1) /* no exports */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
745 # return 1;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
746 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
747 # export_rva = pe_get32 (dll, opthdr_ofs + 96);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
748 # export_size = pe_get32 (dll, opthdr_ofs + 100);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
749 # nsections = pe_get16 (dll, pe_header_offset + 4 +2);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
750 # secptr = (pe_header_offset + 4 + 20 +
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
751 # pe_get16 (dll, pe_header_offset + 4 + 16));
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
752 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
753 # expptr = 0;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
754 # for (i = 0; i < nsections; i++)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
755 # {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
756 # char sname[8];
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
757 # unsigned long secptr1 = secptr + 40 * i;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
758 # unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
759 # unsigned long vsize = pe_get32 (dll, secptr1 + 16);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
760 # unsigned long fptr = pe_get32 (dll, secptr1 + 20);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
761 # lseek(dll, secptr1, SEEK_SET);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
762 # read(dll, sname, 8);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
763 # if (vaddr <= export_rva && vaddr+vsize > export_rva)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
764 # {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
765 # expptr = fptr + (export_rva - vaddr);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
766 # if (export_rva + export_size > vaddr + vsize)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
767 # export_size = vsize - (export_rva - vaddr);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
768 # break;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
769 # }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
770 # }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
771 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
772 # expdata = (unsigned char*)malloc(export_size);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
773 # lseek (dll, expptr, SEEK_SET);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
774 # read (dll, expdata, export_size);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
775 # erva = expdata - export_rva;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
776 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
777 # nexp = pe_as32 (expdata+24);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
778 # name_rvas = pe_as32 (expdata+32);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
779 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
780 # printf ("EXPORTS\n");
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
781 # for (i = 0; i<nexp; i++)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
782 # {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
783 # unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
784 # printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
785 # }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
786 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
787 # return 0;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
788 # }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
789 # /* impgen.c ends here */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
790 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
791 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
792 allow_undefined=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
793 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
794 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
795 compile_command="$CC"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
796 finalize_command="$CC"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
797
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
798 compile_rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
799 finalize_rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
800 compile_shlibpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
801 finalize_shlibpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
802 convenience=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
803 old_convenience=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
804 deplibs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
805 linkopts=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
806
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
807 if test -n "$shlibpath_var"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
808 # get the directories listed in $shlibpath_var
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
809 eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
810 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
811 lib_search_path=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
812 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
813 # now prepend the system-specific ones
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
814 eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
815 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
816
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
817 avoid_version=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
818 dlfiles=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
819 dlprefiles=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
820 dlself=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
821 export_dynamic=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
822 export_symbols=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
823 export_symbols_regex=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
824 generated=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
825 libobjs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
826 link_against_libtool_libs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
827 ltlibs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
828 module=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
829 objs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
830 prefer_static_libs=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
831 preload=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
832 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
833 prevarg=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
834 release=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
835 rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
836 xrpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
837 perm_rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
838 temp_rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
839 thread_safe=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
840 vinfo=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
841
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
842 # We need to know -static, to get the right output filenames.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
843 for arg
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
844 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
845 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
846 -all-static | -static)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
847 if test "X$arg" = "X-all-static"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
848 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
849 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
850 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
851 if test -n "$link_static_flag"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
852 dlopen_self=$dlopen_self_static
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
853 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
854 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
855 if test -z "$pic_flag" && test -n "$link_static_flag"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
856 dlopen_self=$dlopen_self_static
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
857 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
858 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
859 build_libtool_libs=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
860 build_old_libs=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
861 prefer_static_libs=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
862 break
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
863 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
864 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
865 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
866
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
867 # See if our shared archives depend on static archives.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
868 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
869
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
870 # Go through the arguments, transforming them on the way.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
871 while test $# -gt 0; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
872 arg="$1"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
873 shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
874
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
875 # If the previous option needs an argument, assign it.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
876 if test -n "$prev"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
877 case "$prev" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
878 output)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
879 compile_command="$compile_command @OUTPUT@"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
880 finalize_command="$finalize_command @OUTPUT@"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
881 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
882 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
883
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
884 case "$prev" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
885 dlfiles|dlprefiles)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
886 if test "$preload" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
887 # Add the symbol object into the linking commands.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
888 compile_command="$compile_command @SYMFILE@"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
889 finalize_command="$finalize_command @SYMFILE@"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
890 preload=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
891 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
892 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
893 *.la | *.lo) ;; # We handle these cases below.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
894 self)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
895 if test "$prev" = dlprefiles; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
896 dlself=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
897 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
898 dlself=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
899 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
900 dlself=needless
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
901 export_dynamic=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
902 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
903 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
904 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
905 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
906 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
907 if test "$prev" = dlfiles; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
908 dlfiles="$dlfiles $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
909 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
910 dlprefiles="$dlprefiles $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
911 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
912 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
913 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
914 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
915 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
916 expsyms)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
917 export_symbols="$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
918 if test ! -f "$arg"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
919 $echo "$modename: symbol file \`$arg' does not exist"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
920 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
921 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
922 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
923 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
924 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
925 expsyms_regex)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
926 export_symbols_regex="$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
927 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
928 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
929 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
930 release)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
931 release="-$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
932 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
933 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
934 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
935 rpath | xrpath)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
936 # We need an absolute path.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
937 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
938 [\\/]* | [A-Za-z]:[\\/]*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
939 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
940 $echo "$modename: only absolute run-paths are allowed" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
941 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
942 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
943 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
944 if test "$prev" = rpath; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
945 case "$rpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
946 *" $arg "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
947 *) rpath="$rpath $arg" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
948 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
949 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
950 case "$xrpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
951 *" $arg "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
952 *) xrpath="$xrpath $arg" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
953 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
954 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
955 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
956 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
957 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
958 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
959 eval "$prev=\"\$arg\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
960 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
961 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
962 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
963 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
964 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
965
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
966 prevarg="$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
967
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
968 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
969 -all-static)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
970 if test -n "$link_static_flag"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
971 compile_command="$compile_command $link_static_flag"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
972 finalize_command="$finalize_command $link_static_flag"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
973 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
974 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
975 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
976
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
977 -allow-undefined)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
978 # FIXME: remove this flag sometime in the future.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
979 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
980 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
981 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
982
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
983 -avoid-version)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
984 avoid_version=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
985 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
986 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
987
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
988 -dlopen)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
989 prev=dlfiles
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
990 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
991 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
992
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
993 -dlpreopen)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
994 prev=dlprefiles
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
995 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
996 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
997
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
998 -export-dynamic)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
999 export_dynamic=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1000 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1001 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1002
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1003 -export-symbols | -export-symbols-regex)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1004 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1005 $echo "$modename: not more than one -exported-symbols argument allowed"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1006 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1007 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1008 if test "X$arg" = "X-export-symbols"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1009 prev=expsyms
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1010 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1011 prev=expsyms_regex
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1012 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1013 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1014 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1015
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1016 -L*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1017 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1018 # We need an absolute path.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1019 case "$dir" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1020 [\\/]* | [A-Za-z]:[\\/]*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1021 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1022 absdir=`cd "$dir" && pwd`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1023 if test -z "$absdir"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1024 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1025 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1026 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1027 dir="$absdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1028 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1029 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1030 case " $deplibs " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1031 *" $arg "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1032 *) deplibs="$deplibs $arg";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1033 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1034 case " $lib_search_path " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1035 *" $dir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1036 *) lib_search_path="$lib_search_path $dir";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1037 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1038 case "$host" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1039 *-*-cygwin* | *-*-mingw* | *-*-os2*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1040 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1041 case ":$dllsearchpath:" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1042 ::) dllsearchpath="$dllsearchdir";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1043 *":$dllsearchdir:"*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1044 *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1045 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1046 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1047 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1048 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1049
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1050 -l*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1051 if test "$arg" = "-lc"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1052 case "$host" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1053 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1054 # These systems don't actually have c library (as such)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1055 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1056 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1057 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1058 elif test "$arg" = "-lm"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1059 case "$host" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1060 *-*-cygwin* | *-*-beos*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1061 # These systems don't actually have math library (as such)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1062 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1063 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1064 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1065 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1066 deplibs="$deplibs $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1067 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1068
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1069 -module)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1070 module=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1071 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1072 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1073
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1074 -no-undefined)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1075 allow_undefined=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1076 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1077 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1078
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1079 -o) prev=output ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1080
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1081 -release)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1082 prev=release
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1083 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1084 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1085
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1086 -rpath)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1087 prev=rpath
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1088 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1089 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1090
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1091 -R)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1092 prev=xrpath
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1093 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1094 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1095
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1096 -R*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1097 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1098 # We need an absolute path.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1099 case "$dir" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1100 [\\/]* | [A-Za-z]:[\\/]*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1101 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1102 $echo "$modename: only absolute run-paths are allowed" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1103 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1104 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1105 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1106 case "$xrpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1107 *" $dir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1108 *) xrpath="$xrpath $dir" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1109 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1110 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1111 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1112
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1113 -static)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1114 # If we have no pic_flag, then this is the same as -all-static.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1115 if test -z "$pic_flag" && test -n "$link_static_flag"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1116 compile_command="$compile_command $link_static_flag"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1117 finalize_command="$finalize_command $link_static_flag"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1118 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1119 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1120 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1121
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1122 -thread-safe)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1123 thread_safe=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1124 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1125 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1126
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1127 -version-info)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1128 prev=vinfo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1129 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1130 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1131
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1132 # Some other compiler flag.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1133 -* | +*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1134 # Unknown arguments in both finalize_command and compile_command need
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1135 # to be aesthetically quoted because they are evaled later.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1136 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1137 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1138 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1139 arg="\"$arg\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1140 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1141 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1142 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1143
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1144 *.o | *.obj | *.a | *.lib)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1145 # A standard object.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1146 objs="$objs $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1147 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1148
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1149 *.lo)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1150 # A library object.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1151 if test "$prev" = dlfiles; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1152 dlfiles="$dlfiles $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1153 if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1154 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1155 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1156 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1157 # If libtool objects are unsupported, then we need to preload.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1158 prev=dlprefiles
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1159 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1160 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1161
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1162 if test "$prev" = dlprefiles; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1163 # Preload the old-style object.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1164 dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1165 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1166 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1167 libobjs="$libobjs $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1168 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1169
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1170 *.la)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1171 # A libtool-controlled library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1172
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1173 dlname=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1174 libdir=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1175 library_names=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1176 old_library=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1177
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1178 # Check to see that this really is a libtool archive.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1179 if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1180 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1181 $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1182 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1183 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1184
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1185 # If the library was installed with an old release of libtool,
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1186 # it will not redefine variable installed.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1187 installed=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1188
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1189 # Read the .la file
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1190 # If there is no directory component, then add one.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1191 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1192 */* | *\\*) . $arg ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1193 *) . ./$arg ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1194 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1195
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1196 # Get the name of the library we link against.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1197 linklib=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1198 for l in $old_library $library_names; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1199 linklib="$l"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1200 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1201
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1202 if test -z "$linklib"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1203 $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1204 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1205 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1206
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1207 # Find the relevant object directory and library name.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1208 name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1209
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1210 if test "X$installed" = Xyes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1211 dir="$libdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1212 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1213 dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1214 if test "X$dir" = "X$arg"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1215 dir="$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1216 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1217 dir="$dir/$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1218 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1219 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1220
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1221 if test -n "$dependency_libs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1222 # Extract -R from dependency_libs
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1223 temp_deplibs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1224 for deplib in $dependency_libs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1225 case "$deplib" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1226 -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1227 case " $rpath $xrpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1228 *" $temp_xrpath "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1229 *) xrpath="$xrpath $temp_xrpath";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1230 esac;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1231 -L*) case "$compile_command $temp_deplibs " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1232 *" $deplib "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1233 *) temp_deplibs="$temp_deplibs $deplib";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1234 esac;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1235 *) temp_deplibs="$temp_deplibs $deplib";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1236 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1237 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1238 dependency_libs="$temp_deplibs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1239 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1240
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1241 if test -z "$libdir"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1242 # It is a libtool convenience library, so add in its objects.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1243 convenience="$convenience $dir/$old_library"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1244 old_convenience="$old_convenience $dir/$old_library"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1245 deplibs="$deplibs$dependency_libs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1246 compile_command="$compile_command $dir/$old_library$dependency_libs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1247 finalize_command="$finalize_command $dir/$old_library$dependency_libs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1248 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1249 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1250
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1251 # This library was specified with -dlopen.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1252 if test "$prev" = dlfiles; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1253 dlfiles="$dlfiles $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1254 if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1255 # If there is no dlname, no dlopen support or we're linking statically,
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1256 # we need to preload.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1257 prev=dlprefiles
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1258 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1259 # We should not create a dependency on this library, but we
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1260 # may need any libraries it requires.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1261 compile_command="$compile_command$dependency_libs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1262 finalize_command="$finalize_command$dependency_libs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1263 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1264 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1265 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1266 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1267
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1268 # The library was specified with -dlpreopen.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1269 if test "$prev" = dlprefiles; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1270 # Prefer using a static library (so that no silly _DYNAMIC symbols
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1271 # are required to link).
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1272 if test -n "$old_library"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1273 dlprefiles="$dlprefiles $dir/$old_library"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1274 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1275 dlprefiles="$dlprefiles $dir/$linklib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1276 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1277 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1278 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1279
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1280 if test -n "$library_names" &&
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1281 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1282 link_against_libtool_libs="$link_against_libtool_libs $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1283 if test -n "$shlibpath_var"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1284 # Make sure the rpath contains only unique directories.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1285 case "$temp_rpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1286 *" $dir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1287 *) temp_rpath="$temp_rpath $dir" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1288 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1289 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1290
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1291 # We need an absolute path.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1292 case "$dir" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1293 [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1294 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1295 absdir=`cd "$dir" && pwd`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1296 if test -z "$absdir"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1297 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1298 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1299 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1300 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1301 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1302
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1303 # This is the magic to use -rpath.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1304 # Skip directories that are in the system default run-time
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1305 # search path, unless they have been requested with -R.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1306 case " $sys_lib_dlsearch_path " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1307 *" $absdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1308 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1309 case "$compile_rpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1310 *" $absdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1311 *) compile_rpath="$compile_rpath $absdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1312 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1313 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1314 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1315
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1316 case " $sys_lib_dlsearch_path " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1317 *" $libdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1318 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1319 case "$finalize_rpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1320 *" $libdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1321 *) finalize_rpath="$finalize_rpath $libdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1322 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1323 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1324 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1325
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1326 lib_linked=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1327 case "$hardcode_action" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1328 immediate | unsupported)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1329 if test "$hardcode_direct" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1330 compile_command="$compile_command $dir/$linklib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1331 deplibs="$deplibs $dir/$linklib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1332 case "$host" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1333 *-*-cygwin* | *-*-mingw* | *-*-os2*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1334 dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1335 if test -n "$dllsearchpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1336 dllsearchpath="$dllsearchpath:$dllsearchdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1337 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1338 dllsearchpath="$dllsearchdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1339 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1340 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1341 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1342 elif test "$hardcode_minus_L" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1343 case "$host" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1344 *-*-sunos*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1345 compile_shlibpath="$compile_shlibpath$dir:"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1346 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1347 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1348 case "$compile_command " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1349 *" -L$dir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1350 *) compile_command="$compile_command -L$dir";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1351 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1352 compile_command="$compile_command -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1353 deplibs="$deplibs -L$dir -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1354 elif test "$hardcode_shlibpath_var" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1355 case ":$compile_shlibpath:" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1356 *":$dir:"*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1357 *) compile_shlibpath="$compile_shlibpath$dir:";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1358 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1359 compile_command="$compile_command -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1360 deplibs="$deplibs -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1361 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1362 lib_linked=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1363 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1364 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1365
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1366 relink)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1367 if test "$hardcode_direct" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1368 compile_command="$compile_command $absdir/$linklib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1369 deplibs="$deplibs $absdir/$linklib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1370 elif test "$hardcode_minus_L" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1371 case "$compile_command " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1372 *" -L$absdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1373 *) compile_command="$compile_command -L$absdir";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1374 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1375 compile_command="$compile_command -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1376 deplibs="$deplibs -L$absdir -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1377 elif test "$hardcode_shlibpath_var" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1378 case ":$compile_shlibpath:" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1379 *":$absdir:"*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1380 *) compile_shlibpath="$compile_shlibpath$absdir:";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1381 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1382 compile_command="$compile_command -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1383 deplibs="$deplibs -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1384 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1385 lib_linked=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1386 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1387 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1388
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1389 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1390 lib_linked=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1391 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1392 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1393
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1394 if test "$lib_linked" != yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1395 $echo "$modename: configuration error: unsupported hardcode properties"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1396 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1397 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1398
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1399 # Finalize command for both is simple: just hardcode it.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1400 if test "$hardcode_direct" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1401 finalize_command="$finalize_command $libdir/$linklib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1402 elif test "$hardcode_minus_L" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1403 case "$finalize_command " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1404 *" -L$libdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1405 *) finalize_command="$finalize_command -L$libdir";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1406 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1407 finalize_command="$finalize_command -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1408 elif test "$hardcode_shlibpath_var" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1409 case ":$finalize_shlibpath:" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1410 *":$libdir:"*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1411 *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1412 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1413 finalize_command="$finalize_command -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1414 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1415 # We cannot seem to hardcode it, guess we'll fake it.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1416 case "$finalize_command " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1417 *" -L$dir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1418 *) finalize_command="$finalize_command -L$libdir";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1419 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1420 finalize_command="$finalize_command -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1421 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1422 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1423 # Transform directly to old archives if we don't build new libraries.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1424 if test -n "$pic_flag" && test -z "$old_library"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1425 $echo "$modename: cannot find static library for \`$arg'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1426 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1427 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1428
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1429 # Here we assume that one of hardcode_direct or hardcode_minus_L
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1430 # is not unsupported. This is valid on all known static and
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1431 # shared platforms.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1432 if test "$hardcode_direct" != unsupported; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1433 test -n "$old_library" && linklib="$old_library"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1434 compile_command="$compile_command $dir/$linklib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1435 finalize_command="$finalize_command $dir/$linklib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1436 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1437 case "$compile_command " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1438 *" -L$dir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1439 *) compile_command="$compile_command -L$dir";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1440 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1441 compile_command="$compile_command -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1442 case "$finalize_command " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1443 *" -L$dir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1444 *) finalize_command="$finalize_command -L$dir";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1445 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1446 finalize_command="$finalize_command -l$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1447 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1448 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1449
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1450 # Add in any libraries that this one depends upon.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1451 compile_command="$compile_command$dependency_libs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1452 finalize_command="$finalize_command$dependency_libs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1453 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1454 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1455
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1456 # Some other compiler argument.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1457 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1458 # Unknown arguments in both finalize_command and compile_command need
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1459 # to be aesthetically quoted because they are evaled later.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1460 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1461 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1462 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1463 arg="\"$arg\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1464 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1465 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1466 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1467 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1468
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1469 # Now actually substitute the argument into the commands.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1470 if test -n "$arg"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1471 compile_command="$compile_command $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1472 finalize_command="$finalize_command $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1473 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1474 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1475
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1476 if test -n "$prev"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1477 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1478 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1479 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1480 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1481
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1482 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1483 eval arg=\"$export_dynamic_flag_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1484 compile_command="$compile_command $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1485 finalize_command="$finalize_command $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1486 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1487
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1488 oldlibs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1489 # calculate the name of the file, without its directory
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1490 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1491 libobjs_save="$libobjs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1492
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1493 case "$output" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1494 "")
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1495 $echo "$modename: you must specify an output file" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1496 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1497 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1498 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1499
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1500 *.a | *.lib)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1501 if test -n "$link_against_libtool_libs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1502 $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1503 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1504 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1505
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1506 if test -n "$deplibs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1507 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1508 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1509
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1510 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1511 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1512 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1513
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1514 if test -n "$rpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1515 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1516 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1517
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1518 if test -n "$xrpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1519 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1520 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1521
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1522 if test -n "$vinfo"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1523 $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1524 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1525
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1526 if test -n "$release"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1527 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1528 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1529
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1530 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1531 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1532 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1533
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1534 # Now set the variables for building old libraries.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1535 build_libtool_libs=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1536 oldlibs="$output"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1537 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1538
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1539 *.la)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1540 # Make sure we only generate libraries of the form `libNAME.la'.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1541 case "$outputname" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1542 lib*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1543 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1544 eval libname=\"$libname_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1545 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1546 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1547 if test "$module" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1548 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1549 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1550 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1551 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1552 if test "$need_lib_prefix" != no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1553 # Add the "lib" prefix for modules if required
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1554 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1555 eval libname=\"$libname_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1556 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1557 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1558 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1559 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1560 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1561
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1562 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1563 if test "X$output_objdir" = "X$output"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1564 output_objdir="$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1565 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1566 output_objdir="$output_objdir/$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1567 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1568
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1569 if test -n "$objs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1570 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1571 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1572 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1573
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1574 # How the heck are we supposed to write a wrapper for a shared library?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1575 if test -n "$link_against_libtool_libs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1576 $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1577 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1578 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1579
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1580 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1581 $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1582 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1583
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1584 set dummy $rpath
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1585 if test $# -gt 2; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1586 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1587 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1588 install_libdir="$2"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1589
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1590 oldlibs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1591 if test -z "$rpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1592 if test "$build_libtool_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1593 # Building a libtool convenience library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1594 libext=al
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1595 oldlibs="$output_objdir/$libname.$libext $oldlibs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1596 build_libtool_libs=convenience
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1597 build_old_libs=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1598 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1599 dependency_libs="$deplibs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1600
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1601 if test -n "$vinfo"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1602 $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1603 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1604
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1605 if test -n "$release"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1606 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1607 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1608 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1609
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1610 # Parse the version information argument.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1611 IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1612 set dummy $vinfo 0 0 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1613 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1614
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1615 if test -n "$8"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1616 $echo "$modename: too many parameters to \`-version-info'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1617 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1618 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1619 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1620
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1621 current="$2"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1622 revision="$3"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1623 age="$4"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1624
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1625 # Check that each of the things are valid numbers.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1626 case "$current" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1627 0 | [1-9] | [1-9][0-9]*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1628 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1629 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1630 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1631 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1632 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1633 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1634
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1635 case "$revision" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1636 0 | [1-9] | [1-9][0-9]*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1637 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1638 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1639 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1640 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1641 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1642 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1643
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1644 case "$age" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1645 0 | [1-9] | [1-9][0-9]*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1646 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1647 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1648 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1649 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1650 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1651 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1652
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1653 if test $age -gt $current; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1654 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1655 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1656 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1657 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1658
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1659 # Calculate the version variables.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1660 major=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1661 versuffix=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1662 verstring=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1663 case "$version_type" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1664 none) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1665
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1666 irix)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1667 major=`expr $current - $age + 1`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1668 versuffix="$major.$revision"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1669 verstring="sgi$major.$revision"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1670
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1671 # Add in all the interfaces that we are compatible with.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1672 loop=$revision
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1673 while test $loop != 0; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1674 iface=`expr $revision - $loop`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1675 loop=`expr $loop - 1`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1676 verstring="sgi$major.$iface:$verstring"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1677 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1678 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1679
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1680 linux)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1681 major=.`expr $current - $age`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1682 versuffix="$major.$age.$revision"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1683 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1684
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1685 osf)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1686 major=`expr $current - $age`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1687 versuffix=".$current.$age.$revision"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1688 verstring="$current.$age.$revision"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1689
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1690 # Add in all the interfaces that we are compatible with.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1691 loop=$age
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1692 while test $loop != 0; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1693 iface=`expr $current - $loop`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1694 loop=`expr $loop - 1`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1695 verstring="$verstring:${iface}.0"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1696 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1697
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1698 # Make executables depend on our current version.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1699 verstring="$verstring:${current}.0"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1700 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1701
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1702 sunos)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1703 major=".$current"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1704 versuffix=".$current.$revision"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1705 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1706
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1707 freebsd-aout)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1708 major=".$current"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1709 versuffix=".$current.$revision";
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1710 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1711
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1712 freebsd-elf)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1713 major=".$current"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1714 versuffix=".$current";
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1715 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1716
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1717 windows)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1718 # Like Linux, but with '-' rather than '.', since we only
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1719 # want one extension on Windows 95.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1720 major=`expr $current - $age`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1721 versuffix="-$major-$age-$revision"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1722 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1723
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1724 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1725 $echo "$modename: unknown library version type \`$version_type'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1726 echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1727 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1728 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1729 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1730
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1731 # Clear the version info if we defaulted, and they specified a release.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1732 if test -z "$vinfo" && test -n "$release"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1733 major=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1734 verstring="0.0"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1735 if test "$need_version" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1736 versuffix=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1737 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1738 versuffix=".0.0"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1739 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1740 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1741
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1742 # Remove version info from name if versioning should be avoided
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1743 if test "$avoid_version" = yes && test "$need_version" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1744 major=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1745 versuffix=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1746 verstring=""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1747 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1748
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1749 # Check to see if the archive will have undefined symbols.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1750 if test "$allow_undefined" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1751 if test "$allow_undefined_flag" = unsupported; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1752 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1753 build_libtool_libs=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1754 build_old_libs=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1755 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1756 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1757 # Don't allow undefined symbols.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1758 allow_undefined_flag="$no_undefined_flag"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1759 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1760
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1761 dependency_libs="$deplibs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1762 case "$host" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1763 *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1764 # these systems don't actually have a c library (as such)!
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1765 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1766 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1767 # Add libc to deplibs on all other systems.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1768 deplibs="$deplibs -lc"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1769 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1770 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1771 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1772
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1773 # Create the output directory, or remove our outputs if we need to.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1774 if test -d $output_objdir; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1775 $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1776 $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1777 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1778 $show "$mkdir $output_objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1779 $run $mkdir $output_objdir
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1780 status=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1781 if test $status -ne 0 && test ! -d $output_objdir; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1782 exit $status
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1783 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1784 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1785
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1786 # Now set the variables for building old libraries.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1787 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1788 oldlibs="$oldlibs $output_objdir/$libname.$libext"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1789
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1790 # Transform .lo files to .o files.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1791 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1792 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1793
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1794 if test "$build_libtool_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1795 # Transform deplibs into only deplibs that can be linked in shared.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1796 name_save=$name
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1797 libname_save=$libname
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1798 release_save=$release
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1799 versuffix_save=$versuffix
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1800 major_save=$major
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1801 # I'm not sure if I'm treating the release correctly. I think
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1802 # release should show up in the -l (ie -lgmp5) so we don't want to
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1803 # add it in twice. Is that correct?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1804 release=""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1805 versuffix=""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1806 major=""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1807 newdeplibs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1808 droppeddeps=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1809 case "$deplibs_check_method" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1810 pass_all)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1811 # Don't check for shared/static. Everything works.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1812 # This might be a little naive. We might want to check
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1813 # whether the library exists or not. But this is on
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1814 # osf3 & osf4 and I'm not really sure... Just
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1815 # implementing what was already the behaviour.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1816 newdeplibs=$deplibs
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1817 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1818 test_compile)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1819 # This code stresses the "libraries are programs" paradigm to its
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1820 # limits. Maybe even breaks it. We compile a program, linking it
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1821 # against the deplibs as a proxy for the library. Then we can check
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1822 # whether they linked in statically or dynamically with ldd.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1823 $rm conftest.c
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1824 cat > conftest.c <<EOF
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1825 int main() { return 0; }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1826 EOF
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1827 $rm conftest
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1828 $C_compiler -o conftest conftest.c $deplibs
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1829 if test $? -eq 0 ; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1830 ldd_output=`ldd conftest`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1831 for i in $deplibs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1832 name="`expr $i : '-l\(.*\)'`"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1833 # If $name is empty we are operating on a -L argument.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1834 if test "$name" != "" ; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1835 libname=`eval \\$echo \"$libname_spec\"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1836 deplib_matches=`eval \\$echo \"$library_names_spec\"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1837 set dummy $deplib_matches
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1838 deplib_match=$2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1839 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1840 newdeplibs="$newdeplibs $i"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1841 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1842 droppeddeps=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1843 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1844 echo "*** Warning: This library needs some functionality provided by $i."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1845 echo "*** I have the capability to make that library automatically link in when"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1846 echo "*** you link to this library. But I can only do this if you have a"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1847 echo "*** shared version of the library, which you do not appear to have."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1848 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1849 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1850 newdeplibs="$newdeplibs $i"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1851 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1852 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1853 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1854 # Error occured in the first compile. Let's try to salvage the situation:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1855 # Compile a seperate program for each library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1856 for i in $deplibs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1857 name="`expr $i : '-l\(.*\)'`"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1858 # If $name is empty we are operating on a -L argument.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1859 if test "$name" != "" ; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1860 $rm conftest
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1861 $C_compiler -o conftest conftest.c $i
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1862 # Did it work?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1863 if test $? -eq 0 ; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1864 ldd_output=`ldd conftest`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1865 libname=`eval \\$echo \"$libname_spec\"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1866 deplib_matches=`eval \\$echo \"$library_names_spec\"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1867 set dummy $deplib_matches
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1868 deplib_match=$2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1869 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1870 newdeplibs="$newdeplibs $i"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1871 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1872 droppeddeps=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1873 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1874 echo "*** Warning: This library needs some functionality provided by $i."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1875 echo "*** I have the capability to make that library automatically link in when"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1876 echo "*** you link to this library. But I can only do this if you have a"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1877 echo "*** shared version of the library, which you do not appear to have."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1878 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1879 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1880 droppeddeps=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1881 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1882 echo "*** Warning! Library $i is needed by this library but I was not able to"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1883 echo "*** make it link in! You will probably need to install it or some"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1884 echo "*** library that it depends on before this library will be fully"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1885 echo "*** functional. Installing it before continuing would be even better."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1886 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1887 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1888 newdeplibs="$newdeplibs $i"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1889 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1890 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1891 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1892 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1893 file_magic*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1894 set dummy $deplibs_check_method
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1895 file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1896 for a_deplib in $deplibs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1897 name="`expr $a_deplib : '-l\(.*\)'`"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1898 # If $name is empty we are operating on a -L argument.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1899 if test "$name" != "" ; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1900 libname=`eval \\$echo \"$libname_spec\"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1901 for i in $lib_search_path; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1902 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1903 for potent_lib in $potential_libs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1904 # Follow soft links.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1905 if ls -lLd "$potlib" 2>/dev/null \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1906 | grep " -> " >/dev/null; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1907 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1908 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1909 # The statement above tries to avoid entering an
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1910 # endless loop below, in case of cyclic links.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1911 # We might still enter an endless loop, since a link
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1912 # loop can be closed while we follow links,
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1913 # but so what?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1914 potlib="$potent_lib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1915 while test -h "$potlib" 2>/dev/null; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1916 potliblink=`ls -ld $potlib | sed 's/.* -> //'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1917 case "$potliblink" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1918 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1919 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1920 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1921 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1922 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1923 | sed 10q \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1924 | egrep "$file_magic_regex" > /dev/null; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1925 newdeplibs="$newdeplibs $a_deplib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1926 a_deplib=""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1927 break 2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1928 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1929 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1930 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1931 if test -n "$a_deplib" ; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1932 droppeddeps=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1933 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1934 echo "*** Warning: This library needs some functionality provided by $a_deplib."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1935 echo "*** I have the capability to make that library automatically link in when"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1936 echo "*** you link to this library. But I can only do this if you have a"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1937 echo "*** shared version of the library, which you do not appear to have."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1938 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1939 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1940 # Add a -L argument.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1941 newdeplibs="$newdeplibs $a_deplib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1942 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1943 done # Gone through all deplibs.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1944 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1945 none | unknown | *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1946 newdeplibs=""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1947 if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1948 -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' |
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1949 grep . >/dev/null; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1950 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1951 if test "X$deplibs_check_method" = "Xnone"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1952 echo "*** Warning: inter-library dependencies are not supported in this platform."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1953 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1954 echo "*** Warning: inter-library dependencies are not known to be supported."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1955 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1956 echo "*** All declared inter-library dependencies are being dropped."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1957 droppeddeps=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1958 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1959 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1960 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1961 versuffix=$versuffix_save
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1962 major=$major_save
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1963 release=$release_save
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1964 libname=$libname_save
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1965 name=$name_save
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1966
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1967 if test "$droppeddeps" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1968 if test "$module" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1969 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1970 echo "*** Warning: libtool could not satisfy all declared inter-library"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1971 echo "*** dependencies of module $libname. Therefore, libtool will create"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1972 echo "*** a static module, that should work as long as the dlopening"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1973 echo "*** application is linked with the -dlopen flag."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1974 if test -z "$global_symbol_pipe"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1975 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1976 echo "*** However, this would only work if libtool was able to extract symbol"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1977 echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1978 echo "*** not find such a program. So, this module is probably useless."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1979 echo "*** \`nm' from GNU binutils and a full rebuild may help."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1980 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1981 if test "$build_old_libs" = no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1982 oldlibs="$output_objdir/$libname.$libext"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1983 build_libtool_libs=module
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1984 build_old_libs=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1985 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1986 build_libtool_libs=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1987 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1988 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1989 echo "*** The inter-library dependencies that have been dropped here will be"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1990 echo "*** automatically added whenever a program is linked with this library"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1991 echo "*** or is declared to -dlopen it."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1992 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1993 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1994 # Done checking deplibs!
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1995 deplibs=$newdeplibs
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1996 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1997
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1998 # All the library-specific variables (install_libdir is set above).
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1999 library_names=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2000 old_library=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2001 dlname=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2002
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2003 # Test again, we may have decided not to build it any more
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2004 if test "$build_libtool_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2005 # Get the real and link names of the library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2006 eval library_names=\"$library_names_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2007 set dummy $library_names
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2008 realname="$2"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2009 shift; shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2010
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2011 if test -n "$soname_spec"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2012 eval soname=\"$soname_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2013 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2014 soname="$realname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2015 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2016
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2017 lib="$output_objdir/$realname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2018 for link
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2019 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2020 linknames="$linknames $link"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2021 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2022
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2023 # Ensure that we have .o objects for linkers which dislike .lo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2024 # (e.g. aix) incase we are running --disable-static
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2025 for obj in $libobjs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2026 oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2027 if test ! -f $oldobj; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2028 $show "${LN_S} $obj $oldobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2029 $run ${LN_S} $obj $oldobj || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2030 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2031 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2032
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2033 # Use standard objects if they are pic
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2034 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2035
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2036 if test -n "$whole_archive_flag_spec"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2037 if test -n "$convenience"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2038 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2039 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2040 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2041 gentop="$output_objdir/${outputname}x"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2042 $show "${rm}r $gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2043 $run ${rm}r "$gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2044 $show "mkdir $gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2045 $run mkdir "$gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2046 status=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2047 if test $status -ne 0 && test ! -d "$gentop"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2048 exit $status
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2049 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2050 generated="$generated $gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2051
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2052 for xlib in $convenience; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2053 # Extract the objects.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2054 case "$xlib" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2055 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2056 *) xabs=`pwd`"/$xlib" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2057 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2058 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2059 xdir="$gentop/$xlib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2060
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2061 $show "${rm}r $xdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2062 $run ${rm}r "$xdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2063 $show "mkdir $xdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2064 $run mkdir "$xdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2065 status=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2066 if test $status -ne 0 && test ! -d "$xdir"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2067 exit $status
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2068 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2069 $show "(cd $xdir && $AR x $xabs)"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2070 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2071
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2072 libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2073 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2074 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2075
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2076 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2077 eval flag=\"$thread_safe_flag_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2078 linkopts="$linkopts $flag"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2079 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2080
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2081 # Prepare the list of exported symbols
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2082 if test -z "$export_symbols"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2083 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2084 $show "generating symbol list for \`$libname.la'"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2085 export_symbols="$output_objdir/$libname.exp"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2086 $run $rm $export_symbols
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2087 eval cmds=\"$export_symbols_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2088 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2089 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2090 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2091 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2092 $run eval "$cmd" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2093 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2094 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2095 if test -n "$export_symbols_regex"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2096 $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2097 $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2098 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2099 $run eval '$mv "${export_symbols}T" "$export_symbols"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2100 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2101 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2102 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2103
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2104 if test -n "$export_symbols" && test -n "$include_expsyms"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2105 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2106 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2107
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2108 # Do each of the archive commands.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2109 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2110 eval cmds=\"$archive_expsym_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2111 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2112 eval cmds=\"$archive_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2113 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2114 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2115 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2116 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2117 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2118 $run eval "$cmd" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2119 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2120 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2121
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2122 # Create links to the real library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2123 for linkname in $linknames; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2124 if test "$realname" != "$linkname"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2125 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2126 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2127 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2128 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2129
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2130 # If -module or -export-dynamic was specified, set the dlname.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2131 if test "$module" = yes || test "$export_dynamic" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2132 # On all known operating systems, these are identical.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2133 dlname="$soname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2134 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2135 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2136 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2137
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2138 *.lo | *.o | *.obj)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2139 if test -n "$link_against_libtool_libs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2140 $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2141 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2142 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2143
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2144 if test -n "$deplibs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2145 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2146 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2147
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2148 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2149 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2150 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2151
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2152 if test -n "$rpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2153 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2154 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2155
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2156 if test -n "$xrpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2157 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2158 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2159
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2160 if test -n "$vinfo"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2161 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2162 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2163
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2164 if test -n "$release"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2165 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2166 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2167
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2168 case "$output" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2169 *.lo)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2170 if test -n "$objs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2171 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2172 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2173 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2174 libobj="$output"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2175 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2176 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2177 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2178 libobj=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2179 obj="$output"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2180 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2181 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2182
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2183 # Delete the old objects.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2184 $run $rm $obj $libobj
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2185
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2186 # Create the old-style object.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2187 reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2188
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2189 output="$obj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2190 eval cmds=\"$reload_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2191 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2192 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2193 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2194 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2195 $run eval "$cmd" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2196 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2197 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2198
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2199 # Exit if we aren't doing a library object file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2200 test -z "$libobj" && exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2201
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2202 if test "$build_libtool_libs" != yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2203 # Create an invalid libtool object if no PIC, so that we don't
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2204 # accidentally link it into a program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2205 $show "echo timestamp > $libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2206 $run eval "echo timestamp > $libobj" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2207 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2208 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2209
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2210 if test -n "$pic_flag"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2211 # Only do commands if we really have different PIC objects.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2212 reload_objs="$libobjs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2213 output="$libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2214 eval cmds=\"$reload_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2215 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2216 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2217 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2218 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2219 $run eval "$cmd" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2220 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2221 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2222 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2223 # Just create a symlink.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2224 $show $rm $libobj
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2225 $run $rm $libobj
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2226 $show "$LN_S $obj $libobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2227 $run $LN_S $obj $libobj || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2228 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2229
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2230 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2231 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2232
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2233 # Anything else should be a program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2234 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2235 if test -n "$vinfo"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2236 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2237 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2238
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2239 if test -n "$release"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2240 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2241 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2242
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2243 if test "$preload" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2244 if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2245 test "$dlopen_self_static" = unknown; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2246 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2247 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2248 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2249
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2250 if test -n "$rpath$xrpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2251 # If the user specified any rpath flags, then add them.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2252 for libdir in $rpath $xrpath; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2253 # This is the magic to use -rpath.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2254 case "$compile_rpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2255 *" $libdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2256 *) compile_rpath="$compile_rpath $libdir" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2257 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2258 case "$finalize_rpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2259 *" $libdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2260 *) finalize_rpath="$finalize_rpath $libdir" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2261 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2262 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2263 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2264
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2265 # Now hardcode the library paths
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2266 rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2267 hardcode_libdirs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2268 for libdir in $compile_rpath $finalize_rpath; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2269 if test -n "$hardcode_libdir_flag_spec"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2270 if test -n "$hardcode_libdir_separator"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2271 if test -z "$hardcode_libdirs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2272 hardcode_libdirs="$libdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2273 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2274 # Just accumulate the unique libdirs.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2275 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2276 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2277 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2278 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2279 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2280 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2281 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2282 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2283 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2284 eval flag=\"$hardcode_libdir_flag_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2285 rpath="$rpath $flag"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2286 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2287 elif test -n "$runpath_var"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2288 case "$perm_rpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2289 *" $libdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2290 *) perm_rpath="$perm_rpath $libdir" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2291 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2292 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2293 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2294 # Substitute the hardcoded libdirs into the rpath.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2295 if test -n "$hardcode_libdir_separator" &&
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2296 test -n "$hardcode_libdirs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2297 libdir="$hardcode_libdirs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2298 eval rpath=\" $hardcode_libdir_flag_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2299 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2300 compile_rpath="$rpath"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2301
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2302 rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2303 hardcode_libdirs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2304 for libdir in $finalize_rpath; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2305 if test -n "$hardcode_libdir_flag_spec"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2306 if test -n "$hardcode_libdir_separator"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2307 if test -z "$hardcode_libdirs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2308 hardcode_libdirs="$libdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2309 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2310 # Just accumulate the unique libdirs.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2311 case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2312 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2313 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2314 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2315 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2316 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2317 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2318 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2319 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2320 eval flag=\"$hardcode_libdir_flag_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2321 rpath="$rpath $flag"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2322 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2323 elif test -n "$runpath_var"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2324 case "$finalize_perm_rpath " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2325 *" $libdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2326 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2327 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2328 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2329 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2330 # Substitute the hardcoded libdirs into the rpath.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2331 if test -n "$hardcode_libdir_separator" &&
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2332 test -n "$hardcode_libdirs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2333 libdir="$hardcode_libdirs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2334 eval rpath=\" $hardcode_libdir_flag_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2335 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2336 finalize_rpath="$rpath"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2337
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2338 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2339 if test "X$output_objdir" = "X$output"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2340 output_objdir="$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2341 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2342 output_objdir="$output_objdir/$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2343 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2344
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2345 # Create the binary in the object directory, then wrap it.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2346 if test ! -d $output_objdir; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2347 $show "$mkdir $output_objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2348 $run $mkdir $output_objdir
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2349 status=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2350 if test $status -ne 0 && test ! -d $output_objdir; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2351 exit $status
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2352 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2353 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2354
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2355 if test -n "$libobjs" && test "$build_old_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2356 # Transform all the library objects into standard objects.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2357 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2358 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2359 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2360
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2361 dlsyms=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2362 if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2363 if test -n "$NM" && test -n "$global_symbol_pipe"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2364 dlsyms="${outputname}S.c"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2365 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2366 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2367 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2368 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2369
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2370 if test -n "$dlsyms"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2371 case "$dlsyms" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2372 "") ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2373 *.c)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2374 # Discover the nlist of each of the dlfiles.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2375 nlist="$output_objdir/${outputname}.nm"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2376
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2377 $show "$rm $nlist ${nlist}S ${nlist}T"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2378 $run $rm "$nlist" "${nlist}S" "${nlist}T"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2379
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2380 # Parse the name list into a source file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2381 $show "creating $output_objdir/$dlsyms"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2382
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2383 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2384 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2385 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2386
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2387 #ifdef __cplusplus
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2388 extern \"C\" {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2389 #endif
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2390
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2391 /* Prevent the only kind of declaration conflicts we can make. */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2392 #define lt_preloaded_symbols some_other_symbol
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2393
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2394 /* External symbol declarations for the compiler. */\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2395 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2396
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2397 if test "$dlself" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2398 $show "generating symbol list for \`$output'"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2399
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2400 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2401
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2402 # Add our own program objects to the symbol list.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2403 progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2404 for arg in $progfiles; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2405 $show "extracting global C symbols from \`$arg'"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2406 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2407 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2408
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2409 if test -n "$exclude_expsyms"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2410 $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2411 $run eval '$mv "$nlist"T "$nlist"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2412 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2413
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2414 if test -n "$export_symbols_regex"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2415 $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2416 $run eval '$mv "$nlist"T "$nlist"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2417 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2418
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2419 # Prepare the list of exported symbols
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2420 if test -z "$export_symbols"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2421 export_symbols="$output_objdir/$output.exp"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2422 $run $rm $export_symbols
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2423 $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2424 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2425 $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2426 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2427 $run eval 'mv "$nlist"T "$nlist"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2428 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2429 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2430
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2431 for arg in $dlprefiles; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2432 $show "extracting global C symbols from \`$arg'"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2433 name=`echo "$arg" | sed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2434 $run eval 'echo ": $name " >> "$nlist"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2435 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2436 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2437
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2438 if test -z "$run"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2439 # Make sure we have at least an empty file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2440 test -f "$nlist" || : > "$nlist"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2441
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2442 if test -n "$exclude_expsyms"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2443 egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2444 $mv "$nlist"T "$nlist"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2445 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2446
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2447 # Try sorting and uniquifying the output.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2448 if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2449 :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2450 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2451 grep -v "^: " < "$nlist" > "$nlist"S
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2452 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2453
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2454 if test -f "$nlist"S; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2455 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2456 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2457 echo '/* NONE */' >> "$output_objdir/$dlsyms"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2458 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2459
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2460 $echo >> "$output_objdir/$dlsyms" "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2461
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2462 #undef lt_preloaded_symbols
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2463
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2464 #if defined (__STDC__) && __STDC__
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2465 # define lt_ptr_t void *
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2466 #else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2467 # define lt_ptr_t char *
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2468 # define const
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2469 #endif
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2470
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2471 /* The mapping between symbol names and symbols. */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2472 const struct {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2473 const char *name;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2474 lt_ptr_t address;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2475 }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2476 lt_preloaded_symbols[] =
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2477 {\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2478 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2479
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2480 sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2481 -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2482 < "$nlist" >> "$output_objdir/$dlsyms"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2483
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2484 $echo >> "$output_objdir/$dlsyms" "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2485 {0, (lt_ptr_t) 0}
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2486 };
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2487
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2488 /* This works around a problem in FreeBSD linker */
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2489 #ifdef FREEBSD_WORKAROUND
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2490 static const void *lt_preloaded_setup() {
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2491 return lt_preloaded_symbols;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2492 }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2493 #endif
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2494
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2495 #ifdef __cplusplus
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2496 }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2497 #endif\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2498 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2499 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2500
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2501 pic_flag_for_symtable=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2502 case "$host" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2503 # compiling the symbol table file with pic_flag works around
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2504 # a FreeBSD bug that causes programs to crash when -lm is
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2505 # linked before any other PIC object. But we must not use
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2506 # pic_flag when linking with -static. The problem exists in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2507 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2508 *-*-freebsd2*|*-*-freebsd3.0*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2509 case "$compile_command " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2510 *" -static "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2511 *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2512 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2513 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2514
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2515 # Now compile the dynamic symbol file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2516 $show "(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2517 $run eval '(cd $output_objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2518
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2519 # Clean up the generated files.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2520 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2521 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2522
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2523 # Transform the symbol file into the correct name.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2524 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2525 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2526 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2527 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2528 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2529 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2530 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2531 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2532 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2533 # We keep going just in case the user didn't refer to
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2534 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2535 # really was required.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2536
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2537 # Nullify the symbol file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2538 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2539 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2540 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2541
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2542 if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2543 # Replace the output file specification.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2544 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2545 link_command="$compile_command$compile_rpath"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2546
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2547 # We have no uninstalled library dependencies, so finalize right now.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2548 $show "$link_command"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2549 $run eval "$link_command"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2550 status=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2551
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2552 # Delete the generated files.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2553 if test -n "$dlsyms"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2554 $show "$rm $output_objdir/${outputname}S.${objext}"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2555 $run $rm "$output_objdir/${outputname}S.${objext}"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2556 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2557
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2558 exit $status
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2559 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2560
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2561 if test -n "$shlibpath_var"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2562 # We should set the shlibpath_var
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2563 rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2564 for dir in $temp_rpath; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2565 case "$dir" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2566 [\\/]* | [A-Za-z]:[\\/]*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2567 # Absolute path.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2568 rpath="$rpath$dir:"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2569 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2570 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2571 # Relative path: add a thisdir entry.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2572 rpath="$rpath\$thisdir/$dir:"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2573 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2574 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2575 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2576 temp_rpath="$rpath"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2577 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2578
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2579 if test -n "$compile_shlibpath$finalize_shlibpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2580 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2581 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2582 if test -n "$finalize_shlibpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2583 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2584 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2585
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2586 compile_var=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2587 finalize_var=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2588 if test -n "$runpath_var"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2589 if test -n "$perm_rpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2590 # We should set the runpath_var.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2591 rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2592 for dir in $perm_rpath; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2593 rpath="$rpath$dir:"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2594 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2595 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2596 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2597 if test -n "$finalize_perm_rpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2598 # We should set the runpath_var.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2599 rpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2600 for dir in $finalize_perm_rpath; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2601 rpath="$rpath$dir:"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2602 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2603 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2604 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2605 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2606
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2607 if test "$hardcode_action" = relink; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2608 # Fast installation is not supported
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2609 link_command="$compile_var$compile_command$compile_rpath"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2610 relink_command="$finalize_var$finalize_command$finalize_rpath"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2611
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2612 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2613 $echo "$modename: \`$output' will be relinked during installation" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2614 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2615 if test "$fast_install" != no; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2616 link_command="$finalize_var$compile_command$finalize_rpath"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2617 if test "$fast_install" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2618 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2619 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2620 # fast_install is set to needless
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2621 relink_command=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2622 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2623 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2624 link_command="$compile_var$compile_command$compile_rpath"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2625 relink_command="$finalize_var$finalize_command$finalize_rpath"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2626 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2627 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2628
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2629 # Replace the output file specification.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2630 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2631
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2632 # Delete the old output files.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2633 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2634
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2635 $show "$link_command"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2636 $run eval "$link_command" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2637
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2638 # Now create the wrapper script.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2639 $show "creating $output"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2640
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2641 # Quote the relink command for shipping.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2642 if test -n "$relink_command"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2643 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2644 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2645
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2646 # Quote $echo for shipping.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2647 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2648 case "$0" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2649 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2650 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2651 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2652 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2653 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2654 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2655 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2656
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2657 # Only actually do things if our run command is non-null.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2658 if test -z "$run"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2659 # win32 will think the script is a binary if it has
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2660 # a .exe suffix, so we strip it off here.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2661 case $output in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2662 *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2663 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2664 $rm $output
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2665 trap "$rm $output; exit 1" 1 2 15
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2666
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2667 $echo > $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2668 #! $SHELL
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2669
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2670 # $output - temporary wrapper script for $objdir/$outputname
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2671 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2672 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2673 # The $output program cannot be directly executed until all the libtool
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2674 # libraries that it depends on are installed.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2675 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2676 # This wrapper script should never be moved out of the build directory.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2677 # If it is, it will not operate correctly.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2678
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2679 # Sed substitution that helps us do robust quoting. It backslashifies
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2680 # metacharacters that are still active within double-quoted strings.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2681 Xsed='sed -e 1s/^X//'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2682 sed_quote_subst='$sed_quote_subst'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2683
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2684 # The HP-UX ksh and POSIX shell print the target directory to stdout
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2685 # if CDPATH is set.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2686 if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2687
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2688 relink_command=\"$relink_command\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2689
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2690 # This environment variable determines our operation mode.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2691 if test \"\$libtool_install_magic\" = \"$magic\"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2692 # install mode needs the following variable:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2693 link_against_libtool_libs='$link_against_libtool_libs'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2694 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2695 # When we are sourced in execute mode, \$file and \$echo are already set.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2696 if test \"\$libtool_execute_magic\" != \"$magic\"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2697 echo=\"$qecho\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2698 file=\"\$0\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2699 # Make sure echo works.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2700 if test \"X\$1\" = X--no-reexec; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2701 # Discard the --no-reexec flag, and continue.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2702 shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2703 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2704 # Yippee, \$echo works!
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2705 :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2706 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2707 # Restart under the correct shell, and then maybe \$echo will work.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2708 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2709 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2710 fi\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2711 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2712 $echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2713
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2714 # Find the directory that this script lives in.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2715 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2716 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2717
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2718 # Follow symbolic links until we get to the real thisdir.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2719 file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2720 while test -n \"\$file\"; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2721 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2722
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2723 # If there was a directory component, then change thisdir.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2724 if test \"x\$destdir\" != \"x\$file\"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2725 case \"\$destdir\" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2726 [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2727 *) thisdir=\"\$thisdir/\$destdir\" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2728 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2729 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2730
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2731 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2732 file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2733 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2734
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2735 # Try to get the absolute directory name.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2736 absdir=\`cd \"\$thisdir\" && pwd\`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2737 test -n \"\$absdir\" && thisdir=\"\$absdir\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2738 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2739
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2740 if test "$fast_install" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2741 echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2742 program=lt-'$outputname'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2743 progdir=\"\$thisdir/$objdir\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2744
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2745 if test ! -f \"\$progdir/\$program\" || \\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2746 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2747 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2748
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2749 file=\"\$\$-\$program\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2750
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2751 if test ! -d \"\$progdir\"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2752 $mkdir \"\$progdir\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2753 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2754 $rm \"\$progdir/\$file\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2755 fi"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2756
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2757 echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2758
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2759 # relink executable if necessary
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2760 if test -n \"\$relink_command\"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2761 if (cd \"\$thisdir\" && eval \$relink_command); then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2762 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2763 $rm \"\$progdir/\$file\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2764 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2765 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2766 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2767
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2768 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2769 { $rm \"\$progdir/\$program\";
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2770 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2771 $rm \"\$progdir/\$file\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2772 fi"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2773 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2774 echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2775 program='$outputname'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2776 progdir=\"\$thisdir/$objdir\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2777 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2778 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2779
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2780 echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2781
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2782 if test -f \"\$progdir/\$program\"; then"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2783
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2784 # Export our shlibpath_var if we have one.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2785 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2786 $echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2787 # Add our own library path to $shlibpath_var
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2788 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2789
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2790 # Some systems cannot cope with colon-terminated $shlibpath_var
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2791 # The second colon is a workaround for a bug in BeOS R4 sed
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2792 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2793
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2794 export $shlibpath_var
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2795 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2796 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2797
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2798 # fixup the dll searchpath if we need to.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2799 if test -n "$dllsearchpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2800 $echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2801 # Add the dll search path components to the executable PATH
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2802 PATH=$dllsearchpath:\$PATH
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2803 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2804 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2805
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2806 $echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2807 if test \"\$libtool_execute_magic\" != \"$magic\"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2808 # Run the actual program with our arguments.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2809 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2810 case $host in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2811 *-*-cygwin* | *-*-mingw | *-*-os2*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2812 # win32 systems need to use the prog path for dll
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2813 # lookup to work
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2814 $echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2815 exec \$progdir\\\\\$program \${1+\"\$@\"}
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2816 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2817 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2818 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2819 $echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2820 # Export the path to the program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2821 PATH=\"\$progdir:\$PATH\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2822 export PATH
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2823
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2824 exec \$program \${1+\"\$@\"}
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2825 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2826 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2827 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2828 $echo >> $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2829 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2830 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2831 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2832 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2833 # The program doesn't exist.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2834 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2835 \$echo \"This script is just a wrapper for \$program.\" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2836 echo \"See the $PACKAGE documentation for more information.\" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2837 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2838 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2839 fi\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2840 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2841 chmod +x $output
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2842 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2843 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2844 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2845 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2846
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2847 # See if we need to build an old-fashioned archive.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2848 for oldlib in $oldlibs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2849
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2850 if test "$build_libtool_libs" = convenience; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2851 oldobjs="$libobjs_save"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2852 addlibs="$convenience"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2853 build_libtool_libs=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2854 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2855 if test "$build_libtool_libs" = module; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2856 oldobjs="$libobjs_save"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2857 build_libtool_libs=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2858 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2859 oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2860 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2861 addlibs="$old_convenience"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2862 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2863
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2864 if test -n "$addlibs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2865 gentop="$output_objdir/${outputname}x"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2866 $show "${rm}r $gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2867 $run ${rm}r "$gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2868 $show "mkdir $gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2869 $run mkdir "$gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2870 status=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2871 if test $status -ne 0 && test ! -d "$gentop"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2872 exit $status
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2873 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2874 generated="$generated $gentop"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2875
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2876 # Add in members from convenience archives.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2877 for xlib in $addlibs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2878 # Extract the objects.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2879 case "$xlib" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2880 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2881 *) xabs=`pwd`"/$xlib" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2882 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2883 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2884 xdir="$gentop/$xlib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2885
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2886 $show "${rm}r $xdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2887 $run ${rm}r "$xdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2888 $show "mkdir $xdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2889 $run mkdir "$xdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2890 status=$?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2891 if test $status -ne 0 && test ! -d "$xdir"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2892 exit $status
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2893 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2894 $show "(cd $xdir && $AR x $xabs)"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2895 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2896
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2897 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2898 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2899 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2900
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2901 # Do each command in the archive commands.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2902 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2903 eval cmds=\"$old_archive_from_new_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2904 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2905 # Ensure that we have .o objects in place incase we decided
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2906 # not to build a shared library, and have fallen back to building
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2907 # static libs even though --disable-static was passed!
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2908 for oldobj in $oldobjs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2909 if test ! -f $oldobj; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2910 obj=`$echo "X$oldobj" | $Xsed -e "$o2lo"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2911 $show "${LN_S} $obj $oldobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2912 $run ${LN_S} $obj $oldobj || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2913 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2914 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2915
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2916 eval cmds=\"$old_archive_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2917 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2918 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2919 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2920 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2921 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2922 $run eval "$cmd" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2923 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2924 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2925 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2926
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2927 if test -n "$generated"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2928 $show "${rm}r$generated"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2929 $run ${rm}r$generated
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2930 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2931
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2932 # Now create the libtool archive.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2933 case "$output" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2934 *.la)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2935 old_library=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2936 test "$build_old_libs" = yes && old_library="$libname.$libext"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2937 $show "creating $output"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2938
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2939 if test -n "$xrpath"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2940 temp_xrpath=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2941 for libdir in $xrpath; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2942 temp_xrpath="$temp_xrpath -R$libdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2943 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2944 dependency_libs="$temp_xrpath $dependency_libs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2945 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2946
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2947 # Only create the output if not a dry run.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2948 if test -z "$run"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2949 for installed in no yes; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2950 if test "$installed" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2951 if test -z "$install_libdir"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2952 break
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2953 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2954 output="$output_objdir/$outputname"i
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2955 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2956 $rm $output
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2957 $echo > $output "\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2958 # $outputname - a libtool library file
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2959 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2960 #
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2961 # Please DO NOT delete this file!
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2962 # It is necessary for linking the library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2963
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2964 # The name that we can dlopen(3).
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2965 dlname='$dlname'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2966
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2967 # Names of this library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2968 library_names='$library_names'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2969
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2970 # The name of the static archive.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2971 old_library='$old_library'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2972
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2973 # Libraries that this one depends upon.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2974 dependency_libs='$dependency_libs'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2975
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2976 # Version information for $libname.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2977 current=$current
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2978 age=$age
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2979 revision=$revision
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2980
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2981 # Is this an already installed library?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2982 installed=$installed
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2983
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2984 # Directory that this library needs to be installed in:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2985 libdir='$install_libdir'\
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2986 "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2987 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2988 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2989
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2990 # Do a symbolic link so that the libtool archive can be found in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2991 # LD_LIBRARY_PATH before the program is installed.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2992 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2993 $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2994 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2995 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2996 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2997 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2998
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2999 # libtool install mode
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3000 install)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3001 modename="$modename: install"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3002
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3003 # There may be an optional sh(1) argument at the beginning of
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3004 # install_prog (especially on Windows NT).
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3005 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3006 # Aesthetically quote it.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3007 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3008 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3009 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3010 arg="\"$arg\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3011 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3012 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3013 install_prog="$arg "
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3014 arg="$1"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3015 shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3016 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3017 install_prog=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3018 arg="$nonopt"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3019 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3020
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3021 # The real first argument should be the name of the installation program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3022 # Aesthetically quote it.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3023 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3024 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3025 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3026 arg="\"$arg\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3027 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3028 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3029 install_prog="$install_prog$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3030
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3031 # We need to accept at least all the BSD install flags.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3032 dest=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3033 files=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3034 opts=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3035 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3036 install_type=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3037 isdir=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3038 stripme=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3039 for arg
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3040 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3041 if test -n "$dest"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3042 files="$files $dest"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3043 dest="$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3044 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3045 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3046
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3047 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3048 -d) isdir=yes ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3049 -f) prev="-f" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3050 -g) prev="-g" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3051 -m) prev="-m" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3052 -o) prev="-o" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3053 -s)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3054 stripme=" -s"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3055 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3056 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3057 -*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3058
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3059 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3060 # If the previous option needed an argument, then skip it.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3061 if test -n "$prev"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3062 prev=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3063 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3064 dest="$arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3065 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3066 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3067 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3068 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3069
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3070 # Aesthetically quote the argument.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3071 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3072 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3073 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3074 arg="\"$arg\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3075 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3076 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3077 install_prog="$install_prog $arg"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3078 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3079
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3080 if test -z "$install_prog"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3081 $echo "$modename: you must specify an install program" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3082 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3083 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3084 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3085
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3086 if test -n "$prev"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3087 $echo "$modename: the \`$prev' option requires an argument" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3088 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3089 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3090 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3091
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3092 if test -z "$files"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3093 if test -z "$dest"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3094 $echo "$modename: no file or destination specified" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3095 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3096 $echo "$modename: you must specify a destination" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3097 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3098 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3099 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3100 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3101
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3102 # Strip any trailing slash from the destination.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3103 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3104
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3105 # Check to see that the destination is a directory.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3106 test -d "$dest" && isdir=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3107 if test "$isdir" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3108 destdir="$dest"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3109 destname=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3110 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3111 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3112 test "X$destdir" = "X$dest" && destdir=.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3113 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3114
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3115 # Not a directory, so check to see that there is only one file specified.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3116 set dummy $files
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3117 if test $# -gt 2; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3118 $echo "$modename: \`$dest' is not a directory" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3119 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3120 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3121 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3122 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3123 case "$destdir" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3124 [\\/]* | [A-Za-z]:[\\/]*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3125 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3126 for file in $files; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3127 case "$file" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3128 *.lo) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3129 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3130 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3131 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3132 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3133 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3134 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3135 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3136 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3137 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3138
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3139 # This variable tells wrapper scripts just to set variables rather
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3140 # than running their programs.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3141 libtool_install_magic="$magic"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3142
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3143 staticlibs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3144 future_libdirs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3145 current_libdirs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3146 for file in $files; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3147
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3148 # Do each installation.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3149 case "$file" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3150 *.a | *.lib)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3151 # Do the static libraries later.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3152 staticlibs="$staticlibs $file"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3153 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3154
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3155 *.la)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3156 # Check to see that this really is a libtool archive.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3157 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3158 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3159 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3160 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3161 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3162 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3163
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3164 library_names=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3165 old_library=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3166 # If there is no directory component, then add one.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3167 case "$file" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3168 */* | *\\*) . $file ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3169 *) . ./$file ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3170 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3171
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3172 # Add the libdir to current_libdirs if it is the destination.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3173 if test "X$destdir" = "X$libdir"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3174 case "$current_libdirs " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3175 *" $libdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3176 *) current_libdirs="$current_libdirs $libdir" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3177 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3178 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3179 # Note the libdir as a future libdir.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3180 case "$future_libdirs " in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3181 *" $libdir "*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3182 *) future_libdirs="$future_libdirs $libdir" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3183 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3184 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3185
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3186 dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3187 test "X$dir" = "X$file/" && dir=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3188 dir="$dir$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3189
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3190 # See the names of the shared library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3191 set dummy $library_names
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3192 if test -n "$2"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3193 realname="$2"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3194 shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3195 shift
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3196
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3197 # Install the shared library and build the symlinks.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3198 $show "$install_prog $dir/$realname $destdir/$realname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3199 $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3200 test "X$dlname" = "X$realname" && dlname=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3201
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3202 if test $# -gt 0; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3203 # Delete the old symlinks, and create new ones.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3204 for linkname
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3205 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3206 test "X$dlname" = "X$linkname" && dlname=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3207 if test "$linkname" != "$realname"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3208 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3209 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3210 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3211 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3212 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3213
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3214 if test -n "$dlname"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3215 # Install the dynamically-loadable library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3216 $show "$install_prog $dir/$dlname $destdir/$dlname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3217 $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3218 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3219
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3220 # Do each command in the postinstall commands.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3221 lib="$destdir/$realname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3222 eval cmds=\"$postinstall_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3223 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3224 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3225 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3226 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3227 $run eval "$cmd" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3228 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3229 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3230 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3231
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3232 # Install the pseudo-library for information purposes.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3233 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3234 instname="$dir/$name"i
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3235 $show "$install_prog $instname $destdir/$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3236 $run eval "$install_prog $instname $destdir/$name" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3237
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3238 # Maybe install the static library, too.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3239 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3240 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3241
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3242 *.lo)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3243 # Install (i.e. copy) a libtool object.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3244
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3245 # Figure out destination file name, if it wasn't already specified.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3246 if test -n "$destname"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3247 destfile="$destdir/$destname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3248 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3249 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3250 destfile="$destdir/$destfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3251 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3252
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3253 # Deduce the name of the destination old-style object file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3254 case "$destfile" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3255 *.lo)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3256 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3257 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3258 *.o | *.obj)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3259 staticdest="$destfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3260 destfile=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3261 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3262 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3263 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3264 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3265 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3266 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3267 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3268
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3269 # Install the libtool object if requested.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3270 if test -n "$destfile"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3271 $show "$install_prog $file $destfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3272 $run eval "$install_prog $file $destfile" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3273 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3274
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3275 # Install the old object if enabled.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3276 if test "$build_old_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3277 # Deduce the name of the old-style object file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3278 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3279
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3280 $show "$install_prog $staticobj $staticdest"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3281 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3282 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3283 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3284 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3285
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3286 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3287 # Figure out destination file name, if it wasn't already specified.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3288 if test -n "$destname"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3289 destfile="$destdir/$destname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3290 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3291 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3292 destfile="$destdir/$destfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3293 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3294
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3295 # Do a test to see if this is really a libtool program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3296 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3297 link_against_libtool_libs=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3298 relink_command=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3299
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3300 # If there is no directory component, then add one.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3301 case "$file" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3302 */* | *\\*) . $file ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3303 *) . ./$file ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3304 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3305
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3306 # Check the variables that should have been set.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3307 if test -z "$link_against_libtool_libs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3308 $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3309 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3310 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3311
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3312 finalize=yes
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3313 for lib in $link_against_libtool_libs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3314 # Check to see that each library is installed.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3315 libdir=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3316 if test -f "$lib"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3317 # If there is no directory component, then add one.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3318 case "$lib" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3319 */* | *\\*) . $lib ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3320 *) . ./$lib ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3321 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3322 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3323 libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3324 if test -n "$libdir" && test ! -f "$libfile"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3325 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3326 finalize=no
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3327 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3328 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3329
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3330 outputname=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3331 if test "$fast_install" = no && test -n "$relink_command"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3332 if test "$finalize" = yes && test -z "$run"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3333 tmpdir="/tmp"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3334 test -n "$TMPDIR" && tmpdir="$TMPDIR"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3335 tmpdir="$tmpdir/libtool-$$"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3336 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3337 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3338 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3339 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3340 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3341 outputname="$tmpdir/$file"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3342 # Replace the output file specification.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3343 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3344
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3345 $show "$relink_command"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3346 if $run eval "$relink_command"; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3347 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3348 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3349 ${rm}r "$tmpdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3350 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3351 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3352 file="$outputname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3353 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3354 $echo "$modename: warning: cannot relink \`$file'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3355 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3356 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3357 # Install the binary that we compiled earlier.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3358 file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3359 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3360 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3361
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3362 $show "$install_prog$stripme $file $destfile"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3363 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3364 test -n "$outputname" && ${rm}r "$tmpdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3365 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3366 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3367 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3368
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3369 for file in $staticlibs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3370 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3371
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3372 # Set up the ranlib parameters.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3373 oldlib="$destdir/$name"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3374
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3375 $show "$install_prog $file $oldlib"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3376 $run eval "$install_prog \$file \$oldlib" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3377
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3378 # Do each command in the postinstall commands.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3379 eval cmds=\"$old_postinstall_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3380 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3381 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3382 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3383 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3384 $run eval "$cmd" || exit $?
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3385 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3386 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3387 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3388
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3389 if test -n "$future_libdirs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3390 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3391 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3392
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3393 if test -n "$current_libdirs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3394 # Maybe just do a dry run.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3395 test -n "$run" && current_libdirs=" -n$current_libdirs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3396 exec $SHELL $0 --finish$current_libdirs
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3397 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3398 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3399
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3400 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3401 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3402
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3403 # libtool finish mode
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3404 finish)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3405 modename="$modename: finish"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3406 libdirs="$nonopt"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3407 admincmds=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3408
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3409 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3410 for dir
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3411 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3412 libdirs="$libdirs $dir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3413 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3414
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3415 for libdir in $libdirs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3416 if test -n "$finish_cmds"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3417 # Do each command in the finish commands.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3418 eval cmds=\"$finish_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3419 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3420 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3421 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3422 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3423 $run eval "$cmd" || admincmds="$admincmds
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3424 $cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3425 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3426 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3427 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3428 if test -n "$finish_eval"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3429 # Do the single finish_eval.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3430 eval cmds=\"$finish_eval\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3431 $run eval "$cmds" || admincmds="$admincmds
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3432 $cmds"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3433 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3434 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3435 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3436
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3437 # Exit here if they wanted silent mode.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3438 test "$show" = : && exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3439
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3440 echo "----------------------------------------------------------------------"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3441 echo "Libraries have been installed in:"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3442 for libdir in $libdirs; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3443 echo " $libdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3444 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3445 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3446 echo "If you ever happen to want to link against installed libraries"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3447 echo "in a given directory, LIBDIR, you must either use libtool, and"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3448 echo "specify the full pathname of the library, or use \`-LLIBDIR'"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3449 echo "flag during linking and do at least one of the following:"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3450 if test -n "$shlibpath_var"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3451 echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3452 echo " during execution"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3453 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3454 if test -n "$runpath_var"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3455 echo " - add LIBDIR to the \`$runpath_var' environment variable"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3456 echo " during linking"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3457 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3458 if test -n "$hardcode_libdir_flag_spec"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3459 libdir=LIBDIR
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3460 eval flag=\"$hardcode_libdir_flag_spec\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3461
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3462 echo " - use the \`$flag' linker flag"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3463 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3464 if test -n "$admincmds"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3465 echo " - have your system administrator run these commands:$admincmds"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3466 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3467 if test -f /etc/ld.so.conf; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3468 echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3469 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3470 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3471 echo "See any operating system documentation about shared libraries for"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3472 echo "more information, such as the ld(1) and ld.so(8) manual pages."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3473 echo "----------------------------------------------------------------------"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3474 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3475 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3476
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3477 # libtool execute mode
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3478 execute)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3479 modename="$modename: execute"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3480
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3481 # The first argument is the command name.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3482 cmd="$nonopt"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3483 if test -z "$cmd"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3484 $echo "$modename: you must specify a COMMAND" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3485 $echo "$help"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3486 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3487 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3488
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3489 # Handle -dlopen flags immediately.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3490 for file in $execute_dlfiles; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3491 if test ! -f "$file"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3492 $echo "$modename: \`$file' is not a file" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3493 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3494 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3495 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3496
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3497 dir=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3498 case "$file" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3499 *.la)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3500 # Check to see that this really is a libtool archive.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3501 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3502 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3503 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3504 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3505 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3506 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3507
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3508 # Read the libtool library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3509 dlname=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3510 library_names=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3511
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3512 # If there is no directory component, then add one.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3513 case "$file" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3514 */* | *\\*) . $file ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3515 *) . ./$file ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3516 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3517
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3518 # Skip this library if it cannot be dlopened.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3519 if test -z "$dlname"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3520 # Warn if it was a shared library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3521 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3522 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3523 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3524
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3525 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3526 test "X$dir" = "X$file" && dir=.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3527
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3528 if test -f "$dir/$objdir/$dlname"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3529 dir="$dir/$objdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3530 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3531 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3532 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3533 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3534 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3535
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3536 *.lo)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3537 # Just add the directory containing the .lo file.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3538 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3539 test "X$dir" = "X$file" && dir=.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3540 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3541
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3542 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3543 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3544 continue
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3545 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3546 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3547
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3548 # Get the absolute pathname.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3549 absdir=`cd "$dir" && pwd`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3550 test -n "$absdir" && dir="$absdir"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3551
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3552 # Now add the directory to shlibpath_var.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3553 if eval "test -z \"\$$shlibpath_var\""; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3554 eval "$shlibpath_var=\"\$dir\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3555 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3556 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3557 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3558 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3559
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3560 # This variable tells wrapper scripts just to set shlibpath_var
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3561 # rather than running their programs.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3562 libtool_execute_magic="$magic"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3563
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3564 # Check if any of the arguments is a wrapper script.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3565 args=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3566 for file
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3567 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3568 case "$file" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3569 -*) ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3570 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3571 # Do a test to see if this is really a libtool program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3572 if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3573 # If there is no directory component, then add one.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3574 case "$file" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3575 */* | *\\*) . $file ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3576 *) . ./$file ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3577 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3578
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3579 # Transform arg to wrapped name.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3580 file="$progdir/$program"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3581 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3582 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3583 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3584 # Quote arguments (to preserve shell metacharacters).
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3585 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3586 args="$args \"$file\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3587 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3588
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3589 if test -z "$run"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3590 # Export the shlibpath_var.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3591 eval "export $shlibpath_var"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3592
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3593 # Restore saved enviroment variables
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3594 if test "${save_LC_ALL+set}" = set; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3595 LC_ALL="$save_LC_ALL"; export LC_ALL
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3596 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3597 if test "${save_LANG+set}" = set; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3598 LANG="$save_LANG"; export LANG
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3599 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3600
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3601 # Now actually exec the command.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3602 eval "exec \$cmd$args"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3603
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3604 $echo "$modename: cannot exec \$cmd$args"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3605 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3606 else
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3607 # Display what would be done.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3608 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3609 $echo "export $shlibpath_var"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3610 $echo "$cmd$args"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3611 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3612 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3613 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3614
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3615 # libtool uninstall mode
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3616 uninstall)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3617 modename="$modename: uninstall"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3618 rm="$nonopt"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3619 files=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3620
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3621 for arg
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3622 do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3623 case "$arg" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3624 -*) rm="$rm $arg" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3625 *) files="$files $arg" ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3626 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3627 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3628
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3629 if test -z "$rm"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3630 $echo "$modename: you must specify an RM program" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3631 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3632 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3633 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3634
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3635 for file in $files; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3636 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3637 test "X$dir" = "X$file" && dir=.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3638 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3639
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3640 rmfiles="$file"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3641
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3642 case "$name" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3643 *.la)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3644 # Possibly a libtool archive, so verify it.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3645 if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3646 . $dir/$name
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3647
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3648 # Delete the libtool libraries and symlinks.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3649 for n in $library_names; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3650 rmfiles="$rmfiles $dir/$n"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3651 test "X$n" = "X$dlname" && dlname=
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3652 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3653 test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3654 test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3655
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3656 $show "$rm $rmfiles"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3657 $run $rm $rmfiles
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3658
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3659 if test -n "$library_names"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3660 # Do each command in the postuninstall commands.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3661 eval cmds=\"$postuninstall_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3662 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3663 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3664 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3665 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3666 $run eval "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3667 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3668 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3669 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3670
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3671 if test -n "$old_library"; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3672 # Do each command in the old_postuninstall commands.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3673 eval cmds=\"$old_postuninstall_cmds\"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3674 IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3675 for cmd in $cmds; do
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3676 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3677 $show "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3678 $run eval "$cmd"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3679 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3680 IFS="$save_ifs"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3681 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3682
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3683 # FIXME: should reinstall the best remaining shared library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3684 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3685 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3686
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3687 *.lo)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3688 if test "$build_old_libs" = yes; then
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3689 oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3690 rmfiles="$rmfiles $dir/$oldobj"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3691 fi
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3692 $show "$rm $rmfiles"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3693 $run $rm $rmfiles
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3694 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3695
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3696 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3697 $show "$rm $rmfiles"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3698 $run $rm $rmfiles
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3699 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3700 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3701 done
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3702 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3703 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3704
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3705 "")
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3706 $echo "$modename: you must specify a MODE" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3707 $echo "$generic_help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3708 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3709 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3710 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3711
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3712 $echo "$modename: invalid operation mode \`$mode'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3713 $echo "$generic_help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3714 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3715 fi # test -z "$show_help"
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3716
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3717 # We need to display help for each of the modes.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3718 case "$mode" in
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3719 "") $echo \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3720 "Usage: $modename [OPTION]... [MODE-ARG]...
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3721
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3722 Provide generalized library-building support services.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3723
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3724 --config show all configuration variables
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3725 --debug enable verbose shell tracing
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3726 -n, --dry-run display commands without modifying any files
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3727 --features display basic configuration information and exit
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3728 --finish same as \`--mode=finish'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3729 --help display this help message and exit
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3730 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3731 --quiet same as \`--silent'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3732 --silent don't print informational messages
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3733 --version print version information
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3734
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3735 MODE must be one of the following:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3736
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3737 compile compile a source file into a libtool object
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3738 execute automatically set library path, then run a program
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3739 finish complete the installation of libtool libraries
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3740 install install libraries or executables
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3741 link create a library or an executable
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3742 uninstall remove libraries from an installed directory
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3743
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3744 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3745 a more detailed description of MODE."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3746 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3747 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3748
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3749 compile)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3750 $echo \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3751 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3752
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3753 Compile a source file into a libtool library object.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3754
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3755 This mode accepts the following additional options:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3756
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3757 -o OUTPUT-FILE set the output file name to OUTPUT-FILE
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3758 -static always build a \`.o' file suitable for static linking
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3759
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3760 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3761 from the given SOURCEFILE.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3762
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3763 The output file name is determined by removing the directory component from
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3764 SOURCEFILE, then substituting the C source code suffix \`.c' with the
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3765 library object suffix, \`.lo'."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3766 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3767
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3768 execute)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3769 $echo \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3770 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3771
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3772 Automatically set library path, then run a program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3773
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3774 This mode accepts the following additional options:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3775
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3776 -dlopen FILE add the directory containing FILE to the library path
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3777
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3778 This mode sets the library path environment variable according to \`-dlopen'
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3779 flags.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3780
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3781 If any of the ARGS are libtool executable wrappers, then they are translated
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3782 into their corresponding uninstalled binary, and any of their required library
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3783 directories are added to the library path.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3784
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3785 Then, COMMAND is executed, with ARGS as arguments."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3786 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3787
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3788 finish)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3789 $echo \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3790 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3791
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3792 Complete the installation of libtool libraries.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3793
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3794 Each LIBDIR is a directory that contains libtool libraries.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3795
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3796 The commands that this mode executes may require superuser privileges. Use
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3797 the \`--dry-run' option if you just want to see what would be executed."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3798 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3799
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3800 install)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3801 $echo \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3802 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3803
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3804 Install executables or libraries.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3805
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3806 INSTALL-COMMAND is the installation command. The first component should be
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3807 either the \`install' or \`cp' program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3808
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3809 The rest of the components are interpreted as arguments to that command (only
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3810 BSD-compatible install options are recognized)."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3811 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3812
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3813 link)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3814 $echo \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3815 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3816
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3817 Link object files or libraries together to form another library, or to
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3818 create an executable program.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3819
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3820 LINK-COMMAND is a command using the C compiler that you would use to create
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3821 a program from several object files.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3822
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3823 The following components of LINK-COMMAND are treated specially:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3824
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3825 -all-static do not do any dynamic linking at all
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3826 -avoid-version do not add a version suffix if possible
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3827 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3828 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3829 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3830 -export-symbols SYMFILE
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3831 try to export only the symbols listed in SYMFILE
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3832 -export-symbols-regex REGEX
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3833 try to export only the symbols matching REGEX
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3834 -LLIBDIR search LIBDIR for required installed libraries
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3835 -lNAME OUTPUT-FILE requires the installed library libNAME
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3836 -module build a library that can dlopened
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3837 -no-undefined declare that a library does not refer to external symbols
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3838 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3839 -release RELEASE specify package release information
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3840 -rpath LIBDIR the created library will eventually be installed in LIBDIR
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3841 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3842 -static do not do any dynamic linking of libtool libraries
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3843 -version-info CURRENT[:REVISION[:AGE]]
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3844 specify library version info [each variable defaults to 0]
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3845
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3846 All other options (arguments beginning with \`-') are ignored.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3847
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3848 Every other argument is treated as a filename. Files ending in \`.la' are
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3849 treated as uninstalled libtool libraries, other files are standard or library
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3850 object files.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3851
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3852 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3853 only library objects (\`.lo' files) may be specified, and \`-rpath' is
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3854 required, except when creating a convenience library.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3855
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3856 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3857 using \`ar' and \`ranlib', or on Windows using \`lib'.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3858
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3859 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3860 is created, otherwise an executable program is created."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3861 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3862
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3863 uninstall)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3864 $echo \
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3865 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3866
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3867 Remove libraries from an installation directory.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3868
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3869 RM is the name of the program to use to delete files associated with each FILE
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3870 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3871 to RM.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3872
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3873 If FILE is a libtool library, all the files associated with it are deleted.
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3874 Otherwise, only FILE itself is deleted using RM."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3875 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3876
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3877 *)
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3878 $echo "$modename: invalid operation mode \`$mode'" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3879 $echo "$help" 1>&2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3880 exit 1
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3881 ;;
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3882 esac
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3883
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3884 echo
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3885 $echo "Try \`$modename --help' for more information about other modes."
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3886
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3887 exit 0
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3888
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3889 # Local Variables:
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3890 # mode:shell-script
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3891 # sh-indentation:2
494816c30ca7 [gaim-migrate @ 14]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3892 # End: