MIT_SCHEME_EXE = mit-scheme
EXE = '$(MIT_SCHEME_EXE)' --batch-mode
-build: gdbm-shim.so
+all: gdbm-shim.so
echo '(load "compile")' | $(EXE)
-check:
+check: all
echo '(load "check")' | $(EXE)
-install: build
+install: all
echo '(install-shim "gdbm")' | $(EXE) -- *.com *.bci *.pkd make.scm
-clean:
+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
gdbm-shim.c: gdbm.cdecl gdbm-shim.h
echo '(generate-shim "gdbm" "#include \"gdbm-shim.h\"")' | $(EXE)
-.PHONY: build install clean
\ No newline at end of file
+.PHONY: all check install clean distclean maintainer-clean
-The libgdbm wrapper.
+The GDBM wrapper.
-This wrapper is not part of the core build and can be built outside
-the core build tree. There is no ./configure script yet. If you know
-you have libgdbm installed, you should win with this command:
+This is a drop-in replacement for the gdbm microcode module and
+runtime/gdbm.scm. It is not part of the core build and can be built
+outside the core build tree. There is no ./configure script yet. If
+you know you have libgdbm installed, you should win with this command:
- make build check install
+ 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 system library path) by setting
-MIT_SCHEME_EXE.
+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 'GDBM2 (guarded-system-loader '(gdbm) "gdbm"))
+
+You will need to call it GDBM2 while GDBM refers to the original
+microcode module.
+
+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 gdbm).
#| -*-Scheme-*- |#
-;;;; Test the GDBM adapter.
+;;;; Test the GDBM wrapper.
(load "make")
(with-system-library-directories
#| -*-Scheme-*- |#
-;;;; Compile the GDBM adapter
+;;;; Compile the GDBM wrapper.
(fluid-let ((load/suppress-loading-message? #t))
(load-option 'CREF)
(load-option 'FFI))
-(compile-system "gdbm" (directory-pathname (current-load-pathname)))
\ No newline at end of file
+(with-system-library-directories
+ '("./")
+ (lambda ()
+ (compile-system "gdbm" (directory-pathname (current-load-pathname)))))
\ No newline at end of file
*/
-/* Interface to the gdbm database library */
+/* Adapters for the GDBM database library. */
#include <mit-scheme.h>
#include "gdbm-shim.h"
|#
-;;;; Test the GDBM adapter.
+;;;; Test the GDBM wrapper.
(if (not (gdbm-available?))
- (warn "gdbm adapter not found")
+ (warn "gdbm wrapper not found")
(let ((filename.db "gdbm-check.db"))
(ignore-errors (lambda () (delete-file filename.db)))
(let ((dbf (gdbm-open filename.db 0 GDBM_WRCREAT #o660)))
|#
-;;;; gdbm Database Library Interface
+;;;; GDBM wrapper
;;; package: (gdbm)
-(declare (usual-integrations)
- (integrate-external))
+(declare (usual-integrations))
\f
(C-include "gdbm")