source: libpipi/trunk/build-win32 @ 2902

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

build-win32: pass script arguments to configure, to allow --disable-shared.

  • Property svn:executable set to *
File size: 1.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
10SRCDIR="`pwd`"
11DIRNAME="libpipi-win32-`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
12INSTALLDIR="`pwd`/${DIRNAME}"
13BUILDDIR="${INSTALLDIR}/build"
14rm -Rf "${INSTALLDIR}"
15rm -f "${INSTALLDIR}.zip"
16mkdir "${INSTALLDIR}"
17mkdir "${BUILDDIR}"
18
19make distclean || true
20
21cd "${BUILDDIR}"
22# Build for win32
23"${SRCDIR}/configure" --host=i586-mingw32msvc --prefix=/ --bindir=/bin --libdir=/lib "$@"
24make pkglibdir=/lib pkgdatadir=/data bindir=/bin
25# Install into our private directory
26make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
27cd "${SRCDIR}"
28rm -Rf "${BUILDDIR}"
29
30mv "${INSTALLDIR}/bin/"* "${INSTALLDIR}/"
31mv "${INSTALLDIR}/lib/"* "${INSTALLDIR}/"
32i586-mingw32msvc-strip "${INSTALLDIR}/"*.exe || true
33i586-mingw32msvc-strip "${INSTALLDIR}/"*.dll || true
34rmdir "${INSTALLDIR}/bin"
35rmdir "${INSTALLDIR}/lib"
36
37mkdir "${INSTALLDIR}/doc"
38for f in COPYING NOTES; do
39   sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
40done
41rm -Rf "${INSTALLDIR}/share"
42rm -Rf "${INSTALLDIR}/man"
43rm -Rf "${INSTALLDIR}/include"
44rm -Rf "${INSTALLDIR}/pkg-config"
45rm -f "${INSTALLDIR}/"*.a
46rm -f "${INSTALLDIR}/"*.la
47
48# Pack the directory
49zip "${DIRNAME}.zip" `find "${DIRNAME}"`
50rm -Rf "${INSTALLDIR}"
51
Note: See TracBrowser for help on using the repository browser.