- #! /bin/sh
-
- ## Win32 cross-compilation for libpipi -- Sam Hocevar <sam@zoy.org>
- ## $Id$
-
- set -x
- set -e
-
- # Clean up our working directory
- PROJECT="ThePimp"
- SRCDIR="`pwd`"
- DIRNAME="${PROJECT}-`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
- INSTALLDIR="`pwd`/${DIRNAME}"
- BUILDDIR="${INSTALLDIR}/build"
- rm -Rf "${INSTALLDIR}"
- rm -f "${INSTALLDIR}.zip"
- mkdir "${INSTALLDIR}"
- mkdir "${BUILDDIR}"
-
- make distclean || true
-
- cd "${BUILDDIR}"
- # Build for win32
- "${SRCDIR}/configure" --host=i586-mingw32msvc --prefix=/ --bindir=/bin --libdir=/lib "$@"
- make pkglibdir=/lib pkgdatadir=/data bindir=/bin
- # Install into our private directory
- make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
- # Create a launcher
- echo 'int main(int argc, char *argv[], char *envp[]) { argv[0] = ".\\bin\\ThePimp.exe"; execve(argv[0], argv, envp); return 0; }' > run.c
- i586-mingw32msvc-gcc run.c -mwindows -o "${INSTALLDIR}/ThePimp.exe"
- i586-mingw32msvc-strip "${INSTALLDIR}/ThePimp.exe"
- # Clean up
- cd "${SRCDIR}"
- rm -Rf "${BUILDDIR}"
-
- #i586-mingw32msvc-strip "${INSTALLDIR}/bin/"*.exe || true
- #i586-mingw32msvc-strip "${INSTALLDIR}/lib/"*.dll || true
-
- # Install gtk-sharp
- cp -r "win32/gtksharp/"* "${INSTALLDIR}/"
- find "${INSTALLDIR}/" -name .svn -prune -exec rm -rf '{}' ';'
-
- # Install pipi-sharp
- mv "${INSTALLDIR}/lib/pipi-sharp/"* "${INSTALLDIR}/bin/"
- rm -Rf "${INSTALLDIR}/lib/pipi-sharp"
-
- mkdir "${INSTALLDIR}/doc"
- for f in COPYING NOTES; do
- sed -e 's/$/
/' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
- done
- rm -f "${INSTALLDIR}/lib/"*.a
- rm -f "${INSTALLDIR}/lib/"*.la
-
- # Pack the directory
- zip "${DIRNAME}.zip" `find "${DIRNAME}"`
- rm -Rf "${INSTALLDIR}"
-
|