Sfoglia il codice sorgente

build: fix Win32 build and allow to build Win64 binaries from Linux, and

ship the static library and includes too.
tags/v0.99.beta19
Sam Hocevar sam 12 anni fa
parent
commit
b2e484ffe0
4 ha cambiato i file con 67 aggiunte e 11 eliminazioni
  1. +1
    -1
      Makefile.am
  2. +11
    -10
      build-win32
  3. +53
    -0
      build-win64
  4. +2
    -0
      caca/caca.h

+ 1
- 1
Makefile.am Vedi File

@@ -4,7 +4,7 @@ SUBDIRS = kernel caca src examples tools \
doc test
DIST_SUBDIRS = $(SUBDIRS) win32

EXTRA_DIST = NOTES COPYING.GPL COPYING.ISC COPYING.LGPL bootstrap build-dos build-kernel build-win32 caca-config.in libcaca.spec libcaca.sln
EXTRA_DIST = NOTES COPYING.GPL COPYING.ISC COPYING.LGPL bootstrap build-dos build-kernel build-win32 build-win64 caca-config.in libcaca.spec libcaca.sln
AUTOMAKE_OPTIONS = dist-bzip2

bin_SCRIPTS = caca-config


+ 11
- 10
build-win32 Vedi File

@@ -7,7 +7,7 @@ set -e

# Clean up our working directory
SRCDIR="`pwd`"
DIRNAME="libpipi-win32-`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
DIRNAME="libcaca-win32-`sed -ne 's/^AC_INIT(.*, \(.*\)).*/\1/p' configure.ac`"
INSTALLDIR="`pwd`/${DIRNAME}"
BUILDDIR="${INSTALLDIR}/build"
rm -Rf "${INSTALLDIR}"
@@ -19,20 +19,22 @@ make distclean || true

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

mv "${INSTALLDIR}/bin/"* "${INSTALLDIR}/"
rmdir "${INSTALLDIR}/bin"
mv "${INSTALLDIR}/lib/"* "${INSTALLDIR}/"
for f in libcaca libcaca++; do
mv "${INSTALLDIR}/${f}.a" "${INSTALLDIR}/lib/${f}.lib"
done
rm -f "${INSTALLDIR}/caca-config.exe" # Just in case. *sigh*.
i586-mingw32msvc-strip "${INSTALLDIR}/"*.exe || true
i586-mingw32msvc-strip "${INSTALLDIR}/"*.dll || true
rmdir "${INSTALLDIR}/bin"
rmdir "${INSTALLDIR}/lib"
i686-w64-mingw32-strip "${INSTALLDIR}/"*.exe || true
i686-w64-mingw32-strip "${INSTALLDIR}/"*.dll || true

mkdir "${INSTALLDIR}/doc"
for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS; do
@@ -40,8 +42,7 @@ for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS; do
done
rm -Rf "${INSTALLDIR}/share"
rm -Rf "${INSTALLDIR}/man"
rm -Rf "${INSTALLDIR}/include"
rm -Rf "${INSTALLDIR}/pkg-config"
rm -Rf "${INSTALLDIR}/pkgconfig"
rm -f "${INSTALLDIR}/caca-config"
rm -f "${INSTALLDIR}/"*.a
rm -f "${INSTALLDIR}/"*.la


+ 53
- 0
build-win64 Vedi File

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

## Win32 cross-compilation for libcaca -- Sam Hocevar <sam@hocevar.net>

set -x
set -e

# Clean up our working directory
SRCDIR="`pwd`"
DIRNAME="libcaca-win64-`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 win64
"${SRCDIR}/configure" --host=x86_64-w64-mingw32 --build=none --prefix=/ --bindir=/bin --libdir=/lib --disable-imlib2 --disable-java --disable-doc "$@"
make -j4 pkglibdir=/lib pkgdatadir=/data bindir=/bin
# Install into our private directory
make -j4 install DESTDIR="${INSTALLDIR}" pkglibdir=/lib/ pkgdatadir=/ bindir=/bin/
cd "${SRCDIR}"
rm -Rf "${BUILDDIR}"

mv "${INSTALLDIR}/bin/"* "${INSTALLDIR}/"
rmdir "${INSTALLDIR}/bin"
mv "${INSTALLDIR}/lib/"* "${INSTALLDIR}/"
for f in libcaca libcaca++; do
mv "${INSTALLDIR}/${f}.a" "${INSTALLDIR}/lib/${f}.lib"
done
rm -f "${INSTALLDIR}/caca-config.exe" # Just in case. *sigh*.
x86_64-w64-mingw32-strip "${INSTALLDIR}/"*.exe || true
x86_64-w64-mingw32-strip "${INSTALLDIR}/"*.dll || true

mkdir "${INSTALLDIR}/doc"
for f in COPYING COPYING.LGPL COPYING.GPL README AUTHORS NEWS NOTES THANKS; do
sed -e 's/$/ /' < "${SRCDIR}/${f}" > "${INSTALLDIR}/doc/${f}.txt"
done
rm -Rf "${INSTALLDIR}/share"
rm -Rf "${INSTALLDIR}/man"
rm -Rf "${INSTALLDIR}/pkgconfig"
rm -f "${INSTALLDIR}/caca-config"
rm -f "${INSTALLDIR}/"*.a
rm -f "${INSTALLDIR}/"*.la

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


+ 2
- 0
caca/caca.h Vedi File

@@ -720,12 +720,14 @@ __extern cucul_buffer_t * cucul_export_canvas(caca_canvas_t *,
char const *) CACA_DEPRECATED;
__extern caca_canvas_t * cucul_import_canvas(cucul_buffer_t *,
char const *) CACA_DEPRECATED;
#if !defined _WIN32 || !defined __GNUC__
__extern ssize_t caca_import_memory(caca_canvas_t *, void const *, size_t,
char const *) CACA_DEPRECATED;
__extern ssize_t caca_import_file(caca_canvas_t *, char const *,
char const *) CACA_DEPRECATED;
__extern void *caca_export_memory(caca_canvas_t const *, char const *,
size_t *) CACA_DEPRECATED;
#endif
__extern int cucul_rotate(caca_canvas_t *) CACA_DEPRECATED;
__extern int cucul_set_dither_invert(caca_dither_t *, int) CACA_DEPRECATED;
__extern int cucul_set_dither_mode(caca_dither_t *,


Caricamento…
Annulla
Salva