Fix the cross-compilation guide and build script

This commit is contained in:
Moritz Bunkus 2012-05-31 13:39:43 +02:00
parent 32e1303eb2
commit 4df3d55a42
2 changed files with 18 additions and 9 deletions

View File

@ -28,9 +28,12 @@ build each library. Luckily there's the "mingw-cross-env" project at
http://mingw-cross-env.nongnu.org/ that provides an easy-to-use way of http://mingw-cross-env.nongnu.org/ that provides an easy-to-use way of
setting up everything we need. setting up everything we need.
First, download a release or the current development version; see Unfortunately current versions of mingw-cross-env use a compiler
http://mingw-cross-env.nongnu.org/#latest-release to to retrieve version that is known to cause issues upon runtime. Therefore the
them. Then unpack the release. author maintains his own fork that is known to work. In order to
retrieve that fork you need `git`. Then to the following:
git clone https://github.com/mbunkus/mxe $HOME/mingw-cross-env
The rest of this guide assumes that you've unpacked mingw-cross-env The rest of this guide assumes that you've unpacked mingw-cross-env
into the directory $HOME/mingw-cross-env. into the directory $HOME/mingw-cross-env.
@ -85,7 +88,8 @@ Next, build the required libraries:
Append the installation directory to your PATH variable: Append the installation directory to your PATH variable:
export PATH=$PATH:$HOME/mingw-cross-env/usr/i686-pc-mingw32/bin export PATH=$PATH:$HOME/mingw-cross-env/usr/bin
hash -r
Finally, configure mkvtoolnix: Finally, configure mkvtoolnix:
@ -93,7 +97,7 @@ Finally, configure mkvtoolnix:
./configure \ ./configure \
--host=i686-pc-mingw32 \ --host=i686-pc-mingw32 \
--with-boost=$HOME/mingw-cross-env/usr/i686-pc-mingw32 \ --with-boost=$HOME/mingw-cross-env/usr/i686-pc-mingw32 \
--with-wx-config=$HOME/mingw-cross-env/usr/i686-pc-mingw32/bin/i686-pc-mingw32-wx-config --with-wx-config=$HOME/mingw-cross-env/usr/bin/i686-pc-mingw32-wx-config
If everything works then build it: If everything works then build it:

View File

@ -28,7 +28,7 @@ LOGFILE=$(mktemp)
function update_mingw_cross_env { function update_mingw_cross_env {
if [[ ! -d $INSTALL_DIR ]]; then if [[ ! -d $INSTALL_DIR ]]; then
echo Retrieving the mingw-cross-env build scripts >> $LOGFILE echo Retrieving the mingw-cross-env build scripts >> $LOGFILE
git clone https://github.com/mxe/mxe $INSTALL_DIR >> $LOGFILE 2>&1 git clone https://github.com/mbunkus/mxe $INSTALL_DIR >> $LOGFILE 2>&1
else else
echo Updating the mingw-cross-env build scripts >> $LOGFILE echo Updating the mingw-cross-env build scripts >> $LOGFILE
cd $INSTALL_DIR cd $INSTALL_DIR
@ -43,18 +43,23 @@ function create_run_configure_script {
cat > run_configure.sh <<EOF cat > run_configure.sh <<EOF
#!/bin/bash #!/bin/bash
export PATH=$PATH:${INSTALL_DIR}/usr/${TARGET}/bin export PATH=$PATH:${INSTALL_DIR}/usr/bin
hash -r hash -r
./configure \\ ./configure \\
--host=${TARGET} \\ --host=${TARGET} \\
--with-boost="${INSTALL_DIR}/usr/${TARGET}" \\ --with-boost="${INSTALL_DIR}/usr/${TARGET}" \\
--with-wx-config="${INSTALL_DIR}/usr/${TARGET}/bin/${TARGET}-wx-config" \\ --with-wx-config="${INSTALL_DIR}/usr/bin/${TARGET}-wx-config" \\
"\$@" "\$@"
exit \$? exit \$?
EOF EOF
chmod 755 run_configure.sh chmod 755 run_configure.sh
if [[ ! -f configure ]]; then
echo Creating \'configure\'
./autogen.sh
fi
} }
function configure_mkvtoolnix { function configure_mkvtoolnix {
@ -68,7 +73,7 @@ function configure_mkvtoolnix {
if [ $result -eq 0 ]; then if [ $result -eq 0 ]; then
echo 'Configuration went well. Congratulations. You can now run "drake"' echo 'Configuration went well. Congratulations. You can now run "drake"'
echo 'after adding the mingw cross compiler installation directory to your PATH:' echo 'after adding the mingw cross compiler installation directory to your PATH:'
echo ' export PATH=$PATH:'${INSTALL_DIR}'/usr/'${TARGET}'/bin' echo ' export PATH=$PATH:'${INSTALL_DIR}'/usr/bin'
echo ' hash -r' echo ' hash -r'
echo ' ./drake' echo ' ./drake'
else else