From 24315755dc301cd43db01f09bffdfbc06e4c5632 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sat, 16 Feb 2019 16:05:18 -0700 Subject: [PATCH] standard plugin Makefile.ams: backport recent changes to x11 Use _SOURCES and nodist_ _SOURCES rather than a _LIBADD. Consider re-compiling Scheme code if -const.bin changes. Punt trying to override etag's commandline. Use the tags rule to append .cdecls and use tags-fix.sh to re-order the files. Use EXEEXT. Provide mostlyclean-local. Use standard copyright notice. Remove trailing whitespace. --- src/blowfish/Makefile.am | 34 ++++++----- src/blowfish/tags-fix.sh | 117 ++++++++++++++++++++++++++----------- src/edwin/Makefile.am | 22 ++++--- src/edwin/configure.ac | 4 +- src/gdbm/Makefile.am | 34 ++++++----- src/gdbm/tags-fix.sh | 117 ++++++++++++++++++++++++++----------- src/imail/Makefile.am | 28 ++++----- src/imail/configure.ac | 4 +- src/mcrypt/Makefile.am | 38 +++++++----- src/mcrypt/tags-fix.sh | 117 ++++++++++++++++++++++++++----------- src/pgsql/Makefile.am | 42 +++++++------ src/pgsql/tags-fix.sh | 117 ++++++++++++++++++++++++++----------- src/x11-screen/Makefile.am | 31 +++++----- src/x11/Makefile.am | 43 +++++++------- src/x11/tags-fix.sh | 117 ++++++++++++++++++++++++++----------- 15 files changed, 568 insertions(+), 297 deletions(-) diff --git a/src/blowfish/Makefile.am b/src/blowfish/Makefile.am index 4fec71e53..82c5ec743 100644 --- a/src/blowfish/Makefile.am +++ b/src/blowfish/Makefile.am @@ -5,19 +5,19 @@ ## 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, ## 2015, 2016, 2017, 2018, 2019 Massachusetts Institute of ## Technology -## +## ## This file is part of MIT/GNU Scheme. -## +## ## MIT/GNU Scheme 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 2 of the License, or (at ## your option) any later version. -## +## ## MIT/GNU Scheme 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 MIT/GNU Scheme; if not, write to the Free Software ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, @@ -51,11 +51,13 @@ AM_UPDATE_INFO_DIR = no AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ AM_CFLAGS = @MIT_CFLAGS@ -blowfish_shim_la_LIBADD = blowfish-adapter.lo blowfish_shim_la_LDFLAGS = -module -avoid-version -shared +blowfish_shim_la_SOURCES = blowfish-adapter.c blowfish-shim.h +nodist_blowfish_shim_la_SOURCES = blowfish-shim.c -noinst_PROGRAMS = blowfish-const -blowfish_const_SOURCES = blowfish-const.c blowfish-shim.h +noinst_PROGRAMS = blowfish-const$(EXEEXT) +blowfish_const_SOURCES = blowfish-shim.h +nodist_blowfish_const_SOURCES = blowfish-const.c blowfish-shim.c: stamp-shim blowfish-const.c: stamp-shim @@ -68,14 +70,19 @@ stamp-shim: blowfish-shim.h $(cdecls) blowfish-const.bin: blowfish-const.scm echo '(sf "blowfish-const")' | $(MIT_SCHEME_EXE) --batch-mode -blowfish-const.scm: blowfish-const +blowfish-const.scm: blowfish-const$(EXEEXT) ./blowfish-const @MIT_SCHEME_DEPS@ -stamp-scheme: stamp-shim $(sources) blowfish.pkg +stamp-scheme: stamp-shim $(sources) blowfish-const.bin blowfish.pkg MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) ./compile.sh echo "done" > $@ +MOSTLYCLEANFILES = $(scmlib_LTLIBRARIES) blowfish-const$(EXEEXT) + +mostlyclean-local: + -rm -rf .libs + CLEANFILES = blowfish-const* blowfish-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd CLEANFILES += stamp-shim stamp-scheme @@ -85,13 +92,10 @@ TESTS = blowfish-check.sh CLEANFILES += test tags: tags-am - ./tags-fix.sh blowfish - -all_sources = $(sources) blowfish-adapter.c -ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) -TAGS_DEPENDENCIES = $(all_sources) $(cdecls) + $(ETAGS) -a $(sources) -r '/^([^iI].*/' $(cdecls) + ./tags-fix.sh -EXTRA_DIST += $(all_sources) $(cdecls) compile.sh compile.scm blowfish.pkg +EXTRA_DIST += $(sources) $(cdecls) compile.sh compile.scm blowfish.pkg EXTRA_DIST += blowfish-test.scm blowfish-check.scm blowfish-check.sh EXTRA_DIST += make.scm optiondb.scm tags-fix.sh debian diff --git a/src/blowfish/tags-fix.sh b/src/blowfish/tags-fix.sh index a22e6bab5..c100cbd4b 100755 --- a/src/blowfish/tags-fix.sh +++ b/src/blowfish/tags-fix.sh @@ -1,42 +1,91 @@ #!/bin/sh # -*-Scheme-*- # -# Chop the generated $1-shim.c and $1-const.c files out of TAGS. +# Changes to TAGS: +# + Punt any generated *-shim.c and *-const.c files. +# + Re-order the files: .scm first, .[hc] next, whatnot, and .cdecls last. +# Someday: +# + Index the .cdecls? set -e : ${MIT_SCHEME_EXE=mit-scheme} ${MIT_SCHEME_EXE} --batch-mode -- ${1+"$@"} <<\EOF -(let ((name (car (command-line-arguments)))) - (let ((shim.c-prefix (string-append name "-shim.c,")) - (const.c-prefix (string-append name "-const.c,"))) - - (define (rewriter in out) - (let loop ((skipping? #f)) - (let ((line (read-line in))) - (cond ((eof-object? line) - unspecific) - ((string=? line "\f") - (let ((next (read-line in))) - (cond ((eof-object? next) (error "Bogus TAGS format:" next)) - ((or (string-prefix? shim.c-prefix next) - (string-prefix? const.c-prefix next)) - (loop #t)) - (else - (write-string line out) - (newline out) - (write-string next out) - (newline out) - (loop #f))))) - (skipping? - (loop skipping?)) - (else - (write-string line out) - (newline out) - (loop skipping?)))))) - - (parameterize ((param:suppress-loading-message? #t)) - (load-option 'FFI)) - ((access rewrite-file (->environment '(ffi build))) - (merge-pathnames "TAGS") - rewriter))) +(let () + + (define-integrable (make-section filename bytecount lines) + (cons (cons filename bytecount) lines)) + (define-integrable section.filename caar) + (define-integrable section.bytecount cdar) + (define-integrable section.lines cdr) + + (define headline-pattern + (compile-regsexp '(seq (line-start) + (group filename (+ (char-not-in #\,))) + #\, + (group bytecount (+ (char-in numeric))) + (line-end)))) + + (define (write-section section out) + (write-string "\f\n" out) + (write-string (string (section.filename section) + #\, (section.bytecount section) + "\n") + out) + (for-each (lambda (line) (write-string line out) (newline out)) + (section.lines section))) + + (define (write-sections sections out) + (for-each (lambda (section) (write-section section out)) + (sort sections + (lambda (a b) + (stringenvironment '(ffi build))) + (merge-pathnames "TAGS") + rewriter))) EOF diff --git a/src/edwin/Makefile.am b/src/edwin/Makefile.am index 21f8781eb..884a45da3 100644 --- a/src/edwin/Makefile.am +++ b/src/edwin/Makefile.am @@ -7,17 +7,17 @@ ## Technology ## ## This file is part of MIT/GNU Scheme. -## +## ## MIT/GNU Scheme 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 2 of the License, or (at ## your option) any later version. -## +## ## MIT/GNU Scheme 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 MIT/GNU Scheme; if not, write to the Free Software ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, @@ -31,20 +31,19 @@ scmlib_subdir = $(scmlibdir)edwin scmdocdir = $(datarootdir)/doc/@MIT_SCHEME_PROJECT@ #scminfodir = $(scmdocdir)/info -scmlib_sub_DATA = $(sources) -scmlib_sub_DATA += $(binaries) +scmlib_sub_DATA = $(sources) $(binaries) scmlib_sub_DATA += loadef.scm edwin.bld -scmlib_sub_DATA += make.scm edwin.pkg edwin-@MIT_SCHEME_OS_SUFFIX@.pkd +scmlib_sub_DATA += make.scm edwin.pkg @MIT_SCHEME_PKD@ scmlib_sub_DATA += TUTORIAL #scminfo_DATA = edwin.info #info_TEXINFOS = edwin.texi -#AM_MAKEINFOHTMLFLAGS = --no-split +#AM_MAKEINFOHTMLFLAGS = --no-split --css-ref=style.css #AM_UPDATE_INFO_DIR = no include $(srcdir)/source-dependencies.am edwin.bld: stamp-scheme -edwin-@MIT_SCHEME_OS_SUFFIX@.pkd: stamp-scheme +@MIT_SCHEME_PKD@: stamp-scheme stamp-scheme: $(sources) edwin.ldr edwin.pkg MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) ./compile.sh echo "done" > $@ @@ -52,11 +51,10 @@ stamp-scheme: $(sources) edwin.ldr edwin.pkg CLEANFILES = *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd *.bld CLEANFILES += stamp-scheme -ETAGS_ARGS = $(sources) edwin.ldr -TAGS_DEPENDENCIES = $(sources) edwin.ldr +TAGS_FILES = $(sources) edwin.ldr -EXTRA_DIST += $(sources) TUTORIAL -EXTRA_DIST += sources.sh compile.sh decls.scm edwin.ldr +EXTRA_DIST += $(sources) edwin.ldr TUTORIAL +EXTRA_DIST += sources.scm sources.sh compile.sh decls.scm EXTRA_DIST += edwin.sf edwin.cbf edwin.pkg debian install-data-hook: diff --git a/src/edwin/configure.ac b/src/edwin/configure.ac index 0333adb9f..bba891d7b 100644 --- a/src/edwin/configure.ac +++ b/src/edwin/configure.ac @@ -58,9 +58,11 @@ if test x"${MIT_SCHEME_OS_SUFFIX}" = x; then | ${MIT_SCHEME_TOOLCHAIN_EXE} --batch-mode` fi +MIT_SCHEME_PKD="edwin-${MIT_SCHEME_OS_SUFFIX}.pkd" + AC_SUBST([MIT_SCHEME_PROJECT]) AC_SUBST([MIT_SCHEME_TOOLCHAIN_EXE]) AC_SUBST([MIT_SCHEME_LIBDIR]) -AC_SUBST([MIT_SCHEME_OS_SUFFIX]) +AC_SUBST([MIT_SCHEME_PKD]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/src/gdbm/Makefile.am b/src/gdbm/Makefile.am index 28837ba2f..e65e59632 100644 --- a/src/gdbm/Makefile.am +++ b/src/gdbm/Makefile.am @@ -5,19 +5,19 @@ ## 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, ## 2015, 2016, 2017, 2018, 2019 Massachusetts Institute of ## Technology -## +## ## This file is part of MIT/GNU Scheme. -## +## ## MIT/GNU Scheme 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 2 of the License, or (at ## your option) any later version. -## +## ## MIT/GNU Scheme 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 MIT/GNU Scheme; if not, write to the Free Software ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, @@ -51,11 +51,13 @@ AM_UPDATE_INFO_DIR = no AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ AM_CFLAGS = @MIT_CFLAGS@ -gdbm_shim_la_LIBADD = gdbm-adapter.lo gdbm_shim_la_LDFLAGS = -module -avoid-version -shared +gdbm_shim_la_SOURCES = gdbm-adapter.c gdbm-shim.h +nodist_gdbm_shim_la_SOURCES = gdbm-shim.c -noinst_PROGRAMS = gdbm-const -gdbm_const_SOURCES = gdbm-const.c gdbm-shim.h +noinst_PROGRAMS = gdbm-const$(EXEEXT) +gdbm_const_SOURCES = gdbm-shim.h +nodist_gdbm_const_SOURCES = gdbm-const.c gdbm-shim.c: stamp-shim gdbm-const.c: stamp-shim @@ -68,14 +70,19 @@ stamp-shim: gdbm-shim.h $(cdecls) gdbm-const.bin: gdbm-const.scm echo '(sf "gdbm-const")' | $(MIT_SCHEME_EXE) --batch-mode -gdbm-const.scm: gdbm-const +gdbm-const.scm: gdbm-const$(EXEEXT) ./gdbm-const @MIT_SCHEME_DEPS@ -stamp-scheme: stamp-shim $(sources) gdbm.pkg +stamp-scheme: stamp-shim $(sources) gdbm-const.bin gdbm.pkg MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) ./compile.sh echo "done" > $@ +MOSTLYCLEANFILES = $(scmlib_LTLIBRARIES) gdbm-const$(EXEEXT) + +mostlyclean-local: + -rm -rf .libs + CLEANFILES = gdbm-const* gdbm-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd CLEANFILES += stamp-shim stamp-scheme @@ -85,13 +92,10 @@ TESTS = gdbm-check.sh CLEANFILES += gdbm-check.db tags: tags-am - ./tags-fix.sh gdbm - -all_sources = $(sources) gdbm-adapter.c -ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) -TAGS_DEPENDENCIES = $(all_sources) $(cdecls) + $(ETAGS) -a $(sources) -r '/^([^iI].*/' $(cdecls) + ./tags-fix.sh -EXTRA_DIST += $(all_sources) $(cdecls) compile.sh compile.scm gdbm.pkg +EXTRA_DIST += $(sources) $(cdecls) compile.sh compile.scm gdbm.pkg EXTRA_DIST += gdbm-check.scm gdbm-check.sh EXTRA_DIST += make.scm optiondb.scm tags-fix.sh debian diff --git a/src/gdbm/tags-fix.sh b/src/gdbm/tags-fix.sh index a22e6bab5..c100cbd4b 100755 --- a/src/gdbm/tags-fix.sh +++ b/src/gdbm/tags-fix.sh @@ -1,42 +1,91 @@ #!/bin/sh # -*-Scheme-*- # -# Chop the generated $1-shim.c and $1-const.c files out of TAGS. +# Changes to TAGS: +# + Punt any generated *-shim.c and *-const.c files. +# + Re-order the files: .scm first, .[hc] next, whatnot, and .cdecls last. +# Someday: +# + Index the .cdecls? set -e : ${MIT_SCHEME_EXE=mit-scheme} ${MIT_SCHEME_EXE} --batch-mode -- ${1+"$@"} <<\EOF -(let ((name (car (command-line-arguments)))) - (let ((shim.c-prefix (string-append name "-shim.c,")) - (const.c-prefix (string-append name "-const.c,"))) - - (define (rewriter in out) - (let loop ((skipping? #f)) - (let ((line (read-line in))) - (cond ((eof-object? line) - unspecific) - ((string=? line "\f") - (let ((next (read-line in))) - (cond ((eof-object? next) (error "Bogus TAGS format:" next)) - ((or (string-prefix? shim.c-prefix next) - (string-prefix? const.c-prefix next)) - (loop #t)) - (else - (write-string line out) - (newline out) - (write-string next out) - (newline out) - (loop #f))))) - (skipping? - (loop skipping?)) - (else - (write-string line out) - (newline out) - (loop skipping?)))))) - - (parameterize ((param:suppress-loading-message? #t)) - (load-option 'FFI)) - ((access rewrite-file (->environment '(ffi build))) - (merge-pathnames "TAGS") - rewriter))) +(let () + + (define-integrable (make-section filename bytecount lines) + (cons (cons filename bytecount) lines)) + (define-integrable section.filename caar) + (define-integrable section.bytecount cdar) + (define-integrable section.lines cdr) + + (define headline-pattern + (compile-regsexp '(seq (line-start) + (group filename (+ (char-not-in #\,))) + #\, + (group bytecount (+ (char-in numeric))) + (line-end)))) + + (define (write-section section out) + (write-string "\f\n" out) + (write-string (string (section.filename section) + #\, (section.bytecount section) + "\n") + out) + (for-each (lambda (line) (write-string line out) (newline out)) + (section.lines section))) + + (define (write-sections sections out) + (for-each (lambda (section) (write-section section out)) + (sort sections + (lambda (a b) + (stringenvironment '(ffi build))) + (merge-pathnames "TAGS") + rewriter))) EOF diff --git a/src/imail/Makefile.am b/src/imail/Makefile.am index f2eb3570c..a1bb904fe 100644 --- a/src/imail/Makefile.am +++ b/src/imail/Makefile.am @@ -6,21 +6,22 @@ ## 2015, 2016, 2017, 2018, 2019 Massachusetts Institute of ## Technology ## -## This file is part of the IMail option for MIT/GNU Scheme. +## This file is part of MIT/GNU Scheme. ## -## IMail 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 2 of the License, or -## (at your option) any later version. +## MIT/GNU Scheme 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 2 of the License, or (at +## your option) any later version. ## -## IMail is distributed in the hope that it will be useful, but +## MIT/GNU Scheme 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 IMail; if not, write to the Free Software Foundation, -## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. +## along with MIT/GNU Scheme; if not, write to the Free Software +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, +## USA. EXTRA_DIST = autogen.sh @@ -47,9 +48,8 @@ binaries += imail-util.bci imail-util.com binaries += imap-response.bci imap-response.com binaries += imap-syntax.bci imap-syntax.com -scmlib_sub_DATA = $(sources) -scmlib_sub_DATA += $(binaries) -scmlib_sub_DATA += make.scm imail.pkg imail-@MIT_SCHEME_OS_SUFFIX@.pkd +scmlib_sub_DATA = $(sources) $(binaries) +scmlib_sub_DATA += make.scm imail.pkg @MIT_SCHEME_PKD@ scminfo_DATA = imail.info info_TEXINFOS = imail.texi @@ -90,10 +90,10 @@ CLEANFILES += stamp-scheme #TESTS = imail-check.sh -ETAGS_ARGS = $(sources) -TAGS_DEPENDENCIES = $(sources) +TAGS_FILES = $(sources) -EXTRA_DIST += $(sources) compile.sh make.scm compile.scm imail.pkg debian +EXTRA_DIST += $(sources) compile.sh compile.scm imail.pkg +EXTRA_DIST += make.scm debian install-data-hook: ( echo '(add-plugin "imail" "@MIT_SCHEME_PROJECT@"'; \ diff --git a/src/imail/configure.ac b/src/imail/configure.ac index 1d6124c72..c7156ff6c 100644 --- a/src/imail/configure.ac +++ b/src/imail/configure.ac @@ -58,9 +58,11 @@ if test x"${MIT_SCHEME_OS_SUFFIX}" = x; then | ${MIT_SCHEME_TOOLCHAIN_EXE} --batch-mode` fi +MIT_SCHEME_PKD="imail-${MIT_SCHEME_OS_SUFFIX}.pkd" + AC_SUBST([MIT_SCHEME_PROJECT]) AC_SUBST([MIT_SCHEME_TOOLCHAIN_EXE]) AC_SUBST([MIT_SCHEME_LIBDIR]) -AC_SUBST([MIT_SCHEME_OS_SUFFIX]) +AC_SUBST([MIT_SCHEME_PKD]) AC_CONFIG_FILES([Makefile]) AC_OUTPUT diff --git a/src/mcrypt/Makefile.am b/src/mcrypt/Makefile.am index b8eefc028..7fae2e567 100644 --- a/src/mcrypt/Makefile.am +++ b/src/mcrypt/Makefile.am @@ -5,19 +5,19 @@ ## 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, ## 2015, 2016, 2017, 2018, 2019 Massachusetts Institute of ## Technology -## +## ## This file is part of MIT/GNU Scheme. -## +## ## MIT/GNU Scheme 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 2 of the License, or (at ## your option) any later version. -## +## ## MIT/GNU Scheme 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 MIT/GNU Scheme; if not, write to the Free Software ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, @@ -44,16 +44,20 @@ scmlib_sub_DATA = $(sources) $(binaries) scmlib_sub_DATA += make.scm mcrypt.pkg @MIT_SCHEME_PKD@ #scminfo_DATA = mcrypt.info -#AM_MAKEINFOHTMLFLAGS = --no-split +#info_TEXINFOS = mcrypt.texi +#AM_MAKEINFOHTMLFLAGS = --no-split --css-ref=style.css +#AM_UPDATE_INFO_DIR = no AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ AM_CFLAGS = @MIT_CFLAGS@ -mcrypt_shim_la_LIBADD = mcrypt-adapter.lo mcrypt_shim_la_LDFLAGS = -module -avoid-version -shared +mcrypt_shim_la_SOURCES = mcrypt-adapter.c mcrypt-shim.h +nodist_mcrypt_shim_la_SOURCES = mcrypt-shim.c -noinst_PROGRAMS = mcrypt-const -mcrypt_const_SOURCES = mcrypt-const.c mcrypt-shim.h +noinst_PROGRAMS = mcrypt-const$(EXEEXT) +mcrypt_const_SOURCES = mcrypt-shim.h +nodist_mcrypt_const_SOURCES = mcrypt-const.c mcrypt-shim.c: stamp-shim mcrypt-const.c: stamp-shim @@ -66,14 +70,19 @@ stamp-shim: mcrypt-shim.h $(cdecls) mcrypt-const.bin: mcrypt-const.scm echo '(sf "mcrypt-const")' | $(MIT_SCHEME_EXE) --batch-mode -mcrypt-const.scm: mcrypt-const +mcrypt-const.scm: mcrypt-const$(EXEEXT) ./mcrypt-const @MIT_SCHEME_DEPS@ -stamp-scheme: stamp-shim $(sources) mcrypt.pkg +stamp-scheme: stamp-shim $(sources) mcrypt-const.bin mcrypt.pkg MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) ./compile.sh echo "done" > $@ +MOSTLYCLEANFILES = $(scmlib_LTLIBRARIES) mcrypt-const$(EXEEXT) + +mostlyclean-local: + -rm -rf .libs + CLEANFILES = mcrypt-const* mcrypt-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd CLEANFILES += stamp-shim stamp-scheme @@ -83,13 +92,10 @@ TESTS = mcrypt-check.sh CLEANFILES += encrypted decrypted tags: tags-am - ./tags-fix.sh mcrypt - -all_sources = $(sources) mcrypt-adapter.c -ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) -TAGS_DEPENDENCIES = $(all_sources) $(cdecls) + $(ETAGS) -a $(sources) -r '/^([^iI].*/' $(cdecls) + ./tags-fix.sh -EXTRA_DIST += $(all_sources) $(cdecls) compile.sh compile.scm mcrypt.pkg +EXTRA_DIST += $(sources) $(cdecls) compile.sh compile.scm mcrypt.pkg EXTRA_DIST += mcrypt-check.scm mcrypt-check.sh EXTRA_DIST += make.scm optiondb.scm tags-fix.sh debian diff --git a/src/mcrypt/tags-fix.sh b/src/mcrypt/tags-fix.sh index a22e6bab5..c100cbd4b 100755 --- a/src/mcrypt/tags-fix.sh +++ b/src/mcrypt/tags-fix.sh @@ -1,42 +1,91 @@ #!/bin/sh # -*-Scheme-*- # -# Chop the generated $1-shim.c and $1-const.c files out of TAGS. +# Changes to TAGS: +# + Punt any generated *-shim.c and *-const.c files. +# + Re-order the files: .scm first, .[hc] next, whatnot, and .cdecls last. +# Someday: +# + Index the .cdecls? set -e : ${MIT_SCHEME_EXE=mit-scheme} ${MIT_SCHEME_EXE} --batch-mode -- ${1+"$@"} <<\EOF -(let ((name (car (command-line-arguments)))) - (let ((shim.c-prefix (string-append name "-shim.c,")) - (const.c-prefix (string-append name "-const.c,"))) - - (define (rewriter in out) - (let loop ((skipping? #f)) - (let ((line (read-line in))) - (cond ((eof-object? line) - unspecific) - ((string=? line "\f") - (let ((next (read-line in))) - (cond ((eof-object? next) (error "Bogus TAGS format:" next)) - ((or (string-prefix? shim.c-prefix next) - (string-prefix? const.c-prefix next)) - (loop #t)) - (else - (write-string line out) - (newline out) - (write-string next out) - (newline out) - (loop #f))))) - (skipping? - (loop skipping?)) - (else - (write-string line out) - (newline out) - (loop skipping?)))))) - - (parameterize ((param:suppress-loading-message? #t)) - (load-option 'FFI)) - ((access rewrite-file (->environment '(ffi build))) - (merge-pathnames "TAGS") - rewriter))) +(let () + + (define-integrable (make-section filename bytecount lines) + (cons (cons filename bytecount) lines)) + (define-integrable section.filename caar) + (define-integrable section.bytecount cdar) + (define-integrable section.lines cdr) + + (define headline-pattern + (compile-regsexp '(seq (line-start) + (group filename (+ (char-not-in #\,))) + #\, + (group bytecount (+ (char-in numeric))) + (line-end)))) + + (define (write-section section out) + (write-string "\f\n" out) + (write-string (string (section.filename section) + #\, (section.bytecount section) + "\n") + out) + (for-each (lambda (line) (write-string line out) (newline out)) + (section.lines section))) + + (define (write-sections sections out) + (for-each (lambda (section) (write-section section out)) + (sort sections + (lambda (a b) + (stringenvironment '(ffi build))) + (merge-pathnames "TAGS") + rewriter))) EOF diff --git a/src/pgsql/Makefile.am b/src/pgsql/Makefile.am index 2c793e240..06ea2e67c 100644 --- a/src/pgsql/Makefile.am +++ b/src/pgsql/Makefile.am @@ -5,19 +5,19 @@ ## 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, ## 2015, 2016, 2017, 2018, 2019 Massachusetts Institute of ## Technology -## +## ## This file is part of MIT/GNU Scheme. -## +## ## MIT/GNU Scheme 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 2 of the License, or (at ## your option) any later version. -## +## ## MIT/GNU Scheme 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 MIT/GNU Scheme; if not, write to the Free Software ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, @@ -30,6 +30,7 @@ MIT_SCHEME_EXE = @MIT_SCHEME_TOOLCHAIN_EXE@ scmlibdir = @MIT_SCHEME_LIBDIR@ scmlib_subdir = $(scmlibdir)pgsql scmdocdir = $(datarootdir)/doc/@MIT_SCHEME_PROJECT@ +#scminfodir = $(scmdocdir)/info scmlib_LTLIBRARIES = pgsql-shim.la scmlib_DATA = pgsql-types.bin pgsql-const.bin @@ -42,17 +43,22 @@ binaries = @MIT_SCHEME_BCIs@ @MIT_SCHEME_COMs@ scmlib_sub_DATA = $(sources) $(binaries) scmlib_sub_DATA += make.scm pgsql.pkg @MIT_SCHEME_PKD@ -#info_TEXINFOS = mit-scheme-pgsql.texi -#AM_MAKEINFOHTMLFLAGS = --no-split +#scminfo_DATA = pgsql.info +#info_TEXINFOS = pgsql.texi +#AM_MAKEINFOHTMLFLAGS = --no-split --css-ref=style.css +#AM_UPDATE_INFO_DIR = no AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ AM_CFLAGS = @MIT_CFLAGS@ `pkg-config --cflags libpq` -LIBS = `pkg-config --libs libpq` +AM_LIBS = `pkg-config --libs libpq` pgsql_shim_la_LDFLAGS = -module -avoid-version -shared +pgsql_shim_la_SOURCES = pgsql-shim.h +nodist_pgsql_shim_la_SOURCES = pgsql-shim.c -noinst_PROGRAMS = pgsql-const -pgsql_const_SOURCES = pgsql-const.c pgsql-shim.h +noinst_PROGRAMS = pgsql-const$(EXEEXT) +pgsql_const_SOURCES = pgsql-shim.h +nodist_pgsql_const_SOURCES = pgsql-const.c pgsql-shim.c: stamp-shim pgsql-const.c: stamp-shim @@ -65,14 +71,19 @@ stamp-shim: pgsql-shim.h $(cdecls) pgsql-const.bin: pgsql-const.scm echo '(sf "pgsql-const")' | $(MIT_SCHEME_EXE) --batch-mode -pgsql-const.scm: pgsql-const +pgsql-const.scm: pgsql-const$(EXEEXT) ./pgsql-const @MIT_SCHEME_DEPS@ -stamp-scheme: stamp-shim $(sources) pgsql.pkg +stamp-scheme: stamp-shim $(sources) pgsql-const.bin pgsql.pkg MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) ./compile.sh echo "done" > $@ +MOSTLYCLEANFILES = $(scmlib_LTLIBRARIES) pgsql-const$(EXEEXT) + +mostlyclean-local: + -rm -rf .libs + CLEANFILES = pgsql-const* pgsql-shim.c CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd CLEANFILES += stamp-shim stamp-scheme @@ -82,13 +93,10 @@ TESTS = pgsql-check.sh CLEANFILES += pgsql-check.db tags: tags-am - ./tags-fix.sh pgsql - -all_sources = $(sources) -ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) -TAGS_DEPENDENCIES = $(all_sources) $(cdecls) + $(ETAGS) -a $(sources) -r '/^([^iI].*/' $(cdecls) + ./tags-fix.sh -EXTRA_DIST += $(all_sources) $(cdecls) compile.sh compile.scm pgsql.pkg +EXTRA_DIST += $(sources) $(cdecls) compile.sh compile.scm pgsql.pkg EXTRA_DIST += pgsql-check.scm pgsql-check.sh EXTRA_DIST += make.scm optiondb.scm tags-fix.sh debian diff --git a/src/pgsql/tags-fix.sh b/src/pgsql/tags-fix.sh index a22e6bab5..c100cbd4b 100755 --- a/src/pgsql/tags-fix.sh +++ b/src/pgsql/tags-fix.sh @@ -1,42 +1,91 @@ #!/bin/sh # -*-Scheme-*- # -# Chop the generated $1-shim.c and $1-const.c files out of TAGS. +# Changes to TAGS: +# + Punt any generated *-shim.c and *-const.c files. +# + Re-order the files: .scm first, .[hc] next, whatnot, and .cdecls last. +# Someday: +# + Index the .cdecls? set -e : ${MIT_SCHEME_EXE=mit-scheme} ${MIT_SCHEME_EXE} --batch-mode -- ${1+"$@"} <<\EOF -(let ((name (car (command-line-arguments)))) - (let ((shim.c-prefix (string-append name "-shim.c,")) - (const.c-prefix (string-append name "-const.c,"))) - - (define (rewriter in out) - (let loop ((skipping? #f)) - (let ((line (read-line in))) - (cond ((eof-object? line) - unspecific) - ((string=? line "\f") - (let ((next (read-line in))) - (cond ((eof-object? next) (error "Bogus TAGS format:" next)) - ((or (string-prefix? shim.c-prefix next) - (string-prefix? const.c-prefix next)) - (loop #t)) - (else - (write-string line out) - (newline out) - (write-string next out) - (newline out) - (loop #f))))) - (skipping? - (loop skipping?)) - (else - (write-string line out) - (newline out) - (loop skipping?)))))) - - (parameterize ((param:suppress-loading-message? #t)) - (load-option 'FFI)) - ((access rewrite-file (->environment '(ffi build))) - (merge-pathnames "TAGS") - rewriter))) +(let () + + (define-integrable (make-section filename bytecount lines) + (cons (cons filename bytecount) lines)) + (define-integrable section.filename caar) + (define-integrable section.bytecount cdar) + (define-integrable section.lines cdr) + + (define headline-pattern + (compile-regsexp '(seq (line-start) + (group filename (+ (char-not-in #\,))) + #\, + (group bytecount (+ (char-in numeric))) + (line-end)))) + + (define (write-section section out) + (write-string "\f\n" out) + (write-string (string (section.filename section) + #\, (section.bytecount section) + "\n") + out) + (for-each (lambda (line) (write-string line out) (newline out)) + (section.lines section))) + + (define (write-sections sections out) + (for-each (lambda (section) (write-section section out)) + (sort sections + (lambda (a b) + (stringenvironment '(ffi build))) + (merge-pathnames "TAGS") + rewriter))) EOF diff --git a/src/x11-screen/Makefile.am b/src/x11-screen/Makefile.am index af0a46979..7e7370f3c 100644 --- a/src/x11-screen/Makefile.am +++ b/src/x11-screen/Makefile.am @@ -6,22 +6,22 @@ ## 2015, 2016, 2017, 2018, 2019 Massachusetts Institute of ## Technology ## -## This file is part of an X11-screen plugin for MIT/GNU Scheme. +## This file is part of MIT/GNU Scheme. ## -## This plugin 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 2 of the License, -## or (at your option) any later version. +## MIT/GNU Scheme 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 2 of the License, or (at +## your option) any later version. ## -## This plugin is distributed in the hope that it will be useful, but +## MIT/GNU Scheme 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 plugin; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -## 02110-1301, USA. +## along with MIT/GNU Scheme; if not, write to the Free Software +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, +## USA. EXTRA_DIST = autogen.sh @@ -39,7 +39,9 @@ scmlib_sub_DATA = $(sources) $(binaries) scmlib_sub_DATA += make.scm x11-screen.pkg @MIT_SCHEME_PKD@ #scminfo_DATA = x11-screen.info -#AM_MAKEINFOHTMLFLAGS = --no-split +#info_TEXINFOS = x11-screen.texi +#AM_MAKEINFOHTMLFLAGS = --no-split --css-ref=style.css +#AM_UPDATE_INFO_DIR = no @MIT_SCHEME_DEPS@ stamp-scheme: $(sources) x11-screen.pkg @@ -52,12 +54,11 @@ CLEANFILES += @MIT_SCHEME_CLEAN@ TESTS = x11-screen-check.sh -ETAGS_ARGS = $(sources) -TAGS_DEPENDENCIES = $(sources) +TAGS_FILES = $(sources) -EXTRA_DIST += $(sources) compile.sh x11-screen.pkg -EXTRA_DIST += x11-screen-check.sh x11-screen-test.scm -EXTRA_DIST += make.scm optiondb.scm compile.scm debian +EXTRA_DIST += $(sources) compile.sh compile.scm x11-screen.pkg +EXTRA_DIST += x11-screen-test.scm x11-screen-check.sh +EXTRA_DIST += make.scm optiondb.scm debian install-data-hook: ( echo '(add-plugin "x11-screen" "@MIT_SCHEME_PROJECT@"'; \ diff --git a/src/x11/Makefile.am b/src/x11/Makefile.am index 631754627..7464a1f43 100644 --- a/src/x11/Makefile.am +++ b/src/x11/Makefile.am @@ -6,22 +6,22 @@ ## 2015, 2016, 2017, 2018, 2019 Massachusetts Institute of ## Technology ## -## This file is part of an x11 plugin for MIT/GNU Scheme. +## This file is part of MIT/GNU Scheme. ## -## This plugin 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 2 of the License, -## or (at your option) any later version. +## MIT/GNU Scheme 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 2 of the License, or (at +## your option) any later version. ## -## This plugin is distributed in the hope that it will be useful, but +## MIT/GNU Scheme 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 plugin; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA -## 02110-1301, USA. +## along with MIT/GNU Scheme; if not, write to the Free Software +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, +## USA. ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = autogen.sh @@ -44,23 +44,26 @@ scmlib_sub_DATA = $(sources) $(binaries) scmlib_sub_DATA += make.scm x11.pkg @MIT_SCHEME_PKD@ #scminfo_DATA = x11.info -#AM_MAKEINFOHTMLFLAGS = --no-split +#info_TEXINFOS = x11.texi +#AM_MAKEINFOHTMLFLAGS = --no-split --css-ref=style.css +#AM_UPDATE_INFO_DIR = no AM_CPPFLAGS = -I@MIT_SCHEME_INCLUDEDIR@ AM_CFLAGS = @MIT_CFLAGS@ x11_shim_la_LIBADD = @MIT_LIBS@ -c_sources = x11base.c x11color.c x11graph.c x11term.c x11-shim.h x11.h -x11_shim_la_SOURCES = $(c_sources) x11-shim.c x11_shim_la_LDFLAGS = -module -avoid-version -shared +x11_shim_la_SOURCES = x11base.c x11color.c x11graph.c x11term.c x11-shim.h x11.h +nodist_x11_shim_la_SOURCES = x11-shim.c -noinst_PROGRAMS = x11-const -x11_const_SOURCES = x11-const.c x11-shim.h x11.h +noinst_PROGRAMS = x11-const$(EXEEXT) +x11_const_SOURCES = x11-shim.h x11.h +nodist_x11_const_SOURCES = x11-const.c x11-shim.c: stamp-shim x11-const.c: stamp-shim x11-types.bin: stamp-shim -stamp-shim: $(c_sources) $(cdecls) +stamp-shim: x11-shim.h x11.h $(cdecls) echo '(generate-shim "x11" "#include \"x11-shim.h\"")' \ | $(MIT_SCHEME_EXE) --batch-mode echo "done" > $@ @@ -76,7 +79,7 @@ stamp-scheme: stamp-shim $(sources) x11-const.bin x11.pkg MIT_SCHEME_EXE=$(MIT_SCHEME_EXE) ./compile.sh echo "done" > $@ -MOSTLYCLEANFILES = $(scmlib_LTLIBRARIES) x11-const +MOSTLYCLEANFILES = $(scmlib_LTLIBRARIES) x11-const$(EXEEXT) mostlyclean-local: -rm -rf .libs @@ -89,13 +92,11 @@ CLEANFILES += @MIT_SCHEME_CLEAN@ TESTS = x11-check.sh tags: tags-am - ./tags-fix.sh x11 - -ETAGS_ARGS = $(sources) $(c_sources) -r '/^([^iI].*/' $(cdecls) -TAGS_DEPENDENCIES = $(sources) $(c_sources) $(cdecls) + $(ETAGS) -a $(sources) -r '/^([^iI].*/' $(cdecls) + ./tags-fix.sh EXTRA_DIST += $(sources) $(cdecls) compile.sh compile.scm x11.pkg -EXTRA_DIST += x11-check.sh x11-test.scm +EXTRA_DIST += x11-test.scm x11-check.sh EXTRA_DIST += make.scm optiondb.scm tags-fix.sh debian install-data-hook: diff --git a/src/x11/tags-fix.sh b/src/x11/tags-fix.sh index a22e6bab5..c100cbd4b 100755 --- a/src/x11/tags-fix.sh +++ b/src/x11/tags-fix.sh @@ -1,42 +1,91 @@ #!/bin/sh # -*-Scheme-*- # -# Chop the generated $1-shim.c and $1-const.c files out of TAGS. +# Changes to TAGS: +# + Punt any generated *-shim.c and *-const.c files. +# + Re-order the files: .scm first, .[hc] next, whatnot, and .cdecls last. +# Someday: +# + Index the .cdecls? set -e : ${MIT_SCHEME_EXE=mit-scheme} ${MIT_SCHEME_EXE} --batch-mode -- ${1+"$@"} <<\EOF -(let ((name (car (command-line-arguments)))) - (let ((shim.c-prefix (string-append name "-shim.c,")) - (const.c-prefix (string-append name "-const.c,"))) - - (define (rewriter in out) - (let loop ((skipping? #f)) - (let ((line (read-line in))) - (cond ((eof-object? line) - unspecific) - ((string=? line "\f") - (let ((next (read-line in))) - (cond ((eof-object? next) (error "Bogus TAGS format:" next)) - ((or (string-prefix? shim.c-prefix next) - (string-prefix? const.c-prefix next)) - (loop #t)) - (else - (write-string line out) - (newline out) - (write-string next out) - (newline out) - (loop #f))))) - (skipping? - (loop skipping?)) - (else - (write-string line out) - (newline out) - (loop skipping?)))))) - - (parameterize ((param:suppress-loading-message? #t)) - (load-option 'FFI)) - ((access rewrite-file (->environment '(ffi build))) - (merge-pathnames "TAGS") - rewriter))) +(let () + + (define-integrable (make-section filename bytecount lines) + (cons (cons filename bytecount) lines)) + (define-integrable section.filename caar) + (define-integrable section.bytecount cdar) + (define-integrable section.lines cdr) + + (define headline-pattern + (compile-regsexp '(seq (line-start) + (group filename (+ (char-not-in #\,))) + #\, + (group bytecount (+ (char-in numeric))) + (line-end)))) + + (define (write-section section out) + (write-string "\f\n" out) + (write-string (string (section.filename section) + #\, (section.bytecount section) + "\n") + out) + (for-each (lambda (line) (write-string line out) (newline out)) + (section.lines section))) + + (define (write-sections sections out) + (for-each (lambda (section) (write-section section out)) + (sort sections + (lambda (a b) + (stringenvironment '(ffi build))) + (merge-pathnames "TAGS") + rewriter))) EOF -- 2.25.1