EXE = '$(MIT_SCHEME_EXE)' --batch-mode
CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir)
+CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-all: blowfish-shim.so
+all: blowfish-shim.so blowfish-types.bin blowfish-const.bin
echo '(load "compile")' | $(EXE)
-check: all
+check:
echo '(load "check")' | $(EXE)
-install: all
+install:
echo '(install-shim "blowfish")' | $(EXE) -- *.com *.bci *.pkd make.scm
clean:
rm -f blowfish-const.scm blowfish-const blowfish-const.c
rm -f blowfish-shim.c
rm -f blowfish-*.crf blowfish-*.fre blowfish-*.pkd
- rm -f *.o *.so *.bin *.ext *.com *.bci
- rm -f *.moc *.fni *-init.c *-init.h *-init.o
+ rm -f *.o *.so *.bin *.ext *.com *.bci *.moc *.fni
rm -f test
distclean: clean
blowfish-shim.o: blowfish-shim.c blowfish-shim.h
echo '(compile-shim)' | $(EXE) -- $(CPPFLAGS) $(CFLAGS) -c $<
-blowfish-shim.c: blowfish.cdecl blowfish-shim.h
+blowfish-shim.c blowfish-const.c blowfish-types.bin: \
+ blowfish.cdecl blowfish-shim.h
echo '(generate-shim "blowfish" "#include \"blowfish-shim.h\"")' \
| $(EXE)
+blowfish-const.bin: blowfish-const.scm
+ echo '(sf "blowfish-const")' | $(EXE)
+
+blowfish-const.scm: blowfish-const
+ ./blowfish-const
+
+blowfish-const: blowfish-const.o
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+blowfish-const.o: blowfish-const.c blowfish-shim.h
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
+
.PHONY: all check install clean distclean maintainer-clean
library-dir
(except-last-pair
(pathname-directory library-dir))))))))
-
-(define (generate-shim library #!optional prefix)
- (let ((-const (string-append library"-const"))
- (-const.c (string-append library"-const.c"))
- (-const.o (string-append library"-const.o")))
- (c-generate library prefix)
- (run-command (append CC CFLAGS (list "-c" -const.c)))
- (run-command (append CC LDFLAGS (list "-o" -const -const.o)))
- (run-command (list (->namestring
- (merge-pathnames -const (working-directory-pathname)))))
- (sf -const)))
\f
(define (parse-words string)
(burst-string string char-set:whitespace #t))
MIT_SCHEME_EXE = mit-scheme
EXE = '$(MIT_SCHEME_EXE)' --batch-mode
-all: gdbm-shim.so
+all: gdbm-shim.so gdbm-types.bin gdbm-const.bin
echo '(load "compile")' | $(EXE)
-check: all
+check:
echo '(load "check")' | $(EXE)
-install: all
+install:
echo '(install-shim "gdbm")' | $(EXE) -- *.com *.bci *.pkd make.scm
clean distclean maintainer-clean:
rm -f gdbm-const.scm gdbm-const gdbm-const.c gdbm-shim.c
rm -f gdbm-*.crf gdbm-*.fre gdbm-*.pkd
- rm -f *.o *.so *.bin *.ext *.com *.bci
- rm -f *.moc *.fni *-init.c *-init.h *-init.o
+ rm -f *.o *.so *.bin *.ext *.com *.bci *.moc *.fni
rm -f gdbm-check.db
gdbm-shim.so: gdbm-shim.o gdbm-adapter.o
gdbm-shim.o: gdbm-shim.c gdbm-shim.h
echo '(compile-shim)' | $(EXE) -- -c $<
-gdbm-shim.c: gdbm.cdecl gdbm-shim.h
+gdbm-shim.c gdbm-const.c gdbm-types.bin: gdbm.cdecl gdbm-shim.h
echo '(generate-shim "gdbm" "#include \"gdbm-shim.h\"")' | $(EXE)
+gdbm-const.bin: gdbm-const.scm
+ echo '(sf "gdbm-const")' | $(EXE)
+
+gdbm-const.scm: gdbm-const
+ ./gdbm-const
+
+gdbm-const: gdbm-const.o
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+gdbm-const.o: gdbm-const.c gdbm-shim.h
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
+
.PHONY: all check install clean distclean maintainer-clean
EXE = '$(MIT_SCHEME_EXE)' --batch-mode
CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir)
+CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-all: md5-shim.so
+all: md5-shim.so md5-types.bin md5-const.bin
echo '(load "compile")' | $(EXE)
-check: all
+check:
echo '(load "check")' | $(EXE)
-install: all
+install:
echo '(install-shim "md5")' | $(EXE) -- *.com *.bci *.pkd make.scm
clean:
rm -f md5-const.scm md5-const md5-const.c md5-shim.c
rm -f md5-*.crf md5-*.fre md5-*.pkd
- rm -f *.o *.so *.bin *.ext *.com *.bci
- rm -f *.moc *.fni *-init.c *-init.h *-init.o
+ rm -f *.o *.so *.bin *.ext *.com *.bci *.moc *.fni
rm -f sample
distclean: clean
md5-shim.o: md5-shim.c md5-shim.h
echo '(compile-shim)' | $(EXE) -- $(CPPFLAGS) $(CFLAGS) -c $<
-md5-shim.c: md5.cdecl md5-shim.h
- echo '(generate-shim "md5" "#include \"md5-shim.h\"")' \
- | $(EXE)
+md5-shim.c md5-const.c md5-types.bin: md5.cdecl md5-shim.h
+ echo '(generate-shim "md5" "#include \"md5-shim.h\"")' | $(EXE)
+
+md5-const.bin: md5-const.scm
+ echo '(sf "md5-const")' | $(EXE)
+
+md5-const.scm: md5-const
+ ./md5-const
+
+md5-const: md5-const.o
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+md5-const.o: md5-const.c md5-shim.h
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
.PHONY: all check install clean distclean maintainer-clean
EXE = '$(MIT_SCHEME_EXE)' --batch-mode
CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@ -I. -I$(srcdir)
+CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-all: mhash-shim.so
+all: mhash-shim.so mhash-types.bin mhash-const.bin
echo '(load "compile")' | $(EXE)
-check: all
+check:
echo '(load "check")' | $(EXE)
-install: all
+install:
echo '(install-shim "mhash")' | $(EXE) -- *.com *.bci *.pkd make.scm
clean:
rm -f mhash-const.scm mhash-const mhash-const.c mhash-shim.c
rm -f mhash-*.crf mhash-*.fre mhash-*.pkd
- rm -f *.o *.so *.bin *.ext *.com *.bci
- rm -f *.moc *.fni *-init.c *-init.h *-init.o
+ rm -f *.o *.so *.bin *.ext *.com *.bci *.moc *.fni
rm -f sample
distclean: clean
mhash-shim.o: mhash-shim.c mhash-shim.h
echo '(compile-shim)' | $(EXE) -- $(CPPFLAGS) $(CFLAGS) -c $<
-mhash-shim.c: mhash.cdecl mhash-shim.h
- echo '(generate-shim "mhash" "#include \"mhash-shim.h\"")' \
- | $(EXE)
+mhash-shim.c mhash-const.c mhash-types.bin: mhash.cdecl mhash-shim.h
+ echo '(generate-shim "mhash" "#include \"mhash-shim.h\"")' | $(EXE)
+
+mhash-const.bin: mhash-const.scm
+ echo '(sf "mhash-const")' | $(EXE)
+
+mhash-const.scm: mhash-const
+ ./mhash-const
+
+mhash-const: mhash-const.o
+ $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+
+mhash-const.o: mhash-const.c mhash-shim.h
+ $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
.PHONY: all check install clean distclean maintainer-clean
-mhash/ (prmhash.c):
-mhash 4
-mhash_count 0
-mhash_end 1
-mhash_get_block_size 1
-mhash_get_hash_name 1
-mhash_get_hash_pblock 1
-mhash_get_keygen_max_key_size 1
-mhash_get_keygen_name 1
-mhash_get_keygen_salt_size 1
-mhash_hmac_end 1
-mhash_hmac_init 3
-mhash_init 1
-mhash_keygen 4
-mhash_keygen_count 0
-mhash_keygen_uses_count 1
-mhash_keygen_uses_hash_algorithm 1
-mhash_keygen_uses_salt 1
+The mhash wrapper.
+
+This is a drop-in replacement for the mhash microcode module and the
+mhash-* procedures in runtime/crypto.scm. It is not part of the core
+build and can be built outside the core build tree in the customary
+way:
+
+ ./configure [--with-mhash=directory]...
+ make all check install
+
+The install target copies a shared library shim and compiled Scheme
+files into the system library path. You can override the default
+command name "mit-scheme" (and thus the system library path) by
+setting MIT_SCHEME_EXE.
+
+To load via load-option, install the following in your optiondb.scm:
+
+ (define-load-option 'MHASH
+ (guarded-system-loader '(mhash) "mhash"))
+
+You will need to import the bindings you want to use. They are not
+exported to the global environment because they would conflict with
+the exports from (runtime crypto).
(define (generate-shim library #!optional prefix)
(load-ffi-quietly)
- ((environment-lookup (->environment '(ffi)) 'generate-shim) library prefix))
+ ((environment-lookup (->environment '(ffi)) 'c-generate) library prefix))
(define (compile-shim)
(load-ffi-quietly)
generate-shim
compile-shim
link-shim
- install-shim
- compile-bundle
- install-bundle)
+ install-shim)
(initialization (initialize-package!)))
(define-package (runtime program-copier)