source: libpipi/trunk/build-win32 @ 3076

Last change on this file since 3076 was 3076, checked in by Sam Hocevar, 12 years ago

libpipi: improve GDI+ codec cross-compilation.

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#! /bin/sh
2
3##  Win32 cross-compilation for libpipi -- Sam Hocevar <sam@zoy.org>
4##  $Id$
5
6set -x
7set -e
8
9# Clean up our working directory
10PROJECT="ThePimp"
11SRCDIR="`pwd`"
12DIRNAME="${PROJECT}-`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
13INSTALLDIR="`pwd`/${DIRNAME}"
14BUILDDIR="${INSTALLDIR}/build"
15rm -Rf "${INSTALLDIR}"
16rm -f "${INSTALLDIR}.zip"
17mkdir "${INSTALLDIR}"
18mkdir "${BUILDDIR}"
19
20make distclean || true
21
22cd "${BUILDDIR}"
23# Build for win32
24"${SRCDIR}/configure" --host=i586-mingw32msvc --prefix=/ --bindir=/bin --libdir=/lib CPPFLAGS="-I${SRCDIR}/win32/gdiplus/include" LIBS="-L${SRCDIR}/win32/gdiplus/lib" "$@"
25make pkglibdir=/lib pkgdatadir=/data bindir=/bin
26# Install into our private directory
27make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
28# Clean up
29cd "${SRCDIR}"
30rm -Rf "${BUILDDIR}"
31
32#i586-mingw32msvc-strip "${INSTALLDIR}/bin/"*.exe || true
33#i586-mingw32msvc-strip "${INSTALLDIR}/lib/"*.dll || true
34
35# Install gtk-sharp
36cp -r "win32/gtksharp/"* "${INSTALLDIR}/"
37find "${INSTALLDIR}/" -name .svn -prune -exec rm -rf '{}' ';'
38
39# Install pipi-sharp
40mv "${INSTALLDIR}/lib/mono/gac/pipi-sharp/"*/* "${INSTALLDIR}/bin/"
41rm -Rf "${INSTALLDIR}/lib/mono"
42
43# Install The Pimp
44mv "${INSTALLDIR}/lib/ThePimp.exe" "${INSTALLDIR}/bin/"
45echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
46i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe"
47i586-mingw32msvc-strip "${INSTALLDIR}/ThePimp.exe"
48
49# Install documentation
50mkdir "${INSTALLDIR}/doc"
51for f in COPYING NOTES; do
52   sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
53done
54rm -f "${INSTALLDIR}/lib/"*.a
55rm -f "${INSTALLDIR}/lib/"*.la
56
57# Pack the directory
58zip "${DIRNAME}.zip" `find "${DIRNAME}"`
59rm -Rf "${INSTALLDIR}"
60
Note: See TracBrowser for help on using the repository browser.