blob: 01cbab3a74a6fae55ab579c3eab4cbdf5d9079d1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
#!/bin/sh
# Copyright (c) 2004, 2005 MySQL AB
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
dst=$1
shift
type=$1
shift
add_lib(){
echo `dirname $2`/$1/`basename $2 | sed "s/\.[l]*a/$3.lib/g"`
}
out_rel=
out_deb=
out_tls_rel=
out_tls_deb=
for i in $*
do
# mysql VC++ project files have for some unknown reason
# choosen NOT to put libdbug.lib in $(topdir)./dbug but rather in $(topdir)
# the same goes for mysys and strings
lib=$i
case $i in
*libdbug.a | *libmysys.a | *libmystrings.a)
lib=`echo $i | sed s'!dbug\/lib!!' | sed 's!mysys\/lib!!' | sed 's!strings\/libmy!!'`
echo "Changing from $i to $lib"
;;
esac
if [ `echo $i | grep -c gcc` -eq 0 ]
then
out_rel="${out_rel} `add_lib lib_release $lib`"
out_deb="${out_deb} `add_lib lib_debug $lib`"
out_tls_rel="${out_tls_rel} `add_lib lib_release $lib _tls`"
out_tls_deb="${out_tls_deb} `add_lib lib_debug $lib _tls`"
fi
done
fix(){
echo "# ADD BASE ${type}32 $*\n# ADD ${type}32 $*\n"
}
if [ "$out_rel" ]
then
out_rel=`fix $out_rel`
out_deb=`fix $out_deb`
out_tls_rel=`fix $out_tls_rel`
out_tls_deb=`fix $out_tls_deb`
fi
sed -e "s!@release_libs@!$out_rel!g" \
-e "s!@debug_libs@!$out_deb!g" \
-e "s!@tls_release_libs@!$out_tls_rel!g" \
-e "s!@tls_debug_libs@!$out_tls_deb!g" \
$dst > !tmp!$dst.$$
mv !tmp!$dst.$$ $dst
|