3
# SDL Cross-Build Download Script v 1.0
4
# =====================================
5
# (c) 2006 Dana Olson <dolson@icculus.org>
6
# Updated 20080617 by Saul D.
8
# SDL 1.2 - http://www.libsdl.org/download-1.2.php
9
# SDL_image - http://www.libsdl.org/projects/SDL_image/
10
# SDL_mixer - http://www.libsdl.org/projects/SDL_mixer/
11
# SDL_net - http://www.libsdl.org/projects/SDL_net/
12
# SDL_ttf - http://www.libsdl.org/projects/SDL_ttf/
14
# Path to install to. Default is /opt/SDL-1.2.13
16
if [ "$1" == "" ] ; then
17
INSTPATH=/opt/SDL-1.2.13
18
echo Install path not specified\; using default.
21
# Check and warn if destination exists.
22
if [ -e "$INSTPATH" ] ; then
23
echo WARNING!!! Install path already exists!
26
# Allow user to confirm install.
27
echo SDL libraries will be installed to $INSTPATH.
28
echo Press Enter to continue, ^C to abort.
31
# Create the patch and subdirectory.
32
mkdir -p $INSTPATH/archives/
34
# Make sure the directory could be created.
35
if [ ! -e "$INSTPATH/archives" ] ; then
36
echo Couldn\'t create install path. Aborting.
41
# Download the SDL archives. Add to this list if you want more libraries.
42
cd $INSTPATH/archives/
44
http://www.libsdl.org/release/SDL-devel-1.2.13-mingw32.tar.gz \
45
http://www.libsdl.org/projects/SDL_image/release/SDL_image-devel-1.2.6-VC8.zip \
46
http://www.libsdl.org/projects/SDL_mixer/release/SDL_mixer-devel-1.2.8-VC8.zip \
47
http://www.libsdl.org/projects/SDL_net/release/SDL_net-devel-1.2.7-VC8.zip \
48
http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-devel-2.0.9-VC8.zip
53
# Extract the main SDL archive.
54
tar zxf archives/SDL-devel-1.2.13-mingw32.tar.gz
56
# Extract the addon archives.
57
for i in archives/*.zip
61
# Make a directory to hold the SDL runtime for Win32.
62
mkdir SDL-1.2.13/runtime/
64
# Move all the DLLs and README file into here.
65
mv */*/*.dll SDL-1.2.13/runtime/
66
mv SDL-1.2.13/README-SDL.txt SDL-1.2.13/runtime/
68
# Move all the addon libraries into the lib dir.
69
mv SDL_*/*/*.lib SDL-1.2.13/lib/
71
# Move all the addon headers into the include dir.
72
mv SDL_*/*/*.h SDL-1.2.13/include/
74
# Remove unneeded directories.
77
# Make a symlink, so that the sdl-config can be found.
79
ln -s sdl-config i586-mingw32msvc-sdl-config
81
# Patch the sdl-config script to point to install path.
82
echo "--- i586-mingw32msvc-sdl-config" > sdlcfgfix.patch
83
echo "+++ i586-mingw32msvc-sdl-config.fix" >> sdlcfgfix.patch
84
echo "@@ -1,6 +1,6 @@" >> sdlcfgfix.patch
85
echo " #!/bin/sh" >> sdlcfgfix.patch
86
echo " " >> sdlcfgfix.patch
87
echo "-prefix=/Users/hercules/tmp/SDL-1.2.13" >> sdlcfgfix.patch
88
echo "+prefix=$INSTPATH" >> sdlcfgfix.patch
89
echo " exec_prefix=\${prefix}" >> sdlcfgfix.patch
90
echo " exec_prefix_set=no" >> sdlcfgfix.patch
91
echo " " >> sdlcfgfix.patch
92
patch < sdlcfgfix.patch
93
mv sdlcfgfix.patch ../../archives/
95
# Set proper permissions on some files.
97
chmod -x SDL-1.2.13/lib/* SDL-1.2.13/runtime/*
99
# Move everything into install dir.
100
mv SDL-1.2.13/ tempsdlinstalldir129
101
mv tempsdlinstalldir129/* ./
102
rm -r tempsdlinstalldir129/
106
echo Everything is done! SDL was installed in $INSTPATH.
107
echo This line should work to cross-compile:
108
echo PATH=$INSTPATH/bin:\$PATH ./configure --target=i586-mingw32msvc --host=i586-mingw32msvc --build=i586-linux