X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=arch%2Fwin32%2Fmakedeps.sh;fp=arch%2Fwin32%2Fmakedeps.sh;h=49a79e1f054bbb9ad9c3e3b0a8169adfd03c8703;hp=0000000000000000000000000000000000000000;hb=cf4c819df08e2ab6c06532d8a4467fa58b2792ae;hpb=705fbbaf9a8064c034d23119e912da028af7fac7 diff --git a/arch/win32/makedeps.sh b/arch/win32/makedeps.sh new file mode 100755 index 0000000..49a79e1 --- /dev/null +++ b/arch/win32/makedeps.sh @@ -0,0 +1,363 @@ +#!/bin/sh + +# +# Yoink +# Run this script to download and cross-compile dependencies for win32. +# +# A directory named deps will be created and/or populated in the current +# directory. Upon successful completion (be patient), the compiled +# dependencies will be packaged into an archive named deps.tar.bz2 in the +# current directory. To install the dependencies, execute this command: +# +# tar xjf deps.tar.bz2 -C $PREFIX +# +# where $PREFIX is the path to your mingw32 toolchain. If problems occur, +# check stdout and stderr for clues. You may be able to easily determine +# the problem and make the necessary corrections. These packages will be +# downloaded and built: +# +# SDL 1.2.14 +# boost 1.42.0 (headers only) +# libogg 1.1.4 +# libpng 1.4.1 +# libvorbis 1.2.3 +# lua 5.1.4 +# openal-soft 1.11.753 +# +# This script requires a working mingw32 toolchain and other basic tools. +# You also need zlib which may not have been included with your mingw32 +# installation; you're on your own for that one. Have fun! +# +# Example usage: +# ./makedeps.sh -H i486-mingw32 -p /usr/i486-mingw32 -m "-j8" +# +# Bugs: Each time the script is run, all of the dependencies will be +# rebuilt, even the ones which were already built successfully. +# + +showhelp() +{ + echo "Usage: $0 [-h] [-m makeopts] -H host -p prefix" + echo " Downloads and cross-compiles dependencies for win32." + echo "" + echo " -H Specify the name of your toolchain, like i486-mingw32." + echo " -h Show this help an exit." + echo " -m Specify options to be passed to make." + echo " -p Specify the path to your toolchain installation." +} + +while getopts ":H:hm:p:" opt +do + case $opt in + H) + HOST="$OPTARG" + ;; + h) + showhelp + exit 0 + ;; + m) + MAKEOPTS="$OPTARG" + ;; + p) + PREFIX="$OPTARG" + ;; + \?) + echo "Invalid option: -$OPTARG" >&2 + showhelp + exit 1 + ;; + esac +done + +if test x$HOST = x || test x$PREFIX = x +then + showhelp + exit 1 +fi + + +die() +{ + echo "die:" $@ + exit 1 +} + +DESTDIR="`pwd`/deps" +mkdir -p "$DESTDIR" +rm -f "$DESTDIR/README" +rm -rf "$DESTDIR/$PREFIX" + + +PACKAGE="boost_1_42_0" +VERSION="1.42.0" +cd $DESTDIR +test ! -f $PACKAGE.tar.bz2 && (wget "http://sourceforge.net/projects/boost/files/boost/$VERSION/$PACKAGE.tar.bz2/download" || die "downloading $PACKAGE") +(md5sum -c <<"EOL" +7bf3b4eb841b62ffb0ade2b82218ebe6 boost_1_42_0.tar.bz2 +EOL +) || die "verifying $PACKAGE" +rm -rf $PACKAGE +tar xjf $PACKAGE.tar.bz2 || die "unpackaging $PACKAGE" +(mkdir -p $DESTDIR/$PREFIX/include && \ +rm -rf $DESTDIR/$PREFIX/include/boost && \ +cp -r $PACKAGE/boost $DESTDIR/$PREFIX/include/boost) || die "installing $PACKAGE" + + +PACKAGE="SDL-1.2.14" +cd $DESTDIR +test ! -f $PACKAGE.tar.gz && (wget "http://www.libsdl.org/release/$PACKAGE.tar.gz" || die "downloading $PACKAGE") +(md5sum -c <<"EOL" +e52086d1b508fa0b76c52ee30b55bec4 SDL-1.2.14.tar.gz +EOL +) || die "verifying $PACKAGE" +rm -rf $PACKAGE +tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE" +cd $PACKAGE +./configure --host=$HOST --prefix=$PREFIX --disable-stdio-redirect || die "configuring $PACKAGE" +make $MAKEOPTS || die "making $PACKAGE" +make DESTDIR=$DESTDIR install || die "installing $PACKAGE" + + +PACKAGE="libogg-1.1.4" +cd $DESTDIR +test ! -f $PACKAGE.tar.gz && (wget "http://downloads.xiph.org/releases/ogg/$PACKAGE.tar.gz" || die "downloading $PACKAGE") +(md5sum -c <<"EOL" +10200ec22543841d9d1c23e0aed4e5e9 libogg-1.1.4.tar.gz +EOL +) || die "verifying $PACKAGE" +rm -rf $PACKAGE +tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE" +cd $PACKAGE +./configure --host=$HOST --prefix=$PREFIX || die "configuring $PACKAGE" +make $MAKEOPTS || die "making $PACKAGE" +make DESTDIR=$DESTDIR install || die "installing $PACKAGE" + + +PACKAGE="libvorbis-1.2.3" +cd $DESTDIR +test ! -f $PACKAGE.tar.gz && (wget "http://downloads.xiph.org/releases/vorbis/$PACKAGE.tar.gz" || die "downloading $PACKAGE") +(md5sum -c <<"EOL" +5aa77f55c0e0aab8eb8ed982335daac8 libvorbis-1.2.3.tar.gz +EOL +) || die "verifying $PACKAGE" +rm -rf $PACKAGE +tar xzf $PACKAGE.tar.gz || die "unpackaging $PACKAGE" +cd $PACKAGE +./configure --host=$HOST --prefix=$PREFIX \ +CPPFLAGS="-I$DESTDIR/$PREFIX/include" \ +LDFLAGS="-L$DESTDIR/$PREFIX/lib" || die "configuring $PACKAGE" +make $MAKEOPTS || die "making $PACKAGE" +make DESTDIR=$DESTDIR install || die "installing $PACKAGE" + + +PACKAGE="openal-soft-1.11.753-bin" +cd $DESTDIR +test ! -f $PACKAGE.zip && (wget "http://kcat.strangesoft.net/$PACKAGE.zip" || die "downloading $PACKAGE") +(md5sum -c <<"EOL" +20747ce5ca0f902ae082fef15d7b41a5 openal-soft-1.11.753-bin.zip +EOL +) || die "verifying $PACKAGE" +rm -rf $PACKAGE +unzip $PACKAGE.zip || die "unpackaging $PACKAGE" +cd $PACKAGE +(mkdir -p $DESTDIR/$PREFIX/{lib/pkgconfig,include/AL} && \ +install -p -m 0644 include/AL/* $DESTDIR/$PREFIX/include/AL/ && \ +install -p -m 0755 Win32/soft_oal.dll $DESTDIR/$PREFIX/bin/OpenAL32.dll && \ +install -p -m 0755 openal-info.exe $DESTDIR/$PREFIX/bin/ && \ +install -p -m 0755 lib/Win32/libOpenAL32.dll.a $DESTDIR/$PREFIX/lib/ && \ +cat >$DESTDIR/$PREFIX/lib/pkgconfig/openal.pc <$DESTDIR/$PREFIX/lib/pkgconfig/gl.pc <$DESTDIR/$PREFIX/lib/pkgconfig/glu.pc <README <