Commit 6cbc51da authored by amirouche's avatar amirouche

autotools: add it (tx to Kristofer Buffington)

parent 35757ce4
......@@ -3,4 +3,13 @@
db
README.pdf
README.html
website/index.html
\ No newline at end of file
*.go
*.trs
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
build-aux/
config.status
configure
pre-inst-env
\ No newline at end of file
all: check
check:
guile -L . tests/wiredtiger.scm
guile -L . tests/extra.scm
guile -L . tests/feature-space.scm
guile -L . tests/grf3.scm
guile -L . tests/ix.scm
html:
pandoc README.md -o README.html
pdf:
pandoc README.md -o README.pdf
website: html
cat website/header.html README.html website/footer.html > website/index.html
include guile.am
TEST_EXTENSIONS = .scm
TESTS = tests/wiredtiger.scm \
tests/extra.scm \
tests/feature-space.scm \
tests/grf3.scm \
tests/ix.scm
SCM_LOG_COMPILER = $(GUILE)
AM_SCM_LOG_FLAGS = --no-auto-compile -L $(top_srcdir)
SOURCES = \
microkanren.scm \
htmlprag.scm \
wiredtiger/config.scm \
wiredtiger/wiredtiger.scm \
wiredtiger/extra.scm \
wiredtiger/feature-space.scm \
wiredtiger/grf3.scm \
wiredtiger/html2text.scm \
wiredtiger/ix.scm \
wiredtiger/plain.scm \
wiredtiger/text.scm
EXTRA_DIST = \
README.md \
bootstrap \
pre-inst-env.in
#! /bin/sh
autoreconf --verbose --install --force
AC_INIT([guile-wiredtiger], [0.6.2])
AC_CONFIG_SRCDIR([wiredtiger])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])
GUILE_PKG([2.2])
GUILE_PROGS
# Wiredtiger lib
LIBWIREDTIGER="libwiredtiger"
LIBWIREDTIGER_PREFIX="no"
LIBWIREDTIGER_LIBDIR="no"
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([WIREDTIGER],[wiredtiger],
[LIBWIREDTIGER_LIBDIR=`$PKG_CONFIG --variable=libdir wiredtiger`],
[LIBWIREDTIGER_LIBDIR="no"])
AC_ARG_WITH([libwiredtiger-prefix],
[AS_HELP_STRING([--with-libwiredtiger-prefix=DIR], [search for wiredtiger in DIR])],
[case "$withval" in
yes|no)
;;
*)
LIBWIREDTIGER="libwiredtiger"
LIBWIREDTIGER_PREFIX="$withval"
LIBWIREDTIGER_LIBDIR="$withval/lib"
;;
esac])
dnl Library name suitable for `dynamic-link'.
AC_MSG_CHECKING([for libwiredtiger shared library name])
AC_MSG_RESULT([$LIBWIREDTIGER])
AC_SUBST([LIBWIREDTIGER])
AC_SUBST([LIBWIREDTIGER_PREFIX])
AC_SUBST([LIBWIREDTIGER_LIBDIR])
if test "x$GUILD" = "x"; then
AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
fi
AC_CONFIG_FILES([Makefile wiredtiger/config.scm])
AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env])
AC_OUTPUT
moddir=$(datadir)/guile/site/$(GUILE_EFFECTIVE_VERSION)
godir=$(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
GOBJECTS = $(SOURCES:%.scm=%.go)
nobase_dist_mod_DATA = $(SOURCES) $(NOCOMP_SOURCES)
nobase_go_DATA = $(GOBJECTS)
# Make sure source files are installed first, so that the mtime of
# installed compiled files is greater than that of installed source
# files. See
# <http://lists.gnu.org/archive/html/guile-devel/2010-07/msg00125.html>
# for details.
guile_install_go_files = install-nobase_goDATA
$(guile_install_go_files): install-nobase_dist_modDATA
CLEANFILES = $(GOBJECTS)
GUILE_WARNINGS = -Wunbound-variable -Warity-mismatch -Wformat
SUFFIXES = .scm .go
.scm.go:
$(AM_V_GEN)$(top_builddir)/pre-inst-env $(GUILD) compile $(GUILE_WARNINGS) -o "$@" "$<"
(use-modules (ice-9 match)
(ice-9 popen)
(ice-9 rdelim)
(srfi srfi-1)
(srfi srfi-26)
(guix gexp)
(guix packages)
(guix licenses)
(guix git-download)
(guix build-system gnu)
((guix build utils) #:select (with-directory-excursion))
(gnu packages)
(gnu packages autotools)
(gnu packages guile)
(gnu packages pkg-config)
(gnu packages databases))
(define %source-dir (dirname (current-filename)))
(define git-file?
(let* ((pipe (with-directory-excursion %source-dir
(open-pipe* OPEN_READ "git" "ls-files")))
(files (let loop ((lines '()))
(match (read-line pipe)
((? eof-object?)
(reverse lines))
(line
(loop (cons line lines))))))
(status (close-pipe pipe)))
(lambda (file stat)
(match (stat:type stat)
('directory #t)
((or 'regular 'symlink)
(any (cut string-suffix? <> file) files))
(_ #f)))))
(package
(name "guile-wiredtiger")
(version "0.0")
(source (local-file %source-dir #:recursive? #t #:select? git-file?))
(build-system gnu-build-system)
(arguments
'(#:configure-flags
(list (string-append "--with-libwiredtiger-prefix="
(assoc-ref %build-inputs "wiredtiger")))
#:make-flags '("GUILE_AUTO_COMPILE=0")
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'bootstrap
(lambda _ (zero? (system* "sh" "bootstrap")))))))
(native-inputs
`(("autoconf" ,autoconf)
("automake" ,automake)
("pkg-config" ,pkg-config)))
(inputs
`(("wiredtiger" ,wiredtiger)
("guile-lib" ,guile-lib)
("guile" ,guile-2.2)))
(synopsis "Wired Tiger bindings for GNU Guile")
(description "wiredtiger bindings for guile")
(home-page "https://framagit.org/a-guile-mind/guile-wiredtiger.git")
(license gpl3+))
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
#!/bin/sh
abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd`"
abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd`"
GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}:$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH
PATH="$abs_top_builddir:$PATH"
export PATH
exec "$@"
\ No newline at end of file
(define-module (wiredtiger config)
#:export (%libwiredtiger))
(define %libwiredtiger
"/usr/local/lib/libwiredtiger")
(define-module (wiredtiger config)
#:export (%libwiredtiger))
(define %libwiredtiger
"@LIBWIREDTIGER_LIBDIR@/@LIBWIREDTIGER@")
......@@ -30,6 +30,7 @@
(use-modules (ice-9 receive))
(use-modules (system foreign)) ;; ffi
(use-modules (wiredtiger config))
;;;
;;; plain
......@@ -89,7 +90,7 @@
;;; wiredtiger bindings
;;;
(define wiredtiger (dynamic-link* "/usr/local/lib/libwiredtiger.so"))
(define wiredtiger (dynamic-link* %libwiredtiger))
(define* wiredtiger-string-error
(let ((function (wiredtiger POINTER "wiredtiger_strerror" int)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment