mirror of https://gitee.com/bigwinds/arangodb
79 lines
2.0 KiB
Plaintext
79 lines
2.0 KiB
Plaintext
dnl -*- mode: Autoconf; -*-
|
|
|
|
dnl -----------------------------------------------------------------------------------------
|
|
dnl pthreads
|
|
dnl -----------------------------------------------------------------------------------------
|
|
|
|
AC_MSG_NOTICE([................................................................................])
|
|
AC_MSG_NOTICE([CHECKING FOR PTHREADS])
|
|
AC_MSG_NOTICE([................................................................................])
|
|
|
|
AC_LANG(C)
|
|
|
|
ACX_PTHREAD(tr_PTHREAD=yes, tr_PTHREAD=no)
|
|
|
|
if test "x$tr_PTHREAD" = xno; then
|
|
AC_MSG_ERROR([please install the pthread library])
|
|
fi
|
|
|
|
CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}"
|
|
CXXFLAGS="${CXXFLAGS} ${PTHREAD_CFLAGS}"
|
|
LDFLAGS="${LDFLAGS} ${PTHREAD_CFLAGS}"
|
|
LIBS="${LIBS} ${PTHREAD_LIBS} "
|
|
|
|
AC_LANG(C++)
|
|
|
|
SAVE_LDFLAGS="$LDFLAGS"
|
|
LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
|
|
|
|
AC_MSG_CHECKING([broken __cxa_guard])
|
|
|
|
AC_RUN_IFELSE([AC_LANG_PROGRAM(
|
|
[[
|
|
#include <pthread.h>
|
|
#include <string>
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
class A {
|
|
public:
|
|
std::string& a () {
|
|
static std::string empty;
|
|
return empty;
|
|
}
|
|
};
|
|
]],
|
|
[[
|
|
pthread_mutex_init(&mutex, 0);
|
|
A a;
|
|
a.a();
|
|
return 0;
|
|
]])],
|
|
[tr_cv_broken_cxa_guard=no],
|
|
[tr_cv_broken_cxa_guard=yes],
|
|
[tr_cv_broken_cxa_guard=yes])
|
|
|
|
AC_MSG_RESULT($tr_cv_broken_cxa_guard)
|
|
|
|
LDFLAGS="$SAVE_LDFLAGS"
|
|
|
|
if test "x$tr_cv_broken_cxa_guard" = xyes; then
|
|
AC_DEFINE([BROKEN_CXA_GUARD], [1], [static programs have broken cxa_guard])
|
|
fi
|
|
|
|
dnl -----------------------------------------------------------------------------------------
|
|
dnl option for lock checking
|
|
dnl -----------------------------------------------------------------------------------------
|
|
|
|
AC_ARG_ENABLE(lock-check,
|
|
AS_HELP_STRING([--enable-lock-check], [enables lock checking (default: no)]),
|
|
tr_LOCK_CHECK="${enableval:-yes}",
|
|
tr_LOCK_CHECK=no
|
|
)
|
|
|
|
if test "x$tr_LOCK_CHECK" = xyes; then
|
|
AC_DEFINE_UNQUOTED(TRI_ENABLE_LOCK_CHECK, 1, [true if lock checking should be performed])
|
|
fi
|
|
|
|
AM_CONDITIONAL(ENABLE_LOCK_CHECK, test "x$tr_LOCK_CHECK" = xyes)
|