support "make install", and use libtool to generate .so, .a files.

This commit is contained in:
Sears Russell 2007-06-25 15:47:28 +00:00
parent d0274c3304
commit 356387eafe
26 changed files with 192 additions and 107 deletions

View file

@ -1,6 +1,11 @@
EXTRA_DIST = reconf
SUBDIRS = src test utilities benchmarks examples
SUBDIRS = stasis src test utilities benchmarks examples
export GLOBAL_CFLAGS = -g -Wall -pedantic -std=gnu99 -DPBL_COMPAT
nobase_include_HEADERS=libdfa/rw.h # XXX move rw.h into stasis/ !!!
ACLOCAL_AMFLAGS = -I m4
## GOAL: Make these not warn!
#-Wextra -Wno-unused-parameter -Winline

View file

@ -1,9 +1,8 @@
LDADD=$(top_builddir)/src/stasis/liblladd.a \
$(top_builddir)/src/libdfa/librw.a
#$(top_builddir)/src/2pc/lib2pc.a $(top_builddir)/src/libdfa/libdfa.a
LDADD=$(top_builddir)/src/stasis/libstasis.la \
$(top_builddir)/src/libdfa/librw.la
if BUILD_BENCHMARKS
bin_PROGRAMS=lhtableThreaded naiveHash logicalHash readLogicalHash naiveMultiThreaded logicalMultThreaded rawSet \
noinst_PROGRAMS=lhtableThreaded naiveHash logicalHash readLogicalHash naiveMultiThreaded logicalMultThreaded rawSet \
arrayListSet logicalMultiReaders linearHashNTA linkedListNTA pageOrientedListNTA \
linearHashNTAThreaded linearHashNTAMultiReader linearHashNTAWriteRequests transitiveClosure zeroCopy
endif

View file

@ -1,6 +1,6 @@
if BUILD_BENCHMARKS
if DB_ENABLED
LDADD=@DB_LIBS@
bin_PROGRAMS=transapp bdbRaw bdbHash bdbHashThreaded bdbHashWriteRequests
noinst_PROGRAMS=transapp bdbRaw bdbHash bdbHashThreaded bdbHashWriteRequests
endif
endif

View file

@ -12,10 +12,11 @@
#define NUM_NODES 1000000
#define DIRTY_BUF_SIZE 60000000
//#define OUTDGREE 3
//#define OUTDEGREE 3
#define NUM_THREADS 1
#define NUM_FIFOS 5
#define NUM_ITER 1
int hotSet(int j, int HotSetProb) {
@ -69,14 +70,14 @@ lladdFifo_t * transClos_getFifoLocal(lladdFifoPool_t * pool, byte * multiplexKey
}*/
int numOut = 0;
int numTset = 0;
int numShortcutted = 0;
int numSkipped = 0;
int numPushed = 0;
int useCRC = 0;
extern int transClos_outdegree;
extern int numOut;
extern int numTset;
extern int numShortcutted;
extern int numSkipped;
extern int numPushed;
extern int useCRC;
int OUTDEGREE = 0;
int transClos_outdegree = 0;
typedef struct {
lladdFifo_t * dirty;

View file

@ -1,9 +1,10 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
AC_INIT(Stasis, 0.1, sears@cs.berkeley.edu)
AM_INIT_AUTOMAKE(hello,0.1)
AC_PREREQ(2.59)
AC_INIT([Stasis],[0.1],[sears@cs.berkeley.edu])
AM_INIT_AUTOMAKE() #hello,0.1)
#AM_INIT_AUTOMAKE([subdir-objects]) # @todo use subdir-objects once transition to libtool is done.
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADER([config.h])
@ -58,11 +59,11 @@ AM_CONDITIONAL(HAVE_SWIG, test x"$have_swig" = "xyes")
# the command line.
test_host_prw=yes
AC_CACHE_CHECK([for open/O_DIRECT], db_cv_open_o_direct, [
AC_TRY_LINK([
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <fcntl.h>], [
#include <fcntl.h>]], [[
open("a", O_RDONLY | O_DIRECT, 0);
], [db_cv_open_o_direct=yes; test_host_prw=no], [db_cv_open_o_direct=no])])
]])],[db_cv_open_o_direct=yes; test_host_prw=no],[db_cv_open_o_direct=no])])
if test "$test_host_prw" = "no" -a "$db_cv_open_o_direct" = "yes"; then
case "$host_os" in
linux*)
@ -132,8 +133,7 @@ AC_CHECK_LIB([pthread], [pthread_create])
AC_ARG_ENABLE([network],
AC_HELP_STRING([--disable-network],
[Disable old networking code]),
AS_HELP_STRING(--disable-network,Disable old networking code),
if test x$enableval = xno ; then
echo "Networking disabled; not checking for confuse";
have_libconfuse=no
@ -148,14 +148,13 @@ AC_ARG_ENABLE([network],
AM_CONDITIONAL(HAVE_LIBCONFUSE, test x$have_libconfuse = xyes)
AC_ARG_ENABLE([pobj],
AC_HELP_STRING([--disable-pobj], [Don't build pobj]),
AS_HELP_STRING(--disable-pobj,Don't build pobj),
AM_CONDITIONAL(BUILD_POBJ, test x$enableval = xyes),
AM_CONDITIONAL(BUILD_POBJ, true)
)
AC_ARG_ENABLE([benchmarks],
AC_HELP_STRING([--disable-benchmarks],
[Don't build benchmarks]),
AS_HELP_STRING(--disable-benchmarks,Don't build benchmarks),
if test x$enableval = xyes ; then
build_benchmarks=yes
else
@ -191,12 +190,12 @@ AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h malloc.h memory.h netdb.h netinet
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
#AC_TYPE_INT64_T
#AC_TYPE_UINT64_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
#AC_TYPE_SSIZE_T
AC_HEADER_TIME
AC_STRUCT_TM

View file

@ -1,4 +1,4 @@
LDADD=$(top_builddir)/src/stasis/liblladd.a \
$(top_builddir)/src/libdfa/librw.a
bin_PROGRAMS=ex1 ex2
LDADD=$(top_builddir)/src/stasis/libstasis.la \
$(top_builddir)/src/libdfa/librw.la
noinst_PROGRAMS=ex1 ex2
AM_CFLAGS=${GLOBAL_CFLAGS}

87
reconf
View file

@ -1,3 +1,22 @@
#!/usr/bin/env perl
#
# @todo Rewrite this in sh
#
# This perl script invokes autoreconf after setting ACLOCAL and AUTOMAKE to reasonably modern values.
# (>= aclocal-1.6, automake-1.6).
#
# It is careful to avoid mixing versions of the two tools.
#
# If you don't have perl, find sufficiently recent and matching versions of aclocal and automake, and invoke
# something like this (under bash):
#
# ACLOCAL=/usr/bin/aclocal-1.8 AUTOMAKE=/usr/bin/automake-1.8 autoreconf
#
# Stasis used to ship with the following two scripts; the first uses the system default, the second uses automake 1.8:
#
qq(
#!/bin/sh
rm -f config.cache
rm -f acconfig.h
@ -7,3 +26,71 @@ autoheader
libtoolize --automake
automake -a
exit
);
#
#
qq(
#!/bin/sh
rm -f config.cache
rm -f acconfig.h
aclocal-1.8 -I m4
autoconf
autoheader
libtoolize --automake
automake-1.8 -a
exit
);
#
my $aclocal_base = `which aclocal` || die `aclocal not found!`;
my $automake_base = `which automake` || die `aclocal not found!`;
chomp $aclocal_base;
chomp $automake_base;
my @good_versions = qw(1.9 1.8 1.7 1.6);
foreach my $i (@ARGV) {
if ($i eq "-h" || $i eq "--help") {
print
qq(Usage: $0 [options]
This program is a thin wrapper on top of autoreconf. It looks for an
appropriate version of aclocal and automake, and then invokes autoreconf.
It takes the same options as autoreconf, whose usage string is repeated below:
);
}
}
my $version;
foreach my $i (@good_versions) {
if ((-x "$aclocal_base-$i") && (-x "$automake_base-$i")) {
$version = $i;
break;
}
}
if(! $version ) {
print
qq(
*****************************************************************************************
No appropriate version of automake was found.
Please install a version between 1.6 and 1.9, or add a directory containing automake-1.n
and aclocal-1.n to your path.
Proceeding with system's default automake. Expect trouble.
*****************************************************************************************
);
} else {
$ENV{ACLOCAL} = "$aclocal_base-$version";
$ENV{AUTOMAKE} = "$automake_base-$version";
}
system ("autoreconf", @ARGV);

View file

@ -1,5 +1,5 @@
if HAVE_LIBCONFUSE
lib_LIBRARIES=lib2pc.a
lib2pc_a_SOURCES=2pc.c
noinst_LTLIBRARIES=lib2pc.la
lib2pc_la_SOURCES=2pc.c
AM_CFLAGS=${GLOBAL_CFLAGS}
endif

View file

@ -1,7 +1,7 @@
if HAVE_LIBCONFUSE
LDADD=$(top_builddir)/src/libdfa/libdfa.a $(top_builddir)/src/2pc/lib2pc.a
LDADD=$(top_builddir)/src/libdfa/libdfa.la $(top_builddir)/src/2pc/lib2pc.la
#SOURCES=cht.c
lib_LIBRARIES=libcht.a
libcht_a_SOURCES=cht.c cht_client.c cht_server.c cht_message.c
noinst_LTLIBRARIES=libcht.la
libcht_la_SOURCES=cht.c cht_client.c cht_server.c cht_message.c
AM_CFLAGS=${GLOBAL_CFLAGS}
endif

View file

@ -1,5 +1,5 @@
LDADD=$(top_builddir)/build/libdfa.a $(top_builddir)/build/lib2pc.a
LDADD=$(top_builddir)/build/libdfa.la $(top_builddir)/build/lib2pc.la
SOURCES=cyrusdb_lladd.c
lib_LIBRARIES=libcyrusdb_lladd.a
libcyrusdb_lladd_a_SOURCES=cyrusdb_lladd.c
noinst_LTLIBRARIES=libcyrusdb_lladd.la
libcyrusdb_lladd_la_SOURCES=cyrusdb_lladd.c
AM_CFLAGS=${GLOBAL_CFLAGS}

View file

@ -1,3 +1,3 @@
LDADD=$(top_builddir)/src/stasis/liblladd.a $(top_builddir)/src/libdfa/librw.a
bin_PROGRAMS=queryTable buildTable
LDADD=$(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la
noinst_PROGRAMS=queryTable buildTable
AM_CFLAGS=-g -Wall -pedantic -std=gnu99

View file

@ -1,9 +1,8 @@
if HAVE_LIBCONFUSE
lib_LIBRARIES=libdfa.a librw.a
else
lib_LIBRARIES=librw.a
noinst_LTLIBRARIES=libdfa.la
#else
endif
libdfa_a_SOURCES=libdfa.c monotree.c smash.c callbacks.c messages.c networksetup.c
librw_a_SOURCES=rw.c
lib_LTLIBRARIES=librw.la
libdfa_la_SOURCES=libdfa.c monotree.c smash.c callbacks.c messages.c networksetup.c
librw_la_SOURCES=rw.c
AM_CFLAGS=${GLOBAL_CFLAGS}

View file

@ -1,3 +1,3 @@
lib_LIBRARIES=libpobj.a
libpobj_a_SOURCES=xmem.c debug.c hash.c queue.c pobj.c
noinst_LTLIBRARIES=libpobj.la
libpobj_la_SOURCES=xmem.c debug.c hash.c queue.c pobj.c
AM_CFLAGS= -g -Wall # -pedantic -std=gnu99

View file

@ -1,9 +1,6 @@
#SUBDIRS=operations logger
#LDADD=$(top_builddir)/src/pbl/libpbl.a
lib_LIBRARIES=liblladd.a
#liblladd_a_LIBADD=logger/liblogger.a operations/liboperations.a
# removed: recovery.c transactional.c logger.c logger/logparser.c logger/logstreamer.c
liblladd_a_SOURCES=crc32.c redblack.c lhtable.c doubleLinkedList.c common.c stats.c io.c bufferManager.c linkedlist.c operations.c \
nobase_pkginclude_HEADERS=$(wildcard *.h) $(wildcard */*.h)
lib_LTLIBRARIES=libstasis.la
libstasis_la_SOURCES=crc32.c redblack.c lhtable.c doubleLinkedList.c common.c stats.c io.c bufferManager.c linkedlist.c operations.c \
pageHandle.c pageFile.c pageCache.c page.c bufferPool.c blobManager.c recovery2.c truncation.c \
transactional2.c allocationPolicy.c \
lockManager.c iterator.c consumer.c arrayCollection.c ringbuffer.c fifo.c multiplexer.c graph.c\
@ -21,7 +18,4 @@ liblladd_a_SOURCES=crc32.c redblack.c lhtable.c doubleLinkedList.c common.c stat
io/rangeTracker.c io/memory.c io/file.c io/non_blocking.c io/debug.c \
bufferManager/pageArray.c bufferManager/bufferHash.c \
replacementPolicy/lru.c replacementPolicy/lruFast.c
# page/header.c logger/logMemory.c \ ringbuffer.c \ asdfas
#operations/lladdhash.c
#AM_CFLAGS= -g -Wall -pedantic -std=gnu99
AM_CFLAGS=${GLOBAL_CFLAGS}

View file

@ -5,13 +5,13 @@
#include "page.h"
#include <stasis/crc32.h>
extern int transClos_outdegree;
extern int numOut;
extern int numTset;
extern int numShortcutted;
extern int numSkipped;
extern int numPushed;
extern int useCRC;
int numOut = 0;
int numTset = 0;
int numShortcutted = 0;
int numSkipped = 0;
int numPushed = 0;
int useCRC = 0;
int transClos_outdegree = 0;
void naiveTraverse(int xid, recordid rid, int num) {

View file

@ -1,3 +1,2 @@
bin_PROGRAMS=getTimeOfDay
noinst_PROGRAMS=getTimeOfDay
AM_CFLAGS=${GLOBAL_CFLAGS}

View file

@ -0,0 +1 @@
nobase_pkginclude_HEADERS=$(wildcard *.h) $(wildcard */*.h)

View file

@ -72,14 +72,18 @@ terms specified in this license.
Development is currently performed under Debian's Testing branch.
To compile Stasis, first check out a copy with CVS:
To compile Stasis, first check out a copy with SVN. If you have commit access:
@code
$ cvs -z3 -d:pserver:anonymous@lladd.cvs.sourceforge.net:/cvsroot/lladd co -P lladd
svn co --username username https://stasis.googlecode.com/svn/trunk stasis
@endcode
For anonymous checkout:
svn co http://stasis.googlecode.com/svn/trunk stasis
then:
@code
@ -87,7 +91,7 @@ terms specified in this license.
$ ./reconf
$ ./configure --quiet
$ make -j4 > /dev/null
$ cd test/lladd
$ cd test/stasis
$ make check
@endcode
@ -102,7 +106,7 @@ terms specified in this license.
$ ./reconf-1.8
$ ./configure --quiet
$ make -j4 > /dev/null
$ cd test/lladd
$ cd test/stasis
$ make check
@endcode
@ -113,7 +117,7 @@ terms specified in this license.
'make install' is currently unsupported. Look in utilities/ for an example of a
simple program that uses Stasis. Currently, most generally useful programs
written on top of Stasis belong in lladd/src/apps, while utilities/ contains
written on top of Stasis belong in stasis/src/apps, while utilities/ contains
programs useful for debugging the library.
@section usage Using Stasis in your software
@ -194,7 +198,7 @@ terms specified in this license.
Stasis includes an extensive unit test suite which may be invoked
by running 'make check' in Stasis' root directory. Some of the
tests are for older, unmaintained code that was built on top of
Stasis. Running 'make check' in test/lladd runs all of the Stasis
Stasis. Running 'make check' in test/stasis runs all of the Stasis
tests without running the obsolete tests.
@section archictecture Stasis' structure
@ -223,25 +227,25 @@ terms specified in this license.
The Stasis repository contains the following "interesting" directories:
@par $STASIS/lladd/
@par $STASIS/stasis/
Contains the header directory structure.
In theory, this contains all of the .h files that need to be
installed for a fully functional Stasis development environment.
In practice, .h files in src/ are also needed in some cases. The
separation of .h files between src/ and lladd/ continues for
separation of .h files between src/ and stasis/ continues for
various obscure reasons, including CVS's lack of a "move" command.
For now, .h files should be placed with similar .h files, or in
lladd/ if no such files exist.
stasis/ if no such files exist.
The directory structure of lladd/ mirrors that of src/
The directory structure of stasis/ mirrors that of src/
@par $STASIS/src/
Contains the .c files
@par $STASIS/src/lladd
@par $STASIS/src/stasis
Contains Stasis and the implementations of its standard modules.
The subdirectories group files by the type of module they
@ -249,9 +253,9 @@ terms specified in this license.
@note By convention, when the rest of this document says
<tt>foo/</tt>, it is referring to two directories:
<tt>lladd/foo/</tt> and <tt>src/lladd/foo/</tt>. Unless it's clear
<tt>stasis/foo/</tt> and <tt>src/stasis/foo/</tt>. Unless it's clear
from context, a file without an explicit directory name is in
<tt>lladd/</tt> or <tt>src/lladd/</tt>. In order to refer to files
<tt>stasis/</tt> or <tt>src/stasis/</tt>. In order to refer to files
and directories outside of these two locations, but still in the
repository, this document will use the notation
<tt>$STASIS/dir</tt>.
@ -261,8 +265,8 @@ terms specified in this license.
@note <b>Example:</b> The transactional data structure
implementations in <tt>operations/</tt> can be found in
<tt>$STASIS/src/lladd/operations/</tt> and
<tt>$STASIS/lladd/operations/</tt>.
<tt>$STASIS/src/stasis/operations/</tt> and
<tt>$STASIS/stasis/operations/</tt>.
@subsection Modules

View file

@ -1,4 +1,4 @@
LDADD=$(top_builddir)/src/2pc/lib2pc.a $(top_builddir)/src/libdfa/libdfa.a \
$(top_builddir)/src/stasis/liblladd.a $(top_builddir)/src/libdfa/librw.a -lconfuse
bin_PROGRAMS=always_commit
LDADD=$(top_builddir)/src/2pc/lib2pc.la $(top_builddir)/src/libdfa/libdfa.la \
$(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la -lconfuse
noinst_PROGRAMS=always_commit
AM_CFLAGS=${GLOBAL_CFLAGS}

View file

@ -1,5 +1,5 @@
TESTS=./run
LDADD=-lconfuse $(top_builddir)/src/apps/cht/libcht.a $(top_builddir)/src/2pc/lib2pc.a $(top_builddir)/src/libdfa/libdfa.a \
$(top_builddir)/src/stasis/liblladd.a $(top_builddir)/src/libdfa/librw.a
bin_PROGRAMS=simple cht_server client coordinator subordinate
LDADD=-lconfuse $(top_builddir)/src/apps/cht/libcht.la $(top_builddir)/src/2pc/lib2pc.la $(top_builddir)/src/libdfa/libdfa.la \
$(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la
noinst_PROGRAMS=simple cht_server client coordinator subordinate
AM_CFLAGS=${GLOBAL_CFLAGS}

View file

@ -1,10 +1,9 @@
LDADD= $(top_builddir)/src/libdfa/libdfa.a $(top_builddir)/src/stasis/liblladd.a $(top_builddir)/src/libdfa/librw.a -lconfuse
bin_PROGRAMS=ping_pong_dfa fork_bomb star
LDADD= $(top_builddir)/src/libdfa/libdfa.la $(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la -lconfuse
AM_CFLAGS=${GLOBAL_CFLAGS}
if HAVE_LIBCHECK
TESTS = check_networksetup ping_pong_dfa
else
TESTS =
endif
noinst_PROGRAMS = $(TESTS)
noinst_PROGRAMS = ping_pong_dfa fork_bomb star $(TESTS)
CLEANFILES = check_networksetup.log

View file

@ -1,4 +1,4 @@
LDADD=$(top_builddir)/src/libdfa/libdfa.a $(top_builddir)/src/stasis/liblladd.a $(top_builddir)/src/libdfa/librw.a
bin_PROGRAMS=bit_arithmetic binary_search soundness
LDADD=$(top_builddir)/src/libdfa/libdfa.la $(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la -lconfuse
noinst_PROGRAMS=bit_arithmetic binary_search soundness
soundness_SOURCES = soundness.c
AM_CFLAGS=${GLOBAL_CFLAGS}

View file

@ -1,5 +1,5 @@
noinst_PROGRAMS = test-list test-multilist test-list2
LDADD = $(top_builddir)/src/pobj/libpobj.a $(top_builddir)/src/stasis/liblladd.a \
$(top_builddir)/src/libdfa/librw.a
LDADD = $(top_builddir)/src/pobj/libpobj.la $(top_builddir)/src/stasis/libstasis.la \
$(top_builddir)/src/libdfa/librw.la
CLEANFILES = storefile.txt logfile.txt blob0_file.txt blob1_file.txt
AM_CFLAGS= -g -Wall -pedantic -std=gnu99

View file

@ -8,6 +8,6 @@ else
TESTS =
endif
noinst_PROGRAMS = $(TESTS)
LDADD = $(top_builddir)/src/stasis/liblladd.a $(top_builddir)/src/libdfa/librw.a #-lefence
LDADD = $(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la
CLEANFILES = check_lht.log check_logEntry.log storefile.txt logfile.txt blob0_file.txt blob1_file.txt check_blobRecovery.log check_logWriter.log check_operations.log check_recovery.log check_transactional2.log check_page.log check_bufferManager.log check_indirect.log check_bufferMananger.log check_lladdhash.log check_pageOperations.log check_linearhash.log check_linkedListNTA.log check_linearHashNTA.log check_pageOrientedListNTA.log check_lockManager.log check_compensations.log check_errorhandling.log check_header.log check_iterator.log check_linearHash.log check_ringbuffer.log check_bTree.log
AM_CFLAGS=${GLOBAL_CFLAGS}

View file

@ -1,8 +1,6 @@
#LDADD=$(top_builddir)/src/2pc/lib2pc.a $(top_builddir)/src/libdfa/libdfa.a
LDADD=$(top_builddir)/src/stasis/liblladd.a \
$(top_builddir)/src/libdfa/librw.a
bin_PROGRAMS=logfile_dump run_recovery truncate_log
LDADD=$(top_builddir)/src/stasis/libstasis.la \
$(top_builddir)/src/libdfa/librw.la
noinst_PROGRAMS=logfile_dump run_recovery truncate_log
AM_CFLAGS=${GLOBAL_CFLAGS}
SUBDIRS =

View file

@ -2,12 +2,12 @@
BUILT_SOURCES = stasis_wrap.cc
all: $(BUILD_SOURCES)
pkgpython_PYTHON = stasis.py
pkgpyexec_LTLIBRARIES = _stasis.la
python_PYTHON = stasis.py
pyexec_LTLIBRARIES = _stasis.la
_stasis_la_SOURCES = stasis_wrap.cc
_stasis_la_CPPFLAGS = $(SWIG_PYTHON_CPPFLAGS) -I$(top_srcdir) -I$(top_srcdir)/src
_stasis_la_LDFLAGS = -module
_stasis_la_LIBADD = $(top_srcdir)/src/stasis/liblladd.a $(top_srcdir)/src/libdfa/librw.a
_stasis_la_LIBADD = $(top_srcdir)/src/stasis/libstasis.la $(top_srcdir)/src/libdfa/librw.la
stasis_wrap.cc : lladd.i
$(SWIG) $(SWIG_PYTHON_OPT) -I$(top_srcdir)/src -I$(top_srcdir) -o $@ $<