Mercurial > sdl-ios-xcode
annotate ltmain.sh @ 883:50f5a29c6a17
Date: Sat, 10 Apr 2004 02:25:33 -0400
From: Glenn Maynard
To: sdl@libsdl.org
Subject: [SDL] SDL_SetVideoMode() failing and not setting an error (patch)
Running an OpenGL SDL application off 1.2.7, at SDL_InitSubSystem(SDL_INIT_VIDEO) time:
Warning: Unable to initialize AAlib mouseUsing AAlib driver: Slang driver 1.0 (slang)
SDL_SetVideoMode then fails; SDL_GetError() returns "".
The installation problem is straightforward: X (the higher priority
driver) isn't running, so SDL is falling back on aalib. However,
no error is being set when aalib fails to initialize. This also
happens with the svgalib driver.
SDL_video.c line ~653 sets mode to NULL, since aalib didn't return an
OpenGL surface. Line ~711 ("failed setting a video mode") returns NULL.
The attached patch sets an error. It's a horrible, useless error
message--it should really say eg. "aalib does not support OpenGL"; this
should probably be done earlier in the individual drivers, too.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 11 Apr 2004 19:54:40 +0000 |
parents | f9d0e03fc2ff |
children | 05c551e5bc64 |
rev | line source |
---|---|
0 | 1 # ltmain.sh - Provide generalized library-building support services. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2 # NOTE: Changing this file will not affect anything until you rerun configure. |
0 | 3 # |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5 # Free Software Foundation, Inc. |
0 | 6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 |
7 # | |
8 # This program is free software; you can redistribute it and/or modify | |
9 # it under the terms of the GNU General Public License as published by | |
10 # the Free Software Foundation; either version 2 of the License, or | |
11 # (at your option) any later version. | |
12 # | |
13 # This program is distributed in the hope that it will be useful, but | |
14 # WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
16 # General Public License for more details. | |
17 # | |
18 # You should have received a copy of the GNU General Public License | |
19 # along with this program; if not, write to the Free Software | |
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
21 # | |
22 # As a special exception to the GNU General Public License, if you | |
23 # distribute this file as part of a program that contains a | |
24 # configuration script generated by Autoconf, you may include it under | |
25 # the same distribution terms that you use for the rest of that program. | |
26 | |
27 # Check that we have a working $echo. | |
28 if test "X$1" = X--no-reexec; then | |
29 # Discard the --no-reexec flag, and continue. | |
30 shift | |
31 elif test "X$1" = X--fallback-echo; then | |
32 # Avoid inline document here, it may be left over | |
33 : | |
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then | |
35 # Yippee, $echo works! | |
36 : | |
37 else | |
38 # Restart under the correct shell, and then maybe $echo will work. | |
39 exec $SHELL "$0" --no-reexec ${1+"$@"} | |
40 fi | |
41 | |
42 if test "X$1" = X--fallback-echo; then | |
43 # used as fallback echo | |
44 shift | |
45 cat <<EOF | |
46 $* | |
47 EOF | |
48 exit 0 | |
49 fi | |
50 | |
51 # The name of this program. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
52 progname=`$echo "$0" | ${SED} 's%^.*/%%'` |
0 | 53 modename="$progname" |
54 | |
55 # Constants. | |
56 PROGRAM=ltmain.sh | |
57 PACKAGE=libtool | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
58 VERSION=1.5 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
59 TIMESTAMP=" (1.1220.2.1 2003/04/14 22:48:00)" |
0 | 60 |
61 default_mode= | |
62 help="Try \`$progname --help' for more information." | |
63 magic="%%%MAGIC variable%%%" | |
64 mkdir="mkdir" | |
65 mv="mv -f" | |
66 rm="rm -f" | |
67 | |
68 # Sed substitution that helps us do robust quoting. It backslashifies | |
69 # metacharacters that are still active within double-quoted strings. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
70 Xsed="${SED}"' -e 1s/^X//' |
0 | 71 sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
72 # test EBCDIC or ASCII |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
73 case `echo A|od -x` in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
74 *[Cc]1*) # EBCDIC based system |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
75 SP2NL="tr '\100' '\n'" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
76 NL2SP="tr '\r\n' '\100\100'" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
77 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
78 *) # Assume ASCII based system |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
79 SP2NL="tr '\040' '\012'" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
80 NL2SP="tr '\015\012' '\040\040'" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
81 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
82 esac |
0 | 83 |
84 # NLS nuisances. | |
85 # Only set LANG and LC_ALL to C if already set. | |
86 # These must not be set unconditionally because not all systems understand | |
87 # e.g. LANG=C (notably SCO). | |
88 # We save the old values to restore during execute mode. | |
89 if test "${LC_ALL+set}" = set; then | |
90 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL | |
91 fi | |
92 if test "${LANG+set}" = set; then | |
93 save_LANG="$LANG"; LANG=C; export LANG | |
94 fi | |
95 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
96 # Make sure IFS has a sensible default |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
97 : ${IFS=" "} |
0 | 98 |
99 if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
100 $echo "$modename: not configured to build any kind of library" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
101 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
0 | 102 exit 1 |
103 fi | |
104 | |
105 # Global variables. | |
106 mode=$default_mode | |
107 nonopt= | |
108 prev= | |
109 prevopt= | |
110 run= | |
111 show="$echo" | |
112 show_help= | |
113 execute_dlfiles= | |
114 lo2o="s/\\.lo\$/.${objext}/" | |
115 o2lo="s/\\.${objext}\$/.lo/" | |
116 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
117 ##################################### |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
118 # Shell function definitions: |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
119 # This seems to be the best place for them |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
120 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
121 # Need a lot of goo to handle *both* DLLs and import libs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
122 # Has to be a shell function in order to 'eat' the argument |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
123 # that is supplied when $file_magic_command is called. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
124 win32_libid () { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
125 win32_libid_type="unknown" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
126 win32_fileres=`file -L $1 2>/dev/null` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
127 case $win32_fileres in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
128 *ar\ archive\ import\ library*) # definitely import |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
129 win32_libid_type="x86 archive import" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
130 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
131 *ar\ archive*) # could be an import, or static |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
132 if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
133 grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
134 win32_nmres=`eval $NM -f posix -A $1 | \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
135 sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
136 if test "X$win32_nmres" = "Ximport" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
137 win32_libid_type="x86 archive import" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
138 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
139 win32_libid_type="x86 archive static" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
140 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
141 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
142 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
143 *DLL*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
144 win32_libid_type="x86 DLL" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
145 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
146 *executable*) # but shell scripts are "executable" too... |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
147 case $win32_fileres in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
148 *MS\ Windows\ PE\ Intel*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
149 win32_libid_type="x86 DLL" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
150 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
151 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
152 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
153 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
154 $echo $win32_libid_type |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
155 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
156 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
157 # End of Shell function definitions |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
158 ##################################### |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
159 |
0 | 160 # Parse our command line options once, thoroughly. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
161 while test "$#" -gt 0 |
0 | 162 do |
163 arg="$1" | |
164 shift | |
165 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
166 case $arg in |
0 | 167 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; |
168 *) optarg= ;; | |
169 esac | |
170 | |
171 # If the previous option needs an argument, assign it. | |
172 if test -n "$prev"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
173 case $prev in |
0 | 174 execute_dlfiles) |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
175 execute_dlfiles="$execute_dlfiles $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
176 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
177 tag) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
178 tagname="$arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
179 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
180 # Check whether tagname contains only valid characters |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
181 case $tagname in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
182 *[!-_A-Za-z0-9,/]*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
183 $echo "$progname: invalid tag name: $tagname" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
184 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
185 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
186 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
187 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
188 case $tagname in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
189 CC) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
190 # Don't test for the "default" C tag, as we know, it's there, but |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
191 # not specially marked. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
192 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
193 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
194 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
195 taglist="$taglist $tagname" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
196 # Evaluate the configuration. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
197 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
198 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
199 $echo "$progname: ignoring unknown tag $tagname" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
200 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
201 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
202 esac |
0 | 203 ;; |
204 *) | |
205 eval "$prev=\$arg" | |
206 ;; | |
207 esac | |
208 | |
209 prev= | |
210 prevopt= | |
211 continue | |
212 fi | |
213 | |
214 # Have we seen a non-optional argument yet? | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
215 case $arg in |
0 | 216 --help) |
217 show_help=yes | |
218 ;; | |
219 | |
220 --version) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
221 $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
222 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
223 $echo "Copyright (C) 2003 Free Software Foundation, Inc." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
224 $echo "This is free software; see the source for copying conditions. There is NO" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
225 $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." |
0 | 226 exit 0 |
227 ;; | |
228 | |
229 --config) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
230 ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
231 # Now print the configurations for the tags. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
232 for tagname in $taglist; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
233 ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
234 done |
0 | 235 exit 0 |
236 ;; | |
237 | |
238 --debug) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
239 $echo "$progname: enabling shell trace mode" |
0 | 240 set -x |
241 ;; | |
242 | |
243 --dry-run | -n) | |
244 run=: | |
245 ;; | |
246 | |
247 --features) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
248 $echo "host: $host" |
0 | 249 if test "$build_libtool_libs" = yes; then |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
250 $echo "enable shared libraries" |
0 | 251 else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
252 $echo "disable shared libraries" |
0 | 253 fi |
254 if test "$build_old_libs" = yes; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
255 $echo "enable static libraries" |
0 | 256 else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
257 $echo "disable static libraries" |
0 | 258 fi |
259 exit 0 | |
260 ;; | |
261 | |
262 --finish) mode="finish" ;; | |
263 | |
264 --mode) prevopt="--mode" prev=mode ;; | |
265 --mode=*) mode="$optarg" ;; | |
266 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
267 --preserve-dup-deps) duplicate_deps="yes" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
268 |
0 | 269 --quiet | --silent) |
270 show=: | |
271 ;; | |
272 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
273 --tag) prevopt="--tag" prev=tag ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
274 --tag=*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
275 set tag "$optarg" ${1+"$@"} |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
276 shift |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
277 prev=tag |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
278 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
279 |
0 | 280 -dlopen) |
281 prevopt="-dlopen" | |
282 prev=execute_dlfiles | |
283 ;; | |
284 | |
285 -*) | |
286 $echo "$modename: unrecognized option \`$arg'" 1>&2 | |
287 $echo "$help" 1>&2 | |
288 exit 1 | |
289 ;; | |
290 | |
291 *) | |
292 nonopt="$arg" | |
293 break | |
294 ;; | |
295 esac | |
296 done | |
297 | |
298 if test -n "$prevopt"; then | |
299 $echo "$modename: option \`$prevopt' requires an argument" 1>&2 | |
300 $echo "$help" 1>&2 | |
301 exit 1 | |
302 fi | |
303 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
304 # If this variable is set in any of the actions, the command in it |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
305 # will be execed at the end. This prevents here-documents from being |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
306 # left over by shells. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
307 exec_cmd= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
308 |
0 | 309 if test -z "$show_help"; then |
310 | |
311 # Infer the operation mode. | |
312 if test -z "$mode"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
313 $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
314 $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
315 case $nonopt in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
316 *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) |
0 | 317 mode=link |
318 for arg | |
319 do | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
320 case $arg in |
0 | 321 -c) |
322 mode=compile | |
323 break | |
324 ;; | |
325 esac | |
326 done | |
327 ;; | |
328 *db | *dbx | *strace | *truss) | |
329 mode=execute | |
330 ;; | |
331 *install*|cp|mv) | |
332 mode=install | |
333 ;; | |
334 *rm) | |
335 mode=uninstall | |
336 ;; | |
337 *) | |
338 # If we have no mode, but dlfiles were specified, then do execute mode. | |
339 test -n "$execute_dlfiles" && mode=execute | |
340 | |
341 # Just use the default operation mode. | |
342 if test -z "$mode"; then | |
343 if test -n "$nonopt"; then | |
344 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 | |
345 else | |
346 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 | |
347 fi | |
348 fi | |
349 ;; | |
350 esac | |
351 fi | |
352 | |
353 # Only execute mode is allowed to have -dlopen flags. | |
354 if test -n "$execute_dlfiles" && test "$mode" != execute; then | |
355 $echo "$modename: unrecognized option \`-dlopen'" 1>&2 | |
356 $echo "$help" 1>&2 | |
357 exit 1 | |
358 fi | |
359 | |
360 # Change the help message to a mode-specific one. | |
361 generic_help="$help" | |
362 help="Try \`$modename --help --mode=$mode' for more information." | |
363 | |
364 # These modes are in order of execution frequency so that they run quickly. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
365 case $mode in |
0 | 366 # libtool compile mode |
367 compile) | |
368 modename="$modename: compile" | |
369 # Get the compilation command and the source file. | |
370 base_compile= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
371 srcfile="$nonopt" # always keep a non-empty value in "srcfile" |
0 | 372 suppress_output= |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
373 arg_mode=normal |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
374 libobj= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
375 |
0 | 376 for arg |
377 do | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
378 case "$arg_mode" in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
379 arg ) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
380 # do not "continue". Instead, add this to base_compile |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
381 lastarg="$arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
382 arg_mode=normal |
0 | 383 ;; |
384 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
385 target ) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
386 libobj="$arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
387 arg_mode=normal |
0 | 388 continue |
389 ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
390 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
391 normal ) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
392 # Accept any command-line options. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
393 case $arg in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
394 -o) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
395 if test -n "$libobj" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
396 $echo "$modename: you cannot specify \`-o' more than once" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
397 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
398 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
399 arg_mode=target |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
400 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
401 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
402 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
403 -static) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
404 build_old_libs=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
405 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
406 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
407 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
408 -prefer-pic) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
409 pic_mode=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
410 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
411 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
412 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
413 -prefer-non-pic) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
414 pic_mode=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
415 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
416 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
417 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
418 -Xcompiler) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
419 arg_mode=arg # the next one goes into the "base_compile" arg list |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
420 continue # The current "srcfile" will either be retained or |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
421 ;; # replaced later. I would guess that would be a bug. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
422 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
423 -Wc,*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
424 args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
425 lastarg= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
426 save_ifs="$IFS"; IFS=',' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
427 for arg in $args; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
428 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
429 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
430 # Double-quote args containing other shell metacharacters. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
431 # Many Bourne shells cannot handle close brackets correctly |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
432 # in scan sets, so we specify it separately. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
433 case $arg in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
434 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
435 arg="\"$arg\"" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
436 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
437 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
438 lastarg="$lastarg $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
439 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
440 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
441 lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
442 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
443 # Add the arguments to base_compile. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
444 base_compile="$base_compile $lastarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
445 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
446 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
447 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
448 * ) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
449 # Accept the current argument as the source file. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
450 # The previous "srcfile" becomes the current argument. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
451 # |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
452 lastarg="$srcfile" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
453 srcfile="$arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
454 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
455 esac # case $arg |
0 | 456 ;; |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
457 esac # case $arg_mode |
0 | 458 |
459 # Aesthetically quote the previous argument. | |
460 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` | |
461 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
462 case $lastarg in |
0 | 463 # Double-quote args containing other shell metacharacters. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
464 # Many Bourne shells cannot handle close brackets correctly |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
465 # in scan sets, so we specify it separately. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
466 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
0 | 467 lastarg="\"$lastarg\"" |
468 ;; | |
469 esac | |
470 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
471 base_compile="$base_compile $lastarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
472 done # for arg |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
473 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
474 case $arg_mode in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
475 arg) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
476 $echo "$modename: you must specify an argument for -Xcompile" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
477 exit 1 |
0 | 478 ;; |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
479 target) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
480 $echo "$modename: you must specify a target with \`-o'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
481 exit 1 |
0 | 482 ;; |
483 *) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
484 # Get the name of the library object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
485 [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` |
0 | 486 ;; |
487 esac | |
488 | |
489 # Recognize several different file suffixes. | |
490 # If the user specifies -o file.o, it is replaced with file.lo | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
491 xform='[cCFSifmso]' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
492 case $libobj in |
0 | 493 *.ada) xform=ada ;; |
494 *.adb) xform=adb ;; | |
495 *.ads) xform=ads ;; | |
496 *.asm) xform=asm ;; | |
497 *.c++) xform=c++ ;; | |
498 *.cc) xform=cc ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
499 *.ii) xform=ii ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
500 *.class) xform=class ;; |
0 | 501 *.cpp) xform=cpp ;; |
502 *.cxx) xform=cxx ;; | |
503 *.f90) xform=f90 ;; | |
504 *.for) xform=for ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
505 *.java) xform=java ;; |
0 | 506 esac |
507 | |
508 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` | |
509 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
510 case $libobj in |
0 | 511 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; |
512 *) | |
513 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 | |
514 exit 1 | |
515 ;; | |
516 esac | |
517 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
518 # Infer tagged configuration to use if any are available and |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
519 # if one wasn't chosen via the "--tag" command line option. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
520 # Only attempt this if the compiler in the base compile |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
521 # command doesn't match the default compiler. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
522 if test -n "$available_tags" && test -z "$tagname"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
523 case $base_compile in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
524 # Blanks in the command may have been stripped by the calling shell, |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
525 # but not from the CC environment variable when configure was run. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
526 " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
527 # Blanks at the start of $base_compile will cause this to fail |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
528 # if we don't check for them as well. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
529 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
530 for z in $available_tags; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
531 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
532 # Evaluate the configuration. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
533 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
534 case "$base_compile " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
535 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
536 # The compiler in the base compile command matches |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
537 # the one in the tagged configuration. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
538 # Assume this is the tagged configuration we want. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
539 tagname=$z |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
540 break |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
541 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
542 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
543 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
544 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
545 # If $tagname still isn't set, then no tagged configuration |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
546 # was found and let the user know that the "--tag" command |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
547 # line option must be used. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
548 if test -z "$tagname"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
549 $echo "$modename: unable to infer tagged configuration" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
550 $echo "$modename: specify a tag with \`--tag'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
551 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
552 # else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
553 # $echo "$modename: using $tagname tagged configuration" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
554 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
555 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
556 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
557 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
558 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
559 objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
560 xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
561 if test "X$xdir" = "X$obj"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
562 xdir= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
563 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
564 xdir=$xdir/ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
565 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
566 lobj=${xdir}$objdir/$objname |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
567 |
0 | 568 if test -z "$base_compile"; then |
569 $echo "$modename: you must specify a compilation command" 1>&2 | |
570 $echo "$help" 1>&2 | |
571 exit 1 | |
572 fi | |
573 | |
574 # Delete any leftover library objects. | |
575 if test "$build_old_libs" = yes; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
576 removelist="$obj $lobj $libobj ${libobj}T" |
0 | 577 else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
578 removelist="$lobj $libobj ${libobj}T" |
0 | 579 fi |
580 | |
581 $run $rm $removelist | |
582 trap "$run $rm $removelist; exit 1" 1 2 15 | |
583 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
584 # On Cygwin there's no "real" PIC flag so we must build both object types |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
585 case $host_os in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
586 cygwin* | mingw* | pw32* | os2*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
587 pic_mode=default |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
588 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
589 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
590 if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
591 # non-PIC code in shared libraries is not supported |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
592 pic_mode=default |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
593 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
594 |
0 | 595 # Calculate the filename of the output object if compiler does |
596 # not support -o with -c | |
597 if test "$compiler_c_o" = no; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
598 output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} |
0 | 599 lockfile="$output_obj.lock" |
600 removelist="$removelist $output_obj $lockfile" | |
601 trap "$run $rm $removelist; exit 1" 1 2 15 | |
602 else | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
603 output_obj= |
0 | 604 need_locks=no |
605 lockfile= | |
606 fi | |
607 | |
608 # Lock this critical section if it is needed | |
609 # We use this script file to make the link, it avoids creating a new file | |
610 if test "$need_locks" = yes; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
611 until $run ln "$0" "$lockfile" 2>/dev/null; do |
0 | 612 $show "Waiting for $lockfile to be removed" |
613 sleep 2 | |
614 done | |
615 elif test "$need_locks" = warn; then | |
616 if test -f "$lockfile"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
617 $echo "\ |
0 | 618 *** ERROR, $lockfile exists and contains: |
619 `cat $lockfile 2>/dev/null` | |
620 | |
621 This indicates that another process is trying to use the same | |
622 temporary object file, and libtool could not work around it because | |
623 your compiler does not support \`-c' and \`-o' together. If you | |
624 repeat this compilation, it may succeed, by chance, but you had better | |
625 avoid parallel builds (make -j) in this platform, or get a better | |
626 compiler." | |
627 | |
628 $run $rm $removelist | |
629 exit 1 | |
630 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
631 $echo $srcfile > "$lockfile" |
0 | 632 fi |
633 | |
634 if test -n "$fix_srcfile_path"; then | |
635 eval srcfile=\"$fix_srcfile_path\" | |
636 fi | |
637 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
638 $run $rm "$libobj" "${libobj}T" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
639 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
640 # Create a libtool object file (analogous to a ".la" file), |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
641 # but don't create it if we're doing a dry run. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
642 test -z "$run" && cat > ${libobj}T <<EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
643 # $libobj - a libtool object file |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
644 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
645 # |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
646 # Please DO NOT delete this file! |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
647 # It is necessary for linking the library. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
648 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
649 # Name of the PIC object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
650 EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
651 |
0 | 652 # Only build a PIC object if we are building libtool libraries. |
653 if test "$build_libtool_libs" = yes; then | |
654 # Without this assignment, base_compile gets emptied. | |
655 fbsd_hideous_sh_bug=$base_compile | |
656 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
657 if test "$pic_mode" != no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
658 command="$base_compile $srcfile $pic_flag" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
659 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
660 # Don't build PIC code |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
661 command="$base_compile $srcfile" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
662 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
663 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
664 if test ! -d "${xdir}$objdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
665 $show "$mkdir ${xdir}$objdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
666 $run $mkdir ${xdir}$objdir |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
667 status=$? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
668 if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
669 exit $status |
0 | 670 fi |
671 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
672 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
673 if test -z "$output_obj"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
674 # Place PIC objects in $objdir |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
675 command="$command -o $lobj" |
0 | 676 fi |
677 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
678 $run $rm "$lobj" "$output_obj" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
679 |
0 | 680 $show "$command" |
681 if $run eval "$command"; then : | |
682 else | |
683 test -n "$output_obj" && $run $rm $removelist | |
684 exit 1 | |
685 fi | |
686 | |
687 if test "$need_locks" = warn && | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
688 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
689 $echo "\ |
0 | 690 *** ERROR, $lockfile contains: |
691 `cat $lockfile 2>/dev/null` | |
692 | |
693 but it should contain: | |
694 $srcfile | |
695 | |
696 This indicates that another process is trying to use the same | |
697 temporary object file, and libtool could not work around it because | |
698 your compiler does not support \`-c' and \`-o' together. If you | |
699 repeat this compilation, it may succeed, by chance, but you had better | |
700 avoid parallel builds (make -j) in this platform, or get a better | |
701 compiler." | |
702 | |
703 $run $rm $removelist | |
704 exit 1 | |
705 fi | |
706 | |
707 # Just move the object if needed, then go on to compile the next one | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
708 if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
709 $show "$mv $output_obj $lobj" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
710 if $run $mv $output_obj $lobj; then : |
0 | 711 else |
712 error=$? | |
713 $run $rm $removelist | |
714 exit $error | |
715 fi | |
716 fi | |
717 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
718 # Append the name of the PIC object to the libtool object file. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
719 test -z "$run" && cat >> ${libobj}T <<EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
720 pic_object='$objdir/$objname' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
721 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
722 EOF |
0 | 723 |
724 # Allow error messages only from the first compilation. | |
725 suppress_output=' >/dev/null 2>&1' | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
726 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
727 # No PIC object so indicate it doesn't exist in the libtool |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
728 # object file. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
729 test -z "$run" && cat >> ${libobj}T <<EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
730 pic_object=none |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
731 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
732 EOF |
0 | 733 fi |
734 | |
735 # Only build a position-dependent object if we build old libraries. | |
736 if test "$build_old_libs" = yes; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
737 if test "$pic_mode" != yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
738 # Don't build PIC code |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
739 command="$base_compile $srcfile" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
740 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
741 command="$base_compile $srcfile $pic_flag" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
742 fi |
0 | 743 if test "$compiler_c_o" = yes; then |
744 command="$command -o $obj" | |
745 fi | |
746 | |
747 # Suppress compiler output if we already did a PIC compilation. | |
748 command="$command$suppress_output" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
749 $run $rm "$obj" "$output_obj" |
0 | 750 $show "$command" |
751 if $run eval "$command"; then : | |
752 else | |
753 $run $rm $removelist | |
754 exit 1 | |
755 fi | |
756 | |
757 if test "$need_locks" = warn && | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
758 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
759 $echo "\ |
0 | 760 *** ERROR, $lockfile contains: |
761 `cat $lockfile 2>/dev/null` | |
762 | |
763 but it should contain: | |
764 $srcfile | |
765 | |
766 This indicates that another process is trying to use the same | |
767 temporary object file, and libtool could not work around it because | |
768 your compiler does not support \`-c' and \`-o' together. If you | |
769 repeat this compilation, it may succeed, by chance, but you had better | |
770 avoid parallel builds (make -j) in this platform, or get a better | |
771 compiler." | |
772 | |
773 $run $rm $removelist | |
774 exit 1 | |
775 fi | |
776 | |
777 # Just move the object if needed | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
778 if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then |
0 | 779 $show "$mv $output_obj $obj" |
780 if $run $mv $output_obj $obj; then : | |
781 else | |
782 error=$? | |
783 $run $rm $removelist | |
784 exit $error | |
785 fi | |
786 fi | |
787 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
788 # Append the name of the non-PIC object the libtool object file. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
789 # Only append if the libtool object file exists. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
790 test -z "$run" && cat >> ${libobj}T <<EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
791 # Name of the non-PIC object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
792 non_pic_object='$objname' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
793 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
794 EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
795 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
796 # Append the name of the non-PIC object the libtool object file. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
797 # Only append if the libtool object file exists. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
798 test -z "$run" && cat >> ${libobj}T <<EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
799 # Name of the non-PIC object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
800 non_pic_object=none |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
801 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
802 EOF |
0 | 803 fi |
804 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
805 $run $mv "${libobj}T" "${libobj}" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
806 |
0 | 807 # Unlock the critical section if it was locked |
808 if test "$need_locks" != no; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
809 $run $rm "$lockfile" |
0 | 810 fi |
811 | |
812 exit 0 | |
813 ;; | |
814 | |
815 # libtool link mode | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
816 link | relink) |
0 | 817 modename="$modename: link" |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
818 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
819 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
0 | 820 # It is impossible to link a dll without this setting, and |
821 # we shouldn't force the makefile maintainer to figure out | |
822 # which system we are compiling for in order to pass an extra | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
823 # flag for every libtool invocation. |
0 | 824 # allow_undefined=no |
825 | |
826 # FIXME: Unfortunately, there are problems with the above when trying | |
827 # to make a dll which has undefined symbols, in which case not | |
828 # even a static library is built. For now, we need to specify | |
829 # -no-undefined on the libtool link line when we can be certain | |
830 # that all symbols are satisfied, otherwise we get a static library. | |
831 allow_undefined=yes | |
832 ;; | |
833 *) | |
834 allow_undefined=yes | |
835 ;; | |
836 esac | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
837 libtool_args="$nonopt" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
838 base_compile="$nonopt" |
0 | 839 compile_command="$nonopt" |
840 finalize_command="$nonopt" | |
841 | |
842 compile_rpath= | |
843 finalize_rpath= | |
844 compile_shlibpath= | |
845 finalize_shlibpath= | |
846 convenience= | |
847 old_convenience= | |
848 deplibs= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
849 old_deplibs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
850 compiler_flags= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
851 linker_flags= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
852 dllsearchpath= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
853 lib_search_path=`pwd` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
854 inst_prefix_dir= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
855 |
0 | 856 avoid_version=no |
857 dlfiles= | |
858 dlprefiles= | |
859 dlself=no | |
860 export_dynamic=no | |
861 export_symbols= | |
862 export_symbols_regex= | |
863 generated= | |
864 libobjs= | |
865 ltlibs= | |
866 module=no | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
867 no_install=no |
0 | 868 objs= |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
869 non_pic_objects= |
0 | 870 prefer_static_libs=no |
871 preload=no | |
872 prev= | |
873 prevarg= | |
874 release= | |
875 rpath= | |
876 xrpath= | |
877 perm_rpath= | |
878 temp_rpath= | |
879 thread_safe=no | |
880 vinfo= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
881 vinfo_number=no |
0 | 882 |
883 # We need to know -static, to get the right output filenames. | |
884 for arg | |
885 do | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
886 case $arg in |
0 | 887 -all-static | -static) |
888 if test "X$arg" = "X-all-static"; then | |
889 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then | |
890 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 | |
891 fi | |
892 if test -n "$link_static_flag"; then | |
893 dlopen_self=$dlopen_self_static | |
894 fi | |
895 else | |
896 if test -z "$pic_flag" && test -n "$link_static_flag"; then | |
897 dlopen_self=$dlopen_self_static | |
898 fi | |
899 fi | |
900 build_libtool_libs=no | |
901 build_old_libs=yes | |
902 prefer_static_libs=yes | |
903 break | |
904 ;; | |
905 esac | |
906 done | |
907 | |
908 # See if our shared archives depend on static archives. | |
909 test -n "$old_archive_from_new_cmds" && build_old_libs=yes | |
910 | |
911 # Go through the arguments, transforming them on the way. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
912 while test "$#" -gt 0; do |
0 | 913 arg="$1" |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
914 base_compile="$base_compile $arg" |
0 | 915 shift |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
916 case $arg in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
917 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
918 qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
919 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
920 *) qarg=$arg ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
921 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
922 libtool_args="$libtool_args $qarg" |
0 | 923 |
924 # If the previous option needs an argument, assign it. | |
925 if test -n "$prev"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
926 case $prev in |
0 | 927 output) |
928 compile_command="$compile_command @OUTPUT@" | |
929 finalize_command="$finalize_command @OUTPUT@" | |
930 ;; | |
931 esac | |
932 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
933 case $prev in |
0 | 934 dlfiles|dlprefiles) |
935 if test "$preload" = no; then | |
936 # Add the symbol object into the linking commands. | |
937 compile_command="$compile_command @SYMFILE@" | |
938 finalize_command="$finalize_command @SYMFILE@" | |
939 preload=yes | |
940 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
941 case $arg in |
0 | 942 *.la | *.lo) ;; # We handle these cases below. |
943 force) | |
944 if test "$dlself" = no; then | |
945 dlself=needless | |
946 export_dynamic=yes | |
947 fi | |
948 prev= | |
949 continue | |
950 ;; | |
951 self) | |
952 if test "$prev" = dlprefiles; then | |
953 dlself=yes | |
954 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then | |
955 dlself=yes | |
956 else | |
957 dlself=needless | |
958 export_dynamic=yes | |
959 fi | |
960 prev= | |
961 continue | |
962 ;; | |
963 *) | |
964 if test "$prev" = dlfiles; then | |
965 dlfiles="$dlfiles $arg" | |
966 else | |
967 dlprefiles="$dlprefiles $arg" | |
968 fi | |
969 prev= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
970 continue |
0 | 971 ;; |
972 esac | |
973 ;; | |
974 expsyms) | |
975 export_symbols="$arg" | |
976 if test ! -f "$arg"; then | |
977 $echo "$modename: symbol file \`$arg' does not exist" | |
978 exit 1 | |
979 fi | |
980 prev= | |
981 continue | |
982 ;; | |
983 expsyms_regex) | |
984 export_symbols_regex="$arg" | |
985 prev= | |
986 continue | |
987 ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
988 inst_prefix) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
989 inst_prefix_dir="$arg" |
387
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
990 prev= |
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
991 continue |
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
992 ;; |
0 | 993 release) |
994 release="-$arg" | |
995 prev= | |
996 continue | |
997 ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
998 objectlist) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
999 if test -f "$arg"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1000 save_arg=$arg |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1001 moreargs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1002 for fil in `cat $save_arg` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1003 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1004 # moreargs="$moreargs $fil" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1005 arg=$fil |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1006 # A libtool-controlled object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1007 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1008 # Check to see that this really is a libtool object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1009 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1010 pic_object= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1011 non_pic_object= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1012 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1013 # Read the .lo file |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1014 # If there is no directory component, then add one. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1015 case $arg in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1016 */* | *\\*) . $arg ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1017 *) . ./$arg ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1018 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1019 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1020 if test -z "$pic_object" || \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1021 test -z "$non_pic_object" || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1022 test "$pic_object" = none && \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1023 test "$non_pic_object" = none; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1024 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1025 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1026 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1027 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1028 # Extract subdirectory from the argument. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1029 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1030 if test "X$xdir" = "X$arg"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1031 xdir= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1032 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1033 xdir="$xdir/" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1034 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1035 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1036 if test "$pic_object" != none; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1037 # Prepend the subdirectory the object is found in. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1038 pic_object="$xdir$pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1039 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1040 if test "$prev" = dlfiles; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1041 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1042 dlfiles="$dlfiles $pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1043 prev= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1044 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1045 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1046 # If libtool objects are unsupported, then we need to preload. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1047 prev=dlprefiles |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1048 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1049 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1050 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1051 # CHECK ME: I think I busted this. -Ossama |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1052 if test "$prev" = dlprefiles; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1053 # Preload the old-style object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1054 dlprefiles="$dlprefiles $pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1055 prev= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1056 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1057 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1058 # A PIC object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1059 libobjs="$libobjs $pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1060 arg="$pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1061 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1062 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1063 # Non-PIC object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1064 if test "$non_pic_object" != none; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1065 # Prepend the subdirectory the object is found in. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1066 non_pic_object="$xdir$non_pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1067 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1068 # A standard non-PIC object |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1069 non_pic_objects="$non_pic_objects $non_pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1070 if test -z "$pic_object" || test "$pic_object" = none ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1071 arg="$non_pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1072 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1073 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1074 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1075 # Only an error if not doing a dry-run. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1076 if test -z "$run"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1077 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1078 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1079 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1080 # Dry-run case. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1081 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1082 # Extract subdirectory from the argument. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1083 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1084 if test "X$xdir" = "X$arg"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1085 xdir= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1086 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1087 xdir="$xdir/" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1088 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1089 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1090 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1091 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1092 libobjs="$libobjs $pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1093 non_pic_objects="$non_pic_objects $non_pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1094 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1095 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1096 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1097 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1098 $echo "$modename: link input file \`$save_arg' does not exist" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1099 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1100 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1101 arg=$save_arg |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1102 prev= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1103 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1104 ;; |
0 | 1105 rpath | xrpath) |
1106 # We need an absolute path. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1107 case $arg in |
0 | 1108 [\\/]* | [A-Za-z]:[\\/]*) ;; |
1109 *) | |
1110 $echo "$modename: only absolute run-paths are allowed" 1>&2 | |
1111 exit 1 | |
1112 ;; | |
1113 esac | |
1114 if test "$prev" = rpath; then | |
1115 case "$rpath " in | |
1116 *" $arg "*) ;; | |
1117 *) rpath="$rpath $arg" ;; | |
1118 esac | |
1119 else | |
1120 case "$xrpath " in | |
1121 *" $arg "*) ;; | |
1122 *) xrpath="$xrpath $arg" ;; | |
1123 esac | |
1124 fi | |
1125 prev= | |
1126 continue | |
1127 ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1128 xcompiler) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1129 compiler_flags="$compiler_flags $qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1130 prev= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1131 compile_command="$compile_command $qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1132 finalize_command="$finalize_command $qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1133 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1134 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1135 xlinker) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1136 linker_flags="$linker_flags $qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1137 compiler_flags="$compiler_flags $wl$qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1138 prev= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1139 compile_command="$compile_command $wl$qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1140 finalize_command="$finalize_command $wl$qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1141 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1142 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1143 xcclinker) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1144 linker_flags="$linker_flags $qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1145 compiler_flags="$compiler_flags $qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1146 prev= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1147 compile_command="$compile_command $qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1148 finalize_command="$finalize_command $qarg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1149 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1150 ;; |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1151 framework) |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1152 case $host in |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1153 *-*-darwin*) |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1154 case "$deplibs " in |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1155 *" $qarg.framework "*) ;; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1156 *) deplibs="$deplibs $qarg.framework" # this is fixed later |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1157 ;; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1158 esac |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1159 ;; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1160 esac |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1161 prev= |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1162 continue |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1163 ;; |
0 | 1164 *) |
1165 eval "$prev=\"\$arg\"" | |
1166 prev= | |
1167 continue | |
1168 ;; | |
1169 esac | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1170 fi # test -n "$prev" |
0 | 1171 |
1172 prevarg="$arg" | |
1173 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1174 case $arg in |
0 | 1175 -all-static) |
1176 if test -n "$link_static_flag"; then | |
1177 compile_command="$compile_command $link_static_flag" | |
1178 finalize_command="$finalize_command $link_static_flag" | |
1179 fi | |
1180 continue | |
1181 ;; | |
1182 | |
1183 -allow-undefined) | |
1184 # FIXME: remove this flag sometime in the future. | |
1185 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 | |
1186 continue | |
1187 ;; | |
1188 | |
1189 -avoid-version) | |
1190 avoid_version=yes | |
1191 continue | |
1192 ;; | |
1193 | |
1194 -dlopen) | |
1195 prev=dlfiles | |
1196 continue | |
1197 ;; | |
1198 | |
1199 -dlpreopen) | |
1200 prev=dlprefiles | |
1201 continue | |
1202 ;; | |
1203 | |
1204 -export-dynamic) | |
1205 export_dynamic=yes | |
1206 continue | |
1207 ;; | |
1208 | |
1209 -export-symbols | -export-symbols-regex) | |
1210 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1211 $echo "$modename: more than one -exported-symbols argument is not allowed" |
0 | 1212 exit 1 |
1213 fi | |
1214 if test "X$arg" = "X-export-symbols"; then | |
1215 prev=expsyms | |
1216 else | |
1217 prev=expsyms_regex | |
1218 fi | |
1219 continue | |
1220 ;; | |
1221 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1222 -inst-prefix-dir) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1223 prev=inst_prefix |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1224 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1225 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1226 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1227 # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1228 # so, if we see these flags be careful not to treat them like -L |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1229 -L[A-Z][A-Z]*:*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1230 case $with_gcc/$host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1231 no/*-*-irix* | /*-*-irix*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1232 compile_command="$compile_command $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1233 finalize_command="$finalize_command $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1234 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1235 esac |
387
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
1236 continue |
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
1237 ;; |
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
1238 |
0 | 1239 -L*) |
1240 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` | |
1241 # We need an absolute path. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1242 case $dir in |
0 | 1243 [\\/]* | [A-Za-z]:[\\/]*) ;; |
1244 *) | |
1245 absdir=`cd "$dir" && pwd` | |
1246 if test -z "$absdir"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1247 $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1248 exit 1 |
0 | 1249 fi |
1250 dir="$absdir" | |
1251 ;; | |
1252 esac | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1253 case "$deplibs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1254 *" -L$dir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1255 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1256 deplibs="$deplibs -L$dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1257 lib_search_path="$lib_search_path $dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1258 ;; |
0 | 1259 esac |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1260 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1261 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1262 case :$dllsearchpath: in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1263 *":$dir:"*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1264 *) dllsearchpath="$dllsearchpath:$dir";; |
0 | 1265 esac |
1266 ;; | |
1267 esac | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1268 continue |
0 | 1269 ;; |
1270 | |
1271 -l*) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1272 if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1273 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1274 *-*-cygwin* | *-*-pw32* | *-*-beos*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1275 # These systems don't actually have a C or math library (as such) |
0 | 1276 continue |
1277 ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1278 *-*-mingw* | *-*-os2*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1279 # These systems don't actually have a C library (as such) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1280 test "X$arg" = "X-lc" && continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1281 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1282 *-*-openbsd* | *-*-freebsd*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1283 # Do not include libc due to us having libc/libc_r. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1284 test "X$arg" = "X-lc" && continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1285 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1286 *-*-rhapsody* | *-*-darwin1.[012]) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1287 # Rhapsody C and math libraries are in the System framework |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1288 deplibs="$deplibs -framework System" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1289 continue |
0 | 1290 esac |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1291 elif test "X$arg" = "X-lc_r"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1292 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1293 *-*-openbsd* | *-*-freebsd*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1294 # Do not include libc_r directly, use -pthread flag. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1295 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1296 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1297 esac |
0 | 1298 fi |
1299 deplibs="$deplibs $arg" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1300 continue |
0 | 1301 ;; |
1302 | |
1303 -module) | |
1304 module=yes | |
1305 continue | |
1306 ;; | |
1307 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1308 # gcc -m* arguments should be passed to the linker via $compiler_flags |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1309 # in order to pass architecture information to the linker |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1310 # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1311 # but this is not reliable with gcc because gcc may use -mfoo to |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1312 # select a different linker, different libraries, etc, while |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1313 # -Wl,-mfoo simply passes -mfoo to the linker. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1314 -m*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1315 # Unknown arguments in both finalize_command and compile_command need |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1316 # to be aesthetically quoted because they are evaled later. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1317 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1318 case $arg in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1319 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1320 arg="\"$arg\"" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1321 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1322 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1323 compile_command="$compile_command $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1324 finalize_command="$finalize_command $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1325 if test "$with_gcc" = "yes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1326 compiler_flags="$compiler_flags $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1327 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1328 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1329 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1330 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1331 -shrext) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1332 prev=shrext |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1333 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1334 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1335 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1336 -no-fast-install) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1337 fast_install=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1338 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1339 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1340 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1341 -no-install) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1342 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1343 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1344 # The PATH hackery in wrapper scripts is required on Windows |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1345 # in order for the loader to find any dlls it needs. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1346 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1347 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1348 fast_install=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1349 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1350 *) no_install=yes ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1351 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1352 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1353 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1354 |
0 | 1355 -no-undefined) |
1356 allow_undefined=no | |
1357 continue | |
1358 ;; | |
1359 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1360 -objectlist) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1361 prev=objectlist |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1362 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1363 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1364 |
0 | 1365 -o) prev=output ;; |
1366 | |
1367 -release) | |
1368 prev=release | |
1369 continue | |
1370 ;; | |
1371 | |
1372 -rpath) | |
1373 prev=rpath | |
1374 continue | |
1375 ;; | |
1376 | |
1377 -R) | |
1378 prev=xrpath | |
1379 continue | |
1380 ;; | |
1381 | |
1382 -R*) | |
1383 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` | |
1384 # We need an absolute path. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1385 case $dir in |
0 | 1386 [\\/]* | [A-Za-z]:[\\/]*) ;; |
1387 *) | |
1388 $echo "$modename: only absolute run-paths are allowed" 1>&2 | |
1389 exit 1 | |
1390 ;; | |
1391 esac | |
1392 case "$xrpath " in | |
1393 *" $dir "*) ;; | |
1394 *) xrpath="$xrpath $dir" ;; | |
1395 esac | |
1396 continue | |
1397 ;; | |
1398 | |
1399 -static) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1400 # The effects of -static are defined in a previous loop. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1401 # We used to do the same as -all-static on platforms that |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1402 # didn't have a PIC flag, but the assumption that the effects |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1403 # would be equivalent was wrong. It would break on at least |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1404 # Digital Unix and AIX. |
0 | 1405 continue |
1406 ;; | |
1407 | |
1408 -thread-safe) | |
1409 thread_safe=yes | |
1410 continue | |
1411 ;; | |
1412 | |
1413 -version-info) | |
1414 prev=vinfo | |
1415 continue | |
1416 ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1417 -version-number) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1418 prev=vinfo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1419 vinfo_number=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1420 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1421 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1422 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1423 -Wc,*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1424 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1425 arg= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1426 save_ifs="$IFS"; IFS=',' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1427 for flag in $args; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1428 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1429 case $flag in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1430 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1431 flag="\"$flag\"" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1432 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1433 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1434 arg="$arg $wl$flag" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1435 compiler_flags="$compiler_flags $flag" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1436 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1437 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1438 arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1439 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1440 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1441 -Wl,*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1442 args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1443 arg= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1444 save_ifs="$IFS"; IFS=',' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1445 for flag in $args; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1446 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1447 case $flag in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1448 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1449 flag="\"$flag\"" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1450 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1451 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1452 arg="$arg $wl$flag" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1453 compiler_flags="$compiler_flags $wl$flag" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1454 linker_flags="$linker_flags $flag" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1455 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1456 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1457 arg=`$echo "X$arg" | $Xsed -e "s/^ //"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1458 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1459 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1460 -Xcompiler) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1461 prev=xcompiler |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1462 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1463 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1464 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1465 -Xlinker) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1466 prev=xlinker |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1467 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1468 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1469 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1470 -XCClinker) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1471 prev=xcclinker |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1472 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1473 ;; |
0 | 1474 |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1475 -framework) |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1476 prev=framework |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1477 continue |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1478 ;; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1479 |
0 | 1480 # Some other compiler flag. |
1481 -* | +*) | |
1482 # Unknown arguments in both finalize_command and compile_command need | |
1483 # to be aesthetically quoted because they are evaled later. | |
1484 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1485 case $arg in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1486 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
0 | 1487 arg="\"$arg\"" |
1488 ;; | |
1489 esac | |
1490 ;; | |
1491 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1492 *.$objext) |
0 | 1493 # A standard object. |
1494 objs="$objs $arg" | |
1495 ;; | |
1496 | |
1497 *.lo) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1498 # A libtool-controlled object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1499 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1500 # Check to see that this really is a libtool object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1501 if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1502 pic_object= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1503 non_pic_object= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1504 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1505 # Read the .lo file |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1506 # If there is no directory component, then add one. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1507 case $arg in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1508 */* | *\\*) . $arg ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1509 *) . ./$arg ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1510 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1511 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1512 if test -z "$pic_object" || \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1513 test -z "$non_pic_object" || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1514 test "$pic_object" = none && \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1515 test "$non_pic_object" = none; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1516 $echo "$modename: cannot find name of object for \`$arg'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1517 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1518 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1519 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1520 # Extract subdirectory from the argument. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1521 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1522 if test "X$xdir" = "X$arg"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1523 xdir= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1524 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1525 xdir="$xdir/" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1526 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1527 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1528 if test "$pic_object" != none; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1529 # Prepend the subdirectory the object is found in. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1530 pic_object="$xdir$pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1531 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1532 if test "$prev" = dlfiles; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1533 if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1534 dlfiles="$dlfiles $pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1535 prev= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1536 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1537 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1538 # If libtool objects are unsupported, then we need to preload. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1539 prev=dlprefiles |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1540 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1541 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1542 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1543 # CHECK ME: I think I busted this. -Ossama |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1544 if test "$prev" = dlprefiles; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1545 # Preload the old-style object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1546 dlprefiles="$dlprefiles $pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1547 prev= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1548 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1549 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1550 # A PIC object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1551 libobjs="$libobjs $pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1552 arg="$pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1553 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1554 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1555 # Non-PIC object. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1556 if test "$non_pic_object" != none; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1557 # Prepend the subdirectory the object is found in. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1558 non_pic_object="$xdir$non_pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1559 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1560 # A standard non-PIC object |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1561 non_pic_objects="$non_pic_objects $non_pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1562 if test -z "$pic_object" || test "$pic_object" = none ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1563 arg="$non_pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1564 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1565 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1566 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1567 # Only an error if not doing a dry-run. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1568 if test -z "$run"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1569 $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1570 exit 1 |
0 | 1571 else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1572 # Dry-run case. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1573 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1574 # Extract subdirectory from the argument. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1575 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1576 if test "X$xdir" = "X$arg"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1577 xdir= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1578 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1579 xdir="$xdir/" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1580 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1581 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1582 pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1583 non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1584 libobjs="$libobjs $pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1585 non_pic_objects="$non_pic_objects $non_pic_object" |
0 | 1586 fi |
1587 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1588 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1589 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1590 *.$libext) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1591 # An archive. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1592 deplibs="$deplibs $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1593 old_deplibs="$old_deplibs $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1594 continue |
0 | 1595 ;; |
1596 | |
1597 *.la) | |
1598 # A libtool-controlled library. | |
1599 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1600 if test "$prev" = dlfiles; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1601 # This library was specified with -dlopen. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1602 dlfiles="$dlfiles $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1603 prev= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1604 elif test "$prev" = dlprefiles; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1605 # The library was specified with -dlpreopen. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1606 dlprefiles="$dlprefiles $arg" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1607 prev= |
0 | 1608 else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1609 deplibs="$deplibs $arg" |
0 | 1610 fi |
1611 continue | |
1612 ;; | |
1613 | |
1614 # Some other compiler argument. | |
1615 *) | |
1616 # Unknown arguments in both finalize_command and compile_command need | |
1617 # to be aesthetically quoted because they are evaled later. | |
1618 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1619 case $arg in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1620 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") |
0 | 1621 arg="\"$arg\"" |
1622 ;; | |
1623 esac | |
1624 ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1625 esac # arg |
0 | 1626 |
1627 # Now actually substitute the argument into the commands. | |
1628 if test -n "$arg"; then | |
1629 compile_command="$compile_command $arg" | |
1630 finalize_command="$finalize_command $arg" | |
1631 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1632 done # argument parsing loop |
0 | 1633 |
1634 if test -n "$prev"; then | |
1635 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 | |
1636 $echo "$help" 1>&2 | |
1637 exit 1 | |
1638 fi | |
1639 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1640 # Infer tagged configuration to use if any are available and |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1641 # if one wasn't chosen via the "--tag" command line option. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1642 # Only attempt this if the compiler in the base link |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1643 # command doesn't match the default compiler. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1644 if test -n "$available_tags" && test -z "$tagname"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1645 case $base_compile in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1646 # Blanks in the command may have been stripped by the calling shell, |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1647 # but not from the CC environment variable when configure was run. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1648 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1649 # Blanks at the start of $base_compile will cause this to fail |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1650 # if we don't check for them as well. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1651 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1652 for z in $available_tags; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1653 if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1654 # Evaluate the configuration. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1655 eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1656 case $base_compile in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1657 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1658 # The compiler in $compile_command matches |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1659 # the one in the tagged configuration. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1660 # Assume this is the tagged configuration we want. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1661 tagname=$z |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1662 break |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1663 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1664 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1665 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1666 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1667 # If $tagname still isn't set, then no tagged configuration |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1668 # was found and let the user know that the "--tag" command |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1669 # line option must be used. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1670 if test -z "$tagname"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1671 $echo "$modename: unable to infer tagged configuration" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1672 $echo "$modename: specify a tag with \`--tag'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1673 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1674 # else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1675 # $echo "$modename: using $tagname tagged configuration" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1676 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1677 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1678 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1679 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1680 |
0 | 1681 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then |
1682 eval arg=\"$export_dynamic_flag_spec\" | |
1683 compile_command="$compile_command $arg" | |
1684 finalize_command="$finalize_command $arg" | |
1685 fi | |
1686 | |
1687 oldlibs= | |
1688 # calculate the name of the file, without its directory | |
1689 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` | |
1690 libobjs_save="$libobjs" | |
1691 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1692 if test -n "$shlibpath_var"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1693 # get the directories listed in $shlibpath_var |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1694 eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1695 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1696 shlib_search_path= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1697 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1698 eval sys_lib_search_path=\"$sys_lib_search_path_spec\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1699 eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1700 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1701 output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1702 if test "X$output_objdir" = "X$output"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1703 output_objdir="$objdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1704 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1705 output_objdir="$output_objdir/$objdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1706 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1707 # Create the object directory. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1708 if test ! -d "$output_objdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1709 $show "$mkdir $output_objdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1710 $run $mkdir $output_objdir |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1711 status=$? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1712 if test "$status" -ne 0 && test ! -d "$output_objdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1713 exit $status |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1714 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1715 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1716 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1717 # Determine the type of output |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1718 case $output in |
0 | 1719 "") |
1720 $echo "$modename: you must specify an output file" 1>&2 | |
1721 $echo "$help" 1>&2 | |
1722 exit 1 | |
1723 ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1724 *.$libext) linkmode=oldlib ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1725 *.lo | *.$objext) linkmode=obj ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1726 *.la) linkmode=lib ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1727 *) linkmode=prog ;; # Anything else should be a program. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1728 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1729 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1730 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1731 *cygwin* | *mingw* | *pw32*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1732 # don't eliminate duplcations in $postdeps and $predeps |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1733 duplicate_compiler_generated_deps=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1734 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1735 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1736 duplicate_compiler_generated_deps=$duplicate_deps |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1737 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1738 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1739 specialdeplibs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1740 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1741 libs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1742 # Find all interdependent deplibs by searching for libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1743 # that are linked more than once (e.g. -la -lb -la) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1744 for deplib in $deplibs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1745 if test "X$duplicate_deps" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1746 case "$libs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1747 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1748 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1749 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1750 libs="$libs $deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1751 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1752 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1753 if test "$linkmode" = lib; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1754 libs="$predeps $libs $compiler_lib_search_path $postdeps" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1755 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1756 # Compute libraries that are listed more than once in $predeps |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1757 # $postdeps and mark them as special (i.e., whose duplicates are |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1758 # not to be eliminated). |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1759 pre_post_deps= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1760 if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1761 for pre_post_dep in $predeps $postdeps; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1762 case "$pre_post_deps " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1763 *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1764 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1765 pre_post_deps="$pre_post_deps $pre_post_dep" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1766 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1767 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1768 pre_post_deps= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1769 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1770 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1771 deplibs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1772 newdependency_libs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1773 newlib_search_path= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1774 need_relink=no # whether we're linking any uninstalled libtool libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1775 notinst_deplibs= # not-installed libtool libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1776 notinst_path= # paths that contain not-installed libtool libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1777 case $linkmode in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1778 lib) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1779 passes="conv link" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1780 for file in $dlfiles $dlprefiles; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1781 case $file in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1782 *.la) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1783 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1784 $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1785 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1786 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1787 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1788 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1789 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1790 prog) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1791 compile_deplibs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1792 finalize_deplibs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1793 alldeplibs=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1794 newdlfiles= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1795 newdlprefiles= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1796 passes="conv scan dlopen dlpreopen link" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1797 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1798 *) passes="conv" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1799 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1800 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1801 for pass in $passes; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1802 if test "$linkmode,$pass" = "lib,link" || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1803 test "$linkmode,$pass" = "prog,scan"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1804 libs="$deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1805 deplibs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1806 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1807 if test "$linkmode" = prog; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1808 case $pass in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1809 dlopen) libs="$dlfiles" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1810 dlpreopen) libs="$dlprefiles" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1811 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1812 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1813 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1814 if test "$pass" = dlopen; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1815 # Collect dlpreopened libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1816 save_deplibs="$deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1817 deplibs= |
0 | 1818 fi |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1819 for deplib in $libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1820 lib= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1821 found=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1822 case $deplib in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1823 -l*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1824 if test "$linkmode" != lib && test "$linkmode" != prog; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1825 $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1826 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1827 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1828 if test "$pass" = conv; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1829 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1830 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1831 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1832 name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1833 for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1834 # Search the libtool library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1835 lib="$searchdir/lib${name}.la" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1836 if test -f "$lib"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1837 found=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1838 break |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1839 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1840 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1841 if test "$found" != yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1842 # deplib doesn't seem to be a libtool library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1843 if test "$linkmode,$pass" = "prog,link"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1844 compile_deplibs="$deplib $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1845 finalize_deplibs="$deplib $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1846 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1847 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1848 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1849 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1850 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1851 else # deplib is a libtool library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1852 # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1853 # We need to do some special things here, and not later. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1854 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1855 case " $predeps $postdeps " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1856 *" $deplib "*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1857 if (${SED} -e '2q' $lib | |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1858 grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1859 library_names= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1860 old_library= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1861 case $lib in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1862 */* | *\\*) . $lib ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1863 *) . ./$lib ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1864 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1865 for l in $old_library $library_names; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1866 ll="$l" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1867 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1868 if test "X$ll" = "X$old_library" ; then # only static version available |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1869 found=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1870 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1871 test "X$ladir" = "X$lib" && ladir="." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1872 lib=$ladir/$old_library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1873 if test "$linkmode,$pass" = "prog,link"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1874 compile_deplibs="$deplib $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1875 finalize_deplibs="$deplib $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1876 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1877 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1878 test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1879 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1880 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1881 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1882 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1883 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1884 *) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1885 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1886 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1887 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1888 ;; # -l |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1889 *.framework) |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1890 if test "$linkmode,$pass" = "prog,link"; then |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1891 compile_deplibs="$deplib $compile_deplibs" |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1892 finalize_deplibs="$deplib $finalize_deplibs" |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1893 else |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1894 deplibs="$deplib $deplibs" |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1895 if test "$linkmode" = lib ; then |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1896 newdependency_libs="$deplib $newdependency_libs" |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1897 fi |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1898 fi |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1899 continue |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
1900 ;; |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1901 -L*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1902 case $linkmode in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1903 lib) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1904 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1905 test "$pass" = conv && continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1906 newdependency_libs="$deplib $newdependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1907 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1908 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1909 prog) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1910 if test "$pass" = conv; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1911 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1912 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1913 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1914 if test "$pass" = scan; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1915 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1916 newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1917 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1918 compile_deplibs="$deplib $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1919 finalize_deplibs="$deplib $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1920 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1921 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1922 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1923 $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1924 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1925 esac # linkmode |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1926 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1927 ;; # -L |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1928 -R*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1929 if test "$pass" = link; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1930 dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1931 # Make sure the xrpath contains only unique directories. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1932 case "$xrpath " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1933 *" $dir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1934 *) xrpath="$xrpath $dir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1935 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1936 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1937 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1938 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1939 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1940 *.la) lib="$deplib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1941 *.$libext) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1942 if test "$pass" = conv; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1943 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1944 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1945 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1946 case $linkmode in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1947 lib) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1948 if test "$deplibs_check_method" != pass_all; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1949 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1950 $echo "*** Warning: Trying to link with static lib archive $deplib." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1951 $echo "*** I have the capability to make that library automatically link in when" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1952 $echo "*** you link to this library. But I can only do this if you have a" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1953 $echo "*** shared version of the library, which you do not appear to have" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1954 $echo "*** because the file extensions .$libext of this argument makes me believe" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1955 $echo "*** that it is just a static archive that I should not used here." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1956 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1957 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1958 $echo "*** Warning: Linking the shared library $output against the" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1959 $echo "*** static library $deplib is not portable!" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1960 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1961 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1962 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1963 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1964 prog) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1965 if test "$pass" != link; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1966 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1967 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1968 compile_deplibs="$deplib $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1969 finalize_deplibs="$deplib $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1970 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1971 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1972 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1973 esac # linkmode |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1974 ;; # *.$libext |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1975 *.lo | *.$objext) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1976 if test "$pass" = conv; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1977 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1978 elif test "$linkmode" = prog; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1979 if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1980 # If there is no dlopen support or we're linking statically, |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1981 # we need to preload. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1982 newdlprefiles="$newdlprefiles $deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1983 compile_deplibs="$deplib $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1984 finalize_deplibs="$deplib $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1985 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1986 newdlfiles="$newdlfiles $deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1987 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1988 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1989 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1990 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1991 %DEPLIBS%) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1992 alldeplibs=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1993 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1994 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1995 esac # case $deplib |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1996 if test "$found" = yes || test -f "$lib"; then : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1997 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1998 $echo "$modename: cannot find the library \`$lib'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
1999 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2000 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2001 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2002 # Check to see that this really is a libtool archive. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2003 if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2004 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2005 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2006 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2007 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2008 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2009 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2010 test "X$ladir" = "X$lib" && ladir="." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2011 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2012 dlname= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2013 dlopen= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2014 dlpreopen= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2015 libdir= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2016 library_names= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2017 old_library= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2018 # If the library was installed with an old release of libtool, |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2019 # it will not redefine variables installed, or shouldnotlink |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2020 installed=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2021 shouldnotlink=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2022 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2023 # Read the .la file |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2024 case $lib in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2025 */* | *\\*) . $lib ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2026 *) . ./$lib ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2027 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2028 |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2029 case $host in |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2030 *-*-darwin*) |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2031 # Convert "-framework foo" to "foo.framework" in dependency_libs |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2032 test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'` |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2033 ;; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2034 esac |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2035 |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2036 if test "$linkmode,$pass" = "lib,link" || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2037 test "$linkmode,$pass" = "prog,scan" || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2038 { test "$linkmode" != prog && test "$linkmode" != lib; }; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2039 test -n "$dlopen" && dlfiles="$dlfiles $dlopen" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2040 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2041 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2042 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2043 if test "$pass" = conv; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2044 # Only check for convenience libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2045 deplibs="$lib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2046 if test -z "$libdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2047 if test -z "$old_library"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2048 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2049 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2050 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2051 # It is a libtool convenience library, so add in its objects. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2052 convenience="$convenience $ladir/$objdir/$old_library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2053 old_convenience="$old_convenience $ladir/$objdir/$old_library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2054 tmp_libs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2055 for deplib in $dependency_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2056 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2057 if test "X$duplicate_deps" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2058 case "$tmp_libs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2059 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2060 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2061 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2062 tmp_libs="$tmp_libs $deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2063 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2064 elif test "$linkmode" != prog && test "$linkmode" != lib; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2065 $echo "$modename: \`$lib' is not a convenience library" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2066 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2067 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2068 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2069 fi # $pass = conv |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2070 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2071 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2072 # Get the name of the library we link against. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2073 linklib= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2074 for l in $old_library $library_names; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2075 linklib="$l" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2076 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2077 if test -z "$linklib"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2078 $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2079 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2080 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2081 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2082 # This library was specified with -dlopen. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2083 if test "$pass" = dlopen; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2084 if test -z "$libdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2085 $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2086 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2087 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2088 if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2089 # If there is no dlname, no dlopen support or we're linking |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2090 # statically, we need to preload. We also need to preload any |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2091 # dependent libraries so libltdl's deplib preloader doesn't |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2092 # bomb out in the load deplibs phase. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2093 dlprefiles="$dlprefiles $lib $dependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2094 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2095 newdlfiles="$newdlfiles $lib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2096 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2097 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2098 fi # $pass = dlopen |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2099 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2100 # We need an absolute path. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2101 case $ladir in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2102 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2103 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2104 abs_ladir=`cd "$ladir" && pwd` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2105 if test -z "$abs_ladir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2106 $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2107 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2108 abs_ladir="$ladir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2109 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2110 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2111 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2112 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2113 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2114 # Find the relevant object directory and library name. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2115 if test "X$installed" = Xyes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2116 if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2117 $echo "$modename: warning: library \`$lib' was moved." 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2118 dir="$ladir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2119 absdir="$abs_ladir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2120 libdir="$abs_ladir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2121 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2122 dir="$libdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2123 absdir="$libdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2124 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2125 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2126 dir="$ladir/$objdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2127 absdir="$abs_ladir/$objdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2128 # Remove this search path later |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2129 notinst_path="$notinst_path $abs_ladir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2130 fi # $installed = yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2131 name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2132 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2133 # This library was specified with -dlpreopen. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2134 if test "$pass" = dlpreopen; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2135 if test -z "$libdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2136 $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2137 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2138 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2139 # Prefer using a static library (so that no silly _DYNAMIC symbols |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2140 # are required to link). |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2141 if test -n "$old_library"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2142 newdlprefiles="$newdlprefiles $dir/$old_library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2143 # Otherwise, use the dlname, so that lt_dlopen finds it. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2144 elif test -n "$dlname"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2145 newdlprefiles="$newdlprefiles $dir/$dlname" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2146 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2147 newdlprefiles="$newdlprefiles $dir/$linklib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2148 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2149 fi # $pass = dlpreopen |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2150 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2151 if test -z "$libdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2152 # Link the convenience library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2153 if test "$linkmode" = lib; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2154 deplibs="$dir/$old_library $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2155 elif test "$linkmode,$pass" = "prog,link"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2156 compile_deplibs="$dir/$old_library $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2157 finalize_deplibs="$dir/$old_library $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2158 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2159 deplibs="$lib $deplibs" # used for prog,scan pass |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2160 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2161 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2162 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2163 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2164 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2165 if test "$linkmode" = prog && test "$pass" != link; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2166 newlib_search_path="$newlib_search_path $ladir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2167 deplibs="$lib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2168 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2169 linkalldeplibs=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2170 if test "$link_all_deplibs" != no || test -z "$library_names" || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2171 test "$build_libtool_libs" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2172 linkalldeplibs=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2173 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2174 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2175 tmp_libs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2176 for deplib in $dependency_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2177 case $deplib in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2178 -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2179 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2180 # Need to link against all dependency_libs? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2181 if test "$linkalldeplibs" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2182 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2183 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2184 # Need to hardcode shared library paths |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2185 # or/and link against static libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2186 newdependency_libs="$deplib $newdependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2187 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2188 if test "X$duplicate_deps" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2189 case "$tmp_libs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2190 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2191 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2192 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2193 tmp_libs="$tmp_libs $deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2194 done # for deplib |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2195 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2196 fi # $linkmode = prog... |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2197 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2198 if test "$linkmode,$pass" = "prog,link"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2199 if test -n "$library_names" && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2200 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2201 # We need to hardcode the library path |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2202 if test -n "$shlibpath_var"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2203 # Make sure the rpath contains only unique directories. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2204 case "$temp_rpath " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2205 *" $dir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2206 *" $absdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2207 *) temp_rpath="$temp_rpath $dir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2208 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2209 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2210 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2211 # Hardcode the library path. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2212 # Skip directories that are in the system default run-time |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2213 # search path. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2214 case " $sys_lib_dlsearch_path " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2215 *" $absdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2216 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2217 case "$compile_rpath " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2218 *" $absdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2219 *) compile_rpath="$compile_rpath $absdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2220 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2221 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2222 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2223 case " $sys_lib_dlsearch_path " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2224 *" $libdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2225 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2226 case "$finalize_rpath " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2227 *" $libdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2228 *) finalize_rpath="$finalize_rpath $libdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2229 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2230 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2231 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2232 fi # $linkmode,$pass = prog,link... |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2233 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2234 if test "$alldeplibs" = yes && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2235 { test "$deplibs_check_method" = pass_all || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2236 { test "$build_libtool_libs" = yes && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2237 test -n "$library_names"; }; }; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2238 # We only need to search for static libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2239 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2240 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2241 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2242 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2243 link_static=no # Whether the deplib will be linked statically |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2244 if test -n "$library_names" && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2245 { test "$prefer_static_libs" = no || test -z "$old_library"; }; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2246 if test "$installed" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2247 notinst_deplibs="$notinst_deplibs $lib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2248 need_relink=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2249 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2250 # This is a shared library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2251 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2252 # Warn about portability, can't link against -module's on some systems (darwin) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2253 if test "$shouldnotlink" = yes && test "$pass" = link ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2254 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2255 if test "$linkmode" = prog; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2256 $echo "*** Warning: Linking the executable $output against the loadable module" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2257 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2258 $echo "*** Warning: Linking the shared library $output against the loadable module" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2259 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2260 $echo "*** $linklib is not portable!" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2261 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2262 if test "$linkmode" = lib && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2263 test "$hardcode_into_libs" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2264 # Hardcode the library path. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2265 # Skip directories that are in the system default run-time |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2266 # search path. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2267 case " $sys_lib_dlsearch_path " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2268 *" $absdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2269 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2270 case "$compile_rpath " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2271 *" $absdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2272 *) compile_rpath="$compile_rpath $absdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2273 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2274 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2275 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2276 case " $sys_lib_dlsearch_path " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2277 *" $libdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2278 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2279 case "$finalize_rpath " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2280 *" $libdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2281 *) finalize_rpath="$finalize_rpath $libdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2282 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2283 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2284 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2285 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2286 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2287 if test -n "$old_archive_from_expsyms_cmds"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2288 # figure out the soname |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2289 set dummy $library_names |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2290 realname="$2" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2291 shift; shift |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2292 libname=`eval \\$echo \"$libname_spec\"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2293 # use dlname if we got it. it's perfectly good, no? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2294 if test -n "$dlname"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2295 soname="$dlname" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2296 elif test -n "$soname_spec"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2297 # bleh windows |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2298 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2299 *cygwin* | mingw*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2300 major=`expr $current - $age` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2301 versuffix="-$major" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2302 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2303 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2304 eval soname=\"$soname_spec\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2305 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2306 soname="$realname" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2307 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2308 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2309 # Make a new name for the extract_expsyms_cmds to use |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2310 soroot="$soname" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2311 soname=`$echo $soroot | ${SED} -e 's/^.*\///'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2312 newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2313 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2314 # If the library has no export list, then create one now |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2315 if test -f "$output_objdir/$soname-def"; then : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2316 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2317 $show "extracting exported symbol list from \`$soname'" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2318 save_ifs="$IFS"; IFS='~' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2319 eval cmds=\"$extract_expsyms_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2320 for cmd in $cmds; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2321 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2322 $show "$cmd" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2323 $run eval "$cmd" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2324 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2325 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2326 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2327 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2328 # Create $newlib |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2329 if test -f "$output_objdir/$newlib"; then :; else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2330 $show "generating import library for \`$soname'" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2331 save_ifs="$IFS"; IFS='~' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2332 eval cmds=\"$old_archive_from_expsyms_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2333 for cmd in $cmds; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2334 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2335 $show "$cmd" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2336 $run eval "$cmd" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2337 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2338 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2339 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2340 # make sure the library variables are pointing to the new library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2341 dir=$output_objdir |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2342 linklib=$newlib |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2343 fi # test -n "$old_archive_from_expsyms_cmds" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2344 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2345 if test "$linkmode" = prog || test "$mode" != relink; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2346 add_shlibpath= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2347 add_dir= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2348 add= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2349 lib_linked=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2350 case $hardcode_action in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2351 immediate | unsupported) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2352 if test "$hardcode_direct" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2353 add="$dir/$linklib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2354 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2355 *-*-sco3.2v5* ) add_dir="-L$dir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2356 *-*-darwin* ) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2357 # if the lib is a module then we can not link against it, someone |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2358 # is ignoring the new warnings I added |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2359 if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2360 $echo "** Warning, lib $linklib is a module, not a shared library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2361 if test -z "$old_library" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2362 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2363 $echo "** And there doesn't seem to be a static archive available" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2364 $echo "** The link will probably fail, sorry" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2365 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2366 add="$dir/$old_library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2367 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2368 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2369 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2370 elif test "$hardcode_minus_L" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2371 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2372 *-*-sunos*) add_shlibpath="$dir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2373 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2374 add_dir="-L$dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2375 add="-l$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2376 elif test "$hardcode_shlibpath_var" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2377 add_shlibpath="$dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2378 add="-l$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2379 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2380 lib_linked=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2381 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2382 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2383 relink) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2384 if test "$hardcode_direct" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2385 add="$dir/$linklib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2386 elif test "$hardcode_minus_L" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2387 add_dir="-L$dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2388 # Try looking first in the location we're being installed to. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2389 if test -n "$inst_prefix_dir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2390 case "$libdir" in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2391 [\\/]*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2392 add_dir="-L$inst_prefix_dir$libdir $add_dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2393 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2394 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2395 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2396 add="-l$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2397 elif test "$hardcode_shlibpath_var" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2398 add_shlibpath="$dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2399 add="-l$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2400 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2401 lib_linked=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2402 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2403 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2404 *) lib_linked=no ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2405 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2406 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2407 if test "$lib_linked" != yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2408 $echo "$modename: configuration error: unsupported hardcode properties" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2409 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2410 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2411 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2412 if test -n "$add_shlibpath"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2413 case :$compile_shlibpath: in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2414 *":$add_shlibpath:"*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2415 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2416 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2417 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2418 if test "$linkmode" = prog; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2419 test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2420 test -n "$add" && compile_deplibs="$add $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2421 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2422 test -n "$add_dir" && deplibs="$add_dir $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2423 test -n "$add" && deplibs="$add $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2424 if test "$hardcode_direct" != yes && \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2425 test "$hardcode_minus_L" != yes && \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2426 test "$hardcode_shlibpath_var" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2427 case :$finalize_shlibpath: in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2428 *":$libdir:"*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2429 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2430 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2431 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2432 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2433 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2434 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2435 if test "$linkmode" = prog || test "$mode" = relink; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2436 add_shlibpath= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2437 add_dir= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2438 add= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2439 # Finalize command for both is simple: just hardcode it. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2440 if test "$hardcode_direct" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2441 add="$libdir/$linklib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2442 elif test "$hardcode_minus_L" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2443 add_dir="-L$libdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2444 add="-l$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2445 elif test "$hardcode_shlibpath_var" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2446 case :$finalize_shlibpath: in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2447 *":$libdir:"*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2448 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2449 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2450 add="-l$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2451 elif test "$hardcode_automatic" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2452 if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2453 add="$inst_prefix_dir$libdir/$linklib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2454 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2455 add="$libdir/$linklib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2456 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2457 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2458 # We cannot seem to hardcode it, guess we'll fake it. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2459 add_dir="-L$libdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2460 # Try looking first in the location we're being installed to. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2461 if test -n "$inst_prefix_dir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2462 case "$libdir" in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2463 [\\/]*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2464 add_dir="-L$inst_prefix_dir$libdir $add_dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2465 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2466 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2467 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2468 add="-l$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2469 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2470 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2471 if test "$linkmode" = prog; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2472 test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2473 test -n "$add" && finalize_deplibs="$add $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2474 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2475 test -n "$add_dir" && deplibs="$add_dir $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2476 test -n "$add" && deplibs="$add $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2477 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2478 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2479 elif test "$linkmode" = prog; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2480 # Here we assume that one of hardcode_direct or hardcode_minus_L |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2481 # is not unsupported. This is valid on all known static and |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2482 # shared platforms. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2483 if test "$hardcode_direct" != unsupported; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2484 test -n "$old_library" && linklib="$old_library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2485 compile_deplibs="$dir/$linklib $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2486 finalize_deplibs="$dir/$linklib $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2487 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2488 compile_deplibs="-l$name -L$dir $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2489 finalize_deplibs="-l$name -L$dir $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2490 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2491 elif test "$build_libtool_libs" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2492 # Not a shared library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2493 if test "$deplibs_check_method" != pass_all; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2494 # We're trying link a shared library against a static one |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2495 # but the system doesn't support it. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2496 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2497 # Just print a warning and add the library to dependency_libs so |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2498 # that the program can be linked against the static library. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2499 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2500 $echo "*** Warning: This system can not link to static lib archive $lib." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2501 $echo "*** I have the capability to make that library automatically link in when" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2502 $echo "*** you link to this library. But I can only do this if you have a" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2503 $echo "*** shared version of the library, which you do not appear to have." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2504 if test "$module" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2505 $echo "*** But as you try to build a module library, libtool will still create " |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2506 $echo "*** a static module, that should work as long as the dlopening application" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2507 $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2508 if test -z "$global_symbol_pipe"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2509 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2510 $echo "*** However, this would only work if libtool was able to extract symbol" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2511 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2512 $echo "*** not find such a program. So, this module is probably useless." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2513 $echo "*** \`nm' from GNU binutils and a full rebuild may help." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2514 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2515 if test "$build_old_libs" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2516 build_libtool_libs=module |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2517 build_old_libs=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2518 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2519 build_libtool_libs=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2520 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2521 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2522 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2523 convenience="$convenience $dir/$old_library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2524 old_convenience="$old_convenience $dir/$old_library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2525 deplibs="$dir/$old_library $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2526 link_static=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2527 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2528 fi # link shared/static library? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2529 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2530 if test "$linkmode" = lib; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2531 if test -n "$dependency_libs" && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2532 { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2533 test "$link_static" = yes; }; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2534 # Extract -R from dependency_libs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2535 temp_deplibs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2536 for libdir in $dependency_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2537 case $libdir in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2538 -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2539 case " $xrpath " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2540 *" $temp_xrpath "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2541 *) xrpath="$xrpath $temp_xrpath";; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2542 esac;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2543 *) temp_deplibs="$temp_deplibs $libdir";; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2544 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2545 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2546 dependency_libs="$temp_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2547 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2548 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2549 newlib_search_path="$newlib_search_path $absdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2550 # Link against this library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2551 test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2552 # ... and its dependency_libs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2553 tmp_libs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2554 for deplib in $dependency_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2555 newdependency_libs="$deplib $newdependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2556 if test "X$duplicate_deps" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2557 case "$tmp_libs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2558 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2559 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2560 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2561 tmp_libs="$tmp_libs $deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2562 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2563 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2564 if test "$link_all_deplibs" != no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2565 # Add the search paths of all dependency libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2566 for deplib in $dependency_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2567 case $deplib in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2568 -L*) path="$deplib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2569 *.la) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2570 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2571 test "X$dir" = "X$deplib" && dir="." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2572 # We need an absolute path. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2573 case $dir in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2574 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2575 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2576 absdir=`cd "$dir" && pwd` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2577 if test -z "$absdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2578 $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2579 absdir="$dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2580 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2581 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2582 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2583 if grep "^installed=no" $deplib > /dev/null; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2584 path="$absdir/$objdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2585 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2586 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2587 if test -z "$libdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2588 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2589 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2590 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2591 if test "$absdir" != "$libdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2592 $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2593 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2594 path="$absdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2595 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2596 depdepl= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2597 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2598 *-*-darwin*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2599 # we do not want to link against static libs, but need to link against shared |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2600 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2601 if test -n "$deplibrary_names" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2602 for tmp in $deplibrary_names ; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2603 depdepl=$tmp |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2604 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2605 if test -f "$path/$depdepl" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2606 depdepl="$path/$depdepl" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2607 fi |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2608 # do not add paths which are already there |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2609 case " $newlib_search_path " in |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2610 *" $path "*) ;; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2611 *) newlib_search_path="$newlib_search_path $path";; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2612 esac |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2613 fi |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2614 path="" |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2615 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2616 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2617 path="-L$path" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2618 ;; |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2619 esac |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2620 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2621 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2622 -l*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2623 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2624 *-*-darwin*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2625 # Again, we only want to link against shared libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2626 eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2627 for tmp in $newlib_search_path ; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2628 if test -f "$tmp/lib$tmp_libs.dylib" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2629 eval depdepl="$tmp/lib$tmp_libs.dylib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2630 break |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2631 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2632 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2633 path="" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2634 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2635 *) continue ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2636 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2637 ;; |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2638 |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2639 *.framework) |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2640 case $host in |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2641 *-*-darwin*) |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2642 depdepl="$deplib" |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2643 ;; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2644 esac |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2645 ;; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
2646 |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2647 *) continue ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2648 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2649 case " $deplibs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2650 *" $depdepl "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2651 *) deplibs="$deplibs $depdepl" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2652 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2653 case " $deplibs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2654 *" $path "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2655 *) deplibs="$deplibs $path" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2656 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2657 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2658 fi # link_all_deplibs != no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2659 fi # linkmode = lib |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2660 done # for deplib in $libs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2661 dependency_libs="$newdependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2662 if test "$pass" = dlpreopen; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2663 # Link the dlpreopened libraries before other libraries |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2664 for deplib in $save_deplibs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2665 deplibs="$deplib $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2666 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2667 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2668 if test "$pass" != dlopen; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2669 if test "$pass" != conv; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2670 # Make sure lib_search_path contains only unique directories. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2671 lib_search_path= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2672 for dir in $newlib_search_path; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2673 case "$lib_search_path " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2674 *" $dir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2675 *) lib_search_path="$lib_search_path $dir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2676 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2677 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2678 newlib_search_path= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2679 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2680 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2681 if test "$linkmode,$pass" != "prog,link"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2682 vars="deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2683 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2684 vars="compile_deplibs finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2685 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2686 for var in $vars dependency_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2687 # Add libraries to $var in reverse order |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2688 eval tmp_libs=\"\$$var\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2689 new_libs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2690 for deplib in $tmp_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2691 # FIXME: Pedantically, this is the right thing to do, so |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2692 # that some nasty dependency loop isn't accidentally |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2693 # broken: |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2694 #new_libs="$deplib $new_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2695 # Pragmatically, this seems to cause very few problems in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2696 # practice: |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2697 case $deplib in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2698 -L*) new_libs="$deplib $new_libs" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2699 -R*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2700 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2701 # And here is the reason: when a library appears more |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2702 # than once as an explicit dependence of a library, or |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2703 # is implicitly linked in more than once by the |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2704 # compiler, it is considered special, and multiple |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2705 # occurrences thereof are not removed. Compare this |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2706 # with having the same library being listed as a |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2707 # dependency of multiple other libraries: in this case, |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2708 # we know (pedantically, we assume) the library does not |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2709 # need to be listed more than once, so we keep only the |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2710 # last copy. This is not always right, but it is rare |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2711 # enough that we require users that really mean to play |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2712 # such unportable linking tricks to link the library |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2713 # using -Wl,-lname, so that libtool does not consider it |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2714 # for duplicate removal. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2715 case " $specialdeplibs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2716 *" $deplib "*) new_libs="$deplib $new_libs" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2717 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2718 case " $new_libs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2719 *" $deplib "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2720 *) new_libs="$deplib $new_libs" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2721 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2722 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2723 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2724 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2725 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2726 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2727 tmp_libs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2728 for deplib in $new_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2729 case $deplib in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2730 -L*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2731 case " $tmp_libs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2732 *" $deplib "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2733 *) tmp_libs="$tmp_libs $deplib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2734 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2735 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2736 *) tmp_libs="$tmp_libs $deplib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2737 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2738 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2739 eval $var=\"$tmp_libs\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2740 done # for var |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2741 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2742 # Last step: remove runtime libs from dependency_libs (they stay in deplibs) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2743 tmp_libs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2744 for i in $dependency_libs ; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2745 case " $predeps $postdeps $compiler_lib_search_path " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2746 *" $i "*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2747 i="" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2748 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2749 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2750 if test -n "$i" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2751 tmp_libs="$tmp_libs $i" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2752 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2753 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2754 dependency_libs=$tmp_libs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2755 done # for pass |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2756 if test "$linkmode" = prog; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2757 dlfiles="$newdlfiles" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2758 dlprefiles="$newdlprefiles" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2759 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2760 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2761 case $linkmode in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2762 oldlib) |
0 | 2763 if test -n "$deplibs"; then |
2764 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 | |
2765 fi | |
2766 | |
2767 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then | |
2768 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 | |
2769 fi | |
2770 | |
2771 if test -n "$rpath"; then | |
2772 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 | |
2773 fi | |
2774 | |
2775 if test -n "$xrpath"; then | |
2776 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 | |
2777 fi | |
2778 | |
2779 if test -n "$vinfo"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2780 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 |
0 | 2781 fi |
2782 | |
2783 if test -n "$release"; then | |
2784 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 | |
2785 fi | |
2786 | |
2787 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then | |
2788 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 | |
2789 fi | |
2790 | |
2791 # Now set the variables for building old libraries. | |
2792 build_libtool_libs=no | |
2793 oldlibs="$output" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2794 objs="$objs$old_deplibs" |
0 | 2795 ;; |
2796 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2797 lib) |
0 | 2798 # Make sure we only generate libraries of the form `libNAME.la'. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2799 case $outputname in |
0 | 2800 lib*) |
2801 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2802 eval shared_ext=\"$shrext\" |
0 | 2803 eval libname=\"$libname_spec\" |
2804 ;; | |
2805 *) | |
2806 if test "$module" = no; then | |
2807 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 | |
2808 $echo "$help" 1>&2 | |
2809 exit 1 | |
2810 fi | |
2811 if test "$need_lib_prefix" != no; then | |
2812 # Add the "lib" prefix for modules if required | |
2813 name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2814 eval shared_ext=\"$shrext\" |
0 | 2815 eval libname=\"$libname_spec\" |
2816 else | |
2817 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` | |
2818 fi | |
2819 ;; | |
2820 esac | |
2821 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2822 if test -n "$objs"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2823 if test "$deplibs_check_method" != pass_all; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2824 $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2825 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2826 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2827 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2828 $echo "*** Warning: Linking the shared library $output against the non-libtool" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2829 $echo "*** objects $objs is not portable!" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2830 libobjs="$libobjs $objs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2831 fi |
0 | 2832 fi |
2833 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2834 if test "$dlself" != no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2835 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 |
0 | 2836 fi |
2837 | |
2838 set dummy $rpath | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2839 if test "$#" -gt 2; then |
0 | 2840 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 |
2841 fi | |
2842 install_libdir="$2" | |
2843 | |
2844 oldlibs= | |
2845 if test -z "$rpath"; then | |
2846 if test "$build_libtool_libs" = yes; then | |
2847 # Building a libtool convenience library. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2848 # Some compilers have problems with a `.al' extension so |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2849 # convenience libraries should have the same extension an |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2850 # archive normally would. |
0 | 2851 oldlibs="$output_objdir/$libname.$libext $oldlibs" |
2852 build_libtool_libs=convenience | |
2853 build_old_libs=yes | |
2854 fi | |
2855 | |
2856 if test -n "$vinfo"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2857 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 |
0 | 2858 fi |
2859 | |
2860 if test -n "$release"; then | |
2861 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 | |
2862 fi | |
2863 else | |
2864 | |
2865 # Parse the version information argument. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2866 save_ifs="$IFS"; IFS=':' |
0 | 2867 set dummy $vinfo 0 0 0 |
2868 IFS="$save_ifs" | |
2869 | |
2870 if test -n "$8"; then | |
2871 $echo "$modename: too many parameters to \`-version-info'" 1>&2 | |
2872 $echo "$help" 1>&2 | |
2873 exit 1 | |
2874 fi | |
2875 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2876 # convert absolute version numbers to libtool ages |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2877 # this retains compatibility with .la files and attempts |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2878 # to make the code below a bit more comprehensible |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2879 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2880 case $vinfo_number in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2881 yes) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2882 number_major="$2" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2883 number_minor="$3" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2884 number_revision="$4" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2885 # |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2886 # There are really only two kinds -- those that |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2887 # use the current revision as the major version |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2888 # and those that subtract age and use age as |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2889 # a minor version. But, then there is irix |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2890 # which has an extra 1 added just for fun |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2891 # |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2892 case $version_type in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2893 darwin|linux|osf|windows) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2894 current=`expr $number_major + $number_minor` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2895 age="$number_minor" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2896 revision="$number_revision" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2897 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2898 freebsd-aout|freebsd-elf|sunos) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2899 current="$number_major" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2900 revision="$number_minor" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2901 age="0" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2902 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2903 irix|nonstopux) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2904 current=`expr $number_major + $number_minor - 1` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2905 age="$number_minor" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2906 revision="$number_minor" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2907 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2908 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2909 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2910 no) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2911 current="$2" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2912 revision="$3" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2913 age="$4" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2914 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2915 esac |
0 | 2916 |
2917 # Check that each of the things are valid numbers. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2918 case $current in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2919 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
0 | 2920 *) |
2921 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 | |
2922 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | |
2923 exit 1 | |
2924 ;; | |
2925 esac | |
2926 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2927 case $revision in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2928 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
0 | 2929 *) |
2930 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 | |
2931 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | |
2932 exit 1 | |
2933 ;; | |
2934 esac | |
2935 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2936 case $age in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2937 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;; |
0 | 2938 *) |
2939 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 | |
2940 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | |
2941 exit 1 | |
2942 ;; | |
2943 esac | |
2944 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2945 if test "$age" -gt "$current"; then |
0 | 2946 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 |
2947 $echo "$modename: \`$vinfo' is not valid version information" 1>&2 | |
2948 exit 1 | |
2949 fi | |
2950 | |
2951 # Calculate the version variables. | |
2952 major= | |
2953 versuffix= | |
2954 verstring= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2955 case $version_type in |
0 | 2956 none) ;; |
2957 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2958 darwin) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2959 # Like Linux, but with the current version available in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2960 # verstring for coding it into the library header |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2961 major=.`expr $current - $age` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2962 versuffix="$major.$age.$revision" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2963 # Darwin ld doesn't like 0 for these options... |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2964 minor_current=`expr $current + 1` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2965 verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2966 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2967 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2968 freebsd-aout) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2969 major=".$current" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2970 versuffix=".$current.$revision"; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2971 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2972 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2973 freebsd-elf) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2974 major=".$current" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2975 versuffix=".$current"; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2976 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2977 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2978 irix | nonstopux) |
0 | 2979 major=`expr $current - $age + 1` |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2980 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2981 case $version_type in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2982 nonstopux) verstring_prefix=nonstopux ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2983 *) verstring_prefix=sgi ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2984 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2985 verstring="$verstring_prefix$major.$revision" |
0 | 2986 |
2987 # Add in all the interfaces that we are compatible with. | |
2988 loop=$revision | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2989 while test "$loop" -ne 0; do |
0 | 2990 iface=`expr $revision - $loop` |
2991 loop=`expr $loop - 1` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2992 verstring="$verstring_prefix$major.$iface:$verstring" |
0 | 2993 done |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2994 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2995 # Before this point, $major must not contain `.'. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2996 major=.$major |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
2997 versuffix="$major.$revision" |
0 | 2998 ;; |
2999 | |
3000 linux) | |
3001 major=.`expr $current - $age` | |
3002 versuffix="$major.$age.$revision" | |
3003 ;; | |
3004 | |
3005 osf) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3006 major=.`expr $current - $age` |
0 | 3007 versuffix=".$current.$age.$revision" |
3008 verstring="$current.$age.$revision" | |
3009 | |
3010 # Add in all the interfaces that we are compatible with. | |
3011 loop=$age | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3012 while test "$loop" -ne 0; do |
0 | 3013 iface=`expr $current - $loop` |
3014 loop=`expr $loop - 1` | |
3015 verstring="$verstring:${iface}.0" | |
3016 done | |
3017 | |
3018 # Make executables depend on our current version. | |
3019 verstring="$verstring:${current}.0" | |
3020 ;; | |
3021 | |
3022 sunos) | |
3023 major=".$current" | |
3024 versuffix=".$current.$revision" | |
3025 ;; | |
3026 | |
3027 windows) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3028 # Use '-' rather than '.', since we only want one |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3029 # extension on DOS 8.3 filesystems. |
0 | 3030 major=`expr $current - $age` |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3031 versuffix="-$major" |
387
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
3032 ;; |
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
3033 |
0 | 3034 *) |
3035 $echo "$modename: unknown library version type \`$version_type'" 1>&2 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3036 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 |
0 | 3037 exit 1 |
3038 ;; | |
3039 esac | |
3040 | |
3041 # Clear the version info if we defaulted, and they specified a release. | |
3042 if test -z "$vinfo" && test -n "$release"; then | |
3043 major= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3044 case $version_type in |
387
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
3045 darwin) |
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
3046 # we can't check for "0.0" in archive_cmds due to quoting |
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
3047 # problems, so we reset it completely |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3048 verstring= |
387
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
3049 ;; |
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
3050 *) |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3051 verstring="0.0" |
387
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
3052 ;; |
469d5c0da01d
Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents:
1
diff
changeset
|
3053 esac |
0 | 3054 if test "$need_version" = no; then |
3055 versuffix= | |
3056 else | |
3057 versuffix=".0.0" | |
3058 fi | |
3059 fi | |
3060 | |
3061 # Remove version info from name if versioning should be avoided | |
3062 if test "$avoid_version" = yes && test "$need_version" = no; then | |
3063 major= | |
3064 versuffix= | |
3065 verstring="" | |
3066 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3067 |
0 | 3068 # Check to see if the archive will have undefined symbols. |
3069 if test "$allow_undefined" = yes; then | |
3070 if test "$allow_undefined_flag" = unsupported; then | |
3071 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 | |
3072 build_libtool_libs=no | |
3073 build_old_libs=yes | |
3074 fi | |
3075 else | |
3076 # Don't allow undefined symbols. | |
3077 allow_undefined_flag="$no_undefined_flag" | |
3078 fi | |
3079 fi | |
3080 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3081 if test "$mode" != relink; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3082 # Remove our outputs, but don't remove object files since they |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3083 # may have been created when compiling PIC objects. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3084 removelist= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3085 tempremovelist=`$echo "$output_objdir/*"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3086 for p in $tempremovelist; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3087 case $p in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3088 *.$objext) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3089 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3090 $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3091 removelist="$removelist $p" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3092 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3093 *) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3094 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3095 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3096 if test -n "$removelist"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3097 $show "${rm}r $removelist" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3098 $run ${rm}r $removelist |
0 | 3099 fi |
3100 fi | |
3101 | |
3102 # Now set the variables for building old libraries. | |
3103 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then | |
3104 oldlibs="$oldlibs $output_objdir/$libname.$libext" | |
3105 | |
3106 # Transform .lo files to .o files. | |
3107 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` | |
3108 fi | |
3109 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3110 # Eliminate all temporary directories. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3111 for path in $notinst_path; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3112 lib_search_path=`$echo "$lib_search_path " | ${SED} -e 's% $path % %g'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3113 deplibs=`$echo "$deplibs " | ${SED} -e 's% -L$path % %g'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3114 dependency_libs=`$echo "$dependency_libs " | ${SED} -e 's% -L$path % %g'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3115 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3116 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3117 if test -n "$xrpath"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3118 # If the user specified any rpath flags, then add them. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3119 temp_xrpath= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3120 for libdir in $xrpath; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3121 temp_xrpath="$temp_xrpath -R$libdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3122 case "$finalize_rpath " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3123 *" $libdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3124 *) finalize_rpath="$finalize_rpath $libdir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3125 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3126 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3127 if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3128 dependency_libs="$temp_xrpath $dependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3129 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3130 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3131 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3132 # Make sure dlfiles contains only unique files that won't be dlpreopened |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3133 old_dlfiles="$dlfiles" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3134 dlfiles= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3135 for lib in $old_dlfiles; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3136 case " $dlprefiles $dlfiles " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3137 *" $lib "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3138 *) dlfiles="$dlfiles $lib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3139 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3140 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3141 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3142 # Make sure dlprefiles contains only unique files |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3143 old_dlprefiles="$dlprefiles" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3144 dlprefiles= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3145 for lib in $old_dlprefiles; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3146 case "$dlprefiles " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3147 *" $lib "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3148 *) dlprefiles="$dlprefiles $lib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3149 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3150 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3151 |
0 | 3152 if test "$build_libtool_libs" = yes; then |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3153 if test -n "$rpath"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3154 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3155 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3156 # these systems don't actually have a c library (as such)! |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3157 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3158 *-*-rhapsody* | *-*-darwin1.[012]) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3159 # Rhapsody C library is in the System framework |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3160 deplibs="$deplibs -framework System" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3161 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3162 *-*-netbsd*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3163 # Don't link with libc until the a.out ld.so is fixed. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3164 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3165 *-*-openbsd* | *-*-freebsd*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3166 # Do not include libc due to us having libc/libc_r. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3167 test "X$arg" = "X-lc" && continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3168 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3169 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3170 # Add libc to deplibs on all other systems if necessary. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3171 if test "$build_libtool_need_lc" = "yes"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3172 deplibs="$deplibs -lc" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3173 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3174 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3175 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3176 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3177 |
0 | 3178 # Transform deplibs into only deplibs that can be linked in shared. |
3179 name_save=$name | |
3180 libname_save=$libname | |
3181 release_save=$release | |
3182 versuffix_save=$versuffix | |
3183 major_save=$major | |
3184 # I'm not sure if I'm treating the release correctly. I think | |
3185 # release should show up in the -l (ie -lgmp5) so we don't want to | |
3186 # add it in twice. Is that correct? | |
3187 release="" | |
3188 versuffix="" | |
3189 major="" | |
3190 newdeplibs= | |
3191 droppeddeps=no | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3192 case $deplibs_check_method in |
0 | 3193 pass_all) |
3194 # Don't check for shared/static. Everything works. | |
3195 # This might be a little naive. We might want to check | |
3196 # whether the library exists or not. But this is on | |
3197 # osf3 & osf4 and I'm not really sure... Just | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3198 # implementing what was already the behavior. |
0 | 3199 newdeplibs=$deplibs |
3200 ;; | |
3201 test_compile) | |
3202 # This code stresses the "libraries are programs" paradigm to its | |
3203 # limits. Maybe even breaks it. We compile a program, linking it | |
3204 # against the deplibs as a proxy for the library. Then we can check | |
3205 # whether they linked in statically or dynamically with ldd. | |
3206 $rm conftest.c | |
3207 cat > conftest.c <<EOF | |
3208 int main() { return 0; } | |
3209 EOF | |
3210 $rm conftest | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3211 $LTCC -o conftest conftest.c $deplibs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3212 if test "$?" -eq 0 ; then |
0 | 3213 ldd_output=`ldd conftest` |
3214 for i in $deplibs; do | |
3215 name="`expr $i : '-l\(.*\)'`" | |
3216 # If $name is empty we are operating on a -L argument. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3217 if test "$name" != "" && test "$name" -ne "0"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3218 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3219 case " $predeps $postdeps " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3220 *" $i "*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3221 newdeplibs="$newdeplibs $i" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3222 i="" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3223 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3224 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3225 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3226 if test -n "$i" ; then |
0 | 3227 libname=`eval \\$echo \"$libname_spec\"` |
3228 deplib_matches=`eval \\$echo \"$library_names_spec\"` | |
3229 set dummy $deplib_matches | |
3230 deplib_match=$2 | |
3231 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then | |
3232 newdeplibs="$newdeplibs $i" | |
3233 else | |
3234 droppeddeps=yes | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3235 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3236 $echo "*** Warning: dynamic linker does not accept needed library $i." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3237 $echo "*** I have the capability to make that library automatically link in when" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3238 $echo "*** you link to this library. But I can only do this if you have a" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3239 $echo "*** shared version of the library, which I believe you do not have" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3240 $echo "*** because a test_compile did reveal that the linker did not use it for" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3241 $echo "*** its dynamic dependency list that programs get resolved with at runtime." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3242 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3243 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3244 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3245 newdeplibs="$newdeplibs $i" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3246 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3247 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3248 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3249 # Error occurred in the first compile. Let's try to salvage |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3250 # the situation: Compile a separate program for each library. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3251 for i in $deplibs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3252 name="`expr $i : '-l\(.*\)'`" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3253 # If $name is empty we are operating on a -L argument. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3254 if test "$name" != "" && test "$name" != "0"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3255 $rm conftest |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3256 $LTCC -o conftest conftest.c $i |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3257 # Did it work? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3258 if test "$?" -eq 0 ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3259 ldd_output=`ldd conftest` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3260 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3261 case " $predeps $postdeps " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3262 *" $i "*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3263 newdeplibs="$newdeplibs $i" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3264 i="" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3265 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3266 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3267 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3268 if test -n "$i" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3269 libname=`eval \\$echo \"$libname_spec\"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3270 deplib_matches=`eval \\$echo \"$library_names_spec\"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3271 set dummy $deplib_matches |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3272 deplib_match=$2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3273 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3274 newdeplibs="$newdeplibs $i" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3275 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3276 droppeddeps=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3277 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3278 $echo "*** Warning: dynamic linker does not accept needed library $i." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3279 $echo "*** I have the capability to make that library automatically link in when" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3280 $echo "*** you link to this library. But I can only do this if you have a" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3281 $echo "*** shared version of the library, which you do not appear to have" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3282 $echo "*** because a test_compile did reveal that the linker did not use this one" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3283 $echo "*** as a dynamic dependency that programs can get resolved with at runtime." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3284 fi |
0 | 3285 fi |
3286 else | |
3287 droppeddeps=yes | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3288 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3289 $echo "*** Warning! Library $i is needed by this library but I was not able to" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3290 $echo "*** make it link in! You will probably need to install it or some" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3291 $echo "*** library that it depends on before this library will be fully" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3292 $echo "*** functional. Installing it before continuing would be even better." |
0 | 3293 fi |
3294 else | |
3295 newdeplibs="$newdeplibs $i" | |
3296 fi | |
3297 done | |
3298 fi | |
3299 ;; | |
3300 file_magic*) | |
3301 set dummy $deplibs_check_method | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3302 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
0 | 3303 for a_deplib in $deplibs; do |
3304 name="`expr $a_deplib : '-l\(.*\)'`" | |
3305 # If $name is empty we are operating on a -L argument. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3306 if test "$name" != "" && test "$name" != "0"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3307 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3308 case " $predeps $postdeps " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3309 *" $a_deplib "*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3310 newdeplibs="$newdeplibs $a_deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3311 a_deplib="" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3312 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3313 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3314 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3315 if test -n "$a_deplib" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3316 libname=`eval \\$echo \"$libname_spec\"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3317 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3318 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3319 for potent_lib in $potential_libs; do |
0 | 3320 # Follow soft links. |
3321 if ls -lLd "$potent_lib" 2>/dev/null \ | |
3322 | grep " -> " >/dev/null; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3323 continue |
0 | 3324 fi |
3325 # The statement above tries to avoid entering an | |
3326 # endless loop below, in case of cyclic links. | |
3327 # We might still enter an endless loop, since a link | |
3328 # loop can be closed while we follow links, | |
3329 # but so what? | |
3330 potlib="$potent_lib" | |
3331 while test -h "$potlib" 2>/dev/null; do | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3332 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3333 case $potliblink in |
0 | 3334 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; |
3335 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; | |
3336 esac | |
3337 done | |
3338 if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3339 | ${SED} 10q \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3340 | $EGREP "$file_magic_regex" > /dev/null; then |
0 | 3341 newdeplibs="$newdeplibs $a_deplib" |
3342 a_deplib="" | |
3343 break 2 | |
3344 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3345 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3346 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3347 fi |
0 | 3348 if test -n "$a_deplib" ; then |
3349 droppeddeps=yes | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3350 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3351 $echo "*** Warning: linker path does not have real file for library $a_deplib." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3352 $echo "*** I have the capability to make that library automatically link in when" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3353 $echo "*** you link to this library. But I can only do this if you have a" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3354 $echo "*** shared version of the library, which you do not appear to have" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3355 $echo "*** because I did check the linker path looking for a file starting" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3356 if test -z "$potlib" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3357 $echo "*** with $libname but no candidates were found. (...for file magic test)" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3358 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3359 $echo "*** with $libname and none of the candidates passed a file format test" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3360 $echo "*** using a file magic. Last file checked: $potlib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3361 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3362 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3363 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3364 # Add a -L argument. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3365 newdeplibs="$newdeplibs $a_deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3366 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3367 done # Gone through all deplibs. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3368 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3369 match_pattern*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3370 set dummy $deplibs_check_method |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3371 match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3372 for a_deplib in $deplibs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3373 name="`expr $a_deplib : '-l\(.*\)'`" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3374 # If $name is empty we are operating on a -L argument. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3375 if test -n "$name" && test "$name" != "0"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3376 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3377 case " $predeps $postdeps " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3378 *" $a_deplib "*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3379 newdeplibs="$newdeplibs $a_deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3380 a_deplib="" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3381 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3382 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3383 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3384 if test -n "$a_deplib" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3385 libname=`eval \\$echo \"$libname_spec\"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3386 for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3387 potential_libs=`ls $i/$libname[.-]* 2>/dev/null` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3388 for potent_lib in $potential_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3389 potlib="$potent_lib" # see symlink-check above in file_magic test |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3390 if eval $echo \"$potent_lib\" 2>/dev/null \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3391 | ${SED} 10q \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3392 | $EGREP "$match_pattern_regex" > /dev/null; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3393 newdeplibs="$newdeplibs $a_deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3394 a_deplib="" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3395 break 2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3396 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3397 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3398 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3399 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3400 if test -n "$a_deplib" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3401 droppeddeps=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3402 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3403 $echo "*** Warning: linker path does not have real file for library $a_deplib." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3404 $echo "*** I have the capability to make that library automatically link in when" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3405 $echo "*** you link to this library. But I can only do this if you have a" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3406 $echo "*** shared version of the library, which you do not appear to have" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3407 $echo "*** because I did check the linker path looking for a file starting" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3408 if test -z "$potlib" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3409 $echo "*** with $libname but no candidates were found. (...for regex pattern test)" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3410 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3411 $echo "*** with $libname and none of the candidates passed a file format test" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3412 $echo "*** using a regex pattern. Last file checked: $potlib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3413 fi |
0 | 3414 fi |
3415 else | |
3416 # Add a -L argument. | |
3417 newdeplibs="$newdeplibs $a_deplib" | |
3418 fi | |
3419 done # Gone through all deplibs. | |
3420 ;; | |
3421 none | unknown | *) | |
3422 newdeplibs="" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3423 tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3424 -e 's/ -[LR][^ ]*//g'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3425 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3426 for i in $predeps $postdeps ; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3427 # can't use Xsed below, because $i might contain '/' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3428 tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3429 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3430 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3431 if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3432 | grep . >/dev/null; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3433 $echo |
0 | 3434 if test "X$deplibs_check_method" = "Xnone"; then |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3435 $echo "*** Warning: inter-library dependencies are not supported in this platform." |
0 | 3436 else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3437 $echo "*** Warning: inter-library dependencies are not known to be supported." |
0 | 3438 fi |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3439 $echo "*** All declared inter-library dependencies are being dropped." |
0 | 3440 droppeddeps=yes |
3441 fi | |
3442 ;; | |
3443 esac | |
3444 versuffix=$versuffix_save | |
3445 major=$major_save | |
3446 release=$release_save | |
3447 libname=$libname_save | |
3448 name=$name_save | |
3449 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3450 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3451 *-*-rhapsody* | *-*-darwin1.[012]) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3452 # On Rhapsody replace the C library is the System framework |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3453 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3454 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3455 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3456 |
0 | 3457 if test "$droppeddeps" = yes; then |
3458 if test "$module" = yes; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3459 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3460 $echo "*** Warning: libtool could not satisfy all declared inter-library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3461 $echo "*** dependencies of module $libname. Therefore, libtool will create" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3462 $echo "*** a static module, that should work as long as the dlopening" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3463 $echo "*** application is linked with the -dlopen flag." |
0 | 3464 if test -z "$global_symbol_pipe"; then |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3465 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3466 $echo "*** However, this would only work if libtool was able to extract symbol" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3467 $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3468 $echo "*** not find such a program. So, this module is probably useless." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3469 $echo "*** \`nm' from GNU binutils and a full rebuild may help." |
0 | 3470 fi |
3471 if test "$build_old_libs" = no; then | |
3472 oldlibs="$output_objdir/$libname.$libext" | |
3473 build_libtool_libs=module | |
3474 build_old_libs=yes | |
3475 else | |
3476 build_libtool_libs=no | |
3477 fi | |
3478 else | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3479 $echo "*** The inter-library dependencies that have been dropped here will be" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3480 $echo "*** automatically added whenever a program is linked with this library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3481 $echo "*** or is declared to -dlopen it." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3482 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3483 if test "$allow_undefined" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3484 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3485 $echo "*** Since this library must not contain undefined symbols," |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3486 $echo "*** because either the platform does not support them or" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3487 $echo "*** it was explicitly requested with -no-undefined," |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3488 $echo "*** libtool will only create a static version of it." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3489 if test "$build_old_libs" = no; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3490 oldlibs="$output_objdir/$libname.$libext" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3491 build_libtool_libs=module |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3492 build_old_libs=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3493 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3494 build_libtool_libs=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3495 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3496 fi |
0 | 3497 fi |
3498 fi | |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
3499 # Time to change all our "foo.framework" stuff back to "-framework foo" |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
3500 case $host in |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
3501 *-*-darwin*) |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
3502 newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'` |
789
f9d0e03fc2ff
Date: Wed, 28 Jan 2004 02:37:04 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
741
diff
changeset
|
3503 dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework%%g'` |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
3504 ;; |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
3505 esac |
0 | 3506 # Done checking deplibs! |
3507 deplibs=$newdeplibs | |
3508 fi | |
3509 | |
3510 # All the library-specific variables (install_libdir is set above). | |
3511 library_names= | |
3512 old_library= | |
3513 dlname= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3514 |
0 | 3515 # Test again, we may have decided not to build it any more |
3516 if test "$build_libtool_libs" = yes; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3517 if test "$hardcode_into_libs" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3518 # Hardcode the library paths |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3519 hardcode_libdirs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3520 dep_rpath= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3521 rpath="$finalize_rpath" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3522 test "$mode" != relink && rpath="$compile_rpath$rpath" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3523 for libdir in $rpath; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3524 if test -n "$hardcode_libdir_flag_spec"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3525 if test -n "$hardcode_libdir_separator"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3526 if test -z "$hardcode_libdirs"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3527 hardcode_libdirs="$libdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3528 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3529 # Just accumulate the unique libdirs. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3530 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3531 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3532 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3533 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3534 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3535 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3536 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3537 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3538 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3539 eval flag=\"$hardcode_libdir_flag_spec\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3540 dep_rpath="$dep_rpath $flag" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3541 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3542 elif test -n "$runpath_var"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3543 case "$perm_rpath " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3544 *" $libdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3545 *) perm_rpath="$perm_rpath $libdir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3546 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3547 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3548 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3549 # Substitute the hardcoded libdirs into the rpath. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3550 if test -n "$hardcode_libdir_separator" && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3551 test -n "$hardcode_libdirs"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3552 libdir="$hardcode_libdirs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3553 if test -n "$hardcode_libdir_flag_spec_ld"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3554 eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3555 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3556 eval dep_rpath=\"$hardcode_libdir_flag_spec\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3557 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3558 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3559 if test -n "$runpath_var" && test -n "$perm_rpath"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3560 # We should set the runpath_var. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3561 rpath= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3562 for dir in $perm_rpath; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3563 rpath="$rpath$dir:" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3564 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3565 eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3566 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3567 test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3568 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3569 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3570 shlibpath="$finalize_shlibpath" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3571 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3572 if test -n "$shlibpath"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3573 eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3574 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3575 |
0 | 3576 # Get the real and link names of the library. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3577 eval shared_ext=\"$shrext\" |
0 | 3578 eval library_names=\"$library_names_spec\" |
3579 set dummy $library_names | |
3580 realname="$2" | |
3581 shift; shift | |
3582 | |
3583 if test -n "$soname_spec"; then | |
3584 eval soname=\"$soname_spec\" | |
3585 else | |
3586 soname="$realname" | |
3587 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3588 if test -z "$dlname"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3589 dlname=$soname |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3590 fi |
0 | 3591 |
3592 lib="$output_objdir/$realname" | |
3593 for link | |
3594 do | |
3595 linknames="$linknames $link" | |
3596 done | |
3597 | |
3598 # Use standard objects if they are pic | |
3599 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | |
3600 | |
3601 # Prepare the list of exported symbols | |
3602 if test -z "$export_symbols"; then | |
3603 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then | |
3604 $show "generating symbol list for \`$libname.la'" | |
3605 export_symbols="$output_objdir/$libname.exp" | |
3606 $run $rm $export_symbols | |
3607 eval cmds=\"$export_symbols_cmds\" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3608 save_ifs="$IFS"; IFS='~' |
0 | 3609 for cmd in $cmds; do |
3610 IFS="$save_ifs" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3611 if len=`expr "X$cmd" : ".*"` && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3612 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3613 $show "$cmd" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3614 $run eval "$cmd" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3615 skipped_export=false |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3616 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3617 # The command line is too long to execute in one step. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3618 $show "using reloadable object file for export list..." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3619 skipped_export=: |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3620 fi |
0 | 3621 done |
3622 IFS="$save_ifs" | |
3623 if test -n "$export_symbols_regex"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3624 $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3625 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' |
0 | 3626 $show "$mv \"${export_symbols}T\" \"$export_symbols\"" |
3627 $run eval '$mv "${export_symbols}T" "$export_symbols"' | |
3628 fi | |
3629 fi | |
3630 fi | |
3631 | |
3632 if test -n "$export_symbols" && test -n "$include_expsyms"; then | |
3633 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' | |
3634 fi | |
3635 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3636 tmp_deplibs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3637 for test_deplib in $deplibs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3638 case " $convenience " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3639 *" $test_deplib "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3640 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3641 tmp_deplibs="$tmp_deplibs $test_deplib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3642 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3643 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3644 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3645 deplibs="$tmp_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3646 |
0 | 3647 if test -n "$convenience"; then |
3648 if test -n "$whole_archive_flag_spec"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3649 save_libobjs=$libobjs |
0 | 3650 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" |
3651 else | |
3652 gentop="$output_objdir/${outputname}x" | |
3653 $show "${rm}r $gentop" | |
3654 $run ${rm}r "$gentop" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3655 $show "$mkdir $gentop" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3656 $run $mkdir "$gentop" |
0 | 3657 status=$? |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3658 if test "$status" -ne 0 && test ! -d "$gentop"; then |
0 | 3659 exit $status |
3660 fi | |
3661 generated="$generated $gentop" | |
3662 | |
3663 for xlib in $convenience; do | |
3664 # Extract the objects. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3665 case $xlib in |
0 | 3666 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
3667 *) xabs=`pwd`"/$xlib" ;; | |
3668 esac | |
3669 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` | |
3670 xdir="$gentop/$xlib" | |
3671 | |
3672 $show "${rm}r $xdir" | |
3673 $run ${rm}r "$xdir" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3674 $show "$mkdir $xdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3675 $run $mkdir "$xdir" |
0 | 3676 status=$? |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3677 if test "$status" -ne 0 && test ! -d "$xdir"; then |
0 | 3678 exit $status |
3679 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3680 # We will extract separately just the conflicting names and we will no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3681 # longer touch any unique names. It is faster to leave these extract |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3682 # automatically by $AR in one run. |
0 | 3683 $show "(cd $xdir && $AR x $xabs)" |
3684 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3685 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3686 : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3687 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3688 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3689 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3690 $AR t "$xabs" | sort | uniq -cd | while read -r count name |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3691 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3692 i=1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3693 while test "$i" -le "$count" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3694 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3695 # Put our $i before any first dot (extension) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3696 # Never overwrite any file |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3697 name_to="$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3698 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3699 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3700 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3701 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3702 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3703 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3704 i=`expr $i + 1` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3705 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3706 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3707 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3708 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3709 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
0 | 3710 done |
3711 fi | |
3712 fi | |
3713 | |
3714 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then | |
3715 eval flag=\"$thread_safe_flag_spec\" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3716 linker_flags="$linker_flags $flag" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3717 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3718 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3719 # Make a backup of the uninstalled library when relinking |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3720 if test "$mode" = relink; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3721 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? |
0 | 3722 fi |
3723 | |
3724 # Do each of the archive commands. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3725 if test "$module" = yes && test -n "$module_cmds" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3726 if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3727 eval cmds=\"$module_expsym_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3728 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3729 eval cmds=\"$module_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3730 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3731 else |
0 | 3732 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
3733 eval cmds=\"$archive_expsym_cmds\" | |
3734 else | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3735 eval cmds=\"$archive_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3736 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3737 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3738 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3739 if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3740 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3741 : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3742 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3743 # The command line is too long to link in one step, link piecewise. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3744 $echo "creating reloadable object files..." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3745 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3746 # Save the value of $output and $libobjs because we want to |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3747 # use them later. If we have whole_archive_flag_spec, we |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3748 # want to use save_libobjs as it was before |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3749 # whole_archive_flag_spec was expanded, because we can't |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3750 # assume the linker understands whole_archive_flag_spec. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3751 # This may have to be revisited, in case too many |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3752 # convenience libraries get linked in and end up exceeding |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3753 # the spec. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3754 if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3755 save_libobjs=$libobjs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3756 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3757 save_output=$output |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3758 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3759 # Clear the reloadable object creation command queue and |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3760 # initialize k to one. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3761 test_cmds= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3762 concat_cmds= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3763 objlist= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3764 delfiles= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3765 last_robj= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3766 k=1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3767 output=$output_objdir/$save_output-${k}.$objext |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3768 # Loop over the list of objects to be linked. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3769 for obj in $save_libobjs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3770 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3771 eval test_cmds=\"$reload_cmds $objlist $last_robj\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3772 if test "X$objlist" = X || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3773 { len=`expr "X$test_cmds" : ".*"` && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3774 test "$len" -le "$max_cmd_len"; }; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3775 objlist="$objlist $obj" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3776 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3777 # The command $test_cmds is almost too long, add a |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3778 # command to the queue. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3779 if test "$k" -eq 1 ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3780 # The first file doesn't have a previous command to add. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3781 eval concat_cmds=\"$reload_cmds $objlist $last_robj\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3782 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3783 # All subsequent reloadable object files will link in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3784 # the last one created. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3785 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" |
608
d0fecf67cd93
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
581
diff
changeset
|
3786 fi |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3787 last_robj=$output_objdir/$save_output-${k}.$objext |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3788 k=`expr $k + 1` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3789 output=$output_objdir/$save_output-${k}.$objext |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3790 objlist=$obj |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3791 len=1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3792 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3793 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3794 # Handle the remaining objects by creating one last |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3795 # reloadable object file. All subsequent reloadable object |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3796 # files will link in the last one created. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3797 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3798 eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3799 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3800 if ${skipped_export-false}; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3801 $show "generating symbol list for \`$libname.la'" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3802 export_symbols="$output_objdir/$libname.exp" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3803 $run $rm $export_symbols |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3804 libobjs=$output |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3805 # Append the command to create the export file. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3806 eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3807 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3808 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3809 # Set up a command to remove the reloadale object files |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3810 # after they are used. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3811 i=0 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3812 while test "$i" -lt "$k" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3813 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3814 i=`expr $i + 1` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3815 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext" |
608
d0fecf67cd93
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
581
diff
changeset
|
3816 done |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3817 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3818 $echo "creating a temporary reloadable object file: $output" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3819 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3820 # Loop through the commands generated above and execute them. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3821 save_ifs="$IFS"; IFS='~' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3822 for cmd in $concat_cmds; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3823 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3824 $show "$cmd" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3825 $run eval "$cmd" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3826 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3827 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3828 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3829 libobjs=$output |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3830 # Restore the value of output. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3831 output=$save_output |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3832 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3833 if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3834 eval libobjs=\"\$libobjs $whole_archive_flag_spec\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3835 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3836 # Expand the library linking commands again to reset the |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3837 # value of $libobjs for piecewise linking. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3838 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3839 # Do each of the archive commands. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3840 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3841 eval cmds=\"$archive_expsym_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3842 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3843 eval cmds=\"$archive_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3844 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3845 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3846 # Append the command to remove the reloadable object files |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3847 # to the just-reset $cmds. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3848 eval cmds=\"\$cmds~$rm $delfiles\" |
0 | 3849 fi |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3850 save_ifs="$IFS"; IFS='~' |
0 | 3851 for cmd in $cmds; do |
3852 IFS="$save_ifs" | |
3853 $show "$cmd" | |
3854 $run eval "$cmd" || exit $? | |
3855 done | |
3856 IFS="$save_ifs" | |
3857 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3858 # Restore the uninstalled library and exit |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3859 if test "$mode" = relink; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3860 $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3861 exit 0 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3862 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3863 |
0 | 3864 # Create links to the real library. |
3865 for linkname in $linknames; do | |
3866 if test "$realname" != "$linkname"; then | |
3867 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" | |
3868 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? | |
3869 fi | |
3870 done | |
3871 | |
3872 # If -module or -export-dynamic was specified, set the dlname. | |
3873 if test "$module" = yes || test "$export_dynamic" = yes; then | |
3874 # On all known operating systems, these are identical. | |
3875 dlname="$soname" | |
3876 fi | |
3877 fi | |
3878 ;; | |
3879 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3880 obj) |
0 | 3881 if test -n "$deplibs"; then |
3882 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 | |
3883 fi | |
3884 | |
3885 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then | |
3886 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 | |
3887 fi | |
3888 | |
3889 if test -n "$rpath"; then | |
3890 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 | |
3891 fi | |
3892 | |
3893 if test -n "$xrpath"; then | |
3894 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 | |
3895 fi | |
3896 | |
3897 if test -n "$vinfo"; then | |
3898 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 | |
3899 fi | |
3900 | |
3901 if test -n "$release"; then | |
3902 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 | |
3903 fi | |
3904 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3905 case $output in |
0 | 3906 *.lo) |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3907 if test -n "$objs$old_deplibs"; then |
0 | 3908 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 |
3909 exit 1 | |
3910 fi | |
3911 libobj="$output" | |
3912 obj=`$echo "X$output" | $Xsed -e "$lo2o"` | |
3913 ;; | |
3914 *) | |
3915 libobj= | |
3916 obj="$output" | |
3917 ;; | |
3918 esac | |
3919 | |
3920 # Delete the old objects. | |
3921 $run $rm $obj $libobj | |
3922 | |
3923 # Objects from convenience libraries. This assumes | |
3924 # single-version convenience libraries. Whenever we create | |
3925 # different ones for PIC/non-PIC, this we'll have to duplicate | |
3926 # the extraction. | |
3927 reload_conv_objs= | |
3928 gentop= | |
3929 # reload_cmds runs $LD directly, so let us get rid of | |
3930 # -Wl from whole_archive_flag_spec | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3931 wl= |
0 | 3932 |
3933 if test -n "$convenience"; then | |
3934 if test -n "$whole_archive_flag_spec"; then | |
3935 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" | |
3936 else | |
3937 gentop="$output_objdir/${obj}x" | |
3938 $show "${rm}r $gentop" | |
3939 $run ${rm}r "$gentop" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3940 $show "$mkdir $gentop" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3941 $run $mkdir "$gentop" |
0 | 3942 status=$? |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3943 if test "$status" -ne 0 && test ! -d "$gentop"; then |
0 | 3944 exit $status |
3945 fi | |
3946 generated="$generated $gentop" | |
3947 | |
3948 for xlib in $convenience; do | |
3949 # Extract the objects. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3950 case $xlib in |
0 | 3951 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
3952 *) xabs=`pwd`"/$xlib" ;; | |
3953 esac | |
3954 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` | |
3955 xdir="$gentop/$xlib" | |
3956 | |
3957 $show "${rm}r $xdir" | |
3958 $run ${rm}r "$xdir" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3959 $show "$mkdir $xdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3960 $run $mkdir "$xdir" |
0 | 3961 status=$? |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3962 if test "$status" -ne 0 && test ! -d "$xdir"; then |
0 | 3963 exit $status |
3964 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3965 # We will extract separately just the conflicting names and we will no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3966 # longer touch any unique names. It is faster to leave these extract |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3967 # automatically by $AR in one run. |
0 | 3968 $show "(cd $xdir && $AR x $xabs)" |
3969 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3970 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3971 : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3972 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3973 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3974 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3975 $AR t "$xabs" | sort | uniq -cd | while read -r count name |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3976 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3977 i=1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3978 while test "$i" -le "$count" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3979 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3980 # Put our $i before any first dot (extension) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3981 # Never overwrite any file |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3982 name_to="$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3983 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3984 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3985 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3986 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3987 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3988 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3989 i=`expr $i + 1` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3990 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3991 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3992 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3993 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
3994 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` |
0 | 3995 done |
3996 fi | |
3997 fi | |
3998 | |
3999 # Create the old-style object. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4000 reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test |
0 | 4001 |
4002 output="$obj" | |
4003 eval cmds=\"$reload_cmds\" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4004 save_ifs="$IFS"; IFS='~' |
0 | 4005 for cmd in $cmds; do |
4006 IFS="$save_ifs" | |
4007 $show "$cmd" | |
4008 $run eval "$cmd" || exit $? | |
4009 done | |
4010 IFS="$save_ifs" | |
4011 | |
4012 # Exit if we aren't doing a library object file. | |
4013 if test -z "$libobj"; then | |
4014 if test -n "$gentop"; then | |
4015 $show "${rm}r $gentop" | |
4016 $run ${rm}r $gentop | |
4017 fi | |
4018 | |
4019 exit 0 | |
4020 fi | |
4021 | |
4022 if test "$build_libtool_libs" != yes; then | |
4023 if test -n "$gentop"; then | |
4024 $show "${rm}r $gentop" | |
4025 $run ${rm}r $gentop | |
4026 fi | |
4027 | |
4028 # Create an invalid libtool object if no PIC, so that we don't | |
4029 # accidentally link it into a program. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4030 # $show "echo timestamp > $libobj" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4031 # $run eval "echo timestamp > $libobj" || exit $? |
0 | 4032 exit 0 |
4033 fi | |
4034 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4035 if test -n "$pic_flag" || test "$pic_mode" != default; then |
0 | 4036 # Only do commands if we really have different PIC objects. |
4037 reload_objs="$libobjs $reload_conv_objs" | |
4038 output="$libobj" | |
4039 eval cmds=\"$reload_cmds\" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4040 save_ifs="$IFS"; IFS='~' |
0 | 4041 for cmd in $cmds; do |
4042 IFS="$save_ifs" | |
4043 $show "$cmd" | |
4044 $run eval "$cmd" || exit $? | |
4045 done | |
4046 IFS="$save_ifs" | |
4047 fi | |
4048 | |
4049 if test -n "$gentop"; then | |
4050 $show "${rm}r $gentop" | |
4051 $run ${rm}r $gentop | |
4052 fi | |
4053 | |
4054 exit 0 | |
4055 ;; | |
4056 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4057 prog) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4058 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4059 *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4060 esac |
0 | 4061 if test -n "$vinfo"; then |
4062 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 | |
4063 fi | |
4064 | |
4065 if test -n "$release"; then | |
4066 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 | |
4067 fi | |
4068 | |
4069 if test "$preload" = yes; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4070 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && |
0 | 4071 test "$dlopen_self_static" = unknown; then |
4072 $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4073 fi |
0 | 4074 fi |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4075 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4076 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4077 *-*-rhapsody* | *-*-darwin1.[012]) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4078 # On Rhapsody replace the C library is the System framework |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4079 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4080 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4081 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4082 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4083 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4084 case $host in |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
4085 *-*-darwin*) |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4086 # Don't allow lazy linking, it breaks C++ global constructors |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4087 if test "$tagname" = CXX ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4088 compile_command="$compile_command ${wl}-bind_at_load" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4089 finalize_command="$finalize_command ${wl}-bind_at_load" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4090 fi |
741
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
4091 # Time to change all our "foo.framework" stuff back to "-framework foo" |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
4092 compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'` |
97b9c301df94
Date: Mon, 17 Nov 2003 23:12:59 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
730
diff
changeset
|
4093 finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'` |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4094 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4095 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4096 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4097 compile_command="$compile_command $compile_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4098 finalize_command="$finalize_command $finalize_deplibs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4099 |
0 | 4100 if test -n "$rpath$xrpath"; then |
4101 # If the user specified any rpath flags, then add them. | |
4102 for libdir in $rpath $xrpath; do | |
4103 # This is the magic to use -rpath. | |
4104 case "$finalize_rpath " in | |
4105 *" $libdir "*) ;; | |
4106 *) finalize_rpath="$finalize_rpath $libdir" ;; | |
4107 esac | |
4108 done | |
4109 fi | |
4110 | |
4111 # Now hardcode the library paths | |
4112 rpath= | |
4113 hardcode_libdirs= | |
4114 for libdir in $compile_rpath $finalize_rpath; do | |
4115 if test -n "$hardcode_libdir_flag_spec"; then | |
4116 if test -n "$hardcode_libdir_separator"; then | |
4117 if test -z "$hardcode_libdirs"; then | |
4118 hardcode_libdirs="$libdir" | |
4119 else | |
4120 # Just accumulate the unique libdirs. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4121 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
0 | 4122 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
4123 ;; | |
4124 *) | |
4125 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | |
4126 ;; | |
4127 esac | |
4128 fi | |
4129 else | |
4130 eval flag=\"$hardcode_libdir_flag_spec\" | |
4131 rpath="$rpath $flag" | |
4132 fi | |
4133 elif test -n "$runpath_var"; then | |
4134 case "$perm_rpath " in | |
4135 *" $libdir "*) ;; | |
4136 *) perm_rpath="$perm_rpath $libdir" ;; | |
4137 esac | |
4138 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4139 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4140 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4141 case :$dllsearchpath: in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4142 *":$libdir:"*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4143 *) dllsearchpath="$dllsearchpath:$libdir";; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4144 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4145 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4146 esac |
0 | 4147 done |
4148 # Substitute the hardcoded libdirs into the rpath. | |
4149 if test -n "$hardcode_libdir_separator" && | |
4150 test -n "$hardcode_libdirs"; then | |
4151 libdir="$hardcode_libdirs" | |
4152 eval rpath=\" $hardcode_libdir_flag_spec\" | |
4153 fi | |
4154 compile_rpath="$rpath" | |
4155 | |
4156 rpath= | |
4157 hardcode_libdirs= | |
4158 for libdir in $finalize_rpath; do | |
4159 if test -n "$hardcode_libdir_flag_spec"; then | |
4160 if test -n "$hardcode_libdir_separator"; then | |
4161 if test -z "$hardcode_libdirs"; then | |
4162 hardcode_libdirs="$libdir" | |
4163 else | |
4164 # Just accumulate the unique libdirs. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4165 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in |
0 | 4166 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) |
4167 ;; | |
4168 *) | |
4169 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" | |
4170 ;; | |
4171 esac | |
4172 fi | |
4173 else | |
4174 eval flag=\"$hardcode_libdir_flag_spec\" | |
4175 rpath="$rpath $flag" | |
4176 fi | |
4177 elif test -n "$runpath_var"; then | |
4178 case "$finalize_perm_rpath " in | |
4179 *" $libdir "*) ;; | |
4180 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; | |
4181 esac | |
4182 fi | |
4183 done | |
4184 # Substitute the hardcoded libdirs into the rpath. | |
4185 if test -n "$hardcode_libdir_separator" && | |
4186 test -n "$hardcode_libdirs"; then | |
4187 libdir="$hardcode_libdirs" | |
4188 eval rpath=\" $hardcode_libdir_flag_spec\" | |
4189 fi | |
4190 finalize_rpath="$rpath" | |
4191 | |
4192 if test -n "$libobjs" && test "$build_old_libs" = yes; then | |
4193 # Transform all the library objects into standard objects. | |
4194 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | |
4195 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` | |
4196 fi | |
4197 | |
4198 dlsyms= | |
4199 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then | |
4200 if test -n "$NM" && test -n "$global_symbol_pipe"; then | |
4201 dlsyms="${outputname}S.c" | |
4202 else | |
4203 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 | |
4204 fi | |
4205 fi | |
4206 | |
4207 if test -n "$dlsyms"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4208 case $dlsyms in |
0 | 4209 "") ;; |
4210 *.c) | |
4211 # Discover the nlist of each of the dlfiles. | |
4212 nlist="$output_objdir/${outputname}.nm" | |
4213 | |
4214 $show "$rm $nlist ${nlist}S ${nlist}T" | |
4215 $run $rm "$nlist" "${nlist}S" "${nlist}T" | |
4216 | |
4217 # Parse the name list into a source file. | |
4218 $show "creating $output_objdir/$dlsyms" | |
4219 | |
4220 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ | |
4221 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ | |
4222 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ | |
4223 | |
4224 #ifdef __cplusplus | |
4225 extern \"C\" { | |
4226 #endif | |
4227 | |
4228 /* Prevent the only kind of declaration conflicts we can make. */ | |
4229 #define lt_preloaded_symbols some_other_symbol | |
4230 | |
4231 /* External symbol declarations for the compiler. */\ | |
4232 " | |
4233 | |
4234 if test "$dlself" = yes; then | |
4235 $show "generating symbol list for \`$output'" | |
4236 | |
4237 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" | |
4238 | |
4239 # Add our own program objects to the symbol list. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4240 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` |
0 | 4241 for arg in $progfiles; do |
4242 $show "extracting global C symbols from \`$arg'" | |
4243 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" | |
4244 done | |
4245 | |
4246 if test -n "$exclude_expsyms"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4247 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' |
0 | 4248 $run eval '$mv "$nlist"T "$nlist"' |
4249 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4250 |
0 | 4251 if test -n "$export_symbols_regex"; then |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4252 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' |
0 | 4253 $run eval '$mv "$nlist"T "$nlist"' |
4254 fi | |
4255 | |
4256 # Prepare the list of exported symbols | |
4257 if test -z "$export_symbols"; then | |
4258 export_symbols="$output_objdir/$output.exp" | |
4259 $run $rm $export_symbols | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4260 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' |
0 | 4261 else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4262 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' |
0 | 4263 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' |
4264 $run eval 'mv "$nlist"T "$nlist"' | |
4265 fi | |
4266 fi | |
4267 | |
4268 for arg in $dlprefiles; do | |
4269 $show "extracting global C symbols from \`$arg'" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4270 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4271 $run eval '$echo ": $name " >> "$nlist"' |
0 | 4272 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" |
4273 done | |
4274 | |
4275 if test -z "$run"; then | |
4276 # Make sure we have at least an empty file. | |
4277 test -f "$nlist" || : > "$nlist" | |
4278 | |
4279 if test -n "$exclude_expsyms"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4280 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T |
0 | 4281 $mv "$nlist"T "$nlist" |
4282 fi | |
4283 | |
4284 # Try sorting and uniquifying the output. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4285 if grep -v "^: " < "$nlist" | |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4286 if sort -k 3 </dev/null >/dev/null 2>&1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4287 sort -k 3 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4288 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4289 sort +2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4290 fi | |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4291 uniq > "$nlist"S; then |
0 | 4292 : |
4293 else | |
4294 grep -v "^: " < "$nlist" > "$nlist"S | |
4295 fi | |
4296 | |
4297 if test -f "$nlist"S; then | |
4298 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' | |
4299 else | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4300 $echo '/* NONE */' >> "$output_objdir/$dlsyms" |
0 | 4301 fi |
4302 | |
4303 $echo >> "$output_objdir/$dlsyms" "\ | |
4304 | |
4305 #undef lt_preloaded_symbols | |
4306 | |
4307 #if defined (__STDC__) && __STDC__ | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4308 # define lt_ptr void * |
0 | 4309 #else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4310 # define lt_ptr char * |
0 | 4311 # define const |
4312 #endif | |
4313 | |
4314 /* The mapping between symbol names and symbols. */ | |
4315 const struct { | |
4316 const char *name; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4317 lt_ptr address; |
0 | 4318 } |
4319 lt_preloaded_symbols[] = | |
4320 {\ | |
4321 " | |
4322 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4323 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" |
0 | 4324 |
4325 $echo >> "$output_objdir/$dlsyms" "\ | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4326 {0, (lt_ptr) 0} |
0 | 4327 }; |
4328 | |
4329 /* This works around a problem in FreeBSD linker */ | |
4330 #ifdef FREEBSD_WORKAROUND | |
4331 static const void *lt_preloaded_setup() { | |
4332 return lt_preloaded_symbols; | |
4333 } | |
4334 #endif | |
4335 | |
4336 #ifdef __cplusplus | |
4337 } | |
4338 #endif\ | |
4339 " | |
4340 fi | |
4341 | |
4342 pic_flag_for_symtable= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4343 case $host in |
0 | 4344 # compiling the symbol table file with pic_flag works around |
4345 # a FreeBSD bug that causes programs to crash when -lm is | |
4346 # linked before any other PIC object. But we must not use | |
4347 # pic_flag when linking with -static. The problem exists in | |
4348 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. | |
4349 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) | |
4350 case "$compile_command " in | |
4351 *" -static "*) ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4352 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; |
0 | 4353 esac;; |
4354 *-*-hpux*) | |
4355 case "$compile_command " in | |
4356 *" -static "*) ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4357 *) pic_flag_for_symtable=" $pic_flag";; |
0 | 4358 esac |
4359 esac | |
4360 | |
4361 # Now compile the dynamic symbol file. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4362 $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4363 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? |
0 | 4364 |
4365 # Clean up the generated files. | |
4366 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" | |
4367 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" | |
4368 | |
4369 # Transform the symbol file into the correct name. | |
4370 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` | |
4371 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` | |
4372 ;; | |
4373 *) | |
4374 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 | |
4375 exit 1 | |
4376 ;; | |
4377 esac | |
4378 else | |
4379 # We keep going just in case the user didn't refer to | |
4380 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe | |
4381 # really was required. | |
4382 | |
4383 # Nullify the symbol file. | |
4384 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` | |
4385 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` | |
4386 fi | |
4387 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4388 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then |
0 | 4389 # Replace the output file specification. |
4390 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` | |
4391 link_command="$compile_command$compile_rpath" | |
4392 | |
4393 # We have no uninstalled library dependencies, so finalize right now. | |
4394 $show "$link_command" | |
4395 $run eval "$link_command" | |
4396 status=$? | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4397 |
0 | 4398 # Delete the generated files. |
4399 if test -n "$dlsyms"; then | |
4400 $show "$rm $output_objdir/${outputname}S.${objext}" | |
4401 $run $rm "$output_objdir/${outputname}S.${objext}" | |
4402 fi | |
4403 | |
4404 exit $status | |
4405 fi | |
4406 | |
4407 if test -n "$shlibpath_var"; then | |
4408 # We should set the shlibpath_var | |
4409 rpath= | |
4410 for dir in $temp_rpath; do | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4411 case $dir in |
0 | 4412 [\\/]* | [A-Za-z]:[\\/]*) |
4413 # Absolute path. | |
4414 rpath="$rpath$dir:" | |
4415 ;; | |
4416 *) | |
4417 # Relative path: add a thisdir entry. | |
4418 rpath="$rpath\$thisdir/$dir:" | |
4419 ;; | |
4420 esac | |
4421 done | |
4422 temp_rpath="$rpath" | |
4423 fi | |
4424 | |
4425 if test -n "$compile_shlibpath$finalize_shlibpath"; then | |
4426 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" | |
4427 fi | |
4428 if test -n "$finalize_shlibpath"; then | |
4429 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" | |
4430 fi | |
4431 | |
4432 compile_var= | |
4433 finalize_var= | |
4434 if test -n "$runpath_var"; then | |
4435 if test -n "$perm_rpath"; then | |
4436 # We should set the runpath_var. | |
4437 rpath= | |
4438 for dir in $perm_rpath; do | |
4439 rpath="$rpath$dir:" | |
4440 done | |
4441 compile_var="$runpath_var=\"$rpath\$$runpath_var\" " | |
4442 fi | |
4443 if test -n "$finalize_perm_rpath"; then | |
4444 # We should set the runpath_var. | |
4445 rpath= | |
4446 for dir in $finalize_perm_rpath; do | |
4447 rpath="$rpath$dir:" | |
4448 done | |
4449 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " | |
4450 fi | |
4451 fi | |
4452 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4453 if test "$no_install" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4454 # We don't need to create a wrapper script. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4455 link_command="$compile_var$compile_command$compile_rpath" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4456 # Replace the output file specification. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4457 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4458 # Delete the old output file. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4459 $run $rm $output |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4460 # Link the executable and exit |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4461 $show "$link_command" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4462 $run eval "$link_command" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4463 exit 0 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4464 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4465 |
0 | 4466 if test "$hardcode_action" = relink; then |
4467 # Fast installation is not supported | |
4468 link_command="$compile_var$compile_command$compile_rpath" | |
4469 relink_command="$finalize_var$finalize_command$finalize_rpath" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4470 |
0 | 4471 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 |
4472 $echo "$modename: \`$output' will be relinked during installation" 1>&2 | |
4473 else | |
4474 if test "$fast_install" != no; then | |
4475 link_command="$finalize_var$compile_command$finalize_rpath" | |
4476 if test "$fast_install" = yes; then | |
4477 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` | |
4478 else | |
4479 # fast_install is set to needless | |
4480 relink_command= | |
4481 fi | |
4482 else | |
4483 link_command="$compile_var$compile_command$compile_rpath" | |
4484 relink_command="$finalize_var$finalize_command$finalize_rpath" | |
4485 fi | |
4486 fi | |
4487 | |
4488 # Replace the output file specification. | |
4489 link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4490 |
0 | 4491 # Delete the old output files. |
4492 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname | |
4493 | |
4494 $show "$link_command" | |
4495 $run eval "$link_command" || exit $? | |
4496 | |
4497 # Now create the wrapper script. | |
4498 $show "creating $output" | |
4499 | |
4500 # Quote the relink command for shipping. | |
4501 if test -n "$relink_command"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4502 # Preserve any variables that may affect compiler behavior |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4503 for var in $variables_saved_for_relink; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4504 if eval test -z \"\${$var+set}\"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4505 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4506 elif eval var_value=\$$var; test -z "$var_value"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4507 relink_command="$var=; export $var; $relink_command" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4508 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4509 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4510 relink_command="$var=\"$var_value\"; export $var; $relink_command" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4511 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4512 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4513 relink_command="(cd `pwd`; $relink_command)" |
0 | 4514 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
4515 fi | |
4516 | |
4517 # Quote $echo for shipping. | |
4518 if test "X$echo" = "X$SHELL $0 --fallback-echo"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4519 case $0 in |
0 | 4520 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; |
4521 *) qecho="$SHELL `pwd`/$0 --fallback-echo";; | |
4522 esac | |
4523 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` | |
4524 else | |
4525 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` | |
4526 fi | |
4527 | |
4528 # Only actually do things if our run command is non-null. | |
4529 if test -z "$run"; then | |
4530 # win32 will think the script is a binary if it has | |
4531 # a .exe suffix, so we strip it off here. | |
4532 case $output in | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4533 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4534 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4535 # test for cygwin because mv fails w/o .exe extensions |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4536 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4537 *cygwin*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4538 exeext=.exe |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4539 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4540 *) exeext= ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4541 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4542 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4543 *cygwin* | *mingw* ) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4544 cwrappersource=`$echo ${objdir}/lt-${output}.c` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4545 cwrapper=`$echo ${output}.exe` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4546 $rm $cwrappersource $cwrapper |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4547 trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4548 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4549 cat > $cwrappersource <<EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4550 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4551 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4552 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4553 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4554 The $output program cannot be directly executed until all the libtool |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4555 libraries that it depends on are installed. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4556 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4557 This wrapper executable should never be moved out of the build directory. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4558 If it is, it will not operate correctly. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4559 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4560 Currently, it simply execs the wrapper *script* "/bin/sh $output", |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4561 but could eventually absorb all of the scripts functionality and |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4562 exec $objdir/$outputname directly. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4563 */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4564 EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4565 cat >> $cwrappersource<<"EOF" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4566 #include <stdio.h> |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4567 #include <stdlib.h> |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4568 #include <unistd.h> |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4569 #include <malloc.h> |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4570 #include <stdarg.h> |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4571 #include <assert.h> |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4572 #include <sys/stat.h> |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4573 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4574 #if defined(PATH_MAX) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4575 # define LT_PATHMAX PATH_MAX |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4576 #elif defined(MAXPATHLEN) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4577 # define LT_PATHMAX MAXPATHLEN |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4578 #else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4579 # define LT_PATHMAX 1024 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4580 #endif |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4581 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4582 #ifndef DIR_SEPARATOR |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4583 # define DIR_SEPARATOR '/' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4584 # define PATH_SEPARATOR ':' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4585 #endif |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4586 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4587 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4588 defined (__OS2__) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4589 # define HAVE_DOS_BASED_FILE_SYSTEM |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4590 # ifndef DIR_SEPARATOR_2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4591 # define DIR_SEPARATOR_2 '\\' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4592 # endif |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4593 # ifndef PATH_SEPARATOR_2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4594 # define PATH_SEPARATOR_2 ';' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4595 # endif |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4596 #endif |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4597 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4598 #ifndef DIR_SEPARATOR_2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4599 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4600 #else /* DIR_SEPARATOR_2 */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4601 # define IS_DIR_SEPARATOR(ch) \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4602 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4603 #endif /* DIR_SEPARATOR_2 */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4604 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4605 #ifndef PATH_SEPARATOR_2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4606 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4607 #else /* PATH_SEPARATOR_2 */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4608 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4609 #endif /* PATH_SEPARATOR_2 */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4610 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4611 #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4612 #define XFREE(stale) do { \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4613 if (stale) { free ((void *) stale); stale = 0; } \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4614 } while (0) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4615 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4616 #if defined DEBUGWRAPPER |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4617 # define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4618 #else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4619 # define DEBUG(format, ...) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4620 #endif |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4621 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4622 const char *program_name = NULL; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4623 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4624 void * xmalloc (size_t num); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4625 char * xstrdup (const char *string); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4626 char * basename (const char *name); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4627 char * find_executable(const char *wrapper); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4628 int check_executable(const char *path); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4629 char * strendzap(char *str, const char *pat); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4630 void lt_fatal (const char *message, ...); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4631 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4632 int |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4633 main (int argc, char *argv[]) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4634 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4635 char **newargz; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4636 int i; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4637 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4638 program_name = (char *) xstrdup ((char *) basename (argv[0])); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4639 DEBUG("(main) argv[0] : %s\n",argv[0]); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4640 DEBUG("(main) program_name : %s\n",program_name); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4641 newargz = XMALLOC(char *, argc+2); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4642 EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4643 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4644 cat >> $cwrappersource <<EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4645 newargz[0] = "$SHELL"; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4646 EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4647 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4648 cat >> $cwrappersource <<"EOF" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4649 newargz[1] = find_executable(argv[0]); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4650 if (newargz[1] == NULL) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4651 lt_fatal("Couldn't find %s", argv[0]); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4652 DEBUG("(main) found exe at : %s\n",newargz[1]); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4653 /* we know the script has the same name, without the .exe */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4654 /* so make sure newargz[1] doesn't end in .exe */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4655 strendzap(newargz[1],".exe"); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4656 for (i = 1; i < argc; i++) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4657 newargz[i+1] = xstrdup(argv[i]); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4658 newargz[argc+1] = NULL; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4659 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4660 for (i=0; i<argc+1; i++) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4661 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4662 DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4663 ; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4664 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4665 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4666 EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4667 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4668 cat >> $cwrappersource <<EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4669 execv("$SHELL",newargz); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4670 EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4671 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4672 cat >> $cwrappersource <<"EOF" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4673 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4674 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4675 void * |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4676 xmalloc (size_t num) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4677 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4678 void * p = (void *) malloc (num); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4679 if (!p) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4680 lt_fatal ("Memory exhausted"); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4681 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4682 return p; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4683 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4684 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4685 char * |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4686 xstrdup (const char *string) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4687 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4688 return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4689 ; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4690 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4691 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4692 char * |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4693 basename (const char *name) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4694 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4695 const char *base; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4696 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4697 #if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4698 /* Skip over the disk name in MSDOS pathnames. */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4699 if (isalpha (name[0]) && name[1] == ':') |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4700 name += 2; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4701 #endif |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4702 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4703 for (base = name; *name; name++) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4704 if (IS_DIR_SEPARATOR (*name)) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4705 base = name + 1; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4706 return (char *) base; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4707 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4708 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4709 int |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4710 check_executable(const char * path) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4711 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4712 struct stat st; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4713 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4714 DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4715 if ((!path) || (!*path)) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4716 return 0; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4717 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4718 if ((stat (path, &st) >= 0) && |
730
0f4f974d0201
Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents:
729
diff
changeset
|
4719 ( |
0f4f974d0201
Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents:
729
diff
changeset
|
4720 #ifdef S_IXOTH |
0f4f974d0201
Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents:
729
diff
changeset
|
4721 ((st.st_mode & S_IXOTH) == S_IXOTH) || |
0f4f974d0201
Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents:
729
diff
changeset
|
4722 #endif |
0f4f974d0201
Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents:
729
diff
changeset
|
4723 #ifdef S_IXGRP |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4724 ((st.st_mode & S_IXGRP) == S_IXGRP) || |
730
0f4f974d0201
Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents:
729
diff
changeset
|
4725 #endif |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4726 ((st.st_mode & S_IXUSR) == S_IXUSR))) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4727 return 1; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4728 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4729 return 0; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4730 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4731 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4732 /* Searches for the full path of the wrapper. Returns |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4733 newly allocated full path name if found, NULL otherwise */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4734 char * |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4735 find_executable (const char* wrapper) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4736 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4737 int has_slash = 0; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4738 const char* p; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4739 const char* p_next; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4740 struct stat st; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4741 /* static buffer for getcwd */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4742 char tmp[LT_PATHMAX + 1]; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4743 int tmp_len; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4744 char* concat_name; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4745 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4746 DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4747 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4748 if ((wrapper == NULL) || (*wrapper == '\0')) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4749 return NULL; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4750 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4751 /* Absolute path? */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4752 #if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4753 if (isalpha (wrapper[0]) && wrapper[1] == ':') |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4754 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4755 concat_name = xstrdup (wrapper); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4756 if (check_executable(concat_name)) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4757 return concat_name; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4758 XFREE(concat_name); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4759 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4760 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4761 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4762 #endif |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4763 if (IS_DIR_SEPARATOR (wrapper[0])) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4764 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4765 concat_name = xstrdup (wrapper); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4766 if (check_executable(concat_name)) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4767 return concat_name; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4768 XFREE(concat_name); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4769 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4770 #if defined (HAVE_DOS_BASED_FILE_SYSTEM) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4771 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4772 #endif |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4773 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4774 for (p = wrapper; *p; p++) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4775 if (*p == '/') |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4776 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4777 has_slash = 1; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4778 break; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4779 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4780 if (!has_slash) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4781 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4782 /* no slashes; search PATH */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4783 const char* path = getenv ("PATH"); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4784 if (path != NULL) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4785 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4786 for (p = path; *p; p = p_next) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4787 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4788 const char* q; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4789 size_t p_len; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4790 for (q = p; *q; q++) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4791 if (IS_PATH_SEPARATOR(*q)) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4792 break; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4793 p_len = q - p; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4794 p_next = (*q == '\0' ? q : q + 1); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4795 if (p_len == 0) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4796 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4797 /* empty path: current directory */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4798 if (getcwd (tmp, LT_PATHMAX) == NULL) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4799 lt_fatal ("getcwd failed"); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4800 tmp_len = strlen(tmp); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4801 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4802 memcpy (concat_name, tmp, tmp_len); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4803 concat_name[tmp_len] = '/'; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4804 strcpy (concat_name + tmp_len + 1, wrapper); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4805 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4806 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4807 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4808 concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4809 memcpy (concat_name, p, p_len); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4810 concat_name[p_len] = '/'; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4811 strcpy (concat_name + p_len + 1, wrapper); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4812 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4813 if (check_executable(concat_name)) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4814 return concat_name; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4815 XFREE(concat_name); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4816 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4817 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4818 /* not found in PATH; assume curdir */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4819 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4820 /* Relative path | not found in path: prepend cwd */ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4821 if (getcwd (tmp, LT_PATHMAX) == NULL) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4822 lt_fatal ("getcwd failed"); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4823 tmp_len = strlen(tmp); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4824 concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4825 memcpy (concat_name, tmp, tmp_len); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4826 concat_name[tmp_len] = '/'; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4827 strcpy (concat_name + tmp_len + 1, wrapper); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4828 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4829 if (check_executable(concat_name)) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4830 return concat_name; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4831 XFREE(concat_name); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4832 return NULL; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4833 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4834 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4835 char * |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4836 strendzap(char *str, const char *pat) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4837 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4838 size_t len, patlen; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4839 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4840 assert(str != NULL); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4841 assert(pat != NULL); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4842 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4843 len = strlen(str); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4844 patlen = strlen(pat); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4845 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4846 if (patlen <= len) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4847 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4848 str += len - patlen; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4849 if (strcmp(str, pat) == 0) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4850 *str = '\0'; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4851 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4852 return str; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4853 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4854 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4855 static void |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4856 lt_error_core (int exit_status, const char * mode, |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4857 const char * message, va_list ap) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4858 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4859 fprintf (stderr, "%s: %s: ", program_name, mode); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4860 vfprintf (stderr, message, ap); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4861 fprintf (stderr, ".\n"); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4862 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4863 if (exit_status >= 0) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4864 exit (exit_status); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4865 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4866 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4867 void |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4868 lt_fatal (const char *message, ...) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4869 { |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4870 va_list ap; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4871 va_start (ap, message); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4872 lt_error_core (EXIT_FAILURE, "FATAL", message, ap); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4873 va_end (ap); |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4874 } |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4875 EOF |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4876 # we should really use a build-platform specific compiler |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4877 # here, but OTOH, the wrappers (shell script and this C one) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4878 # are only useful if you want to execute the "real" binary. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4879 # Since the "real" binary is built for $host, then this |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4880 # wrapper might as well be built for $host, too. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4881 $run $LTCC -s -o $cwrapper $cwrappersource |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4882 ;; |
0 | 4883 esac |
4884 $rm $output | |
4885 trap "$rm $output; exit 1" 1 2 15 | |
4886 | |
4887 $echo > $output "\ | |
4888 #! $SHELL | |
4889 | |
4890 # $output - temporary wrapper script for $objdir/$outputname | |
4891 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP | |
4892 # | |
4893 # The $output program cannot be directly executed until all the libtool | |
4894 # libraries that it depends on are installed. | |
4895 # | |
4896 # This wrapper script should never be moved out of the build directory. | |
4897 # If it is, it will not operate correctly. | |
4898 | |
4899 # Sed substitution that helps us do robust quoting. It backslashifies | |
4900 # metacharacters that are still active within double-quoted strings. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4901 Xsed='${SED} -e 1s/^X//' |
0 | 4902 sed_quote_subst='$sed_quote_subst' |
4903 | |
4904 # The HP-UX ksh and POSIX shell print the target directory to stdout | |
4905 # if CDPATH is set. | |
4906 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi | |
4907 | |
4908 relink_command=\"$relink_command\" | |
4909 | |
4910 # This environment variable determines our operation mode. | |
4911 if test \"\$libtool_install_magic\" = \"$magic\"; then | |
4912 # install mode needs the following variable: | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4913 notinst_deplibs='$notinst_deplibs' |
0 | 4914 else |
4915 # When we are sourced in execute mode, \$file and \$echo are already set. | |
4916 if test \"\$libtool_execute_magic\" != \"$magic\"; then | |
4917 echo=\"$qecho\" | |
4918 file=\"\$0\" | |
4919 # Make sure echo works. | |
4920 if test \"X\$1\" = X--no-reexec; then | |
4921 # Discard the --no-reexec flag, and continue. | |
4922 shift | |
4923 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then | |
4924 # Yippee, \$echo works! | |
4925 : | |
4926 else | |
4927 # Restart under the correct shell, and then maybe \$echo will work. | |
4928 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} | |
4929 fi | |
4930 fi\ | |
4931 " | |
4932 $echo >> $output "\ | |
4933 | |
4934 # Find the directory that this script lives in. | |
4935 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` | |
4936 test \"x\$thisdir\" = \"x\$file\" && thisdir=. | |
4937 | |
4938 # Follow symbolic links until we get to the real thisdir. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4939 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` |
0 | 4940 while test -n \"\$file\"; do |
4941 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` | |
4942 | |
4943 # If there was a directory component, then change thisdir. | |
4944 if test \"x\$destdir\" != \"x\$file\"; then | |
4945 case \"\$destdir\" in | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4946 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; |
0 | 4947 *) thisdir=\"\$thisdir/\$destdir\" ;; |
4948 esac | |
4949 fi | |
4950 | |
4951 file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4952 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` |
0 | 4953 done |
4954 | |
4955 # Try to get the absolute directory name. | |
4956 absdir=\`cd \"\$thisdir\" && pwd\` | |
4957 test -n \"\$absdir\" && thisdir=\"\$absdir\" | |
4958 " | |
4959 | |
4960 if test "$fast_install" = yes; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4961 $echo >> $output "\ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4962 program=lt-'$outputname'$exeext |
0 | 4963 progdir=\"\$thisdir/$objdir\" |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4964 |
0 | 4965 if test ! -f \"\$progdir/\$program\" || \\ |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4966 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ |
0 | 4967 test \"X\$file\" != \"X\$progdir/\$program\"; }; then |
4968 | |
4969 file=\"\$\$-\$program\" | |
4970 | |
4971 if test ! -d \"\$progdir\"; then | |
4972 $mkdir \"\$progdir\" | |
4973 else | |
4974 $rm \"\$progdir/\$file\" | |
4975 fi" | |
4976 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4977 $echo >> $output "\ |
0 | 4978 |
4979 # relink executable if necessary | |
4980 if test -n \"\$relink_command\"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4981 if relink_command_output=\`eval \$relink_command 2>&1\`; then : |
0 | 4982 else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4983 $echo \"\$relink_command_output\" >&2 |
0 | 4984 $rm \"\$progdir/\$file\" |
4985 exit 1 | |
4986 fi | |
4987 fi | |
4988 | |
4989 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || | |
4990 { $rm \"\$progdir/\$program\"; | |
4991 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } | |
4992 $rm \"\$progdir/\$file\" | |
4993 fi" | |
4994 else | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
4995 $echo >> $output "\ |
0 | 4996 program='$outputname' |
4997 progdir=\"\$thisdir/$objdir\" | |
4998 " | |
4999 fi | |
5000 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5001 $echo >> $output "\ |
0 | 5002 |
5003 if test -f \"\$progdir/\$program\"; then" | |
5004 | |
5005 # Export our shlibpath_var if we have one. | |
5006 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then | |
5007 $echo >> $output "\ | |
5008 # Add our own library path to $shlibpath_var | |
5009 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" | |
5010 | |
5011 # Some systems cannot cope with colon-terminated $shlibpath_var | |
5012 # The second colon is a workaround for a bug in BeOS R4 sed | |
5013 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` | |
5014 | |
5015 export $shlibpath_var | |
5016 " | |
5017 fi | |
5018 | |
5019 # fixup the dll searchpath if we need to. | |
5020 if test -n "$dllsearchpath"; then | |
5021 $echo >> $output "\ | |
5022 # Add the dll search path components to the executable PATH | |
5023 PATH=$dllsearchpath:\$PATH | |
5024 " | |
5025 fi | |
5026 | |
5027 $echo >> $output "\ | |
5028 if test \"\$libtool_execute_magic\" != \"$magic\"; then | |
5029 # Run the actual program with our arguments. | |
5030 " | |
5031 case $host in | |
5032 # Backslashes separate directories on plain windows | |
5033 *-*-mingw | *-*-os2*) | |
5034 $echo >> $output "\ | |
5035 exec \$progdir\\\\\$program \${1+\"\$@\"} | |
5036 " | |
5037 ;; | |
5038 | |
5039 *) | |
5040 $echo >> $output "\ | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5041 exec \$progdir/\$program \${1+\"\$@\"} |
0 | 5042 " |
5043 ;; | |
5044 esac | |
5045 $echo >> $output "\ | |
5046 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" | |
5047 exit 1 | |
5048 fi | |
5049 else | |
5050 # The program doesn't exist. | |
5051 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 | |
5052 \$echo \"This script is just a wrapper for \$program.\" 1>&2 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5053 $echo \"See the $PACKAGE documentation for more information.\" 1>&2 |
0 | 5054 exit 1 |
5055 fi | |
5056 fi\ | |
5057 " | |
5058 chmod +x $output | |
5059 fi | |
5060 exit 0 | |
5061 ;; | |
5062 esac | |
5063 | |
5064 # See if we need to build an old-fashioned archive. | |
5065 for oldlib in $oldlibs; do | |
5066 | |
5067 if test "$build_libtool_libs" = convenience; then | |
5068 oldobjs="$libobjs_save" | |
5069 addlibs="$convenience" | |
5070 build_libtool_libs=no | |
5071 else | |
5072 if test "$build_libtool_libs" = module; then | |
5073 oldobjs="$libobjs_save" | |
5074 build_libtool_libs=no | |
5075 else | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5076 oldobjs="$old_deplibs $non_pic_objects" |
0 | 5077 fi |
5078 addlibs="$old_convenience" | |
5079 fi | |
5080 | |
5081 if test -n "$addlibs"; then | |
5082 gentop="$output_objdir/${outputname}x" | |
5083 $show "${rm}r $gentop" | |
5084 $run ${rm}r "$gentop" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5085 $show "$mkdir $gentop" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5086 $run $mkdir "$gentop" |
0 | 5087 status=$? |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5088 if test "$status" -ne 0 && test ! -d "$gentop"; then |
0 | 5089 exit $status |
5090 fi | |
5091 generated="$generated $gentop" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5092 |
0 | 5093 # Add in members from convenience archives. |
5094 for xlib in $addlibs; do | |
5095 # Extract the objects. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5096 case $xlib in |
0 | 5097 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; |
5098 *) xabs=`pwd`"/$xlib" ;; | |
5099 esac | |
5100 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` | |
5101 xdir="$gentop/$xlib" | |
5102 | |
5103 $show "${rm}r $xdir" | |
5104 $run ${rm}r "$xdir" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5105 $show "$mkdir $xdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5106 $run $mkdir "$xdir" |
0 | 5107 status=$? |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5108 if test "$status" -ne 0 && test ! -d "$xdir"; then |
0 | 5109 exit $status |
5110 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5111 # We will extract separately just the conflicting names and we will no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5112 # longer touch any unique names. It is faster to leave these extract |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5113 # automatically by $AR in one run. |
0 | 5114 $show "(cd $xdir && $AR x $xabs)" |
5115 $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5116 if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5117 : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5118 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5119 $echo "$modename: warning: object name conflicts; renaming object files" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5120 $echo "$modename: warning: to ensure that they will not overwrite" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5121 $AR t "$xabs" | sort | uniq -cd | while read -r count name |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5122 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5123 i=1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5124 while test "$i" -le "$count" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5125 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5126 # Put our $i before any first dot (extension) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5127 # Never overwrite any file |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5128 name_to="$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5129 while test "X$name_to" = "X$name" || test -f "$xdir/$name_to" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5130 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5131 name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5132 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5133 $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5134 $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5135 i=`expr $i + 1` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5136 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5137 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5138 fi |
0 | 5139 |
5140 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` | |
5141 done | |
5142 fi | |
5143 | |
5144 # Do each command in the archive commands. | |
5145 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then | |
5146 eval cmds=\"$old_archive_from_new_cmds\" | |
5147 else | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5148 eval cmds=\"$old_archive_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5149 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5150 if len=`expr "X$cmds" : ".*"` && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5151 test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5152 : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5153 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5154 # the command line is too long to link in one step, link in parts |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5155 $echo "using piecewise archive linking..." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5156 save_RANLIB=$RANLIB |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5157 RANLIB=: |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5158 objlist= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5159 concat_cmds= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5160 save_oldobjs=$oldobjs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5161 # GNU ar 2.10+ was changed to match POSIX; thus no paths are |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5162 # encoded into archives. This makes 'ar r' malfunction in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5163 # this piecewise linking case whenever conflicting object |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5164 # names appear in distinct ar calls; check, warn and compensate. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5165 if (for obj in $save_oldobjs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5166 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5167 $echo "X$obj" | $Xsed -e 's%^.*/%%' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5168 done | sort | sort -uc >/dev/null 2>&1); then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5169 : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5170 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5171 $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5172 $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5173 AR_FLAGS=cq |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5174 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5175 # Is there a better way of finding the last object in the list? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5176 for obj in $save_oldobjs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5177 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5178 last_oldobj=$obj |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5179 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5180 for obj in $save_oldobjs |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5181 do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5182 oldobjs="$objlist $obj" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5183 objlist="$objlist $obj" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5184 eval test_cmds=\"$old_archive_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5185 if len=`expr "X$test_cmds" : ".*"` && |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5186 test "$len" -le "$max_cmd_len"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5187 : |
0 | 5188 else |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5189 # the above command should be used before it gets too long |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5190 oldobjs=$objlist |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5191 if test "$obj" = "$last_oldobj" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5192 RANLIB=$save_RANLIB |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5193 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5194 test -z "$concat_cmds" || concat_cmds=$concat_cmds~ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5195 eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5196 objlist= |
0 | 5197 fi |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5198 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5199 RANLIB=$save_RANLIB |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5200 oldobjs=$objlist |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5201 if test "X$oldobjs" = "X" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5202 eval cmds=\"\$concat_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5203 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5204 eval cmds=\"\$concat_cmds~$old_archive_cmds\" |
0 | 5205 fi |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5206 fi |
0 | 5207 fi |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5208 save_ifs="$IFS"; IFS='~' |
0 | 5209 for cmd in $cmds; do |
5210 IFS="$save_ifs" | |
5211 $show "$cmd" | |
5212 $run eval "$cmd" || exit $? | |
5213 done | |
5214 IFS="$save_ifs" | |
5215 done | |
5216 | |
5217 if test -n "$generated"; then | |
5218 $show "${rm}r$generated" | |
5219 $run ${rm}r$generated | |
5220 fi | |
5221 | |
5222 # Now create the libtool archive. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5223 case $output in |
0 | 5224 *.la) |
5225 old_library= | |
5226 test "$build_old_libs" = yes && old_library="$libname.$libext" | |
5227 $show "creating $output" | |
5228 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5229 # Preserve any variables that may affect compiler behavior |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5230 for var in $variables_saved_for_relink; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5231 if eval test -z \"\${$var+set}\"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5232 relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5233 elif eval var_value=\$$var; test -z "$var_value"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5234 relink_command="$var=; export $var; $relink_command" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5235 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5236 var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5237 relink_command="$var=\"$var_value\"; export $var; $relink_command" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5238 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5239 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5240 # Quote the link command for shipping. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5241 relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5242 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` |
0 | 5243 |
5244 # Only create the output if not a dry run. | |
5245 if test -z "$run"; then | |
5246 for installed in no yes; do | |
5247 if test "$installed" = yes; then | |
5248 if test -z "$install_libdir"; then | |
5249 break | |
5250 fi | |
5251 output="$output_objdir/$outputname"i | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5252 # Replace all uninstalled libtool libraries with the installed ones |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5253 newdependency_libs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5254 for deplib in $dependency_libs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5255 case $deplib in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5256 *.la) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5257 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5258 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5259 if test -z "$libdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5260 $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5261 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5262 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5263 newdependency_libs="$newdependency_libs $libdir/$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5264 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5265 *) newdependency_libs="$newdependency_libs $deplib" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5266 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5267 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5268 dependency_libs="$newdependency_libs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5269 newdlfiles= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5270 for lib in $dlfiles; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5271 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5272 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5273 if test -z "$libdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5274 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5275 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5276 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5277 newdlfiles="$newdlfiles $libdir/$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5278 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5279 dlfiles="$newdlfiles" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5280 newdlprefiles= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5281 for lib in $dlprefiles; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5282 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5283 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5284 if test -z "$libdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5285 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5286 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5287 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5288 newdlprefiles="$newdlprefiles $libdir/$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5289 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5290 dlprefiles="$newdlprefiles" |
0 | 5291 fi |
5292 $rm $output | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5293 # place dlname in correct position for cygwin |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5294 tdlname=$dlname |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5295 case $host,$output,$installed,$module,$dlname in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5296 *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5297 esac |
0 | 5298 $echo > $output "\ |
5299 # $outputname - a libtool library file | |
5300 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP | |
5301 # | |
5302 # Please DO NOT delete this file! | |
5303 # It is necessary for linking the library. | |
5304 | |
5305 # The name that we can dlopen(3). | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5306 dlname='$tdlname' |
0 | 5307 |
5308 # Names of this library. | |
5309 library_names='$library_names' | |
5310 | |
5311 # The name of the static archive. | |
5312 old_library='$old_library' | |
5313 | |
5314 # Libraries that this one depends upon. | |
5315 dependency_libs='$dependency_libs' | |
5316 | |
5317 # Version information for $libname. | |
5318 current=$current | |
5319 age=$age | |
5320 revision=$revision | |
5321 | |
5322 # Is this an already installed library? | |
5323 installed=$installed | |
5324 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5325 # Should we warn about portability when linking against -modules? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5326 shouldnotlink=$module |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5327 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5328 # Files to dlopen/dlpreopen |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5329 dlopen='$dlfiles' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5330 dlpreopen='$dlprefiles' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5331 |
0 | 5332 # Directory that this library needs to be installed in: |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5333 libdir='$install_libdir'" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5334 if test "$installed" = no && test "$need_relink" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5335 $echo >> $output "\ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5336 relink_command=\"$relink_command\"" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5337 fi |
0 | 5338 done |
5339 fi | |
5340 | |
5341 # Do a symbolic link so that the libtool archive can be found in | |
5342 # LD_LIBRARY_PATH before the program is installed. | |
5343 $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5344 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? |
0 | 5345 ;; |
5346 esac | |
5347 exit 0 | |
5348 ;; | |
5349 | |
5350 # libtool install mode | |
5351 install) | |
5352 modename="$modename: install" | |
5353 | |
5354 # There may be an optional sh(1) argument at the beginning of | |
5355 # install_prog (especially on Windows NT). | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5356 if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5357 # Allow the use of GNU shtool's install command. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5358 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then |
0 | 5359 # Aesthetically quote it. |
5360 arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5361 case $arg in |
0 | 5362 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
5363 arg="\"$arg\"" | |
5364 ;; | |
5365 esac | |
5366 install_prog="$arg " | |
5367 arg="$1" | |
5368 shift | |
5369 else | |
5370 install_prog= | |
5371 arg="$nonopt" | |
5372 fi | |
5373 | |
5374 # The real first argument should be the name of the installation program. | |
5375 # Aesthetically quote it. | |
5376 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5377 case $arg in |
0 | 5378 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
5379 arg="\"$arg\"" | |
5380 ;; | |
5381 esac | |
5382 install_prog="$install_prog$arg" | |
5383 | |
5384 # We need to accept at least all the BSD install flags. | |
5385 dest= | |
5386 files= | |
5387 opts= | |
5388 prev= | |
5389 install_type= | |
5390 isdir=no | |
5391 stripme= | |
5392 for arg | |
5393 do | |
5394 if test -n "$dest"; then | |
5395 files="$files $dest" | |
5396 dest="$arg" | |
5397 continue | |
5398 fi | |
5399 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5400 case $arg in |
0 | 5401 -d) isdir=yes ;; |
5402 -f) prev="-f" ;; | |
5403 -g) prev="-g" ;; | |
5404 -m) prev="-m" ;; | |
5405 -o) prev="-o" ;; | |
5406 -s) | |
5407 stripme=" -s" | |
5408 continue | |
5409 ;; | |
5410 -*) ;; | |
5411 | |
5412 *) | |
5413 # If the previous option needed an argument, then skip it. | |
5414 if test -n "$prev"; then | |
5415 prev= | |
5416 else | |
5417 dest="$arg" | |
5418 continue | |
5419 fi | |
5420 ;; | |
5421 esac | |
5422 | |
5423 # Aesthetically quote the argument. | |
5424 arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5425 case $arg in |
0 | 5426 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) |
5427 arg="\"$arg\"" | |
5428 ;; | |
5429 esac | |
5430 install_prog="$install_prog $arg" | |
5431 done | |
5432 | |
5433 if test -z "$install_prog"; then | |
5434 $echo "$modename: you must specify an install program" 1>&2 | |
5435 $echo "$help" 1>&2 | |
5436 exit 1 | |
5437 fi | |
5438 | |
5439 if test -n "$prev"; then | |
5440 $echo "$modename: the \`$prev' option requires an argument" 1>&2 | |
5441 $echo "$help" 1>&2 | |
5442 exit 1 | |
5443 fi | |
5444 | |
5445 if test -z "$files"; then | |
5446 if test -z "$dest"; then | |
5447 $echo "$modename: no file or destination specified" 1>&2 | |
5448 else | |
5449 $echo "$modename: you must specify a destination" 1>&2 | |
5450 fi | |
5451 $echo "$help" 1>&2 | |
5452 exit 1 | |
5453 fi | |
5454 | |
5455 # Strip any trailing slash from the destination. | |
5456 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` | |
5457 | |
5458 # Check to see that the destination is a directory. | |
5459 test -d "$dest" && isdir=yes | |
5460 if test "$isdir" = yes; then | |
5461 destdir="$dest" | |
5462 destname= | |
5463 else | |
5464 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` | |
5465 test "X$destdir" = "X$dest" && destdir=. | |
5466 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` | |
5467 | |
5468 # Not a directory, so check to see that there is only one file specified. | |
5469 set dummy $files | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5470 if test "$#" -gt 2; then |
0 | 5471 $echo "$modename: \`$dest' is not a directory" 1>&2 |
5472 $echo "$help" 1>&2 | |
5473 exit 1 | |
5474 fi | |
5475 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5476 case $destdir in |
0 | 5477 [\\/]* | [A-Za-z]:[\\/]*) ;; |
5478 *) | |
5479 for file in $files; do | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5480 case $file in |
0 | 5481 *.lo) ;; |
5482 *) | |
5483 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 | |
5484 $echo "$help" 1>&2 | |
5485 exit 1 | |
5486 ;; | |
5487 esac | |
5488 done | |
5489 ;; | |
5490 esac | |
5491 | |
5492 # This variable tells wrapper scripts just to set variables rather | |
5493 # than running their programs. | |
5494 libtool_install_magic="$magic" | |
5495 | |
5496 staticlibs= | |
5497 future_libdirs= | |
5498 current_libdirs= | |
5499 for file in $files; do | |
5500 | |
5501 # Do each installation. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5502 case $file in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5503 *.$libext) |
0 | 5504 # Do the static libraries later. |
5505 staticlibs="$staticlibs $file" | |
5506 ;; | |
5507 | |
5508 *.la) | |
5509 # Check to see that this really is a libtool archive. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5510 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
0 | 5511 else |
5512 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 | |
5513 $echo "$help" 1>&2 | |
5514 exit 1 | |
5515 fi | |
5516 | |
5517 library_names= | |
5518 old_library= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5519 relink_command= |
0 | 5520 # If there is no directory component, then add one. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5521 case $file in |
0 | 5522 */* | *\\*) . $file ;; |
5523 *) . ./$file ;; | |
5524 esac | |
5525 | |
5526 # Add the libdir to current_libdirs if it is the destination. | |
5527 if test "X$destdir" = "X$libdir"; then | |
5528 case "$current_libdirs " in | |
5529 *" $libdir "*) ;; | |
5530 *) current_libdirs="$current_libdirs $libdir" ;; | |
5531 esac | |
5532 else | |
5533 # Note the libdir as a future libdir. | |
5534 case "$future_libdirs " in | |
5535 *" $libdir "*) ;; | |
5536 *) future_libdirs="$future_libdirs $libdir" ;; | |
5537 esac | |
5538 fi | |
5539 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5540 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ |
0 | 5541 test "X$dir" = "X$file/" && dir= |
5542 dir="$dir$objdir" | |
5543 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5544 if test -n "$relink_command"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5545 # Determine the prefix the user has applied to our future dir. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5546 inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5547 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5548 # Don't allow the user to place us outside of our expected |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5549 # location b/c this prevents finding dependent libraries that |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5550 # are installed to the same prefix. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5551 # At present, this check doesn't affect windows .dll's that |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5552 # are installed into $libdir/../bin (currently, that works fine) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5553 # but it's something to keep an eye on. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5554 if test "$inst_prefix_dir" = "$destdir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5555 $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5556 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5557 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5558 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5559 if test -n "$inst_prefix_dir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5560 # Stick the inst_prefix_dir data into the link command. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5561 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5562 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5563 relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5564 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5565 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5566 $echo "$modename: warning: relinking \`$file'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5567 $show "$relink_command" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5568 if $run eval "$relink_command"; then : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5569 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5570 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5571 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5572 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5573 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5574 |
0 | 5575 # See the names of the shared library. |
5576 set dummy $library_names | |
5577 if test -n "$2"; then | |
5578 realname="$2" | |
5579 shift | |
5580 shift | |
5581 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5582 srcname="$realname" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5583 test -n "$relink_command" && srcname="$realname"T |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5584 |
0 | 5585 # Install the shared library and build the symlinks. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5586 $show "$install_prog $dir/$srcname $destdir/$realname" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5587 $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5588 if test -n "$stripme" && test -n "$striplib"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5589 $show "$striplib $destdir/$realname" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5590 $run eval "$striplib $destdir/$realname" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5591 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5592 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5593 if test "$#" -gt 0; then |
0 | 5594 # Delete the old symlinks, and create new ones. |
5595 for linkname | |
5596 do | |
5597 if test "$linkname" != "$realname"; then | |
5598 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" | |
5599 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" | |
5600 fi | |
5601 done | |
5602 fi | |
5603 | |
5604 # Do each command in the postinstall commands. | |
5605 lib="$destdir/$realname" | |
5606 eval cmds=\"$postinstall_cmds\" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5607 save_ifs="$IFS"; IFS='~' |
0 | 5608 for cmd in $cmds; do |
5609 IFS="$save_ifs" | |
5610 $show "$cmd" | |
5611 $run eval "$cmd" || exit $? | |
5612 done | |
5613 IFS="$save_ifs" | |
5614 fi | |
5615 | |
5616 # Install the pseudo-library for information purposes. | |
5617 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | |
5618 instname="$dir/$name"i | |
5619 $show "$install_prog $instname $destdir/$name" | |
5620 $run eval "$install_prog $instname $destdir/$name" || exit $? | |
5621 | |
5622 # Maybe install the static library, too. | |
5623 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" | |
5624 ;; | |
5625 | |
5626 *.lo) | |
5627 # Install (i.e. copy) a libtool object. | |
5628 | |
5629 # Figure out destination file name, if it wasn't already specified. | |
5630 if test -n "$destname"; then | |
5631 destfile="$destdir/$destname" | |
5632 else | |
5633 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | |
5634 destfile="$destdir/$destfile" | |
5635 fi | |
5636 | |
5637 # Deduce the name of the destination old-style object file. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5638 case $destfile in |
0 | 5639 *.lo) |
5640 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` | |
5641 ;; | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5642 *.$objext) |
0 | 5643 staticdest="$destfile" |
5644 destfile= | |
5645 ;; | |
5646 *) | |
5647 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 | |
5648 $echo "$help" 1>&2 | |
5649 exit 1 | |
5650 ;; | |
5651 esac | |
5652 | |
5653 # Install the libtool object if requested. | |
5654 if test -n "$destfile"; then | |
5655 $show "$install_prog $file $destfile" | |
5656 $run eval "$install_prog $file $destfile" || exit $? | |
5657 fi | |
5658 | |
5659 # Install the old object if enabled. | |
5660 if test "$build_old_libs" = yes; then | |
5661 # Deduce the name of the old-style object file. | |
5662 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` | |
5663 | |
5664 $show "$install_prog $staticobj $staticdest" | |
5665 $run eval "$install_prog \$staticobj \$staticdest" || exit $? | |
5666 fi | |
5667 exit 0 | |
5668 ;; | |
5669 | |
5670 *) | |
5671 # Figure out destination file name, if it wasn't already specified. | |
5672 if test -n "$destname"; then | |
5673 destfile="$destdir/$destname" | |
5674 else | |
5675 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | |
5676 destfile="$destdir/$destfile" | |
5677 fi | |
5678 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5679 # If the file is missing, and there is a .exe on the end, strip it |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5680 # because it is most likely a libtool script we actually want to |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5681 # install |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5682 stripped_ext="" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5683 case $file in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5684 *.exe) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5685 if test ! -f "$file"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5686 file=`$echo $file|${SED} 's,.exe$,,'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5687 stripped_ext=".exe" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5688 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5689 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5690 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5691 |
0 | 5692 # Do a test to see if this is really a libtool program. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5693 case $host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5694 *cygwin*|*mingw*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5695 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5696 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5697 *) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5698 wrapper=$file |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5699 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5700 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5701 if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5702 notinst_deplibs= |
0 | 5703 relink_command= |
5704 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5705 # To insure that "foo" is sourced, and not "foo.exe", |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5706 # finese the cygwin/MSYS system by explicitly sourcing "foo." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5707 # which disallows the automatic-append-.exe behavior. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5708 case $build in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5709 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5710 *) wrapperdot=${wrapper} ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5711 esac |
0 | 5712 # If there is no directory component, then add one. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5713 case $file in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5714 */* | *\\*) . ${wrapperdot} ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5715 *) . ./${wrapperdot} ;; |
0 | 5716 esac |
5717 | |
5718 # Check the variables that should have been set. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5719 if test -z "$notinst_deplibs"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5720 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 |
0 | 5721 exit 1 |
5722 fi | |
5723 | |
5724 finalize=yes | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5725 for lib in $notinst_deplibs; do |
0 | 5726 # Check to see that each library is installed. |
5727 libdir= | |
5728 if test -f "$lib"; then | |
5729 # If there is no directory component, then add one. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5730 case $lib in |
0 | 5731 */* | *\\*) . $lib ;; |
5732 *) . ./$lib ;; | |
5733 esac | |
5734 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5735 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test |
0 | 5736 if test -n "$libdir" && test ! -f "$libfile"; then |
5737 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 | |
5738 finalize=no | |
5739 fi | |
5740 done | |
5741 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5742 relink_command= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5743 # To insure that "foo" is sourced, and not "foo.exe", |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5744 # finese the cygwin/MSYS system by explicitly sourcing "foo." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5745 # which disallows the automatic-append-.exe behavior. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5746 case $build in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5747 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5748 *) wrapperdot=${wrapper} ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5749 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5750 # If there is no directory component, then add one. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5751 case $file in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5752 */* | *\\*) . ${wrapperdot} ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5753 *) . ./${wrapperdot} ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5754 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5755 |
0 | 5756 outputname= |
5757 if test "$fast_install" = no && test -n "$relink_command"; then | |
5758 if test "$finalize" = yes && test -z "$run"; then | |
5759 tmpdir="/tmp" | |
5760 test -n "$TMPDIR" && tmpdir="$TMPDIR" | |
5761 tmpdir="$tmpdir/libtool-$$" | |
5762 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : | |
5763 else | |
5764 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 | |
5765 continue | |
5766 fi | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5767 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` |
0 | 5768 outputname="$tmpdir/$file" |
5769 # Replace the output file specification. | |
5770 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` | |
5771 | |
5772 $show "$relink_command" | |
5773 if $run eval "$relink_command"; then : | |
5774 else | |
5775 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 | |
5776 ${rm}r "$tmpdir" | |
5777 continue | |
5778 fi | |
5779 file="$outputname" | |
5780 else | |
5781 $echo "$modename: warning: cannot relink \`$file'" 1>&2 | |
5782 fi | |
5783 else | |
5784 # Install the binary that we compiled earlier. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5785 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` |
0 | 5786 fi |
5787 fi | |
5788 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5789 # remove .exe since cygwin /usr/bin/install will append another |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5790 # one anyways |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5791 case $install_prog,$host in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5792 */usr/bin/install*,*cygwin*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5793 case $file:$destfile in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5794 *.exe:*.exe) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5795 # this is ok |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5796 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5797 *.exe:*) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5798 destfile=$destfile.exe |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5799 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5800 *:*.exe) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5801 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5802 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5803 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5804 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5805 esac |
0 | 5806 $show "$install_prog$stripme $file $destfile" |
5807 $run eval "$install_prog\$stripme \$file \$destfile" || exit $? | |
5808 test -n "$outputname" && ${rm}r "$tmpdir" | |
5809 ;; | |
5810 esac | |
5811 done | |
5812 | |
5813 for file in $staticlibs; do | |
5814 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` | |
5815 | |
5816 # Set up the ranlib parameters. | |
5817 oldlib="$destdir/$name" | |
5818 | |
5819 $show "$install_prog $file $oldlib" | |
5820 $run eval "$install_prog \$file \$oldlib" || exit $? | |
5821 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5822 if test -n "$stripme" && test -n "$striplib"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5823 $show "$old_striplib $oldlib" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5824 $run eval "$old_striplib $oldlib" || exit $? |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5825 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5826 |
0 | 5827 # Do each command in the postinstall commands. |
5828 eval cmds=\"$old_postinstall_cmds\" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5829 save_ifs="$IFS"; IFS='~' |
0 | 5830 for cmd in $cmds; do |
5831 IFS="$save_ifs" | |
5832 $show "$cmd" | |
5833 $run eval "$cmd" || exit $? | |
5834 done | |
5835 IFS="$save_ifs" | |
5836 done | |
5837 | |
5838 if test -n "$future_libdirs"; then | |
5839 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 | |
5840 fi | |
5841 | |
5842 if test -n "$current_libdirs"; then | |
5843 # Maybe just do a dry run. | |
5844 test -n "$run" && current_libdirs=" -n$current_libdirs" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5845 exec_cmd='$SHELL $0 --finish$current_libdirs' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5846 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5847 exit 0 |
0 | 5848 fi |
5849 ;; | |
5850 | |
5851 # libtool finish mode | |
5852 finish) | |
5853 modename="$modename: finish" | |
5854 libdirs="$nonopt" | |
5855 admincmds= | |
5856 | |
5857 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then | |
5858 for dir | |
5859 do | |
5860 libdirs="$libdirs $dir" | |
5861 done | |
5862 | |
5863 for libdir in $libdirs; do | |
5864 if test -n "$finish_cmds"; then | |
5865 # Do each command in the finish commands. | |
5866 eval cmds=\"$finish_cmds\" | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5867 save_ifs="$IFS"; IFS='~' |
0 | 5868 for cmd in $cmds; do |
5869 IFS="$save_ifs" | |
5870 $show "$cmd" | |
5871 $run eval "$cmd" || admincmds="$admincmds | |
5872 $cmd" | |
5873 done | |
5874 IFS="$save_ifs" | |
5875 fi | |
5876 if test -n "$finish_eval"; then | |
5877 # Do the single finish_eval. | |
5878 eval cmds=\"$finish_eval\" | |
5879 $run eval "$cmds" || admincmds="$admincmds | |
5880 $cmds" | |
5881 fi | |
5882 done | |
5883 fi | |
5884 | |
5885 # Exit here if they wanted silent mode. | |
5886 test "$show" = : && exit 0 | |
5887 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5888 $echo "----------------------------------------------------------------------" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5889 $echo "Libraries have been installed in:" |
0 | 5890 for libdir in $libdirs; do |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5891 $echo " $libdir" |
0 | 5892 done |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5893 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5894 $echo "If you ever happen to want to link against installed libraries" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5895 $echo "in a given directory, LIBDIR, you must either use libtool, and" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5896 $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5897 $echo "flag during linking and do at least one of the following:" |
0 | 5898 if test -n "$shlibpath_var"; then |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5899 $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5900 $echo " during execution" |
0 | 5901 fi |
5902 if test -n "$runpath_var"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5903 $echo " - add LIBDIR to the \`$runpath_var' environment variable" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5904 $echo " during linking" |
0 | 5905 fi |
5906 if test -n "$hardcode_libdir_flag_spec"; then | |
5907 libdir=LIBDIR | |
5908 eval flag=\"$hardcode_libdir_flag_spec\" | |
5909 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5910 $echo " - use the \`$flag' linker flag" |
0 | 5911 fi |
5912 if test -n "$admincmds"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5913 $echo " - have your system administrator run these commands:$admincmds" |
0 | 5914 fi |
5915 if test -f /etc/ld.so.conf; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5916 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" |
0 | 5917 fi |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5918 $echo |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5919 $echo "See any operating system documentation about shared libraries for" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5920 $echo "more information, such as the ld(1) and ld.so(8) manual pages." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5921 $echo "----------------------------------------------------------------------" |
0 | 5922 exit 0 |
5923 ;; | |
5924 | |
5925 # libtool execute mode | |
5926 execute) | |
5927 modename="$modename: execute" | |
5928 | |
5929 # The first argument is the command name. | |
5930 cmd="$nonopt" | |
5931 if test -z "$cmd"; then | |
5932 $echo "$modename: you must specify a COMMAND" 1>&2 | |
5933 $echo "$help" | |
5934 exit 1 | |
5935 fi | |
5936 | |
5937 # Handle -dlopen flags immediately. | |
5938 for file in $execute_dlfiles; do | |
5939 if test ! -f "$file"; then | |
5940 $echo "$modename: \`$file' is not a file" 1>&2 | |
5941 $echo "$help" 1>&2 | |
5942 exit 1 | |
5943 fi | |
5944 | |
5945 dir= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5946 case $file in |
0 | 5947 *.la) |
5948 # Check to see that this really is a libtool archive. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5949 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : |
0 | 5950 else |
5951 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 | |
5952 $echo "$help" 1>&2 | |
5953 exit 1 | |
5954 fi | |
5955 | |
5956 # Read the libtool library. | |
5957 dlname= | |
5958 library_names= | |
5959 | |
5960 # If there is no directory component, then add one. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
5961 case $file in |
0 | 5962 */* | *\\*) . $file ;; |
5963 *) . ./$file ;; | |
5964 esac | |
5965 | |
5966 # Skip this library if it cannot be dlopened. | |
5967 if test -z "$dlname"; then | |
5968 # Warn if it was a shared library. | |
5969 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" | |
5970 continue | |
5971 fi | |
5972 | |
5973 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` | |
5974 test "X$dir" = "X$file" && dir=. | |
5975 | |
5976 if test -f "$dir/$objdir/$dlname"; then | |
5977 dir="$dir/$objdir" | |
5978 else | |
5979 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 | |
5980 exit 1 | |
5981 fi | |
5982 ;; | |
5983 | |
5984 *.lo) | |
5985 # Just add the directory containing the .lo file. | |
5986 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` | |
5987 test "X$dir" = "X$file" && dir=. | |
5988 ;; | |
5989 | |
5990 *) | |
5991 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 | |
5992 continue | |
5993 ;; | |
5994 esac | |
5995 | |
5996 # Get the absolute pathname. | |
5997 absdir=`cd "$dir" && pwd` | |
5998 test -n "$absdir" && dir="$absdir" | |
5999 | |
6000 # Now add the directory to shlibpath_var. | |
6001 if eval "test -z \"\$$shlibpath_var\""; then | |
6002 eval "$shlibpath_var=\"\$dir\"" | |
6003 else | |
6004 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" | |
6005 fi | |
6006 done | |
6007 | |
6008 # This variable tells wrapper scripts just to set shlibpath_var | |
6009 # rather than running their programs. | |
6010 libtool_execute_magic="$magic" | |
6011 | |
6012 # Check if any of the arguments is a wrapper script. | |
6013 args= | |
6014 for file | |
6015 do | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6016 case $file in |
0 | 6017 -*) ;; |
6018 *) | |
6019 # Do a test to see if this is really a libtool program. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6020 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
0 | 6021 # If there is no directory component, then add one. |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6022 case $file in |
0 | 6023 */* | *\\*) . $file ;; |
6024 *) . ./$file ;; | |
6025 esac | |
6026 | |
6027 # Transform arg to wrapped name. | |
6028 file="$progdir/$program" | |
6029 fi | |
6030 ;; | |
6031 esac | |
6032 # Quote arguments (to preserve shell metacharacters). | |
6033 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` | |
6034 args="$args \"$file\"" | |
6035 done | |
6036 | |
6037 if test -z "$run"; then | |
6038 if test -n "$shlibpath_var"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6039 # Export the shlibpath_var. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6040 eval "export $shlibpath_var" |
0 | 6041 fi |
6042 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6043 # Restore saved environment variables |
0 | 6044 if test "${save_LC_ALL+set}" = set; then |
6045 LC_ALL="$save_LC_ALL"; export LC_ALL | |
6046 fi | |
6047 if test "${save_LANG+set}" = set; then | |
6048 LANG="$save_LANG"; export LANG | |
6049 fi | |
6050 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6051 # Now prepare to actually exec the command. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6052 exec_cmd="\$cmd$args" |
0 | 6053 else |
6054 # Display what would be done. | |
6055 if test -n "$shlibpath_var"; then | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6056 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6057 $echo "export $shlibpath_var" |
0 | 6058 fi |
6059 $echo "$cmd$args" | |
6060 exit 0 | |
6061 fi | |
6062 ;; | |
6063 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6064 # libtool clean and uninstall mode |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6065 clean | uninstall) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6066 modename="$modename: $mode" |
0 | 6067 rm="$nonopt" |
6068 files= | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6069 rmforce= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6070 exit_status=0 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6071 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6072 # This variable tells wrapper scripts just to set variables rather |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6073 # than running their programs. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6074 libtool_install_magic="$magic" |
0 | 6075 |
6076 for arg | |
6077 do | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6078 case $arg in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6079 -f) rm="$rm $arg"; rmforce=yes ;; |
0 | 6080 -*) rm="$rm $arg" ;; |
6081 *) files="$files $arg" ;; | |
6082 esac | |
6083 done | |
6084 | |
6085 if test -z "$rm"; then | |
6086 $echo "$modename: you must specify an RM program" 1>&2 | |
6087 $echo "$help" 1>&2 | |
6088 exit 1 | |
6089 fi | |
6090 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6091 rmdirs= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6092 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6093 origobjdir="$objdir" |
0 | 6094 for file in $files; do |
6095 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6096 if test "X$dir" = "X$file"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6097 dir=. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6098 objdir="$origobjdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6099 else |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6100 objdir="$dir/$origobjdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6101 fi |
0 | 6102 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6103 test "$mode" = uninstall && objdir="$dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6104 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6105 # Remember objdir for removal later, being careful to avoid duplicates |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6106 if test "$mode" = clean; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6107 case " $rmdirs " in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6108 *" $objdir "*) ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6109 *) rmdirs="$rmdirs $objdir" ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6110 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6111 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6112 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6113 # Don't error if the file doesn't exist and rm -f was used. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6114 if (test -L "$file") >/dev/null 2>&1 \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6115 || (test -h "$file") >/dev/null 2>&1 \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6116 || test -f "$file"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6117 : |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6118 elif test -d "$file"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6119 exit_status=1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6120 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6121 elif test "$rmforce" = yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6122 continue |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6123 fi |
0 | 6124 |
6125 rmfiles="$file" | |
6126 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6127 case $name in |
0 | 6128 *.la) |
6129 # Possibly a libtool archive, so verify it. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6130 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
0 | 6131 . $dir/$name |
6132 | |
6133 # Delete the libtool libraries and symlinks. | |
6134 for n in $library_names; do | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6135 rmfiles="$rmfiles $objdir/$n" |
0 | 6136 done |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6137 test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6138 test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6139 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6140 if test "$mode" = uninstall; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6141 if test -n "$library_names"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6142 # Do each command in the postuninstall commands. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6143 eval cmds=\"$postuninstall_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6144 save_ifs="$IFS"; IFS='~' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6145 for cmd in $cmds; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6146 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6147 $show "$cmd" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6148 $run eval "$cmd" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6149 if test "$?" -ne 0 && test "$rmforce" != yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6150 exit_status=1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6151 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6152 done |
0 | 6153 IFS="$save_ifs" |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6154 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6155 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6156 if test -n "$old_library"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6157 # Do each command in the old_postuninstall commands. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6158 eval cmds=\"$old_postuninstall_cmds\" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6159 save_ifs="$IFS"; IFS='~' |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6160 for cmd in $cmds; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6161 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6162 $show "$cmd" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6163 $run eval "$cmd" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6164 if test "$?" -ne 0 && test "$rmforce" != yes; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6165 exit_status=1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6166 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6167 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6168 IFS="$save_ifs" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6169 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6170 # FIXME: should reinstall the best remaining shared library. |
0 | 6171 fi |
6172 fi | |
6173 ;; | |
6174 | |
6175 *.lo) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6176 # Possibly a libtool object, so verify it. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6177 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6178 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6179 # Read the .lo file |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6180 . $dir/$name |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6181 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6182 # Add PIC object to the list of files to remove. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6183 if test -n "$pic_object" \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6184 && test "$pic_object" != none; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6185 rmfiles="$rmfiles $dir/$pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6186 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6187 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6188 # Add non-PIC object to the list of files to remove. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6189 if test -n "$non_pic_object" \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6190 && test "$non_pic_object" != none; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6191 rmfiles="$rmfiles $dir/$non_pic_object" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6192 fi |
0 | 6193 fi |
6194 ;; | |
6195 | |
6196 *) | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6197 if test "$mode" = clean ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6198 noexename=$name |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6199 case $file in |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6200 *.exe) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6201 file=`$echo $file|${SED} 's,.exe$,,'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6202 noexename=`$echo $name|${SED} 's,.exe$,,'` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6203 # $file with .exe has already been added to rmfiles, |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6204 # add $file without .exe |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6205 rmfiles="$rmfiles $file" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6206 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6207 esac |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6208 # Do a test to see if this is a libtool program. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6209 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6210 relink_command= |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6211 . $dir/$noexename |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6212 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6213 # note $name still contains .exe if it was in $file originally |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6214 # as does the version of $file that was added into $rmfiles |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6215 rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6216 if test "$fast_install" = yes && test -n "$relink_command"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6217 rmfiles="$rmfiles $objdir/lt-$name" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6218 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6219 if test "X$noexename" != "X$name" ; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6220 rmfiles="$rmfiles $objdir/lt-${noexename}.c" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6221 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6222 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6223 fi |
0 | 6224 ;; |
6225 esac | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6226 $show "$rm $rmfiles" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6227 $run $rm $rmfiles || exit_status=1 |
0 | 6228 done |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6229 objdir="$origobjdir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6230 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6231 # Try to remove the ${objdir}s in the directories where we deleted files |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6232 for dir in $rmdirs; do |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6233 if test -d "$dir"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6234 $show "rmdir $dir" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6235 $run rmdir $dir >/dev/null 2>&1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6236 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6237 done |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6238 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6239 exit $exit_status |
0 | 6240 ;; |
6241 | |
6242 "") | |
6243 $echo "$modename: you must specify a MODE" 1>&2 | |
6244 $echo "$generic_help" 1>&2 | |
6245 exit 1 | |
6246 ;; | |
6247 esac | |
6248 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6249 if test -z "$exec_cmd"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6250 $echo "$modename: invalid operation mode \`$mode'" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6251 $echo "$generic_help" 1>&2 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6252 exit 1 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6253 fi |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6254 fi # test -z "$show_help" |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6255 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6256 if test -n "$exec_cmd"; then |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6257 eval exec $exec_cmd |
0 | 6258 exit 1 |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6259 fi |
0 | 6260 |
6261 # We need to display help for each of the modes. | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6262 case $mode in |
0 | 6263 "") $echo \ |
6264 "Usage: $modename [OPTION]... [MODE-ARG]... | |
6265 | |
6266 Provide generalized library-building support services. | |
6267 | |
6268 --config show all configuration variables | |
6269 --debug enable verbose shell tracing | |
6270 -n, --dry-run display commands without modifying any files | |
6271 --features display basic configuration information and exit | |
6272 --finish same as \`--mode=finish' | |
6273 --help display this help message and exit | |
6274 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] | |
6275 --quiet same as \`--silent' | |
6276 --silent don't print informational messages | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6277 --tag=TAG use configuration variables from tag TAG |
0 | 6278 --version print version information |
6279 | |
6280 MODE must be one of the following: | |
6281 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6282 clean remove files from the build directory |
0 | 6283 compile compile a source file into a libtool object |
6284 execute automatically set library path, then run a program | |
6285 finish complete the installation of libtool libraries | |
6286 install install libraries or executables | |
6287 link create a library or an executable | |
6288 uninstall remove libraries from an installed directory | |
6289 | |
6290 MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6291 a more detailed description of MODE. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6292 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6293 Report bugs to <bug-libtool@gnu.org>." |
0 | 6294 exit 0 |
6295 ;; | |
6296 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6297 clean) |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6298 $echo \ |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6299 "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6300 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6301 Remove files from the build directory. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6302 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6303 RM is the name of the program to use to delete files associated with each FILE |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6304 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6305 to RM. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6306 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6307 If FILE is a libtool library, object or program, all the files associated |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6308 with it are deleted. Otherwise, only FILE itself is deleted using RM." |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6309 ;; |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6310 |
0 | 6311 compile) |
6312 $echo \ | |
6313 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE | |
6314 | |
6315 Compile a source file into a libtool library object. | |
6316 | |
6317 This mode accepts the following additional options: | |
6318 | |
6319 -o OUTPUT-FILE set the output file name to OUTPUT-FILE | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6320 -prefer-pic try to building PIC objects only |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6321 -prefer-non-pic try to building non-PIC objects only |
0 | 6322 -static always build a \`.o' file suitable for static linking |
6323 | |
6324 COMPILE-COMMAND is a command to be used in creating a \`standard' object file | |
6325 from the given SOURCEFILE. | |
6326 | |
6327 The output file name is determined by removing the directory component from | |
6328 SOURCEFILE, then substituting the C source code suffix \`.c' with the | |
6329 library object suffix, \`.lo'." | |
6330 ;; | |
6331 | |
6332 execute) | |
6333 $echo \ | |
6334 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... | |
6335 | |
6336 Automatically set library path, then run a program. | |
6337 | |
6338 This mode accepts the following additional options: | |
6339 | |
6340 -dlopen FILE add the directory containing FILE to the library path | |
6341 | |
6342 This mode sets the library path environment variable according to \`-dlopen' | |
6343 flags. | |
6344 | |
6345 If any of the ARGS are libtool executable wrappers, then they are translated | |
6346 into their corresponding uninstalled binary, and any of their required library | |
6347 directories are added to the library path. | |
6348 | |
6349 Then, COMMAND is executed, with ARGS as arguments." | |
6350 ;; | |
6351 | |
6352 finish) | |
6353 $echo \ | |
6354 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]... | |
6355 | |
6356 Complete the installation of libtool libraries. | |
6357 | |
6358 Each LIBDIR is a directory that contains libtool libraries. | |
6359 | |
6360 The commands that this mode executes may require superuser privileges. Use | |
6361 the \`--dry-run' option if you just want to see what would be executed." | |
6362 ;; | |
6363 | |
6364 install) | |
6365 $echo \ | |
6366 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... | |
6367 | |
6368 Install executables or libraries. | |
6369 | |
6370 INSTALL-COMMAND is the installation command. The first component should be | |
6371 either the \`install' or \`cp' program. | |
6372 | |
6373 The rest of the components are interpreted as arguments to that command (only | |
6374 BSD-compatible install options are recognized)." | |
6375 ;; | |
6376 | |
6377 link) | |
6378 $echo \ | |
6379 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND... | |
6380 | |
6381 Link object files or libraries together to form another library, or to | |
6382 create an executable program. | |
6383 | |
6384 LINK-COMMAND is a command using the C compiler that you would use to create | |
6385 a program from several object files. | |
6386 | |
6387 The following components of LINK-COMMAND are treated specially: | |
6388 | |
6389 -all-static do not do any dynamic linking at all | |
6390 -avoid-version do not add a version suffix if possible | |
6391 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime | |
6392 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols | |
6393 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) | |
6394 -export-symbols SYMFILE | |
6395 try to export only the symbols listed in SYMFILE | |
6396 -export-symbols-regex REGEX | |
6397 try to export only the symbols matching REGEX | |
6398 -LLIBDIR search LIBDIR for required installed libraries | |
6399 -lNAME OUTPUT-FILE requires the installed library libNAME | |
6400 -module build a library that can dlopened | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6401 -no-fast-install disable the fast-install mode |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6402 -no-install link a not-installable executable |
0 | 6403 -no-undefined declare that a library does not refer to external symbols |
6404 -o OUTPUT-FILE create OUTPUT-FILE from the specified objects | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6405 -objectlist FILE Use a list of object files found in FILE to specify objects |
0 | 6406 -release RELEASE specify package release information |
6407 -rpath LIBDIR the created library will eventually be installed in LIBDIR | |
6408 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries | |
6409 -static do not do any dynamic linking of libtool libraries | |
6410 -version-info CURRENT[:REVISION[:AGE]] | |
6411 specify library version info [each variable defaults to 0] | |
6412 | |
6413 All other options (arguments beginning with \`-') are ignored. | |
6414 | |
6415 Every other argument is treated as a filename. Files ending in \`.la' are | |
6416 treated as uninstalled libtool libraries, other files are standard or library | |
6417 object files. | |
6418 | |
6419 If the OUTPUT-FILE ends in \`.la', then a libtool library is created, | |
6420 only library objects (\`.lo' files) may be specified, and \`-rpath' is | |
6421 required, except when creating a convenience library. | |
6422 | |
6423 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created | |
6424 using \`ar' and \`ranlib', or on Windows using \`lib'. | |
6425 | |
6426 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file | |
6427 is created, otherwise an executable program is created." | |
6428 ;; | |
6429 | |
6430 uninstall) | |
6431 $echo \ | |
6432 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... | |
6433 | |
6434 Remove libraries from an installation directory. | |
6435 | |
6436 RM is the name of the program to use to delete files associated with each FILE | |
6437 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed | |
6438 to RM. | |
6439 | |
6440 If FILE is a libtool library, all the files associated with it are deleted. | |
6441 Otherwise, only FILE itself is deleted using RM." | |
6442 ;; | |
6443 | |
6444 *) | |
6445 $echo "$modename: invalid operation mode \`$mode'" 1>&2 | |
6446 $echo "$help" 1>&2 | |
6447 exit 1 | |
6448 ;; | |
6449 esac | |
6450 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6451 $echo |
0 | 6452 $echo "Try \`$modename --help' for more information about other modes." |
6453 | |
6454 exit 0 | |
6455 | |
729
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6456 # The TAGs below are defined such that we never get into a situation |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6457 # in which we disable both kinds of libraries. Given conflicting |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6458 # choices, we go for a static library, that is the most portable, |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6459 # since we can't tell whether shared libraries were disabled because |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6460 # the user asked for that or because the platform doesn't support |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6461 # them. This is particularly important on AIX, because we don't |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6462 # support having both static and shared libraries enabled at the same |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6463 # time on that platform, so we default to a shared-only configuration. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6464 # If a disable-shared tag is given, we'll fallback to a static-only |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6465 # configuration. But we'll never go from static-only to shared-only. |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6466 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6467 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6468 build_libtool_libs=no |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6469 build_old_libs=yes |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6470 # ### END LIBTOOL TAG CONFIG: disable-shared |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6471 |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6472 # ### BEGIN LIBTOOL TAG CONFIG: disable-static |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6473 build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac` |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6474 # ### END LIBTOOL TAG CONFIG: disable-static |
dac996d69abb
Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents:
608
diff
changeset
|
6475 |
0 | 6476 # Local Variables: |
6477 # mode:shell-script | |
6478 # sh-indentation:2 | |
6479 # End: |