summaryrefslogtreecommitdiff
path: root/m4/threads.m4
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2000-02-07 04:45:55 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2000-02-07 04:45:55 +0000
commit2c694d040890606faddd2e1a175aabc9f19f7b2b (patch)
tree682f4a34cb4a5cbbc473053efa634bc8501c042a /m4/threads.m4
parent294626759de40a9b92b92fd5c67d098afe47d46d (diff)
downloadATCD-2c694d040890606faddd2e1a175aabc9f19f7b2b.tar.gz
ChangeLogTag:Sun Feb 6 20:44:26 2000 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'm4/threads.m4')
-rw-r--r--m4/threads.m422
1 files changed, 22 insertions, 0 deletions
diff --git a/m4/threads.m4 b/m4/threads.m4
index ed9d8db0702..e6633662325 100644
--- a/m4/threads.m4
+++ b/m4/threads.m4
@@ -37,6 +37,23 @@ dnl AC_REQUIRE([AC_LANG_CPLUSPLUS])
ACE_CACHE_CHECK(if compiler may need a thread flag,
ace_cv_feature_may_need_thread_flag,
[
+ ifelse(AC_LANG, [CPLUSPLUS],
+ [ace_save_CXXFLAGS="$CXXFLAGS"
+ case "$target" in
+ *solaris2*)
+ dnl Sun C++ 4.2/5.0 weirdness
+ dnl Sun C++ 4.2/5.0 links a thread function stub library in
+ dnl the single threaded case, which causes the link test in
+ dnl ACE_CHECK_THREAD_FLAGS to pass.
+ if (CC -V 2>&1 | egrep 'Compilers 4\.2' > /dev/null) \
+ || (CC -V 2>&1 | egrep 'Compilers 5\.0' > /dev/null); then
+ CXXFLAGS="-xnolib"
+ fi
+ ;;
+ esac
+ ],
+ [ace_save_CFLAGS="$CFLAGS"])
+
ACE_CHECK_THREAD_FLAGS(
[
ace_cv_feature_may_need_thread_flag=no
@@ -44,6 +61,11 @@ dnl AC_REQUIRE([AC_LANG_CPLUSPLUS])
[
ace_cv_feature_may_need_thread_flag=yes
])
+ dnl Reset the flags to a consistent state.
+ dnl This prevents duplicate flags from being added to
+ dnl the C/CXXFLAGS variable.
+ ifelse(AC_LANG, [CPLUSPLUS],
+ [CXXFLAGS="$ace_save_CXXFLAGS"],[CFLAGS="$ace_save_CFLAGS"])
],
[
dnl The compiler/platform has no thread support linked in by default