From 6893800a4d1cc14dff0395ddcd660a5138db183d Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 23 Jun 2016 13:39:39 -0400 Subject: [PATCH] Cleanup: Re-organise source dir Re-organise the sources, add a top level "src" and "include" dir and move relevant files. Disable autotools automated includes and define them manually. This fixes problems with collision of header names with system headers. Include the autoconf config.h in the default includes and remove it where it's explicitely included. Remove _GNU_SOURCE defines since it's detected at configure for platforms that requires it and added to the config.h. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers --- .gitignore | 10 +-- Makefile.am | 89 ++----------------- configure.ac | 38 ++++---- doc/examples/Makefile.am | 2 +- include/Makefile.am | 17 ++++ {urcu => include/urcu}/arch/aarch64.h | 0 {urcu => include/urcu}/arch/alpha.h | 0 {urcu => include/urcu}/arch/arm.h | 0 {urcu => include/urcu}/arch/gcc.h | 0 {urcu => include/urcu}/arch/generic.h | 0 {urcu => include/urcu}/arch/hppa.h | 0 {urcu => include/urcu}/arch/ia64.h | 0 {urcu => include/urcu}/arch/mips.h | 0 {urcu => include/urcu}/arch/nios2.h | 0 {urcu => include/urcu}/arch/ppc.h | 0 {urcu => include/urcu}/arch/s390.h | 0 {urcu => include/urcu}/arch/sparc64.h | 0 {urcu => include/urcu}/arch/tile.h | 0 {urcu => include/urcu}/arch/unknown.h | 0 {urcu => include/urcu}/arch/x86.h | 0 {urcu => include/urcu}/cds.h | 0 {urcu => include/urcu}/compiler.h | 0 {urcu => include/urcu}/config.h.in | 0 {urcu => include/urcu}/debug.h | 0 {urcu => include/urcu}/futex.h | 0 {urcu => include/urcu}/hlist.h | 0 {urcu => include/urcu}/lfstack.h | 0 {urcu => include/urcu}/list.h | 0 {urcu => include/urcu}/map/urcu-bp.h | 0 {urcu => include/urcu}/map/urcu-qsbr.h | 0 {urcu => include/urcu}/map/urcu.h | 0 {urcu => include/urcu}/rand-compat.h | 0 {urcu => include/urcu}/rcuhlist.h | 0 {urcu => include/urcu}/rculfhash.h | 0 {urcu => include/urcu}/rculfqueue.h | 0 {urcu => include/urcu}/rculfstack.h | 0 {urcu => include/urcu}/rculist.h | 0 {urcu => include/urcu}/ref.h | 0 {urcu => include/urcu}/static/lfstack.h | 0 {urcu => include/urcu}/static/rculfqueue.h | 0 {urcu => include/urcu}/static/rculfstack.h | 0 {urcu => include/urcu}/static/urcu-bp.h | 0 {urcu => include/urcu}/static/urcu-pointer.h | 0 {urcu => include/urcu}/static/urcu-qsbr.h | 0 {urcu => include/urcu}/static/urcu.h | 0 {urcu => include/urcu}/static/wfcqueue.h | 0 {urcu => include/urcu}/static/wfqueue.h | 0 {urcu => include/urcu}/static/wfstack.h | 0 {urcu => include/urcu}/syscall-compat.h | 0 {urcu => include/urcu}/system.h | 0 {urcu => include/urcu}/tls-compat.h | 0 {urcu => include/urcu}/uatomic/aarch64.h | 0 {urcu => include/urcu}/uatomic/alpha.h | 0 {urcu => include/urcu}/uatomic/arm.h | 0 {urcu => include/urcu}/uatomic/gcc.h | 0 {urcu => include/urcu}/uatomic/generic.h | 0 {urcu => include/urcu}/uatomic/hppa.h | 0 {urcu => include/urcu}/uatomic/ia64.h | 0 {urcu => include/urcu}/uatomic/mips.h | 0 {urcu => include/urcu}/uatomic/nios2.h | 0 {urcu => include/urcu}/uatomic/ppc.h | 0 {urcu => include/urcu}/uatomic/s390.h | 0 {urcu => include/urcu}/uatomic/sparc64.h | 0 {urcu => include/urcu}/uatomic/tile.h | 0 {urcu => include/urcu}/uatomic/unknown.h | 0 {urcu => include/urcu}/uatomic/x86.h | 0 {urcu => include/urcu}/uatomic_arch.h | 0 {urcu => include/urcu}/urcu-futex.h | 0 {urcu => include/urcu}/urcu_ref.h | 0 {urcu => include/urcu}/wfcqueue.h | 0 {urcu => include/urcu}/wfqueue.h | 0 {urcu => include/urcu}/wfstack.h | 0 src/Makefile.am | 67 ++++++++++++++ compat-getcpu.h => src/compat-getcpu.h | 2 - compat_arch_x86.c => src/compat_arch_x86.c | 0 compat_futex.c => src/compat_futex.c | 0 lfstack.c => src/lfstack.c | 0 liburcu-bp.pc.in => src/liburcu-bp.pc.in | 0 liburcu-cds.pc.in => src/liburcu-cds.pc.in | 0 liburcu-mb.pc.in => src/liburcu-mb.pc.in | 0 liburcu-qsbr.pc.in => src/liburcu-qsbr.pc.in | 0 .../liburcu-signal.pc.in | 0 liburcu.pc.in => src/liburcu.pc.in | 0 .../rculfhash-internal.h | 0 .../rculfhash-mm-chunk.c | 0 .../rculfhash-mm-mmap.c | 0 .../rculfhash-mm-order.c | 0 rculfhash.c => src/rculfhash.c | 2 - rculfqueue.c => src/rculfqueue.c | 0 rculfstack.c => src/rculfstack.c | 0 urcu-bp.c => src/urcu-bp.c | 1 - urcu-bp.h => src/urcu-bp.h | 0 .../urcu-call-rcu-impl.h | 2 - urcu-call-rcu.h => src/urcu-call-rcu.h | 0 urcu-defer-impl.h => src/urcu-defer-impl.h | 0 urcu-defer.h => src/urcu-defer.h | 0 urcu-die.h => src/urcu-die.h | 0 urcu-flavor.h => src/urcu-flavor.h | 0 urcu-pointer.c => src/urcu-pointer.c | 0 urcu-pointer.h => src/urcu-pointer.h | 0 urcu-qsbr.c => src/urcu-qsbr.c | 1 - urcu-qsbr.h => src/urcu-qsbr.h | 0 urcu-wait.h => src/urcu-wait.h | 0 urcu.c => src/urcu.c | 1 - urcu.h => src/urcu.h | 0 wfcqueue.c => src/wfcqueue.c | 0 wfqueue.c => src/wfqueue.c | 0 wfstack.c => src/wfstack.c | 0 tests/benchmark/Makefile.am | 16 ++-- tests/benchmark/test_looplen.c | 1 - tests/benchmark/test_mutex.c | 2 - tests/benchmark/test_perthreadlock.c | 2 - tests/benchmark/test_rwlock.c | 2 - tests/benchmark/test_rwlock_timing.c | 1 - tests/benchmark/test_urcu.c | 2 - tests/benchmark/test_urcu_assign.c | 2 - tests/benchmark/test_urcu_bp.c | 2 - tests/benchmark/test_urcu_defer.c | 2 - tests/benchmark/test_urcu_gc.c | 2 - tests/benchmark/test_urcu_hash.c | 1 - tests/benchmark/test_urcu_hash.h | 1 - tests/benchmark/test_urcu_hash_rw.c | 1 - tests/benchmark/test_urcu_hash_unique.c | 1 - tests/benchmark/test_urcu_lfq.c | 2 - tests/benchmark/test_urcu_lfs.c | 2 - tests/benchmark/test_urcu_lfs_rcu.c | 2 - tests/benchmark/test_urcu_qsbr.c | 2 - tests/benchmark/test_urcu_qsbr_gc.c | 2 - tests/benchmark/test_urcu_wfcq.c | 2 - tests/benchmark/test_urcu_wfq.c | 2 - tests/benchmark/test_urcu_wfs.c | 2 - tests/common/Makefile.am | 2 +- tests/common/api.h | 3 - tests/common/cpuset.h | 2 - tests/common/thread-id.h | 1 - tests/regression/Makefile.am | 16 ++-- tests/regression/test_urcu_fork.c | 2 - tests/regression/urcutorture.c | 1 - tests/unit/Makefile.am | 16 ++-- tests/utils/Makefile.am | 2 + tests/utils/tap.c | 1 - 141 files changed, 140 insertions(+), 192 deletions(-) create mode 100644 include/Makefile.am rename {urcu => include/urcu}/arch/aarch64.h (100%) rename {urcu => include/urcu}/arch/alpha.h (100%) rename {urcu => include/urcu}/arch/arm.h (100%) rename {urcu => include/urcu}/arch/gcc.h (100%) rename {urcu => include/urcu}/arch/generic.h (100%) rename {urcu => include/urcu}/arch/hppa.h (100%) rename {urcu => include/urcu}/arch/ia64.h (100%) rename {urcu => include/urcu}/arch/mips.h (100%) rename {urcu => include/urcu}/arch/nios2.h (100%) rename {urcu => include/urcu}/arch/ppc.h (100%) rename {urcu => include/urcu}/arch/s390.h (100%) rename {urcu => include/urcu}/arch/sparc64.h (100%) rename {urcu => include/urcu}/arch/tile.h (100%) rename {urcu => include/urcu}/arch/unknown.h (100%) rename {urcu => include/urcu}/arch/x86.h (100%) rename {urcu => include/urcu}/cds.h (100%) rename {urcu => include/urcu}/compiler.h (100%) rename {urcu => include/urcu}/config.h.in (100%) rename {urcu => include/urcu}/debug.h (100%) rename {urcu => include/urcu}/futex.h (100%) rename {urcu => include/urcu}/hlist.h (100%) rename {urcu => include/urcu}/lfstack.h (100%) rename {urcu => include/urcu}/list.h (100%) rename {urcu => include/urcu}/map/urcu-bp.h (100%) rename {urcu => include/urcu}/map/urcu-qsbr.h (100%) rename {urcu => include/urcu}/map/urcu.h (100%) rename {urcu => include/urcu}/rand-compat.h (100%) rename {urcu => include/urcu}/rcuhlist.h (100%) rename {urcu => include/urcu}/rculfhash.h (100%) rename {urcu => include/urcu}/rculfqueue.h (100%) rename {urcu => include/urcu}/rculfstack.h (100%) rename {urcu => include/urcu}/rculist.h (100%) rename {urcu => include/urcu}/ref.h (100%) rename {urcu => include/urcu}/static/lfstack.h (100%) rename {urcu => include/urcu}/static/rculfqueue.h (100%) rename {urcu => include/urcu}/static/rculfstack.h (100%) rename {urcu => include/urcu}/static/urcu-bp.h (100%) rename {urcu => include/urcu}/static/urcu-pointer.h (100%) rename {urcu => include/urcu}/static/urcu-qsbr.h (100%) rename {urcu => include/urcu}/static/urcu.h (100%) rename {urcu => include/urcu}/static/wfcqueue.h (100%) rename {urcu => include/urcu}/static/wfqueue.h (100%) rename {urcu => include/urcu}/static/wfstack.h (100%) rename {urcu => include/urcu}/syscall-compat.h (100%) rename {urcu => include/urcu}/system.h (100%) rename {urcu => include/urcu}/tls-compat.h (100%) rename {urcu => include/urcu}/uatomic/aarch64.h (100%) rename {urcu => include/urcu}/uatomic/alpha.h (100%) rename {urcu => include/urcu}/uatomic/arm.h (100%) rename {urcu => include/urcu}/uatomic/gcc.h (100%) rename {urcu => include/urcu}/uatomic/generic.h (100%) rename {urcu => include/urcu}/uatomic/hppa.h (100%) rename {urcu => include/urcu}/uatomic/ia64.h (100%) rename {urcu => include/urcu}/uatomic/mips.h (100%) rename {urcu => include/urcu}/uatomic/nios2.h (100%) rename {urcu => include/urcu}/uatomic/ppc.h (100%) rename {urcu => include/urcu}/uatomic/s390.h (100%) rename {urcu => include/urcu}/uatomic/sparc64.h (100%) rename {urcu => include/urcu}/uatomic/tile.h (100%) rename {urcu => include/urcu}/uatomic/unknown.h (100%) rename {urcu => include/urcu}/uatomic/x86.h (100%) rename {urcu => include/urcu}/uatomic_arch.h (100%) rename {urcu => include/urcu}/urcu-futex.h (100%) rename {urcu => include/urcu}/urcu_ref.h (100%) rename {urcu => include/urcu}/wfcqueue.h (100%) rename {urcu => include/urcu}/wfqueue.h (100%) rename {urcu => include/urcu}/wfstack.h (100%) create mode 100644 src/Makefile.am rename compat-getcpu.h => src/compat-getcpu.h (98%) rename compat_arch_x86.c => src/compat_arch_x86.c (100%) rename compat_futex.c => src/compat_futex.c (100%) rename lfstack.c => src/lfstack.c (100%) rename liburcu-bp.pc.in => src/liburcu-bp.pc.in (100%) rename liburcu-cds.pc.in => src/liburcu-cds.pc.in (100%) rename liburcu-mb.pc.in => src/liburcu-mb.pc.in (100%) rename liburcu-qsbr.pc.in => src/liburcu-qsbr.pc.in (100%) rename liburcu-signal.pc.in => src/liburcu-signal.pc.in (100%) rename liburcu.pc.in => src/liburcu.pc.in (100%) rename rculfhash-internal.h => src/rculfhash-internal.h (100%) rename rculfhash-mm-chunk.c => src/rculfhash-mm-chunk.c (100%) rename rculfhash-mm-mmap.c => src/rculfhash-mm-mmap.c (100%) rename rculfhash-mm-order.c => src/rculfhash-mm-order.c (100%) rename rculfhash.c => src/rculfhash.c (99%) rename rculfqueue.c => src/rculfqueue.c (100%) rename rculfstack.c => src/rculfstack.c (100%) rename urcu-bp.c => src/urcu-bp.c (99%) rename urcu-bp.h => src/urcu-bp.h (100%) rename urcu-call-rcu-impl.h => src/urcu-call-rcu-impl.h (99%) rename urcu-call-rcu.h => src/urcu-call-rcu.h (100%) rename urcu-defer-impl.h => src/urcu-defer-impl.h (100%) rename urcu-defer.h => src/urcu-defer.h (100%) rename urcu-die.h => src/urcu-die.h (100%) rename urcu-flavor.h => src/urcu-flavor.h (100%) rename urcu-pointer.c => src/urcu-pointer.c (100%) rename urcu-pointer.h => src/urcu-pointer.h (100%) rename urcu-qsbr.c => src/urcu-qsbr.c (99%) rename urcu-qsbr.h => src/urcu-qsbr.h (100%) rename urcu-wait.h => src/urcu-wait.h (100%) rename urcu.c => src/urcu.c (99%) rename urcu.h => src/urcu.h (100%) rename wfcqueue.c => src/wfcqueue.c (100%) rename wfqueue.c => src/wfqueue.c (100%) rename wfstack.c => src/wfstack.c (100%) diff --git a/.gitignore b/.gitignore index c4698b9..7e7242a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -urcu/arch.h -urcu/uatomic.h +include/urcu/arch.h +include/urcu/uatomic.h tests/api.h @@ -120,7 +120,7 @@ doc/examples/rculfhash/cds_lfht_lookup doc/examples/rculfhash/cds_lfht_for_each_entry_duplicate #automake -/config.h +/include/config.h .deps/ .libs/ Makefile.in @@ -146,8 +146,8 @@ Makefile /m4/ltsugar.m4 /m4/ltversion.m4 /libtool -/stamp-h1 -/config.h.in +/include/stamp-h1 +/include/config.h.in /config.status /autom4te.cache/ config.h diff --git a/Makefile.am b/Makefile.am index 7b21321..dacbb3b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,91 +1,16 @@ ACLOCAL_AMFLAGS=-I m4 -AM_CPPFLAGS = -I$(top_builddir)/urcu +SUBDIRS = include src doc tests -#Add the -version-info directly here since we are only building -# library that use the version-info -AM_LDFLAGS=-version-info $(URCU_LIBRARY_VERSION) -if USE_CYGWIN -AM_LDFLAGS+=-no-undefined -endif -AM_CFLAGS=-Wall - -SUBDIRS = . doc tests - -include_HEADERS = urcu.h urcu-bp.h urcu-call-rcu.h urcu-defer.h \ - urcu-pointer.h urcu-qsbr.h urcu-flavor.h -nobase_dist_include_HEADERS = urcu/compiler.h urcu/hlist.h urcu/list.h \ - urcu/rculist.h urcu/rcuhlist.h urcu/system.h urcu/futex.h \ - urcu/uatomic/generic.h urcu/arch/generic.h urcu/wfstack.h \ - urcu/wfqueue.h urcu/rculfstack.h urcu/rculfqueue.h \ - urcu/ref.h urcu/cds.h urcu/urcu_ref.h urcu/urcu-futex.h \ - urcu/uatomic_arch.h urcu/rculfhash.h urcu/wfcqueue.h \ - urcu/lfstack.h urcu/syscall-compat.h \ - $(top_srcdir)/urcu/map/*.h \ - $(top_srcdir)/urcu/static/*.h \ - urcu/rand-compat.h \ - urcu/tls-compat.h urcu/debug.h -nobase_nodist_include_HEADERS = urcu/arch.h urcu/uatomic.h urcu/config.h - -dist_noinst_HEADERS = urcu-die.h urcu-wait.h compat-getcpu.h - -EXTRA_DIST = $(top_srcdir)/urcu/arch/*.h $(top_srcdir)/urcu/uatomic/*.h \ - gpl-2.0.txt lgpl-2.1.txt lgpl-relicensing.txt \ - LICENSE compat_arch_x86.c \ - urcu-call-rcu-impl.h urcu-defer-impl.h \ - rculfhash-internal.h - -if COMPAT_ARCH -COMPAT=compat_arch_@ARCHTYPE@.c -else -COMPAT= -endif - -COMPAT+=compat_futex.c - -RCULFHASH = rculfhash.c rculfhash-mm-order.c rculfhash-mm-chunk.c \ - rculfhash-mm-mmap.c - -lib_LTLIBRARIES = liburcu-common.la \ - liburcu.la liburcu-qsbr.la \ - liburcu-mb.la liburcu-signal.la liburcu-bp.la \ - liburcu-cds.la - -# -# liburcu-common contains wait-free queues (needed by call_rcu) as well -# as futex fallbacks. -# -liburcu_common_la_SOURCES = wfqueue.c wfcqueue.c wfstack.c $(COMPAT) - -liburcu_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT) -liburcu_la_LIBADD = liburcu-common.la - -liburcu_qsbr_la_SOURCES = urcu-qsbr.c urcu-pointer.c $(COMPAT) -liburcu_qsbr_la_LIBADD = liburcu-common.la - -liburcu_mb_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT) -liburcu_mb_la_CFLAGS = -DRCU_MB -liburcu_mb_la_LIBADD = liburcu-common.la - -liburcu_signal_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT) -liburcu_signal_la_CFLAGS = -DRCU_SIGNAL -liburcu_signal_la_LIBADD = liburcu-common.la - -liburcu_bp_la_SOURCES = urcu-bp.c urcu-pointer.c $(COMPAT) -liburcu_bp_la_LIBADD = liburcu-common.la - -liburcu_cds_la_SOURCES = rculfqueue.c rculfstack.c lfstack.c \ - $(RCULFHASH) $(COMPAT) -liburcu_cds_la_LIBADD = liburcu-common.la - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = liburcu-cds.pc liburcu.pc liburcu-bp.pc liburcu-qsbr.pc \ - liburcu-signal.pc liburcu-mb.pc - -dist_doc_DATA = README.md ChangeLog +dist_doc_DATA = LICENSE \ + README.md dist_noinst_DATA = CodingStyle +EXTRA_DIST = gpl-2.0.txt \ + lgpl-2.1.txt \ + lgpl-relicensing.txt + .PHONY: short_bench long_bench regtest short_bench: cd tests && $(MAKE) $(AM_MAKEFLAGS) short_bench diff --git a/configure.ac b/configure.ac index ea57e7e..eb54f4e 100644 --- a/configure.ac +++ b/configure.ac @@ -5,15 +5,14 @@ AC_INIT([userspace-rcu],[0.9.0],[mathieu dot desnoyers at efficios dot com], [], # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html AC_SUBST([URCU_LIBRARY_VERSION], [5:0:1]) -AC_CONFIG_SRCDIR([urcu.h]) -AC_CONFIG_HEADERS([config.h urcu/config.h]) +AC_CONFIG_HEADERS([include/config.h include/urcu/config.h]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_TARGET AC_CANONICAL_HOST -AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip]) +AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip nostdinc]) AM_MAINTAINER_MODE([enable]) # Enable silent rules if available (Introduced in AM 1.11) @@ -148,8 +147,8 @@ AS_CASE([$host],[*-cygwin*], AC_SUBST(ARCHTYPE) AC_SUBST(SUBARCHTYPE) -UATOMICSRC=urcu/uatomic/$ARCHTYPE.h -ARCHSRC=urcu/arch/$ARCHTYPE.h +UATOMICSRC=include/urcu/uatomic/$ARCHTYPE.h +ARCHSRC=include/urcu/arch/$ARCHTYPE.h AS_IF([test "x$SUBARCHTYPE" = xx86compat],[ AC_DEFINE([CONFIG_RCU_COMPAT_ARCH], [1]) @@ -269,12 +268,6 @@ AS_IF([test "x$def_smp_support" = "xyes"], [AC_DEFINE([CONFIG_RCU_SMP], [1])]) # int sched_setaffinity (pid_t __pid, const cpu_set_t *__mask); # ~~~~ -# Since we define _GNU_SOURCE in the sources, must do so too in the -# autoconf tests, as defining _GNU_SOURCE or not exposes -# sched_setaffinity bits differently. -saved_CFLAGS=$CFLAGS -CFLAGS="$CFLAGS -D_GNU_SOURCE" - AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t="yes"], [have_cpu_set_t="no"], @@ -284,7 +277,6 @@ AC_CHECK_TYPES([cpu_set_t], AC_MSG_CHECKING([whether CPU_ZERO works]) AH_TEMPLATE([HAVE_CPU_ZERO], [Defined to 1 if we have CPU_ZERO and it works]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - #define _GNU_SOURCE #include int main() { @@ -303,7 +295,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ AC_MSG_CHECKING([whether CPU_SET works]) AH_TEMPLATE([HAVE_CPU_SET], [Defined to 1 if we have CPU_SET and it works]) AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - #define _GNU_SOURCE #include int main() { @@ -353,16 +344,19 @@ AC_CHECK_FUNCS([sched_setaffinity],[ ]) ]) -CFLAGS=$saved_CFLAGS +DEFAULT_INCLUDES="-include config.h" +AC_SUBST(DEFAULT_INCLUDES) AC_CONFIG_LINKS([ - urcu/arch.h:$ARCHSRC - urcu/uatomic.h:$UATOMICSRC + include/urcu/arch.h:$ARCHSRC + include/urcu/uatomic.h:$UATOMICSRC ]) AC_CONFIG_FILES([ Makefile doc/Makefile doc/examples/Makefile + include/Makefile + src/Makefile tests/Makefile tests/common/Makefile tests/unit/Makefile @@ -370,12 +364,12 @@ AC_CONFIG_FILES([ tests/regression/Makefile tests/regression/regression_tests tests/utils/Makefile - liburcu.pc - liburcu-bp.pc - liburcu-cds.pc - liburcu-qsbr.pc - liburcu-mb.pc - liburcu-signal.pc + src/liburcu.pc + src/liburcu-bp.pc + src/liburcu-cds.pc + src/liburcu-qsbr.pc + src/liburcu-mb.pc + src/liburcu-signal.pc ]) AC_OUTPUT diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am index 6828eee..88f8968 100644 --- a/doc/examples/Makefile.am +++ b/doc/examples/Makefile.am @@ -145,7 +145,7 @@ all-local: echo "Examples: relative top_builddir path $(top_builddir)"; \ rel_build_subdir="../"; \ fi; \ - $(MAKE) -f dist-files/Makefile AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS) -I$$rel_src_subdir/$(top_srcdir)/ -I$$rel_build_subdir$(top_builddir)/" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../.libs/ -Wl,-rpath "$(PWD)/../../.libs/"' $(AM_MAKEFLAGS) all; + $(MAKE) -f dist-files/Makefile AM_CC="$(CC)" AM_CPPFLAGS="$(CPPFLAGS) -I$$rel_src_subdir/$(top_srcdir)/include/ -I$$rel_src_subdir/$(top_srcdir)/src/ -I$$rel_build_subdir$(top_builddir)/include/ -I$$rel_build_subdir$(top_builddir)/include/src/" AM_CFLAGS='$(CFLAGS)' AM_LDFLAGS='$(LDFLAGS) -L../../../src/.libs/ -Wl,-rpath "$(PWD)/../../src/.libs/"' $(AM_MAKEFLAGS) all; clean-local: @$(MAKE) -f dist-files/Makefile $(AM_MAKEFLAGS) clean; \ diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..61301c2 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,17 @@ +nobase_dist_include_HEADERS = urcu/compiler.h urcu/hlist.h urcu/list.h \ + urcu/rculist.h urcu/rcuhlist.h urcu/system.h urcu/futex.h \ + urcu/uatomic/generic.h urcu/arch/generic.h urcu/wfstack.h \ + urcu/wfqueue.h urcu/rculfstack.h urcu/rculfqueue.h \ + urcu/ref.h urcu/cds.h urcu/urcu_ref.h urcu/urcu-futex.h \ + urcu/uatomic_arch.h urcu/rculfhash.h urcu/wfcqueue.h \ + urcu/lfstack.h urcu/syscall-compat.h \ + $(top_srcdir)/include/urcu/map/*.h \ + $(top_srcdir)/include/urcu/static/*.h \ + urcu/rand-compat.h \ + urcu/tls-compat.h urcu/debug.h + +# Don't distribute generated headers +nobase_nodist_include_HEADERS = urcu/arch.h urcu/uatomic.h urcu/config.h + +EXTRA_DIST = $(top_srcdir)/include/urcu/arch/*.h \ + $(top_srcdir)/include/urcu/uatomic/*.h diff --git a/urcu/arch/aarch64.h b/include/urcu/arch/aarch64.h similarity index 100% rename from urcu/arch/aarch64.h rename to include/urcu/arch/aarch64.h diff --git a/urcu/arch/alpha.h b/include/urcu/arch/alpha.h similarity index 100% rename from urcu/arch/alpha.h rename to include/urcu/arch/alpha.h diff --git a/urcu/arch/arm.h b/include/urcu/arch/arm.h similarity index 100% rename from urcu/arch/arm.h rename to include/urcu/arch/arm.h diff --git a/urcu/arch/gcc.h b/include/urcu/arch/gcc.h similarity index 100% rename from urcu/arch/gcc.h rename to include/urcu/arch/gcc.h diff --git a/urcu/arch/generic.h b/include/urcu/arch/generic.h similarity index 100% rename from urcu/arch/generic.h rename to include/urcu/arch/generic.h diff --git a/urcu/arch/hppa.h b/include/urcu/arch/hppa.h similarity index 100% rename from urcu/arch/hppa.h rename to include/urcu/arch/hppa.h diff --git a/urcu/arch/ia64.h b/include/urcu/arch/ia64.h similarity index 100% rename from urcu/arch/ia64.h rename to include/urcu/arch/ia64.h diff --git a/urcu/arch/mips.h b/include/urcu/arch/mips.h similarity index 100% rename from urcu/arch/mips.h rename to include/urcu/arch/mips.h diff --git a/urcu/arch/nios2.h b/include/urcu/arch/nios2.h similarity index 100% rename from urcu/arch/nios2.h rename to include/urcu/arch/nios2.h diff --git a/urcu/arch/ppc.h b/include/urcu/arch/ppc.h similarity index 100% rename from urcu/arch/ppc.h rename to include/urcu/arch/ppc.h diff --git a/urcu/arch/s390.h b/include/urcu/arch/s390.h similarity index 100% rename from urcu/arch/s390.h rename to include/urcu/arch/s390.h diff --git a/urcu/arch/sparc64.h b/include/urcu/arch/sparc64.h similarity index 100% rename from urcu/arch/sparc64.h rename to include/urcu/arch/sparc64.h diff --git a/urcu/arch/tile.h b/include/urcu/arch/tile.h similarity index 100% rename from urcu/arch/tile.h rename to include/urcu/arch/tile.h diff --git a/urcu/arch/unknown.h b/include/urcu/arch/unknown.h similarity index 100% rename from urcu/arch/unknown.h rename to include/urcu/arch/unknown.h diff --git a/urcu/arch/x86.h b/include/urcu/arch/x86.h similarity index 100% rename from urcu/arch/x86.h rename to include/urcu/arch/x86.h diff --git a/urcu/cds.h b/include/urcu/cds.h similarity index 100% rename from urcu/cds.h rename to include/urcu/cds.h diff --git a/urcu/compiler.h b/include/urcu/compiler.h similarity index 100% rename from urcu/compiler.h rename to include/urcu/compiler.h diff --git a/urcu/config.h.in b/include/urcu/config.h.in similarity index 100% rename from urcu/config.h.in rename to include/urcu/config.h.in diff --git a/urcu/debug.h b/include/urcu/debug.h similarity index 100% rename from urcu/debug.h rename to include/urcu/debug.h diff --git a/urcu/futex.h b/include/urcu/futex.h similarity index 100% rename from urcu/futex.h rename to include/urcu/futex.h diff --git a/urcu/hlist.h b/include/urcu/hlist.h similarity index 100% rename from urcu/hlist.h rename to include/urcu/hlist.h diff --git a/urcu/lfstack.h b/include/urcu/lfstack.h similarity index 100% rename from urcu/lfstack.h rename to include/urcu/lfstack.h diff --git a/urcu/list.h b/include/urcu/list.h similarity index 100% rename from urcu/list.h rename to include/urcu/list.h diff --git a/urcu/map/urcu-bp.h b/include/urcu/map/urcu-bp.h similarity index 100% rename from urcu/map/urcu-bp.h rename to include/urcu/map/urcu-bp.h diff --git a/urcu/map/urcu-qsbr.h b/include/urcu/map/urcu-qsbr.h similarity index 100% rename from urcu/map/urcu-qsbr.h rename to include/urcu/map/urcu-qsbr.h diff --git a/urcu/map/urcu.h b/include/urcu/map/urcu.h similarity index 100% rename from urcu/map/urcu.h rename to include/urcu/map/urcu.h diff --git a/urcu/rand-compat.h b/include/urcu/rand-compat.h similarity index 100% rename from urcu/rand-compat.h rename to include/urcu/rand-compat.h diff --git a/urcu/rcuhlist.h b/include/urcu/rcuhlist.h similarity index 100% rename from urcu/rcuhlist.h rename to include/urcu/rcuhlist.h diff --git a/urcu/rculfhash.h b/include/urcu/rculfhash.h similarity index 100% rename from urcu/rculfhash.h rename to include/urcu/rculfhash.h diff --git a/urcu/rculfqueue.h b/include/urcu/rculfqueue.h similarity index 100% rename from urcu/rculfqueue.h rename to include/urcu/rculfqueue.h diff --git a/urcu/rculfstack.h b/include/urcu/rculfstack.h similarity index 100% rename from urcu/rculfstack.h rename to include/urcu/rculfstack.h diff --git a/urcu/rculist.h b/include/urcu/rculist.h similarity index 100% rename from urcu/rculist.h rename to include/urcu/rculist.h diff --git a/urcu/ref.h b/include/urcu/ref.h similarity index 100% rename from urcu/ref.h rename to include/urcu/ref.h diff --git a/urcu/static/lfstack.h b/include/urcu/static/lfstack.h similarity index 100% rename from urcu/static/lfstack.h rename to include/urcu/static/lfstack.h diff --git a/urcu/static/rculfqueue.h b/include/urcu/static/rculfqueue.h similarity index 100% rename from urcu/static/rculfqueue.h rename to include/urcu/static/rculfqueue.h diff --git a/urcu/static/rculfstack.h b/include/urcu/static/rculfstack.h similarity index 100% rename from urcu/static/rculfstack.h rename to include/urcu/static/rculfstack.h diff --git a/urcu/static/urcu-bp.h b/include/urcu/static/urcu-bp.h similarity index 100% rename from urcu/static/urcu-bp.h rename to include/urcu/static/urcu-bp.h diff --git a/urcu/static/urcu-pointer.h b/include/urcu/static/urcu-pointer.h similarity index 100% rename from urcu/static/urcu-pointer.h rename to include/urcu/static/urcu-pointer.h diff --git a/urcu/static/urcu-qsbr.h b/include/urcu/static/urcu-qsbr.h similarity index 100% rename from urcu/static/urcu-qsbr.h rename to include/urcu/static/urcu-qsbr.h diff --git a/urcu/static/urcu.h b/include/urcu/static/urcu.h similarity index 100% rename from urcu/static/urcu.h rename to include/urcu/static/urcu.h diff --git a/urcu/static/wfcqueue.h b/include/urcu/static/wfcqueue.h similarity index 100% rename from urcu/static/wfcqueue.h rename to include/urcu/static/wfcqueue.h diff --git a/urcu/static/wfqueue.h b/include/urcu/static/wfqueue.h similarity index 100% rename from urcu/static/wfqueue.h rename to include/urcu/static/wfqueue.h diff --git a/urcu/static/wfstack.h b/include/urcu/static/wfstack.h similarity index 100% rename from urcu/static/wfstack.h rename to include/urcu/static/wfstack.h diff --git a/urcu/syscall-compat.h b/include/urcu/syscall-compat.h similarity index 100% rename from urcu/syscall-compat.h rename to include/urcu/syscall-compat.h diff --git a/urcu/system.h b/include/urcu/system.h similarity index 100% rename from urcu/system.h rename to include/urcu/system.h diff --git a/urcu/tls-compat.h b/include/urcu/tls-compat.h similarity index 100% rename from urcu/tls-compat.h rename to include/urcu/tls-compat.h diff --git a/urcu/uatomic/aarch64.h b/include/urcu/uatomic/aarch64.h similarity index 100% rename from urcu/uatomic/aarch64.h rename to include/urcu/uatomic/aarch64.h diff --git a/urcu/uatomic/alpha.h b/include/urcu/uatomic/alpha.h similarity index 100% rename from urcu/uatomic/alpha.h rename to include/urcu/uatomic/alpha.h diff --git a/urcu/uatomic/arm.h b/include/urcu/uatomic/arm.h similarity index 100% rename from urcu/uatomic/arm.h rename to include/urcu/uatomic/arm.h diff --git a/urcu/uatomic/gcc.h b/include/urcu/uatomic/gcc.h similarity index 100% rename from urcu/uatomic/gcc.h rename to include/urcu/uatomic/gcc.h diff --git a/urcu/uatomic/generic.h b/include/urcu/uatomic/generic.h similarity index 100% rename from urcu/uatomic/generic.h rename to include/urcu/uatomic/generic.h diff --git a/urcu/uatomic/hppa.h b/include/urcu/uatomic/hppa.h similarity index 100% rename from urcu/uatomic/hppa.h rename to include/urcu/uatomic/hppa.h diff --git a/urcu/uatomic/ia64.h b/include/urcu/uatomic/ia64.h similarity index 100% rename from urcu/uatomic/ia64.h rename to include/urcu/uatomic/ia64.h diff --git a/urcu/uatomic/mips.h b/include/urcu/uatomic/mips.h similarity index 100% rename from urcu/uatomic/mips.h rename to include/urcu/uatomic/mips.h diff --git a/urcu/uatomic/nios2.h b/include/urcu/uatomic/nios2.h similarity index 100% rename from urcu/uatomic/nios2.h rename to include/urcu/uatomic/nios2.h diff --git a/urcu/uatomic/ppc.h b/include/urcu/uatomic/ppc.h similarity index 100% rename from urcu/uatomic/ppc.h rename to include/urcu/uatomic/ppc.h diff --git a/urcu/uatomic/s390.h b/include/urcu/uatomic/s390.h similarity index 100% rename from urcu/uatomic/s390.h rename to include/urcu/uatomic/s390.h diff --git a/urcu/uatomic/sparc64.h b/include/urcu/uatomic/sparc64.h similarity index 100% rename from urcu/uatomic/sparc64.h rename to include/urcu/uatomic/sparc64.h diff --git a/urcu/uatomic/tile.h b/include/urcu/uatomic/tile.h similarity index 100% rename from urcu/uatomic/tile.h rename to include/urcu/uatomic/tile.h diff --git a/urcu/uatomic/unknown.h b/include/urcu/uatomic/unknown.h similarity index 100% rename from urcu/uatomic/unknown.h rename to include/urcu/uatomic/unknown.h diff --git a/urcu/uatomic/x86.h b/include/urcu/uatomic/x86.h similarity index 100% rename from urcu/uatomic/x86.h rename to include/urcu/uatomic/x86.h diff --git a/urcu/uatomic_arch.h b/include/urcu/uatomic_arch.h similarity index 100% rename from urcu/uatomic_arch.h rename to include/urcu/uatomic_arch.h diff --git a/urcu/urcu-futex.h b/include/urcu/urcu-futex.h similarity index 100% rename from urcu/urcu-futex.h rename to include/urcu/urcu-futex.h diff --git a/urcu/urcu_ref.h b/include/urcu/urcu_ref.h similarity index 100% rename from urcu/urcu_ref.h rename to include/urcu/urcu_ref.h diff --git a/urcu/wfcqueue.h b/include/urcu/wfcqueue.h similarity index 100% rename from urcu/wfcqueue.h rename to include/urcu/wfcqueue.h diff --git a/urcu/wfqueue.h b/include/urcu/wfqueue.h similarity index 100% rename from urcu/wfqueue.h rename to include/urcu/wfqueue.h diff --git a/urcu/wfstack.h b/include/urcu/wfstack.h similarity index 100% rename from urcu/wfstack.h rename to include/urcu/wfstack.h diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..e7eb2bc --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,67 @@ +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src + +#Add the -version-info directly here since we are only building +# library that use the version-info +AM_LDFLAGS=-version-info $(URCU_LIBRARY_VERSION) +if USE_CYGWIN +AM_LDFLAGS+=-no-undefined +endif +AM_CFLAGS=-Wall + +include_HEADERS = urcu.h urcu-bp.h urcu-call-rcu.h urcu-defer.h \ + urcu-pointer.h urcu-qsbr.h urcu-flavor.h + +dist_noinst_HEADERS = urcu-die.h urcu-wait.h compat-getcpu.h + + +if COMPAT_ARCH +COMPAT=compat_arch_@ARCHTYPE@.c +else +COMPAT= +endif + +COMPAT+=compat_futex.c + +RCULFHASH = rculfhash.c rculfhash-mm-order.c rculfhash-mm-chunk.c \ + rculfhash-mm-mmap.c + +lib_LTLIBRARIES = liburcu-common.la \ + liburcu.la liburcu-qsbr.la \ + liburcu-mb.la liburcu-signal.la liburcu-bp.la \ + liburcu-cds.la + +# +# liburcu-common contains wait-free queues (needed by call_rcu) as well +# as futex fallbacks. +# +liburcu_common_la_SOURCES = wfqueue.c wfcqueue.c wfstack.c $(COMPAT) + +liburcu_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT) +liburcu_la_LIBADD = liburcu-common.la + +liburcu_qsbr_la_SOURCES = urcu-qsbr.c urcu-pointer.c $(COMPAT) +liburcu_qsbr_la_LIBADD = liburcu-common.la + +liburcu_mb_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT) +liburcu_mb_la_CFLAGS = -DRCU_MB +liburcu_mb_la_LIBADD = liburcu-common.la + +liburcu_signal_la_SOURCES = urcu.c urcu-pointer.c $(COMPAT) +liburcu_signal_la_CFLAGS = -DRCU_SIGNAL +liburcu_signal_la_LIBADD = liburcu-common.la + +liburcu_bp_la_SOURCES = urcu-bp.c urcu-pointer.c $(COMPAT) +liburcu_bp_la_LIBADD = liburcu-common.la + +liburcu_cds_la_SOURCES = rculfqueue.c rculfstack.c lfstack.c \ + $(RCULFHASH) $(COMPAT) +liburcu_cds_la_LIBADD = liburcu-common.la + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = liburcu-cds.pc liburcu.pc liburcu-bp.pc liburcu-qsbr.pc \ + liburcu-signal.pc liburcu-mb.pc + +EXTRA_DIST = compat_arch_x86.c \ + urcu-call-rcu-impl.h \ + urcu-defer-impl.h \ + rculfhash-internal.h diff --git a/compat-getcpu.h b/src/compat-getcpu.h similarity index 98% rename from compat-getcpu.h rename to src/compat-getcpu.h index 863c80a..3c1899b 100644 --- a/compat-getcpu.h +++ b/src/compat-getcpu.h @@ -21,8 +21,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - #if defined(HAVE_SCHED_GETCPU) #include diff --git a/compat_arch_x86.c b/src/compat_arch_x86.c similarity index 100% rename from compat_arch_x86.c rename to src/compat_arch_x86.c diff --git a/compat_futex.c b/src/compat_futex.c similarity index 100% rename from compat_futex.c rename to src/compat_futex.c diff --git a/lfstack.c b/src/lfstack.c similarity index 100% rename from lfstack.c rename to src/lfstack.c diff --git a/liburcu-bp.pc.in b/src/liburcu-bp.pc.in similarity index 100% rename from liburcu-bp.pc.in rename to src/liburcu-bp.pc.in diff --git a/liburcu-cds.pc.in b/src/liburcu-cds.pc.in similarity index 100% rename from liburcu-cds.pc.in rename to src/liburcu-cds.pc.in diff --git a/liburcu-mb.pc.in b/src/liburcu-mb.pc.in similarity index 100% rename from liburcu-mb.pc.in rename to src/liburcu-mb.pc.in diff --git a/liburcu-qsbr.pc.in b/src/liburcu-qsbr.pc.in similarity index 100% rename from liburcu-qsbr.pc.in rename to src/liburcu-qsbr.pc.in diff --git a/liburcu-signal.pc.in b/src/liburcu-signal.pc.in similarity index 100% rename from liburcu-signal.pc.in rename to src/liburcu-signal.pc.in diff --git a/liburcu.pc.in b/src/liburcu.pc.in similarity index 100% rename from liburcu.pc.in rename to src/liburcu.pc.in diff --git a/rculfhash-internal.h b/src/rculfhash-internal.h similarity index 100% rename from rculfhash-internal.h rename to src/rculfhash-internal.h diff --git a/rculfhash-mm-chunk.c b/src/rculfhash-mm-chunk.c similarity index 100% rename from rculfhash-mm-chunk.c rename to src/rculfhash-mm-chunk.c diff --git a/rculfhash-mm-mmap.c b/src/rculfhash-mm-mmap.c similarity index 100% rename from rculfhash-mm-mmap.c rename to src/rculfhash-mm-mmap.c diff --git a/rculfhash-mm-order.c b/src/rculfhash-mm-order.c similarity index 100% rename from rculfhash-mm-order.c rename to src/rculfhash-mm-order.c diff --git a/rculfhash.c b/src/rculfhash.c similarity index 99% rename from rculfhash.c rename to src/rculfhash.c index d7d107f..d7a1f23 100644 --- a/rculfhash.c +++ b/src/rculfhash.c @@ -256,7 +256,6 @@ */ #define _LGPL_SOURCE -#define _GNU_SOURCE #include #include #include @@ -266,7 +265,6 @@ #include #include -#include "config.h" #include "compat-getcpu.h" #include #include diff --git a/rculfqueue.c b/src/rculfqueue.c similarity index 100% rename from rculfqueue.c rename to src/rculfqueue.c diff --git a/rculfstack.c b/src/rculfstack.c similarity index 100% rename from rculfstack.c rename to src/rculfstack.c diff --git a/urcu-bp.c b/src/urcu-bp.c similarity index 99% rename from urcu-bp.c rename to src/urcu-bp.c index cbdebf4..4b4fe45 100644 --- a/urcu-bp.c +++ b/src/urcu-bp.c @@ -23,7 +23,6 @@ * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include diff --git a/urcu-bp.h b/src/urcu-bp.h similarity index 100% rename from urcu-bp.h rename to src/urcu-bp.h diff --git a/urcu-call-rcu-impl.h b/src/urcu-call-rcu-impl.h similarity index 99% rename from urcu-call-rcu-impl.h rename to src/urcu-call-rcu-impl.h index 65f63ee..bfa53f8 100644 --- a/urcu-call-rcu-impl.h +++ b/src/urcu-call-rcu-impl.h @@ -20,7 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -35,7 +34,6 @@ #include #include -#include "config.h" #include "compat-getcpu.h" #include "urcu/wfcqueue.h" #include "urcu-call-rcu.h" diff --git a/urcu-call-rcu.h b/src/urcu-call-rcu.h similarity index 100% rename from urcu-call-rcu.h rename to src/urcu-call-rcu.h diff --git a/urcu-defer-impl.h b/src/urcu-defer-impl.h similarity index 100% rename from urcu-defer-impl.h rename to src/urcu-defer-impl.h diff --git a/urcu-defer.h b/src/urcu-defer.h similarity index 100% rename from urcu-defer.h rename to src/urcu-defer.h diff --git a/urcu-die.h b/src/urcu-die.h similarity index 100% rename from urcu-die.h rename to src/urcu-die.h diff --git a/urcu-flavor.h b/src/urcu-flavor.h similarity index 100% rename from urcu-flavor.h rename to src/urcu-flavor.h diff --git a/urcu-pointer.c b/src/urcu-pointer.c similarity index 100% rename from urcu-pointer.c rename to src/urcu-pointer.c diff --git a/urcu-pointer.h b/src/urcu-pointer.h similarity index 100% rename from urcu-pointer.h rename to src/urcu-pointer.h diff --git a/urcu-qsbr.c b/src/urcu-qsbr.c similarity index 99% rename from urcu-qsbr.c rename to src/urcu-qsbr.c index af82fb7..e029ace 100644 --- a/urcu-qsbr.c +++ b/src/urcu-qsbr.c @@ -23,7 +23,6 @@ * IBM's contributions to this file may be relicensed under LGPLv2 or later. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include diff --git a/urcu-qsbr.h b/src/urcu-qsbr.h similarity index 100% rename from urcu-qsbr.h rename to src/urcu-qsbr.h diff --git a/urcu-wait.h b/src/urcu-wait.h similarity index 100% rename from urcu-wait.h rename to src/urcu-wait.h diff --git a/urcu.c b/src/urcu.c similarity index 99% rename from urcu.c rename to src/urcu.c index a5568bd..ccd9706 100644 --- a/urcu.c +++ b/src/urcu.c @@ -24,7 +24,6 @@ */ #define _BSD_SOURCE -#define _GNU_SOURCE #define _LGPL_SOURCE #define _DEFAULT_SOURCE #include diff --git a/urcu.h b/src/urcu.h similarity index 100% rename from urcu.h rename to src/urcu.h diff --git a/wfcqueue.c b/src/wfcqueue.c similarity index 100% rename from wfcqueue.c rename to src/wfcqueue.c diff --git a/wfqueue.c b/src/wfqueue.c similarity index 100% rename from wfqueue.c rename to src/wfqueue.c diff --git a/wfstack.c b/src/wfstack.c similarity index 100% rename from wfstack.c rename to src/wfstack.c diff --git a/tests/benchmark/Makefile.am b/tests/benchmark/Makefile.am index f513ed4..0c3fd77 100644 --- a/tests/benchmark/Makefile.am +++ b/tests/benchmark/Makefile.am @@ -1,4 +1,4 @@ -AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/common -g +AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/common -g SCRIPT_LIST = common.sh \ run.sh \ @@ -42,13 +42,13 @@ noinst_PROGRAMS = test_urcu test_urcu_dynamic_link test_urcu_timing \ test_urcu_lfq_dynlink test_urcu_lfs_dynlink test_urcu_hash \ test_urcu_lfs_rcu_dynlink -URCU_COMMON_LIB=$(top_builddir)/liburcu-common.la -URCU_LIB=$(top_builddir)/liburcu.la -URCU_QSBR_LIB=$(top_builddir)/liburcu-qsbr.la -URCU_MB_LIB=$(top_builddir)/liburcu-mb.la -URCU_SIGNAL_LIB=$(top_builddir)/liburcu-signal.la -URCU_BP_LIB=$(top_builddir)/liburcu-bp.la -URCU_CDS_LIB=$(top_builddir)/liburcu-cds.la +URCU_COMMON_LIB=$(top_builddir)/src/liburcu-common.la +URCU_LIB=$(top_builddir)/src/liburcu.la +URCU_QSBR_LIB=$(top_builddir)/src/liburcu-qsbr.la +URCU_MB_LIB=$(top_builddir)/src/liburcu-mb.la +URCU_SIGNAL_LIB=$(top_builddir)/src/liburcu-signal.la +URCU_BP_LIB=$(top_builddir)/src/liburcu-bp.la +URCU_CDS_LIB=$(top_builddir)/src/liburcu-cds.la DEBUG_YIELD_LIB=$(builddir)/../common/libdebug-yield.la diff --git a/tests/benchmark/test_looplen.c b/tests/benchmark/test_looplen.c index 453d433..76430a3 100644 --- a/tests/benchmark/test_looplen.c +++ b/tests/benchmark/test_looplen.c @@ -20,7 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #include #include #include diff --git a/tests/benchmark/test_mutex.c b/tests/benchmark/test_mutex.c index 81efcae..049913c 100644 --- a/tests/benchmark/test_mutex.c +++ b/tests/benchmark/test_mutex.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_perthreadlock.c b/tests/benchmark/test_perthreadlock.c index d76b456..86476a0 100644 --- a/tests/benchmark/test_perthreadlock.c +++ b/tests/benchmark/test_perthreadlock.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_rwlock.c b/tests/benchmark/test_rwlock.c index 3fad9cf..4448597 100644 --- a/tests/benchmark/test_rwlock.c +++ b/tests/benchmark/test_rwlock.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_rwlock_timing.c b/tests/benchmark/test_rwlock_timing.c index fb9e41f..a52da38 100644 --- a/tests/benchmark/test_rwlock_timing.c +++ b/tests/benchmark/test_rwlock_timing.c @@ -20,7 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #include #include #include diff --git a/tests/benchmark/test_urcu.c b/tests/benchmark/test_urcu.c index 28dc75a..5670d1e 100644 --- a/tests/benchmark/test_urcu.c +++ b/tests/benchmark/test_urcu.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_assign.c b/tests/benchmark/test_urcu_assign.c index 37b5f7a..fe34af3 100644 --- a/tests/benchmark/test_urcu_assign.c +++ b/tests/benchmark/test_urcu_assign.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_bp.c b/tests/benchmark/test_urcu_bp.c index 9c336e5..52b0a2a 100644 --- a/tests/benchmark/test_urcu_bp.c +++ b/tests/benchmark/test_urcu_bp.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_defer.c b/tests/benchmark/test_urcu_defer.c index bc11941..0a49641 100644 --- a/tests/benchmark/test_urcu_defer.c +++ b/tests/benchmark/test_urcu_defer.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_gc.c b/tests/benchmark/test_urcu_gc.c index b9cda58..0d8e9a4 100644 --- a/tests/benchmark/test_urcu_gc.c +++ b/tests/benchmark/test_urcu_gc.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_hash.c b/tests/benchmark/test_urcu_hash.c index d610d05..39bdcf8 100644 --- a/tests/benchmark/test_urcu_hash.c +++ b/tests/benchmark/test_urcu_hash.c @@ -20,7 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #include "test_urcu_hash.h" enum test_hash { diff --git a/tests/benchmark/test_urcu_hash.h b/tests/benchmark/test_urcu_hash.h index a722485..f2e23f2 100644 --- a/tests/benchmark/test_urcu_hash.h +++ b/tests/benchmark/test_urcu_hash.h @@ -23,7 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_hash_rw.c b/tests/benchmark/test_urcu_hash_rw.c index d2bd0b4..f72e20b 100644 --- a/tests/benchmark/test_urcu_hash_rw.c +++ b/tests/benchmark/test_urcu_hash_rw.c @@ -20,7 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #include "test_urcu_hash.h" enum urcu_hash_addremove { diff --git a/tests/benchmark/test_urcu_hash_unique.c b/tests/benchmark/test_urcu_hash_unique.c index adbbde0..f03adfd 100644 --- a/tests/benchmark/test_urcu_hash_unique.c +++ b/tests/benchmark/test_urcu_hash_unique.c @@ -20,7 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #include "test_urcu_hash.h" enum urcu_hash_addremove { diff --git a/tests/benchmark/test_urcu_lfq.c b/tests/benchmark/test_urcu_lfq.c index 62637f6..5ef96e6 100644 --- a/tests/benchmark/test_urcu_lfq.c +++ b/tests/benchmark/test_urcu_lfq.c @@ -21,8 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_lfs.c b/tests/benchmark/test_urcu_lfs.c index 9670ae5..38e99bf 100644 --- a/tests/benchmark/test_urcu_lfs.c +++ b/tests/benchmark/test_urcu_lfs.c @@ -21,8 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_lfs_rcu.c b/tests/benchmark/test_urcu_lfs_rcu.c index 5a44c97..ce01143 100644 --- a/tests/benchmark/test_urcu_lfs_rcu.c +++ b/tests/benchmark/test_urcu_lfs_rcu.c @@ -21,8 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_qsbr.c b/tests/benchmark/test_urcu_qsbr.c index c6a6098..1fcdfb1 100644 --- a/tests/benchmark/test_urcu_qsbr.c +++ b/tests/benchmark/test_urcu_qsbr.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_qsbr_gc.c b/tests/benchmark/test_urcu_qsbr_gc.c index 198dbb5..7e452d9 100644 --- a/tests/benchmark/test_urcu_qsbr_gc.c +++ b/tests/benchmark/test_urcu_qsbr_gc.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_wfcq.c b/tests/benchmark/test_urcu_wfcq.c index e233427..84a0d0f 100644 --- a/tests/benchmark/test_urcu_wfcq.c +++ b/tests/benchmark/test_urcu_wfcq.c @@ -21,8 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_wfq.c b/tests/benchmark/test_urcu_wfq.c index 20f7693..1cf356e 100644 --- a/tests/benchmark/test_urcu_wfq.c +++ b/tests/benchmark/test_urcu_wfq.c @@ -21,8 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/benchmark/test_urcu_wfs.c b/tests/benchmark/test_urcu_wfs.c index 358e668..266884d 100644 --- a/tests/benchmark/test_urcu_wfs.c +++ b/tests/benchmark/test_urcu_wfs.c @@ -21,8 +21,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/common/Makefile.am b/tests/common/Makefile.am index b55e527..d919ca1 100644 --- a/tests/common/Makefile.am +++ b/tests/common/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = -I$(top_srcdir) -I$(top_builddir) +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src noinst_HEADERS = cpuset.h thread-id.h diff --git a/tests/common/api.h b/tests/common/api.h index 38d92a7..2b72ec5 100644 --- a/tests/common/api.h +++ b/tests/common/api.h @@ -1,9 +1,6 @@ #ifndef _INCLUDE_API_H #define _INCLUDE_API_H -#define _GNU_SOURCE -#include "config.h" - /* * common.h: Common Linux kernel-isms. * diff --git a/tests/common/cpuset.h b/tests/common/cpuset.h index 4d1f211..3c23d04 100644 --- a/tests/common/cpuset.h +++ b/tests/common/cpuset.h @@ -23,8 +23,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "config.h" - #if defined(HAVE_SCHED_SETAFFINITY) || defined(HAVE_CPU_SET_T) \ || defined(HAVE_CPU_ZERO) || defined(HAVE_CPU_SET) # include diff --git a/tests/common/thread-id.h b/tests/common/thread-id.h index 56835e3..96f1f59 100644 --- a/tests/common/thread-id.h +++ b/tests/common/thread-id.h @@ -17,7 +17,6 @@ * provided the above notices are retained, and a notice that the code was * modified is included with the above copyright notice. */ -#include #ifdef __linux__ # include diff --git a/tests/regression/Makefile.am b/tests/regression/Makefile.am index 9556e3c..aa7a00c 100644 --- a/tests/regression/Makefile.am +++ b/tests/regression/Makefile.am @@ -1,4 +1,4 @@ -AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g +AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g SCRIPT_LIST = run.sh @@ -15,13 +15,13 @@ noinst_PROGRAMS = test_urcu_fork \ noinst_HEADERS = rcutorture.h -URCU_COMMON_LIB=$(top_builddir)/liburcu-common.la -URCU_LIB=$(top_builddir)/liburcu.la -URCU_QSBR_LIB=$(top_builddir)/liburcu-qsbr.la -URCU_MB_LIB=$(top_builddir)/liburcu-mb.la -URCU_SIGNAL_LIB=$(top_builddir)/liburcu-signal.la -URCU_BP_LIB=$(top_builddir)/liburcu-bp.la -URCU_CDS_LIB=$(top_builddir)/liburcu-cds.la +URCU_COMMON_LIB=$(top_builddir)/src/liburcu-common.la +URCU_LIB=$(top_builddir)/src/liburcu.la +URCU_QSBR_LIB=$(top_builddir)/src/liburcu-qsbr.la +URCU_MB_LIB=$(top_builddir)/src/liburcu-mb.la +URCU_SIGNAL_LIB=$(top_builddir)/src/liburcu-signal.la +URCU_BP_LIB=$(top_builddir)/src/liburcu-bp.la +URCU_CDS_LIB=$(top_builddir)/src/liburcu-cds.la TAP_LIB=$(top_builddir)/tests/utils/libtap.a test_urcu_fork_SOURCES = test_urcu_fork.c diff --git a/tests/regression/test_urcu_fork.c b/tests/regression/test_urcu_fork.c index f614201..8118be7 100644 --- a/tests/regression/test_urcu_fork.c +++ b/tests/regression/test_urcu_fork.c @@ -20,8 +20,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE -#include "config.h" #include #include #include diff --git a/tests/regression/urcutorture.c b/tests/regression/urcutorture.c index 35096a6..5e9b059 100644 --- a/tests/regression/urcutorture.c +++ b/tests/regression/urcutorture.c @@ -1,4 +1,3 @@ -#define _GNU_SOURCE #include #include #include diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index d97e43f..54eb9f3 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -1,4 +1,4 @@ -AM_CFLAGS=-I$(top_srcdir) -I$(top_builddir) -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g +AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils -I$(top_srcdir)/tests/common -g SCRIPT_LIST = test_loop run.sh unit_tests @@ -10,13 +10,13 @@ dist_noinst_SCRIPTS = $(SCRIPT_LIST) noinst_HEADERS = test_urcu_multiflavor.h -URCU_COMMON_LIB=$(top_builddir)/liburcu-common.la -URCU_LIB=$(top_builddir)/liburcu.la -URCU_QSBR_LIB=$(top_builddir)/liburcu-qsbr.la -URCU_MB_LIB=$(top_builddir)/liburcu-mb.la -URCU_SIGNAL_LIB=$(top_builddir)/liburcu-signal.la -URCU_BP_LIB=$(top_builddir)/liburcu-bp.la -URCU_CDS_LIB=$(top_builddir)/liburcu-cds.la +URCU_COMMON_LIB=$(top_builddir)/src/liburcu-common.la +URCU_LIB=$(top_builddir)/src/liburcu.la +URCU_QSBR_LIB=$(top_builddir)/src/liburcu-qsbr.la +URCU_MB_LIB=$(top_builddir)/src/liburcu-mb.la +URCU_SIGNAL_LIB=$(top_builddir)/src/liburcu-signal.la +URCU_BP_LIB=$(top_builddir)/src/liburcu-bp.la +URCU_CDS_LIB=$(top_builddir)/src/liburcu-cds.la TAP_LIB=$(top_builddir)/tests/utils/libtap.a test_uatomic_SOURCES = test_uatomic.c diff --git a/tests/utils/Makefile.am b/tests/utils/Makefile.am index 6f45810..440ac38 100644 --- a/tests/utils/Makefile.am +++ b/tests/utils/Makefile.am @@ -1,3 +1,5 @@ +AM_CFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src + noinst_LIBRARIES = libtap.a libtap_a_SOURCES = tap.c tap.h diff --git a/tests/utils/tap.c b/tests/utils/tap.c index 6acab66..573ae33 100644 --- a/tests/utils/tap.c +++ b/tests/utils/tap.c @@ -24,7 +24,6 @@ * SUCH DAMAGE. */ -#define _GNU_SOURCE #include #include #include -- 2.34.1