source: libcaca/trunk/build-win32 @ 4815

Last change on this file since 4815 was 4815, checked in by Sam Hocevar, 8 years ago

build: fix Win32 build and allow to build Win64 binaries from Linux, and
ship the static library and includes too.

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#! /bin/sh
2
3##  Win32 cross-compilation for libcaca -- Sam Hocevar <sam@hocevar.net>
4
5set -x
6set -e
7
8# Clean up our working directory
9SRCDIR="`pwd`"
10DIRNAME="libcaca-win32-`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
11INSTALLDIR="`pwd`/${DIRNAME}"
12BUILDDIR="${INSTALLDIR}/build"
13rm -Rf "${INSTALLDIR}"
14rm -f "${INSTALLDIR}.zip"
15mkdir "${INSTALLDIR}"
16mkdir "${BUILDDIR}"
17
18make distclean || true
19
20cd "${BUILDDIR}"
21# Build for win32
22"${SRCDIR}/configure" --host=i686-w64-mingw32 --build=none --prefix=/ --bindir=/bin --libdir=/lib --disable-imlib2 --disable-java --disable-doc "$@"
23make -j4 pkglibdir=/lib pkgdatadir=/data bindir=/bin
24# Install into our private directory
25make -j4 install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
26cd "${SRCDIR}"
27rm -Rf "${BUILDDIR}"
28
29mv "${INSTALLDIR}/bin/"* "${INSTALLDIR}/"
30rmdir "${INSTALLDIR}/bin"
31mv "${INSTALLDIR}/lib/"* "${INSTALLDIR}/"
32for f in libcaca libcaca++; do
33   mv "${INSTALLDIR}/${f}.a" "${INSTALLDIR}/lib/${f}.lib"
34done
35rm -f "${INSTALLDIR}/caca-config.exe" # Just in case. *sigh*.
36i686-w64-mingw32-strip "${INSTALLDIR}/"*.exe || true
37i686-w64-mingw32-strip "${INSTALLDIR}/"*.dll || true
38
39mkdir "${INSTALLDIR}/doc"
40for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS; do
41   sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
42done
43rm -Rf "${INSTALLDIR}/share"
44rm -Rf "${INSTALLDIR}/man"
45rm -Rf "${INSTALLDIR}/pkgconfig"
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.