gtk Makefile.ams (dist, tags): Implement dist. Fix TAGS.
authorMatt Birkholz <puck@birchwood-abbey.net>
Fri, 29 Apr 2016 21:49:29 +0000 (14:49 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Fri, 29 Apr 2016 21:49:29 +0000 (14:49 -0700)
Add missing files to EXTRA_DIST.  Use new ./tags-fix.sh Scheme scripts
to remove generated shim code from TAGS.

src/cairo/Makefile.am
src/cairo/tags-fix.sh [new file with mode: 0755]
src/gl/Makefile.am
src/gl/tags-fix.sh [new file with mode: 0755]
src/glib/Makefile.am
src/glib/tags-fix.sh [new file with mode: 0755]
src/gtk/Makefile.am
src/gtk/tags-fix.sh [new file with mode: 0755]
src/pango/Makefile.am
src/pango/tags-fix.sh [new file with mode: 0755]
src/planetarium/Makefile.am

index 0c8282097648864636d71ddf609bbfba1c8798f2..de8650ce8e7c8d4f34fa30eaa1d9dd2ef3cf92e3 100644 (file)
@@ -29,9 +29,13 @@ scmlib_cairodir = $(scmlibdir)/cairo
 
 scmlib_LTLIBRARIES = cairo-shim.la
 scmlib_DATA = cairo-types.bin cairo-const.bin
-scmlib_cairo_DATA = cairo.scm cairo.bin cairo.bci cairo.com
-scmlib_cairo_DATA += cairo-graphics.scm cairo-graphics.bin
-scmlib_cairo_DATA += cairo-graphics.bci cairo-graphics.com
+
+sources = cairo.scm cairo-graphics.scm
+cdecls = cairo.cdecl
+
+scmlib_cairo_DATA = $(sources)
+scmlib_cairo_DATA += cairo.bin cairo.bci cairo.com
+scmlib_cairo_DATA += cairo-graphics.bin cairo-graphics.bci cairo-graphics.com
 scmlib_cairo_DATA += make.scm cairo-@MIT_SCHEME_OS_SUFFIX@.pkd
 
 info_TEXINFOS = mit-scheme-cairo.texi
@@ -55,7 +59,7 @@ cairo_const_SOURCES = cairo-const.c
 cairo-shim.c: stamp-shim
 cairo-const.c: stamp-shim
 cairo-types.bin: stamp-shim
-stamp-shim: cairo.cdecl
+stamp-shim: $(cdecls)
        touch stamp-shim
        echo '(generate-shim "cairo" "#include <pango/pangocairo.h>")' \
        | $(MIT_SCHEME_EXE) --batch-mode \
@@ -74,7 +78,7 @@ cairo-graphics.bin: stamp-scheme
 cairo-graphics.bci: stamp-scheme
 cairo-graphics.com: stamp-scheme
 cairo-@MIT_SCHEME_OS_SUFFIX@.pkd: stamp-scheme
-stamp-scheme: stamp-shim cairo-graphics.scm cairo.scm
+stamp-scheme: stamp-shim $(sources) cairo.pkg
        touch stamp-scheme
        ./compile.sh || rm stamp-scheme
 
@@ -86,8 +90,15 @@ TESTS = cairo-check.sh
 check-local:
        ./check-doc.sh
 
-ETAGS_ARGS = cairo.scm cairo-graphics.scm -r '/^([^iI].*/' cairo.cdecl
-TAGS_DEPENDENCIES = cairo.scm cairo-graphics.scm cairo.cdecl
+tags: tags-am
+       ./tags-fix.sh cairo
+
+ETAGS_ARGS = $(sources) -r '/^([^iI].*/' $(cdecls)
+TAGS_DEPENDENCIES = $(sources) $(cdecls)
+
+EXTRA_DIST += $(sources) $(cdecls) cairo.pkg
+EXTRA_DIST += compile.sh cairo-check.sh
+EXTRA_DIST += make.scm optiondb.scm check-doc.sh tags-fix.sh
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/cairo/tags-fix.sh b/src/cairo/tags-fix.sh
new file mode 100755 (executable)
index 0000000..c2823ad
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated $1-shim.c and $1-const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode -- "${@}" <<\EOF
+(let ((name (car (command-line))))
+  (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)))
+EOF
index f58449c8dd76e9801f8ad8383506b4c2e5288d60..30f468529f52e486a77dd6cb47a4b9df87d56c0d 100644 (file)
@@ -30,10 +30,13 @@ scmlib_gldir = $(scmlibdir)/gl
 scmlib_LTLIBRARIES = gl-shim.la
 scmlib_DATA = gl-types.bin gl-const.bin
 
-scmlib_gl_DATA = gl.scm gl.bin gl.bci gl.com
-scmlib_gl_DATA += gl-glx.scm gl-glx.bin gl-glx.bci gl-glx.com
-scmlib_gl_DATA += gl-glxgears.scm gl-glxgears.bin
-scmlib_gl_DATA += gl-glxgears.bci gl-glxgears.com
+sources = gl.scm gl-glx.scm gl-glxgears.scm
+cdecls = gl.cdecl
+
+scmlib_gl_DATA = $(sources)
+scmlib_gl_DATA += gl.bin gl.bci gl.com
+scmlib_gl_DATA += gl-glx.bin gl-glx.bci gl-glx.com
+scmlib_gl_DATA += gl-glxgears.bin gl-glxgears.bci gl-glxgears.com
 scmlib_gl_DATA += make.scm gl-@MIT_SCHEME_OS_SUFFIX@.pkd
 
 #info_TEXINFOS = mit-scheme-gl.texi
@@ -58,7 +61,7 @@ gl_const_SOURCES = gl-const.c gl-shim.h
 gl-shim.c: stamp-shim
 gl-const.c: stamp-shim
 gl-types.bin: stamp-shim
-stamp-shim: gl.cdecl gl-shim.h
+stamp-shim: gl-shim.h $(cdecls)
        touch stamp-shim
        echo '(generate-shim "gl" "#include \"gl-shim.h\"")' \
        | $(MIT_SCHEME_EXE) --batch-mode \
@@ -74,7 +77,7 @@ gl.bin: stamp-scheme
 gl.bci: stamp-scheme
 gl.com: stamp-scheme
 gl-@MIT_SCHEME_OS_SUFFIX@.pkd: stamp-scheme
-stamp-scheme: stamp-shim gl.scm
+stamp-scheme: stamp-shim $(sources) gl.pkg
        touch stamp-scheme
        ./compile.sh || rm stamp-scheme
 
@@ -83,11 +86,16 @@ CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd
 
 TESTS = gl-check.sh
 
-ETAGS_FILES = gl-glxgears.scm
-ETAGS_FILES += gl-adapter.c gl-shim.h gl.scm gl-glx.scm
-ETAGS_CDECLS = gl.cdecl
-ETAGS_ARGS = $(ETAGS_FILES) -r '/^([^iI].*/' $(ETAGS_CDECLS)
-TAGS_DEPENDENCIES = $(ETAGS_FILES) $(ETAGS_CDECLS)
+tags: tags-am
+       ./tags-fix.sh gl
+
+all_sources = $(sources) gl-adapter.c
+ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls)
+TAGS_DEPENDENCIES = $(all_sources) $(cdecls)
+
+EXTRA_DIST += $(all_sources) $(cdecls) gl.pkg
+EXTRA_DIST += compile.sh gl-check.sh gl-tests.scm
+EXTRA_DIST += make.scm optiondb.scm tags-fix.sh
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/gl/tags-fix.sh b/src/gl/tags-fix.sh
new file mode 100755 (executable)
index 0000000..c2823ad
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated $1-shim.c and $1-const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode -- "${@}" <<\EOF
+(let ((name (car (command-line))))
+  (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)))
+EOF
index 5076095921bfeb27e55df3f1f3f0fea897c7c9fe..f0e4ca3a41f706b741b9becdcdf15734a9a97e7f 100644 (file)
@@ -30,11 +30,15 @@ scmlib_glibdir = $(scmlibdir)/glib
 scmlib_LTLIBRARIES = glib-shim.la
 scmlib_DATA = glib-types.bin glib-const.bin
 
-scmlib_glib_DATA = gio.scm gio.bin gio.bci gio.com
-scmlib_glib_DATA += glib-main.scm glib-main.bin glib-main.bci glib-main.com
-scmlib_glib_DATA += glib-thread.scm glib-thread.bin glib-thread.bci glib-thread.com
-scmlib_glib_DATA += glib.scm glib.bin glib.bci glib.com
-scmlib_glib_DATA += gobject.scm gobject.bin gobject.bci gobject.com
+sources = glib.scm gobject.scm gio.scm glib-main.scm glib-thread.scm
+cdecls = glib.cdecl Includes/*.cdecl Includes/*/*.cdecl
+
+scmlib_glib_DATA = $(sources)
+scmlib_glib_DATA += glib.bin glib.bci glib.com
+scmlib_glib_DATA += gobject.bin gobject.bci gobject.com
+scmlib_glib_DATA += gio.bin gio.bci gio.com
+scmlib_glib_DATA += glib-main.bin glib-main.bci glib-main.com
+scmlib_glib_DATA += glib-thread.bin glib-thread.bci glib-thread.com
 scmlib_glib_DATA += make.scm glib-@MIT_SCHEME_OS_SUFFIX@.pkd
 
 info_TEXINFOS = mit-scheme-glib.texi
@@ -59,7 +63,7 @@ glib_const_SOURCES = glib-const.c glib-shim.h
 glib-shim.c: stamp-shim
 glib-const.c: stamp-shim
 glib-types.bin: stamp-shim
-stamp-shim: glib.cdecl glib-shim.h Includes/*.cdecl Includes/*/*.cdecl
+stamp-shim: glib-shim.h $(cdecls)
        touch stamp-shim
        echo '(generate-shim "glib" "#include \"glib-shim.h\"")' \
        | $(MIT_SCHEME_EXE) --batch-mode \
@@ -71,6 +75,12 @@ glib-const.bin: glib-const.scm
 glib-const.scm: glib-const
        ./glib-const
 
+glib.bin: stamp-scheme
+glib.bci: stamp-scheme
+glib.com: stamp-scheme
+gobject.bin: stamp-scheme
+gobject.bci: stamp-scheme
+gobject.com: stamp-scheme
 gio.bin: stamp-scheme
 gio.bci: stamp-scheme
 gio.com: stamp-scheme
@@ -80,14 +90,8 @@ glib-main.com: stamp-scheme
 glib-thread.bin: stamp-scheme
 glib-thread.bci: stamp-scheme
 glib-thread.com: stamp-scheme
-glib.bin: stamp-scheme
-glib.bci: stamp-scheme
-glib.com: stamp-scheme
-gobject.bin: stamp-scheme
-gobject.bci: stamp-scheme
-gobject.com: stamp-scheme
 glib-@MIT_SCHEME_OS_SUFFIX@.pkd: stamp-scheme
-stamp-scheme: stamp-shim gio.scm glib-main.scm glib-thread.scm glib.scm
+stamp-scheme: stamp-shim $(sources) glib.pkg
        touch stamp-scheme
        ./compile.sh || rm stamp-scheme
 
@@ -100,12 +104,16 @@ CLEANFILES += test-copy-1.txt
 check-local:
        ./check-doc.sh
 
-ETAGS_FILES = glibio.c
-ETAGS_FILES += glib.scm gobject.scm glib-main.scm glib-thread.scm
-ETAGS_FILES += gio.scm glib-tests.scm
-ETAGS_CDECLS = glib.cdecl Includes/*.cdecl Includes/*/*.cdecl
-ETAGS_ARGS = $(ETAGS_FILES) -r '/^([^iI].*/' $(ETAGS_CDECLS)
-TAGS_DEPENDENCIES = $(ETAGS_FILES) $(ETAGS_CDECLS)
+tags: tags-am
+       ./tags-fix.sh glib
+
+all_sources = $(sources) glibio.c
+ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls)
+TAGS_DEPENDENCIES = $(all_sources) $(cdecls)
+
+EXTRA_DIST += $(all_sources) $(cdecls) glib.pkg
+EXTRA_DIST += compile.sh glib-tests.scm glib-check-copy.sh glib-check-list.sh
+EXTRA_DIST += make.scm optiondb.scm check-doc.sh tags-fix.sh
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/glib/tags-fix.sh b/src/glib/tags-fix.sh
new file mode 100755 (executable)
index 0000000..c2823ad
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated $1-shim.c and $1-const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode -- "${@}" <<\EOF
+(let ((name (car (command-line))))
+  (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)))
+EOF
index 225cb7d7e6c008aab89f29b116681adcb46b95e0..5429a6642463f64e4874b3813217d7d884c6eea4 100644 (file)
@@ -28,23 +28,27 @@ scmlibdir = $(libdir)/mit-scheme-@MIT_SCHEME_ARCH@
 scmlib_gtkdir = $(scmlibdir)/gtk
 
 scmlib_LTLIBRARIES = gtk-shim.la
-scmlib_DATA = gtk-types.bin gtk-const.bin
-
-scmlib_gtk_DATA = conses.png
-scmlib_gtk_DATA += gtk-widget.scm gtk-widget.bin gtk-widget.bci gtk-widget.com
-scmlib_gtk_DATA += scm-widget.scm scm-widget.bin scm-widget.bci scm-widget.com
-scmlib_gtk_DATA += fix-layout.scm fix-layout.bin fix-layout.bci fix-layout.com
-scmlib_gtk_DATA += keys.scm keys.bin keys.bci keys.com
-scmlib_gtk_DATA += main.scm main.bin main.bci main.com
-scmlib_gtk_DATA += gtk-ev.scm gtk-ev.bin gtk-ev.bci gtk-ev.com
-scmlib_gtk_DATA += gtk-graphics.scm gtk-graphics.bin
-scmlib_gtk_DATA += gtk-graphics.bci gtk-graphics.com
-scmlib_gtk_DATA += fix-demo.scm fix-demo.bin fix-demo.bci fix-demo.com
-scmlib_gtk_DATA += swat.scm swat.bin swat.bci swat.com
-scmlib_gtk_DATA += swat-pole-zero.scm swat-pole-zero.bin
-scmlib_gtk_DATA += swat-pole-zero.bci swat-pole-zero.com
-scmlib_gtk_DATA += gdk.scm gdk.bin gdk.bci gdk.com
-scmlib_gtk_DATA += gtk.scm gtk.bin gtk.bci gtk.com
+scmlib_DATA = gtk-types.bin gtk-const.bin conses.png 
+
+sources = gtk.scm gdk.scm gtk-widget.scm
+sources += scm-widget.scm fix-layout.scm keys.scm main.scm
+sources += gtk-ev.scm gtk-graphics.scm fix-demo.scm swat.scm
+sources += swat-pole-zero.scm
+cdecls = gtk.cdecl Includes/*.cdecl
+
+scmlib_gtk_DATA = $(sources)
+scmlib_gtk_DATA += gtk.bin gtk.bci gtk.com
+scmlib_gtk_DATA += gdk.bin gdk.bci gdk.com
+scmlib_gtk_DATA += gtk-widget.bin gtk-widget.bci gtk-widget.com
+scmlib_gtk_DATA += scm-widget.bin scm-widget.bci scm-widget.com
+scmlib_gtk_DATA += fix-layout.bin fix-layout.bci fix-layout.com
+scmlib_gtk_DATA += keys.bin keys.bci keys.com
+scmlib_gtk_DATA += main.bin main.bci main.com
+scmlib_gtk_DATA += gtk-ev.bin gtk-ev.bci gtk-ev.com
+scmlib_gtk_DATA += gtk-graphics.bin gtk-graphics.bci gtk-graphics.com
+scmlib_gtk_DATA += fix-demo.bin fix-demo.bci fix-demo.com
+scmlib_gtk_DATA += swat.bin swat.bci swat.com
+scmlib_gtk_DATA += swat-pole-zero.bin swat-pole-zero.bci swat-pole-zero.com
 scmlib_gtk_DATA += make.scm gtk-@MIT_SCHEME_OS_SUFFIX@.pkd
 
 info_TEXINFOS = mit-scheme-gtk.texi
@@ -60,7 +64,11 @@ AM_CPPFLAGS = -I$(scmlibdir)
 AM_CFLAGS = `pkg-config --cflags gtk+-3.0`
 LIBS = `pkg-config --libs gtk+-3.0 gthread-2.0`
 
-gtk_shim_la_LIBADD = gtkpanedview.lo gtkscrolledview.lo scmwidget.lo gtkio.lo
+gtk_shim_la_LIBADD = gtkio.lo scmwidget.lo gtkpanedview.lo gtkscrolledview.lo
+c_sources = gtk-shim.h gtkio.c
+c_sources += scmwidget.c scmwidget.h
+c_sources += gtkpanedview.c gtkpanedview.h
+c_sources += gtkscrolledview.c gtkscrolledview.h
 gtk_shim_la_LDFLAGS = -module -avoid-version -shared
 
 noinst_PROGRAMS = gtk-const
@@ -69,26 +77,24 @@ gtk_const_SOURCES = gtk-const.c gtk-shim.h
 gtk-shim.c: stamp-shim
 gtk-const.c: stamp-shim
 gtk-types.bin: stamp-shim
-stamp-shim: gtk.cdecl gtk-shim.h Includes/*.cdecl
+stamp-shim: $(c_sources) $(cdecls)
        touch stamp-shim
        echo '(generate-shim "gtk" "#include \"gtk-shim.h\"")' \
        | $(MIT_SCHEME_EXE) --batch-mode \
        || rm stamp-shim
 
-gtk-shim.o: gtk-shim.c gtk-shim.h
-
-gtkpanedview.o: gtkpanedview.c gtkpanedview.h
-
-gtkscrolledview.o: gtkscrolledview.c gtkscrolledview.h
-
-scmwidget.o: scmwidget.c scmwidget.h
-
 gtk-const.bin: gtk-const.scm
        echo '(sf "gtk-const")' | $(MIT_SCHEME_EXE) --batch-mode
 
 gtk-const.scm: gtk-const
        ./gtk-const
 
+gtk.bin: stamp-scheme
+gtk.bci: stamp-scheme
+gtk.com: stamp-scheme
+gdk.bin: stamp-scheme
+gdk.bci: stamp-scheme
+gdk.com: stamp-scheme
 gtk-widget.bin: stamp-scheme
 gtk-widget.bci: stamp-scheme
 gtk-widget.com: stamp-scheme
@@ -119,16 +125,8 @@ swat.com: stamp-scheme
 swat-pole-zero.bin: stamp-scheme
 swat-pole-zero.bci: stamp-scheme
 swat-pole-zero.com: stamp-scheme
-gdk.bin: stamp-scheme
-gdk.bci: stamp-scheme
-gdk.com: stamp-scheme
-gtk.bin: stamp-scheme
-gtk.bci: stamp-scheme
-gtk.com: stamp-scheme
 gtk-@MIT_SCHEME_OS_SUFFIX@.pkd: stamp-scheme
-stamp-scheme: stamp-shim gtk-widget.scm scm-widget.scm fix-layout.scm \
-             keys.scm main.scm gtk-ev.scm gtk-graphics.scm fix-demo.scm \
-             swat.scm swat-pole-zero.scm gdk.scm gtk.scm
+stamp-scheme: stamp-shim $(sources) gtk.pkg
        touch stamp-scheme
        ./compile.sh || rm stamp-scheme
 
@@ -140,13 +138,21 @@ TESTS = gtk-check.sh
 check-local:
        ./check-doc.sh
 
-ETAGS_FILES = gtk-widget.scm scm-widget.scm fix-layout.scm
-ETAGS_FILES += keys.scm main.scm gtk-ev.scm gtk-graphics.scm
-ETAGS_FILES += fix-demo.scm swat.scm swat-pole-zero.scm
-ETAGS_FILES += gdk.scm gtk.scm
-ETAGS_CDECLS = gtk.cdecl Includes/*.cdecl
-ETAGS_ARGS = $(ETAGS_FILES) -r '/^([^iI].*/' $(ETAGS_CDECLS)
-TAGS_DEPENDENCIES = $(ETAGS_FILES) $(ETAGS_CDECLS)
+tags: tags-am
+       ./tags-fix.sh gtk
+
+all_sources = $(source) $(c_sources)
+ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls)
+TAGS_DEPENDENCIES = $(all_sources) $(cdecls)
+
+EXTRA_DIST += $(all_sources) $(cdecls) gtk.pkg
+EXTRA_DIST += compile.sh gtk-check.sh gtk-tests.scm
+EXTRA_DIST += make.scm optiondb.scm check-doc.sh tags-fix.sh
+EXTRA_DIST += gtkpanedview-3.10.8.c gtkscrolledview-3.10.8.c
+EXTRA_DIST += gtkpanedview-3.14.13.c gtkscrolledview-3.14.13.c
+EXTRA_DIST += gtkpanedview-3.16.7.c gtkscrolledview-3.16.7.c
+EXTRA_DIST += gtkpanedview-3.6.0.c gtkscrolledview-3.6.0.c
+EXTRA_DIST += conses.png hello.scm test-gport-performance.scm
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/gtk/tags-fix.sh b/src/gtk/tags-fix.sh
new file mode 100755 (executable)
index 0000000..c2823ad
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated $1-shim.c and $1-const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode -- "${@}" <<\EOF
+(let ((name (car (command-line))))
+  (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)))
+EOF
index 5feea1942656c135a7e4cfc5f7d56cc14d1a6810..9a2116e9415f56ecd800ab4539289bff3bbda155 100644 (file)
@@ -29,9 +29,13 @@ scmlib_pangodir = $(scmlibdir)/pango
 
 scmlib_LTLIBRARIES = pango-shim.la
 scmlib_DATA = pango-types.bin pango-const.bin
-scmlib_pango_DATA = make.scm
-scmlib_pango_DATA += pango.scm pango.bin pango.bci pango.com
-scmlib_pango_DATA += pango-@MIT_SCHEME_OS_SUFFIX@.pkd
+
+sources = pango.scm
+cdecls = pango.cdecl Includes/*.cdecl
+
+scmlib_pango_DATA = $(sources)
+scmlib_pango_DATA += pango.bin pango.bci pango.com
+scmlib_pango_DATA += make.scm pango-@MIT_SCHEME_OS_SUFFIX@.pkd
 
 info_TEXINFOS = mit-scheme-pango.texi
 AM_MAKEINFOHTMLFLAGS = --no-split
@@ -54,7 +58,7 @@ pango_const_SOURCES = pango-const.c
 pango-shim.c: stamp-shim
 pango-const.c: stamp-shim
 pango-types.bin: stamp-shim
-stamp-shim: pango.cdecl Includes/*.cdecl
+stamp-shim: $(cdecls)
        touch stamp-shim
        echo '(generate-shim "pango" "#include <pango/pango.h>")' \
        | $(MIT_SCHEME_EXE) --batch-mode \
@@ -70,7 +74,7 @@ pango.bin: stamp-scheme
 pango.bci: stamp-scheme
 pango.com: stamp-scheme
 pango-@MIT_SCHEME_OS_SUFFIX@.pkd: stamp-scheme
-stamp-scheme: stamp-shim pango.scm
+stamp-scheme: stamp-shim $(sources) pango.pkg
        touch stamp-scheme
        ./compile.sh || rm stamp-scheme
 
@@ -82,8 +86,15 @@ TESTS = pango-check.sh
 check-local:
        ./check-doc.sh
 
-ETAGS_ARGS = pango.scm -r '/^([^iI].*/' pango.cdecl Includes/*.cdecl
-TAGS_DEPENDENCIES = pango.scm pango.cdecl Includes/*.cdecl
+tags: tags-am
+       ./tags-fix.sh pango
+
+ETAGS_ARGS = $(sources) -r '/^([^iI].*/' $(cdecls)
+TAGS_DEPENDENCIES = $(sources) $(cdecls)
+
+EXTRA_DIST += $(sources) $(cdecls) pango.pkg
+EXTRA_DIST += compile.sh pango-check.sh
+EXTRA_DIST += make.scm optiondb.scm check-doc.sh tags-fix.sh
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/pango/tags-fix.sh b/src/pango/tags-fix.sh
new file mode 100755 (executable)
index 0000000..c2823ad
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated $1-shim.c and $1-const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode -- "${@}" <<\EOF
+(let ((name (car (command-line))))
+  (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)))
+EOF
index 080f382c1baf647d282c79250e169ac29962732b..3d838b88a94cfaba059bcbfc61ee6d907a522ccb 100644 (file)
@@ -1,20 +1,20 @@
 ## Process this file with automake to produce Makefile.in
 ##
-## Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
-## Matthew Birkholz
-## 
+## Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015,
+##     2016 Matthew Birkholz
+##
 ## This file is part of a planetarium for MIT/GNU Scheme.
-## 
+##
 ## This planetarium 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 planetarium 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 planetarium; if not, write to the Free Software
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
@@ -26,12 +26,12 @@ MIT_SCHEME_EXE = @MIT_SCHEME_EXE@
 scmlibdir = $(libdir)/mit-scheme-@MIT_SCHEME_ARCH@
 scmlib_planetariumdir = $(scmlibdir)/planetarium
 
-source = earth.scm geometry.scm google-earth.scm graphics.scm
-source += matrices.scm mit-cairo.scm mit-cil.scm mit-graphics.scm mit-gtk.scm
-source += mit-r3rs.scm mit-syntax.scm mit-x.scm solar.scm tellurion.scm
-source += terrain.scm time.scm
+sources = earth.scm geometry.scm google-earth.scm graphics.scm
+sources += matrices.scm mit-cairo.scm mit-cil.scm mit-graphics.scm mit-gtk.scm
+sources += mit-r3rs.scm mit-syntax.scm mit-x.scm solar.scm tellurion.scm
+sources += terrain.scm time.scm
 
-scmlib_planetarium_DATA = $(source)
+scmlib_planetarium_DATA = $(sources)
 scmlib_planetarium_DATA += earth.bin earth.bci earth.com
 scmlib_planetarium_DATA += geometry.bin geometry.bci geometry.com
 scmlib_planetarium_DATA += google-earth.bin google-earth.bci google-earth.com
@@ -48,9 +48,8 @@ scmlib_planetarium_DATA += solar.bin solar.bci solar.com
 scmlib_planetarium_DATA += tellurion.bin tellurion.bci tellurion.com
 scmlib_planetarium_DATA += terrain.bin terrain.bci terrain.com
 scmlib_planetarium_DATA += time.bin time.bci time.com
-scmlib_planetarium_DATA += make.scm mit-link.scm
-scmlib_planetarium_DATA += mit-@MIT_SCHEME_OS_SUFFIX@.pkd
-scmlib_planetarium_DATA += mit-3d-@MIT_SCHEME_OS_SUFFIX@.pkd
+scmlib_planetarium_DATA += make.scm mit-@MIT_SCHEME_OS_SUFFIX@.pkd
+scmlib_planetarium_DATA += mit-link.scm mit-3d-@MIT_SCHEME_OS_SUFFIX@.pkd
 
 info_TEXINFOS = mit-scheme-planetarium.texi
 AM_MAKEINFOHTMLFLAGS = --no-split
@@ -58,6 +57,8 @@ AM_MAKEINFOHTMLFLAGS = --no-split
 # Set these to the defaults used by Scheme.
 infodir = $(datarootdir)/info
 htmldir = $(libdir)/mit-scheme/doc
+dvidir = $(libdir)/mit-scheme/doc
+pdfdir = $(libdir)/mit-scheme/doc
 
 make.scm: mit-make.scm
        cp $< $@
@@ -112,7 +113,7 @@ time.bci: stamp-scheme
 time.com: stamp-scheme
 mit-@MIT_SCHEME_OS_SUFFIX@.pkd: stamp-scheme
 mit-3d-@MIT_SCHEME_OS_SUFFIX@.pkd: stamp-scheme
-stamp-scheme: $(source)
+stamp-scheme: $(sources) mit.pkg mit-3d.pkg
        touch stamp-scheme
        ./mit-compile.sh || rm stamp-scheme
 
@@ -122,8 +123,13 @@ CLEANFILES += make.scm
 TESTS = mit-check.sh
 CLEANFILES += sample-terrain.txt
 
-ETAGS_ARGS = $(source)
-TAGS_DEPENDENCIES = $(source)
+ETAGS_ARGS = $(sources)
+TAGS_DEPENDENCIES = $(sources)
+
+EXTRA_DIST += $(sources) mit.pkg mit-3d.pkg
+EXTRA_DIST += mit-compile.sh mit-link.scm mit-check.sh
+EXTRA_DIST += mit-make.scm mit-optiondb.scm cil-*.txt
+EXTRA_DIST += mit-snapshot.scm
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \