Browse Source

Add a script to cross-compile Win32 binaries.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2856 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 years ago
parent
commit
e734d0f683
2 changed files with 50 additions and 1 deletions
  1. +1
    -1
      Makefile.am
  2. +49
    -0
      build-win32

+ 1
- 1
Makefile.am View File

@@ -2,6 +2,6 @@

SUBDIRS = pipi src genethumb examples test

EXTRA_DIST = bootstrap common.h NOTES
EXTRA_DIST = bootstrap build-win32 common.h NOTES
AUTOMAKE_OPTIONS = dist-bzip2


+ 49
- 0
build-win32 View File

@@ -0,0 +1,49 @@
#! /bin/sh

## Win32 cross-compilation for libpipi -- Sam Hocevar <sam@zoy.org>
## $Id$

set -x
set -e

# Clean up our working directory
SRCDIR="`pwd`"
DIRNAME="libpipi-win32-`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}"

cd "${BUILDDIR}"
# Build for win32
"${SRCDIR}/configure" --host=i586-mingw32msvc --prefix=/ --bindir=/bin --libdir=/lib --disable-imlib2 --disable-doc
make pkglibdir=/lib pkgdatadir=/data bindir=/bin
# Install into our private directory
make install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
cd "${SRCDIR}"
rm -Rf "${BUILDDIR}"

mv "${INSTALLDIR}/bin/"* "${INSTALLDIR}/"
mv "${INSTALLDIR}/lib/"* "${INSTALLDIR}/"
i586-mingw32msvc-strip "${INSTALLDIR}/"*.exe
i586-mingw32msvc-strip "${INSTALLDIR}/"*.dll
rmdir "${INSTALLDIR}/bin"
rmdir "${INSTALLDIR}/lib"

mkdir "${INSTALLDIR}/doc"
for f in COPYING NOTES; do
sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
done
rm -Rf "${INSTALLDIR}/share"
rm -Rf "${INSTALLDIR}/man"
rm -Rf "${INSTALLDIR}/include"
rm -Rf "${INSTALLDIR}/pkg-config"
rm -f "${INSTALLDIR}/"*.a
rm -f "${INSTALLDIR}/"*.la

# Pack the directory
zip "${DIRNAME}.zip" `find "${DIRNAME}"`
rm -Rf "${INSTALLDIR}"


Loading…
Cancel
Save