diff options
-rw-r--r-- | .gitmodules | 4 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | bootstrap | 92 | ||||
-rw-r--r-- | configure.ac | 5 | ||||
m--------- | gdbm/master | 0 | ||||
m--------- | gdbm/newcache | 0 | ||||
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/benchmark.mk.in | 7 | ||||
-rw-r--r-- | src/fetchkeys.c | 18 | ||||
-rw-r--r-- | src/gnuplot.m4 | 26 | ||||
-rw-r--r-- | src/master/Makefile.am | 2 | ||||
-rw-r--r-- | src/newcache/Makefile.am | 5 | ||||
-rwxr-xr-x | src/runtest | 23 |
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 @@ | |||
1 | ACLOCAL_AMFLAGS = -I m4 | 1 | ACLOCAL_AMFLAGS = -I m4 |
2 | SUBDIRS = gdbm/master gdbm/newcache src | 2 | SUBDIRS = @USER_SUBDIRS@ src |
3 | BENCHMARKDIR=benchmarks | 3 | BENCHMARKDIR=benchmarks |
4 | NUMSAMPLES=5 | 4 | NUMSAMPLES=5 |
5 | benchmark: | 5 | benchmark: |
@@ -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)"; \ |
@@ -1,8 +1,86 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | set e | 2 | #! -*- perl -*- |
3 | test -d m4 || mkdir m4 | 3 | eval 'exec perl -x -S $0 ${1+"$@"}' |
4 | test -d gdbm || mkdir gdbm | 4 | if 0; |
5 | git submodule init | 5 | |
6 | git submodule update | 6 | use strict; |
7 | git submodule foreach ./bootstrap | 7 | use warnings; |
8 | autoreconf -f -i -s | 8 | use File::Basename; |
9 | |||
10 | my %target; | ||
11 | |||
12 | die "no bootstrap.conf in current working directory\n" | ||
13 | unless -f "bootstrap.conf"; | ||
14 | |||
15 | # Read configuration | ||
16 | open(my $fh, '<', 'bootstrap.conf') | ||
17 | or die "can't open bootstrap.conf: $!\n"; | ||
18 | my $i = 0; | ||
19 | while (<$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; | ||
44 | noinst_PROGRAMS=fetchkeys | ||
45 | fetchkeys_SOURCES=fetchkeys.c | ||
46 | VPATH=\$(top_srcdir)/src | ||
47 | LDADD=../../gdbm/$subdir/src/.libs/libgdbm.a | ||
48 | AM_CPPFLAGS=-DSIZEOF_OFF_T=8 -I\$(top_srcdir)/gdbm/$subdir/src/ | ||
49 | EOT | ||
50 | ; | ||
51 | close $of; | ||
52 | } | ||
53 | $target{$subdir} = { | ||
54 | order => $i, | ||
55 | treeish => $treeish | ||
56 | }; | ||
57 | ++$i; | ||
58 | } | ||
59 | close($fh); | ||
60 | |||
61 | # | ||
62 | # Creating directories | ||
63 | # | ||
64 | unless (-d 'm4') { | ||
65 | mkdir 'm4' | ||
66 | } | ||
67 | unless (-d 'gdbm') { | ||
68 | mkdir 'gdbm' | ||
69 | } | ||
70 | |||
71 | system("git submodule init"); | ||
72 | system("git submodule update"); | ||
73 | |||
74 | # | ||
75 | # Creating bootstrap.mk | ||
76 | # | ||
77 | my @k = sort { $target{$a}{order} <=> $target{$b}{order}} keys %target; | ||
78 | my $gdbm_subdirs = join(' ', map { "gdbm/$_" } @k); | ||
79 | open($fh, '>', 'bootstrap.mk') | ||
80 | or die "can't open bootstrap.mk: $!\n"; | ||
81 | print $fh "AC_SUBST([USER_SUBDIRS],['$gdbm_subdirs'])\n"; | ||
82 | print $fh "AC_SUBST([USER_TARGETS],['" . join(' ', @k) . "'])\n"; | ||
83 | print $fh "AC_CONFIG_SUBDIRS([$gdbm_subdirs])\n"; | ||
84 | print $fh "AC_CONFIG_FILES([" . join(' ', map { "src/$_/Makefile" } @k) . "])\n"; | ||
85 | close $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. |
10 | AC_PROG_CC | 10 | AC_PROG_CC |
11 | 11 | m4_include([bootstrap.mk]) | |
12 | AC_CONFIG_SUBDIRS(gdbm/master gdbm/newcache) | ||
13 | AC_CONFIG_FILES([Makefile | 12 | AC_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]) |
18 | AC_OUTPUT | 15 | AC_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 @@ | |||
1 | SUBDIRS=newcache master | 1 | SUBDIRS=@USER_TARGETS@ |
2 | EXTRA_DIST=fechkeys.c runtest gnuplot.m4 benchmark.mk.in | 2 | EXTRA_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@ | |||
18 | MASTERDIR=$(abs_top_builddir)/gdbm/master | 18 | MASTERDIR=$(abs_top_builddir)/gdbm/master |
19 | GDBMTOOL=$(MASTERDIR)/src/gdbmtool | 19 | GDBMTOOL=$(MASTERDIR)/src/gdbmtool |
20 | TESTDIR=$(MASTERDIR)/tests | 20 | TESTDIR=$(MASTERDIR)/tests |
21 | USER_TARGETS=@USER_TARGETS@ | ||
22 | LOGS=$(patsubst %, %.log, $(USER_TARGETS)) | ||
21 | 23 | ||
22 | all: test | 24 | all: test |
23 | test: master.log newcache.log | 25 | test: $(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) |
34 | clean: | 36 | clean: |
35 | rm -f master.log newcache.log | 37 | rm -f $(LOGS) |
36 | allclean: clean | 38 | allclean: clean |
37 | rm -f keys.txt a.gdbm | 39 | rm -f keys.txt a.gdbm |
38 | keys.txt: | 40 | keys.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 |
45 | benchmark.gnuplot: $(abs_top_srcdir)/src/gnuplot.m4 | 47 | benchmark.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 |
48 | plot: test benchmark.gnuplot | 51 | plot: 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'); | ||