aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitmodules4
-rw-r--r--Makefile.am4
-rwxr-xr-x[-rw-r--r--]bootstrap92
-rw-r--r--configure.ac5
m---------gdbm/master0
m---------gdbm/newcache0
-rw-r--r--src/Makefile.am2
-rw-r--r--src/benchmark.mk.in7
-rw-r--r--src/fetchkeys.c18
-rw-r--r--src/gnuplot.m426
-rw-r--r--src/master/Makefile.am2
-rw-r--r--src/newcache/Makefile.am5
-rwxr-xr-xsrc/runtest23
13 files changed, 145 insertions, 43 deletions
diff --git a/.gitmodules b/.gitmodules
index a4fd957..dfb9f90 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,7 +1,3 @@
1[submodule "gdbm/newcache"]
2 path = gdbm/newcache
3 url = git://git.gnu.org.ua/gdbm.git
4 branch = newcache
5[submodule "gdbm/master"] 1[submodule "gdbm/master"]
6 path = gdbm/master 2 path = gdbm/master
7 url = git://git.gnu.org.ua/gdbm.git 3 url = git://git.gnu.org.ua/gdbm.git
diff --git a/Makefile.am b/Makefile.am
index 2020e06..db9b75f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,5 @@
1ACLOCAL_AMFLAGS = -I m4 1ACLOCAL_AMFLAGS = -I m4
2SUBDIRS = gdbm/master gdbm/newcache src 2SUBDIRS = @USER_SUBDIRS@ src
3BENCHMARKDIR=benchmarks 3BENCHMARKDIR=benchmarks
4NUMSAMPLES=5 4NUMSAMPLES=5
5benchmark: 5benchmark:
@@ -11,7 +11,7 @@ benchmark:
11 echo "Please set NKEYS"; \ 11 echo "Please set NKEYS"; \
12 exit 1; \ 12 exit 1; \
13 fi; \ 13 fi; \
14 DIRNAME="$(BENCHMARKDIR)/$(NRECS)-$(NKEYS)"; \ 14 DIRNAME="$(BENCHMARKDIR)/$(BENCHMARKPREFIX)$(NRECS)-$(NKEYS)"; \
15 if ! test -d "$$DIRNAME"; then \ 15 if ! test -d "$$DIRNAME"; then \
16 mkdir -p $$DIRNAME; \ 16 mkdir -p $$DIRNAME; \
17 (echo "NRECS=$(NRECS)"; \ 17 (echo "NRECS=$(NRECS)"; \
diff --git a/bootstrap b/bootstrap
index 1726aea..723788f 100644..100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,8 +1,86 @@
1#!/bin/sh 1#!/bin/sh
2set e 2#! -*- perl -*-
3test -d m4 || mkdir m4 3eval 'exec perl -x -S $0 ${1+"$@"}'
4test -d gdbm || mkdir gdbm 4 if 0;
5git submodule init 5
6git submodule update 6use strict;
7git submodule foreach ./bootstrap 7use warnings;
8autoreconf -f -i -s 8use File::Basename;
9
10my %target;
11
12die "no bootstrap.conf in current working directory\n"
13 unless -f "bootstrap.conf";
14
15# Read configuration
16open(my $fh, '<', 'bootstrap.conf')
17 or die "can't open bootstrap.conf: $!\n";
18my $i = 0;
19while (<$fh>) {
20 chomp;
21 s/^\s+//;
22 s/#.*$//;
23 next if /^$/ ;
24 my ($treeish, $subdir) = split /\s+/;
25 if (!$subdir) {
26 $subdir = basename($treeish);
27 }
28
29 if ($subdir ne "master") {
30 unless (-d "gdbm/$subdir") {
31 system("git -C gdbm clone -b $treeish ./master $subdir");
32 }
33 }
34 system("(cd gdbm/$subdir; ./bootstrap)");
35
36 unless (-d "src/$subdir") {
37 mkdir "src/$subdir"
38 }
39 my $makefile = "src/$subdir/Makefile.am";
40 unless (-f $makefile) {
41 open(my $of, '>', $makefile)
42 or die "can't open $makefile for writing: $!\n";
43 print $of <<EOT;
44noinst_PROGRAMS=fetchkeys
45fetchkeys_SOURCES=fetchkeys.c
46VPATH=\$(top_srcdir)/src
47LDADD=../../gdbm/$subdir/src/.libs/libgdbm.a
48AM_CPPFLAGS=-DSIZEOF_OFF_T=8 -I\$(top_srcdir)/gdbm/$subdir/src/
49EOT
50 ;
51 close $of;
52 }
53 $target{$subdir} = {
54 order => $i,
55 treeish => $treeish
56 };
57 ++$i;
58}
59close($fh);
60
61#
62# Creating directories
63#
64unless (-d 'm4') {
65 mkdir 'm4'
66}
67unless (-d 'gdbm') {
68 mkdir 'gdbm'
69}
70
71system("git submodule init");
72system("git submodule update");
73
74#
75# Creating bootstrap.mk
76#
77my @k = sort { $target{$a}{order} <=> $target{$b}{order}} keys %target;
78my $gdbm_subdirs = join(' ', map { "gdbm/$_" } @k);
79open($fh, '>', 'bootstrap.mk')
80 or die "can't open bootstrap.mk: $!\n";
81print $fh "AC_SUBST([USER_SUBDIRS],['$gdbm_subdirs'])\n";
82print $fh "AC_SUBST([USER_TARGETS],['" . join(' ', @k) . "'])\n";
83print $fh "AC_CONFIG_SUBDIRS([$gdbm_subdirs])\n";
84print $fh "AC_CONFIG_FILES([" . join(' ', map { "src/$_/Makefile" } @k) . "])\n";
85close $fh;
86
diff --git a/configure.ac b/configure.ac
index 84f1957..3d7dcb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,11 +8,8 @@ AM_INIT_AUTOMAKE([-Wall -Werror 1.11.5 foreign tar-ustar silent-rules])
8 8
9# Checks for programs. 9# Checks for programs.
10AC_PROG_CC 10AC_PROG_CC
11 11m4_include([bootstrap.mk])
12AC_CONFIG_SUBDIRS(gdbm/master gdbm/newcache)
13AC_CONFIG_FILES([Makefile 12AC_CONFIG_FILES([Makefile
14 src/Makefile 13 src/Makefile
15 src/master/Makefile
16 src/newcache/Makefile
17 src/benchmark.mk]) 14 src/benchmark.mk])
18AC_OUTPUT 15AC_OUTPUT
diff --git a/gdbm/master b/gdbm/master
Subproject 2dc9267a91a98733a18ebb3b8488da8016539f8 Subproject 2cb3428f11998e6f10a92a3963c245cbc8ed7cf
diff --git a/gdbm/newcache b/gdbm/newcache
deleted file mode 160000
Subproject 35d6474da608623482a95e89fae79420ec7eeb1
diff --git a/src/Makefile.am b/src/Makefile.am
index c019df3..0e1b1b8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,2 +1,2 @@
1SUBDIRS=newcache master 1SUBDIRS=@USER_TARGETS@
2EXTRA_DIST=fechkeys.c runtest gnuplot.m4 benchmark.mk.in 2EXTRA_DIST=fechkeys.c runtest gnuplot.m4 benchmark.mk.in
diff --git a/src/benchmark.mk.in b/src/benchmark.mk.in
index 43c605c..4b4f199 100644
--- a/src/benchmark.mk.in
+++ b/src/benchmark.mk.in
@@ -18,9 +18,11 @@ abs_top_builddir = @abs_top_builddir@
18MASTERDIR=$(abs_top_builddir)/gdbm/master 18MASTERDIR=$(abs_top_builddir)/gdbm/master
19GDBMTOOL=$(MASTERDIR)/src/gdbmtool 19GDBMTOOL=$(MASTERDIR)/src/gdbmtool
20TESTDIR=$(MASTERDIR)/tests 20TESTDIR=$(MASTERDIR)/tests
21USER_TARGETS=@USER_TARGETS@
22LOGS=$(patsubst %, %.log, $(USER_TARGETS))
21 23
22all: test 24all: test
23test: master.log newcache.log 25test: $(LOGS)
24%.log: keys.txt a.gdbm 26%.log: keys.txt a.gdbm
25 $(AM_V_GEN)MAXCACHE=$(MAXCACHE); \ 27 $(AM_V_GEN)MAXCACHE=$(MAXCACHE); \
26 $(abs_top_srcdir)/src/runtest -n $(NUMSAMPLES) $(RUNTESTOPT) \ 28 $(abs_top_srcdir)/src/runtest -n $(NUMSAMPLES) $(RUNTESTOPT) \
@@ -32,7 +34,7 @@ test: master.log newcache.log
32 --log-file=$*.log \ 34 --log-file=$*.log \
33 $(abs_top_builddir)/src/$*/fetchkeys $(FETCHKEYSOPT) 35 $(abs_top_builddir)/src/$*/fetchkeys $(FETCHKEYSOPT)
34clean: 36clean:
35 rm -f master.log newcache.log 37 rm -f $(LOGS)
36allclean: clean 38allclean: clean
37 rm -f keys.txt a.gdbm 39 rm -f keys.txt a.gdbm
38keys.txt: 40keys.txt:
@@ -44,6 +46,7 @@ a.gdbm:
44 $(AM_V_GEN)$(TESTDIR)/num2word 1:$(NRECS) | $(TESTDIR)/gtload -clear a.gdbm 46 $(AM_V_GEN)$(TESTDIR)/num2word 1:$(NRECS) | $(TESTDIR)/gtload -clear a.gdbm
45benchmark.gnuplot: $(abs_top_srcdir)/src/gnuplot.m4 47benchmark.gnuplot: $(abs_top_srcdir)/src/gnuplot.m4
46 m4 -DNRECS=$(NRECS) -DNKEYS=$(NKEYS) -DNUMSAMPLES=$(NUMSAMPLES) \ 48 m4 -DNRECS=$(NRECS) -DNKEYS=$(NKEYS) -DNUMSAMPLES=$(NUMSAMPLES) \
49 "-DTARGETS=$$(echo "@USER_TARGETS@" | sed -r 's/[[:space:]]+/,/g')" \
47 $(abs_top_srcdir)/src/gnuplot.m4 > benchmark.gnuplot 50 $(abs_top_srcdir)/src/gnuplot.m4 > benchmark.gnuplot
48plot: test benchmark.gnuplot 51plot: test benchmark.gnuplot
49 gnuplot -p benchmark.gnuplot 52 gnuplot -p benchmark.gnuplot
diff --git a/src/fetchkeys.c b/src/fetchkeys.c
index 694f4d9..cfc0371 100644
--- a/src/fetchkeys.c
+++ b/src/fetchkeys.c
@@ -199,7 +199,7 @@ main (int argc, char **argv)
199 char *keystr; 199 char *keystr;
200 int b_opt = 0; 200 int b_opt = 0;
201 201
202 while ((i = getopt (argc, argv, "bc:t:nTpv")) != EOF) 202 while ((i = getopt (argc, argv, "bc:t:nTpVv")) != EOF)
203 { 203 {
204 switch (i) 204 switch (i)
205 { 205 {
@@ -226,6 +226,22 @@ main (int argc, char **argv)
226 case 'v': 226 case 'v':
227 verbose = 1; 227 verbose = 1;
228 break; 228 break;
229
230 case 'V':
231 printf ("gdbm header version: %d.%d",
232 GDBM_VERSION_MAJOR, GDBM_VERSION_MINOR);
233#ifdef GDBM_VERSION_PATCH
234#if GDBM_VERSION_PATCH > 0
235 printf (".%d", GDBM_VERSION_PATCH);
236# endif
237#endif
238 putchar ('\n');