source: libpipi/trunk/build-win32 @ 3096

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

Add a launcher for pipi.exe in the Win32 package.

  • Property svn:executable set to *
File size: 2.1 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 pipi.exe
36echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\pipi.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
37i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/pipi.exe"
38i586-mingw32msvc-strip "${INSTALLDIR}/pipi.exe"
39
40# Install gtk-sharp
41cp -r "win32/gtksharp/"* "${INSTALLDIR}/"
42find "${INSTALLDIR}/" -name .svn -prune -exec rm -rf '{}' ';'
43
44# Install pipi-sharp
45mv "${INSTALLDIR}/lib/mono/gac/pipi-sharp/"*/* "${INSTALLDIR}/bin/"
46rm -Rf "${INSTALLDIR}/lib/mono"
47
48# Install The Pimp
49mv "${INSTALLDIR}/lib/ThePimp.exe" "${INSTALLDIR}/bin/"
50echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
51i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe"
52i586-mingw32msvc-strip "${INSTALLDIR}/ThePimp.exe"
53
54# Install documentation
55mkdir "${INSTALLDIR}/doc"
56for f in COPYING NOTES; do
57   sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
58done
59rm -f "${INSTALLDIR}/lib/"*.a
60rm -f "${INSTALLDIR}/lib/"*.la
61
62# Pack the directory
63zip "${DIRNAME}.zip" `find "${DIRNAME}"`
64rm -Rf "${INSTALLDIR}"
65
Note: See TracBrowser for help on using the repository browser.