annotate ltmain.sh @ 730:0f4f974d0201

Use a unique base address for each DLL. Fixed ltmain.sh for MSYS development environment.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 06 Oct 2003 08:34:08 +0000
parents dac996d69abb
children 97b9c301df94
rev   line source
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6 # Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
7 #
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
8 # This program is free software; you can redistribute it and/or modify
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
9 # it under the terms of the GNU General Public License as published by
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
10 # the Free Software Foundation; either version 2 of the License, or
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
11 # (at your option) any later version.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
12 #
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
13 # This program is distributed in the hope that it will be useful, but
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
16 # General Public License for more details.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
17 #
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
18 # You should have received a copy of the GNU General Public License
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
19 # along with this program; if not, write to the Free Software
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
20 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
21 #
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
22 # As a special exception to the GNU General Public License, if you
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
23 # distribute this file as part of a program that contains a
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
24 # configuration script generated by Autoconf, you may include it under
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
25 # the same distribution terms that you use for the rest of that program.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
26
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
27 # Check that we have a working $echo.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
28 if test "X$1" = X--no-reexec; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
29 # Discard the --no-reexec flag, and continue.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
30 shift
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
31 elif test "X$1" = X--fallback-echo; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
32 # Avoid inline document here, it may be left over
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
33 :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
34 elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
35 # Yippee, $echo works!
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
36 :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
37 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
38 # Restart under the correct shell, and then maybe $echo will work.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
39 exec $SHELL "$0" --no-reexec ${1+"$@"}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
40 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
41
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
42 if test "X$1" = X--fallback-echo; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
43 # used as fallback echo
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
44 shift
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
45 cat <<EOF
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
46 $*
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
47 EOF
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
48 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
49 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
50
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
53 modename="$progname"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
54
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
55 # Constants.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
56 PROGRAM=ltmain.sh
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
60
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
61 default_mode=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
62 help="Try \`$progname --help' for more information."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
63 magic="%%%MAGIC variable%%%"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
64 mkdir="mkdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
65 mv="mv -f"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
66 rm="rm -f"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
67
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
68 # Sed substitution that helps us do robust quoting. It backslashifies
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
83
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
84 # NLS nuisances.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
85 # Only set LANG and LC_ALL to C if already set.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
86 # These must not be set unconditionally because not all systems understand
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
87 # e.g. LANG=C (notably SCO).
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
88 # We save the old values to restore during execute mode.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
89 if test "${LC_ALL+set}" = set; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
90 save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
91 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
92 if test "${LANG+set}" = set; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
93 save_LANG="$LANG"; LANG=C; export LANG
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
94 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
98
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
102 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
103 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
104
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
105 # Global variables.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
106 mode=$default_mode
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
107 nonopt=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
108 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
109 prevopt=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
110 run=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
111 show="$echo"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
112 show_help=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
113 execute_dlfiles=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
114 lo2o="s/\\.lo\$/.${objext}/"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
115 o2lo="s/\\.${objext}\$/.lo/"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
162 do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
163 arg="$1"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
164 shift
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
165
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
166 case $arg in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
167 -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
168 *) optarg= ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
169 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
170
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
171 # If the previous option needs an argument, assign it.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
203 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
204 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
205 eval "$prev=\$arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
206 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
207 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
208
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
209 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
210 prevopt=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
211 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
212 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
213
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
216 --help)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
217 show_help=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
218 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
219
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
226 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
227 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
228
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
235 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
236 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
237
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
240 set -x
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
241 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
242
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
243 --dry-run | -n)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
244 run=:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
245 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
246
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
253 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
258 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
259 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
260 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
261
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
262 --finish) mode="finish" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
263
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
264 --mode) prevopt="--mode" prev=mode ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
265 --mode=*) mode="$optarg" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
269 --quiet | --silent)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
270 show=:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
271 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
280 -dlopen)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
281 prevopt="-dlopen"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
282 prev=execute_dlfiles
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
283 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
284
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
285 -*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
286 $echo "$modename: unrecognized option \`$arg'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
287 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
288 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
289 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
290
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
291 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
292 nonopt="$arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
293 break
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
294 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
295 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
296 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
297
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
298 if test -n "$prevopt"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
299 $echo "$modename: option \`$prevopt' requires an argument" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
300 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
301 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
302 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
309 if test -z "$show_help"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
310
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
311 # Infer the operation mode.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
317 mode=link
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
318 for arg
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
321 -c)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
322 mode=compile
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
323 break
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
324 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
325 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
326 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
327 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
328 *db | *dbx | *strace | *truss)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
329 mode=execute
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
330 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
331 *install*|cp|mv)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
332 mode=install
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
333 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
334 *rm)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
335 mode=uninstall
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
336 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
337 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
338 # If we have no mode, but dlfiles were specified, then do execute mode.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
339 test -n "$execute_dlfiles" && mode=execute
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
340
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
341 # Just use the default operation mode.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
342 if test -z "$mode"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
343 if test -n "$nonopt"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
344 $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
345 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
346 $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
347 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
348 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
349 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
350 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
351 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
352
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
353 # Only execute mode is allowed to have -dlopen flags.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
354 if test -n "$execute_dlfiles" && test "$mode" != execute; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
355 $echo "$modename: unrecognized option \`-dlopen'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
356 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
357 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
358 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
359
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
360 # Change the help message to a mode-specific one.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
361 generic_help="$help"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
362 help="Try \`$modename --help --mode=$mode' for more information."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
363
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
366 # libtool compile mode
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
367 compile)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
368 modename="$modename: compile"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
369 # Get the compilation command and the source file.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
376 for arg
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
383 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
388 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
458
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
459 # Aesthetically quote the previous argument.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
460 lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
461
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
462 case $lastarg in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
467 lastarg="\"$lastarg\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
468 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
469 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
482 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
486 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
487 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
488
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
489 # Recognize several different file suffixes.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
493 *.ada) xform=ada ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
494 *.adb) xform=adb ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
495 *.ads) xform=ads ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
496 *.asm) xform=asm ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
497 *.c++) xform=c++ ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
501 *.cpp) xform=cpp ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
502 *.cxx) xform=cxx ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
503 *.f90) xform=f90 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
506 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
507
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
508 libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
509
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
510 case $libobj in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
511 *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
512 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
513 $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
514 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
515 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
516 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
568 if test -z "$base_compile"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
569 $echo "$modename: you must specify a compilation command" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
570 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
571 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
572 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
573
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
574 # Delete any leftover library objects.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
579 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
580
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
581 $run $rm $removelist
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
582 trap "$run $rm $removelist; exit 1" 1 2 15
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
595 # Calculate the filename of the output object if compiler does
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
596 # not support -o with -c
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
599 lockfile="$output_obj.lock"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
600 removelist="$removelist $output_obj $lockfile"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
601 trap "$run $rm $removelist; exit 1" 1 2 15
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
602 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
603 output_obj=
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
604 need_locks=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
605 lockfile=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
606 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
607
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
608 # Lock this critical section if it is needed
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
609 # We use this script file to make the link, it avoids creating a new file
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
612 $show "Waiting for $lockfile to be removed"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
613 sleep 2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
614 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
615 elif test "$need_locks" = warn; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
618 *** ERROR, $lockfile exists and contains:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
619 `cat $lockfile 2>/dev/null`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
620
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
621 This indicates that another process is trying to use the same
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
622 temporary object file, and libtool could not work around it because
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
623 your compiler does not support \`-c' and \`-o' together. If you
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
624 repeat this compilation, it may succeed, by chance, but you had better
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
625 avoid parallel builds (make -j) in this platform, or get a better
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
626 compiler."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
627
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
628 $run $rm $removelist
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
629 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
632 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
633
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
634 if test -n "$fix_srcfile_path"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
635 eval srcfile=\"$fix_srcfile_path\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
636 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
652 # Only build a PIC object if we are building libtool libraries.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
653 if test "$build_libtool_libs" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
654 # Without this assignment, base_compile gets emptied.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
655 fbsd_hideous_sh_bug=$base_compile
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
670 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
676 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
680 $show "$command"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
681 if $run eval "$command"; then :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
682 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
683 test -n "$output_obj" && $run $rm $removelist
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
684 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
685 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
686
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
690 *** ERROR, $lockfile contains:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
691 `cat $lockfile 2>/dev/null`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
692
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
693 but it should contain:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
694 $srcfile
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
695
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
696 This indicates that another process is trying to use the same
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
697 temporary object file, and libtool could not work around it because
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
698 your compiler does not support \`-c' and \`-o' together. If you
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
699 repeat this compilation, it may succeed, by chance, but you had better
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
700 avoid parallel builds (make -j) in this platform, or get a better
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
701 compiler."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
702
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
703 $run $rm $removelist
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
704 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
705 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
706
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
711 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
712 error=$?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
713 $run $rm $removelist
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
714 exit $error
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
715 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
716 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
723
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
724 # Allow error messages only from the first compilation.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
733 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
734
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
735 # Only build a position-dependent object if we build old libraries.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
743 if test "$compiler_c_o" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
744 command="$command -o $obj"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
745 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
746
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
747 # Suppress compiler output if we already did a PIC compilation.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
750 $show "$command"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
751 if $run eval "$command"; then :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
752 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
753 $run $rm $removelist
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
754 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
755 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
756
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
760 *** ERROR, $lockfile contains:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
761 `cat $lockfile 2>/dev/null`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
762
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
763 but it should contain:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
764 $srcfile
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
765
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
766 This indicates that another process is trying to use the same
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
767 temporary object file, and libtool could not work around it because
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
768 your compiler does not support \`-c' and \`-o' together. If you
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
769 repeat this compilation, it may succeed, by chance, but you had better
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
770 avoid parallel builds (make -j) in this platform, or get a better
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
771 compiler."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
772
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
773 $run $rm $removelist
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
774 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
775 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
776
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
779 $show "$mv $output_obj $obj"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
780 if $run $mv $output_obj $obj; then :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
781 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
782 error=$?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
783 $run $rm $removelist
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
784 exit $error
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
785 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
786 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
803 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
807 # Unlock the critical section if it was locked
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
810 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
811
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
812 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
813 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
814
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
820 # It is impossible to link a dll without this setting, and
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
821 # we shouldn't force the makefile maintainer to figure out
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
824 # allow_undefined=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
825
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
826 # FIXME: Unfortunately, there are problems with the above when trying
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
827 # to make a dll which has undefined symbols, in which case not
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
828 # even a static library is built. For now, we need to specify
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
829 # -no-undefined on the libtool link line when we can be certain
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
830 # that all symbols are satisfied, otherwise we get a static library.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
831 allow_undefined=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
832 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
833 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
834 allow_undefined=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
835 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
839 compile_command="$nonopt"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
840 finalize_command="$nonopt"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
841
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
842 compile_rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
843 finalize_rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
844 compile_shlibpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
845 finalize_shlibpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
846 convenience=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
847 old_convenience=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
856 avoid_version=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
857 dlfiles=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
858 dlprefiles=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
859 dlself=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
860 export_dynamic=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
861 export_symbols=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
862 export_symbols_regex=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
863 generated=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
864 libobjs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
865 ltlibs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
870 prefer_static_libs=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
871 preload=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
872 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
873 prevarg=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
874 release=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
875 rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
876 xrpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
877 perm_rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
878 temp_rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
879 thread_safe=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
882
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
883 # We need to know -static, to get the right output filenames.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
884 for arg
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
887 -all-static | -static)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
888 if test "X$arg" = "X-all-static"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
889 if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
890 $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
891 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
892 if test -n "$link_static_flag"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
893 dlopen_self=$dlopen_self_static
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
894 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
895 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
896 if test -z "$pic_flag" && test -n "$link_static_flag"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
897 dlopen_self=$dlopen_self_static
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
898 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
899 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
900 build_libtool_libs=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
901 build_old_libs=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
902 prefer_static_libs=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
903 break
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
904 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
905 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
906 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
907
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
908 # See if our shared archives depend on static archives.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
909 test -n "$old_archive_from_new_cmds" && build_old_libs=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
910
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
923
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
924 # If the previous option needs an argument, assign it.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
927 output)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
928 compile_command="$compile_command @OUTPUT@"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
929 finalize_command="$finalize_command @OUTPUT@"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
930 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
931 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
932
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
933 case $prev in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
934 dlfiles|dlprefiles)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
935 if test "$preload" = no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
936 # Add the symbol object into the linking commands.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
937 compile_command="$compile_command @SYMFILE@"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
938 finalize_command="$finalize_command @SYMFILE@"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
939 preload=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
942 *.la | *.lo) ;; # We handle these cases below.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
943 force)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
944 if test "$dlself" = no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
945 dlself=needless
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
946 export_dynamic=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
947 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
948 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
949 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
950 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
951 self)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
952 if test "$prev" = dlprefiles; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
953 dlself=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
954 elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
955 dlself=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
956 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
957 dlself=needless
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
958 export_dynamic=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
959 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
960 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
961 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
962 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
963 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
964 if test "$prev" = dlfiles; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
965 dlfiles="$dlfiles $arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
966 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
967 dlprefiles="$dlprefiles $arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
968 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
969 prev=
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
970 continue
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
971 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
972 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
973 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
974 expsyms)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
975 export_symbols="$arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
976 if test ! -f "$arg"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
977 $echo "$modename: symbol file \`$arg' does not exist"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
978 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
979 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
980 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
981 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
982 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
983 expsyms_regex)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
984 export_symbols_regex="$arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
985 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
986 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
993 release)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
994 release="-$arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
995 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
996 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1105 rpath | xrpath)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1108 [\\/]* | [A-Za-z]:[\\/]*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1109 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1110 $echo "$modename: only absolute run-paths are allowed" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1111 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1112 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1113 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1114 if test "$prev" = rpath; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1115 case "$rpath " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1116 *" $arg "*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1117 *) rpath="$rpath $arg" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1118 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1119 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1120 case "$xrpath " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1121 *" $arg "*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1122 *) xrpath="$xrpath $arg" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1123 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1124 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1125 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1126 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
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 ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1151 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1152 eval "$prev=\"\$arg\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1153 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1154 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1155 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1156 esac
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1157 fi # test -n "$prev"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1158
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1159 prevarg="$arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1160
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1161 case $arg in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1162 -all-static)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1163 if test -n "$link_static_flag"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1164 compile_command="$compile_command $link_static_flag"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1165 finalize_command="$finalize_command $link_static_flag"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1166 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1167 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1168 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1169
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1170 -allow-undefined)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1171 # FIXME: remove this flag sometime in the future.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1172 $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1173 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1174 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1175
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1176 -avoid-version)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1177 avoid_version=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1178 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1179 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1180
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1181 -dlopen)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1182 prev=dlfiles
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1183 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1184 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1185
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1186 -dlpreopen)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1187 prev=dlprefiles
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1188 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1189 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1190
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1191 -export-dynamic)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1192 export_dynamic=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1193 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1194 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1195
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1196 -export-symbols | -export-symbols-regex)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1197 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
1198 $echo "$modename: more than one -exported-symbols argument is not allowed"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1199 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1200 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1201 if test "X$arg" = "X-export-symbols"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1202 prev=expsyms
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1203 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1204 prev=expsyms_regex
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1205 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1206 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1207 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1208
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1209 -inst-prefix-dir)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1210 prev=inst_prefix
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1211 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1212 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1213
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1214 # 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
1215 # 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
1216 -L[A-Z][A-Z]*:*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1217 case $with_gcc/$host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1218 no/*-*-irix* | /*-*-irix*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1219 compile_command="$compile_command $arg"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1220 finalize_command="$finalize_command $arg"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1221 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1222 esac
387
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
1223 continue
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
1224 ;;
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
1225
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1226 -L*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1227 dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1228 # We need an absolute path.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1229 case $dir in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1230 [\\/]* | [A-Za-z]:[\\/]*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1231 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1232 absdir=`cd "$dir" && pwd`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1233 if test -z "$absdir"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1234 $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
1235 exit 1
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1236 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1237 dir="$absdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1238 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1239 esac
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1240 case "$deplibs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1241 *" -L$dir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1242 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1243 deplibs="$deplibs -L$dir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1244 lib_search_path="$lib_search_path $dir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1245 ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1246 esac
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1247 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1248 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1249 case :$dllsearchpath: in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1250 *":$dir:"*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1251 *) dllsearchpath="$dllsearchpath:$dir";;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1252 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1253 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1254 esac
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1255 continue
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1256 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1257
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1258 -l*)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1259 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
1260 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1261 *-*-cygwin* | *-*-pw32* | *-*-beos*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1262 # These systems don't actually have a C or math library (as such)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1263 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1264 ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1265 *-*-mingw* | *-*-os2*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1266 # 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
1267 test "X$arg" = "X-lc" && continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1268 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1269 *-*-openbsd* | *-*-freebsd*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1270 # 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
1271 test "X$arg" = "X-lc" && continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1272 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1273 *-*-rhapsody* | *-*-darwin1.[012])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1274 # 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
1275 deplibs="$deplibs -framework System"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1276 continue
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1277 esac
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1278 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
1279 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1280 *-*-openbsd* | *-*-freebsd*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1281 # 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
1282 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1283 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1284 esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1285 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1286 deplibs="$deplibs $arg"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1287 continue
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1288 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1289
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1290 -module)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1291 module=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1292 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1293 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1294
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1295 # 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
1296 # 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
1297 # (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
1298 # 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
1299 # 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
1300 # -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
1301 -m*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1302 # 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
1303 # 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
1304 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
1305 case $arg in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1306 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1307 arg="\"$arg\""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1308 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1309 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1310 compile_command="$compile_command $arg"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1311 finalize_command="$finalize_command $arg"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1312 if test "$with_gcc" = "yes" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1313 compiler_flags="$compiler_flags $arg"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1314 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1315 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1316 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1317
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1318 -shrext)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1319 prev=shrext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1320 continue
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1323 -no-fast-install)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1324 fast_install=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1325 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1326 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1327
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1328 -no-install)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1329 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1330 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1331 # 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
1332 # 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
1333 $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
1334 $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
1335 fast_install=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1336 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1337 *) no_install=yes ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1338 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1339 continue
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
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1342 -no-undefined)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1343 allow_undefined=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1344 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1345 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1346
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1347 -objectlist)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1348 prev=objectlist
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1349 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1350 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1351
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1352 -o) prev=output ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1353
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1354 -release)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1355 prev=release
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1356 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1357 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1358
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1359 -rpath)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1360 prev=rpath
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1361 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1362 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1363
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1364 -R)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1365 prev=xrpath
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1366 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1367 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1368
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1369 -R*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1370 dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1371 # We need an absolute path.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1372 case $dir in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1373 [\\/]* | [A-Za-z]:[\\/]*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1374 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1375 $echo "$modename: only absolute run-paths are allowed" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1376 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1377 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1378 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1379 case "$xrpath " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1380 *" $dir "*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1381 *) xrpath="$xrpath $dir" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1382 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1383 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1384 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1385
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1386 -static)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1387 # 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
1388 # 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
1389 # 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
1390 # 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
1391 # Digital Unix and AIX.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1392 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1393 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1394
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1395 -thread-safe)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1396 thread_safe=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1397 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1398 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1399
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1400 -version-info)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1401 prev=vinfo
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1402 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1403 ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1404 -version-number)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1405 prev=vinfo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1406 vinfo_number=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1407 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1408 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1409
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1410 -Wc,*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1411 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
1412 arg=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1413 save_ifs="$IFS"; IFS=','
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1414 for flag in $args; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1415 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1416 case $flag in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1417 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1418 flag="\"$flag\""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1419 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1420 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1421 arg="$arg $wl$flag"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1422 compiler_flags="$compiler_flags $flag"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1423 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1424 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1425 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1426 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1427
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1428 -Wl,*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1429 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
1430 arg=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1431 save_ifs="$IFS"; IFS=','
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1432 for flag in $args; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1433 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1434 case $flag in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1435 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1436 flag="\"$flag\""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1437 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1438 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1439 arg="$arg $wl$flag"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1440 compiler_flags="$compiler_flags $wl$flag"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1441 linker_flags="$linker_flags $flag"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1442 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1443 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1444 arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1445 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1446
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1447 -Xcompiler)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1448 prev=xcompiler
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1449 continue
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1452 -Xlinker)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1453 prev=xlinker
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1454 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1455 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1456
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1457 -XCClinker)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1458 prev=xcclinker
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1459 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1460 ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1461
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1462 # Some other compiler flag.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1463 -* | +*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1464 # Unknown arguments in both finalize_command and compile_command need
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1465 # to be aesthetically quoted because they are evaled later.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1466 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
1467 case $arg in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1468 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1469 arg="\"$arg\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1470 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1471 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1472 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1473
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1474 *.$objext)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1475 # A standard object.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1476 objs="$objs $arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1477 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1478
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1479 *.lo)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1480 # A libtool-controlled object.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1481
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1482 # 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
1483 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
1484 pic_object=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1485 non_pic_object=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1486
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1487 # Read the .lo file
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1488 # 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
1489 case $arg in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1490 */* | *\\*) . $arg ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1491 *) . ./$arg ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1492 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1493
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1494 if test -z "$pic_object" || \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1495 test -z "$non_pic_object" ||
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1496 test "$pic_object" = none && \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1497 test "$non_pic_object" = none; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1498 $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
1499 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1500 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1501
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1502 # Extract subdirectory from the argument.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1503 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1504 if test "X$xdir" = "X$arg"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1505 xdir=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1506 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1507 xdir="$xdir/"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1508 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1509
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1510 if test "$pic_object" != none; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1511 # 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
1512 pic_object="$xdir$pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1513
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1514 if test "$prev" = dlfiles; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1515 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
1516 dlfiles="$dlfiles $pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1517 prev=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1518 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1519 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1520 # 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
1521 prev=dlprefiles
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1522 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1523 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1524
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1525 # 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
1526 if test "$prev" = dlprefiles; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1527 # Preload the old-style object.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1528 dlprefiles="$dlprefiles $pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1529 prev=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1530 fi
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 # A PIC object.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1533 libobjs="$libobjs $pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1534 arg="$pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1535 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1536
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1537 # Non-PIC object.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1538 if test "$non_pic_object" != none; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1539 # 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
1540 non_pic_object="$xdir$non_pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1541
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1542 # A standard non-PIC object
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1543 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
1544 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
1545 arg="$non_pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1546 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1547 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1548 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1549 # 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
1550 if test -z "$run"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1551 $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
1552 exit 1
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1553 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1554 # Dry-run case.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1555
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1556 # Extract subdirectory from the argument.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1557 xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1558 if test "X$xdir" = "X$arg"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1559 xdir=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1560 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1561 xdir="$xdir/"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1562 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1563
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1564 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
1565 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
1566 libobjs="$libobjs $pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1567 non_pic_objects="$non_pic_objects $non_pic_object"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1568 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1569 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1570 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1571
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1572 *.$libext)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1573 # An archive.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1574 deplibs="$deplibs $arg"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1575 old_deplibs="$old_deplibs $arg"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1576 continue
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1577 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1578
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1579 *.la)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1580 # A libtool-controlled library.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1581
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1582 if test "$prev" = dlfiles; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1583 # This library was specified with -dlopen.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1584 dlfiles="$dlfiles $arg"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1585 prev=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1586 elif test "$prev" = dlprefiles; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1587 # The library was specified with -dlpreopen.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1588 dlprefiles="$dlprefiles $arg"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1589 prev=
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1590 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1591 deplibs="$deplibs $arg"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1592 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1593 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1594 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1595
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1596 # Some other compiler argument.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1597 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1598 # Unknown arguments in both finalize_command and compile_command need
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1599 # to be aesthetically quoted because they are evaled later.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1600 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
1601 case $arg in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1602 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1603 arg="\"$arg\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1604 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1605 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1606 ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1607 esac # arg
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1608
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1609 # Now actually substitute the argument into the commands.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1610 if test -n "$arg"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1611 compile_command="$compile_command $arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1612 finalize_command="$finalize_command $arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1613 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1614 done # argument parsing loop
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1615
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1616 if test -n "$prev"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1617 $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1618 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1619 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1620 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1621
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1622 # 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
1623 # 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
1624 # 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
1625 # command doesn't match the default compiler.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1626 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
1627 case $base_compile in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1628 # 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
1629 # 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
1630 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1631 # 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
1632 # 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
1633 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1634 for z in $available_tags; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1635 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
1636 # Evaluate the configuration.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1637 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
1638 case $base_compile in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1639 "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1640 # The compiler in $compile_command matches
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1641 # the one in the tagged configuration.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1642 # 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
1643 tagname=$z
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1644 break
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1645 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1646 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1647 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1648 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1649 # 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
1650 # 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
1651 # line option must be used.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1652 if test -z "$tagname"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1653 $echo "$modename: unable to infer tagged configuration"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1654 $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
1655 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1656 # else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1657 # $echo "$modename: using $tagname tagged configuration"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1658 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1659 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1660 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1661 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1662
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1663 if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1664 eval arg=\"$export_dynamic_flag_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1665 compile_command="$compile_command $arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1666 finalize_command="$finalize_command $arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1667 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1668
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1669 oldlibs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1670 # calculate the name of the file, without its directory
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1671 outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1672 libobjs_save="$libobjs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1673
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1674 if test -n "$shlibpath_var"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1675 # get the directories listed in $shlibpath_var
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1676 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
1677 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1678 shlib_search_path=
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 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
1681 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
1682
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1683 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
1684 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
1685 output_objdir="$objdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1686 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1687 output_objdir="$output_objdir/$objdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1688 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1689 # Create the object directory.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1690 if test ! -d "$output_objdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1691 $show "$mkdir $output_objdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1692 $run $mkdir $output_objdir
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1693 status=$?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1694 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
1695 exit $status
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1696 fi
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1699 # Determine the type of output
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1700 case $output in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1701 "")
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1702 $echo "$modename: you must specify an output file" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1703 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1704 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1705 ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1706 *.$libext) linkmode=oldlib ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1707 *.lo | *.$objext) linkmode=obj ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1708 *.la) linkmode=lib ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1709 *) 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
1710 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1711
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1712 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1713 *cygwin* | *mingw* | *pw32*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1714 # 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
1715 duplicate_compiler_generated_deps=yes
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 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1718 duplicate_compiler_generated_deps=$duplicate_deps
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1719 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1720 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1721 specialdeplibs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1722
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1723 libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1724 # 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
1725 # 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
1726 for deplib in $deplibs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1727 if test "X$duplicate_deps" = "Xyes" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1728 case "$libs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1729 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1730 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1731 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1732 libs="$libs $deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1733 done
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 if test "$linkmode" = lib; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1736 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
1737
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1738 # 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
1739 # $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
1740 # not to be eliminated).
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1741 pre_post_deps=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1742 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
1743 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
1744 case "$pre_post_deps " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1745 *" $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
1746 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1747 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
1748 done
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 pre_post_deps=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1751 fi
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 deplibs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1754 newdependency_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1755 newlib_search_path=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1756 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
1757 notinst_deplibs= # not-installed libtool libraries
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1758 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
1759 case $linkmode in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1760 lib)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1761 passes="conv link"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1762 for file in $dlfiles $dlprefiles; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1763 case $file in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1764 *.la) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1765 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1766 $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
1767 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1768 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1769 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1770 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1771 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1772 prog)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1773 compile_deplibs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1774 finalize_deplibs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1775 alldeplibs=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1776 newdlfiles=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1777 newdlprefiles=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1778 passes="conv scan dlopen dlpreopen link"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1779 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1780 *) passes="conv"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1781 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1782 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1783 for pass in $passes; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1784 if test "$linkmode,$pass" = "lib,link" ||
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1785 test "$linkmode,$pass" = "prog,scan"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1786 libs="$deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1787 deplibs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1788 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1789 if test "$linkmode" = prog; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1790 case $pass in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1791 dlopen) libs="$dlfiles" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1792 dlpreopen) libs="$dlprefiles" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1793 link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1794 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1795 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1796 if test "$pass" = dlopen; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1797 # Collect dlpreopened libraries
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1798 save_deplibs="$deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1799 deplibs=
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
1800 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1801 for deplib in $libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1802 lib=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1803 found=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1804 case $deplib in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1805 -l*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1806 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
1807 $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
1808 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1809 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1810 if test "$pass" = conv; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1811 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1812 continue
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 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
1815 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
1816 # Search the libtool library
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1817 lib="$searchdir/lib${name}.la"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1818 if test -f "$lib"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1819 found=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1820 break
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1821 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1822 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1823 if test "$found" != yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1824 # 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
1825 if test "$linkmode,$pass" = "prog,link"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1826 compile_deplibs="$deplib $compile_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1827 finalize_deplibs="$deplib $finalize_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1828 else
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 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
1831 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1832 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1833 else # deplib is a libtool library
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1834 # 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
1835 # 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
1836 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
1837 case " $predeps $postdeps " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1838 *" $deplib "*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1839 if (${SED} -e '2q' $lib |
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1840 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
1841 library_names=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1842 old_library=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1843 case $lib in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1844 */* | *\\*) . $lib ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1845 *) . ./$lib ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1846 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1847 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
1848 ll="$l"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1849 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1850 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
1851 found=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1852 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1853 test "X$ladir" = "X$lib" && ladir="."
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1854 lib=$ladir/$old_library
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1855 if test "$linkmode,$pass" = "prog,link"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1856 compile_deplibs="$deplib $compile_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1857 finalize_deplibs="$deplib $finalize_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1858 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1859 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1860 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
1861 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1862 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1863 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1864 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1865 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1866 *) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1867 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1868 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1869 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1870 ;; # -l
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1871 -L*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1872 case $linkmode in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1873 lib)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1874 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1875 test "$pass" = conv && continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1876 newdependency_libs="$deplib $newdependency_libs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1877 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
1878 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1879 prog)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1880 if test "$pass" = conv; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1881 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1882 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1883 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1884 if test "$pass" = scan; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1885 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1886 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
1887 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1888 compile_deplibs="$deplib $compile_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1889 finalize_deplibs="$deplib $finalize_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1890 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1891 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1892 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1893 $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
1894 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1895 esac # linkmode
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1896 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1897 ;; # -L
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1898 -R*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1899 if test "$pass" = link; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1900 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
1901 # 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
1902 case "$xrpath " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1903 *" $dir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1904 *) xrpath="$xrpath $dir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1905 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1906 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1907 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1908 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1909 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1910 *.la) lib="$deplib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1911 *.$libext)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1912 if test "$pass" = conv; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1913 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1914 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1915 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1916 case $linkmode in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1917 lib)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1918 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
1919 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1920 $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
1921 $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
1922 $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
1923 $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
1924 $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
1925 $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
1926 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1927 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1928 $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
1929 $echo "*** static library $deplib is not portable!"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1930 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1931 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1932 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1933 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1934 prog)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1935 if test "$pass" != link; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1936 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1937 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1938 compile_deplibs="$deplib $compile_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1939 finalize_deplibs="$deplib $finalize_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1940 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1941 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1942 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1943 esac # linkmode
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1944 ;; # *.$libext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1945 *.lo | *.$objext)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1946 if test "$pass" = conv; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1947 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1948 elif test "$linkmode" = prog; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1949 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
1950 # 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
1951 # we need to preload.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1952 newdlprefiles="$newdlprefiles $deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1953 compile_deplibs="$deplib $compile_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1954 finalize_deplibs="$deplib $finalize_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1955 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1956 newdlfiles="$newdlfiles $deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1957 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1958 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1959 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1960 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1961 %DEPLIBS%)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1962 alldeplibs=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1963 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1964 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1965 esac # case $deplib
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1966 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
1967 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1968 $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
1969 exit 1
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1972 # 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
1973 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
1974 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1975 $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
1976 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1977 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1978
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1979 ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1980 test "X$ladir" = "X$lib" && ladir="."
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1981
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1982 dlname=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1983 dlopen=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1984 dlpreopen=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1985 libdir=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1986 library_names=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1987 old_library=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1988 # 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
1989 # 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
1990 installed=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1991 shouldnotlink=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1992
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1993 # Read the .la file
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1994 case $lib in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1995 */* | *\\*) . $lib ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1996 *) . ./$lib ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1997 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1998
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
1999 if test "$linkmode,$pass" = "lib,link" ||
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2000 test "$linkmode,$pass" = "prog,scan" ||
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2001 { test "$linkmode" != prog && test "$linkmode" != lib; }; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2002 test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2003 test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2004 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2005
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2006 if test "$pass" = conv; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2007 # Only check for convenience libraries
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2008 deplibs="$lib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2009 if test -z "$libdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2010 if test -z "$old_library"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2011 $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
2012 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2013 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2014 # 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
2015 convenience="$convenience $ladir/$objdir/$old_library"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2016 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
2017 tmp_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2018 for deplib in $dependency_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2019 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2020 if test "X$duplicate_deps" = "Xyes" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2021 case "$tmp_libs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2022 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2023 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2024 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2025 tmp_libs="$tmp_libs $deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2026 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2027 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
2028 $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
2029 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2030 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2031 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2032 fi # $pass = conv
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2033
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2034
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2035 # 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
2036 linklib=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2037 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
2038 linklib="$l"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2039 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2040 if test -z "$linklib"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2041 $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
2042 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2043 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2044
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2045 # This library was specified with -dlopen.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2046 if test "$pass" = dlopen; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2047 if test -z "$libdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2048 $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
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 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
2052 # 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
2053 # 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
2054 # 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
2055 # bomb out in the load deplibs phase.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2056 dlprefiles="$dlprefiles $lib $dependency_libs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2057 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2058 newdlfiles="$newdlfiles $lib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2059 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2060 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2061 fi # $pass = dlopen
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2062
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2063 # We need an absolute path.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2064 case $ladir in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2065 [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2066 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2067 abs_ladir=`cd "$ladir" && pwd`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2068 if test -z "$abs_ladir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2069 $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
2070 $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
2071 abs_ladir="$ladir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2072 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2073 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2074 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2075 laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2076
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2077 # 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
2078 if test "X$installed" = Xyes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2079 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
2080 $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
2081 dir="$ladir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2082 absdir="$abs_ladir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2083 libdir="$abs_ladir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2084 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2085 dir="$libdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2086 absdir="$libdir"
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 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2089 dir="$ladir/$objdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2090 absdir="$abs_ladir/$objdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2091 # Remove this search path later
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2092 notinst_path="$notinst_path $abs_ladir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2093 fi # $installed = yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2094 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
2095
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2096 # This library was specified with -dlpreopen.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2097 if test "$pass" = dlpreopen; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2098 if test -z "$libdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2099 $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
2100 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2101 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2102 # 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
2103 # are required to link).
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2104 if test -n "$old_library"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2105 newdlprefiles="$newdlprefiles $dir/$old_library"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2106 # 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
2107 elif test -n "$dlname"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2108 newdlprefiles="$newdlprefiles $dir/$dlname"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2109 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2110 newdlprefiles="$newdlprefiles $dir/$linklib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2111 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2112 fi # $pass = dlpreopen
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 if test -z "$libdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2115 # Link the convenience library
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2116 if test "$linkmode" = lib; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2117 deplibs="$dir/$old_library $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2118 elif test "$linkmode,$pass" = "prog,link"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2119 compile_deplibs="$dir/$old_library $compile_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2120 finalize_deplibs="$dir/$old_library $finalize_deplibs"
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 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
2123 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2124 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2125 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2126
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2127
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2128 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
2129 newlib_search_path="$newlib_search_path $ladir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2130 deplibs="$lib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2131
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2132 linkalldeplibs=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2133 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
2134 test "$build_libtool_libs" = no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2135 linkalldeplibs=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2136 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2137
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2138 tmp_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2139 for deplib in $dependency_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2140 case $deplib in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2141 -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
2142 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2143 # Need to link against all dependency_libs?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2144 if test "$linkalldeplibs" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2145 deplibs="$deplib $deplibs"
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 # Need to hardcode shared library paths
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2148 # or/and link against static libraries
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2149 newdependency_libs="$deplib $newdependency_libs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2150 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2151 if test "X$duplicate_deps" = "Xyes" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2152 case "$tmp_libs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2153 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2154 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2155 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2156 tmp_libs="$tmp_libs $deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2157 done # for deplib
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2158 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2159 fi # $linkmode = prog...
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2160
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2161 if test "$linkmode,$pass" = "prog,link"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2162 if test -n "$library_names" &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2163 { 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
2164 # We need to hardcode the library path
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2165 if test -n "$shlibpath_var"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2166 # 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
2167 case "$temp_rpath " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2168 *" $dir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2169 *" $absdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2170 *) temp_rpath="$temp_rpath $dir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2171 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2172 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2173
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2174 # Hardcode the library path.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2175 # 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
2176 # search path.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2177 case " $sys_lib_dlsearch_path " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2178 *" $absdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2179 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2180 case "$compile_rpath " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2181 *" $absdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2182 *) compile_rpath="$compile_rpath $absdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2183 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2184 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2185 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2186 case " $sys_lib_dlsearch_path " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2187 *" $libdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2188 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2189 case "$finalize_rpath " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2190 *" $libdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2191 *) finalize_rpath="$finalize_rpath $libdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2192 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2193 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2194 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2195 fi # $linkmode,$pass = prog,link...
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2196
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2197 if test "$alldeplibs" = yes &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2198 { test "$deplibs_check_method" = pass_all ||
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2199 { test "$build_libtool_libs" = yes &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2200 test -n "$library_names"; }; }; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2201 # 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
2202 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2203 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2204 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2205
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2206 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
2207 if test -n "$library_names" &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2208 { 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
2209 if test "$installed" = no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2210 notinst_deplibs="$notinst_deplibs $lib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2211 need_relink=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2212 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2213 # This is a shared library
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2214
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2215 # 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
2216 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
2217 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2218 if test "$linkmode" = prog; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2219 $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
2220 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2221 $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
2222 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2223 $echo "*** $linklib is not portable!"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2224 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2225 if test "$linkmode" = lib &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2226 test "$hardcode_into_libs" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2227 # Hardcode the library path.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2228 # 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
2229 # search path.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2230 case " $sys_lib_dlsearch_path " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2231 *" $absdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2232 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2233 case "$compile_rpath " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2234 *" $absdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2235 *) compile_rpath="$compile_rpath $absdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2236 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2237 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2238 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2239 case " $sys_lib_dlsearch_path " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2240 *" $libdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2241 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2242 case "$finalize_rpath " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2243 *" $libdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2244 *) finalize_rpath="$finalize_rpath $libdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2245 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2246 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2247 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2248 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2249
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2250 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
2251 # figure out the soname
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2252 set dummy $library_names
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2253 realname="$2"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2254 shift; shift
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2255 libname=`eval \\$echo \"$libname_spec\"`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2256 # 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
2257 if test -n "$dlname"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2258 soname="$dlname"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2259 elif test -n "$soname_spec"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2260 # bleh windows
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2261 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2262 *cygwin* | mingw*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2263 major=`expr $current - $age`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2264 versuffix="-$major"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2265 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2266 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2267 eval soname=\"$soname_spec\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2268 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2269 soname="$realname"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2270 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2271
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2272 # 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
2273 soroot="$soname"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2274 soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2275 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
2276
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2277 # 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
2278 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
2279 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2280 $show "extracting exported symbol list from \`$soname'"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2281 save_ifs="$IFS"; IFS='~'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2282 eval cmds=\"$extract_expsyms_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2283 for cmd in $cmds; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2284 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2285 $show "$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2286 $run eval "$cmd" || exit $?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2287 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2288 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2289 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2290
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2291 # Create $newlib
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2292 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
2293 $show "generating import library for \`$soname'"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2294 save_ifs="$IFS"; IFS='~'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2295 eval cmds=\"$old_archive_from_expsyms_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2296 for cmd in $cmds; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2297 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2298 $show "$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2299 $run eval "$cmd" || exit $?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2300 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2301 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2302 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2303 # 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
2304 dir=$output_objdir
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2305 linklib=$newlib
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2306 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
2307
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2308 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
2309 add_shlibpath=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2310 add_dir=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2311 add=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2312 lib_linked=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2313 case $hardcode_action in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2314 immediate | unsupported)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2315 if test "$hardcode_direct" = no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2316 add="$dir/$linklib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2317 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2318 *-*-sco3.2v5* ) add_dir="-L$dir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2319 *-*-darwin* )
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2320 # 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
2321 # is ignoring the new warnings I added
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2322 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
2323 $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
2324 if test -z "$old_library" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2325 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2326 $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
2327 $echo "** The link will probably fail, sorry"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2328 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2329 add="$dir/$old_library"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2330 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2331 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2332 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2333 elif test "$hardcode_minus_L" = no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2334 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2335 *-*-sunos*) add_shlibpath="$dir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2336 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2337 add_dir="-L$dir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2338 add="-l$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2339 elif test "$hardcode_shlibpath_var" = no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2340 add_shlibpath="$dir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2341 add="-l$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2342 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2343 lib_linked=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2344 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2345 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2346 relink)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2347 if test "$hardcode_direct" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2348 add="$dir/$linklib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2349 elif test "$hardcode_minus_L" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2350 add_dir="-L$dir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2351 # 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
2352 if test -n "$inst_prefix_dir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2353 case "$libdir" in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2354 [\\/]*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2355 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
2356 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2357 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2358 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2359 add="-l$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2360 elif test "$hardcode_shlibpath_var" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2361 add_shlibpath="$dir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2362 add="-l$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2363 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2364 lib_linked=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2365 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2366 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2367 *) lib_linked=no ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2368 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2369
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2370 if test "$lib_linked" != yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2371 $echo "$modename: configuration error: unsupported hardcode properties"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2372 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2373 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2374
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2375 if test -n "$add_shlibpath"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2376 case :$compile_shlibpath: in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2377 *":$add_shlibpath:"*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2378 *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2379 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2380 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2381 if test "$linkmode" = prog; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2382 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
2383 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
2384 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2385 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
2386 test -n "$add" && deplibs="$add $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2387 if test "$hardcode_direct" != yes && \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2388 test "$hardcode_minus_L" != yes && \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2389 test "$hardcode_shlibpath_var" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2390 case :$finalize_shlibpath: in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2391 *":$libdir:"*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2392 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2393 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2394 fi
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 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2397
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2398 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
2399 add_shlibpath=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2400 add_dir=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2401 add=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2402 # 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
2403 if test "$hardcode_direct" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2404 add="$libdir/$linklib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2405 elif test "$hardcode_minus_L" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2406 add_dir="-L$libdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2407 add="-l$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2408 elif test "$hardcode_shlibpath_var" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2409 case :$finalize_shlibpath: in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2410 *":$libdir:"*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2411 *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2412 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2413 add="-l$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2414 elif test "$hardcode_automatic" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2415 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
2416 add="$inst_prefix_dir$libdir/$linklib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2417 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2418 add="$libdir/$linklib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2419 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2420 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2421 # 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
2422 add_dir="-L$libdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2423 # 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
2424 if test -n "$inst_prefix_dir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2425 case "$libdir" in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2426 [\\/]*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2427 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
2428 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2429 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2430 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2431 add="-l$name"
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2434 if test "$linkmode" = prog; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2435 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
2436 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
2437 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2438 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
2439 test -n "$add" && deplibs="$add $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2440 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2441 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2442 elif test "$linkmode" = prog; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2443 # 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
2444 # 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
2445 # shared platforms.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2446 if test "$hardcode_direct" != unsupported; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2447 test -n "$old_library" && linklib="$old_library"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2448 compile_deplibs="$dir/$linklib $compile_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2449 finalize_deplibs="$dir/$linklib $finalize_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2450 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2451 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
2452 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
2453 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2454 elif test "$build_libtool_libs" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2455 # Not a shared library
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2456 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
2457 # 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
2458 # but the system doesn't support it.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2459
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2460 # 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
2461 # 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
2462 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2463 $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
2464 $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
2465 $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
2466 $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
2467 if test "$module" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2468 $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
2469 $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
2470 $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
2471 if test -z "$global_symbol_pipe"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2472 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2473 $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
2474 $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
2475 $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
2476 $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
2477 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2478 if test "$build_old_libs" = no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2479 build_libtool_libs=module
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2480 build_old_libs=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2481 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2482 build_libtool_libs=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2483 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2484 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2485 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2486 convenience="$convenience $dir/$old_library"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2487 old_convenience="$old_convenience $dir/$old_library"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2488 deplibs="$dir/$old_library $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2489 link_static=yes
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 fi # link shared/static library?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2492
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2493 if test "$linkmode" = lib; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2494 if test -n "$dependency_libs" &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2495 { 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
2496 test "$link_static" = yes; }; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2497 # Extract -R from dependency_libs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2498 temp_deplibs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2499 for libdir in $dependency_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2500 case $libdir in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2501 -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
2502 case " $xrpath " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2503 *" $temp_xrpath "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2504 *) xrpath="$xrpath $temp_xrpath";;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2505 esac;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2506 *) temp_deplibs="$temp_deplibs $libdir";;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2507 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2508 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2509 dependency_libs="$temp_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2510 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2511
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2512 newlib_search_path="$newlib_search_path $absdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2513 # Link against this library
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2514 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
2515 # ... and its dependency_libs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2516 tmp_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2517 for deplib in $dependency_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2518 newdependency_libs="$deplib $newdependency_libs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2519 if test "X$duplicate_deps" = "Xyes" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2520 case "$tmp_libs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2521 *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2522 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2523 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2524 tmp_libs="$tmp_libs $deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2525 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2526
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2527 if test "$link_all_deplibs" != no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2528 # 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
2529 for deplib in $dependency_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2530 case $deplib in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2531 -L*) path="$deplib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2532 *.la)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2533 dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2534 test "X$dir" = "X$deplib" && dir="."
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2535 # We need an absolute path.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2536 case $dir in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2537 [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2538 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2539 absdir=`cd "$dir" && pwd`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2540 if test -z "$absdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2541 $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
2542 absdir="$dir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2543 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2544 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2545 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2546 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
2547 path="$absdir/$objdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2548 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2549 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
2550 if test -z "$libdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2551 $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
2552 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2553 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2554 if test "$absdir" != "$libdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2555 $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
2556 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2557 path="$absdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2558 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2559 depdepl=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2560 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2561 *-*-darwin*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2562 # 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
2563 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
2564 if test -n "$deplibrary_names" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2565 for tmp in $deplibrary_names ; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2566 depdepl=$tmp
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2567 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2568 if test -f "$path/$depdepl" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2569 depdepl="$path/$depdepl"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2570 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2571 newlib_search_path="$newlib_search_path $path"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2572 path=""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2573 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2574 ;;
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 path="-L$path"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2577 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2578 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2579
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2580 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2581 -l*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2582 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2583 *-*-darwin*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2584 # 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
2585 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
2586 for tmp in $newlib_search_path ; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2587 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
2588 eval depdepl="$tmp/lib$tmp_libs.dylib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2589 break
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 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2592 path=""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2593 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2594 *) continue ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2595 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2596 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2597 *) continue ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2598 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2599 case " $deplibs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2600 *" $depdepl "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2601 *) deplibs="$deplibs $depdepl" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2602 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2603 case " $deplibs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2604 *" $path "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2605 *) deplibs="$deplibs $path" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2606 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2607 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2608 fi # link_all_deplibs != no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2609 fi # linkmode = lib
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2610 done # for deplib in $libs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2611 dependency_libs="$newdependency_libs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2612 if test "$pass" = dlpreopen; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2613 # Link the dlpreopened libraries before other libraries
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2614 for deplib in $save_deplibs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2615 deplibs="$deplib $deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2616 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2617 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2618 if test "$pass" != dlopen; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2619 if test "$pass" != conv; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2620 # 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
2621 lib_search_path=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2622 for dir in $newlib_search_path; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2623 case "$lib_search_path " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2624 *" $dir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2625 *) lib_search_path="$lib_search_path $dir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2626 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2627 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2628 newlib_search_path=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2629 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2630
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2631 if test "$linkmode,$pass" != "prog,link"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2632 vars="deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2633 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2634 vars="compile_deplibs finalize_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2635 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2636 for var in $vars dependency_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2637 # Add libraries to $var in reverse order
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2638 eval tmp_libs=\"\$$var\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2639 new_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2640 for deplib in $tmp_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2641 # 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
2642 # 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
2643 # broken:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2644 #new_libs="$deplib $new_libs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2645 # 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
2646 # practice:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2647 case $deplib in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2648 -L*) new_libs="$deplib $new_libs" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2649 -R*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2650 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2651 # 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
2652 # 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
2653 # 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
2654 # compiler, it is considered special, and multiple
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2655 # occurrences thereof are not removed. Compare this
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2656 # 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
2657 # 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
2658 # 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
2659 # 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
2660 # 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
2661 # 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
2662 # 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
2663 # 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
2664 # for duplicate removal.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2665 case " $specialdeplibs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2666 *" $deplib "*) new_libs="$deplib $new_libs" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2667 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2668 case " $new_libs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2669 *" $deplib "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2670 *) new_libs="$deplib $new_libs" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2671 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2672 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2673 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2674 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2675 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2676 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2677 tmp_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2678 for deplib in $new_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2679 case $deplib in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2680 -L*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2681 case " $tmp_libs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2682 *" $deplib "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2683 *) tmp_libs="$tmp_libs $deplib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2684 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2685 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2686 *) tmp_libs="$tmp_libs $deplib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2687 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2688 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2689 eval $var=\"$tmp_libs\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2690 done # for var
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2691 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2692 # 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
2693 tmp_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2694 for i in $dependency_libs ; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2695 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
2696 *" $i "*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2697 i=""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2698 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2699 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2700 if test -n "$i" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2701 tmp_libs="$tmp_libs $i"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2702 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2703 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2704 dependency_libs=$tmp_libs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2705 done # for pass
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2706 if test "$linkmode" = prog; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2707 dlfiles="$newdlfiles"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2708 dlprefiles="$newdlprefiles"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2709 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2710
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2711 case $linkmode in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2712 oldlib)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2713 if test -n "$deplibs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2714 $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2715 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2716
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2717 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2718 $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2719 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2720
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2721 if test -n "$rpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2722 $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2723 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2724
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2725 if test -n "$xrpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2726 $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2727 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2728
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2729 if test -n "$vinfo"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2730 $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2731 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2732
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2733 if test -n "$release"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2734 $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2735 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2736
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2737 if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2738 $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2739 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2740
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2741 # Now set the variables for building old libraries.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2742 build_libtool_libs=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2743 oldlibs="$output"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2744 objs="$objs$old_deplibs"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2745 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2746
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2747 lib)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2748 # 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
2749 case $outputname in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2750 lib*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2751 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
2752 eval shared_ext=\"$shrext\"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2753 eval libname=\"$libname_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2754 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2755 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2756 if test "$module" = no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2757 $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2758 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2759 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2760 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2761 if test "$need_lib_prefix" != no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2762 # Add the "lib" prefix for modules if required
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2763 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
2764 eval shared_ext=\"$shrext\"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2765 eval libname=\"$libname_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2766 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2767 libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2768 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2769 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2770 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2771
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2772 if test -n "$objs"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2773 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
2774 $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
2775 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2776 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2777 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2778 $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
2779 $echo "*** objects $objs is not portable!"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2780 libobjs="$libobjs $objs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2781 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2782 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2783
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2784 if test "$dlself" != no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2785 $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2786 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2787
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2788 set dummy $rpath
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2789 if test "$#" -gt 2; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2790 $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2791 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2792 install_libdir="$2"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2793
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2794 oldlibs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2795 if test -z "$rpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2796 if test "$build_libtool_libs" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2797 # Building a libtool convenience library.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2798 # 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
2799 # 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
2800 # archive normally would.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2801 oldlibs="$output_objdir/$libname.$libext $oldlibs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2802 build_libtool_libs=convenience
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2803 build_old_libs=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2804 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2805
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2806 if test -n "$vinfo"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2807 $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2808 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2809
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2810 if test -n "$release"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2811 $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2812 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2813 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2814
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2815 # Parse the version information argument.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2816 save_ifs="$IFS"; IFS=':'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2817 set dummy $vinfo 0 0 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2818 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2819
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2820 if test -n "$8"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2821 $echo "$modename: too many parameters to \`-version-info'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2822 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2823 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2824 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2825
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2826 # convert absolute version numbers to libtool ages
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2827 # 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
2828 # 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
2829
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2830 case $vinfo_number in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2831 yes)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2832 number_major="$2"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2833 number_minor="$3"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2834 number_revision="$4"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2835 #
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2836 # 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
2837 # 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
2838 # 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
2839 # 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
2840 # 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
2841 #
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2842 case $version_type in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2843 darwin|linux|osf|windows)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2844 current=`expr $number_major + $number_minor`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2845 age="$number_minor"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2846 revision="$number_revision"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2847 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2848 freebsd-aout|freebsd-elf|sunos)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2849 current="$number_major"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2850 revision="$number_minor"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2851 age="0"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2852 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2853 irix|nonstopux)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2854 current=`expr $number_major + $number_minor - 1`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2855 age="$number_minor"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2856 revision="$number_minor"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2857 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2858 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2859 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2860 no)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2861 current="$2"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2862 revision="$3"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2863 age="$4"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2864 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2865 esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2866
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2867 # 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
2868 case $current in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2869 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2870 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2871 $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2872 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2873 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2874 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2875 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2876
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2877 case $revision in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2878 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2879 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2880 $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2881 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2882 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2883 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2884 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2885
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2886 case $age in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2887 0 | [1-9] | [1-9][0-9] | [1-9][0-9][0-9]) ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2888 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2889 $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2890 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2891 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2892 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2893 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2894
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2895 if test "$age" -gt "$current"; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2896 $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2897 $echo "$modename: \`$vinfo' is not valid version information" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2898 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2899 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2900
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2901 # Calculate the version variables.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2902 major=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2903 versuffix=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2904 verstring=
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2905 case $version_type in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2906 none) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2907
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2908 darwin)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2909 # 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
2910 # 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
2911 major=.`expr $current - $age`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2912 versuffix="$major.$age.$revision"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2913 # 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
2914 minor_current=`expr $current + 1`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2915 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
2916 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2917
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2918 freebsd-aout)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2919 major=".$current"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2920 versuffix=".$current.$revision";
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2921 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2922
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2923 freebsd-elf)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2924 major=".$current"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2925 versuffix=".$current";
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2926 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2927
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2928 irix | nonstopux)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2929 major=`expr $current - $age + 1`
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2930
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2931 case $version_type in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2932 nonstopux) verstring_prefix=nonstopux ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2933 *) verstring_prefix=sgi ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2934 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2935 verstring="$verstring_prefix$major.$revision"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2936
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2937 # Add in all the interfaces that we are compatible with.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2938 loop=$revision
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2939 while test "$loop" -ne 0; do
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2940 iface=`expr $revision - $loop`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2941 loop=`expr $loop - 1`
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2942 verstring="$verstring_prefix$major.$iface:$verstring"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2943 done
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2944
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2945 # Before this point, $major must not contain `.'.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2946 major=.$major
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2947 versuffix="$major.$revision"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2948 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2949
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2950 linux)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2951 major=.`expr $current - $age`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2952 versuffix="$major.$age.$revision"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2953 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2954
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2955 osf)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2956 major=.`expr $current - $age`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2957 versuffix=".$current.$age.$revision"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2958 verstring="$current.$age.$revision"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2959
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2960 # Add in all the interfaces that we are compatible with.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2961 loop=$age
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2962 while test "$loop" -ne 0; do
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2963 iface=`expr $current - $loop`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2964 loop=`expr $loop - 1`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2965 verstring="$verstring:${iface}.0"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2966 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2967
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2968 # Make executables depend on our current version.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2969 verstring="$verstring:${current}.0"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2970 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2971
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2972 sunos)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2973 major=".$current"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2974 versuffix=".$current.$revision"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2975 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2976
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2977 windows)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2978 # 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
2979 # extension on DOS 8.3 filesystems.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2980 major=`expr $current - $age`
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2981 versuffix="-$major"
387
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
2982 ;;
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
2983
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2984 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2985 $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
2986 $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2987 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2988 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2989 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2990
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2991 # Clear the version info if we defaulted, and they specified a release.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2992 if test -z "$vinfo" && test -n "$release"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
2993 major=
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2994 case $version_type in
387
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
2995 darwin)
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
2996 # 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
2997 # problems, so we reset it completely
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
2998 verstring=
387
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
2999 ;;
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
3000 *)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3001 verstring="0.0"
387
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
3002 ;;
469d5c0da01d Fixed shared library building on MacOS X (thanks Max!)
Sam Lantinga <slouken@libsdl.org>
parents: 1
diff changeset
3003 esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3004 if test "$need_version" = no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3005 versuffix=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3006 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3007 versuffix=".0.0"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3008 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3009 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3010
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3011 # Remove version info from name if versioning should be avoided
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3012 if test "$avoid_version" = yes && test "$need_version" = no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3013 major=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3014 versuffix=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3015 verstring=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3016 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3017
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3018 # Check to see if the archive will have undefined symbols.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3019 if test "$allow_undefined" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3020 if test "$allow_undefined_flag" = unsupported; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3021 $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3022 build_libtool_libs=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3023 build_old_libs=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3024 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3025 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3026 # Don't allow undefined symbols.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3027 allow_undefined_flag="$no_undefined_flag"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3028 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3029 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3030
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3031 if test "$mode" != relink; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3032 # 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
3033 # 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
3034 removelist=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3035 tempremovelist=`$echo "$output_objdir/*"`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3036 for p in $tempremovelist; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3037 case $p in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3038 *.$objext)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3039 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3040 $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
3041 removelist="$removelist $p"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3042 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3043 *) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3044 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3045 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3046 if test -n "$removelist"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3047 $show "${rm}r $removelist"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3048 $run ${rm}r $removelist
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3049 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3050 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3051
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3052 # Now set the variables for building old libraries.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3053 if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3054 oldlibs="$oldlibs $output_objdir/$libname.$libext"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3055
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3056 # Transform .lo files to .o files.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3057 oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3058 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3059
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3060 # Eliminate all temporary directories.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3061 for path in $notinst_path; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3062 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
3063 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
3064 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
3065 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3066
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3067 if test -n "$xrpath"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3068 # 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
3069 temp_xrpath=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3070 for libdir in $xrpath; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3071 temp_xrpath="$temp_xrpath -R$libdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3072 case "$finalize_rpath " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3073 *" $libdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3074 *) finalize_rpath="$finalize_rpath $libdir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3075 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3076 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3077 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
3078 dependency_libs="$temp_xrpath $dependency_libs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3079 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3080 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3081
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3082 # 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
3083 old_dlfiles="$dlfiles"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3084 dlfiles=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3085 for lib in $old_dlfiles; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3086 case " $dlprefiles $dlfiles " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3087 *" $lib "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3088 *) dlfiles="$dlfiles $lib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3089 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3090 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3091
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3092 # Make sure dlprefiles contains only unique files
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3093 old_dlprefiles="$dlprefiles"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3094 dlprefiles=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3095 for lib in $old_dlprefiles; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3096 case "$dlprefiles " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3097 *" $lib "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3098 *) dlprefiles="$dlprefiles $lib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3099 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3100 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3101
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3102 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
3103 if test -n "$rpath"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3104 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3105 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3106 # 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
3107 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3108 *-*-rhapsody* | *-*-darwin1.[012])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3109 # 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
3110 deplibs="$deplibs -framework System"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3111 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3112 *-*-netbsd*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3113 # 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
3114 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3115 *-*-openbsd* | *-*-freebsd*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3116 # 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
3117 test "X$arg" = "X-lc" && continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3118 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3119 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3120 # 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
3121 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
3122 deplibs="$deplibs -lc"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3123 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3124 ;;
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 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3127
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3128 # Transform deplibs into only deplibs that can be linked in shared.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3129 name_save=$name
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3130 libname_save=$libname
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3131 release_save=$release
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3132 versuffix_save=$versuffix
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3133 major_save=$major
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3134 # I'm not sure if I'm treating the release correctly. I think
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3135 # release should show up in the -l (ie -lgmp5) so we don't want to
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3136 # add it in twice. Is that correct?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3137 release=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3138 versuffix=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3139 major=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3140 newdeplibs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3141 droppeddeps=no
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3142 case $deplibs_check_method in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3143 pass_all)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3144 # Don't check for shared/static. Everything works.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3145 # This might be a little naive. We might want to check
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3146 # whether the library exists or not. But this is on
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3147 # 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
3148 # implementing what was already the behavior.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3149 newdeplibs=$deplibs
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3150 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3151 test_compile)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3152 # This code stresses the "libraries are programs" paradigm to its
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3153 # limits. Maybe even breaks it. We compile a program, linking it
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3154 # against the deplibs as a proxy for the library. Then we can check
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3155 # whether they linked in statically or dynamically with ldd.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3156 $rm conftest.c
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3157 cat > conftest.c <<EOF
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3158 int main() { return 0; }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3159 EOF
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3160 $rm conftest
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3161 $LTCC -o conftest conftest.c $deplibs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3162 if test "$?" -eq 0 ; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3163 ldd_output=`ldd conftest`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3164 for i in $deplibs; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3165 name="`expr $i : '-l\(.*\)'`"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3166 # 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
3167 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
3168 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
3169 case " $predeps $postdeps " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3170 *" $i "*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3171 newdeplibs="$newdeplibs $i"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3172 i=""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3173 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3174 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3175 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3176 if test -n "$i" ; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3177 libname=`eval \\$echo \"$libname_spec\"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3178 deplib_matches=`eval \\$echo \"$library_names_spec\"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3179 set dummy $deplib_matches
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3180 deplib_match=$2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3181 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3182 newdeplibs="$newdeplibs $i"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3183 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3184 droppeddeps=yes
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3185 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3186 $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
3187 $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
3188 $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
3189 $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
3190 $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
3191 $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
3192 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3193 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3194 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3195 newdeplibs="$newdeplibs $i"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3196 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3197 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3198 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3199 # 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
3200 # 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
3201 for i in $deplibs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3202 name="`expr $i : '-l\(.*\)'`"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3203 # 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
3204 if test "$name" != "" && test "$name" != "0"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3205 $rm conftest
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3206 $LTCC -o conftest conftest.c $i
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3207 # Did it work?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3208 if test "$?" -eq 0 ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3209 ldd_output=`ldd conftest`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3210 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
3211 case " $predeps $postdeps " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3212 *" $i "*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3213 newdeplibs="$newdeplibs $i"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3214 i=""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3215 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3216 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3217 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3218 if test -n "$i" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3219 libname=`eval \\$echo \"$libname_spec\"`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3220 deplib_matches=`eval \\$echo \"$library_names_spec\"`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3221 set dummy $deplib_matches
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3222 deplib_match=$2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3223 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
3224 newdeplibs="$newdeplibs $i"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3225 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3226 droppeddeps=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3227 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3228 $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
3229 $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
3230 $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
3231 $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
3232 $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
3233 $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
3234 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3235 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3236 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3237 droppeddeps=yes
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3238 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3239 $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
3240 $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
3241 $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
3242 $echo "*** functional. Installing it before continuing would be even better."
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3243 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3244 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3245 newdeplibs="$newdeplibs $i"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3246 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3247 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3248 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3249 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3250 file_magic*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3251 set dummy $deplibs_check_method
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3252 file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3253 for a_deplib in $deplibs; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3254 name="`expr $a_deplib : '-l\(.*\)'`"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3255 # 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
3256 if test "$name" != "" && test "$name" != "0"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3257 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
3258 case " $predeps $postdeps " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3259 *" $a_deplib "*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3260 newdeplibs="$newdeplibs $a_deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3261 a_deplib=""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3262 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3263 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3264 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3265 if test -n "$a_deplib" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3266 libname=`eval \\$echo \"$libname_spec\"`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3267 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
3268 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
3269 for potent_lib in $potential_libs; do
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3270 # Follow soft links.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3271 if ls -lLd "$potent_lib" 2>/dev/null \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3272 | grep " -> " >/dev/null; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3273 continue
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3274 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3275 # The statement above tries to avoid entering an
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3276 # endless loop below, in case of cyclic links.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3277 # We might still enter an endless loop, since a link
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3278 # loop can be closed while we follow links,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3279 # but so what?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3280 potlib="$potent_lib"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3281 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
3282 potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3283 case $potliblink in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3284 [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3285 *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3286 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3287 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3288 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
3289 | ${SED} 10q \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3290 | $EGREP "$file_magic_regex" > /dev/null; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3291 newdeplibs="$newdeplibs $a_deplib"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3292 a_deplib=""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3293 break 2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3294 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3295 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3296 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3297 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3298 if test -n "$a_deplib" ; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3299 droppeddeps=yes
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3300 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3301 $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
3302 $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
3303 $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
3304 $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
3305 $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
3306 if test -z "$potlib" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3307 $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
3308 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3309 $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
3310 $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
3311 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3312 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3313 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3314 # Add a -L argument.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3315 newdeplibs="$newdeplibs $a_deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3316 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3317 done # Gone through all deplibs.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3318 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3319 match_pattern*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3320 set dummy $deplibs_check_method
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3321 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
3322 for a_deplib in $deplibs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3323 name="`expr $a_deplib : '-l\(.*\)'`"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3324 # 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
3325 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
3326 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
3327 case " $predeps $postdeps " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3328 *" $a_deplib "*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3329 newdeplibs="$newdeplibs $a_deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3330 a_deplib=""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3331 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3332 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3333 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3334 if test -n "$a_deplib" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3335 libname=`eval \\$echo \"$libname_spec\"`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3336 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
3337 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
3338 for potent_lib in $potential_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3339 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
3340 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
3341 | ${SED} 10q \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3342 | $EGREP "$match_pattern_regex" > /dev/null; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3343 newdeplibs="$newdeplibs $a_deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3344 a_deplib=""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3345 break 2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3346 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3347 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3348 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3349 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3350 if test -n "$a_deplib" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3351 droppeddeps=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3352 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3353 $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
3354 $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
3355 $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
3356 $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
3357 $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
3358 if test -z "$potlib" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3359 $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
3360 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3361 $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
3362 $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
3363 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3364 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3365 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3366 # Add a -L argument.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3367 newdeplibs="$newdeplibs $a_deplib"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3368 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3369 done # Gone through all deplibs.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3370 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3371 none | unknown | *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3372 newdeplibs=""
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3373 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
3374 -e 's/ -[LR][^ ]*//g'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3375 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
3376 for i in $predeps $postdeps ; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3377 # 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
3378 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
3379 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3380 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3381 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
3382 | grep . >/dev/null; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3383 $echo
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3384 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
3385 $echo "*** Warning: inter-library dependencies are not supported in this platform."
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3386 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3387 $echo "*** Warning: inter-library dependencies are not known to be supported."
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3388 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3389 $echo "*** All declared inter-library dependencies are being dropped."
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3390 droppeddeps=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3391 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3392 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3393 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3394 versuffix=$versuffix_save
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3395 major=$major_save
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3396 release=$release_save
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3397 libname=$libname_save
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3398 name=$name_save
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3399
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3400 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3401 *-*-rhapsody* | *-*-darwin1.[012])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3402 # 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
3403 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
3404 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3405 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3406
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3407 if test "$droppeddeps" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3408 if test "$module" = yes; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3409 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3410 $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
3411 $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
3412 $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
3413 $echo "*** application is linked with the -dlopen flag."
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3414 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
3415 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3416 $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
3417 $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
3418 $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
3419 $echo "*** \`nm' from GNU binutils and a full rebuild may help."
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3420 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3421 if test "$build_old_libs" = no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3422 oldlibs="$output_objdir/$libname.$libext"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3423 build_libtool_libs=module
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3424 build_old_libs=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3425 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3426 build_libtool_libs=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3427 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3428 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3429 $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
3430 $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
3431 $echo "*** or is declared to -dlopen it."
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3432
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3433 if test "$allow_undefined" = no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3434 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3435 $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
3436 $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
3437 $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
3438 $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
3439 if test "$build_old_libs" = no; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3440 oldlibs="$output_objdir/$libname.$libext"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3441 build_libtool_libs=module
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3442 build_old_libs=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3443 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3444 build_libtool_libs=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3445 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3446 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3447 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3448 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3449 # Done checking deplibs!
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3450 deplibs=$newdeplibs
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3451 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3452
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3453 # All the library-specific variables (install_libdir is set above).
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3454 library_names=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3455 old_library=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3456 dlname=
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3457
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3458 # Test again, we may have decided not to build it any more
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3459 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
3460 if test "$hardcode_into_libs" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3461 # Hardcode the library paths
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3462 hardcode_libdirs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3463 dep_rpath=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3464 rpath="$finalize_rpath"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3465 test "$mode" != relink && rpath="$compile_rpath$rpath"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3466 for libdir in $rpath; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3467 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
3468 if test -n "$hardcode_libdir_separator"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3469 if test -z "$hardcode_libdirs"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3470 hardcode_libdirs="$libdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3471 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3472 # Just accumulate the unique libdirs.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3473 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
3474 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3475 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3476 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3477 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
3478 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3479 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3480 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3481 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3482 eval flag=\"$hardcode_libdir_flag_spec\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3483 dep_rpath="$dep_rpath $flag"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3484 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3485 elif test -n "$runpath_var"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3486 case "$perm_rpath " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3487 *" $libdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3488 *) perm_rpath="$perm_rpath $libdir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3489 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3490 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3491 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3492 # Substitute the hardcoded libdirs into the rpath.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3493 if test -n "$hardcode_libdir_separator" &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3494 test -n "$hardcode_libdirs"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3495 libdir="$hardcode_libdirs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3496 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
3497 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
3498 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3499 eval dep_rpath=\"$hardcode_libdir_flag_spec\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3500 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3501 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3502 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
3503 # We should set the runpath_var.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3504 rpath=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3505 for dir in $perm_rpath; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3506 rpath="$rpath$dir:"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3507 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3508 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
3509 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3510 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
3511 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3512
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3513 shlibpath="$finalize_shlibpath"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3514 test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3515 if test -n "$shlibpath"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3516 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
3517 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3518
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3519 # 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
3520 eval shared_ext=\"$shrext\"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3521 eval library_names=\"$library_names_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3522 set dummy $library_names
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3523 realname="$2"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3524 shift; shift
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3525
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3526 if test -n "$soname_spec"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3527 eval soname=\"$soname_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3528 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3529 soname="$realname"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3530 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3531 if test -z "$dlname"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3532 dlname=$soname
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3533 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3534
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3535 lib="$output_objdir/$realname"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3536 for link
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3537 do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3538 linknames="$linknames $link"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3539 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3540
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3541 # Use standard objects if they are pic
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3542 test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3543
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3544 # Prepare the list of exported symbols
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3545 if test -z "$export_symbols"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3546 if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3547 $show "generating symbol list for \`$libname.la'"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3548 export_symbols="$output_objdir/$libname.exp"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3549 $run $rm $export_symbols
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3550 eval cmds=\"$export_symbols_cmds\"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3551 save_ifs="$IFS"; IFS='~'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3552 for cmd in $cmds; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3553 IFS="$save_ifs"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3554 if len=`expr "X$cmd" : ".*"` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3555 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
3556 $show "$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3557 $run eval "$cmd" || exit $?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3558 skipped_export=false
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3559 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3560 # 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
3561 $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
3562 skipped_export=:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3563 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3564 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3565 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3566 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
3567 $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
3568 $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3569 $show "$mv \"${export_symbols}T\" \"$export_symbols\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3570 $run eval '$mv "${export_symbols}T" "$export_symbols"'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3571 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3572 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3573 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3574
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3575 if test -n "$export_symbols" && test -n "$include_expsyms"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3576 $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3577 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3578
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3579 tmp_deplibs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3580 for test_deplib in $deplibs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3581 case " $convenience " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3582 *" $test_deplib "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3583 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3584 tmp_deplibs="$tmp_deplibs $test_deplib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3585 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3586 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3587 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3588 deplibs="$tmp_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3589
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3590 if test -n "$convenience"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3591 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
3592 save_libobjs=$libobjs
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3593 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3594 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3595 gentop="$output_objdir/${outputname}x"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3596 $show "${rm}r $gentop"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3597 $run ${rm}r "$gentop"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3598 $show "$mkdir $gentop"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3599 $run $mkdir "$gentop"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3600 status=$?
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3601 if test "$status" -ne 0 && test ! -d "$gentop"; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3602 exit $status
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3603 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3604 generated="$generated $gentop"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3605
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3606 for xlib in $convenience; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3607 # Extract the objects.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3608 case $xlib in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3609 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3610 *) xabs=`pwd`"/$xlib" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3611 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3612 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3613 xdir="$gentop/$xlib"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3614
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3615 $show "${rm}r $xdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3616 $run ${rm}r "$xdir"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3617 $show "$mkdir $xdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3618 $run $mkdir "$xdir"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3619 status=$?
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3620 if test "$status" -ne 0 && test ! -d "$xdir"; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3621 exit $status
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3622 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3623 # 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
3624 # 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
3625 # automatically by $AR in one run.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3626 $show "(cd $xdir && $AR x $xabs)"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3627 $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
3628 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
3629 :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3630 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3631 $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
3632 $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
3633 $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
3634 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3635 i=1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3636 while test "$i" -le "$count"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3637 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3638 # 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
3639 # Never overwrite any file
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3640 name_to="$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3641 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
3642 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3643 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
3644 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3645 $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
3646 $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
3647 i=`expr $i + 1`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3648 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3649 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3650 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3651
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3652 libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3653 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3654 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3655 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3656
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3657 if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3658 eval flag=\"$thread_safe_flag_spec\"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3659 linker_flags="$linker_flags $flag"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3660 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3661
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3662 # 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
3663 if test "$mode" = relink; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3664 $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3665 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3666
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3667 # Do each of the archive commands.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3668 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
3669 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
3670 eval cmds=\"$module_expsym_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3671 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3672 eval cmds=\"$module_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3673 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3674 else
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3675 if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3676 eval cmds=\"$archive_expsym_cmds\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3677 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3678 eval cmds=\"$archive_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3679 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3680 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3681
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3682 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
3683 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
3684 :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3685 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3686 # 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
3687 $echo "creating reloadable object files..."
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3688
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3689 # 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
3690 # 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
3691 # 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
3692 # 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
3693 # 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
3694 # 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
3695 # 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
3696 # the spec.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3697 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
3698 save_libobjs=$libobjs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3699 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3700 save_output=$output
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3701
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3702 # 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
3703 # initialize k to one.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3704 test_cmds=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3705 concat_cmds=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3706 objlist=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3707 delfiles=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3708 last_robj=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3709 k=1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3710 output=$output_objdir/$save_output-${k}.$objext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3711 # 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
3712 for obj in $save_libobjs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3713 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3714 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
3715 if test "X$objlist" = X ||
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3716 { len=`expr "X$test_cmds" : ".*"` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3717 test "$len" -le "$max_cmd_len"; }; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3718 objlist="$objlist $obj"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3719 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3720 # 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
3721 # command to the queue.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3722 if test "$k" -eq 1 ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3723 # 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
3724 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
3725 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3726 # 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
3727 # the last one created.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3728 eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
608
d0fecf67cd93 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 581
diff changeset
3729 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3730 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
3731 k=`expr $k + 1`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3732 output=$output_objdir/$save_output-${k}.$objext
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3733 objlist=$obj
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3734 len=1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3735 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3736 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3737 # 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
3738 # reloadable object file. All subsequent reloadable object
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3739 # 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
3740 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
3741 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
3742
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3743 if ${skipped_export-false}; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3744 $show "generating symbol list for \`$libname.la'"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3745 export_symbols="$output_objdir/$libname.exp"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3746 $run $rm $export_symbols
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3747 libobjs=$output
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3748 # 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
3749 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
3750 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3751
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3752 # 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
3753 # after they are used.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3754 i=0
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3755 while test "$i" -lt "$k"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3756 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3757 i=`expr $i + 1`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3758 delfiles="$delfiles $output_objdir/$save_output-${i}.$objext"
608
d0fecf67cd93 *** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents: 581
diff changeset
3759 done
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3760
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3761 $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
3762
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3763 # 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
3764 save_ifs="$IFS"; IFS='~'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3765 for cmd in $concat_cmds; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3766 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3767 $show "$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3768 $run eval "$cmd" || exit $?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3769 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3770 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3771
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3772 libobjs=$output
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3773 # Restore the value of output.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3774 output=$save_output
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3775
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3776 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
3777 eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3778 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3779 # 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
3780 # value of $libobjs for piecewise linking.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3781
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3782 # Do each of the archive commands.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3783 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
3784 eval cmds=\"$archive_expsym_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3785 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3786 eval cmds=\"$archive_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3787 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3788
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3789 # 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
3790 # to the just-reset $cmds.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3791 eval cmds=\"\$cmds~$rm $delfiles\"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3792 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3793 save_ifs="$IFS"; IFS='~'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3794 for cmd in $cmds; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3795 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3796 $show "$cmd"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3797 $run eval "$cmd" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3798 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3799 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3800
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3801 # Restore the uninstalled library and exit
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3802 if test "$mode" = relink; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3803 $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
3804 exit 0
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3805 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3806
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3807 # Create links to the real library.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3808 for linkname in $linknames; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3809 if test "$realname" != "$linkname"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3810 $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3811 $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3812 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3813 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3814
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3815 # If -module or -export-dynamic was specified, set the dlname.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3816 if test "$module" = yes || test "$export_dynamic" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3817 # On all known operating systems, these are identical.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3818 dlname="$soname"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3819 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3820 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3821 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3822
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3823 obj)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3824 if test -n "$deplibs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3825 $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3826 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3827
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3828 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3829 $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3830 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3831
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3832 if test -n "$rpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3833 $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3834 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3835
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3836 if test -n "$xrpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3837 $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3838 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3839
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3840 if test -n "$vinfo"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3841 $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3842 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3843
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3844 if test -n "$release"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3845 $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3846 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3847
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3848 case $output in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3849 *.lo)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3850 if test -n "$objs$old_deplibs"; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3851 $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3852 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3853 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3854 libobj="$output"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3855 obj=`$echo "X$output" | $Xsed -e "$lo2o"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3856 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3857 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3858 libobj=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3859 obj="$output"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3860 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3861 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3862
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3863 # Delete the old objects.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3864 $run $rm $obj $libobj
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3865
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3866 # Objects from convenience libraries. This assumes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3867 # single-version convenience libraries. Whenever we create
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3868 # different ones for PIC/non-PIC, this we'll have to duplicate
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3869 # the extraction.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3870 reload_conv_objs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3871 gentop=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3872 # reload_cmds runs $LD directly, so let us get rid of
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3873 # -Wl from whole_archive_flag_spec
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3874 wl=
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3875
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3876 if test -n "$convenience"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3877 if test -n "$whole_archive_flag_spec"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3878 eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3879 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3880 gentop="$output_objdir/${obj}x"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3881 $show "${rm}r $gentop"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3882 $run ${rm}r "$gentop"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3883 $show "$mkdir $gentop"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3884 $run $mkdir "$gentop"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3885 status=$?
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3886 if test "$status" -ne 0 && test ! -d "$gentop"; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3887 exit $status
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3888 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3889 generated="$generated $gentop"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3890
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3891 for xlib in $convenience; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3892 # Extract the objects.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3893 case $xlib in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3894 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3895 *) xabs=`pwd`"/$xlib" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3896 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3897 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3898 xdir="$gentop/$xlib"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3899
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3900 $show "${rm}r $xdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3901 $run ${rm}r "$xdir"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3902 $show "$mkdir $xdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3903 $run $mkdir "$xdir"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3904 status=$?
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3905 if test "$status" -ne 0 && test ! -d "$xdir"; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3906 exit $status
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3907 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3908 # 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
3909 # 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
3910 # automatically by $AR in one run.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3911 $show "(cd $xdir && $AR x $xabs)"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3912 $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
3913 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
3914 :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3915 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3916 $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
3917 $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
3918 $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
3919 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3920 i=1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3921 while test "$i" -le "$count"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3922 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3923 # 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
3924 # Never overwrite any file
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3925 name_to="$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3926 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
3927 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3928 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
3929 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3930 $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
3931 $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
3932 i=`expr $i + 1`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3933 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3934 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3935 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3936
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3937 reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3938 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3939 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3940 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3941
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3942 # Create the old-style object.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3943 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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3944
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3945 output="$obj"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3946 eval cmds=\"$reload_cmds\"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3947 save_ifs="$IFS"; IFS='~'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3948 for cmd in $cmds; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3949 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3950 $show "$cmd"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3951 $run eval "$cmd" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3952 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3953 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3954
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3955 # Exit if we aren't doing a library object file.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3956 if test -z "$libobj"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3957 if test -n "$gentop"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3958 $show "${rm}r $gentop"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3959 $run ${rm}r $gentop
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3960 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3961
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3962 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3963 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3964
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3965 if test "$build_libtool_libs" != yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3966 if test -n "$gentop"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3967 $show "${rm}r $gentop"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3968 $run ${rm}r $gentop
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3969 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3970
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3971 # Create an invalid libtool object if no PIC, so that we don't
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3972 # accidentally link it into a program.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3973 # $show "echo timestamp > $libobj"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3974 # $run eval "echo timestamp > $libobj" || exit $?
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3975 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3976 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3977
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3978 if test -n "$pic_flag" || test "$pic_mode" != default; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3979 # Only do commands if we really have different PIC objects.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3980 reload_objs="$libobjs $reload_conv_objs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3981 output="$libobj"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3982 eval cmds=\"$reload_cmds\"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
3983 save_ifs="$IFS"; IFS='~'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3984 for cmd in $cmds; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3985 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3986 $show "$cmd"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3987 $run eval "$cmd" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3988 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3989 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3990 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3991
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3992 if test -n "$gentop"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3993 $show "${rm}r $gentop"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3994 $run ${rm}r $gentop
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3995 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3996
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3997 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3998 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
3999
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4000 prog)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4001 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4002 *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
4003 esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4004 if test -n "$vinfo"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4005 $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4006 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4007
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4008 if test -n "$release"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4009 $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4010 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4011
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4012 if test "$preload" = yes; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4013 if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4014 test "$dlopen_self_static" = unknown; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4015 $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
4016 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4017 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4018
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4019 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4020 *-*-rhapsody* | *-*-darwin1.[012])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4021 # 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
4022 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
4023 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
4024 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4025 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4026
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4027 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4028 *darwin*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4029 # 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
4030 if test "$tagname" = CXX ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4031 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
4032 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
4033 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4034 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4035 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4036
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4037 compile_command="$compile_command $compile_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4038 finalize_command="$finalize_command $finalize_deplibs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4039
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4040 if test -n "$rpath$xrpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4041 # If the user specified any rpath flags, then add them.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4042 for libdir in $rpath $xrpath; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4043 # This is the magic to use -rpath.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4044 case "$finalize_rpath " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4045 *" $libdir "*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4046 *) finalize_rpath="$finalize_rpath $libdir" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4047 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4048 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4049 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4050
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4051 # Now hardcode the library paths
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4052 rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4053 hardcode_libdirs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4054 for libdir in $compile_rpath $finalize_rpath; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4055 if test -n "$hardcode_libdir_flag_spec"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4056 if test -n "$hardcode_libdir_separator"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4057 if test -z "$hardcode_libdirs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4058 hardcode_libdirs="$libdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4059 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4060 # Just accumulate the unique libdirs.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4061 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4062 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4063 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4064 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4065 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4066 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4067 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4068 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4069 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4070 eval flag=\"$hardcode_libdir_flag_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4071 rpath="$rpath $flag"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4072 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4073 elif test -n "$runpath_var"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4074 case "$perm_rpath " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4075 *" $libdir "*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4076 *) perm_rpath="$perm_rpath $libdir" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4077 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4078 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4079 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4080 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4081 case :$dllsearchpath: in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4082 *":$libdir:"*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4083 *) dllsearchpath="$dllsearchpath:$libdir";;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4084 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4085 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4086 esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4087 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4088 # Substitute the hardcoded libdirs into the rpath.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4089 if test -n "$hardcode_libdir_separator" &&
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4090 test -n "$hardcode_libdirs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4091 libdir="$hardcode_libdirs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4092 eval rpath=\" $hardcode_libdir_flag_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4093 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4094 compile_rpath="$rpath"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4095
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4096 rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4097 hardcode_libdirs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4098 for libdir in $finalize_rpath; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4099 if test -n "$hardcode_libdir_flag_spec"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4100 if test -n "$hardcode_libdir_separator"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4101 if test -z "$hardcode_libdirs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4102 hardcode_libdirs="$libdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4103 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4104 # Just accumulate the unique libdirs.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4105 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4106 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4107 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4108 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4109 hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4110 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4111 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4112 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4113 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4114 eval flag=\"$hardcode_libdir_flag_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4115 rpath="$rpath $flag"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4116 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4117 elif test -n "$runpath_var"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4118 case "$finalize_perm_rpath " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4119 *" $libdir "*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4120 *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4121 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4122 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4123 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4124 # Substitute the hardcoded libdirs into the rpath.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4125 if test -n "$hardcode_libdir_separator" &&
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4126 test -n "$hardcode_libdirs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4127 libdir="$hardcode_libdirs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4128 eval rpath=\" $hardcode_libdir_flag_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4129 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4130 finalize_rpath="$rpath"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4131
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4132 if test -n "$libobjs" && test "$build_old_libs" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4133 # Transform all the library objects into standard objects.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4134 compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4135 finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4136 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4137
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4138 dlsyms=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4139 if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4140 if test -n "$NM" && test -n "$global_symbol_pipe"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4141 dlsyms="${outputname}S.c"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4142 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4143 $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4144 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4145 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4146
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4147 if test -n "$dlsyms"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4148 case $dlsyms in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4149 "") ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4150 *.c)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4151 # Discover the nlist of each of the dlfiles.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4152 nlist="$output_objdir/${outputname}.nm"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4153
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4154 $show "$rm $nlist ${nlist}S ${nlist}T"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4155 $run $rm "$nlist" "${nlist}S" "${nlist}T"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4156
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4157 # Parse the name list into a source file.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4158 $show "creating $output_objdir/$dlsyms"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4159
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4160 test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4161 /* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4162 /* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4163
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4164 #ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4165 extern \"C\" {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4166 #endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4167
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4168 /* Prevent the only kind of declaration conflicts we can make. */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4169 #define lt_preloaded_symbols some_other_symbol
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4170
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4171 /* External symbol declarations for the compiler. */\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4172 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4173
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4174 if test "$dlself" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4175 $show "generating symbol list for \`$output'"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4176
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4177 test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4178
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4179 # 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
4180 progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4181 for arg in $progfiles; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4182 $show "extracting global C symbols from \`$arg'"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4183 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4184 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4185
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4186 if test -n "$exclude_expsyms"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4187 $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4188 $run eval '$mv "$nlist"T "$nlist"'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4189 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4190
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4191 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
4192 $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4193 $run eval '$mv "$nlist"T "$nlist"'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4194 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4195
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4196 # Prepare the list of exported symbols
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4197 if test -z "$export_symbols"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4198 export_symbols="$output_objdir/$output.exp"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4199 $run $rm $export_symbols
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4200 $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4201 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4202 $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4203 $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4204 $run eval 'mv "$nlist"T "$nlist"'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4205 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4206 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4207
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4208 for arg in $dlprefiles; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4209 $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
4210 name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4211 $run eval '$echo ": $name " >> "$nlist"'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4212 $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4213 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4214
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4215 if test -z "$run"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4216 # Make sure we have at least an empty file.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4217 test -f "$nlist" || : > "$nlist"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4218
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4219 if test -n "$exclude_expsyms"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4220 $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4221 $mv "$nlist"T "$nlist"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4222 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4223
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4224 # Try sorting and uniquifying the output.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4225 if grep -v "^: " < "$nlist" |
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4226 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
4227 sort -k 3
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4228 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4229 sort +2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4230 fi |
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4231 uniq > "$nlist"S; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4232 :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4233 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4234 grep -v "^: " < "$nlist" > "$nlist"S
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4235 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4236
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4237 if test -f "$nlist"S; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4238 eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4239 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4240 $echo '/* NONE */' >> "$output_objdir/$dlsyms"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4241 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4242
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4243 $echo >> "$output_objdir/$dlsyms" "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4244
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4245 #undef lt_preloaded_symbols
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4246
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4247 #if defined (__STDC__) && __STDC__
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4248 # define lt_ptr void *
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4249 #else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4250 # define lt_ptr char *
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4251 # define const
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4252 #endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4253
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4254 /* The mapping between symbol names and symbols. */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4255 const struct {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4256 const char *name;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4257 lt_ptr address;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4258 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4259 lt_preloaded_symbols[] =
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4260 {\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4261 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4262
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4263 eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4264
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4265 $echo >> "$output_objdir/$dlsyms" "\
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4266 {0, (lt_ptr) 0}
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4267 };
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4268
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4269 /* This works around a problem in FreeBSD linker */
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4270 #ifdef FREEBSD_WORKAROUND
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4271 static const void *lt_preloaded_setup() {
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4272 return lt_preloaded_symbols;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4273 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4274 #endif
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4275
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4276 #ifdef __cplusplus
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4277 }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4278 #endif\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4279 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4280 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4281
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4282 pic_flag_for_symtable=
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4283 case $host in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4284 # compiling the symbol table file with pic_flag works around
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4285 # a FreeBSD bug that causes programs to crash when -lm is
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4286 # linked before any other PIC object. But we must not use
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4287 # pic_flag when linking with -static. The problem exists in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4288 # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4289 *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4290 case "$compile_command " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4291 *" -static "*) ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4292 *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4293 esac;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4294 *-*-hpux*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4295 case "$compile_command " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4296 *" -static "*) ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4297 *) pic_flag_for_symtable=" $pic_flag";;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4298 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4299 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4300
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4301 # Now compile the dynamic symbol file.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4302 $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
4303 $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4304
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4305 # Clean up the generated files.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4306 $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4307 $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4308
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4309 # Transform the symbol file into the correct name.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4310 compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4311 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4312 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4313 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4314 $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4315 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4316 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4317 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4318 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4319 # We keep going just in case the user didn't refer to
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4320 # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4321 # really was required.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4322
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4323 # Nullify the symbol file.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4324 compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4325 finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4326 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4327
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4328 if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4329 # Replace the output file specification.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4330 compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4331 link_command="$compile_command$compile_rpath"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4332
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4333 # We have no uninstalled library dependencies, so finalize right now.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4334 $show "$link_command"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4335 $run eval "$link_command"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4336 status=$?
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4337
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4338 # Delete the generated files.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4339 if test -n "$dlsyms"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4340 $show "$rm $output_objdir/${outputname}S.${objext}"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4341 $run $rm "$output_objdir/${outputname}S.${objext}"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4342 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4343
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4344 exit $status
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4345 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4346
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4347 if test -n "$shlibpath_var"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4348 # We should set the shlibpath_var
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4349 rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4350 for dir in $temp_rpath; do
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4351 case $dir in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4352 [\\/]* | [A-Za-z]:[\\/]*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4353 # Absolute path.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4354 rpath="$rpath$dir:"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4355 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4356 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4357 # Relative path: add a thisdir entry.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4358 rpath="$rpath\$thisdir/$dir:"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4359 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4360 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4361 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4362 temp_rpath="$rpath"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4363 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4364
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4365 if test -n "$compile_shlibpath$finalize_shlibpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4366 compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4367 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4368 if test -n "$finalize_shlibpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4369 finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4370 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4371
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4372 compile_var=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4373 finalize_var=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4374 if test -n "$runpath_var"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4375 if test -n "$perm_rpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4376 # We should set the runpath_var.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4377 rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4378 for dir in $perm_rpath; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4379 rpath="$rpath$dir:"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4380 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4381 compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4382 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4383 if test -n "$finalize_perm_rpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4384 # We should set the runpath_var.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4385 rpath=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4386 for dir in $finalize_perm_rpath; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4387 rpath="$rpath$dir:"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4388 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4389 finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4390 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4391 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4392
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4393 if test "$no_install" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4394 # 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
4395 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
4396 # Replace the output file specification.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4397 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
4398 # Delete the old output file.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4399 $run $rm $output
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4400 # Link the executable and exit
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4401 $show "$link_command"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4402 $run eval "$link_command" || exit $?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4403 exit 0
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4404 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4405
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4406 if test "$hardcode_action" = relink; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4407 # Fast installation is not supported
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4408 link_command="$compile_var$compile_command$compile_rpath"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4409 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
4410
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4411 $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4412 $echo "$modename: \`$output' will be relinked during installation" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4413 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4414 if test "$fast_install" != no; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4415 link_command="$finalize_var$compile_command$finalize_rpath"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4416 if test "$fast_install" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4417 relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4418 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4419 # fast_install is set to needless
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4420 relink_command=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4421 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4422 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4423 link_command="$compile_var$compile_command$compile_rpath"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4424 relink_command="$finalize_var$finalize_command$finalize_rpath"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4425 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4426 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4427
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4428 # Replace the output file specification.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4429 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
4430
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4431 # Delete the old output files.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4432 $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4433
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4434 $show "$link_command"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4435 $run eval "$link_command" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4436
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4437 # Now create the wrapper script.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4438 $show "creating $output"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4439
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4440 # Quote the relink command for shipping.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4441 if test -n "$relink_command"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4442 # 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
4443 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
4444 if eval test -z \"\${$var+set}\"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4445 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
4446 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
4447 relink_command="$var=; export $var; $relink_command"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4448 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4449 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
4450 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
4451 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4452 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4453 relink_command="(cd `pwd`; $relink_command)"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4454 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4455 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4456
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4457 # Quote $echo for shipping.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4458 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
4459 case $0 in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4460 [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4461 *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4462 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4463 qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4464 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4465 qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4466 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4467
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4468 # Only actually do things if our run command is non-null.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4469 if test -z "$run"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4470 # win32 will think the script is a binary if it has
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4471 # a .exe suffix, so we strip it off here.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4472 case $output in
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4473 *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4474 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4475 # 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
4476 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4477 *cygwin*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4478 exeext=.exe
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4479 outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4480 *) exeext= ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4481 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4482 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4483 *cygwin* | *mingw* )
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4484 cwrappersource=`$echo ${objdir}/lt-${output}.c`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4485 cwrapper=`$echo ${output}.exe`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4486 $rm $cwrappersource $cwrapper
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4487 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
4488
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4489 cat > $cwrappersource <<EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4490
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4491 /* $cwrappersource - temporary wrapper executable for $objdir/$outputname
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4492 Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4493
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4494 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
4495 libraries that it depends on are installed.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4496
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4497 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
4498 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
4499
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4500 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
4501 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
4502 exec $objdir/$outputname directly.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4503 */
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4504 EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4505 cat >> $cwrappersource<<"EOF"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4506 #include <stdio.h>
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4507 #include <stdlib.h>
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4508 #include <unistd.h>
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4509 #include <malloc.h>
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4510 #include <stdarg.h>
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4511 #include <assert.h>
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4512 #include <sys/stat.h>
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4513
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4514 #if defined(PATH_MAX)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4515 # define LT_PATHMAX PATH_MAX
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4516 #elif defined(MAXPATHLEN)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4517 # define LT_PATHMAX MAXPATHLEN
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4518 #else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4519 # define LT_PATHMAX 1024
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4520 #endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4521
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4522 #ifndef DIR_SEPARATOR
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4523 # define DIR_SEPARATOR '/'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4524 # define PATH_SEPARATOR ':'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4525 #endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4526
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4527 #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4528 defined (__OS2__)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4529 # define HAVE_DOS_BASED_FILE_SYSTEM
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4530 # ifndef DIR_SEPARATOR_2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4531 # define DIR_SEPARATOR_2 '\\'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4532 # endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4533 # ifndef PATH_SEPARATOR_2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4534 # define PATH_SEPARATOR_2 ';'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4535 # endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4536 #endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4537
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4538 #ifndef DIR_SEPARATOR_2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4539 # 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
4540 #else /* DIR_SEPARATOR_2 */
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4541 # define IS_DIR_SEPARATOR(ch) \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4542 (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4543 #endif /* DIR_SEPARATOR_2 */
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4544
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4545 #ifndef PATH_SEPARATOR_2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4546 # 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
4547 #else /* PATH_SEPARATOR_2 */
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4548 # 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
4549 #endif /* PATH_SEPARATOR_2 */
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 #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
4552 #define XFREE(stale) do { \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4553 if (stale) { free ((void *) stale); stale = 0; } \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4554 } while (0)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4555
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4556 #if defined DEBUGWRAPPER
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4557 # 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
4558 #else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4559 # define DEBUG(format, ...)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4560 #endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4561
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4562 const char *program_name = NULL;
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 void * xmalloc (size_t num);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4565 char * xstrdup (const char *string);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4566 char * basename (const char *name);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4567 char * find_executable(const char *wrapper);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4568 int check_executable(const char *path);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4569 char * strendzap(char *str, const char *pat);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4570 void lt_fatal (const char *message, ...);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4571
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4572 int
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4573 main (int argc, char *argv[])
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4574 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4575 char **newargz;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4576 int i;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4577
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4578 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
4579 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
4580 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
4581 newargz = XMALLOC(char *, argc+2);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4582 EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4583
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4584 cat >> $cwrappersource <<EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4585 newargz[0] = "$SHELL";
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4586 EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4587
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4588 cat >> $cwrappersource <<"EOF"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4589 newargz[1] = find_executable(argv[0]);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4590 if (newargz[1] == NULL)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4591 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
4592 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
4593 /* 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
4594 /* 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
4595 strendzap(newargz[1],".exe");
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4596 for (i = 1; i < argc; i++)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4597 newargz[i+1] = xstrdup(argv[i]);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4598 newargz[argc+1] = NULL;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4599
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4600 for (i=0; i<argc+1; i++)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4601 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4602 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
4603 ;
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4606 EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4607
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4608 cat >> $cwrappersource <<EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4609 execv("$SHELL",newargz);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4610 EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4611
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4612 cat >> $cwrappersource <<"EOF"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4613 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4614
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4615 void *
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4616 xmalloc (size_t num)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4617 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4618 void * p = (void *) malloc (num);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4619 if (!p)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4620 lt_fatal ("Memory exhausted");
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 return p;
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4625 char *
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4626 xstrdup (const char *string)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4627 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4628 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
4629 ;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4630 }
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 char *
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4633 basename (const char *name)
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 const char *base;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4636
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4637 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4638 /* 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
4639 if (isalpha (name[0]) && name[1] == ':')
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4640 name += 2;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4641 #endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4642
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4643 for (base = name; *name; name++)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4644 if (IS_DIR_SEPARATOR (*name))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4645 base = name + 1;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4646 return (char *) base;
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4649 int
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4650 check_executable(const char * path)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4651 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4652 struct stat st;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4653
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4654 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
4655 if ((!path) || (!*path))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4656 return 0;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4657
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4658 if ((stat (path, &st) >= 0) &&
730
0f4f974d0201 Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents: 729
diff changeset
4659 (
0f4f974d0201 Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents: 729
diff changeset
4660 #ifdef S_IXOTH
0f4f974d0201 Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents: 729
diff changeset
4661 ((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
4662 #endif
0f4f974d0201 Use a unique base address for each DLL.
Sam Lantinga <slouken@libsdl.org>
parents: 729
diff changeset
4663 #ifdef S_IXGRP
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4664 ((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
4665 #endif
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4666 ((st.st_mode & S_IXUSR) == S_IXUSR)))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4667 return 1;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4668 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4669 return 0;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4670 }
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 /* 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
4673 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
4674 char *
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4675 find_executable (const char* wrapper)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4676 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4677 int has_slash = 0;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4678 const char* p;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4679 const char* p_next;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4680 struct stat st;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4681 /* static buffer for getcwd */
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4682 char tmp[LT_PATHMAX + 1];
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4683 int tmp_len;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4684 char* concat_name;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4685
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4686 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
4687
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4688 if ((wrapper == NULL) || (*wrapper == '\0'))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4689 return NULL;
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 /* Absolute path? */
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4692 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4693 if (isalpha (wrapper[0]) && wrapper[1] == ':')
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 concat_name = xstrdup (wrapper);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4696 if (check_executable(concat_name))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4697 return concat_name;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4698 XFREE(concat_name);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4699 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4700 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4701 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4702 #endif
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4703 if (IS_DIR_SEPARATOR (wrapper[0]))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4704 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4705 concat_name = xstrdup (wrapper);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4706 if (check_executable(concat_name))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4707 return concat_name;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4708 XFREE(concat_name);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4709 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4710 #if defined (HAVE_DOS_BASED_FILE_SYSTEM)
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 #endif
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 for (p = wrapper; *p; p++)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4715 if (*p == '/')
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4716 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4717 has_slash = 1;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4718 break;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4719 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4720 if (!has_slash)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4721 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4722 /* no slashes; search PATH */
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4723 const char* path = getenv ("PATH");
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4724 if (path != NULL)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4725 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4726 for (p = path; *p; p = p_next)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4727 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4728 const char* q;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4729 size_t p_len;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4730 for (q = p; *q; q++)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4731 if (IS_PATH_SEPARATOR(*q))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4732 break;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4733 p_len = q - p;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4734 p_next = (*q == '\0' ? q : q + 1);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4735 if (p_len == 0)
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 /* empty path: current directory */
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4738 if (getcwd (tmp, LT_PATHMAX) == NULL)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4739 lt_fatal ("getcwd failed");
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4740 tmp_len = strlen(tmp);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4741 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
4742 memcpy (concat_name, tmp, tmp_len);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4743 concat_name[tmp_len] = '/';
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4744 strcpy (concat_name + tmp_len + 1, wrapper);
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 else
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 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
4749 memcpy (concat_name, p, p_len);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4750 concat_name[p_len] = '/';
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4751 strcpy (concat_name + p_len + 1, wrapper);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4752 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4753 if (check_executable(concat_name))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4754 return concat_name;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4755 XFREE(concat_name);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4756 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4757 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4758 /* not found in PATH; assume curdir */
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 /* 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
4761 if (getcwd (tmp, LT_PATHMAX) == NULL)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4762 lt_fatal ("getcwd failed");
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4763 tmp_len = strlen(tmp);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4764 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
4765 memcpy (concat_name, tmp, tmp_len);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4766 concat_name[tmp_len] = '/';
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4767 strcpy (concat_name + tmp_len + 1, wrapper);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4768
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4769 if (check_executable(concat_name))
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4770 return concat_name;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4771 XFREE(concat_name);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4772 return NULL;
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4775 char *
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4776 strendzap(char *str, const char *pat)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4777 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4778 size_t len, patlen;
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 assert(str != NULL);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4781 assert(pat != NULL);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4782
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4783 len = strlen(str);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4784 patlen = strlen(pat);
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 if (patlen <= len)
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 str += len - patlen;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4789 if (strcmp(str, pat) == 0)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4790 *str = '\0';
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4791 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4792 return str;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4793 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4794
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4795 static void
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4796 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
4797 const char * message, va_list ap)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4798 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4799 fprintf (stderr, "%s: %s: ", program_name, mode);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4800 vfprintf (stderr, message, ap);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4801 fprintf (stderr, ".\n");
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4802
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4803 if (exit_status >= 0)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4804 exit (exit_status);
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
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4807 void
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4808 lt_fatal (const char *message, ...)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4809 {
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4810 va_list ap;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4811 va_start (ap, message);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4812 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
4813 va_end (ap);
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4814 }
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4815 EOF
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4816 # 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
4817 # 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
4818 # 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
4819 # 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
4820 # 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
4821 $run $LTCC -s -o $cwrapper $cwrappersource
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4822 ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4823 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4824 $rm $output
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4825 trap "$rm $output; exit 1" 1 2 15
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4826
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4827 $echo > $output "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4828 #! $SHELL
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4829
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4830 # $output - temporary wrapper script for $objdir/$outputname
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4831 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4832 #
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4833 # The $output program cannot be directly executed until all the libtool
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4834 # libraries that it depends on are installed.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4835 #
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4836 # This wrapper script should never be moved out of the build directory.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4837 # If it is, it will not operate correctly.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4838
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4839 # Sed substitution that helps us do robust quoting. It backslashifies
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4840 # 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
4841 Xsed='${SED} -e 1s/^X//'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4842 sed_quote_subst='$sed_quote_subst'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4843
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4844 # The HP-UX ksh and POSIX shell print the target directory to stdout
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4845 # if CDPATH is set.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4846 if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4847
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4848 relink_command=\"$relink_command\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4849
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4850 # This environment variable determines our operation mode.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4851 if test \"\$libtool_install_magic\" = \"$magic\"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4852 # install mode needs the following variable:
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4853 notinst_deplibs='$notinst_deplibs'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4854 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4855 # When we are sourced in execute mode, \$file and \$echo are already set.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4856 if test \"\$libtool_execute_magic\" != \"$magic\"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4857 echo=\"$qecho\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4858 file=\"\$0\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4859 # Make sure echo works.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4860 if test \"X\$1\" = X--no-reexec; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4861 # Discard the --no-reexec flag, and continue.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4862 shift
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4863 elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4864 # Yippee, \$echo works!
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4865 :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4866 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4867 # Restart under the correct shell, and then maybe \$echo will work.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4868 exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4869 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4870 fi\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4871 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4872 $echo >> $output "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4873
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4874 # Find the directory that this script lives in.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4875 thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4876 test \"x\$thisdir\" = \"x\$file\" && thisdir=.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4877
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4878 # 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
4879 file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4880 while test -n \"\$file\"; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4881 destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4882
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4883 # If there was a directory component, then change thisdir.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4884 if test \"x\$destdir\" != \"x\$file\"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4885 case \"\$destdir\" in
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4886 [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4887 *) thisdir=\"\$thisdir/\$destdir\" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4888 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4889 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4890
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4891 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
4892 file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4893 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4894
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4895 # Try to get the absolute directory name.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4896 absdir=\`cd \"\$thisdir\" && pwd\`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4897 test -n \"\$absdir\" && thisdir=\"\$absdir\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4898 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4899
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4900 if test "$fast_install" = yes; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4901 $echo >> $output "\
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4902 program=lt-'$outputname'$exeext
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4903 progdir=\"\$thisdir/$objdir\"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4904
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4905 if test ! -f \"\$progdir/\$program\" || \\
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4906 { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4907 test \"X\$file\" != \"X\$progdir/\$program\"; }; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4908
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4909 file=\"\$\$-\$program\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4910
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4911 if test ! -d \"\$progdir\"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4912 $mkdir \"\$progdir\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4913 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4914 $rm \"\$progdir/\$file\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4915 fi"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4916
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4917 $echo >> $output "\
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4918
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4919 # relink executable if necessary
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4920 if test -n \"\$relink_command\"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4921 if relink_command_output=\`eval \$relink_command 2>&1\`; then :
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4922 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4923 $echo \"\$relink_command_output\" >&2
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4924 $rm \"\$progdir/\$file\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4925 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4926 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4927 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4928
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4929 $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4930 { $rm \"\$progdir/\$program\";
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4931 $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4932 $rm \"\$progdir/\$file\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4933 fi"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4934 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4935 $echo >> $output "\
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4936 program='$outputname'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4937 progdir=\"\$thisdir/$objdir\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4938 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4939 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4940
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4941 $echo >> $output "\
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4942
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4943 if test -f \"\$progdir/\$program\"; then"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4944
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4945 # Export our shlibpath_var if we have one.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4946 if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4947 $echo >> $output "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4948 # Add our own library path to $shlibpath_var
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4949 $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4950
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4951 # Some systems cannot cope with colon-terminated $shlibpath_var
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4952 # The second colon is a workaround for a bug in BeOS R4 sed
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4953 $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4954
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4955 export $shlibpath_var
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4956 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4957 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4958
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4959 # fixup the dll searchpath if we need to.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4960 if test -n "$dllsearchpath"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4961 $echo >> $output "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4962 # Add the dll search path components to the executable PATH
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4963 PATH=$dllsearchpath:\$PATH
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4964 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4965 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4966
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4967 $echo >> $output "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4968 if test \"\$libtool_execute_magic\" != \"$magic\"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4969 # Run the actual program with our arguments.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4970 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4971 case $host in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4972 # Backslashes separate directories on plain windows
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4973 *-*-mingw | *-*-os2*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4974 $echo >> $output "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4975 exec \$progdir\\\\\$program \${1+\"\$@\"}
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4976 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4977 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4978
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4979 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4980 $echo >> $output "\
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
4981 exec \$progdir/\$program \${1+\"\$@\"}
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4982 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4983 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4984 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4985 $echo >> $output "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4986 \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4987 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4988 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4989 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4990 # The program doesn't exist.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4991 \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4992 \$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
4993 $echo \"See the $PACKAGE documentation for more information.\" 1>&2
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4994 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4995 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4996 fi\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4997 "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4998 chmod +x $output
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4999 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5000 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5001 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5002 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5003
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5004 # See if we need to build an old-fashioned archive.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5005 for oldlib in $oldlibs; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5006
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5007 if test "$build_libtool_libs" = convenience; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5008 oldobjs="$libobjs_save"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5009 addlibs="$convenience"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5010 build_libtool_libs=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5011 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5012 if test "$build_libtool_libs" = module; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5013 oldobjs="$libobjs_save"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5014 build_libtool_libs=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5015 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5016 oldobjs="$old_deplibs $non_pic_objects"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5017 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5018 addlibs="$old_convenience"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5019 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5020
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5021 if test -n "$addlibs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5022 gentop="$output_objdir/${outputname}x"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5023 $show "${rm}r $gentop"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5024 $run ${rm}r "$gentop"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5025 $show "$mkdir $gentop"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5026 $run $mkdir "$gentop"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5027 status=$?
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5028 if test "$status" -ne 0 && test ! -d "$gentop"; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5029 exit $status
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5030 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5031 generated="$generated $gentop"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5032
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5033 # Add in members from convenience archives.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5034 for xlib in $addlibs; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5035 # Extract the objects.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5036 case $xlib in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5037 [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5038 *) xabs=`pwd`"/$xlib" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5039 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5040 xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5041 xdir="$gentop/$xlib"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5042
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5043 $show "${rm}r $xdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5044 $run ${rm}r "$xdir"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5045 $show "$mkdir $xdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5046 $run $mkdir "$xdir"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5047 status=$?
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5048 if test "$status" -ne 0 && test ! -d "$xdir"; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5049 exit $status
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5050 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5051 # 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
5052 # 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
5053 # automatically by $AR in one run.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5054 $show "(cd $xdir && $AR x $xabs)"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5055 $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
5056 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
5057 :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5058 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5059 $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
5060 $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
5061 $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
5062 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5063 i=1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5064 while test "$i" -le "$count"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5065 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5066 # 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
5067 # Never overwrite any file
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5068 name_to="$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5069 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
5070 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5071 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
5072 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5073 $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
5074 $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
5075 i=`expr $i + 1`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5076 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5077 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5078 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5079
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5080 oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5081 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5082 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5083
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5084 # Do each command in the archive commands.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5085 if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5086 eval cmds=\"$old_archive_from_new_cmds\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5087 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5088 eval cmds=\"$old_archive_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5089
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5090 if len=`expr "X$cmds" : ".*"` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5091 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
5092 :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5093 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5094 # 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
5095 $echo "using piecewise archive linking..."
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5096 save_RANLIB=$RANLIB
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5097 RANLIB=:
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5098 objlist=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5099 concat_cmds=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5100 save_oldobjs=$oldobjs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5101 # 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
5102 # 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
5103 # this piecewise linking case whenever conflicting object
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5104 # 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
5105 if (for obj in $save_oldobjs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5106 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5107 $echo "X$obj" | $Xsed -e 's%^.*/%%'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5108 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
5109 :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5110 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5111 $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
5112 $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
5113 AR_FLAGS=cq
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5114 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5115 # 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
5116 for obj in $save_oldobjs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5117 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5118 last_oldobj=$obj
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5119 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5120 for obj in $save_oldobjs
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5121 do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5122 oldobjs="$objlist $obj"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5123 objlist="$objlist $obj"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5124 eval test_cmds=\"$old_archive_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5125 if len=`expr "X$test_cmds" : ".*"` &&
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5126 test "$len" -le "$max_cmd_len"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5127 :
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5128 else
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5129 # 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
5130 oldobjs=$objlist
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5131 if test "$obj" = "$last_oldobj" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5132 RANLIB=$save_RANLIB
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5133 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5134 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
5135 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
5136 objlist=
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5137 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5138 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5139 RANLIB=$save_RANLIB
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5140 oldobjs=$objlist
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5141 if test "X$oldobjs" = "X" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5142 eval cmds=\"\$concat_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5143 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5144 eval cmds=\"\$concat_cmds~$old_archive_cmds\"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5145 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5146 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5147 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5148 save_ifs="$IFS"; IFS='~'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5149 for cmd in $cmds; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5150 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5151 $show "$cmd"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5152 $run eval "$cmd" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5153 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5154 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5155 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5156
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5157 if test -n "$generated"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5158 $show "${rm}r$generated"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5159 $run ${rm}r$generated
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5160 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5161
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5162 # Now create the libtool archive.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5163 case $output in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5164 *.la)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5165 old_library=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5166 test "$build_old_libs" = yes && old_library="$libname.$libext"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5167 $show "creating $output"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5168
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5169 # 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
5170 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
5171 if eval test -z \"\${$var+set}\"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5172 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
5173 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
5174 relink_command="$var=; export $var; $relink_command"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5175 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5176 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
5177 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
5178 fi
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 # Quote the link command for shipping.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5181 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
5182 relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5183
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5184 # Only create the output if not a dry run.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5185 if test -z "$run"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5186 for installed in no yes; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5187 if test "$installed" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5188 if test -z "$install_libdir"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5189 break
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5190 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5191 output="$output_objdir/$outputname"i
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5192 # 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
5193 newdependency_libs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5194 for deplib in $dependency_libs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5195 case $deplib in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5196 *.la)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5197 name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5198 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
5199 if test -z "$libdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5200 $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
5201 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5202 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5203 newdependency_libs="$newdependency_libs $libdir/$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5204 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5205 *) newdependency_libs="$newdependency_libs $deplib" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5206 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5207 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5208 dependency_libs="$newdependency_libs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5209 newdlfiles=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5210 for lib in $dlfiles; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5211 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5212 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
5213 if test -z "$libdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5214 $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
5215 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5216 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5217 newdlfiles="$newdlfiles $libdir/$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5218 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5219 dlfiles="$newdlfiles"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5220 newdlprefiles=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5221 for lib in $dlprefiles; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5222 name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5223 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
5224 if test -z "$libdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5225 $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
5226 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5227 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5228 newdlprefiles="$newdlprefiles $libdir/$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5229 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5230 dlprefiles="$newdlprefiles"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5231 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5232 $rm $output
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5233 # place dlname in correct position for cygwin
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5234 tdlname=$dlname
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5235 case $host,$output,$installed,$module,$dlname in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5236 *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
5237 esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5238 $echo > $output "\
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5239 # $outputname - a libtool library file
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5240 # Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5241 #
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5242 # Please DO NOT delete this file!
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5243 # It is necessary for linking the library.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5244
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5245 # 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
5246 dlname='$tdlname'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5247
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5248 # Names of this library.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5249 library_names='$library_names'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5250
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5251 # The name of the static archive.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5252 old_library='$old_library'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5253
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5254 # Libraries that this one depends upon.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5255 dependency_libs='$dependency_libs'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5256
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5257 # Version information for $libname.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5258 current=$current
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5259 age=$age
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5260 revision=$revision
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5261
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5262 # Is this an already installed library?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5263 installed=$installed
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5264
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5265 # 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
5266 shouldnotlink=$module
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5267
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5268 # Files to dlopen/dlpreopen
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5269 dlopen='$dlfiles'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5270 dlpreopen='$dlprefiles'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5271
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5272 # 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
5273 libdir='$install_libdir'"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5274 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
5275 $echo >> $output "\
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5276 relink_command=\"$relink_command\""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5277 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5278 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5279 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5280
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5281 # Do a symbolic link so that the libtool archive can be found in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5282 # LD_LIBRARY_PATH before the program is installed.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5283 $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
5284 $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5285 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5286 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5287 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5288 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5289
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5290 # libtool install mode
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5291 install)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5292 modename="$modename: install"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5293
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5294 # There may be an optional sh(1) argument at the beginning of
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5295 # install_prog (especially on Windows NT).
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5296 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
5297 # 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
5298 $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5299 # Aesthetically quote it.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5300 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
5301 case $arg in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5302 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5303 arg="\"$arg\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5304 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5305 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5306 install_prog="$arg "
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5307 arg="$1"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5308 shift
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5309 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5310 install_prog=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5311 arg="$nonopt"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5312 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5313
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5314 # The real first argument should be the name of the installation program.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5315 # Aesthetically quote it.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5316 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
5317 case $arg in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5318 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5319 arg="\"$arg\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5320 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5321 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5322 install_prog="$install_prog$arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5323
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5324 # We need to accept at least all the BSD install flags.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5325 dest=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5326 files=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5327 opts=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5328 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5329 install_type=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5330 isdir=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5331 stripme=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5332 for arg
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5333 do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5334 if test -n "$dest"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5335 files="$files $dest"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5336 dest="$arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5337 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5338 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5339
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5340 case $arg in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5341 -d) isdir=yes ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5342 -f) prev="-f" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5343 -g) prev="-g" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5344 -m) prev="-m" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5345 -o) prev="-o" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5346 -s)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5347 stripme=" -s"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5348 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5349 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5350 -*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5351
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5352 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5353 # If the previous option needed an argument, then skip it.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5354 if test -n "$prev"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5355 prev=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5356 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5357 dest="$arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5358 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5359 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5360 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5361 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5362
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5363 # Aesthetically quote the argument.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5364 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
5365 case $arg in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5366 *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5367 arg="\"$arg\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5368 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5369 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5370 install_prog="$install_prog $arg"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5371 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5372
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5373 if test -z "$install_prog"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5374 $echo "$modename: you must specify an install program" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5375 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5376 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5377 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5378
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5379 if test -n "$prev"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5380 $echo "$modename: the \`$prev' option requires an argument" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5381 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5382 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5383 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5384
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5385 if test -z "$files"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5386 if test -z "$dest"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5387 $echo "$modename: no file or destination specified" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5388 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5389 $echo "$modename: you must specify a destination" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5390 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5391 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5392 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5393 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5394
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5395 # Strip any trailing slash from the destination.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5396 dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5397
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5398 # Check to see that the destination is a directory.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5399 test -d "$dest" && isdir=yes
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5400 if test "$isdir" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5401 destdir="$dest"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5402 destname=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5403 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5404 destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5405 test "X$destdir" = "X$dest" && destdir=.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5406 destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5407
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5408 # Not a directory, so check to see that there is only one file specified.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5409 set dummy $files
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5410 if test "$#" -gt 2; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5411 $echo "$modename: \`$dest' is not a directory" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5412 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5413 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5414 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5415 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5416 case $destdir in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5417 [\\/]* | [A-Za-z]:[\\/]*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5418 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5419 for file in $files; do
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5420 case $file in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5421 *.lo) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5422 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5423 $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5424 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5425 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5426 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5427 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5428 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5429 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5430 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5431
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5432 # This variable tells wrapper scripts just to set variables rather
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5433 # than running their programs.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5434 libtool_install_magic="$magic"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5435
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5436 staticlibs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5437 future_libdirs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5438 current_libdirs=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5439 for file in $files; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5440
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5441 # Do each installation.
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5442 case $file in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5443 *.$libext)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5444 # Do the static libraries later.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5445 staticlibs="$staticlibs $file"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5446 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5447
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5448 *.la)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5449 # 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
5450 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5451 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5452 $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5453 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5454 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5455 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5456
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5457 library_names=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5458 old_library=
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5459 relink_command=
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5460 # 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
5461 case $file in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5462 */* | *\\*) . $file ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5463 *) . ./$file ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5464 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5465
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5466 # Add the libdir to current_libdirs if it is the destination.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5467 if test "X$destdir" = "X$libdir"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5468 case "$current_libdirs " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5469 *" $libdir "*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5470 *) current_libdirs="$current_libdirs $libdir" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5471 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5472 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5473 # Note the libdir as a future libdir.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5474 case "$future_libdirs " in
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5475 *" $libdir "*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5476 *) future_libdirs="$future_libdirs $libdir" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5477 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5478 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5479
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5480 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5481 test "X$dir" = "X$file/" && dir=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5482 dir="$dir$objdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5483
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5484 if test -n "$relink_command"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5485 # 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
5486 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
5487
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5488 # 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
5489 # 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
5490 # are installed to the same prefix.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5491 # 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
5492 # 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
5493 # 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
5494 if test "$inst_prefix_dir" = "$destdir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5495 $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
5496 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5497 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5498
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5499 if test -n "$inst_prefix_dir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5500 # 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
5501 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
5502 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5503 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
5504 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5505
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5506 $echo "$modename: warning: relinking \`$file'" 1>&2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5507 $show "$relink_command"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5508 if $run eval "$relink_command"; then :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5509 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5510 $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
5511 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5512 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5513 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5514
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5515 # See the names of the shared library.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5516 set dummy $library_names
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5517 if test -n "$2"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5518 realname="$2"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5519 shift
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5520 shift
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5521
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5522 srcname="$realname"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5523 test -n "$relink_command" && srcname="$realname"T
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5524
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5525 # 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
5526 $show "$install_prog $dir/$srcname $destdir/$realname"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5527 $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
5528 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
5529 $show "$striplib $destdir/$realname"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5530 $run eval "$striplib $destdir/$realname" || exit $?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5531 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5532
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5533 if test "$#" -gt 0; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5534 # Delete the old symlinks, and create new ones.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5535 for linkname
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5536 do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5537 if test "$linkname" != "$realname"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5538 $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5539 $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5540 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5541 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5542 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5543
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5544 # Do each command in the postinstall commands.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5545 lib="$destdir/$realname"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5546 eval cmds=\"$postinstall_cmds\"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5547 save_ifs="$IFS"; IFS='~'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5548 for cmd in $cmds; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5549 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5550 $show "$cmd"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5551 $run eval "$cmd" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5552 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5553 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5554 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5555
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5556 # Install the pseudo-library for information purposes.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5557 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5558 instname="$dir/$name"i
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5559 $show "$install_prog $instname $destdir/$name"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5560 $run eval "$install_prog $instname $destdir/$name" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5561
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5562 # Maybe install the static library, too.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5563 test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5564 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5565
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5566 *.lo)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5567 # Install (i.e. copy) a libtool object.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5568
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5569 # Figure out destination file name, if it wasn't already specified.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5570 if test -n "$destname"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5571 destfile="$destdir/$destname"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5572 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5573 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5574 destfile="$destdir/$destfile"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5575 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5576
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5577 # 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
5578 case $destfile in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5579 *.lo)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5580 staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5581 ;;
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5582 *.$objext)
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5583 staticdest="$destfile"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5584 destfile=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5585 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5586 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5587 $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5588 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5589 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5590 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5591 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5592
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5593 # Install the libtool object if requested.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5594 if test -n "$destfile"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5595 $show "$install_prog $file $destfile"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5596 $run eval "$install_prog $file $destfile" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5597 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5598
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5599 # Install the old object if enabled.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5600 if test "$build_old_libs" = yes; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5601 # Deduce the name of the old-style object file.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5602 staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5603
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5604 $show "$install_prog $staticobj $staticdest"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5605 $run eval "$install_prog \$staticobj \$staticdest" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5606 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5607 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5608 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5609
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5610 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5611 # Figure out destination file name, if it wasn't already specified.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5612 if test -n "$destname"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5613 destfile="$destdir/$destname"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5614 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5615 destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5616 destfile="$destdir/$destfile"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5617 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5618
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5619 # 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
5620 # 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
5621 # install
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5622 stripped_ext=""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5623 case $file in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5624 *.exe)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5625 if test ! -f "$file"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5626 file=`$echo $file|${SED} 's,.exe$,,'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5627 stripped_ext=".exe"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5628 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5629 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5630 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5631
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5632 # 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
5633 case $host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5634 *cygwin*|*mingw*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5635 wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5636 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5637 *)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5638 wrapper=$file
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5639 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5640 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5641 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
5642 notinst_deplibs=
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5643 relink_command=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5644
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5645 # 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
5646 # 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
5647 # which disallows the automatic-append-.exe behavior.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5648 case $build in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5649 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5650 *) wrapperdot=${wrapper} ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5651 esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5652 # 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
5653 case $file in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5654 */* | *\\*) . ${wrapperdot} ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5655 *) . ./${wrapperdot} ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5656 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5657
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5658 # 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
5659 if test -z "$notinst_deplibs"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5660 $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5661 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5662 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5663
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5664 finalize=yes
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5665 for lib in $notinst_deplibs; do
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5666 # Check to see that each library is installed.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5667 libdir=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5668 if test -f "$lib"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5669 # 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
5670 case $lib in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5671 */* | *\\*) . $lib ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5672 *) . ./$lib ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5673 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5674 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5675 libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5676 if test -n "$libdir" && test ! -f "$libfile"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5677 $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5678 finalize=no
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5679 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5680 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5681
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5682 relink_command=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5683 # 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
5684 # 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
5685 # which disallows the automatic-append-.exe behavior.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5686 case $build in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5687 *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5688 *) wrapperdot=${wrapper} ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5689 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5690 # 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
5691 case $file in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5692 */* | *\\*) . ${wrapperdot} ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5693 *) . ./${wrapperdot} ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5694 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5695
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5696 outputname=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5697 if test "$fast_install" = no && test -n "$relink_command"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5698 if test "$finalize" = yes && test -z "$run"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5699 tmpdir="/tmp"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5700 test -n "$TMPDIR" && tmpdir="$TMPDIR"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5701 tmpdir="$tmpdir/libtool-$$"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5702 if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5703 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5704 $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5705 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5706 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5707 file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5708 outputname="$tmpdir/$file"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5709 # Replace the output file specification.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5710 relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5711
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5712 $show "$relink_command"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5713 if $run eval "$relink_command"; then :
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5714 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5715 $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5716 ${rm}r "$tmpdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5717 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5718 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5719 file="$outputname"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5720 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5721 $echo "$modename: warning: cannot relink \`$file'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5722 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5723 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5724 # 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
5725 file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5726 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5727 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5728
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5729 # 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
5730 # one anyways
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5731 case $install_prog,$host in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5732 */usr/bin/install*,*cygwin*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5733 case $file:$destfile in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5734 *.exe:*.exe)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5735 # this is ok
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5736 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5737 *.exe:*)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5738 destfile=$destfile.exe
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5739 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5740 *:*.exe)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5741 destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5742 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5743 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5744 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5745 esac
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5746 $show "$install_prog$stripme $file $destfile"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5747 $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5748 test -n "$outputname" && ${rm}r "$tmpdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5749 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5750 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5751 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5752
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5753 for file in $staticlibs; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5754 name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5755
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5756 # Set up the ranlib parameters.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5757 oldlib="$destdir/$name"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5758
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5759 $show "$install_prog $file $oldlib"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5760 $run eval "$install_prog \$file \$oldlib" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5761
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5762 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
5763 $show "$old_striplib $oldlib"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5764 $run eval "$old_striplib $oldlib" || exit $?
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5765 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5766
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5767 # Do each command in the postinstall commands.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5768 eval cmds=\"$old_postinstall_cmds\"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5769 save_ifs="$IFS"; IFS='~'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5770 for cmd in $cmds; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5771 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5772 $show "$cmd"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5773 $run eval "$cmd" || exit $?
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5774 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5775 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5776 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5777
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5778 if test -n "$future_libdirs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5779 $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5780 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5781
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5782 if test -n "$current_libdirs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5783 # Maybe just do a dry run.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5784 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
5785 exec_cmd='$SHELL $0 --finish$current_libdirs'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5786 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5787 exit 0
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5788 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5789 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5790
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5791 # libtool finish mode
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5792 finish)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5793 modename="$modename: finish"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5794 libdirs="$nonopt"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5795 admincmds=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5796
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5797 if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5798 for dir
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5799 do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5800 libdirs="$libdirs $dir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5801 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5802
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5803 for libdir in $libdirs; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5804 if test -n "$finish_cmds"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5805 # Do each command in the finish commands.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5806 eval cmds=\"$finish_cmds\"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5807 save_ifs="$IFS"; IFS='~'
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5808 for cmd in $cmds; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5809 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5810 $show "$cmd"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5811 $run eval "$cmd" || admincmds="$admincmds
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5812 $cmd"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5813 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5814 IFS="$save_ifs"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5815 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5816 if test -n "$finish_eval"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5817 # Do the single finish_eval.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5818 eval cmds=\"$finish_eval\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5819 $run eval "$cmds" || admincmds="$admincmds
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5820 $cmds"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5821 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5822 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5823 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5824
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5825 # Exit here if they wanted silent mode.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5826 test "$show" = : && exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5827
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5828 $echo "----------------------------------------------------------------------"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5829 $echo "Libraries have been installed in:"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5830 for libdir in $libdirs; do
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5831 $echo " $libdir"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5832 done
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5833 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5834 $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
5835 $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
5836 $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
5837 $echo "flag during linking and do at least one of the following:"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5838 if test -n "$shlibpath_var"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5839 $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
5840 $echo " during execution"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5841 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5842 if test -n "$runpath_var"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5843 $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
5844 $echo " during linking"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5845 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5846 if test -n "$hardcode_libdir_flag_spec"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5847 libdir=LIBDIR
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5848 eval flag=\"$hardcode_libdir_flag_spec\"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5849
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5850 $echo " - use the \`$flag' linker flag"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5851 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5852 if test -n "$admincmds"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5853 $echo " - have your system administrator run these commands:$admincmds"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5854 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5855 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
5856 $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5857 fi
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5858 $echo
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5859 $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
5860 $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
5861 $echo "----------------------------------------------------------------------"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5862 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5863 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5864
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5865 # libtool execute mode
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5866 execute)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5867 modename="$modename: execute"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5868
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5869 # The first argument is the command name.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5870 cmd="$nonopt"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5871 if test -z "$cmd"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5872 $echo "$modename: you must specify a COMMAND" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5873 $echo "$help"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5874 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5875 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5876
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5877 # Handle -dlopen flags immediately.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5878 for file in $execute_dlfiles; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5879 if test ! -f "$file"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5880 $echo "$modename: \`$file' is not a file" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5881 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5882 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5883 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5884
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5885 dir=
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5886 case $file in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5887 *.la)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5888 # 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
5889 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5890 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5891 $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5892 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5893 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5894 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5895
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5896 # Read the libtool library.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5897 dlname=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5898 library_names=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5899
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5900 # 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
5901 case $file in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5902 */* | *\\*) . $file ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5903 *) . ./$file ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5904 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5905
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5906 # Skip this library if it cannot be dlopened.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5907 if test -z "$dlname"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5908 # Warn if it was a shared library.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5909 test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5910 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5911 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5912
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5913 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5914 test "X$dir" = "X$file" && dir=.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5915
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5916 if test -f "$dir/$objdir/$dlname"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5917 dir="$dir/$objdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5918 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5919 $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5920 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5921 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5922 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5923
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5924 *.lo)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5925 # Just add the directory containing the .lo file.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5926 dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5927 test "X$dir" = "X$file" && dir=.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5928 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5929
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5930 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5931 $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5932 continue
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5933 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5934 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5935
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5936 # Get the absolute pathname.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5937 absdir=`cd "$dir" && pwd`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5938 test -n "$absdir" && dir="$absdir"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5939
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5940 # Now add the directory to shlibpath_var.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5941 if eval "test -z \"\$$shlibpath_var\""; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5942 eval "$shlibpath_var=\"\$dir\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5943 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5944 eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5945 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5946 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5947
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5948 # This variable tells wrapper scripts just to set shlibpath_var
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5949 # rather than running their programs.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5950 libtool_execute_magic="$magic"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5951
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5952 # Check if any of the arguments is a wrapper script.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5953 args=
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5954 for file
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5955 do
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5956 case $file in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5957 -*) ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5958 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5959 # 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
5960 if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5961 # 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
5962 case $file in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5963 */* | *\\*) . $file ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5964 *) . ./$file ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5965 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5966
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5967 # Transform arg to wrapped name.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5968 file="$progdir/$program"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5969 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5970 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5971 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5972 # Quote arguments (to preserve shell metacharacters).
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5973 file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5974 args="$args \"$file\""
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5975 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5976
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5977 if test -z "$run"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5978 if test -n "$shlibpath_var"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5979 # Export the shlibpath_var.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5980 eval "export $shlibpath_var"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5981 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5982
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5983 # Restore saved environment variables
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5984 if test "${save_LC_ALL+set}" = set; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5985 LC_ALL="$save_LC_ALL"; export LC_ALL
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5986 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5987 if test "${save_LANG+set}" = set; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5988 LANG="$save_LANG"; export LANG
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5989 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5990
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5991 # Now prepare to actually exec the command.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5992 exec_cmd="\$cmd$args"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5993 else
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5994 # Display what would be done.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5995 if test -n "$shlibpath_var"; then
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5996 eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
5997 $echo "export $shlibpath_var"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5998 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
5999 $echo "$cmd$args"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6000 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6001 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6002 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6003
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6004 # libtool clean and uninstall mode
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6005 clean | uninstall)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6006 modename="$modename: $mode"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6007 rm="$nonopt"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6008 files=
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6009 rmforce=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6010 exit_status=0
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6011
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6012 # 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
6013 # than running their programs.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6014 libtool_install_magic="$magic"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6015
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6016 for arg
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6017 do
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6018 case $arg in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6019 -f) rm="$rm $arg"; rmforce=yes ;;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6020 -*) rm="$rm $arg" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6021 *) files="$files $arg" ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6022 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6023 done
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6024
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6025 if test -z "$rm"; then
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6026 $echo "$modename: you must specify an RM program" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6027 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6028 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6029 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6030
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6031 rmdirs=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6032
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6033 origobjdir="$objdir"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6034 for file in $files; do
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6035 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
6036 if test "X$dir" = "X$file"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6037 dir=.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6038 objdir="$origobjdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6039 else
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6040 objdir="$dir/$origobjdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6041 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6042 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
6043 test "$mode" = uninstall && objdir="$dir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6044
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6045 # 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
6046 if test "$mode" = clean; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6047 case " $rmdirs " in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6048 *" $objdir "*) ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6049 *) rmdirs="$rmdirs $objdir" ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6050 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6051 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6052
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6053 # 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
6054 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
6055 || (test -h "$file") >/dev/null 2>&1 \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6056 || test -f "$file"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6057 :
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6058 elif test -d "$file"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6059 exit_status=1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6060 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6061 elif test "$rmforce" = yes; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6062 continue
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6063 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6064
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6065 rmfiles="$file"
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6066
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6067 case $name in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6068 *.la)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6069 # 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
6070 if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6071 . $dir/$name
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6072
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6073 # Delete the libtool libraries and symlinks.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6074 for n in $library_names; do
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6075 rmfiles="$rmfiles $objdir/$n"
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6076 done
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6077 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
6078 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
6079
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6080 if test "$mode" = uninstall; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6081 if test -n "$library_names"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6082 # Do each command in the postuninstall commands.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6083 eval cmds=\"$postuninstall_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6084 save_ifs="$IFS"; IFS='~'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6085 for cmd in $cmds; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6086 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6087 $show "$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6088 $run eval "$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6089 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
6090 exit_status=1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6091 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6092 done
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6093 IFS="$save_ifs"
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6094 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6095
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6096 if test -n "$old_library"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6097 # 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
6098 eval cmds=\"$old_postuninstall_cmds\"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6099 save_ifs="$IFS"; IFS='~'
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6100 for cmd in $cmds; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6101 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6102 $show "$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6103 $run eval "$cmd"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6104 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
6105 exit_status=1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6106 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6107 done
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6108 IFS="$save_ifs"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6109 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6110 # FIXME: should reinstall the best remaining shared library.
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6111 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6112 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6113 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6114
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6115 *.lo)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6116 # Possibly a libtool object, so verify it.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6117 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
6118
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6119 # Read the .lo file
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6120 . $dir/$name
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6121
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6122 # 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
6123 if test -n "$pic_object" \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6124 && test "$pic_object" != none; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6125 rmfiles="$rmfiles $dir/$pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6126 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6127
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6128 # 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
6129 if test -n "$non_pic_object" \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6130 && test "$non_pic_object" != none; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6131 rmfiles="$rmfiles $dir/$non_pic_object"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6132 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6133 fi
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6134 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6135
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6136 *)
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6137 if test "$mode" = clean ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6138 noexename=$name
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6139 case $file in
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6140 *.exe)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6141 file=`$echo $file|${SED} 's,.exe$,,'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6142 noexename=`$echo $name|${SED} 's,.exe$,,'`
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6143 # $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
6144 # add $file without .exe
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6145 rmfiles="$rmfiles $file"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6146 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6147 esac
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6148 # 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
6149 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
6150 relink_command=
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6151 . $dir/$noexename
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6152
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6153 # 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
6154 # 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
6155 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
6156 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
6157 rmfiles="$rmfiles $objdir/lt-$name"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6158 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6159 if test "X$noexename" != "X$name" ; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6160 rmfiles="$rmfiles $objdir/lt-${noexename}.c"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6161 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6162 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6163 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6164 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6165 esac
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6166 $show "$rm $rmfiles"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6167 $run $rm $rmfiles || exit_status=1
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6168 done
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6169 objdir="$origobjdir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6170
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6171 # 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
6172 for dir in $rmdirs; do
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6173 if test -d "$dir"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6174 $show "rmdir $dir"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6175 $run rmdir $dir >/dev/null 2>&1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6176 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6177 done
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 exit $exit_status
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6180 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6181
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6182 "")
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6183 $echo "$modename: you must specify a MODE" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6184 $echo "$generic_help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6185 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6186 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6187 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6188
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6189 if test -z "$exec_cmd"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6190 $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
6191 $echo "$generic_help" 1>&2
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6192 exit 1
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6193 fi
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6194 fi # test -z "$show_help"
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6195
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6196 if test -n "$exec_cmd"; then
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6197 eval exec $exec_cmd
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6198 exit 1
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6199 fi
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6200
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6201 # 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
6202 case $mode in
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6203 "") $echo \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6204 "Usage: $modename [OPTION]... [MODE-ARG]...
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6205
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6206 Provide generalized library-building support services.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6207
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6208 --config show all configuration variables
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6209 --debug enable verbose shell tracing
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6210 -n, --dry-run display commands without modifying any files
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6211 --features display basic configuration information and exit
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6212 --finish same as \`--mode=finish'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6213 --help display this help message and exit
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6214 --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6215 --quiet same as \`--silent'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6216 --silent don't print informational messages
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6217 --tag=TAG use configuration variables from tag TAG
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6218 --version print version information
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6219
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6220 MODE must be one of the following:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6221
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6222 clean remove files from the build directory
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6223 compile compile a source file into a libtool object
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6224 execute automatically set library path, then run a program
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6225 finish complete the installation of libtool libraries
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6226 install install libraries or executables
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6227 link create a library or an executable
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6228 uninstall remove libraries from an installed directory
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6229
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6230 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
6231 a more detailed description of MODE.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6232
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6233 Report bugs to <bug-libtool@gnu.org>."
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6234 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6235 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6236
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6237 clean)
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6238 $echo \
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6239 "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
6240
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6241 Remove files from the build directory.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6242
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6243 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
6244 (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
6245 to RM.
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6246
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6247 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
6248 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
6249 ;;
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6250
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6251 compile)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6252 $echo \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6253 "Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6254
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6255 Compile a source file into a libtool library object.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6256
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6257 This mode accepts the following additional options:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6258
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6259 -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
6260 -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
6261 -prefer-non-pic try to building non-PIC objects only
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6262 -static always build a \`.o' file suitable for static linking
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6263
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6264 COMPILE-COMMAND is a command to be used in creating a \`standard' object file
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6265 from the given SOURCEFILE.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6266
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6267 The output file name is determined by removing the directory component from
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6268 SOURCEFILE, then substituting the C source code suffix \`.c' with the
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6269 library object suffix, \`.lo'."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6270 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6271
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6272 execute)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6273 $echo \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6274 "Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6275
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6276 Automatically set library path, then run a program.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6277
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6278 This mode accepts the following additional options:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6279
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6280 -dlopen FILE add the directory containing FILE to the library path
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6281
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6282 This mode sets the library path environment variable according to \`-dlopen'
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6283 flags.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6284
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6285 If any of the ARGS are libtool executable wrappers, then they are translated
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6286 into their corresponding uninstalled binary, and any of their required library
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6287 directories are added to the library path.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6288
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6289 Then, COMMAND is executed, with ARGS as arguments."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6290 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6291
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6292 finish)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6293 $echo \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6294 "Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6295
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6296 Complete the installation of libtool libraries.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6297
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6298 Each LIBDIR is a directory that contains libtool libraries.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6299
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6300 The commands that this mode executes may require superuser privileges. Use
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6301 the \`--dry-run' option if you just want to see what would be executed."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6302 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6303
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6304 install)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6305 $echo \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6306 "Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6307
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6308 Install executables or libraries.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6309
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6310 INSTALL-COMMAND is the installation command. The first component should be
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6311 either the \`install' or \`cp' program.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6312
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6313 The rest of the components are interpreted as arguments to that command (only
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6314 BSD-compatible install options are recognized)."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6315 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6316
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6317 link)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6318 $echo \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6319 "Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6320
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6321 Link object files or libraries together to form another library, or to
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6322 create an executable program.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6323
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6324 LINK-COMMAND is a command using the C compiler that you would use to create
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6325 a program from several object files.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6326
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6327 The following components of LINK-COMMAND are treated specially:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6328
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6329 -all-static do not do any dynamic linking at all
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6330 -avoid-version do not add a version suffix if possible
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6331 -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6332 -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6333 -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6334 -export-symbols SYMFILE
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6335 try to export only the symbols listed in SYMFILE
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6336 -export-symbols-regex REGEX
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6337 try to export only the symbols matching REGEX
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6338 -LLIBDIR search LIBDIR for required installed libraries
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6339 -lNAME OUTPUT-FILE requires the installed library libNAME
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6340 -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
6341 -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
6342 -no-install link a not-installable executable
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6343 -no-undefined declare that a library does not refer to external symbols
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6344 -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
6345 -objectlist FILE Use a list of object files found in FILE to specify objects
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6346 -release RELEASE specify package release information
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6347 -rpath LIBDIR the created library will eventually be installed in LIBDIR
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6348 -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6349 -static do not do any dynamic linking of libtool libraries
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6350 -version-info CURRENT[:REVISION[:AGE]]
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6351 specify library version info [each variable defaults to 0]
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6352
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6353 All other options (arguments beginning with \`-') are ignored.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6354
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6355 Every other argument is treated as a filename. Files ending in \`.la' are
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6356 treated as uninstalled libtool libraries, other files are standard or library
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6357 object files.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6358
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6359 If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6360 only library objects (\`.lo' files) may be specified, and \`-rpath' is
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6361 required, except when creating a convenience library.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6362
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6363 If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6364 using \`ar' and \`ranlib', or on Windows using \`lib'.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6365
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6366 If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6367 is created, otherwise an executable program is created."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6368 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6369
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6370 uninstall)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6371 $echo \
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6372 "Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6373
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6374 Remove libraries from an installation directory.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6375
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6376 RM is the name of the program to use to delete files associated with each FILE
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6377 (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6378 to RM.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6379
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6380 If FILE is a libtool library, all the files associated with it are deleted.
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6381 Otherwise, only FILE itself is deleted using RM."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6382 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6383
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6384 *)
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6385 $echo "$modename: invalid operation mode \`$mode'" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6386 $echo "$help" 1>&2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6387 exit 1
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6388 ;;
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6389 esac
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6390
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6391 $echo
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6392 $echo "Try \`$modename --help' for more information about other modes."
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6393
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6394 exit 0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6395
729
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6396 # 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
6397 # 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
6398 # 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
6399 # 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
6400 # 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
6401 # 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
6402 # 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
6403 # 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
6404 # 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
6405 # 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
6406
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6407 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6408 build_libtool_libs=no
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6409 build_old_libs=yes
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6410 # ### END LIBTOOL TAG CONFIG: disable-shared
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6411
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6412 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6413 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
6414 # ### END LIBTOOL TAG CONFIG: disable-static
dac996d69abb Updated libtool support so Mingw32 builds work.
Sam Lantinga <slouken@libsdl.org>
parents: 608
diff changeset
6415
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6416 # Local Variables:
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6417 # mode:shell-script
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6418 # sh-indentation:2
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
6419 # End: