From fc5b5a2b29b24f5cb0d6cf7c84e9f637cd87ccb3 Mon Sep 17 00:00:00 2001 From: Sears Russell Date: Fri, 7 Nov 2008 03:44:41 +0000 Subject: [PATCH] do away with librw --- CMakeLists.txt | 2 +- Makefile.am | 2 +- benchmarks/Makefile.am | 4 +--- examples/Makefile.am | 3 +-- libdfa/libdfa.h | 2 +- src/apps/readOnlyHash/Makefile.am | 2 +- src/apps/referential/Makefile.am | 2 +- src/libdfa/CMakeLists.txt | 1 - src/libdfa/Makefile.am | 2 -- src/stasis/CMakeLists.txt | 2 +- src/stasis/Makefile.am | 3 ++- src/{libdfa => stasis}/rw.c | 2 +- stasis/latches.h | 2 +- {libdfa => stasis}/rw.h | 0 test/2pc/Makefile.am | 2 +- test/cht/Makefile.am | 2 +- test/dfa/Makefile.am | 2 +- test/monotree/Makefile.am | 2 +- test/pobj/Makefile.am | 3 +-- test/stasis/Makefile.am | 2 +- utilities/Makefile.am | 3 +-- 21 files changed, 19 insertions(+), 26 deletions(-) rename src/{libdfa => stasis}/rw.c (99%) rename {libdfa => stasis}/rw.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index de8d164..1c8fe8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,6 +65,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} # set linker path for this and all subdirs LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/src/stasis ${CMAKE_CURRENT_BINARY_DIR}/src/libdfa) -SET(COMMON_LIBRARIES stasis rw m pthread) +SET(COMMON_LIBRARIES stasis m pthread) SET(CMAKE_C_FLAGS "-g -Wall -pedantic -std=gnu99 -DPBL_COMPAT ${CMAKE_C_FLAGS}") SET(CMAKE_CXX_FLAGS "-g -Wall -Wno-variadic-macros -Wno-long-long -pedantic -DPBL_COMPAT ${CMAKE_CXX_FLAGS}") diff --git a/Makefile.am b/Makefile.am index 1b767c3..88e96a5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ EXTRA_DIST = reconf 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/ !!! +nobase_include_HEADERS=stasis/rw.h # XXX move rw.h into stasis/ !!! ACLOCAL_AMFLAGS = -I m4 diff --git a/benchmarks/Makefile.am b/benchmarks/Makefile.am index d41ffa5..f48dd90 100644 --- a/benchmarks/Makefile.am +++ b/benchmarks/Makefile.am @@ -1,6 +1,4 @@ -LDADD=$(top_builddir)/src/stasis/libstasis.la \ - $(top_builddir)/src/libdfa/librw.la - +LDADD=$(top_builddir)/src/stasis/libstasis.la rose_SOURCES=rose.cpp roseTable_SOURCES=roseTable.cpp diff --git a/examples/Makefile.am b/examples/Makefile.am index fcc1402..3ab23ac 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,4 +1,3 @@ -LDADD=$(top_builddir)/src/stasis/libstasis.la \ - $(top_builddir)/src/libdfa/librw.la +LDADD=$(top_builddir)/src/stasis/libstasis.la noinst_PROGRAMS=ex1 ex2 AM_CFLAGS=${GLOBAL_CFLAGS} diff --git a/libdfa/libdfa.h b/libdfa/libdfa.h index 119b284..301bcfd 100644 --- a/libdfa/libdfa.h +++ b/libdfa/libdfa.h @@ -47,7 +47,7 @@ terms specified in this license. /*#include "monotree.h"*/ #include #include -#include +#include /** Maximum number of concurrent state machines. diff --git a/src/apps/readOnlyHash/Makefile.am b/src/apps/readOnlyHash/Makefile.am index 9c44bc9..4e56a64 100644 --- a/src/apps/readOnlyHash/Makefile.am +++ b/src/apps/readOnlyHash/Makefile.am @@ -1,3 +1,3 @@ -LDADD=$(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la +LDADD=$(top_builddir)/src/stasis/libstasis.la noinst_PROGRAMS=queryTable buildTable AM_CFLAGS=-g -Wall -pedantic -std=gnu99 diff --git a/src/apps/referential/Makefile.am b/src/apps/referential/Makefile.am index d61063b..052e8c5 100644 --- a/src/apps/referential/Makefile.am +++ b/src/apps/referential/Makefile.am @@ -1,4 +1,4 @@ -LDADD=$(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la +LDADD=$(top_builddir)/src/stasis/libstasis.la ## TODO: Get lex + yacc to work w/ automake #toplevel_SOURCES=toplevel.c algebra.c dml.c ddl.c tuple.c lang/ast.c lang/lexer.l lang/parse.y #noinst_PROGRAMS=toplevel diff --git a/src/libdfa/CMakeLists.txt b/src/libdfa/CMakeLists.txt index 5519b94..ba1c0e9 100644 --- a/src/libdfa/CMakeLists.txt +++ b/src/libdfa/CMakeLists.txt @@ -1,4 +1,3 @@ -ADD_LIBRARY(rw rw.c) IF(HAVE_CONFUSE) ADD_LIBRARY(libdfa libdfa.c monotree.c smash.c callbacks.c messages.c networksetup.c) ENDIF(HAVE_CONFUSE) diff --git a/src/libdfa/Makefile.am b/src/libdfa/Makefile.am index 588b5a4..eff3450 100644 --- a/src/libdfa/Makefile.am +++ b/src/libdfa/Makefile.am @@ -2,7 +2,5 @@ if HAVE_LIBCONFUSE noinst_LTLIBRARIES=libdfa.la #else endif -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} diff --git a/src/stasis/CMakeLists.txt b/src/stasis/CMakeLists.txt index b16e7b6..d830cc8 100644 --- a/src/stasis/CMakeLists.txt +++ b/src/stasis/CMakeLists.txt @@ -1,4 +1,4 @@ -ADD_LIBRARY(stasis crc32.c redblack.c lhtable.c doubleLinkedList.c +ADD_LIBRARY(stasis crc32.c redblack.c lhtable.c rw.c doubleLinkedList.c common.c flags.c stats.c io.c bufferManager.c linkedlist.c operations.c pageHandle.c pageFile.c pageCache.c page.c bufferPool.c blobManager.c diff --git a/src/stasis/Makefile.am b/src/stasis/Makefile.am index 441ee4d..ccb1cad 100644 --- a/src/stasis/Makefile.am +++ b/src/stasis/Makefile.am @@ -1,6 +1,7 @@ nobase_pkginclude_HEADERS=$(wildcard *.h) $(wildcard */*.h) lib_LTLIBRARIES=libstasis.la -libstasis_la_SOURCES=crc32.c redblack.c lhtable.c doubleLinkedList.c common.c flags.c stats.c io.c bufferManager.c linkedlist.c operations.c \ +libstasis_la_SOURCES=crc32.c redblack.c lhtable.c rw.c doubleLinkedList.c common.c flags.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\ diff --git a/src/libdfa/rw.c b/src/stasis/rw.c similarity index 99% rename from src/libdfa/rw.c rename to src/stasis/rw.c index 580e39d..45d6bf0 100644 --- a/src/libdfa/rw.c +++ b/src/stasis/rw.c @@ -1,4 +1,4 @@ -#include +#include #include #undef pthread_cond_wait diff --git a/stasis/latches.h b/stasis/latches.h index b178426..a191c1b 100644 --- a/stasis/latches.h +++ b/stasis/latches.h @@ -20,7 +20,7 @@ typedef struct { void * lockpoints; } lladd_pthread_mutex_t; -#include +#include "rw.h" /** Keeps some profiling information along with a read/write lock. diff --git a/libdfa/rw.h b/stasis/rw.h similarity index 100% rename from libdfa/rw.h rename to stasis/rw.h diff --git a/test/2pc/Makefile.am b/test/2pc/Makefile.am index e0bfdc2..01e1074 100644 --- a/test/2pc/Makefile.am +++ b/test/2pc/Makefile.am @@ -1,4 +1,4 @@ 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 + $(top_builddir)/src/stasis/libstasis.la -lconfuse noinst_PROGRAMS=always_commit AM_CFLAGS=${GLOBAL_CFLAGS} diff --git a/test/cht/Makefile.am b/test/cht/Makefile.am index 3316283..cb10025 100644 --- a/test/cht/Makefile.am +++ b/test/cht/Makefile.am @@ -1,5 +1,5 @@ TESTS=./run 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 + $(top_builddir)/src/stasis/libstasis.la noinst_PROGRAMS=simple cht_server client coordinator subordinate AM_CFLAGS=${GLOBAL_CFLAGS} diff --git a/test/dfa/Makefile.am b/test/dfa/Makefile.am index 40f6b05..d78dff4 100644 --- a/test/dfa/Makefile.am +++ b/test/dfa/Makefile.am @@ -1,4 +1,4 @@ -LDADD= $(top_builddir)/src/libdfa/libdfa.la $(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la -lconfuse +LDADD= $(top_builddir)/src/libdfa/libdfa.la $(top_builddir)/src/stasis/libstasis.la -lconfuse AM_CFLAGS=${GLOBAL_CFLAGS} if HAVE_LIBCHECK TESTS = check_networksetup ping_pong_dfa diff --git a/test/monotree/Makefile.am b/test/monotree/Makefile.am index fce3d1e..8785441 100644 --- a/test/monotree/Makefile.am +++ b/test/monotree/Makefile.am @@ -1,4 +1,4 @@ -LDADD=$(top_builddir)/src/libdfa/libdfa.la $(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la -lconfuse +LDADD=$(top_builddir)/src/libdfa/libdfa.la $(top_builddir)/src/stasis/libstasis.la -lconfuse noinst_PROGRAMS=bit_arithmetic binary_search soundness soundness_SOURCES = soundness.c AM_CFLAGS=${GLOBAL_CFLAGS} diff --git a/test/pobj/Makefile.am b/test/pobj/Makefile.am index b9256f2..2dd9be7 100644 --- a/test/pobj/Makefile.am +++ b/test/pobj/Makefile.am @@ -1,5 +1,4 @@ noinst_PROGRAMS = test-list test-multilist test-list2 -LDADD = $(top_builddir)/src/pobj/libpobj.la $(top_builddir)/src/stasis/libstasis.la \ - $(top_builddir)/src/libdfa/librw.la +LDADD = $(top_builddir)/src/pobj/libpobj.la $(top_builddir)/src/stasis/libstasis.la CLEANFILES = storefile.txt logfile.txt blob0_file.txt blob1_file.txt AM_CFLAGS= -g -Wall -pedantic -std=gnu99 diff --git a/test/stasis/Makefile.am b/test/stasis/Makefile.am index 4e1060f..53f5f68 100644 --- a/test/stasis/Makefile.am +++ b/test/stasis/Makefile.am @@ -8,6 +8,6 @@ else TESTS = endif noinst_PROGRAMS = $(TESTS) -LDADD = $(top_builddir)/src/stasis/libstasis.la $(top_builddir)/src/libdfa/librw.la +LDADD = $(top_builddir)/src/stasis/libstasis.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} diff --git a/utilities/Makefile.am b/utilities/Makefile.am index 49361f5..503c3d4 100644 --- a/utilities/Makefile.am +++ b/utilities/Makefile.am @@ -1,5 +1,4 @@ -LDADD=$(top_builddir)/src/stasis/libstasis.la \ - $(top_builddir)/src/libdfa/librw.la +LDADD=$(top_builddir)/src/stasis/libstasis.la noinst_PROGRAMS=logfile_dump run_recovery truncate_log AM_CFLAGS=${GLOBAL_CFLAGS}