5 # Run this script to download and cross-compile dependencies for win32.
7 # A directory named deps will be created and/or populated in the current
8 # directory. Upon successful completion (be patient), the compiled
9 # dependencies will be packaged into an archive named deps.tar.bz2 in the
10 # current directory. To install the dependencies, execute this command:
12 # tar xf deps.tar.bz2 -C $PREFIX
14 # where $PREFIX is the path to your mingw32 toolchain. If problems occur,
15 # check stdout and stderr for clues. You may be able to easily determine
16 # the problem and make the necessary corrections. These packages will be
17 # downloaded and built:
20 # boost 1.42.0 (headers only)
25 # openal-soft 1.11.753
28 # This script requires a working mingw32 toolchain and other basic tools.
32 # ./makedeps.sh -H i486-mingw32 -p /usr/i486-mingw32 -m "-j8"
34 # Bugs: Each time the script is run, all of the dependencies will be
35 # rebuilt, even the ones which were already built successfully.
40 echo "Download and cross-compile dependencies for win32."
41 echo "Usage: $0 [-h] [-m makeopts] -H host -p prefix"
43 echo " -H Specify the name of your toolchain, like i486-mingw32."
44 echo " -h Show this help an exit."
45 echo " -m Specify options to be passed to make."
46 echo " -p Specify the path to your toolchain installation."
49 while getopts ":H:hm:p:" opt
66 echo "Invalid option: -$OPTARG" >&2
73 if test x
$HOST = x
|| test x
$PREFIX = x
91 PACKAGE
="boost_1_42_0"
94 test ! -f $PACKAGE.
tar.bz2
&& (wget
"http://sourceforge.net/projects/boost/files/boost/$VERSION/$PACKAGE.tar.bz2/download" || die
"downloading $PACKAGE")
96 7bf3b4eb841b62ffb0ade2b82218ebe6 boost_1_42_0.tar.bz2
98 ) || die "verifying $PACKAGE"
100 tar xjf $PACKAGE.tar.bz2 || die "unpackaging $PACKAGE"
101 (mkdir -p $DESTDIR/$PREFIX/include && \
102 rm -rf $DESTDIR/$PREFIX/include/boost && \
103 cp -r $PACKAGE/boost $DESTDIR/$PREFIX/include/boost) || die "installing $PACKAGE"
108 test ! -f $PACKAGE.tar.gz && (wget "http://www.libsdl.org/release/$PACKAGE.tar.gz" || die "downloading $PACKAGE")
110 e52086d1b508fa0b76c52ee30b55bec4 SDL
-1.2
.14.
tar.gz
112 ) || die
"verifying $PACKAGE"
114 tar xzf
$PACKAGE.
tar.gz
|| die
"unpackaging $PACKAGE"
116 .
/configure
--host=$HOST --prefix=$PREFIX --disable-stdio-redirect || die
"configuring $PACKAGE"
117 make $MAKEOPTS || die
"making $PACKAGE"
118 make DESTDIR
=$DESTDIR install || die
"installing $PACKAGE"
121 PACKAGE
="libogg-1.1.4"
123 test ! -f $PACKAGE.
tar.gz
&& (wget
"http://downloads.xiph.org/releases/ogg/$PACKAGE.tar.gz" || die
"downloading $PACKAGE")
125 10200ec22543841d9d1c23e0aed4e5e9 libogg-1.1.4.tar.gz
127 ) || die "verifying $PACKAGE"
129 tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE"
131 ./configure --host=$HOST --prefix=$PREFIX || die "configuring $PACKAGE"
132 make $MAKEOPTS || die "making $PACKAGE"
133 make DESTDIR=$DESTDIR install || die "installing $PACKAGE"
136 PACKAGE="libvorbis-1.2.3"
138 test ! -f $PACKAGE.tar.gz && (wget "http://downloads.xiph.org/releases/vorbis/$PACKAGE.tar.gz" || die "downloading $PACKAGE")
140 5aa77f55c0e0aab8eb8ed982335daac8 libvorbis
-1.2
.3.
tar.gz
142 ) || die
"verifying $PACKAGE"
144 tar xzf
$PACKAGE.
tar.gz
|| die
"unpackaging $PACKAGE"
146 .
/configure
--host=$HOST --prefix=$PREFIX \
147 CPPFLAGS
="-I$DESTDIR/$PREFIX/include" \
148 LDFLAGS
="-L$DESTDIR/$PREFIX/lib" || die
"configuring $PACKAGE"
149 make $MAKEOPTS || die
"making $PACKAGE"
150 make DESTDIR
=$DESTDIR install || die
"installing $PACKAGE"
153 PACKAGE
="openal-soft-1.11.753-bin"
155 test ! -f $PACKAGE.
zip && (wget
"http://kcat.strangesoft.net/$PACKAGE.zip" || die
"downloading $PACKAGE")
157 20747ce5ca0f902ae082fef15d7b41a5 openal-soft-1.11.753-bin.zip
159 ) || die "verifying $PACKAGE"
161 unzip $PACKAGE.zip || die "unpackaging $PACKAGE"
163 (mkdir -p $DESTDIR/$PREFIX/{lib/pkgconfig,include/AL} && \
164 install -p -m 0644 include/AL/* $DESTDIR/$PREFIX/include/AL/ && \
165 install -p -m 0755 Win32/soft_oal.dll $DESTDIR/$PREFIX/bin/OpenAL32.dll && \
166 install -p -m 0755 openal-info.exe $DESTDIR/$PREFIX/bin/ && \
167 install -p -m 0755 lib/Win32/libOpenAL32.dll.a $DESTDIR/$PREFIX/lib/ && \
168 cat >$DESTDIR/$PREFIX/lib/pkgconfig/openal.pc <<EOL
170 exec_prefix=\${prefix}
171 libdir=\${exec_prefix}/lib
172 includedir=\${prefix}/include
175 Description: OpenAL is a cross-platform 3D audio API
178 Libs: -L\${libdir} -lOpenAL32
179 Cflags: -I\${includedir}
181 ) || die "installing $PACKAGE"
184 PACKAGE="zlib123-dll"
186 test ! -f $PACKAGE.zip && (wget "http://www.zlib.net/$PACKAGE.zip" || die "downloading $PACKAGE")
188 cc7fa97f9c19386bb701acc79d0abbca zlib123
-dll.
zip
190 ) || die
"verifying $PACKAGE"
192 unzip -d $PACKAGE $PACKAGE.
zip || die
"unpackaging $PACKAGE"
194 ($HOST-dlltool -k -d lib
/zlib.def
-D zlib1.dll
-l libzdll.a
&& \
195 mkdir -p $DESTDIR/$PREFIX/{lib
,include
} && \
196 install -p -m 0644 include
/* $DESTDIR/$PREFIX/include
/ && \
197 install -p -m 0755 zlib1.dll
$DESTDIR/$PREFIX/bin
/ && \
198 install -p -m 0755 libzdll.a
$DESTDIR/$PREFIX/lib
/ && \
199 cd $DESTDIR/$PREFIX/lib
&& \
200 ln -fs libzdll.a libz.dll.a
) || die
"installing $PACKAGE"
203 PACKAGE
="libpng-1.4.1"
205 test ! -f $PACKAGE.
tar.gz
&& (wget
"http://prdownloads.sourceforge.net/libpng/$PACKAGE.tar.gz?download" || die
"downloading $PACKAGE")
207 fa0b2a84733463f90d3ac9f43ccafabc libpng-1.4.1.tar.gz
209 ) || die "verifying $PACKAGE"
211 tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE"
213 ./configure --host=$HOST --prefix=$PREFIX \
214 CPPFLAGS="-I$DESTDIR/$PREFIX/include" \
215 LDFLAGS="-L$DESTDIR/$PREFIX/lib" || die "configuring $PACKAGE"
216 make $MAKEOPTS || die "making $PACKAGE"
217 make DESTDIR=$DESTDIR install || die "installing $PACKAGE"
222 test ! -f $PACKAGE.tar.gz && (wget "http://www.lua.org/ftp/$PACKAGE.tar.gz" || die "downloading $PACKAGE")
224 d0870f2de55d59c1c8419f36e8fac150 lua
-5.1
.4.
tar.gz
226 ) || die
"verifying $PACKAGE"
228 tar xzf
$PACKAGE.
tar.gz
|| die
"unpackaging $PACKAGE"
231 diff -ur lua-5.1.4.orig/Makefile lua-5.1.4/Makefile
232 --- lua-5.1.4.orig/Makefile 2008-08-11 18:40:48.000000000 -0600
233 +++ lua-5.1.4/Makefile 2010-03-03 23:11:41.673472345 -0700
235 INSTALL_BIN= $(INSTALL_TOP)/bin
236 INSTALL_INC= $(INSTALL_TOP)/include
237 INSTALL_LIB= $(INSTALL_TOP)/lib
238 -INSTALL_MAN= $(INSTALL_TOP)/man/man1
239 +INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
240 +INSTALL_PC= $(INSTALL_LIB)/pkgconfig
242 # You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
243 # LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
245 PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
249 +TO_BIN= lua.exe luac.exe lua51.dll
250 TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
252 +TO_LIB= liblua.a liblua.dll.a
256 # Lua version and release.
259 src/lua test/hello.lua
262 - cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
263 + cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_PC) $(INSTALL_LMOD) $(INSTALL_CMOD)
264 cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
265 cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
266 cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
267 cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
268 + cd etc && $(INSTALL_DATA) $(TO_PC) $(INSTALL_PC)
271 cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)
272 diff -ur lua-5.1.4.orig/src/Makefile lua-5.1.4/src/Makefile
273 --- lua-5.1.4.orig/src/Makefile 2008-01-19 12:37:58.000000000 -0700
274 +++ lua-5.1.4/src/Makefile 2010-03-03 22:45:47.101159854 -0700
278 $(MAKE) "LUA_A=lua51.dll" "LUA_T=lua.exe" \
279 - "AR=$(CC) -shared -o" "RANLIB=strip --strip-unneeded" \
280 + "AR=$(CC) -shared -Wl,--out-implib,liblua.dll.a -o" "RANLIB=strip --strip-unneeded" \
281 "MYCFLAGS=-DLUA_BUILD_AS_DLL" "MYLIBS=" "MYLDFLAGS=-s" lua.exe
282 $(MAKE) "LUAC_T=luac.exe" luac.exe
286 diff -ur lua-5.1.4.orig/etc/lua.pc lua-5.1.4/etc/lua.pc
287 --- lua-5.1.4.orig/etc/lua.pc 2008-08-08 06:46:11.000000000 -0600
288 +++ lua-5.1.4/etc/lua.pc 2010-03-03 22:46:49.160471491 -0700
292 # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
295 INSTALL_BIN= \${prefix}/bin
296 INSTALL_INC= \${prefix}/include
297 INSTALL_LIB= \${prefix}/lib
299 make $MAKEOPTS CC="$HOST-gcc" RANLIB="$HOST-ranlib" mingw || die "making $PACKAGE"
300 make INSTALL_TOP=$DESTDIR/$PREFIX install || die "installing $PACKAGE"
301 chmod 755 $DESTDIR/$PREFIX/lib/liblua.dll.a
304 # libopengl32 and libglu32 pc files
305 mkdir -p $DESTDIR/$PREFIX/lib/pkgconfig
306 cat >$DESTDIR/$PREFIX/lib/pkgconfig/gl.pc <<EOL
308 exec_prefix=\${prefix}
309 libdir=\${exec_prefix}/lib
310 includedir=\${prefix}/include
313 Description: OpenGL library
316 Libs: -L\${libdir} -lopengl32
317 Cflags: -I\${includedir}
319 cat >$DESTDIR/$PREFIX/lib/pkgconfig/glu.pc <<EOL
321 exec_prefix=\${prefix}
322 libdir=\${exec_prefix}/lib
323 includedir=\${prefix}/include
326 Description: OpenGL Utility library
329 Libs: -L\${libdir} -lglu32
330 Cflags: -I\${includedir}
337 Yoink Win32 Dependencies
338 Created `date +"%d %b %Y"`
340 These dependencies were generated automatically by makedeps.sh, a script
341 available in the Yoink repository. You should find here all the header
342 files, DLL's, implibs, and pkgconfig files required to build Yoink that are
343 not provided with the standard mingw32 toolchain. Yoink itself can be
344 built with mingw32 and these installed dependencies like this:
346 ./configure --host=$HOST --prefix=$PREFIX \\
347 PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
350 These files are licensed such that their general distribution under
351 reasonable conditions is allowable. The copyrights of these binaries go to
352 their various respective owners. Look up the specific library for specific
353 terms and conditions, or see the file COPYING in the Yoink package.
356 tar cjf deps.tar.bz2 * || die "archiving dependencies"
357 mv deps.tar.bz2 $DESTDIR/..
360 echo "The dependencies are packed into the archive deps.tar.bz2."