source: libcaca/trunk/build-win32 @ 2900

Last change on this file since 2900 was 2859, checked in by Sam Hocevar, 14 years ago

Fix the Win32 build.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.5 KB
Line 
1#! /bin/sh
2
3##  Win32 cross-compilation for libcaca -- Sam Hocevar <sam@zoy.org>
4##  $Id: build-win32 2859 2008-09-29 23:03:34Z sam $
5
6set -x
7set -e
8
9# Clean up our working directory
10SRCDIR="`pwd`"
11DIRNAME="libcaca-win32-`sed -ne 's/^AM_INIT_AUTOMAKE(.*, \(.*\)).*/\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 --disable-imlib2 --disable-doc
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}/"
32rm -f "${INSTALLDIR}/caca-config.exe" # Just in case. *sigh*.
33i586-mingw32msvc-strip "${INSTALLDIR}/"*.exe
34i586-mingw32msvc-strip "${INSTALLDIR}/"*.dll
35rmdir "${INSTALLDIR}/bin"
36rmdir "${INSTALLDIR}/lib"
37
38mkdir "${INSTALLDIR}/doc"
39for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS; do
40   sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
41done
42rm -Rf "${INSTALLDIR}/share"
43rm -Rf "${INSTALLDIR}/man"
44rm -Rf "${INSTALLDIR}/include"
45rm -Rf "${INSTALLDIR}/pkg-config"
46rm -f "${INSTALLDIR}/caca-config"
47rm -f "${INSTALLDIR}/"*.a
48rm -f "${INSTALLDIR}/"*.la
49
50# Pack the directory
51zip "${DIRNAME}.zip" `find "${DIRNAME}"`
52rm -Rf "${INSTALLDIR}"
53
Note: See TracBrowser for help on using the repository browser.