From d2cbfa2d53c011c7c1939e14201fb41a322a9031 Mon Sep 17 00:00:00 2001 From: jsancho Date: Sun, 26 Jun 2011 08:01:39 +0000 Subject: [PATCH 01/16] --- src/gacela_mobs.scm | 44 +++++++++++++++++--------------------------- 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/src/gacela_mobs.scm b/src/gacela_mobs.scm index 51ce549..927d8b1 100755 --- a/src/gacela_mobs.scm +++ b/src/gacela_mobs.scm @@ -62,33 +62,23 @@ (define (attr-def attr) (let ((name (car attr)) (value (cadr attr))) - `(,name (get-attr attributes ',name ,value)))) - -;; (defmacro make-behaviour (name attr &rest code) -;; `(defun ,(get-behaviour-fun-name name) (object-attr) -;; (let ,(mapcar #'attribute-definition attr) -;; ,@code -;; ,(cons 'progn (mapcar #'attribute-save (reverse attr))) -;; object-attr))) - -;; (defun get-behaviour-fun-name (name) -;; (intern (concatenate 'string "BEHAVIOUR-" (string-upcase (string name))) 'gacela)) - -;; (defun attribute-name (attribute) -;; (intern (string attribute) 'keyword)) - -;; (define (attribute-definition attribute) -;; (let* ((name (cond ((list? attribute) (car attribute)) -;; (else attribute))) -;; (pname (attribute-name name)) -;; (value (cond ((listp attribute) (cadr attribute))))) -;; `(,name (getf object-attr ,pname ,value)))) - -;; (defun attribute-save (attribute) -;; (let* ((name (cond ((listp attribute) (car attribute)) -;; (t attribute))) -;; (pname (attribute-name name))) -;; `(setf (getf object-attr ,pname) ,name))) + `(,name (get-attr attributes ',name ',value)))) + +(define (attr-save attr) + (let ((name (car attr))) + `(assoc-set! attributes ',name (list ,name)))) + +(define-macro (define-action action-head . code) + (let ((name (car action-head)) (attr (cdr action-head))) + `(define ,name + (lambda-action ,attr ,@code)))) + +(define-macro (lambda-action attr . code) + `(lambda (attributes) + (let ,(map attr-def attr) + ,@code + ,(cons 'begin (map attr-save attr)) + attributes))) (define-macro (lambda-look . look) (define (process-look look) -- 2.39.5 From fd3682a33d408d153c08a569b62ae8f756eba11f Mon Sep 17 00:00:00 2001 From: jsancho Date: Wed, 29 Jun 2011 07:58:47 +0000 Subject: [PATCH 02/16] --- src/gacela_mobs.scm | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gacela_mobs.scm b/src/gacela_mobs.scm index 927d8b1..b2280d0 100755 --- a/src/gacela_mobs.scm +++ b/src/gacela_mobs.scm @@ -66,7 +66,7 @@ (define (attr-save attr) (let ((name (car attr))) - `(assoc-set! attributes ',name (list ,name)))) + `(set! attributes (assoc-set! attributes ',name (list ,name))))) (define-macro (define-action action-head . code) (let ((name (car action-head)) (attr (cdr action-head))) @@ -80,7 +80,7 @@ ,(cons 'begin (map attr-save attr)) attributes))) -(define-macro (lambda-look . look) +(define-macro (lambda-look attr . look) (define (process-look look) (cond ((null? look) (values '() '())) (else @@ -96,10 +96,11 @@ (receive (look-lines look-images) (process-look look) `(let ,look-images - (lambda () - (glPushMatrix) - ,@look-lines - (glPopMatrix))))) + (lambda (attributes) + (let ,(map attr-def attr) + (glPushMatrix) + ,@look-lines + (glPopMatrix)))))) ;;; Making mobs @@ -128,6 +129,8 @@ ((set-renders) (if (not (null? params)) (set! renders (car params)))))))) (cond ((not (null? ',look)) - (display ',look) - (newline))) + (mob 'set-renders + (list (cons + 'default-look + (lambda-look () ,@look)))))) mob)) -- 2.39.5 From b50916459d90f604043ea688750c55a516636796 Mon Sep 17 00:00:00 2001 From: jsancho Date: Wed, 29 Jun 2011 18:18:45 +0000 Subject: [PATCH 03/16] --- src/gacela_mobs.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gacela_mobs.scm b/src/gacela_mobs.scm index b2280d0..5ae3296 100755 --- a/src/gacela_mobs.scm +++ b/src/gacela_mobs.scm @@ -127,10 +127,12 @@ ((get-renders) renders) ((set-renders) - (if (not (null? params)) (set! renders (car params)))))))) + (if (not (null? params)) (set! renders (car params)))) + ((render) + (for-each (lambda (render) ((cdr render) attr)) renders)))))) (cond ((not (null? ',look)) (mob 'set-renders (list (cons 'default-look - (lambda-look () ,@look)))))) + (lambda-look ,attr ,@look)))))) mob)) -- 2.39.5 From adc4651eb62039c950d760c5bfc1eaee774ce4a5 Mon Sep 17 00:00:00 2001 From: jsancho Date: Thu, 30 Jun 2011 19:30:01 +0000 Subject: [PATCH 04/16] --- src/gacela_mobs.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/gacela_mobs.scm b/src/gacela_mobs.scm index 5ae3296..69f702f 100755 --- a/src/gacela_mobs.scm +++ b/src/gacela_mobs.scm @@ -128,11 +128,29 @@ renders) ((set-renders) (if (not (null? params)) (set! renders (car params)))) + ((actions) + (for-each + (lambda (action) + (set! attr ((cdr action) attr))) + actions)) ((render) - (for-each (lambda (render) ((cdr render) attr)) renders)))))) + (for-each + (lambda (render) + ((cdr render) attr)) + renders)))))) (cond ((not (null? ',look)) (mob 'set-renders (list (cons 'default-look (lambda-look ,attr ,@look)))))) mob)) + +(define (get-mob-attr mob var) + (let ((value (assoc-ref (mob 'get-attr) var))) + (if value (car value) #f))) + +(define (set-mob-attr! mob var value) + (mob 'set-attr (assoc-set! (mob 'get-attr) var (list value)))) + +(define (add-mob-action mob name action) + ) -- 2.39.5 From 023823491bfe1a64e136bcc2d47c6ec5803f23bf Mon Sep 17 00:00:00 2001 From: jsancho Date: Fri, 1 Jul 2011 18:16:21 +0000 Subject: [PATCH 05/16] --- src/gacela.scm | 3 ++- src/gacela_mobs.scm | 38 +++++++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/src/gacela.scm b/src/gacela.scm index 54b705f..ff28dbb 100644 --- a/src/gacela.scm +++ b/src/gacela.scm @@ -246,7 +246,8 @@ (to-origin) (cond ((mobs-changed?) (set! mobs (get-active-mobs)))) (if (procedure? game-code) (game-code)) - (process-mobs mobs) + (run-mob-actions mobs) + (render-mobs mobs) (SDL_GL_SwapBuffers) (delay-frame)))) (set! running #f))) diff --git a/src/gacela_mobs.scm b/src/gacela_mobs.scm index 69f702f..5e15907 100755 --- a/src/gacela_mobs.scm +++ b/src/gacela_mobs.scm @@ -48,8 +48,11 @@ (define-macro (hide-mob mob) `(hide-mob-hash ',mob)) -(define (process-mobs mobs) - (for-each (lambda (m) (m #:render)) mobs)) +(define (run-mob-actions mobs) + (for-each (lambda (m) (m 'run-actions)) mobs)) + +(define (render-mobs mobs) + (for-each (lambda (m) (m 'render)) mobs)) ;;; Actions and looks for mobs @@ -113,7 +116,7 @@ (define-macro (lambda-mob attr . look) `(let ((mob #f)) (set! mob - (let ((attr ',attr) (actions '()) (renders '())) + (let ((attr ',attr) (actions '()) (looks '())) (lambda (option . params) (case option ((get-attr) @@ -124,22 +127,22 @@ actions) ((set-actions) (if (not (null? params)) (set! actions (car params)))) - ((get-renders) - renders) - ((set-renders) - (if (not (null? params)) (set! renders (car params)))) - ((actions) + ((get-looks) + looks) + ((set-looks) + (if (not (null? params)) (set! looks (car params)))) + ((run-actions) (for-each (lambda (action) (set! attr ((cdr action) attr))) actions)) ((render) (for-each - (lambda (render) - ((cdr render) attr)) - renders)))))) + (lambda (look) + ((cdr look) attr)) + looks)))))) (cond ((not (null? ',look)) - (mob 'set-renders + (mob 'set-looks (list (cons 'default-look (lambda-look ,attr ,@look)))))) @@ -153,4 +156,13 @@ (mob 'set-attr (assoc-set! (mob 'get-attr) var (list value)))) (define (add-mob-action mob name action) - ) + (mob 'set-actions (assoc-set! (mob 'get-actions) name action))) + +(define (quit-mob-action mob name) + (mob 'set-actions (assoc-remove! (mob 'get-actions) name))) + +(define (add-mob-look mob name look) + (mob 'set-looks (assoc-set! (mob 'get-looks) name look))) + +(define (quit-mob-look mob name) + (mob 'set-looks (assoc-remove! (mob 'get-looks) name))) -- 2.39.5 From 5287ad5ca5431fe53c61e2da81b1ac6d0dc6e119 Mon Sep 17 00:00:00 2001 From: jsancho Date: Sun, 3 Jul 2011 08:19:53 +0000 Subject: [PATCH 06/16] --- src/gacela.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gacela.c b/src/gacela.c index fc7ec31..b9be602 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -30,6 +30,8 @@ init_gacela (void *data, int argc, char **argv) scm_c_eval_string ("(activate-readline)"); scm_c_eval_string ("(use-modules (ice-9 optargs))"); scm_c_eval_string ("(use-modules (ice-9 receive))"); + scm_c_eval_string ("(use-modules (ice-9 threads))"); + scm_c_eval_string ("(read-enable 'case-insensitive)"); // Bindings for C functions and structs SDL_register_functions (NULL); -- 2.39.5 From faa5d238501edac61e899697a6bb88f33dff13de Mon Sep 17 00:00:00 2001 From: jsancho Date: Tue, 5 Jul 2011 13:11:48 +0000 Subject: [PATCH 07/16] --- Makefile | 283 ++++++++++++++++++++++++++++++++++----------------- configure.ac | 5 + src/gacela.c | 99 ++++++++++++++++++ 3 files changed, 294 insertions(+), 93 deletions(-) diff --git a/Makefile b/Makefile index 4d12706..b562aea 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,8 +17,9 @@ pkgdatadir = $(datadir)/gacela -pkglibdir = $(libdir)/gacela pkgincludedir = $(includedir)/gacela +pkglibdir = $(libdir)/gacela +pkglibexecdir = $(libexecdir)/gacela am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -44,6 +46,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -58,12 +61,29 @@ am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docdir)" -dist_docDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -71,18 +91,43 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run aclocal-1.10 -AMTAR = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run tar -AUTOCONF = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoconf -AUTOHEADER = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoheader -AUTOMAKE = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run automake-1.10 +ACLOCAL = ${SHELL} /home/jsancho/proyectos/guile/missing --run aclocal-1.11 +AMTAR = ${SHELL} /home/jsancho/proyectos/guile/missing --run tar +AUTOCONF = ${SHELL} /home/jsancho/proyectos/guile/missing --run autoconf +AUTOHEADER = ${SHELL} /home/jsancho/proyectos/guile/missing --run autoheader +AUTOMAKE = ${SHELL} /home/jsancho/proyectos/guile/missing --run automake-1.11 AWK = mawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -95,11 +140,11 @@ ECHO_C = ECHO_N = -n ECHO_T = EXEEXT = -GUILE = /usr/bin/guile -GUILE_CFLAGS = -GUILE_CONFIG = /usr/bin/guile-config -GUILE_LDFLAGS = -lguile -lltdl -lgmp -lcrypt -lm -lltdl -GUILE_TOOLS = /usr/bin/guile-tools +GUILE = /usr/local/bin/guile +GUILE_CFLAGS = -I/usr/local/include -pthread +GUILE_CONFIG = /usr/local/bin/guile-config +GUILE_LDFLAGS = -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl +GUILE_TOOLS = /usr/local/bin/guile-tools INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} @@ -107,9 +152,9 @@ INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LDFLAGS = LIBOBJS = -LIBS = -lSDL -lSDL_image -lSDL_gfx -lSDL_mixer -lGL -lGLU -lftgl +LIBS = -lreadline -lSDL -lSDL_image -lSDL_gfx -lSDL_mixer -lGL -lGLU -lftgl LTLIBOBJS = -MAKEINFO = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run makeinfo +MAKEINFO = ${SHELL} /home/jsancho/proyectos/guile/missing --run makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = gacela @@ -117,16 +162,17 @@ PACKAGE_BUGREPORT = jsf@jsancho.org PACKAGE_NAME = gacela PACKAGE_STRING = gacela 0.5 PACKAGE_TARNAME = gacela +PACKAGE_URL = PACKAGE_VERSION = 0.5 PATH_SEPARATOR = : SET_MAKE = SHELL = /bin/bash STRIP = VERSION = 0.5 -abs_builddir = /home/jsancho/proyectos/gacela/trunk -abs_srcdir = /home/jsancho/proyectos/gacela/trunk -abs_top_builddir = /home/jsancho/proyectos/gacela/trunk -abs_top_srcdir = /home/jsancho/proyectos/gacela/trunk +abs_builddir = /home/jsancho/proyectos/guile +abs_srcdir = /home/jsancho/proyectos/guile +abs_top_builddir = /home/jsancho/proyectos/guile +abs_top_srcdir = /home/jsancho/proyectos/guile ac_ct_CC = gcc am__include = include am__leading_dot = . @@ -145,7 +191,7 @@ host_alias = htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = $(SHELL) /home/jsancho/proyectos/gacela/trunk/install-sh +install_sh = ${SHELL} /home/jsancho/proyectos/guile/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale @@ -162,6 +208,7 @@ sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = +top_build_prefix = top_builddir = . top_srcdir = . SUBDIRS = src @@ -176,15 +223,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -200,9 +247,10 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ @@ -214,7 +262,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -223,20 +271,23 @@ distclean-hdr: install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" - @list='$(dist_doc_DATA)'; for p in $$list; do \ + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \ - $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) - @list='$(dist_doc_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \ - rm -f "$(DESTDIR)$(docdir)/$$f"; \ - done + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(docdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -245,7 +296,7 @@ uninstall-dist_docDATA: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -262,7 +313,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -270,7 +321,7 @@ $(RECURSIVE_TARGETS): fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -296,16 +347,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -313,14 +364,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -332,7 +383,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ @@ -341,36 +392,41 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) - test -d $(distdir) || mkdir $(distdir) + test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -386,38 +442,55 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ + am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) + || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) @@ -430,6 +503,10 @@ dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -453,15 +530,17 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac @@ -469,9 +548,11 @@ distcheck: dist mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -493,13 +574,15 @@ distcheck: dist && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @cd $(distuninstallcheck_dir) \ + @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -544,6 +627,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -563,6 +647,8 @@ dvi-am: html: html-recursive +html-am: + info: info-recursive info-am: @@ -571,18 +657,28 @@ install-data-am: install-dist_docDATA install-dvi: install-dvi-recursive +install-dvi-am: + install-exec-am: install-html: install-html-recursive +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: install-pdf: install-pdf-recursive +install-pdf-am: + install-ps: install-ps-recursive +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -605,24 +701,25 @@ ps-am: uninstall-am: uninstall-dist_docDATA -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-generic distclean-hdr distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dist_docDATA install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-dist_docDATA + dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ + distclean distclean-generic distclean-hdr distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dist_docDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + tags-recursive uninstall uninstall-am uninstall-dist_docDATA + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/configure.ac b/configure.ac index 92b9bdb..5c062df 100644 --- a/configure.ac +++ b/configure.ac @@ -3,6 +3,11 @@ AM_INIT_AUTOMAKE([-Wall -Werror foreign]) AC_PROG_CC GUILE_FLAGS CFLAGS="$CFLAGS -I/usr/include/freetype2" +AC_CHECK_LIB(readline, + main, + LIBS="$LIBS -lreadline", + AC_MSG_ERROR([*** readline library not found!]) +) AC_CHECK_LIB(SDL, main, LIBS="$LIBS -lSDL", diff --git a/src/gacela.c b/src/gacela.c index b9be602..37c8c9f 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -17,10 +17,106 @@ #include #include +#include +#include #include "gacela_SDL.h" #include "gacela_GL.h" #include "gacela_FTGL.h" +static int +find_matching_paren(int k) +{ + register int i; + register char c = 0; + int end_parens_found = 0; + + /* Choose the corresponding opening bracket. */ + if (k == ')') c = '('; + else if (k == ']') c = '['; + else if (k == '}') c = '{'; + + for (i=rl_point-2; i>=0; i--) + { + /* Is the current character part of a character literal? */ + if (i - 2 >= 0 + && rl_line_buffer[i - 1] == '\\' + && rl_line_buffer[i - 2] == '#') + ; + else if (rl_line_buffer[i] == k) + end_parens_found++; + else if (rl_line_buffer[i] == '"') + { + /* Skip over a string literal. */ + for (i--; i >= 0; i--) + if (rl_line_buffer[i] == '"' + && ! (i - 1 >= 0 + && rl_line_buffer[i - 1] == '\\')) + break; + } + else if (rl_line_buffer[i] == c) + { + if (end_parens_found==0) return i; + else --end_parens_found; + } + } + return -1; +} + +static void +match_paren(int x, int k) +{ + int tmp; + fd_set readset; + struct timeval timeout; + + rl_insert(x, k); + + /* Did we just insert a quoted paren? If so, then don't bounce. */ + if (rl_point - 1 >= 1 + && rl_line_buffer[rl_point - 2] == '\\') + return; + + timeout.tv_sec = 0; + timeout.tv_usec = 500000; + FD_ZERO(&readset); + FD_SET(fileno(rl_instream), &readset); + + if(rl_point > 1) { + tmp = rl_point; + rl_point = find_matching_paren(k); + if(rl_point > -1) { + rl_redisplay(); + // scm_internal_select(1, &readset, NULL, NULL, &timeout); + } + rl_point = tmp; + } +} + +static void +init_gacela_client () +{ + /* init bouncing parens */ + rl_bind_key(')', match_paren); + rl_bind_key(']', match_paren); + rl_bind_key('}', match_paren); +} + +void +gacela_client (void) +{ + char *line; + + init_gacela_client (); + + while (1) { + line = readline ("gacela>"); + printf ("%s\n", line); + if (line && *line) + add_history (line); + free (line); + } +} + static void* init_gacela (void *data, int argc, char **argv) { @@ -54,7 +150,10 @@ load_scheme_files (char *path) int main (int argc, char *argv[]) { + /* scm_with_guile (&init_gacela, NULL); load_scheme_files (dirname (argv[0])); scm_shell (argc, argv); + */ + gacela_client (); } -- 2.39.5 From 9382649bb4f29fd789c7acaf7185b2a50ad1613c Mon Sep 17 00:00:00 2001 From: jsancho Date: Tue, 5 Jul 2011 16:28:34 +0000 Subject: [PATCH 08/16] --- Makefile | 281 +++++++++++++++++---------------------------------- src/gacela.c | 62 +++++++++--- 2 files changed, 141 insertions(+), 202 deletions(-) diff --git a/Makefile b/Makefile index b562aea..554812a 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,9 +16,8 @@ pkgdatadir = $(datadir)/gacela -pkgincludedir = $(includedir)/gacela pkglibdir = $(libdir)/gacela -pkglibexecdir = $(libexecdir)/gacela +pkgincludedir = $(includedir)/gacela am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -46,7 +44,6 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -61,29 +58,12 @@ am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(docdir)" +dist_docDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -91,43 +71,18 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/jsancho/proyectos/guile/missing --run aclocal-1.11 -AMTAR = ${SHELL} /home/jsancho/proyectos/guile/missing --run tar -AUTOCONF = ${SHELL} /home/jsancho/proyectos/guile/missing --run autoconf -AUTOHEADER = ${SHELL} /home/jsancho/proyectos/guile/missing --run autoheader -AUTOMAKE = ${SHELL} /home/jsancho/proyectos/guile/missing --run automake-1.11 +ACLOCAL = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run aclocal-1.10 +AMTAR = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run tar +AUTOCONF = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoconf +AUTOHEADER = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoheader +AUTOMAKE = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run automake-1.10 AWK = mawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -140,11 +95,11 @@ ECHO_C = ECHO_N = -n ECHO_T = EXEEXT = -GUILE = /usr/local/bin/guile -GUILE_CFLAGS = -I/usr/local/include -pthread -GUILE_CONFIG = /usr/local/bin/guile-config -GUILE_LDFLAGS = -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl -GUILE_TOOLS = /usr/local/bin/guile-tools +GUILE = /usr/bin/guile +GUILE_CFLAGS = +GUILE_CONFIG = /usr/bin/guile-config +GUILE_LDFLAGS = -lguile -lltdl -lgmp -lcrypt -lm -lltdl +GUILE_TOOLS = /usr/bin/guile-tools INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} @@ -154,7 +109,7 @@ LDFLAGS = LIBOBJS = LIBS = -lreadline -lSDL -lSDL_image -lSDL_gfx -lSDL_mixer -lGL -lGLU -lftgl LTLIBOBJS = -MAKEINFO = ${SHELL} /home/jsancho/proyectos/guile/missing --run makeinfo +MAKEINFO = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = gacela @@ -162,17 +117,16 @@ PACKAGE_BUGREPORT = jsf@jsancho.org PACKAGE_NAME = gacela PACKAGE_STRING = gacela 0.5 PACKAGE_TARNAME = gacela -PACKAGE_URL = PACKAGE_VERSION = 0.5 PATH_SEPARATOR = : SET_MAKE = SHELL = /bin/bash STRIP = VERSION = 0.5 -abs_builddir = /home/jsancho/proyectos/guile -abs_srcdir = /home/jsancho/proyectos/guile -abs_top_builddir = /home/jsancho/proyectos/guile -abs_top_srcdir = /home/jsancho/proyectos/guile +abs_builddir = /home/jsancho/proyectos/gacela/trunk +abs_srcdir = /home/jsancho/proyectos/gacela/trunk +abs_top_builddir = /home/jsancho/proyectos/gacela/trunk +abs_top_srcdir = /home/jsancho/proyectos/gacela/trunk ac_ct_CC = gcc am__include = include am__leading_dot = . @@ -191,7 +145,7 @@ host_alias = htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/jsancho/proyectos/guile/install-sh +install_sh = $(SHELL) /home/jsancho/proyectos/gacela/trunk/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale @@ -208,7 +162,6 @@ sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = -top_build_prefix = top_builddir = . top_srcdir = . SUBDIRS = src @@ -223,15 +176,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -247,10 +200,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) + cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ @@ -262,7 +214,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ @@ -271,23 +223,20 @@ distclean-hdr: install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" - @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ - for p in $$list; do \ + @list='$(dist_doc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + f=$(am__strip_dir) \ + echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \ + $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) - @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(docdir)" && rm -f $$files + @list='$(dist_doc_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \ + rm -f "$(DESTDIR)$(docdir)/$$f"; \ + done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -296,7 +245,7 @@ uninstall-dist_docDATA: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ + @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -313,7 +262,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -321,7 +270,7 @@ $(RECURSIVE_TARGETS): fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ + @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -347,16 +296,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -364,14 +313,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - set x; \ + tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -383,7 +332,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ @@ -392,41 +341,36 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) + tags=; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique + $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" + test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -442,55 +386,38 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ - am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" + || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) @@ -503,10 +430,6 @@ dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz - $(am__remove_distdir) - dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -530,17 +453,15 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac @@ -548,11 +469,9 @@ distcheck: dist mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ + && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -574,15 +493,13 @@ distcheck: dist && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ + @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -627,7 +544,6 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -647,8 +563,6 @@ dvi-am: html: html-recursive -html-am: - info: info-recursive info-am: @@ -657,28 +571,18 @@ install-data-am: install-dist_docDATA install-dvi: install-dvi-recursive -install-dvi-am: - install-exec-am: install-html: install-html-recursive -install-html-am: - install-info: install-info-recursive -install-info-am: - install-man: install-pdf: install-pdf-recursive -install-pdf-am: - install-ps: install-ps-recursive -install-ps-am: - installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -701,25 +605,24 @@ ps-am: uninstall-am: uninstall-dist_docDATA -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-strip tags-recursive +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-generic distclean-hdr distclean-tags \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dist_docDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ - tags-recursive uninstall uninstall-am uninstall-dist_docDATA - + dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dist_docDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-dist_docDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/gacela.c b/src/gacela.c index 37c8c9f..d30ec0d 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -24,7 +24,7 @@ #include "gacela_FTGL.h" static int -find_matching_paren(int k) +find_matching_paren (int k) { register int i; register char c = 0; @@ -35,7 +35,7 @@ find_matching_paren(int k) else if (k == ']') c = '['; else if (k == '}') c = '{'; - for (i=rl_point-2; i>=0; i--) + for (i = rl_point-2; i >= 0; i--) { /* Is the current character part of a character literal? */ if (i - 2 >= 0 @@ -63,13 +63,13 @@ find_matching_paren(int k) } static void -match_paren(int x, int k) +match_paren2 (int x, int k) { int tmp; fd_set readset; struct timeval timeout; - rl_insert(x, k); + rl_insert (x, k); /* Did we just insert a quoted paren? If so, then don't bounce. */ if (rl_point - 1 >= 1 @@ -78,27 +78,63 @@ match_paren(int x, int k) timeout.tv_sec = 0; timeout.tv_usec = 500000; - FD_ZERO(&readset); - FD_SET(fileno(rl_instream), &readset); + FD_ZERO (&readset); + FD_SET (fileno(rl_instream), &readset); - if(rl_point > 1) { + if (rl_point > 1) { tmp = rl_point; rl_point = find_matching_paren(k); - if(rl_point > -1) { + if (rl_point > -1) { rl_redisplay(); - // scm_internal_select(1, &readset, NULL, NULL, &timeout); + //scm_internal_select(1, &readset, NULL, NULL, &timeout); } - rl_point = tmp; + //rl_point = tmp; } } +static int +match_paren (int x, int k) +{ + int tmp; + int fno; + SELECT_TYPE readset; + struct timeval timeout; + + rl_insert (x, k); + + /* Did we just insert a quoted paren? If so, then don't bounce. */ + if (rl_point - 1 >= 1 + && rl_line_buffer[rl_point - 2] == '\\') + return 0; + + tmp = 1000 * 1000; + timeout.tv_sec = tmp / 1000000; + timeout.tv_usec = tmp % 1000000; + FD_ZERO (&readset); + fno = fileno (rl_instream); + FD_SET (fno, &readset); + + if (rl_point > 1) + { + tmp = rl_point; + rl_point = find_matching_paren (k); + if (rl_point > -1) + { + rl_redisplay (); + scm_std_select (fno + 1, &readset, NULL, NULL, &timeout); + } + rl_point = tmp; + } + return 0; +} + static void init_gacela_client () { /* init bouncing parens */ - rl_bind_key(')', match_paren); - rl_bind_key(']', match_paren); - rl_bind_key('}', match_paren); + rl_bind_key (')', match_paren); + rl_bind_key (']', match_paren); + rl_bind_key ('}', match_paren); } void -- 2.39.5 From 495f95e1619224b8ca21a209ea5b50e15b3a6c47 Mon Sep 17 00:00:00 2001 From: jsancho Date: Wed, 6 Jul 2011 12:47:24 +0000 Subject: [PATCH 09/16] --- Makefile | 281 ++++++++++++++++++++++++++++++++++----------------- src/gacela.c | 40 ++------ 2 files changed, 197 insertions(+), 124 deletions(-) diff --git a/Makefile b/Makefile index 554812a..b562aea 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,8 +17,9 @@ pkgdatadir = $(datadir)/gacela -pkglibdir = $(libdir)/gacela pkgincludedir = $(includedir)/gacela +pkglibdir = $(libdir)/gacela +pkglibexecdir = $(libexecdir)/gacela am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -44,6 +46,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -58,12 +61,29 @@ am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__installdirs = "$(DESTDIR)$(docdir)" -dist_docDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -71,18 +91,43 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d $(distdir) \ - || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr $(distdir); }; } + { test ! -d "$(distdir)" \ + || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr "$(distdir)"; }; } +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run aclocal-1.10 -AMTAR = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run tar -AUTOCONF = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoconf -AUTOHEADER = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoheader -AUTOMAKE = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run automake-1.10 +ACLOCAL = ${SHELL} /home/jsancho/proyectos/guile/missing --run aclocal-1.11 +AMTAR = ${SHELL} /home/jsancho/proyectos/guile/missing --run tar +AUTOCONF = ${SHELL} /home/jsancho/proyectos/guile/missing --run autoconf +AUTOHEADER = ${SHELL} /home/jsancho/proyectos/guile/missing --run autoheader +AUTOMAKE = ${SHELL} /home/jsancho/proyectos/guile/missing --run automake-1.11 AWK = mawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -95,11 +140,11 @@ ECHO_C = ECHO_N = -n ECHO_T = EXEEXT = -GUILE = /usr/bin/guile -GUILE_CFLAGS = -GUILE_CONFIG = /usr/bin/guile-config -GUILE_LDFLAGS = -lguile -lltdl -lgmp -lcrypt -lm -lltdl -GUILE_TOOLS = /usr/bin/guile-tools +GUILE = /usr/local/bin/guile +GUILE_CFLAGS = -I/usr/local/include -pthread +GUILE_CONFIG = /usr/local/bin/guile-config +GUILE_LDFLAGS = -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl +GUILE_TOOLS = /usr/local/bin/guile-tools INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} @@ -109,7 +154,7 @@ LDFLAGS = LIBOBJS = LIBS = -lreadline -lSDL -lSDL_image -lSDL_gfx -lSDL_mixer -lGL -lGLU -lftgl LTLIBOBJS = -MAKEINFO = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run makeinfo +MAKEINFO = ${SHELL} /home/jsancho/proyectos/guile/missing --run makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = gacela @@ -117,16 +162,17 @@ PACKAGE_BUGREPORT = jsf@jsancho.org PACKAGE_NAME = gacela PACKAGE_STRING = gacela 0.5 PACKAGE_TARNAME = gacela +PACKAGE_URL = PACKAGE_VERSION = 0.5 PATH_SEPARATOR = : SET_MAKE = SHELL = /bin/bash STRIP = VERSION = 0.5 -abs_builddir = /home/jsancho/proyectos/gacela/trunk -abs_srcdir = /home/jsancho/proyectos/gacela/trunk -abs_top_builddir = /home/jsancho/proyectos/gacela/trunk -abs_top_srcdir = /home/jsancho/proyectos/gacela/trunk +abs_builddir = /home/jsancho/proyectos/guile +abs_srcdir = /home/jsancho/proyectos/guile +abs_top_builddir = /home/jsancho/proyectos/guile +abs_top_srcdir = /home/jsancho/proyectos/guile ac_ct_CC = gcc am__include = include am__leading_dot = . @@ -145,7 +191,7 @@ host_alias = htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = $(SHELL) /home/jsancho/proyectos/gacela/trunk/install-sh +install_sh = ${SHELL} /home/jsancho/proyectos/guile/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale @@ -162,6 +208,7 @@ sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = +top_build_prefix = top_builddir = . top_srcdir = . SUBDIRS = src @@ -176,15 +223,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ - cd $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -200,9 +247,10 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - cd $(srcdir) && $(AUTOCONF) + $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ @@ -214,7 +262,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) - cd $(top_srcdir) && $(AUTOHEADER) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ @@ -223,20 +271,23 @@ distclean-hdr: install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" - @list='$(dist_doc_DATA)'; for p in $$list; do \ + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \ - $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) - @list='$(dist_doc_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \ - rm -f "$(DESTDIR)$(docdir)/$$f"; \ - done + @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(docdir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -245,7 +296,7 @@ uninstall-dist_docDATA: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -262,7 +313,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -270,7 +321,7 @@ $(RECURSIVE_TARGETS): fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @failcom='exit 1'; \ + @fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -296,16 +347,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -313,14 +364,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ + set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -332,7 +383,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ @@ -341,36 +392,41 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - tags=; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ + test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique + $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) - test -d $(distdir) || mkdir $(distdir) + test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -386,38 +442,55 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done - list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ - distdir=`$(am__cd) $(distdir) && pwd`; \ - top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ - (cd $$subdir && \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$top_distdir" \ - distdir="$$distdir/$$subdir" \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ + am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done - -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r $(distdir) + || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) @@ -430,6 +503,10 @@ dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) +dist-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -453,15 +530,17 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac @@ -469,9 +548,11 @@ distcheck: dist mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && cd $(distdir)/_build \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -493,13 +574,15 @@ distcheck: dist && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @cd $(distuninstallcheck_dir) \ + @$(am__cd) '$(distuninstallcheck_dir)' \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -544,6 +627,7 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -563,6 +647,8 @@ dvi-am: html: html-recursive +html-am: + info: info-recursive info-am: @@ -571,18 +657,28 @@ install-data-am: install-dist_docDATA install-dvi: install-dvi-recursive +install-dvi-am: + install-exec-am: install-html: install-html-recursive +install-html-am: + install-info: install-info-recursive +install-info-am: + install-man: install-pdf: install-pdf-recursive +install-pdf-am: + install-ps: install-ps-recursive +install-ps-am: + installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -605,24 +701,25 @@ ps-am: uninstall-am: uninstall-dist_docDATA -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ - install-strip +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ + ctags-recursive install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ - distclean-generic distclean-hdr distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dist_docDATA install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ - pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-dist_docDATA + dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ + distclean distclean-generic distclean-hdr distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dist_docDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ + tags-recursive uninstall uninstall-am uninstall-dist_docDATA + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/gacela.c b/src/gacela.c index d30ec0d..66bd40a 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -23,6 +23,7 @@ #include "gacela_GL.h" #include "gacela_FTGL.h" + static int find_matching_paren (int k) { @@ -62,36 +63,6 @@ find_matching_paren (int k) return -1; } -static void -match_paren2 (int x, int k) -{ - int tmp; - fd_set readset; - struct timeval timeout; - - rl_insert (x, k); - - /* Did we just insert a quoted paren? If so, then don't bounce. */ - if (rl_point - 1 >= 1 - && rl_line_buffer[rl_point - 2] == '\\') - return; - - timeout.tv_sec = 0; - timeout.tv_usec = 500000; - FD_ZERO (&readset); - FD_SET (fileno(rl_instream), &readset); - - if (rl_point > 1) { - tmp = rl_point; - rl_point = find_matching_paren(k); - if (rl_point > -1) { - rl_redisplay(); - //scm_internal_select(1, &readset, NULL, NULL, &timeout); - } - //rl_point = tmp; - } -} - static int match_paren (int x, int k) { @@ -107,7 +78,7 @@ match_paren (int x, int k) && rl_line_buffer[rl_point - 2] == '\\') return 0; - tmp = 1000 * 1000; + tmp = 500000; timeout.tv_sec = tmp / 1000000; timeout.tv_usec = tmp % 1000000; FD_ZERO (&readset); @@ -135,6 +106,9 @@ init_gacela_client () rl_bind_key (')', match_paren); rl_bind_key (']', match_paren); rl_bind_key ('}', match_paren); + + /* SIGINT */ + scm_c_eval_string ("(sigaction SIGINT (lambda (sig) (format #t \"ERROR: User interrupt~%ABORT: (signal)~%\")))"); } void @@ -149,6 +123,8 @@ gacela_client (void) printf ("%s\n", line); if (line && *line) add_history (line); + if (strcmp(line, "fuera") == 0) + break; free (line); } } @@ -162,7 +138,6 @@ init_gacela (void *data, int argc, char **argv) scm_c_eval_string ("(activate-readline)"); scm_c_eval_string ("(use-modules (ice-9 optargs))"); scm_c_eval_string ("(use-modules (ice-9 receive))"); - scm_c_eval_string ("(use-modules (ice-9 threads))"); scm_c_eval_string ("(read-enable 'case-insensitive)"); // Bindings for C functions and structs @@ -191,5 +166,6 @@ main (int argc, char *argv[]) load_scheme_files (dirname (argv[0])); scm_shell (argc, argv); */ + scm_init_guile (); gacela_client (); } -- 2.39.5 From cfc3b5c1197829940765b868c41c4ef53de15f50 Mon Sep 17 00:00:00 2001 From: jsancho Date: Wed, 6 Jul 2011 15:28:22 +0000 Subject: [PATCH 10/16] --- src/gacela.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/gacela.c b/src/gacela.c index 66bd40a..e976bf6 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "gacela_SDL.h" #include "gacela_GL.h" #include "gacela_FTGL.h" @@ -99,16 +100,28 @@ match_paren (int x, int k) return 0; } +void +ctrl_c_handler (int signum) +{ + printf ("ERROR: User interrupt\nABORT: (signal)\n"); +} + static void init_gacela_client () { + struct sigaction new_action; + /* init bouncing parens */ rl_bind_key (')', match_paren); rl_bind_key (']', match_paren); rl_bind_key ('}', match_paren); /* SIGINT */ - scm_c_eval_string ("(sigaction SIGINT (lambda (sig) (format #t \"ERROR: User interrupt~%ABORT: (signal)~%\")))"); + new_action.sa_handler = ctrl_c_handler; + sigemptyset (&new_action.sa_mask); + new_action.sa_flags = 0; + + sigaction (SIGINT, &new_action, NULL); } void @@ -117,16 +130,20 @@ gacela_client (void) char *line; init_gacela_client (); + read_history (".gacela_history"); while (1) { - line = readline ("gacela>"); - printf ("%s\n", line); + line = readline ("gacela> "); + if (!line) break; if (line && *line) - add_history (line); - if (strcmp(line, "fuera") == 0) - break; + { + printf ("%s\n", line); + add_history (line); + } free (line); } + + write_history (".gacela_history"); } static void* -- 2.39.5 From 3957d4932d42a1c3c7292034f0bde8ca5abeb32a Mon Sep 17 00:00:00 2001 From: jsancho Date: Thu, 7 Jul 2011 12:48:41 +0000 Subject: [PATCH 11/16] --- src/gacela.c | 28 ++++++++++++++++++---------- src/gacela_loader.scm | 1 + src/gacela_server.scm | 27 +++++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 10 deletions(-) create mode 100644 src/gacela_server.scm diff --git a/src/gacela.c b/src/gacela.c index e976bf6..cb464a5 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -128,9 +128,12 @@ void gacela_client (void) { char *line; + char *history_path; + + asprintf (&history_path, "%s/.gacela_history", getenv("HOME")); init_gacela_client (); - read_history (".gacela_history"); + read_history (history_path); while (1) { line = readline ("gacela> "); @@ -143,7 +146,8 @@ gacela_client (void) free (line); } - write_history (".gacela_history"); + write_history (history_path); + free (history_path); } static void* @@ -155,7 +159,7 @@ init_gacela (void *data, int argc, char **argv) scm_c_eval_string ("(activate-readline)"); scm_c_eval_string ("(use-modules (ice-9 optargs))"); scm_c_eval_string ("(use-modules (ice-9 receive))"); - scm_c_eval_string ("(read-enable 'case-insensitive)"); + // scm_c_eval_string ("(read-enable 'case-insensitive)"); // Bindings for C functions and structs SDL_register_functions (NULL); @@ -178,11 +182,15 @@ load_scheme_files (char *path) int main (int argc, char *argv[]) { - /* - scm_with_guile (&init_gacela, NULL); - load_scheme_files (dirname (argv[0])); - scm_shell (argc, argv); - */ - scm_init_guile (); - gacela_client (); + if (fork () == 0) { + scm_with_guile (&init_gacela, NULL); + load_scheme_files (dirname (argv[0])); + //scm_shell (argc, argv); + scm_c_eval_string ("(start-server 1234)"); + scm_c_eval_string ("(run-game)"); + } + else { + scm_init_guile (); + gacela_client (); + } } diff --git a/src/gacela_loader.scm b/src/gacela_loader.scm index 183df1d..c5f97fa 100644 --- a/src/gacela_loader.scm +++ b/src/gacela_loader.scm @@ -21,3 +21,4 @@ (primitive-load-path "gacela_ttf.scm") (primitive-load-path "gacela_mobs.scm") (primitive-load-path "gacela_misc.scm") +(primitive-load-path "gacela_server.scm") diff --git a/src/gacela_server.scm b/src/gacela_server.scm new file mode 100644 index 0000000..e7a69c6 --- /dev/null +++ b/src/gacela_server.scm @@ -0,0 +1,27 @@ +;;; Gacela, a GNU Guile extension for fast games development +;;; Copyright (C) 2009 by Javier Sancho Fernandez +;;; +;;; This program is free software: you can redistribute it and/or modify +;;; it under the terms of the GNU General Public License as published by +;;; the Free Software Foundation, either version 3 of the License, or +;;; (at your option) any later version. +;;; +;;; This program is distributed in the hope that it will be useful, +;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with this program. If not, see . + + +(define start-server #f) + +(let ((server-socket #f) (clients '())) + (set! start-server + (lambda (port) + (set! server-socket (socket PF_INET SOCK_STREAM 0)) + (setsockopt server-socket SOL_SOCKET SO_REUSEADDR 1) + (bind server-socket AF_INET INADDR_ANY port) + (listen server-socket 5))) +) -- 2.39.5 From 71acfe50145894e950d1d9deb656fb36132b5de3 Mon Sep 17 00:00:00 2001 From: jsancho Date: Thu, 7 Jul 2011 18:25:07 +0000 Subject: [PATCH 12/16] --- src/gacela_server.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gacela_server.scm b/src/gacela_server.scm index e7a69c6..548488e 100644 --- a/src/gacela_server.scm +++ b/src/gacela_server.scm @@ -16,12 +16,24 @@ (define start-server #f) +(define check-connections #f) +(define stop-server #f) (let ((server-socket #f) (clients '())) (set! start-server (lambda (port) (set! server-socket (socket PF_INET SOCK_STREAM 0)) + (fcntl server-socket F_SETFL (logior O_NONBLOCK (fcntl server-socket F_GETFL))) (setsockopt server-socket SOL_SOCKET SO_REUSEADDR 1) (bind server-socket AF_INET INADDR_ANY port) (listen server-socket 5))) -) + + (set! check-connections + (lambda () + (catch #t + (lambda () (set! clients (cons (accept server-socket) clients))) + (lambda (key . args) #f)))) + + (set! stop-server + (lambda () + (cond (server-socket (close server-socket) (set! server-socket #f))) \ No newline at end of file -- 2.39.5 From 39b00720d1fbe4762abb8bd5aab37572a31028f2 Mon Sep 17 00:00:00 2001 From: jsancho Date: Thu, 7 Jul 2011 19:19:44 +0000 Subject: [PATCH 13/16] --- src/gacela_server.scm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gacela_server.scm b/src/gacela_server.scm index 548488e..a95ec9d 100644 --- a/src/gacela_server.scm +++ b/src/gacela_server.scm @@ -17,6 +17,7 @@ (define start-server #f) (define check-connections #f) +(define eval-from-clients #f) (define stop-server #f) (let ((server-socket #f) (clients '())) @@ -34,6 +35,21 @@ (lambda () (set! clients (cons (accept server-socket) clients))) (lambda (key . args) #f)))) + (set! eval-from-clients + (lambda () + (for-each + (lambda (cli) + (let ((sock (car cli))) + (cond ((char-ready? sock) + (catch #t + (lambda () (eval (read sock))) + (lambda (key . args) #f)))))) + clients))) + (set! stop-server (lambda () - (cond (server-socket (close server-socket) (set! server-socket #f))) \ No newline at end of file + (cond (server-socket + (close server-socket) + (set! server-socket #f))) + (for-each (lambda (cli) (close (car cli))) clients) + (set! clients '())))) -- 2.39.5 From c4dbd17a165312f189ec5211069dab4d039d5471 Mon Sep 17 00:00:00 2001 From: jsancho Date: Fri, 8 Jul 2011 12:48:00 +0000 Subject: [PATCH 14/16] --- src/gacela.c | 42 +++++++++++++++++++++++++++++++----------- src/gacela.scm | 32 +++++++++++++++++++------------- src/gacela_server.scm | 9 ++++++--- 3 files changed, 56 insertions(+), 27 deletions(-) diff --git a/src/gacela.c b/src/gacela.c index cb464a5..f6c970b 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -179,18 +179,38 @@ load_scheme_files (char *path) scm_primitive_load_path (scm_from_locale_string ("gacela_loader.scm")); } +void +start_single (int argc, char *argv[]) +{ + scm_with_guile (&init_gacela, NULL); + load_scheme_files (dirname (argv[0])); + scm_shell (argc, argv); +} + +void +start_server (int argc, char *argv[]) +{ + scm_with_guile (&init_gacela, NULL); + load_scheme_files (dirname (argv[0])); + scm_c_eval_string ("(start-server 1234)"); + scm_c_eval_string ("(game-loop)"); +} + +void +start_client (void) +{ + scm_init_guile (); + gacela_client (); +} + int main (int argc, char *argv[]) { - if (fork () == 0) { - scm_with_guile (&init_gacela, NULL); - load_scheme_files (dirname (argv[0])); - //scm_shell (argc, argv); - scm_c_eval_string ("(start-server 1234)"); - scm_c_eval_string ("(run-game)"); - } - else { - scm_init_guile (); - gacela_client (); - } + start_single (argc, argv); + /* + if (fork () == 0) + start_server (); + else + start_client (); + */ } diff --git a/src/gacela.scm b/src/gacela.scm index ff28dbb..569edc3 100644 --- a/src/gacela.scm +++ b/src/gacela.scm @@ -26,6 +26,7 @@ ;;; SDL Initialization Subsystem (define init-sdl #f) +(define sdl-on? #f) (define quit-sdl #f) (let ((initialized #f)) @@ -34,6 +35,10 @@ (cond ((not initialized) (SDL_Init SDL_INIT_EVERYTHING) (set! initialized #t)) (else initialized)))) + (set! sdl-on? + (lambda () + (if initialized #t #f))) + (set! quit-sdl (lambda () (SDL_Quit) @@ -237,19 +242,20 @@ (set! running #t) (quit? #f) (do () ((quit?)) - (init-frame-time) -; (check-connections) -; (eval-from-clients) - (process-events) - (cond ((not (quit?)) - (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT)) - (to-origin) - (cond ((mobs-changed?) (set! mobs (get-active-mobs)))) - (if (procedure? game-code) (game-code)) - (run-mob-actions mobs) - (render-mobs mobs) - (SDL_GL_SwapBuffers) - (delay-frame)))) + (if (sdl-on?) (init-frame-time)) + (check-connections) + (eval-from-clients) + (cond ((sdl-on?) + (process-events) + (cond ((not (quit?)) + (glClear (+ GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT)) + (to-origin) + (cond ((mobs-changed?) (set! mobs (get-active-mobs)))) + (if (procedure? game-code) (game-code)) + (run-mob-actions mobs) + (render-mobs mobs) + (SDL_GL_SwapBuffers) + (delay-frame)))))) (set! running #f))) (set! game-running? diff --git a/src/gacela_server.scm b/src/gacela_server.scm index a95ec9d..f58c8b6 100644 --- a/src/gacela_server.scm +++ b/src/gacela_server.scm @@ -24,7 +24,7 @@ (set! start-server (lambda (port) (set! server-socket (socket PF_INET SOCK_STREAM 0)) - (fcntl server-socket F_SETFL (logior O_NONBLOCK (fcntl server-socket F_GETFL))) +; (fcntl server-socket F_SETFL (logior O_NONBLOCK (fcntl server-socket F_GETFL))) (setsockopt server-socket SOL_SOCKET SO_REUSEADDR 1) (bind server-socket AF_INET INADDR_ANY port) (listen server-socket 5))) @@ -32,7 +32,10 @@ (set! check-connections (lambda () (catch #t - (lambda () (set! clients (cons (accept server-socket) clients))) +; (lambda () (set! clients (cons (accept server-socket) clients))) + (lambda () + (cond ((char-ready? server-socket) + (set! clients (cons (accept server-socket) clients))))) (lambda (key . args) #f)))) (set! eval-from-clients @@ -42,7 +45,7 @@ (let ((sock (car cli))) (cond ((char-ready? sock) (catch #t - (lambda () (eval (read sock))) + (lambda () (display (primitive-eval (read sock)) sock)) (lambda (key . args) #f)))))) clients))) -- 2.39.5 From ee8cc28a7551d08466af97636c38e55516a22876 Mon Sep 17 00:00:00 2001 From: jsancho Date: Fri, 8 Jul 2011 18:42:12 +0000 Subject: [PATCH 15/16] --- Makefile | 281 ++++++++++++++---------------------------- src/gacela.c | 35 ++++-- src/gacela.scm | 2 +- src/gacela_events.scm | 11 +- src/gacela_server.scm | 26 +++- 5 files changed, 150 insertions(+), 205 deletions(-) diff --git a/Makefile b/Makefile index b562aea..554812a 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.10.1 from Makefile.am. # Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,9 +16,8 @@ pkgdatadir = $(datadir)/gacela -pkgincludedir = $(includedir)/gacela pkglibdir = $(libdir)/gacela -pkglibexecdir = $(libexecdir)/gacela +pkgincludedir = $(includedir)/gacela am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c @@ -46,7 +44,6 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -61,29 +58,12 @@ am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(docdir)" +dist_docDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -91,43 +71,18 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ - { test ! -d "$(distdir)" \ - || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ - && rm -fr "$(distdir)"; }; } -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/jsancho/proyectos/guile/missing --run aclocal-1.11 -AMTAR = ${SHELL} /home/jsancho/proyectos/guile/missing --run tar -AUTOCONF = ${SHELL} /home/jsancho/proyectos/guile/missing --run autoconf -AUTOHEADER = ${SHELL} /home/jsancho/proyectos/guile/missing --run autoheader -AUTOMAKE = ${SHELL} /home/jsancho/proyectos/guile/missing --run automake-1.11 +ACLOCAL = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run aclocal-1.10 +AMTAR = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run tar +AUTOCONF = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoconf +AUTOHEADER = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run autoheader +AUTOMAKE = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run automake-1.10 AWK = mawk CC = gcc CCDEPMODE = depmode=gcc3 @@ -140,11 +95,11 @@ ECHO_C = ECHO_N = -n ECHO_T = EXEEXT = -GUILE = /usr/local/bin/guile -GUILE_CFLAGS = -I/usr/local/include -pthread -GUILE_CONFIG = /usr/local/bin/guile-config -GUILE_LDFLAGS = -pthread -L/usr/local/lib -lguile -lltdl -lgmp -lcrypt -lm -lltdl -GUILE_TOOLS = /usr/local/bin/guile-tools +GUILE = /usr/bin/guile +GUILE_CFLAGS = +GUILE_CONFIG = /usr/bin/guile-config +GUILE_LDFLAGS = -lguile -lltdl -lgmp -lcrypt -lm -lltdl +GUILE_TOOLS = /usr/bin/guile-tools INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} @@ -154,7 +109,7 @@ LDFLAGS = LIBOBJS = LIBS = -lreadline -lSDL -lSDL_image -lSDL_gfx -lSDL_mixer -lGL -lGLU -lftgl LTLIBOBJS = -MAKEINFO = ${SHELL} /home/jsancho/proyectos/guile/missing --run makeinfo +MAKEINFO = ${SHELL} /home/jsancho/proyectos/gacela/trunk/missing --run makeinfo MKDIR_P = /bin/mkdir -p OBJEXT = o PACKAGE = gacela @@ -162,17 +117,16 @@ PACKAGE_BUGREPORT = jsf@jsancho.org PACKAGE_NAME = gacela PACKAGE_STRING = gacela 0.5 PACKAGE_TARNAME = gacela -PACKAGE_URL = PACKAGE_VERSION = 0.5 PATH_SEPARATOR = : SET_MAKE = SHELL = /bin/bash STRIP = VERSION = 0.5 -abs_builddir = /home/jsancho/proyectos/guile -abs_srcdir = /home/jsancho/proyectos/guile -abs_top_builddir = /home/jsancho/proyectos/guile -abs_top_srcdir = /home/jsancho/proyectos/guile +abs_builddir = /home/jsancho/proyectos/gacela/trunk +abs_srcdir = /home/jsancho/proyectos/gacela/trunk +abs_top_builddir = /home/jsancho/proyectos/gacela/trunk +abs_top_srcdir = /home/jsancho/proyectos/gacela/trunk ac_ct_CC = gcc am__include = include am__leading_dot = . @@ -191,7 +145,7 @@ host_alias = htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/jsancho/proyectos/guile/install-sh +install_sh = $(SHELL) /home/jsancho/proyectos/gacela/trunk/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale @@ -208,7 +162,6 @@ sharedstatedir = ${prefix}/com srcdir = . sysconfdir = ${prefix}/etc target_alias = -top_build_prefix = top_builddir = . top_srcdir = . SUBDIRS = src @@ -223,15 +176,15 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign Makefile + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -247,10 +200,9 @@ $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENC $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) + cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ @@ -262,7 +214,7 @@ stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ @@ -271,23 +223,20 @@ distclean-hdr: install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" - @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ - for p in $$list; do \ + @list='$(dist_doc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ + f=$(am__strip_dir) \ + echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \ + $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) - @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(docdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(docdir)" && rm -f $$files + @list='$(dist_doc_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \ + rm -f "$(DESTDIR)$(docdir)/$$f"; \ + done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -296,7 +245,7 @@ uninstall-dist_docDATA: # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ + @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -313,7 +262,7 @@ $(RECURSIVE_TARGETS): else \ local_target="$$target"; \ fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ @@ -321,7 +270,7 @@ $(RECURSIVE_TARGETS): fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ + @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ @@ -347,16 +296,16 @@ $(RECURSIVE_CLEAN_TARGETS): else \ local_target="$$target"; \ fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) @@ -364,14 +313,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) - set x; \ + tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ @@ -383,7 +332,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ @@ -392,41 +341,36 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) + tags=; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique + $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" + test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -442,55 +386,38 @@ distdir: $(DISTFILES) if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ - am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" + || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) @@ -503,10 +430,6 @@ dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) -dist-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz - $(am__remove_distdir) - dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) @@ -530,17 +453,15 @@ dist dist-all: distdir distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac @@ -548,11 +469,9 @@ distcheck: dist mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ + && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ @@ -574,15 +493,13 @@ distcheck: dist && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: - @$(am__cd) '$(distuninstallcheck_dir)' \ + @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ @@ -627,7 +544,6 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -647,8 +563,6 @@ dvi-am: html: html-recursive -html-am: - info: info-recursive info-am: @@ -657,28 +571,18 @@ install-data-am: install-dist_docDATA install-dvi: install-dvi-recursive -install-dvi-am: - install-exec-am: install-html: install-html-recursive -install-html-am: - install-info: install-info-recursive -install-info-am: - install-man: install-pdf: install-pdf-recursive -install-pdf-am: - install-ps: install-ps-recursive -install-ps-am: - installcheck-am: maintainer-clean: maintainer-clean-recursive @@ -701,25 +605,24 @@ ps-am: uninstall-am: uninstall-dist_docDATA -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-strip tags-recursive +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-generic \ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ - dist-lzma dist-shar dist-tarZ dist-xz dist-zip distcheck \ - distclean distclean-generic distclean-hdr distclean-tags \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dist_docDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags \ - tags-recursive uninstall uninstall-am uninstall-dist_docDATA - + dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-dist_docDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-dist_docDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/src/gacela.c b/src/gacela.c index f6c970b..fdb76db 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -20,6 +20,7 @@ #include #include #include +#include #include "gacela_SDL.h" #include "gacela_GL.h" #include "gacela_FTGL.h" @@ -32,14 +33,14 @@ find_matching_paren (int k) register char c = 0; int end_parens_found = 0; - /* Choose the corresponding opening bracket. */ + // Choose the corresponding opening bracket if (k == ')') c = '('; else if (k == ']') c = '['; else if (k == '}') c = '{'; for (i = rl_point-2; i >= 0; i--) { - /* Is the current character part of a character literal? */ + // Is the current character part of a character literal? if (i - 2 >= 0 && rl_line_buffer[i - 1] == '\\' && rl_line_buffer[i - 2] == '#') @@ -48,7 +49,7 @@ find_matching_paren (int k) end_parens_found++; else if (rl_line_buffer[i] == '"') { - /* Skip over a string literal. */ + // Skip over a string literal for (i--; i >= 0; i--) if (rl_line_buffer[i] == '"' && ! (i - 1 >= 0 @@ -74,7 +75,7 @@ match_paren (int x, int k) rl_insert (x, k); - /* Did we just insert a quoted paren? If so, then don't bounce. */ + // Did we just insert a quoted paren? If so, then don't bounce if (rl_point - 1 >= 1 && rl_line_buffer[rl_point - 2] == '\\') return 0; @@ -111,12 +112,12 @@ init_gacela_client () { struct sigaction new_action; - /* init bouncing parens */ + // init bouncing parens rl_bind_key (')', match_paren); rl_bind_key (']', match_paren); rl_bind_key ('}', match_paren); - /* SIGINT */ + // SIGINT new_action.sa_handler = ctrl_c_handler; sigemptyset (&new_action.sa_mask); new_action.sa_flags = 0; @@ -125,11 +126,25 @@ init_gacela_client () } void -gacela_client (void) +gacela_client (char *hostname, int port) { + int sockfd; + struct hostent *server; + struct sockaddr_in serv_addr; + char *line; char *history_path; + // Connect to the server + sockfd = socket (AF_INET, SOCK_STREAM, 0); + server = gethostbyname (hostname); + bzero ((char *) &serv_addr, sizeof (serv_addr)); + serv_addr.sin_family = AF_INET; + bcopy ((char *)server->h_addr, (char *)&serv_addr.sin_addr.s_addr, server->h_length); + serv_addr.sin_port = htons (port); + connect (sockfd, (struct sockaddr *) &serv_addr, sizeof (serv_addr)); + + // Command line asprintf (&history_path, "%s/.gacela_history", getenv("HOME")); init_gacela_client (); @@ -197,10 +212,10 @@ start_server (int argc, char *argv[]) } void -start_client (void) +start_client (char *hostname, int port) { scm_init_guile (); - gacela_client (); + gacela_client (hostname, port); } int @@ -211,6 +226,6 @@ main (int argc, char *argv[]) if (fork () == 0) start_server (); else - start_client (); + start_client ("localhost", 1234); */ } diff --git a/src/gacela.scm b/src/gacela.scm index 569edc3..c8c9fff 100644 --- a/src/gacela.scm +++ b/src/gacela.scm @@ -240,7 +240,7 @@ (lambda () (set! mobs (get-active-mobs)) (set! running #t) - (quit? #f) + (quit! #f) (do () ((quit?)) (if (sdl-on?) (init-frame-time)) (check-connections) diff --git a/src/gacela_events.scm b/src/gacela_events.scm index cd93985..56099b3 100644 --- a/src/gacela_events.scm +++ b/src/gacela_events.scm @@ -30,16 +30,21 @@ (define (process-events) (let ((events (poll-events))) - (quit? (not (null? (get-event events `(,SDL_QUIT))))) + (quit! (not (null? (get-event events `(,SDL_QUIT))))) (clear-key-state) (process-keyboard-events (get-event events `(,SDL_KEYDOWN ,SDL_KEYUP))))) (define quit? #f) +(define quit! #f) (let ((quit #f)) (set! quit? - (lambda* (#:optional (value '())) - (if (null? value) quit (set! quit value))))) + (lambda () + quit)) + + (set! quit! + (lambda (value) + (set! quit value)))) (define (process-keyboard-events events) (cond ((not (null? events)) diff --git a/src/gacela_server.scm b/src/gacela_server.scm index f58c8b6..ef7b24e 100644 --- a/src/gacela_server.scm +++ b/src/gacela_server.scm @@ -17,6 +17,7 @@ (define start-server #f) (define check-connections #f) +(define clean-closed-connections #f) (define eval-from-clients #f) (define stop-server #f) @@ -29,8 +30,19 @@ (bind server-socket AF_INET INADDR_ANY port) (listen server-socket 5))) + (set! clean-closed-connections + (lambda (conns) + (cond ((null? conns) '()) + (else + (let* ((cli (car conns)) (sock (car cli))) + (cond ((port-closed? sock) + (clean-closed-connections (cdr conns))) + (else + (cons cli (clean-closed-connections (cdr conns)))))))))) + (set! check-connections (lambda () + (set! clients (clean-closed-connections clients)) (catch #t ; (lambda () (set! clients (cons (accept server-socket) clients))) (lambda () @@ -45,8 +57,18 @@ (let ((sock (car cli))) (cond ((char-ready? sock) (catch #t - (lambda () (display (primitive-eval (read sock)) sock)) - (lambda (key . args) #f)))))) + (lambda () + (let ((exp (read sock))) + (cond ((eof-object? exp) + (close sock)) + (else + (format sock "~a~%" (primitive-eval exp)))))) + (lambda (key . args) + (let ((fmt (string-concatenate (list (cadr args) "~%"))) + (params (caddr args))) + (if params + (apply format (cons sock (cons fmt params))) + (format sock fmt))))))))) clients))) (set! stop-server -- 2.39.5 From 73ed7bc4800eff475715461ac8c9c26a8531d4f6 Mon Sep 17 00:00:00 2001 From: jsancho Date: Sun, 10 Jul 2011 05:21:15 +0000 Subject: [PATCH 16/16] --- src/gacela.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/gacela.c b/src/gacela.c index fdb76db..8c36b4e 100644 --- a/src/gacela.c +++ b/src/gacela.c @@ -21,6 +21,9 @@ #include #include #include +#include +#include + #include "gacela_SDL.h" #include "gacela_GL.h" #include "gacela_FTGL.h" @@ -195,19 +198,24 @@ load_scheme_files (char *path) } void -start_single (int argc, char *argv[]) +start_single (char *working_path) { + char *argv = "guile"; + scm_with_guile (&init_gacela, NULL); - load_scheme_files (dirname (argv[0])); - scm_shell (argc, argv); + load_scheme_files (working_path); + scm_shell (1, &argv); } void -start_server (int argc, char *argv[]) +start_server (char *working_path, int port) { + char start_server[100]; + scm_with_guile (&init_gacela, NULL); - load_scheme_files (dirname (argv[0])); - scm_c_eval_string ("(start-server 1234)"); + load_scheme_files (working_path); + sprintf (start_server, "(start-server %d)", port); + scm_c_eval_string (start_server); scm_c_eval_string ("(game-loop)"); } @@ -221,7 +229,16 @@ start_client (char *hostname, int port) int main (int argc, char *argv[]) { - start_single (argc, argv); + int shell_mode = 0; + int port; + int i; + + for (i = 1; i < argc; i++) + if (strcmp (argv[i], "--shell-mode") == 0) + shell_mode = 1; + + if (shell_mode == 1) + start_single (dirname (argv[0])); /* if (fork () == 0) start_server (); -- 2.39.5