summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-09-21 15:23:17 +0400
committerIvan Maidanski <ivmai@mail.ru>2011-09-21 15:23:17 +0400
commit49a5fa61ad919162bff1d11c71f3d09a68166271 (patch)
treeae437e3df4e113188d7331780109e5753458be3d
parentca69f7f89202a78a29d276a2ecfbc55642e5d780 (diff)
downloadlibatomic_ops-49a5fa61ad919162bff1d11c71f3d09a68166271.tar.gz
Regenerate configure, test_atomic_include.h; update ChangeLog
-rw-r--r--ChangeLog44
-rwxr-xr-xconfigure33
-rw-r--r--tests/Makefile.in35
-rw-r--r--tests/test_atomic_include.h33
4 files changed, 114 insertions, 31 deletions
diff --git a/ChangeLog b/ChangeLog
index 57e6dc2..ac86f7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,46 @@
-2011-08-10 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
+2011-09-21 Ivan Maidanski <ivmai@mail.ru>
+
+ * configure: Regenerate.
+ * tests/Makefile.in: Ditto.
+ * tests/test_atomic_include.h: Ditto.
+
+2011-09-21 Ivan Maidanski <ivmai@mail.ru>
+
+ * configure.ac (PICFLAG, THREADDLLIBS): Define as empty for MinGW.
+ * configure.ac (have_pthreads): New definition (set to true unless
+ MinGW).
+ * configure.ac (HAVE_PTHREAD_H): New AM conditional (based on
+ have_pthreads value).
+ * tests/Makefile.am (test_atomic_pthreads_SOURCES,
+ test_atomic_pthreads_CPPFLAGS, test_atomic_pthreads_LDADD): Define
+ only if HAVE_PTHREAD_H.
+ * tests/Makefile.am (TESTS): Don't include test_atomic_pthreads unless
+ HAVE_PTHREAD_H.
+ * tests/Makefile.am (check_PROGRAMS): Define to TESTS value.
+
+2011-09-21 Ivan Maidanski <ivmai@mail.ru>
+
+ * configure.ac (PICFLAG): Set to -fPIC if GCC but not Gygwin.
+
+2011-09-21 Ivan Maidanski <ivmai@mail.ru>
+
+ * tests/test_malloc.c (LIST_LENGTH, LARGE_OBJ_SIZE): Define to
+ a smaller value unless HAVE_MMAP.
+
+2011-09-21 Ivan Maidanski <ivmai@mail.ru>
+
+ * tests/test_malloc.c (cons, run_one_test): Call exit with a non-zero
+ code (instead of abort) if out of memory.
+ * tests/test_stack.c (add_elements): Likewise.
+ * tests/test_stack.c (main): Use a distinct exit code if a thread
+ creation failed.
+
+2011-09-15 Ivan Maidanski <ivmai@mail.ru>
+
+ * src/atomic_ops/sysdeps/emul_cas.h: Fix a typo (replace AO_FORCE_CAS
+ with AO_REQUIRE_CAS in a comment).
+
+2011-09-08 Ivan Maidanski <ivmai@mail.ru> (really Petter Urkedal)
* src/Makefile.am, tests/Makefile.am: Set compiler include paths
to $(top_builddir)/src and $(top_srcdir)/src.
diff --git a/configure b/configure
index 75bbeb5..77f6868 100755
--- a/configure
+++ b/configure
@@ -606,6 +606,8 @@ LTLIBOBJS
LIBOBJS
NEED_ASM_FALSE
NEED_ASM_TRUE
+HAVE_PTHREAD_H_FALSE
+HAVE_PTHREAD_H_TRUE
THREADDLLIBS
PICFLAG
EGREP
@@ -4728,14 +4730,22 @@ PICFLAG=
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Determining PIC compiler flag" >&5
$as_echo_n "checking Determining PIC compiler flag... " >&6; }
if test "$GCC" = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: -fPIC" >&5
-$as_echo "-fPIC" >&6; }
- PICFLAG=-fPIC
case "$host" in
*-*-solaris*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: -fPIC" >&5
+$as_echo "-fPIC" >&6; }
+ PICFLAG=-fPIC
# Workaround: at least GCC 3.4.6 does not define this macro.
CFLAGS="$CFLAGS -D__PIC__=1"
;;
+ *-*-cygwin* | *-*-mingw*)
+ # Cygwin and Mingw[-w32/64] do not need -fPIC.
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: -fPIC" >&5
+$as_echo "-fPIC" >&6; }
+ PICFLAG=-fPIC
+ ;;
esac
else
case "$host" in
@@ -4771,6 +4781,7 @@ CFLAGS="$CFLAGS -DNDEBUG"
THREADDLLIBS=
+have_pthreads=true
## Libraries needed to support threads.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_self in -lpthread" >&5
$as_echo_n "checking for pthread_self in -lpthread... " >&6; }
@@ -4826,9 +4837,21 @@ case "$host" in
*-*-cygwin* | *-*-darwin*)
THREADDLLIBS=
;;
+ *-*-mingw*)
+ THREADDLLIBS=
+ have_pthreads=false
+ ;;
esac
+ if test x$have_pthreads = xtrue; then
+ HAVE_PTHREAD_H_TRUE=
+ HAVE_PTHREAD_H_FALSE='#'
+else
+ HAVE_PTHREAD_H_TRUE='#'
+ HAVE_PTHREAD_H_FALSE=
+fi
+
if test x$need_asm = xtrue; then
NEED_ASM_TRUE=
NEED_ASM_FALSE='#'
@@ -4971,6 +4994,10 @@ if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${HAVE_PTHREAD_H_TRUE}" && test -z "${HAVE_PTHREAD_H_FALSE}"; then
+ as_fn_error $? "conditional \"HAVE_PTHREAD_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${NEED_ASM_TRUE}" && test -z "${NEED_ASM_FALSE}"; then
as_fn_error $? "conditional \"NEED_ASM\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 481f4f4..2538fe5 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -34,10 +34,12 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
-TESTS = test_atomic$(EXEEXT) test_atomic_pthreads$(EXEEXT) \
- test_stack$(EXEEXT) test_malloc$(EXEEXT)
-check_PROGRAMS = test_atomic$(EXEEXT) test_atomic_pthreads$(EXEEXT) \
- test_stack$(EXEEXT) test_malloc$(EXEEXT)
+@HAVE_PTHREAD_H_FALSE@TESTS = test_atomic$(EXEEXT) test_stack$(EXEEXT) \
+@HAVE_PTHREAD_H_FALSE@ test_malloc$(EXEEXT)
+@HAVE_PTHREAD_H_TRUE@TESTS = test_atomic$(EXEEXT) \
+@HAVE_PTHREAD_H_TRUE@ test_atomic_pthreads$(EXEEXT) \
+@HAVE_PTHREAD_H_TRUE@ test_stack$(EXEEXT) test_malloc$(EXEEXT)
+check_PROGRAMS = $(am__EXEEXT_1)
subdir = tests
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -48,16 +50,24 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/src/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
+@HAVE_PTHREAD_H_FALSE@am__EXEEXT_1 = test_atomic$(EXEEXT) \
+@HAVE_PTHREAD_H_FALSE@ test_stack$(EXEEXT) test_malloc$(EXEEXT)
+@HAVE_PTHREAD_H_TRUE@am__EXEEXT_1 = test_atomic$(EXEEXT) \
+@HAVE_PTHREAD_H_TRUE@ test_atomic_pthreads$(EXEEXT) \
+@HAVE_PTHREAD_H_TRUE@ test_stack$(EXEEXT) test_malloc$(EXEEXT)
am_test_atomic_OBJECTS = test_atomic.$(OBJEXT)
test_atomic_OBJECTS = $(am_test_atomic_OBJECTS)
am__DEPENDENCIES_1 =
test_atomic_DEPENDENCIES = $(am__DEPENDENCIES_1) \
../src/libatomic_ops.a
-am_test_atomic_pthreads_OBJECTS = \
- test_atomic_pthreads-test_atomic.$(OBJEXT)
+am__test_atomic_pthreads_SOURCES_DIST = test_atomic.c
+am__objects_1 = test_atomic_pthreads-test_atomic.$(OBJEXT)
+@HAVE_PTHREAD_H_TRUE@am_test_atomic_pthreads_OBJECTS = \
+@HAVE_PTHREAD_H_TRUE@ $(am__objects_1)
test_atomic_pthreads_OBJECTS = $(am_test_atomic_pthreads_OBJECTS)
-test_atomic_pthreads_DEPENDENCIES = $(am__DEPENDENCIES_1) \
- ../src/libatomic_ops.a
+am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) ../src/libatomic_ops.a
+@HAVE_PTHREAD_H_TRUE@test_atomic_pthreads_DEPENDENCIES = \
+@HAVE_PTHREAD_H_TRUE@ $(am__DEPENDENCIES_2)
am_test_malloc_OBJECTS = test_malloc.$(OBJEXT)
test_malloc_OBJECTS = $(am_test_malloc_OBJECTS)
test_malloc_DEPENDENCIES = $(am__DEPENDENCIES_1) \
@@ -76,7 +86,8 @@ CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(test_atomic_SOURCES) $(test_atomic_pthreads_SOURCES) \
$(test_malloc_SOURCES) $(test_stack_SOURCES)
-DIST_SOURCES = $(test_atomic_SOURCES) $(test_atomic_pthreads_SOURCES) \
+DIST_SOURCES = $(test_atomic_SOURCES) \
+ $(am__test_atomic_pthreads_SOURCES_DIST) \
$(test_malloc_SOURCES) $(test_stack_SOURCES)
ETAGS = etags
CTAGS = ctags
@@ -195,11 +206,11 @@ EXTRA_DIST = test_atomic.template list_atomic.template run_parallel.inc \
BUILT_SOURCES = test_atomic_include.h list_atomic.i
CLEANFILES = list_atomic.i
AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
+@HAVE_PTHREAD_H_TRUE@test_atomic_pthreads_SOURCES = $(test_atomic_SOURCES)
+@HAVE_PTHREAD_H_TRUE@test_atomic_pthreads_CPPFLAGS = -DAO_USE_PTHREAD_DEFS $(AM_CPPFLAGS)
+@HAVE_PTHREAD_H_TRUE@test_atomic_pthreads_LDADD = $(test_atomic_LDADD)
test_atomic_SOURCES = test_atomic.c
test_atomic_LDADD = $(THREADDLLIBS) ../src/libatomic_ops.a
-test_atomic_pthreads_SOURCES = test_atomic.c
-test_atomic_pthreads_CPPFLAGS = -DAO_USE_PTHREAD_DEFS $(AM_CPPFLAGS)
-test_atomic_pthreads_LDADD = $(THREADDLLIBS) ../src/libatomic_ops.a
test_stack_SOURCES = test_stack.c
test_stack_LDADD = $(THREADDLLIBS) ../src/libatomic_ops_gpl.a \
../src/libatomic_ops.a
diff --git a/tests/test_atomic_include.h b/tests/test_atomic_include.h
index 0297f23..c9970ab 100644
--- a/tests/test_atomic_include.h
+++ b/tests/test_atomic_include.h
@@ -10,7 +10,7 @@
#undef TA_assert
#define TA_assert(e) \
if (!(e)) { fprintf(stderr, "Assertion failed %s:%d (barrier: )\n", \
- __FILE__, __LINE__), exit(1); }
+ __FILE__, __LINE__), exit(1); }
#undef MISSING
#define MISSING(name) \
@@ -200,7 +200,7 @@ void test_atomic(void)
}
-
+
/*
* Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
*
@@ -213,7 +213,7 @@ void test_atomic(void)
#undef TA_assert
#define TA_assert(e) \
if (!(e)) { fprintf(stderr, "Assertion failed %s:%d (barrier: _release)\n", \
- __FILE__, __LINE__), exit(1); }
+ __FILE__, __LINE__), exit(1); }
#undef MISSING
#define MISSING(name) \
@@ -403,7 +403,7 @@ void test_atomic_release(void)
}
-
+
/*
* Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
*
@@ -416,7 +416,7 @@ void test_atomic_release(void)
#undef TA_assert
#define TA_assert(e) \
if (!(e)) { fprintf(stderr, "Assertion failed %s:%d (barrier: _acquire)\n", \
- __FILE__, __LINE__), exit(1); }
+ __FILE__, __LINE__), exit(1); }
#undef MISSING
#define MISSING(name) \
@@ -606,7 +606,7 @@ void test_atomic_acquire(void)
}
-
+
/*
* Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
*
@@ -619,7 +619,7 @@ void test_atomic_acquire(void)
#undef TA_assert
#define TA_assert(e) \
if (!(e)) { fprintf(stderr, "Assertion failed %s:%d (barrier: _read)\n", \
- __FILE__, __LINE__), exit(1); }
+ __FILE__, __LINE__), exit(1); }
#undef MISSING
#define MISSING(name) \
@@ -809,7 +809,7 @@ void test_atomic_read(void)
}
-
+
/*
* Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
*
@@ -822,7 +822,7 @@ void test_atomic_read(void)
#undef TA_assert
#define TA_assert(e) \
if (!(e)) { fprintf(stderr, "Assertion failed %s:%d (barrier: _write)\n", \
- __FILE__, __LINE__), exit(1); }
+ __FILE__, __LINE__), exit(1); }
#undef MISSING
#define MISSING(name) \
@@ -1012,7 +1012,7 @@ void test_atomic_write(void)
}
-
+
/*
* Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
*
@@ -1025,7 +1025,7 @@ void test_atomic_write(void)
#undef TA_assert
#define TA_assert(e) \
if (!(e)) { fprintf(stderr, "Assertion failed %s:%d (barrier: _full)\n", \
- __FILE__, __LINE__), exit(1); }
+ __FILE__, __LINE__), exit(1); }
#undef MISSING
#define MISSING(name) \
@@ -1215,7 +1215,7 @@ void test_atomic_full(void)
}
-
+
/*
* Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
*
@@ -1228,7 +1228,7 @@ void test_atomic_full(void)
#undef TA_assert
#define TA_assert(e) \
if (!(e)) { fprintf(stderr, "Assertion failed %s:%d (barrier: _release_write)\n", \
- __FILE__, __LINE__), exit(1); }
+ __FILE__, __LINE__), exit(1); }
#undef MISSING
#define MISSING(name) \
@@ -1418,7 +1418,7 @@ void test_atomic_release_write(void)
}
-
+
/*
* Copyright (c) 2003 by Hewlett-Packard Company. All rights reserved.
*
@@ -1431,7 +1431,7 @@ void test_atomic_release_write(void)
#undef TA_assert
#define TA_assert(e) \
if (!(e)) { fprintf(stderr, "Assertion failed %s:%d (barrier: _acquire_read)\n", \
- __FILE__, __LINE__), exit(1); }
+ __FILE__, __LINE__), exit(1); }
#undef MISSING
#define MISSING(name) \
@@ -1619,3 +1619,6 @@ void test_atomic_acquire_read(void)
MISSING(AO_compare_and_swap_double);
# endif
}
+
+
+