source: libpipi/trunk/build-win32 @ 2952

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

win32: move GTK# assemblies into the same directory as the rest
of the GTK# runtime.

  • 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}/"
41
42# Install pipi-sharp
43mv "${INSTALLDIR}/lib/pipi-sharp/"* "${INSTALLDIR}/bin/"
44rm -Rf "${INSTALLDIR}/lib/pipi-sharp"
45
46mkdir "${INSTALLDIR}/doc"
47for f in COPYING NOTES; do
48   sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
49done
50rm -f "${INSTALLDIR}/lib/"*.a
51rm -f "${INSTALLDIR}/lib/"*.la
52
53# Pack the directory
54zip "${DIRNAME}.zip" `find "${DIRNAME}"`
55rm -Rf "${INSTALLDIR}"
56
Note: See TracBrowser for help on using the repository browser.