Permalink
Browse files

All source files now include config.h, which contains system-dependen…

…t defines provided by the build system; optional sources (such as display_sdl.c) are now handled in configure.in to facilitate this.
  • Loading branch information...
bitman
bitman committed May 28, 2005
1 parent 42a765b commit 055735c434a787d794010e0ca620365d20b64a84
Showing with 423 additions and 119 deletions.
  1. +2 −0 bootstrap.sh
  2. +41 −36 configure.in
  3. +5 −1 src/dialogs/dialog.c
  4. +5 −7 src/dialogs/files.c
  5. +5 −1 src/dialogs/infobox.c
  6. +5 −1 src/dialogs/paramed.c
  7. +5 −7 src/display/Makefile.am
  8. +11 −7 src/display/display.c
  9. +5 −1 src/display/display_dos.c
  10. +5 −1 src/display/display_sdl.c
  11. +9 −4 src/display/display_stdio.c
  12. +5 −1 src/display/test.c
  13. +6 −1 src/display/textblock.c
  14. +2 −0 src/help/Makefile.am
  15. +6 −2 src/help/help.c
  16. +5 −1 src/help/helplist.c
  17. +5 −1 src/help/hypertxt.c
  18. +2 −0 src/kevedit/Makefile.am
  19. +5 −1 src/kevedit/kevedit.c
  20. +5 −1 src/kevedit/main.c
  21. +5 −1 src/kevedit/menu.c
  22. +5 −1 src/kevedit/misc.c
  23. +5 −1 src/kevedit/patbuffer.c
  24. +5 −1 src/kevedit/screen.c
  25. +5 −1 src/libzzt2/board.c
  26. +5 −1 src/libzzt2/file.c
  27. +5 −1 src/libzzt2/params.c
  28. +5 −1 src/libzzt2/strtools.c
  29. +23 −0 src/libzzt2/test.c
  30. +5 −1 src/libzzt2/tiles.c
  31. +5 −1 src/libzzt2/world.c
  32. +5 −1 src/libzzt2/zztoop.c
  33. +5 −1 src/structures/gradient.c
  34. +5 −1 src/structures/linkedlist.c
  35. +5 −1 src/structures/selection.c
  36. +5 −1 src/structures/svector.c
  37. +8 −2 src/structures/test.c
  38. +5 −8 src/synth/Makefile.am
  39. +5 −1 src/synth/notes.c
  40. +5 −1 src/synth/pcspeaker.c
  41. +23 −0 src/synth/play.c
  42. +5 −1 src/synth/sdl_synth.c
  43. +5 −1 src/synth/zzm.c
  44. +11 −1 src/texteditor/display.c
  45. +5 −1 src/texteditor/editbox.c
  46. +7 −1 src/texteditor/lineeditor.c
  47. +5 −1 src/texteditor/register.c
  48. +8 −1 src/texteditor/select.c
  49. +25 −0 src/texteditor/test.c
  50. +5 −1 src/texteditor/texteditor.c
  51. +5 −1 src/texteditor/zoopdraw.c
  52. +5 −1 src/texteditor/zzl.c
  53. +5 −1 src/texteditor/zzm.c
  54. +5 −1 src/zlaunch/dosemu.c
  55. +22 −3 src/zlaunch/zlaunch.c
  56. +22 −3 src/zlaunch/zlmain.c
View
@@ -59,6 +59,8 @@ if test -z $fast; then
aclocal && \
echo "$this: Running autoconf..." && \
autoconf && \
echo "$this: Running autoheader..." && \
autoheader && \
echo "$this: Running automake..." && \
automake --add-missing || exit
fi
View
@@ -1,12 +1,14 @@
dnl Process this file with autoconf to produce a configure script.
AC_REVISION([$Id: configure.in,v 1.9 2005/05/27 05:02:55 bitman Exp $])
AC_REVISION([$Id: configure.in,v 1.10 2005/05/28 03:17:44 bitman Exp $])
AC_INIT(KevEdit, 0.5.1, bitman@users.sourceforge.net, kevedit)
AC_CONFIG_SRCDIR(src/kevedit/kevedit.c)
AC_CONFIG_SRCDIR([src/kevedit/kevedit.c])
AC_CONFIG_HEADER([src/config.h])
dnl Detect host and target build environment
dnl Detect host and target environments (target is needed by AM_PATH_SDL)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
dnl Use automake
AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
@@ -20,39 +22,47 @@ dnl Determine available displays
AC_MSG_NOTICE(Searching for available displays)
dnl Check for SDL
AM_PATH_SDL(1.2.0,
AC_MSG_NOTICE(Using SDL display and sound)
AC_DEFINE(SDL)
sdl=true,
AC_MSG_NOTICE(SDL not available for display))
AM_PATH_SDL(1.2.0, [AC_MSG_NOTICE(Using SDL display and sound)
sdl=true],
[AC_MSG_NOTICE(SDL not available for display)])
dnl This must be done before most checks because it can affect what headers
dnl and libraries are available
CFLAGS="$CFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AM_CONDITIONAL(SDL, test x$sdl = xtrue)
if test x$sdl = xtrue; then
AC_DEFINE(SDL, [1], [Define to 1 if SDL is available])
display_objects="$display_objects display_sdl.o"
synth_objects="$synth_objects sdl_synth.o"
fi
#AM_CONDITIONAL(SDL, [test x$sdl = xtrue])
dnl Check for DOS display
case "$host" in
*-*-msdos*)
AC_MSG_NOTICE(Using DOS display and pcspeaker sound)
AC_DEFINE(DOS)
dos=true
;;
*)
AC_MSG_NOTICE(DOS display not available)
;;
esac
AM_CONDITIONAL(DOS, test x$dos = xtrue)
if test x$dos = xtrue; then
AC_DEFINE(DOS, [1], [Define to 1 if host is DOS])
display_objects="$display_objects display_dos.o"
synth_objects="$synth_objects pcspeaker.o"
fi
#AM_CONDITIONAL(DOS, [test x$dos = xtrue])
AC_SUBST([display_objects])
AC_SUBST([synth_objects])
dnl Check for windows resource compiler.
AC_CHECK_PROGS(WINDRES, windres)
AC_SUBST(WINDRES)
AM_CONDITIONAL(HAVE_WINDRES, test x$WINDRES != x)
AM_CONDITIONAL(HAVE_WINDRES, [test x$WINDRES != x])
dnl Checks for header files.
AC_HEADER_STDC
@@ -82,23 +92,18 @@ dnl Check for windows (for glob's sake)
AC_MSG_CHECKING(for Windows)
case "$host" in
*-*-*cygwin*)
AC_DEFINE(WINDOWS32)
AC_DEFINE(WINDOWS32, [1], [Define to 1 if host is Windows])
AC_MSG_RESULT(yes: cygwin)
;;
*-*-*mingw32*)
AC_DEFINE(WINDOWS32)
AC_DEFINE(WINDOWS32, [1], [Define to 1 if host is Windows])
AC_MSG_RESULT(yes: MingW)
;;
*)
AC_MSG_RESULT(no)
;;
esac
dnl Define some random things for the sake of the old build system
AC_DEFINE(CANGLOB)
AC_DEFINE_UNQUOTED(keveditVERSION, "$PACKAGE_VERSION")
AC_DEFINE_UNQUOTED(DATAPATH, ".")
dnl Check for glob and add it to CPPFLAGS
AC_PROG_GNU_GLOB
CPPFLAGS="$CPPFLAGS $GLOBINC"
@@ -108,21 +113,21 @@ AC_SUBST(INCLUDE_PATHS) INCLUDE_PATHS='-I$(top_srcdir)/src -I$(top_builddir)'
CPPFLAGS="$CPPFLAGS $INCLUDE_PATHS"
AC_CONFIG_FILES([docs/Makefile
glob/Makefile
inst/kevedit.spec
src/libzzt2/Makefile
src/structures/Makefile
src/display/Makefile
src/synth/Makefile
src/themes/Makefile
src/themes/rusty/Makefile
src/texteditor/Makefile
src/help/Makefile
src/dialogs/Makefile
src/zlaunch/Makefile
src/kevedit/Makefile
src/Makefile
Makefile
buildinfo.h])
glob/Makefile
inst/kevedit.spec
src/libzzt2/Makefile
src/structures/Makefile
src/display/Makefile
src/synth/Makefile
src/themes/Makefile
src/themes/rusty/Makefile
src/texteditor/Makefile
src/help/Makefile
src/dialogs/Makefile
src/zlaunch/Makefile
src/kevedit/Makefile
src/Makefile
Makefile
buildinfo.h])
AC_OUTPUT
View
@@ -1,5 +1,5 @@
/* dialog.c - general dialog tools
* $Id: dialog.c,v 1.1 2003/11/01 23:45:56 bitman Exp $
* $Id: dialog.c,v 1.2 2005/05/28 03:17:45 bitman Exp $
* Copyright (C) 2001 Ryan Phillips <bitman@users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or modify
@@ -17,6 +17,10 @@
* Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "dialog.h"
#include "structures/svector.h"
View
@@ -1,5 +1,5 @@
/* files.h -- filesystem routines
* $Id: files.c,v 1.1 2003/11/01 23:45:56 bitman Exp $
* $Id: files.c,v 1.2 2005/05/28 03:17:45 bitman Exp $
* Copyright (C) 2000 Ryan Phillips <bitman@scn.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -17,6 +17,10 @@
* Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
@@ -29,9 +33,7 @@
#include <unistd.h> /* For getcwd() */
#include <sys/stat.h>
#ifdef CANGLOB
#include <glob.h>
#endif
#include "files.h"
@@ -249,13 +251,10 @@ stringvector globtosvector(char * pattern, int filetypes)
int i;
stringvector files;
#ifdef CANGLOB
glob_t listing;
#endif
initstringvector(&files);
#ifdef CANGLOB
/* Get the listing */
glob(pattern, GLOB_MARK, NULL, &listing);
@@ -272,7 +271,6 @@ stringvector globtosvector(char * pattern, int filetypes)
}
globfree(&listing);
#endif
return files;
}
View
@@ -1,5 +1,5 @@
/* infobox.c - board/world information dialogs
* $Id: infobox.c,v 1.1 2003/11/01 23:45:56 bitman Exp $
* $Id: infobox.c,v 1.2 2005/05/28 03:17:45 bitman Exp $
* Copyright (C) 2000 Ryan Phillips <bitman@scn.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -17,6 +17,10 @@
* Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "infobox.h"
#include "kevedit/screen.h"
View
@@ -1,5 +1,5 @@
/* paramed.c -- Parameter editor
* $Id: paramed.c,v 1.2 2005/05/27 02:50:24 bitman Exp $
* $Id: paramed.c,v 1.3 2005/05/28 03:17:45 bitman Exp $
* Copyright (C) 2000 Ryan Phillips <bitman@scn.org>
*
* This program is free software; you can redistribute it and/or modify
@@ -17,6 +17,10 @@
* Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "paramed.h"
#include "kevedit/screen.h"
View
@@ -8,13 +8,11 @@ libdisplay_a_SOURCES = display.c display.h display_stdio.c display_stdio.h \
textblock.c textblock.h \
keys.h colours.h
if SDL
libdisplay_a_SOURCES += display_sdl.c display_sdl.h
endif
if DOS
libdisplay_a_SOURCES += display_dos.c display_dos.h
endif
OPTIONAL_SRC = display_sdl.c display_sdl.h display_dos.c display_dos.h
libdisplay_a_LIBADD = @display_objects@
libdisplay_a_DEPENDENCIES = @display_objects@
EXTRA_libdisplay_a_SOURCE = $(OPTIONAL_SRC)
EXTRA_DIST = $(OPTIONAL_SRC)
# Test program
noinst_PROGRAMS = test
View
@@ -1,5 +1,5 @@
/* display.c -- Functions for the modular display
* $Id: display.c,v 1.1 2003/11/01 23:45:56 bitman Exp $
* $Id: display.c,v 1.2 2005/05/28 03:17:45 bitman Exp $
* Copyright (C) 2000 Kev Vance <kev@kvance.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -17,28 +17,32 @@
* Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA.
*/
#if defined HAVE_CONFIG_H
#include <config.h>
#endif
#include "display.h"
#include "display_stdio.h"
#ifdef SDL
#if defined(SDL)
#include "display_sdl.h"
#endif
#ifdef VCSA
#if defined(VCSA)
#include "display_vcsa.h"
#endif
#ifdef DOS
#if defined(DOS)
#include "display_dos.h"
#endif
displaymethod display;
void RegisterDisplays()
{
#ifdef DOS
#if defined(DOS)
display = display_dos;
#elif SDL
#elif defined(SDL)
display = display_sdl;
#ifdef VCSA
#if defined(VCSA)
display.next = &display_vcsa;
#endif
#else
@@ -1,5 +1,5 @@
/* display_dos.c -- Functions for the DOS display method
* $Id: display_dos.c,v 1.1 2003/11/01 23:45:56 bitman Exp $
* $Id: display_dos.c,v 1.2 2005/05/28 03:17:45 bitman Exp $
* Copyright (C) 2000-2001 Kev Vance <kev@kvance.com>
*
* This program is free software; you can redistribute it and/or modify
@@ -16,6 +16,10 @@
* Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* God, I love this DOS stuff. If you can't tell from my coding style (or
* lack thereof), I'm an assembly programmer at heart :)
*/
@@ -1,5 +1,5 @@
/* display_sdl.c -- SDL Textmode Emulation display method for KevEdit
* $Id: display_sdl.c,v 1.2 2003/11/02 21:39:41 bitman Exp $
* $Id: display_sdl.c,v 1.3 2005/05/28 03:17:45 bitman Exp $
* Copyright (C) 2002 Gilead Kutnick <exophase@earthlink.net>
* Copyright (C) 2002 Kev Vance <kev@kvance.com>
*
@@ -17,6 +17,10 @@
* Foundation, Inc., 59 Temple Place Suite 330; Boston, MA 02111-1307, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
Oops, something went wrong.

0 comments on commit 055735c

Please sign in to comment.