|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:36
|
Module: performous Branch: joinmenu Commit: 568c57316d70c5536e2699b687c65fdfaf0651b4 Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 9 00:04:23 2010 +0300 WIP cross-compilation scripts for Win32 using mingw-cross-env. --- win32/mingw-cross-env/README | 14 +++++++ win32/mingw-cross-env/make-deps.sh | 51 +++++++++++++++++++++++++++ win32/mingw-cross-env/mk/glibmm.mk | 35 ++++++++++++++++++ win32/mingw-cross-env/mk/liborc.mk | 29 +++++++++++++++ win32/mingw-cross-env/mk/libschroedinger.mk | 29 +++++++++++++++ win32/mingw-cross-env/mk/libsigc++.mk | 35 ++++++++++++++++++ win32/mingw-cross-env/mk/libxml++.mk | 33 +++++++++++++++++ 7 files changed, 226 insertions(+), 0 deletions(-) diff --git a/win32/mingw-cross-env/README b/win32/mingw-cross-env/README new file mode 100644 index 0000000..dc6f5ae --- /dev/null +++ b/win32/mingw-cross-env/README @@ -0,0 +1,14 @@ +Cross-compiling Performous and dependencies using mingw-cross-env +================================================================= + +This is WIP. + +"Mingw cross compiling environment" http://mingw-cross-env.nongnu.org/ provides makefile scripts to download and compile a recent version of gcc cross-compiler and a good amount of additional libraries. Not all of Performous' dependencies are in, but most are and the rest have scripts here. + +Use the make-deps.sh script to build the dependencies. Note that it builds a bit more stuff than is strictly required but well just need to live with it. It also builds static libraries, not shared ones. + +Note: you could maybe try just building the compiler with this and then try the cross-from-debian scripts with the compiler variables pointing to this, newer mingw. + +TODO: Add make-performous.sh script, that creates the needed Toolchain.cmake file and does the manual linking + + diff --git a/win32/mingw-cross-env/make-deps.sh b/win32/mingw-cross-env/make-deps.sh new file mode 100755 index 0000000..c2554e2 --- /dev/null +++ b/win32/mingw-cross-env/make-deps.sh @@ -0,0 +1,51 @@ +#!/bin/bash -e + +if [ ! "$1" ]; then + echo "Usage: $0 prefix-path" + exit 1 +fi + +prefix="$1" + +# Create the prefix path and copy our own suplementary scripts +mkdir -p "$prefix/src" +cp mk/*.mk "$prefix/src" + +# Download the cross env if needed +if [ ! -f "$prefix/Makefile" ]; then + crossenvpackage=mingw-cross-env-2.15 + cd /tmp + wget http://download.savannah.nongnu.org/releases/mingw-cross-env/$crossenvpackage.tar.gz + tar zxf $crossenvpackage.tar.gz + cp -r $crossenvpackage/* "$prefix" + rm -rf $crossenvpackage +fi + +cd "$prefix" + +echo "Make gcc" +make gcc + +echo "Make deps" +make zlib libpng jpeg glew freeglutnsdl boost atk cairo fontconfig freetype gettext glib gtk libcroco libgsf libiconv librsvg libxml2 pango pixman portaudio libsigc++ libglibmm libxml++ liborc libschroedinger + +echo "Make ffmpeg from SVN" +TARGET=i686-pc-mingw32 +export PATH="$prefix/usr/bin:$PATH" +export PKG_CONFIG_PATH=$prefix/usr/i686-pc-mingw32/lib/pkgconfig/ + +# Checkout / update from svn +if [ ! -d ffmpeg ]; then + svn co svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg +else + svn up ffmpeg +fi + +cd ffmpeg + ./configure --prefix="$prefix/usr/$TARGET" --enable-cross-compile --cross-prefix="$TARGET-" --target-os=mingw32 --arch=i386 --disable-shared --enable-static --enable-gpl --enable-postproc --enable-w32threads --enable-runtime-cpudetect --enable-memalign-hack --enable-zlib --enable-libschroedinger --disable-muxers --disable-encoders --disable-ffserver --disable-ffplay --disable-protocol=http --disable-protocol=rtp --disable-protocol=tcp --disable-protocol=udp --extra-cflags="-I$prefix/usr/$TARGET/include" --extra-ldflags="-L$prefix/usr/$TARGET/lib" + sed -i -e 's/-Werror=[^ ]*//g' config.mak + make -j2 + make install +cd .. + +echo "All done" diff --git a/win32/mingw-cross-env/mk/glibmm.mk b/win32/mingw-cross-env/mk/glibmm.mk new file mode 100644 index 0000000..2ebb304 --- /dev/null +++ b/win32/mingw-cross-env/mk/glibmm.mk @@ -0,0 +1,35 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# GLibmm +PKG := glibmm +$(PKG)_IGNORE := +$(PKG)_VERSION := 2.24.2 +$(PKG)_CHECKSUM := df5f22d2c40ebdf097ecdb4a7dfeef70d1ca24e7 +$(PKG)_SUBDIR := glibmm-$($(PKG)_VERSION) +$(PKG)_FILE := glibmm-$($(PKG)_VERSION).tar.bz2 +$(PKG)_WEBSITE := http://www.gtkmm.org/ +$(PKG)_URL := http://ftp.gnome.org/pub/GNOME/sources/glibmm/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) +$(PKG)_DEPS := glib + +define $(PKG)_UPDATE + wget -q -O- 'http://git.gnome.org/browse/glibmm/refs/tags' | \ + grep '<a href=' | \ + $(SED) -n 's,.*<a[^>]*>glibmm-*\([0-9][^<]*\)<.*,\1,p' | \ + grep -v '^2\.24\.' | \ + head -1 +endef + +define $(PKG)_BUILD + # cross build + # wine confuses the cross-compiling detection, so set it explicitly + $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/configure' + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' \ + --with-threads=win32 \ + CXX='$(TARGET)-c++' \ + PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' + $(MAKE) -C '$(1)' -j '$(JOBS)' install +endef diff --git a/win32/mingw-cross-env/mk/liborc.mk b/win32/mingw-cross-env/mk/liborc.mk new file mode 100644 index 0000000..f3cf9a6 --- /dev/null +++ b/win32/mingw-cross-env/mk/liborc.mk @@ -0,0 +1,29 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# liborc +PKG := liborc +$(PKG)_IGNORE := +$(PKG)_VERSION := 0.4.5 +$(PKG)_CHECKSUM := e24d485093a5e5412b4917e4d89ecd89fad3721b +$(PKG)_SUBDIR := orc-$($(PKG)_VERSION) +$(PKG)_FILE := orc-$($(PKG)_VERSION).tar.gz +$(PKG)_WEBSITE := http://code.entropywave.com/ +$(PKG)_URL := http://code.entropywave.com/download/orc/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + wget -q -O- 'http://FIXME' | \ + grep '<a href=' | \ + $(SED) -n "s,.*<a href='[^']*/tag/?id=v\\([0-9][^']*\\)'.*,\\1,p" | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install +endef diff --git a/win32/mingw-cross-env/mk/libschroedinger.mk b/win32/mingw-cross-env/mk/libschroedinger.mk new file mode 100644 index 0000000..62506d5 --- /dev/null +++ b/win32/mingw-cross-env/mk/libschroedinger.mk @@ -0,0 +1,29 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# libschroedinger +PKG := libschroedinger +$(PKG)_IGNORE := +$(PKG)_VERSION := 1.0.9 +$(PKG)_CHECKSUM := b4121e10cc474c97676e03ae49c5a91c11956ba0 +$(PKG)_SUBDIR := schroedinger-$($(PKG)_VERSION) +$(PKG)_FILE := schroedinger-$($(PKG)_VERSION).tar.gz +$(PKG)_WEBSITE := http://diracvideo.org/ +$(PKG)_URL := http://diracvideo.org/download/schroedinger/$($(PKG)_FILE) +$(PKG)_DEPS := gcc liborc + +define $(PKG)_UPDATE + wget -q -O- 'http://FIXME' | \ + grep '<a href=' | \ + $(SED) -n "s,.*<a href='[^']*/tag/?id=v\\([0-9][^']*\\)'.*,\\1,p" | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install +endef diff --git a/win32/mingw-cross-env/mk/libsigc++.mk b/win32/mingw-cross-env/mk/libsigc++.mk new file mode 100644 index 0000000..27e20e5 --- /dev/null +++ b/win32/mingw-cross-env/mk/libsigc++.mk @@ -0,0 +1,35 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# GLib +PKG := libsigc++ +$(PKG)_IGNORE := +$(PKG)_VERSION := 2.2.8 +$(PKG)_CHECKSUM := c26f57110629c16c0b5a873346b7c1cf0edc9c5e +$(PKG)_SUBDIR := libsigc++-$($(PKG)_VERSION) +$(PKG)_FILE := libsigc++-$($(PKG)_VERSION).tar.bz2 +$(PKG)_WEBSITE := http://libsigc.sourceforge.net/ +$(PKG)_URL := http://ftp.gnome.org/pub/GNOME/sources/libsigc++/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + wget -q -O- 'http://FIXME' | \ + grep '<a href=' | \ + $(SED) -n 's,.*<a[^>]*>libsigc++-*\([0-9][^<]*\)<.*,\1,p' | \ + grep -v '^2\.24\.' | \ + head -1 +endef + +define $(PKG)_BUILD + # cross build + # wine confuses the cross-compiling detection, so set it explicitly + $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/configure' + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' \ + --with-threads=win32 \ + CXX='$(TARGET)-c++' \ + PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' + $(MAKE) -C '$(1)' -j '$(JOBS)' install +endef diff --git a/win32/mingw-cross-env/mk/libxml++.mk b/win32/mingw-cross-env/mk/libxml++.mk new file mode 100644 index 0000000..4ff81d5 --- /dev/null +++ b/win32/mingw-cross-env/mk/libxml++.mk @@ -0,0 +1,33 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# libxml++ +PKG := libxml++ +$(PKG)_IGNORE := +$(PKG)_VERSION := 2.30.1 +$(PKG)_CHECKSUM := 0fc6fc14c4751754037beb46f387fa7d069fe2c9 +$(PKG)_SUBDIR := libxml++-$($(PKG)_VERSION) +$(PKG)_FILE := libxml++-$($(PKG)_VERSION).tar.gz +$(PKG)_WEBSITE := http://libxmlplusplus.sourceforge.net/ +$(PKG)_URL := http://ftp.gnome.org/pub/GNOME/sources/libxml++/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) +$(PKG)_DEPS := libxml2 glibmm + +define $(PKG)_UPDATE + wget -q -O- 'http://git.gnome.org/browse/libxml++/refs/tags' | \ + grep '<a href=' | \ + $(SED) -n "s,.*<a href='[^']*/tag/?id=v\\([0-9][^']*\\)'.*,\\1,p" | \ + head -1 +endef + +define $(PKG)_BUILD + #$(SED) -i 's,`uname`,MinGW,g' '$(1)/xml2-config.in' + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --without-debug \ + --prefix='$(PREFIX)/$(TARGET)' \ + --without-python \ + --without-threads + $(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= +endef |