diff --git a/Makefile.am b/Makefile.am index a8ecd70..f7d8be0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,7 +3,7 @@ SUBDIRS = cucul caca src test doc DIST_SUBDIRS = $(SUBDIRS) autotools debian msvc -EXTRA_DIST = NOTES COPYING.LGPL bootstrap build-win32 caca-config.in libcaca.spec +EXTRA_DIST = NOTES COPYING.LGPL bootstrap build-dos build-win32 caca-config.in libcaca.spec AUTOMAKE_OPTIONS = dist-bzip2 bin_SCRIPTS = caca-config diff --git a/build-dos b/build-dos new file mode 100755 index 0000000..4c169ab --- /dev/null +++ b/build-dos @@ -0,0 +1,34 @@ +#! /bin/sh + +## DOS cross-compilation for libcaca -- Sam Hocevar +## $Id$ + +set -x +set -e + +# Clean up our working directory +DIRNAME="libcaca-dos-`sed -ne '/^VERSION/s/[^0-9]*//p' Makefile`" +DESTDIR="`pwd`/${DIRNAME}" +rm -Rf "${DIRNAME}" +rm -f "${DIRNAME}.zip" +mkdir "${DIRNAME}" + +# Build for DOS +./configure --host=i386-pc-msdosdjgpp --prefix=/ --bindir=/ --libdir=/ --disable-imlib2 --disable-doc +make pkglibdir=/lib pkgdatadir=/data + +# Install into our private directory +make install DESTDIR="${DESTDIR}" pkglibdir=/lib pkgdatadir=/ +i386-pc-msdosdjgpp-strip "${DESTDIR}/"*.exe +rm -Rf "${DESTDIR}/man" +rm -Rf "${DESTDIR}/include" +rm -f "${DESTDIR}/caca-config" +rm -f "${DESTDIR}/"*.a +mv "${DESTDIR}/share/doc/libcaca-dev/" "${DESTDIR}/doc" +rmdir "${DESTDIR}/share/doc" +rmdir "${DESTDIR}/share" + +# Pack the directory +zip "${DIRNAME}.zip" `find "${DIRNAME}"` +rm -Rf "${DIRNAME}" + diff --git a/caca/caca_internals.h b/caca/caca_internals.h index c4eed12..ee2c455 100644 --- a/caca/caca_internals.h +++ b/caca/caca_internals.h @@ -22,12 +22,16 @@ #if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME) # include -#else +#elif !defined(CUSTOM_INTTYPES) +# define CUSTOM_INTTYPES typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned int uint32_t; #endif +#if defined(USE_CONIO) +# include +#endif #if defined(USE_GL) # include #endif diff --git a/caca/driver_conio.c b/caca/driver_conio.c index 818c47d..17cce3a 100644 --- a/caca/driver_conio.c +++ b/caca/driver_conio.c @@ -69,7 +69,7 @@ static int conio_end_graphics(caca_t *kk) _wscroll = 1; textcolor((enum COLORS)WHITE); textbackground((enum COLORS)BLACK); - gotoxy(_caca_width, _caca_height); + gotoxy(kk->qq->width, kk->qq->height); cputs("\r\n"); _setcursortype(_NORMALCURSOR); diff --git a/cucul/cucul_internals.h b/cucul/cucul_internals.h index afa843f..adb3bfa 100644 --- a/cucul/cucul_internals.h +++ b/cucul/cucul_internals.h @@ -22,7 +22,8 @@ #if defined(HAVE_INTTYPES_H) || defined(_DOXYGEN_SKIP_ME) # include -#else +#elif !defined(CUSTOM_INTTYPES) +# define CUSTOM_INTTYPES typedef unsigned char uint8_t; typedef unsigned char uint16_t; typedef unsigned int uint32_t;