Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 26 additions & 95 deletions config/ompi_config_pthreads.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2014 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
Expand Down Expand Up @@ -175,43 +177,15 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_C], [
#
if test "$ompi_pthread_c_success" = "0"; then
AC_MSG_CHECKING([if C compiler and POSIX threads work as is])
if test "$HAVE_POSIX_THREADS" = "1" ; then
run_this_test=1
else
case "${host_cpu}-${host_os}" in
*solaris*)
AC_MSG_RESULT([no - Solaris, not checked])
run_this_test=0
;;
*-aix* | *-freebsd*)
if test "`echo $CPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
PTHREAD_CPPFLAGS="-D_THREAD_SAFE"
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
fi
run_this_test=1
;;
*)
if test "`echo $CPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
PTHREAD_CPPFLAGS="-D_REENTRANT"
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
fi
run_this_test=1
;;
esac
fi

if test "$run_this_test" = "1" ; then
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
ompi_pthread_c_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_c_success" = "1"; then
AC_MSG_RESULT([yes])
else
PTHREAD_CPPFLAGS=
CPPFLAGS="$orig_CPPFLAGS"
AC_MSG_RESULT([no])
fi
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
ompi_pthread_c_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_c_success" = "1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
])dnl
Expand All @@ -223,43 +197,15 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_CXX], [
#
if test "$ompi_pthread_cxx_success" = "0"; then
AC_MSG_CHECKING([if C++ compiler and POSIX threads work as is])
if test "$HAVE_POSIX_THREADS" = "1" ; then
run_this_test=1
else
case "${host_cpu}-${host_os}" in
*solaris*)
AC_MSG_RESULT([no - Solaris, not checked])
run_this_test=0
;;
*-aix* | *-freebsd*)
if test "`echo $CXXCPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
PTHREAD_CXXCPPFLAGS="-D_THREAD_SAFE"
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
fi
run_this_test=1
;;
*)
if test "`echo $CXXCPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
PTHREAD_CXXCPPFLAGS="-D_REENTRANT"
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
fi
run_this_test=1
;;
esac
fi

if test "$run_this_test" = "1" ; then
AC_LANG_PUSH(C++)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
ompi_pthread_cxx_success=0)
AC_LANG_POP(C++)
if test "$ompi_pthread_cxx_success" = "1"; then
AC_MSG_RESULT([yes])
else
PTHREAD_CXXCPPFLAGS=
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
AC_MSG_RESULT([no])
fi
AC_LANG_PUSH(C++)
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
ompi_pthread_cxx_success=0)
AC_LANG_POP(C++)
if test "$ompi_pthread_cxx_success" = "1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
])dnl
Expand All @@ -271,30 +217,15 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_FC], [
#
if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1" -a $ompi_fortran_happy -eq 1; then
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work as is])
if test "$HAVE_POSIX_THREADS" = "1" ; then
run_this_test=1
else
case "${host_cpu}-${host_os}" in
*solaris*)
AC_MSG_RESULT([no - Solaris, not checked])
run_this_test=0
;;
*)
run_this_test=1
;;
esac
fi

if test "$run_this_test" = "1" ; then
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
ompi_pthread_fortran_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_fortran_success" = "1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_LANG_PUSH(C)
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
ompi_pthread_fortran_success=0)
AC_LANG_POP(C)
if test "$ompi_pthread_fortran_success" = "1"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
])dnl
Expand Down
Loading