summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-06-28 07:46:38 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-06-28 07:46:38 (GMT)
commitab1e5858eea540e50e8acccdbd37ff86a5afdd19 (patch)
tree90bbeb11bf9e83b41613b4d0526e5e72ae102186 /configure.in
parentafec8e3bde02048524bd1b19d7b2c7c3cc175057 (diff)
downloadcpython-ab1e5858eea540e50e8acccdbd37ff86a5afdd19.zip
cpython-ab1e5858eea540e50e8acccdbd37ff86a5afdd19.tar.gz
cpython-ab1e5858eea540e50e8acccdbd37ff86a5afdd19.tar.bz2
Patch #758910: Add pthread flag to CXX if possible.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in41
1 files changed, 41 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index fb1c962..bfe1e38 100644
--- a/configure.in
+++ b/configure.in
@@ -832,6 +832,47 @@ CC="$ac_save_cc"])
AC_MSG_RESULT($ac_cv_pthread)
fi
+# If we have set a CC compiler flag for thread support then
+# check if it works for CXX, too.
+ac_cv_cxx_thread=no
+if test ! -z "$CXX"
+then
+AC_MSG_CHECKING(whether $CXX also accepts flags for thread support)
+ac_save_cxx="$CXX"
+
+if test "$ac_cv_kpthread" = "yes"
+then
+ CXX="$CXX -Kpthread"
+ ac_cv_cxx_thread=yes
+elif test "$ac_cv_kthread" = "yes"
+then
+ CXX="$CXX -Kthread"
+ ac_cv_cxx_thread=yes
+elif test "$ac_cv_pthread" = "yes"
+then
+ CXX="$CXX -pthread"
+ ac_cv_cxx_thread=yes
+fi
+
+if test $ac_cv_cxx_thread = yes
+then
+ echo 'void foo();int main(){foo();}void foo(){}' > conftest.$ac_ext
+ $CXX -c conftest.$ac_ext 2>&5
+ if $CXX -o conftest$ac_exeext conftest.$ac_objext 2>&5 \
+ && test -s conftest$ac_exeext && ./conftest$ac_exeext
+ then
+ ac_cv_cxx_thread=yes
+ else
+ ac_cv_cxx_thread=no
+ CXX="$ac_save_cxx"
+ fi
+ rm -fr conftest*
+else
+ CXX="$ac_save_cxx"
+fi
+fi
+AC_MSG_RESULT($ac_cv_cxx_thread)
+
dnl # check for ANSI or K&R ("traditional") preprocessor
dnl AC_MSG_CHECKING(for C preprocessor type)
dnl AC_TRY_COMPILE([