Triton Repository branch, aesop-dist, updated. 1c23ea9d3c9095992df7c9c621b90355fec4eb8c
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Triton Repository". The branch, aesop-dist has been updated via 1c23ea9d3c9095992df7c9c621b90355fec4eb8c (commit) via fae46b3bd01e257325bdbc772063a692b154c1e8 (commit) via 2a5ef9679dabc6d071e0b54a9e26332bc3bc820c (commit) via 22aca4392542ffa886582f05b4ed51f79930eff9 (commit) from e75872e4361ea2d73f57cdae5ef523cf7f82973c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1c23ea9d3c9095992df7c9c621b90355fec4eb8c Author: Phil Carns <[email protected]> Date: Mon Dec 19 12:01:43 2011 -0500 tweak main build to use c-utils - for now assumes that c-utils was built in-tree in code/src/c-utils commit fae46b3bd01e257325bdbc772063a692b154c1e8 Author: Phil Carns <[email protected]> Date: Mon Dec 19 10:43:51 2011 -0500 self-contained configure and build for c-utils commit 2a5ef9679dabc6d071e0b54a9e26332bc3bc820c Author: Phil Carns <[email protected]> Date: Mon Dec 19 09:41:02 2011 -0500 rename remaining common stuff to c-utils commit 22aca4392542ffa886582f05b4ed51f79930eff9 Author: Phil Carns <[email protected]> Date: Mon Dec 19 09:40:40 2011 -0500 remove stray dot file ----------------------------------------------------------------------- Summary of changes: code/Makefile.in | 8 +- code/configure.ac | 3 - code/src/aesop/ae-base.h | 2 +- code/src/aesop/ae-list.h | 2 +- code/src/aesop/ae-thread.h | 2 +- code/src/aesop/ae-types.h | 4 +- code/src/aesop/hints.c | 6 +- code/src/aesop/opcache.c | 2 +- code/src/aesop/parser/tests/blocking/btest-impl.c | 2 +- code/src/aesop/resource.c | 2 +- code/src/aesop/resources/timer/timer.c | 2 +- code/src/c-utils/Makefile.in | 306 +++++++++++++++++++++ code/{maint => src/c-utils}/config/libev.m4 | 0 code/{maint => src/c-utils}/config/unix.m4 | 0 code/src/c-utils/configure.ac | 123 +++++++++ code/{maint => src/c-utils}/depend.sh | 0 code/src/{common => c-utils}/jenkins-hash.h | 0 code/src/{common => c-utils}/libev/README | 0 code/src/{common => c-utils}/libev/ev++.h | 0 code/src/{common => c-utils}/libev/ev.c | 0 code/src/{common => c-utils}/libev/ev.h | 0 code/src/{common => c-utils}/libev/ev_epoll.c | 0 code/src/{common => c-utils}/libev/ev_kqueue.c | 0 code/src/{common => c-utils}/libev/ev_poll.c | 0 code/src/{common => c-utils}/libev/ev_port.c | 0 code/src/{common => c-utils}/libev/ev_select.c | 0 code/src/{common => c-utils}/libev/ev_vars.h | 0 code/src/{common => c-utils}/libev/ev_win32.c | 0 code/src/{common => c-utils}/libev/ev_wrap.h | 0 code/src/{common => c-utils}/libev/event.c | 0 code/src/{common => c-utils}/libev/event.h | 0 code/src/c-utils/libev/module.mk.in | 9 + code/src/{common => c-utils}/lookup3.c | 2 +- code/src/c-utils/module.mk.in | 3 + code/{ => src/c-utils}/prepare | 2 +- code/src/{common => c-utils}/triton-base.h | 2 +- code/src/{common => c-utils}/triton-hash.h | 8 +- code/src/{common => c-utils}/triton-list.h | 2 +- code/src/{common => c-utils}/triton-string.c | 2 +- code/src/{common => c-utils}/triton-string.h | 4 +- code/src/{common => c-utils}/triton-thread.h | 2 +- code/src/{common => c-utils}/triton-uint128.h | 2 +- code/src/common/.triton-hash.h.swp | Bin 16572 -> 0 bytes code/src/common/libev/module.mk.in | 14 - code/src/common/module.mk.in | 7 - 45 files changed, 470 insertions(+), 53 deletions(-) create mode 100644 code/src/c-utils/Makefile.in copy code/{maint => src/c-utils}/config/libev.m4 (100%) copy code/{maint => src/c-utils}/config/unix.m4 (100%) create mode 100644 code/src/c-utils/configure.ac copy code/{maint => src/c-utils}/depend.sh (100%) rename code/src/{common => c-utils}/jenkins-hash.h (100%) rename code/src/{common => c-utils}/libev/README (100%) rename code/src/{common => c-utils}/libev/ev++.h (100%) rename code/src/{common => c-utils}/libev/ev.c (100%) rename code/src/{common => c-utils}/libev/ev.h (100%) rename code/src/{common => c-utils}/libev/ev_epoll.c (100%) rename code/src/{common => c-utils}/libev/ev_kqueue.c (100%) rename code/src/{common => c-utils}/libev/ev_poll.c (100%) rename code/src/{common => c-utils}/libev/ev_port.c (100%) rename code/src/{common => c-utils}/libev/ev_select.c (100%) rename code/src/{common => c-utils}/libev/ev_vars.h (100%) rename code/src/{common => c-utils}/libev/ev_win32.c (100%) rename code/src/{common => c-utils}/libev/ev_wrap.h (100%) rename code/src/{common => c-utils}/libev/event.c (100%) rename code/src/{common => c-utils}/libev/event.h (100%) create mode 100644 code/src/c-utils/libev/module.mk.in rename code/src/{common => c-utils}/lookup3.c (99%) create mode 100644 code/src/c-utils/module.mk.in copy code/{ => src/c-utils}/prepare (61%) rename code/src/{common => c-utils}/triton-base.h (99%) rename code/src/{common => c-utils}/triton-hash.h (98%) rename code/src/{common => c-utils}/triton-list.h (99%) rename code/src/{common => c-utils}/triton-string.c (70%) rename code/src/{common => c-utils}/triton-string.h (98%) rename code/src/{common => c-utils}/triton-thread.h (98%) rename code/src/{common => c-utils}/triton-uint128.h (98%) delete mode 100644 code/src/common/.triton-hash.h.swp delete mode 100644 code/src/common/libev/module.mk.in delete mode 100644 code/src/common/module.mk.in Diff of changes: diff --git a/code/Makefile.in b/code/Makefile.in index f119bc7..07c42af 100644 --- a/code/Makefile.in +++ b/code/Makefile.in @@ -67,7 +67,7 @@ ifneq (0,$(VALGRIND_CLEAN)) CPPFLAGS += -DVALGRIND_CLEAN -DVALGRIND endif -CFLAGS= -I$(srcdir)/include -I. -I$(srcdir) @DB_CFLAGS@ @CFLAGS@ $(CPPFLAGS) +CFLAGS= -I$(srcdir)/src/c-utils -I$(srcdir)/include -I. -I$(srcdir) @DB_CFLAGS@ @CFLAGS@ $(CPPFLAGS) # enable relocatable #CFLAGS += -fPIC @@ -98,8 +98,8 @@ LIBCFLAGS=@LIBCFLAGS@ # in the module.mk.in because we need it to take effect when the .d file is # generated as well. LIBCFLAGS += -DEV_CONFIG_H=\"triton-config.h\" -LDFLAGS += @LDFLAGS@ -LIBS += @LIBS@ -lcrypto +LDFLAGS += @LDFLAGS@ -L$(srcdir)/src/c-utils +LIBS += @LIBS@ -lcrypto -lc-utils -lm DEPLIBS += @THREAD_LIB@ @@ -197,7 +197,7 @@ endif # MODULES is a list of subdirectories that we wish to operate on. # They are identified by the presence of module.mk files (makefile # includes). -MODULES := $(shell find src doc -name "*.mk" | sed -e 's/^.\///;s/module.mk//') +MODULES := $(shell find src/aesop -name "*.mk" | sed -e 's/^.\///;s/module.mk//') ################################################################ diff --git a/code/configure.ac b/code/configure.ac index a9a55f3..75b39ff 100644 --- a/code/configure.ac +++ b/code/configure.ac @@ -370,14 +370,11 @@ AC_CONFIG_FILES([maint/aecc-utils], [chmod +x maint/aecc-utils]) AC_CONFIG_FILES([maint/aecc], [chmod +x maint/aecc]) AC_OUTPUT([Makefile -src/common/module.mk -src/common/libev/module.mk src/aesop/resources/timer/test/module.mk src/aesop/resources/timer/module.mk src/aesop/module.mk src/aesop/tests/module.mk src/aesop/parser/module.mk src/aesop/parser/tests/blocking/module.mk -doc/module.mk ]) diff --git a/code/src/aesop/ae-base.h b/code/src/aesop/ae-base.h index f65fc8c..1050fe3 100644 --- a/code/src/aesop/ae-base.h +++ b/code/src/aesop/ae-base.h @@ -6,6 +6,6 @@ * this header with your own if you want to use Aesop without * Triton. */ -#include "src/common/triton-base.h" +#include "triton-base.h" #endif diff --git a/code/src/aesop/ae-list.h b/code/src/aesop/ae-list.h index e3344f5..b68df66 100644 --- a/code/src/aesop/ae-list.h +++ b/code/src/aesop/ae-list.h @@ -6,7 +6,7 @@ * this header with your own if you want to use Aesop without * Triton. */ -#include "src/common/triton-list.h" +#include "triton-list.h" typedef triton_list_t ae_list_t; typedef triton_list_link_t ae_list_link_t; diff --git a/code/src/aesop/ae-thread.h b/code/src/aesop/ae-thread.h index 8674b0c..eeb133b 100644 --- a/code/src/aesop/ae-thread.h +++ b/code/src/aesop/ae-thread.h @@ -6,7 +6,7 @@ * you want to use Aesop without Triton, replace the * following macros with your own. */ -#include "src/common/triton-thread.h" +#include "triton-thread.h" typedef triton_mutex_t ae_mutex_t; #define ae_mutex_init triton_mutex_init diff --git a/code/src/aesop/ae-types.h b/code/src/aesop/ae-types.h index 0dbc205..f880957 100644 --- a/code/src/aesop/ae-types.h +++ b/code/src/aesop/ae-types.h @@ -7,8 +7,8 @@ * want to use Triton. */ -#include "src/common/triton-string.h" -#include "src/common/triton-uint128.h" +#include "triton-string.h" +#include "triton-uint128.h" #define ae_op_id_t uint128_t #define ae_op_id_clear triton_uint128_setzero diff --git a/code/src/aesop/hints.c b/code/src/aesop/hints.c index ee00aaa..5575ad4 100644 --- a/code/src/aesop/hints.c +++ b/code/src/aesop/hints.c @@ -1,9 +1,9 @@ #include "src/aesop/ae-error.h" #include "src/aesop/hints.h" -#include "src/common/triton-hash.h" -#include "src/common/jenkins-hash.h" -#include "src/common/triton-list.h" +#include "triton-hash.h" +#include "jenkins-hash.h" +#include "triton-list.h" /** * hint info structure for static hint definitions. diff --git a/code/src/aesop/opcache.c b/code/src/aesop/opcache.c index 1a16bee..0a420f4 100644 --- a/code/src/aesop/opcache.c +++ b/code/src/aesop/opcache.c @@ -1,6 +1,6 @@ #include "src/aesop/aesop.h" #include "src/aesop/opcache.h" -#include "src/common/jenkins-hash.h" +#include "jenkins-hash.h" #include <errno.h> #include <opa_primitives.h> diff --git a/code/src/aesop/parser/tests/blocking/btest-impl.c b/code/src/aesop/parser/tests/blocking/btest-impl.c index efd1c10..8c39a17 100644 --- a/code/src/aesop/parser/tests/blocking/btest-impl.c +++ b/code/src/aesop/parser/tests/blocking/btest-impl.c @@ -5,7 +5,7 @@ #include <assert.h> #include <pthread.h> #include "src/aesop/aesop.h" -#include "src/common/triton-list.h" +#include "triton-list.h" #include "src/aesop/parser/tests/blocking/btest.h" #define RESOURCE_NAME "btest" diff --git a/code/src/aesop/resource.c b/code/src/aesop/resource.c index b07f3b6..778f8ba 100644 --- a/code/src/aesop/resource.c +++ b/code/src/aesop/resource.c @@ -1,4 +1,4 @@ -#include "src/common/libev/ev.h" +#include "libev/ev.h" #include <stddef.h> #include <unistd.h> #include <fcntl.h> diff --git a/code/src/aesop/resources/timer/timer.c b/code/src/aesop/resources/timer/timer.c index 310f249..6bed882 100644 --- a/code/src/aesop/resources/timer/timer.c +++ b/code/src/aesop/resources/timer/timer.c @@ -11,7 +11,7 @@ #include "src/aesop/op.h" #include "src/aesop/opcache.h" #include "src/aesop/resources/timer/timer.h" -#include "src/common/libev/ev.h" +#include "libev/ev.h" /* NOTES: * diff --git a/code/src/c-utils/Makefile.in b/code/src/c-utils/Makefile.in new file mode 100644 index 0000000..e2559a2 --- /dev/null +++ b/code/src/c-utils/Makefile.in @@ -0,0 +1,306 @@ +############################################################### +# General documentation +# +# This is a single makefile that runs the entire c-utils build +# process. There are no makefiles in subdirectories. For a +# general introduction to this approach, please read this document +# by Peter Miller: +# +# http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html +# +# Each subdirectory contains a module.mk file that gets included +# when make is executed. These module.mk files tell make about the +# files in each subdirectory that must be built, including any +# special case rules. Make uses this information to generate a +# sinle dependency graph and orchestrate the build process from this +# top level directory. +# +# We categorize our source depending on what it will be used for. +# For example, there are lists of source files for building the +# server, building the library, building documentation, etc. +# + +############################################################### +# Generic makefile setup + +# define a few generic variables that we need to use; DESTDIR may +# be overridden on the command line during make install +DESTDIR = +srcdir = @srcdir@ +abs_srcdir = @abs_srcdir@ +builddir = @BUILD_ABSOLUTE_TOP@ +prefix = @prefix@ +datarootdir = @datarootdir@ +exec_prefix = @exec_prefix@ +includedir = $(DESTDIR)@includedir@ +mandir = $(DESTDIR)@mandir@ +sbindir = $(DESTDIR)@sbindir@ +bindir = $(DESTDIR)@bindir@ +libdir = $(DESTDIR)@libdir@ + +# subdirs that contain configure/make +# SUBDIRS = @subdirs@ + +VPATH = $(srcdir) + +CC = @CC@ +LD = @LD@ +BUILD_CC = @BUILD_CC@ +BUILD_LD = @BUILD_LD@ +BUILD_CFLAGS = @BUILD_CFLAGS@ +BUILD_LDFLAGS = @BUILD_LDFLAGS@ + +STRICT_CFLAGS = @STRICT_CFLAGS@ +VALGRIND_CLEAN = @VALGRIND_CLEAN@ +CPPFLAGS = @CPPFLAGS@ + +ifneq (0,$(VALGRIND_CLEAN)) + CPPFLAGS += -DVALGRIND_CLEAN -DVALGRIND +endif + +CFLAGS= -I$(srcdir)/include -I. -I$(srcdir) @CFLAGS@ $(CPPFLAGS) + +CWARNS= +ifneq (0,$(STRICT_CFLAGS)) + CWARNS += -Wcast-align -Wbad-function-cast + CWARNS += -Wmissing-prototypes -Wmissing-declarations + CWARNS += -Wundef -Wpointer-arith + CWARNS += -Wnested-externs + CWARNS += -Wredundant-decls + # Very noisy, too strict + CWARNS += -W -Wno-unused-label -Wno-sign-compare + CWARNS += -Wcast-qual + CWARNS += -Wshadow + CWARNS += -Wwrite-strings + CWARNS += -Wformat +endif + +# don't want to warn when we call format functions without string literal parameters +# e.g. triton_string_init(&str, myname); +CWARNS += -Wno-format-security + +LDSHARED = $(TCC) -shared + +# tell libev to use our config.h instead of its own; we can't just put this +# in the module.mk.in because we need it to take effect when the .d file is +# generated as well. +LIBCFLAGS += -DEV_CONFIG_H=\"c-utils-config.h\" +LDFLAGS += @LDFLAGS@ +LIBS += @LIBS@ + +DEPLIBS += @THREAD_LIB@ + +CPPDEFS=$(filter -D%,$(LIBCFLAGS) $(CFLAGS)) +CPPINCS=$(filter -I%,$(LIBCFLAGS) $(CFLAGS)) + +USE_DYLIBS = @USE_DYLIBS@ + +LIBSRC := + +# Eliminate all default suffixes. We want explicit control. +.SUFFIXES: + +QUIET_COMPILE = @QUIET_COMPILE@ +WARNINGS_AS_ERRORS = @WARNINGS_AS_ERRORS@ + +ifdef V + QUIET_COMPILE = 0 +endif + +ifdef W + ifeq ($(W),1) + WARNINGS_AS_ERRORS = 1 + else + WARNINGS_AS_ERRORS = 0 + endif +endif + +ifdef D + DA="-l" +else + DA= +endif + +ifeq ($(QUIET_COMPILE),1) + # say a one-line description of the action, do not echo the command + Q=@echo + E=@ + VA= +else + # do not say the short Q lines, but do echo the entire command + Q=@echo >/dev/null + E= + VA="-v" +endif + +ifeq ($(WARNINGS_AS_ERRORS),1) + EWARNS = -Werror +else + EWARNS = +endif + +# PHONY targets are targets that do not result in the generation +# of a file that has the same name as the target. Listing them +# here keeps make from accidentally doing too much work (see GNU +# make manual). +.PHONY: all clean + +################################################################ +# Find project subdirectories + +# MODULES is a list of subdirectories that we wish to operate on. +# They are identified by the presence of module.mk files (makefile +# includes). +MODULES := $(shell find . -name "*.mk" | sed -e 's/^.\///;s/module.mk//') + + +################################################################ +# Default target forward pointer, to avoid other targets in make stubs +all:: + +################################################################ +# Makefile includes + +# this is how we pull build information from all of the project +# subdirectories, make sure to catch top level module.mk as well +include $(patsubst %, %/module.mk, $(MODULES)) module.mk + +# Just like dir, but strip the slash off the end, to be pretty. +dirname = $(patsubst %/,%,$(dir $(1))) + +# Generate the canonical in-tree location of a file, given a possible out +# of tree reference. +canonname = $(patsubst $(srcdir)/%,%,$(call dirname,$(1))) + +canonfname = $(patsubst $(srcdir)/%,%,$(1)) + +# the "lastword" function is more concise, but not available on +# older versions of GNU Make +# bname = $(lastword $(subst /, ,$(1))) +bname = $(word $(words $(subst /, ,$(1))),$(subst /, ,$(1))) + +canondirname = $(subst /,_,$(1)) + +################################################################ +# Derived file lists + +# NOTES: At this point, the subdirectory makefile includes have informed +# us what the source files are. Now we want to generate some +# other lists (such as objects, executables, and dependency files) +# by manipulating the lists of source files + +# Grab any CFLAGS defined by the make stub for a particular file, and +# for the directory in which the source resides. +# Similar for ldflags. +modcflags = $(MODCFLAGS_$(call canonname,$(1))) \ + $(MODCFLAGS_$(patsubst $(srcdir)/%,%,$(1))) + +MODCFLAGS_AER = $(call modcflags,$(1)) +MODCFLAGS_AE = $(call modcflags,$(1)) +MODCFLAGS_C = $(call modcflags,$(1)) + +modldflags = $(MODLDFLAGS_$(call canonname,$(1))) \ + $(MODLDFLAGS_$(patsubst $(srcdir)/%,%,$(1))) + +MODLDFLAGS_AER = $(call modldflags,$(1)) +MODLDFLAGS_AE = $(call modldflags,$(1)) +MODLDFLAGS_C = $(call modldflags,$(1)) + +modlibs = $(MODLIBS_$(call canonname,$(1))) \ + $(MODLIBS_$(patsubst $(srcdir)/%,%,$(1))) + +MODLIBS_AER = $(call modlibs,$(1)) +MODLIBS_AE = $(call modlibs,$(1)) +MODLIBS_C = $(call modlibs,$(1)) + +modname = $(MODNAME_$(call canonname,$(1))) \ + $(MODNAME_$(patsubst $(srcdir)/%,%,$(1))) + +# use TCC variable so that we can keep CC as the system compiler +TCC = $(if $(MPICC),$(MPICC),$(CC)) +CPPCC = $(CC) + +modcc = $(if $(MODCC_$(1)),$(MODCC_$(1)),$(TCC)) + +MCC_AER = $(call modcc,$(1)) +MCC_AE = $(call modcc,$(1)) +MCC_C = $(call modcc,$(1)) + +# The object files for the library generated from .c files +LIBOBJS=$(patsubst %.c,%.o,$(LIBSRC)) +LIBDEPS=$(patsubst %.c,%.d,$(LIBSRC)) + +DEPENDS=$(LIBDEPS) + +# for now we just use static if we're not on a mac +ifneq (,$(USE_DYLIBS)) +LIBRARIES=libc-utils.dylib +else +LIBRARIES=libc-utils.a +endif + +#################################################################### +# Rules and dependencies + +# Normal rules + +$(LIBOBJS): %.o: %.c + $(Q) " CC $@" + $(E)$(call MCC_C,$*) -c -o $@ \ + $(LIBCFLAGS) $(CFLAGS) $(CWARNS) \ + $(call MODCFLAGS_C,$*) $< + + +# Auto-generated dependencies for .c files +$(LIBDEPS): %.d: %.c + $(Q) " DEP $@" + $(E)CC="$(call MCC_C,$*)" $(srcdir)/depend.sh $(call dirname,$*) $(LIBCFLAGS) $(CFLAGS) $(call MODCFLAGS_C,$*) $< > $@ + +libc-utils.a: $(LIBOBJS) + $(Q) " RANLIB $@" + $(E)ar rcs $@ $(LIBOBJS) + +# shared objects + +libtriton.so: $(LIBOBJS) + $(Q) " LDSO $@" + $(E)$(LDSHARED) -Wl,-soname,libtriton.so -o $@ $(LIBOBJS) + +libtriton.dylib: $(LIBOBJS) + $(Q) " DYLIB $@" + $(E)$(TCC) -o libtriton.dylib -dynamiclib -current_version 0.0.1 -install_name lib/libtriton.0.0.1.dylib \ + $(LIBOBJS) $(DEPLIBS) + +# User targets + +all:: $(LIBRARIES) + +clean:: + $(Q) " CLEAN" + $(E)rm -f $(LIBOBJS) $(LIBRARIES) $(DEPENDS) + +# this is where we include all of our automatic dependencies. +# NOTE: we wrap this in ifneq's in order to prevent the dependencies +# from being generated for special targets that don't require them +ifeq (,$(filter clean nodep,$(MAKECMDGOALS))) +-include $(DEPENDS) +endif +# add this as a make goal to disable rebuilding deps +.PHONY: nodep +.nodep:; @: + +# rule for generating cscope information +cscope: + find @SRC_ABSOLUTE_TOP@ -regex ".*\.\(c\|h\|ae\|hae\|aer\|haer\)" -o -iname "*.sm" \ + > $(srcdir)/cscope.files + ( cd @SRC_ABSOLUTE_TOP@; cscope -be -i @SRC_ABSOLUTE_TOP@/cscope.files ) + +tags:: + find @SRC_ABSOLUTE_TOP@ -regex ".*\.\(c\|h\|ae\|hae\|aer\|haer\)" | ctags -L- --excmd=pattern -B --extra=+f --langmap=c:+.ae.aer.hae.haer -I pwait,pbranch -f @SRC_ABSOLUTE_TOP@/tags + +etags: +# Note: this only reads src and prunes the test directories + cd @SRC_ABSOLUTE_TOP@ ; find src \ + -name test -prune -o -name tests -prune -o \ + -regex ".*\.\(c\|h\|ae\|hae\|aer\|haer\)" -print \ + | xargs etags diff --git a/code/maint/config/libev.m4 b/code/src/c-utils/config/libev.m4 similarity index 100% copy from code/maint/config/libev.m4 copy to code/src/c-utils/config/libev.m4 diff --git a/code/maint/config/unix.m4 b/code/src/c-utils/config/unix.m4 similarity index 100% copy from code/maint/config/unix.m4 copy to code/src/c-utils/config/unix.m4 diff --git a/code/src/c-utils/configure.ac b/code/src/c-utils/configure.ac new file mode 100644 index 0000000..8183a25 --- /dev/null +++ b/code/src/c-utils/configure.ac @@ -0,0 +1,123 @@ +dnl ************************************************************** +dnl +dnl Process this file with autoconf to produce a configure script. +dnl You may need to use autoheader as well if changing any DEFINEs + +AC_PREREQ(2.50) +AC_INIT(c-utils, 0.0.1, [email protected]) + +AC_CONFIG_HEADER(c-utils-config.h) + +AC_PROG_CC + +AC_CHECK_SIZEOF([long int]) + +dnl ====================================================================== +dnl Try harder to be valgrind safe +dnl ====================================================================== +AC_ARG_ENABLE(valgrind-clean, + [AS_HELP_STRING( + [--enable-valgrind-clean], + [Try harder to avoid valgrind warnings]) + ]) + +VALGRIND_CLEAN=0 +AS_IF([test "x$enable_valgrind_clean" = "xyes"], [ + VALGRIND_CLEAN=1 +]) +AC_SUBST(VALGRIND_CLEAN) + +dnl ========================================================================= +dnl == Google's PerfTools =================================================== +dnl ========================================================================= + +AC_ARG_WITH(perftools, + AS_HELP_STRING([--with-perftools=dir], + [Location of google perftools installation]), + PERFTOOL_DIR="$withval",PERFTOOL_DIR="") + +if test -n "$PERFTOOL_DIR" ; +then + CPPFLAGS="$CPPFLAGS -I${PERFTOOL_DIR}/include" + LDFLAGS="$LDFLAGS -L${PERFTOOL_DIR}/lib" +fi + +if test -n "$PERFTOOL_DIR" ; +then +use_perftools=1 +else +use_perftools= +fi + +AC_CHECK_HEADERS([google/tcmalloc.h],[], + [use_perftools=]) + +if test -n "$use_perftools"; then +AC_CHECK_LIB([tcmalloc],[tc_new],[],[use_perftools=]) +AC_CHECK_LIB([profiler],[ProfilerStart], [], [use_perftools=]) +fi + +AC_MSG_CHECKING([if Google Perftools are used]) +if test "x${use_perftools}" == "x1" ; then + AC_DEFINE([HAVE_PERFTOOLS], [1], [If google perftools are available]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi + +dnl todo: add check making sure that if the user manually enabled perftools +dnl and we cannot find them we complain + +dnl check for unix variants +AX_UNIX("") + +BUILD_ABSOLUTE_TOP=${PWD} +SRC_RELATIVE_TOP=$srcdir +SRC_ABSOLUTE_TOP=`cd $srcdir; pwd` + +AC_SUBST(BUILD_ABSOLUTE_TOP) +AC_SUBST(SRC_RELATIVE_TOP) +AC_SUBST(SRC_ABSOLUTE_TOP) + +AC_SUBST(CFLAGS) +AC_SUBST(LDFLAGS) +AC_SUBST(LIBS) +AC_SUBST(CPPFLAGS) + +AC_ARG_ENABLE(verbose, +[ --enable-verbose Enables verbose output during build process], +QUIET_COMPILE=0, +QUIET_COMPILE=1) +AC_SUBST(QUIET_COMPILE) + +AC_ARG_ENABLE(error-on-warning, +[ --enable-error-on-warning Generate compiler error on warnings], +WARNINGS_AS_ERRORS=1, +WARNINGS_AS_ERRORS=0) +AC_SUBST(WARNINGS_AS_ERRORS) + +STRICT_CFLAGS=1 +AC_ARG_ENABLE(strict, +[ --disable-strict Turn off strict compiler warnings], +[if test "x$enableval" = "xno" ; then + STRICT_CFLAGS=0 +fi], +[ + STRICT_CFLAGS=1 +]) +AC_SUBST(STRICT_CFLAGS) + +AC_ARG_ENABLE(coverage, +[ --enable-coverage Enable coverage analysis (disables optimizations)], +[ CFLAGS="$CFLAGS -g -pg -ftest-coverage -O0" + ENABLE_COVERAGE=1], +) +AC_SUBST(ENABLE_COVERAGE) + +m4_include([config/libev.m4]) + +AC_OUTPUT([Makefile +module.mk +libev/module.mk +]) + diff --git a/code/maint/depend.sh b/code/src/c-utils/depend.sh similarity index 100% copy from code/maint/depend.sh copy to code/src/c-utils/depend.sh diff --git a/code/src/common/jenkins-hash.h b/code/src/c-utils/jenkins-hash.h similarity index 100% rename from code/src/common/jenkins-hash.h rename to code/src/c-utils/jenkins-hash.h diff --git a/code/src/common/libev/README b/code/src/c-utils/libev/README similarity index 100% rename from code/src/common/libev/README rename to code/src/c-utils/libev/README diff --git a/code/src/common/libev/ev++.h b/code/src/c-utils/libev/ev++.h similarity index 100% rename from code/src/common/libev/ev++.h rename to code/src/c-utils/libev/ev++.h diff --git a/code/src/common/libev/ev.c b/code/src/c-utils/libev/ev.c similarity index 100% rename from code/src/common/libev/ev.c rename to code/src/c-utils/libev/ev.c diff --git a/code/src/common/libev/ev.h b/code/src/c-utils/libev/ev.h similarity index 100% rename from code/src/common/libev/ev.h rename to code/src/c-utils/libev/ev.h diff --git a/code/src/common/libev/ev_epoll.c b/code/src/c-utils/libev/ev_epoll.c similarity index 100% rename from code/src/common/libev/ev_epoll.c rename to code/src/c-utils/libev/ev_epoll.c diff --git a/code/src/common/libev/ev_kqueue.c b/code/src/c-utils/libev/ev_kqueue.c similarity index 100% rename from code/src/common/libev/ev_kqueue.c rename to code/src/c-utils/libev/ev_kqueue.c diff --git a/code/src/common/libev/ev_poll.c b/code/src/c-utils/libev/ev_poll.c similarity index 100% rename from code/src/common/libev/ev_poll.c rename to code/src/c-utils/libev/ev_poll.c diff --git a/code/src/common/libev/ev_port.c b/code/src/c-utils/libev/ev_port.c similarity index 100% rename from code/src/common/libev/ev_port.c rename to code/src/c-utils/libev/ev_port.c diff --git a/code/src/common/libev/ev_select.c b/code/src/c-utils/libev/ev_select.c similarity index 100% rename from code/src/common/libev/ev_select.c rename to code/src/c-utils/libev/ev_select.c diff --git a/code/src/common/libev/ev_vars.h b/code/src/c-utils/libev/ev_vars.h similarity index 100% rename from code/src/common/libev/ev_vars.h rename to code/src/c-utils/libev/ev_vars.h diff --git a/code/src/common/libev/ev_win32.c b/code/src/c-utils/libev/ev_win32.c similarity index 100% rename from code/src/common/libev/ev_win32.c rename to code/src/c-utils/libev/ev_win32.c diff --git a/code/src/common/libev/ev_wrap.h b/code/src/c-utils/libev/ev_wrap.h similarity index 100% rename from code/src/common/libev/ev_wrap.h rename to code/src/c-utils/libev/ev_wrap.h diff --git a/code/src/common/libev/event.c b/code/src/c-utils/libev/event.c similarity index 100% rename from code/src/common/libev/event.c rename to code/src/c-utils/libev/event.c diff --git a/code/src/common/libev/event.h b/code/src/c-utils/libev/event.h similarity index 100% rename from code/src/common/libev/event.h rename to code/src/c-utils/libev/event.h diff --git a/code/src/c-utils/libev/module.mk.in b/code/src/c-utils/libev/module.mk.in new file mode 100644 index 0000000..7a3ec40 --- /dev/null +++ b/code/src/c-utils/libev/module.mk.in @@ -0,0 +1,9 @@ +DIR := libev + +# note: the other .c files in this directory are included automatically by +# ev.c as needed; don't compile them explicitly +LIBSRC += $(DIR)/ev.c \ + $(DIR)/event.c + +# turn off warnings for libev compile +MODCFLAGS_$(DIR) = -w diff --git a/code/src/common/lookup3.c b/code/src/c-utils/lookup3.c similarity index 99% rename from code/src/common/lookup3.c rename to code/src/c-utils/lookup3.c index 432e977..f3d8fa4 100644 --- a/code/src/common/lookup3.c +++ b/code/src/c-utils/lookup3.c @@ -1,5 +1,5 @@ -#include "src/common/jenkins-hash.h" +#include "jenkins-hash.h" /* ------------------------------------------------------------------------------- diff --git a/code/src/c-utils/module.mk.in b/code/src/c-utils/module.mk.in new file mode 100644 index 0000000..77ed362 --- /dev/null +++ b/code/src/c-utils/module.mk.in @@ -0,0 +1,3 @@ +LIBSRC += triton-string.c \ + lookup3.c + diff --git a/code/prepare b/code/src/c-utils/prepare similarity index 61% copy from code/prepare copy to code/src/c-utils/prepare index ede73f4..573c075 100755 --- a/code/prepare +++ b/code/src/c-utils/prepare @@ -1,6 +1,6 @@ #!/bin/sh -if aclocal --force -I ./maint/config && autoheader -f && autoconf -f; then +if aclocal --force -I ./config && autoheader -f && autoconf -f; then echo "configure script successfully regenerated" else echo "some part of configure regeneration failed" diff --git a/code/src/common/triton-base.h b/code/src/c-utils/triton-base.h similarity index 99% rename from code/src/common/triton-base.h rename to code/src/c-utils/triton-base.h index 871369c..b33c233 100644 --- a/code/src/common/triton-base.h +++ b/code/src/c-utils/triton-base.h @@ -1,7 +1,7 @@ #ifndef __TRITON_BASE_H__ #define __TRITON_BASE_H__ -#include "triton-config.h" +#include "c-utils-config.h" /** * triton-base.h includes important system headers and defines appropriate diff --git a/code/src/common/triton-hash.h b/code/src/c-utils/triton-hash.h similarity index 98% rename from code/src/common/triton-hash.h rename to code/src/c-utils/triton-hash.h index ad2772d..df633b3 100644 --- a/code/src/common/triton-hash.h +++ b/code/src/c-utils/triton-hash.h @@ -8,10 +8,10 @@ #include <errno.h> -#include "src/common/triton-list.h" -#include "src/common/triton-string.h" -#include "src/common/triton-thread.h" -#include "src/common/jenkins-hash.h" +#include "triton-list.h" +#include "triton-string.h" +#include "triton-thread.h" +#include "jenkins-hash.h" #define triton_hash_link triton_list_link diff --git a/code/src/common/triton-list.h b/code/src/c-utils/triton-list.h similarity index 99% rename from code/src/common/triton-list.h rename to code/src/c-utils/triton-list.h index 685942b..608c9d9 100644 --- a/code/src/common/triton-list.h +++ b/code/src/c-utils/triton-list.h @@ -1,7 +1,7 @@ #ifndef __TRITON_LIST_H__ #define __TRITON_LIST_H__ -#include "src/common/triton-base.h" +#include "triton-base.h" typedef struct triton_list triton_list_t; diff --git a/code/src/common/triton-string.c b/code/src/c-utils/triton-string.c similarity index 70% rename from code/src/common/triton-string.c rename to code/src/c-utils/triton-string.c index db094bc..796e236 100644 --- a/code/src/common/triton-string.c +++ b/code/src/c-utils/triton-string.c @@ -1,4 +1,4 @@ -#include "src/common/triton-string.h" +#include "triton-string.h" triton_string_t triton_string_null = { .size = 0, .string = NULL, .const_string = NULL }; diff --git a/code/src/common/triton-string.h b/code/src/c-utils/triton-string.h similarity index 98% rename from code/src/common/triton-string.h rename to code/src/c-utils/triton-string.h index fae01a6..e8b7179 100644 --- a/code/src/common/triton-string.h +++ b/code/src/c-utils/triton-string.h @@ -1,8 +1,8 @@ #ifndef __TRITON_STRING_H__ #define __TRITON_STRING_H__ -#include "src/common/jenkins-hash.h" -#include "src/common/triton-thread.h" +#include "jenkins-hash.h" +#include "triton-thread.h" /** * The triton_string_t is a null-terminated string. Used for encoding diff --git a/code/src/common/triton-thread.h b/code/src/c-utils/triton-thread.h similarity index 98% rename from code/src/common/triton-thread.h rename to code/src/c-utils/triton-thread.h index 40dbfc1..bf14f61 100644 --- a/code/src/common/triton-thread.h +++ b/code/src/c-utils/triton-thread.h @@ -1,7 +1,7 @@ #ifndef __TRITON_THREAD_H__ #define __TRITON_THREAD_H__ -#include "src/common/triton-base.h" +#include "triton-base.h" #ifdef __TRITON_POSIX_LOCKING__ #include <pthread.h> diff --git a/code/src/common/triton-uint128.h b/code/src/c-utils/triton-uint128.h similarity index 98% rename from code/src/common/triton-uint128.h rename to code/src/c-utils/triton-uint128.h index 519f8a7..abb598f 100644 --- a/code/src/common/triton-uint128.h +++ b/code/src/c-utils/triton-uint128.h @@ -4,7 +4,7 @@ #include <stdio.h> #include <assert.h> -#include "src/common/triton-base.h" +#include "triton-base.h" /* unsigned 128 bit integer type */ typedef struct { uint64_t l; uint64_t u; } uint128_t; diff --git a/code/src/common/.triton-hash.h.swp b/code/src/common/.triton-hash.h.swp deleted file mode 100644 index d7ee31b..0000000 Binary files a/code/src/common/.triton-hash.h.swp and /dev/null differ diff --git a/code/src/common/libev/module.mk.in b/code/src/common/libev/module.mk.in deleted file mode 100644 index 0fa8213..0000000 --- a/code/src/common/libev/module.mk.in +++ /dev/null @@ -1,14 +0,0 @@ -DIR := src/common/libev - -# note: the other .c files in this directory are included automatically by -# ev.c as needed; don't compile them explicitly -LIBSRC += $(DIR)/ev.c \ - $(DIR)/event.c - -# Tell libev to use our config.h instead of its own. -# This is in the top level makefile now so that it catches the dependency -# generation step as well. -# MODCFLAGS_$(DIR) = -DEV_CONFIG_H=\"triton-config.h\" -w - -# turn off warnings for libev compile -MODCFLAGS_$(DIR) = -w diff --git a/code/src/common/module.mk.in b/code/src/common/module.mk.in deleted file mode 100644 index f434d4d..0000000 --- a/code/src/common/module.mk.in +++ /dev/null @@ -1,7 +0,0 @@ -DIR := src/common - -LIBSRC += $(DIR)/triton-string.c \ - $(DIR)/lookup3.c - -COMMONDIR := src/common - hooks/post-receive -- Triton Repository
participants (1)
-
noreply@mcs.anl.gov