source: libpipi/trunk/build-win32 @ 3146

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

Append SVN release ID to ThePimp? binaries.

  • Property svn:executable set to *
File size: 2.3 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`"
12VERSION="`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
13if [ -f .git/svn/trunk/unhandled.log ]; then
14  VERSION="${VERSION}-`grep '^r' .git/svn/trunk/unhandled.log | tail -n 1`"
15elif [ -f .svn/entries ]; then
16  VERSION="${VERSION}-r`head -n 4 .svn/entries | tail -n 1`"
17fi
18DIRNAME="${PROJECT}-${VERSION}"
19INSTALLDIR="`pwd`/${DIRNAME}"
20BUILDDIR="${INSTALLDIR}/build"
21rm -Rf "${INSTALLDIR}"
22rm -f "${INSTALLDIR}.zip"
23mkdir "${INSTALLDIR}"
24mkdir "${BUILDDIR}"
25
26make distclean || true
27
28cd "${BUILDDIR}"
29# Build for win32
30"${SRCDIR}/configure" --host=i586-mingw32msvc --prefix=/ --bindir=/bin --libdir=/lib CPPFLAGS="-I${SRCDIR}/win32/gdiplus/include" LIBS="-L${SRCDIR}/win32/gdiplus/lib" "$@"
31make pkglibdir=/lib pkgdatadir=/data bindir=/bin
32# Install into our private directory
33make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
34# Clean up
35cd "${SRCDIR}"
36rm -Rf "${BUILDDIR}"
37
38#i586-mingw32msvc-strip "${INSTALLDIR}/bin/"*.exe || true
39#i586-mingw32msvc-strip "${INSTALLDIR}/lib/"*.dll || true
40
41# Install pipi.exe
42echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\pipi.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
43i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/pipi.exe"
44i586-mingw32msvc-strip "${INSTALLDIR}/pipi.exe"
45
46# Install gtk-sharp
47cp -r "win32/gtksharp/"* "${INSTALLDIR}/"
48find "${INSTALLDIR}/" -name .svn -prune -exec rm -rf '{}' ';'
49
50# Install pipi-sharp
51mv "${INSTALLDIR}/lib/mono/gac/pipi-sharp/"*/* "${INSTALLDIR}/bin/"
52rm -Rf "${INSTALLDIR}/lib/mono"
53
54# Install The Pimp
55mv "${INSTALLDIR}/lib/ThePimp.exe" "${INSTALLDIR}/bin/"
56echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
57i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe"
58i586-mingw32msvc-strip "${INSTALLDIR}/ThePimp.exe"
59
60# Install documentation
61mkdir "${INSTALLDIR}/doc"
62for f in COPYING NOTES; do
63   sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
64done
65rm -f "${INSTALLDIR}/lib/"*.a
66rm -f "${INSTALLDIR}/lib/"*.la
67
68# Pack the directory
69zip "${DIRNAME}.zip" `find "${DIRNAME}"`
70rm -Rf "${INSTALLDIR}"
71
Note: See TracBrowser for help on using the repository browser.