Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Unity-Technologies/bdwgc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2017-06-07 11:53:14 +0300
committerIvan Maidanski <ivmai@mail.ru>2017-06-07 11:53:14 +0300
commit8106b298c43efe8319a680f11ef4855a29615698 (patch)
treecfc23090f0adbbf26d0918709367be90d6b92afc /configure.ac
parent224643ec4ca3d1534dc1ef78e4fc2c62ea35d007 (diff)
Group common defines for POSIX platforms in configure and CMake scripts
(code refactoring) * CMakeLists.txt [CMAKE_USE_PTHREADS_INIT]: Eliminate duplication of ADD_DEFINITIONS of GC_THREADS, _REENTRANT, PARALLEL_MARK, THREAD_LOCAL_ALLOC (and AC_MSG_WARN) for aix, cygwin, darwin, freebsd, gnu (including kfreebsd), hpux11, irix, linux, nacl, netbsd, openbsd, osf, solaris platforms; add comment. * configure.ac [THREADS=posix]: Likewise. * configure.ac [THREADS=posix]: Remove explicit hpux10 case handling.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac103
1 files changed, 26 insertions, 77 deletions
diff --git a/configure.ac b/configure.ac
index 32865b98..292d6853 100644
--- a/configure.ac
+++ b/configure.ac
@@ -168,104 +168,66 @@ case "$THREADS" in
;;
posix | pthreads)
THREADS=posix
- AC_CHECK_LIB(pthread, pthread_self, THREADDLLIBS="-lpthread",,)
+ # Common defines for most POSIX platforms.
case "$host" in
- *-*-aix* | *-*-irix* | *-*-*linux* | *-*-nacl*)
+ *-*-aix* | *-*-cygwin* | *-*-darwin* | *-*-freebsd* | *-*-hpux11* | \
+ *-*-irix* | *-*-kfreebsd*-gnu | *-*-gnu* | *-*-*linux* | *-*-nacl* | \
+ *-*-netbsd* | *-*-openbsd* | *-*-osf* | *-*-solaris*)
AC_DEFINE(GC_THREADS)
- AC_DEFINE(_REENTRANT)
+ AC_DEFINE([_REENTRANT], [1],
+ [Required define if using POSIX threads.])
if test "${enable_parallel_mark}" != no; then
AC_DEFINE(PARALLEL_MARK)
fi
AC_DEFINE(THREAD_LOCAL_ALLOC)
AC_MSG_WARN("Explicit GC_INIT() calls may be required.")
;;
- *-*-hpux11*)
+ esac
+ AC_CHECK_LIB(pthread, pthread_self, THREADDLLIBS="-lpthread",,)
+ case "$host" in
+ *-*-aix* | *-*-irix* | *-*-*linux* | *-*-nacl*)
+ # The default THREADDLLIBS.
+ ;;
+ *-*-hpux11*)
AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.")
- AC_DEFINE(GC_THREADS)
AC_DEFINE(_POSIX_C_SOURCE,199506L)
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
- AC_MSG_WARN("Explicit GC_INIT() calls may be required.")
THREADDLLIBS="-lpthread -lrt"
# HPUX needs REENTRANT for the _r calls.
- AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads.])
;;
- *-*-hpux10*)
- AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.")
- ;;
- *-*-openbsd*)
- AC_DEFINE(GC_THREADS)
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
- THREADDLLIBS=-pthread
+ *-*-openbsd*)
AM_CFLAGS="$AM_CFLAGS -pthread"
+ THREADDLLIBS=-pthread
;;
- *-*-freebsd*)
- AC_DEFINE(GC_THREADS)
+ *-*-freebsd*)
AM_CFLAGS="$AM_CFLAGS -pthread"
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
;;
- *-*-kfreebsd*-gnu)
- AC_DEFINE(GC_THREADS)
+ *-*-kfreebsd*-gnu)
AM_CFLAGS="$AM_CFLAGS -pthread"
- THREADDLLIBS=-pthread
- AC_DEFINE(_REENTRANT)
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
AC_DEFINE(USE_COMPILER_TLS)
+ THREADDLLIBS=-pthread
;;
- *-*-gnu*) # Excluding kfreebsd.
- AC_DEFINE(GC_THREADS)
- AC_DEFINE(_REENTRANT)
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
+ *-*-gnu*) # Excluding kfreebsd.
+ # The default THREADDLLIBS.
;;
- *-*-netbsd*)
+ *-*-netbsd*)
AC_MSG_WARN("Only on NetBSD 2.0 or later.")
- AC_DEFINE(GC_THREADS)
- AC_DEFINE(_REENTRANT)
AC_DEFINE(_PTHREADS)
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
THREADDLLIBS="-lpthread -lrt"
;;
- *-*-solaris*)
- AC_DEFINE(GC_THREADS)
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
+ *-*-solaris*)
# Need to use alternate thread library, otherwise gctest hangs
# on Solaris 8.
multi_os_directory=`$CC -print-multi-os-directory`
THREADDLLIBS="-L/usr/lib/lwp/$multi_os_directory \
-R/usr/lib/lwp/$multi_os_directory -lpthread -lrt"
;;
- *-*-cygwin*)
- AC_DEFINE(GC_THREADS)
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
+ *-*-cygwin*)
# Cygwin doesn't have a real libpthread, so Libtool can't link
# against it.
THREADDLLIBS=""
win32_threads=true
;;
- *-*-mingw*)
+ *-*-mingw*)
AC_DEFINE(GC_WIN32_PTHREADS)
# Using pthreads-win32 (or other non-Cygwin pthreads) library.
if test "${enable_parallel_mark}" != no; then
@@ -275,23 +237,10 @@ case "$THREADS" in
THREADDLLIBS="-lpthread"
win32_threads=true
;;
- *-*-darwin*)
- AC_DEFINE(GC_THREADS)
- AC_MSG_WARN("Explicit GC_INIT() calls may be required.")
- # Parallel-mark is not well-tested on Darwin
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
+ *-*-darwin*)
darwin_threads=true
;;
- *-*-osf*)
- AC_DEFINE(GC_THREADS)
- if test "${enable_parallel_mark}" != no; then
- AC_DEFINE(PARALLEL_MARK)
- fi
- AC_DEFINE(THREAD_LOCAL_ALLOC)
- AC_MSG_WARN("Explicit GC_INIT() calls may be required.")
+ *-*-osf*)
AM_CFLAGS="$AM_CFLAGS -pthread"
THREADDLLIBS="-lpthread -lrt"
;;