source: libpipi/trunk/build-win32 @ 2947

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

ThePimp?: improve Visual Studio solution and cross-build script. We can
now build and run The Pimp without installing GTK# for Windows.

  • Property svn:executable set to *
File size: 1.6 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 "$@"
25make pkglibdir=/lib pkgdatadir=/data bindir=/bin
26# Install into our private directory
27make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
28# Create a launcher
29echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
30i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe"
31i586-mingw32msvc-strip "${INSTALLDIR}/ThePimp.exe"
32# Clean up
33cd "${SRCDIR}"
34rm -Rf "${BUILDDIR}"
35
36#i586-mingw32msvc-strip "${INSTALLDIR}/bin/"*.exe || true
37#i586-mingw32msvc-strip "${INSTALLDIR}/lib/"*.dll || true
38
39# Install gtk-sharp
40cp -r "win32/dist/"* "${INSTALLDIR}/"
41cp -r "win32/assembly/"* "${INSTALLDIR}/bin/"
42
43# Install pipi-sharp
44mv "${INSTALLDIR}/lib/pipi-sharp/"* "${INSTALLDIR}/bin/"
45rm -Rf "${INSTALLDIR}/lib/pipi-sharp"
46
47mkdir "${INSTALLDIR}/doc"
48for f in COPYING NOTES; do
49   sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
50done
51rm -f "${INSTALLDIR}/lib/"*.a
52rm -f "${INSTALLDIR}/lib/"*.la
53
54# Pack the directory
55zip "${DIRNAME}.zip" `find "${DIRNAME}"`
56rm -Rf "${INSTALLDIR}"
57
Note: See TracBrowser for help on using the repository browser.