plugin Makefile.ams: remove generated -shim.c and -const.c from TAGS
authorMatt Birkholz <matt@birchwood-abbey.net>
Sun, 10 Apr 2016 19:34:07 +0000 (12:34 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Sun, 10 Apr 2016 19:34:07 +0000 (12:34 -0700)
src/blowfish/Makefile.am
src/blowfish/tags-fix.sh [new file with mode: 0755]
src/gdbm/Makefile.am
src/gdbm/tags-fix.sh [new file with mode: 0755]
src/mcrypt/Makefile.am
src/mcrypt/tags-fix.sh [new file with mode: 0755]
src/md5/Makefile.am
src/md5/tags-fix.sh [new file with mode: 0755]
src/mhash/Makefile.am
src/mhash/tags-fix.sh [new file with mode: 0755]

index 9606bffe9ea8f6b99b46f536a7bc88b723fa5066..0fa9c837fa2fe059afb37b8471433257cd42da2a 100644 (file)
@@ -85,11 +85,13 @@ CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd
 TESTS = blowfish-check.sh
 CLEANFILES += test
 
+tags: tags-am
+       ./tags-fix.sh
+
 all_sources = $(sources)
-all_sources += blowfish.pkg blowfish-check.scm
-all_sources += blowfish-adapter.c blowfish-shim.h
-ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls)
-TAGS_DEPENDENCIES = $(all_sources) $(cdecls)
+all_sources += blowfish-check.scm blowfish-adapter.c blowfish-shim.h
+ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) blowfish.pkg
+TAGS_DEPENDENCIES = $(all_sources) $(cdecls) blowfish.pkg
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/blowfish/tags-fix.sh b/src/blowfish/tags-fix.sh
new file mode 100755 (executable)
index 0000000..441c87f
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated -shim.c and -const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode <<\EOF
+(let ((name "blowfish"))
+  (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)))
+         #;(if (eof-object? line)
+             (begin (write-string ": <eof>") (newline))
+             (if (string=? line "\f")
+                 (begin (write-string ": <formfeed>") (newline))
+                 (begin (write-string ": ") (write-string line) (newline))))
+         (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 345cd4b42c1c5bde1e8722bed0e5d8866f91b549..f8916e01a5633fb4c9e635561ad16ad6b4d618bc 100644 (file)
@@ -85,11 +85,13 @@ CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd
 TESTS = gdbm-check.sh
 CLEANFILES += gdbm-check.db
 
+tags: tags-am
+       ./tags-fix.sh
+
 all_sources = $(sources)
-all_sources += gdbm.pkg gdbm-check.scm
-all_sources += gdbm-adapter.c gdbm-shim.h
-ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls)
-TAGS_DEPENDENCIES = $(all_sources) $(cdecls)
+all_sources += gdbm-check.scm gdbm-adapter.c gdbm-shim.h
+ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) gdbm.pkg
+TAGS_DEPENDENCIES = $(all_sources) $(cdecls) gdbm.pkg
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/gdbm/tags-fix.sh b/src/gdbm/tags-fix.sh
new file mode 100755 (executable)
index 0000000..441c87f
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated -shim.c and -const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode <<\EOF
+(let ((name "blowfish"))
+  (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)))
+         #;(if (eof-object? line)
+             (begin (write-string ": <eof>") (newline))
+             (if (string=? line "\f")
+                 (begin (write-string ": <formfeed>") (newline))
+                 (begin (write-string ": ") (write-string line) (newline))))
+         (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 0afa4752306653e4bcd7278cf5b9f0b84079ddb7..c3675d44922e9762b149f108f823a9a745ab97b7 100644 (file)
@@ -85,11 +85,13 @@ CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd
 TESTS = mcrypt-check.sh
 CLEANFILES += encrypted decrypted
 
+tags: tags-am
+       ./tags-fix.sh
+
 all_sources = $(sources)
-all_sources += mcrypt.pkg mcrypt-check.scm
-all_sources += mcrypt-adapter.c mcrypt-shim.h
-ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls)
-TAGS_DEPENDENCIES = $(all_sources) $(cdecls)
+all_sources += mcrypt-check.scm mcrypt-adapter.c mcrypt-shim.h
+ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) mcrypt.pkg
+TAGS_DEPENDENCIES = $(all_sources) $(cdecls) mcrypt.pkg
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/mcrypt/tags-fix.sh b/src/mcrypt/tags-fix.sh
new file mode 100755 (executable)
index 0000000..441c87f
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated -shim.c and -const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode <<\EOF
+(let ((name "blowfish"))
+  (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)))
+         #;(if (eof-object? line)
+             (begin (write-string ": <eof>") (newline))
+             (if (string=? line "\f")
+                 (begin (write-string ": <formfeed>") (newline))
+                 (begin (write-string ": ") (write-string line) (newline))))
+         (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 6b71c5e57ed26aa63dff1ac1ef39c6b9369d33e6..5062864608195f040e73e0e6f5d1641907d01874 100644 (file)
@@ -85,11 +85,13 @@ CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd
 TESTS = md5-check.sh
 CLEANFILES += sample
 
+tags: tags-am
+       ./tags-fix.sh
+
 all_sources = $(sources)
-all_sources += md5.pkg md5-check.scm
-all_sources += md5-adapter.c md5-shim.h
-ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls)
-TAGS_DEPENDENCIES = $(all_sources) $(cdecls)
+all_sources += md5-check.scm md5-adapter.c md5-shim.h
+ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) md5.pkg
+TAGS_DEPENDENCIES = $(all_sources) $(cdecls) md5.pkg
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/md5/tags-fix.sh b/src/md5/tags-fix.sh
new file mode 100755 (executable)
index 0000000..441c87f
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated -shim.c and -const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode <<\EOF
+(let ((name "blowfish"))
+  (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)))
+         #;(if (eof-object? line)
+             (begin (write-string ": <eof>") (newline))
+             (if (string=? line "\f")
+                 (begin (write-string ": <formfeed>") (newline))
+                 (begin (write-string ": ") (write-string line) (newline))))
+         (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 56eb4db8115e4407f9aec3096a20ea7c3f24fa8c..2d436639fd88d45e7b0fc0a2797cab7ceddee8db 100644 (file)
@@ -85,11 +85,13 @@ CLEANFILES += *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd
 TESTS = mhash-check.sh
 CLEANFILES += sample
 
+tags: tags-am
+       ./tags-fix.sh
+
 all_sources = $(sources)
-all_sources += mhash.pkg mhash-check.scm
-all_sources += mhash-adapter.c mhash-shim.h
-ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls)
-TAGS_DEPENDENCIES = $(all_sources) $(cdecls)
+all_sources += mhash-check.scm mhash-adapter.c mhash-shim.h
+ETAGS_ARGS = $(all_sources) -r '/^([^iI].*/' $(cdecls) mhash.pkg
+TAGS_DEPENDENCIES = $(all_sources) $(cdecls) mhash.pkg
 
 install-data-hook:
        echo '(update-optiondb "$(DESTDIR)$(scmlibdir)/")' \
diff --git a/src/mhash/tags-fix.sh b/src/mhash/tags-fix.sh
new file mode 100755 (executable)
index 0000000..441c87f
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/sh
+# -*-Scheme-*-
+#
+# Chop the generated -shim.c and -const.c files out of TAGS.
+
+set -e
+: ${MIT_SCHEME_EXE=mit-scheme}
+${MIT_SCHEME_EXE} --batch-mode <<\EOF
+(let ((name "blowfish"))
+  (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)))
+         #;(if (eof-object? line)
+             (begin (write-string ": <eof>") (newline))
+             (if (string=? line "\f")
+                 (begin (write-string ": <formfeed>") (newline))
+                 (begin (write-string ": ") (write-string line) (newline))))
+         (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