Cross-build Instructions

From Aleph One Wiki

Jump to: navigation, search

Here's how to set up a cross-build environment in Linux/Mac OS X, which you can use to build a Windows version of Aleph One

Contents

[edit] Intro

  • Go to libsdl to find the tool that basically made this possible and relatively easy

[edit] Cross compiler

  • Download this to your /tmp directory
  • Edit build-cross.sh to match the release candidate versions of mingw found here
  • If you're on a Mac, change instances of wget to curl -O in build-cross.sh
  • Add --disable-nls to the binutils configure in build-cross.sh
  • Run build-cross.sh as root

[edit] cross-configure.sh / cross-make.sh

[edit] SDL

  • Download this
  • cross-configure.sh --disable-shared, cross-make.sh install
  • cd to /usr/local/cross-tools/i386-mingw32msvc and untar the w32api-2.3.tar.gz file from /tmp/source (this is to fix an opengl problem, I think build-cross.sh untars a couple files in the wrong order)

[edit] SDL_net

  • Download, cross-configure --disable-shared and cross-make install SDL_net

[edit] JPEG

  • Get the latest JPEG src
  • cross-configure.sh --disable-shared --prefix=/usr/local/cross-tools/i386-mingw32msvc
  • cross-make.sh install-lib

[edit] zlib

  • get zlib
  • cross-configure.sh --prefix=/usr/local/cross-tools/i386-mingw32msvc
  • cross-make.sh libz.a, cross-make.sh install

[edit] libPNG

  • Get the config-based libpng
  • cross-configure.sh --prefix=/usr/local/cross-tools/i386-mingw32msvc
  • cross-make.sh install

[edit] SDL_image

  • get SDL_image
  • cross-configure.sh --disable-shared
  • cross-make.sh install

[edit] SMPEG

  • get SMPEG
  • LIBS="-lstdc++" cross-configure.sh --prefix=/usr/local/cross-tools/i386-mingw32msvc --disable-shared
  • cross-make.sh install

[edit] SDL_sound

  • get the stable SDL_Sound from subversion:
svn co svn://svn.icculus.org/SDL_sound/branches/stable-1.0/ SDL_sound-stable-1.0
cd SDL_sound-stable-1.0
./bootstrap
CFLAGS="-I/usr/local/cross-tools/i386-mingw32msvc/include/smpeg" LIBS="-lstdc++" \
/tmp/cross-configure.sh --disable-shared --prefix=/usr/local/cross-tools/i386-mingw32msvc \
--enable-smpeg --disable-midi --disable-mpglib
 sed -ie s/playsound//g Makefile
  • cross-make.sh install

[edit] Speex

  • Download and untar Speex
  • Cross-configure speex with --prefix=/usr/local/cross-tools/i386-mingw32msvc --enable-ogg=no --disable-shared
  • cross-make and install speex

[edit] Lua

  • Download Lua
  • Edit INSTALL_ROOT to /usr/local/cross-tools/i386-mingw32msvc in the Lua config file
  • Cross-configure and cross-make install lua

[edit] Boost

./bjam -sTOOLS="gcc" --prefix="/usr/local/cross-tools/i386-mingw32msvc" \ 
--sGXX="/usr/local/cross-tools/i386-mingw32msvc/bin/g++" --with-bind \ 
--with-function install
  • ln -s /usr/local/cross-tools/i386-mingw32msvc/include/boost_1_32/boost /usr/local/cross-tools/i386-mingw32msvc/include

[edit] Building Aleph One

  • in your aleph directory: sh autogen.sh
  • N.B. you need SDL installed in your linux environment, so that the native configure succeeds
  • cd Source_Files/Expat and make gennmtab (this is a native make; gennmtab is run to generate nametab.h so it has to be a native binary)
  • cd ../.. and LIBS="-ljpeg -lpng -lz -lstdc++ -lws2_32" cross-configure.sh
  • cd Source_Files/Expat and make clean
  • cd .. and cross-make.sh

[edit] Done

At this point you should have a partially-stripped, static linked AlephOne.exe in your source files directory.

Personal tools