Skip to content

Commit 4309a3b

Browse files
author
rhc54
committed
Merge pull request #4 from ggouaillardet/topic/fix-solaris-threads
Topic/fix solaris threads RM-approved
2 parents bb3e8dc + 1e043a8 commit 4309a3b

File tree

2 files changed

+26
-346
lines changed

2 files changed

+26
-346
lines changed

config/ompi_config_pthreads.m4

Lines changed: 26 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ dnl University of Stuttgart. All rights reserved.
1010
dnl Copyright (c) 2004-2005 The Regents of the University of California.
1111
dnl All rights reserved.
1212
dnl Copyright (c) 2012 Cisco Systems, Inc. All rights reserved.
13+
dnl Copyright (c) 2014 Research Organization for Information Science
14+
dnl and Technology (RIST). All rights reserved.
1315
dnl $COPYRIGHT$
1416
dnl
1517
dnl Additional copyrights may follow
@@ -175,43 +177,15 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_C], [
175177
#
176178
if test "$ompi_pthread_c_success" = "0"; then
177179
AC_MSG_CHECKING([if C compiler and POSIX threads work as is])
178-
if test "$HAVE_POSIX_THREADS" = "1" ; then
179-
run_this_test=1
180-
else
181-
case "${host_cpu}-${host_os}" in
182-
*solaris*)
183-
AC_MSG_RESULT([no - Solaris, not checked])
184-
run_this_test=0
185-
;;
186-
*-aix* | *-freebsd*)
187-
if test "`echo $CPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
188-
PTHREAD_CPPFLAGS="-D_THREAD_SAFE"
189-
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
190-
fi
191-
run_this_test=1
192-
;;
193-
*)
194-
if test "`echo $CPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
195-
PTHREAD_CPPFLAGS="-D_REENTRANT"
196-
CPPFLAGS="$CPPFLAGS $PTHREAD_CPPFLAGS"
197-
fi
198-
run_this_test=1
199-
;;
200-
esac
201-
fi
202180
203-
if test "$run_this_test" = "1" ; then
204-
AC_LANG_PUSH(C)
205-
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
206-
ompi_pthread_c_success=0)
207-
AC_LANG_POP(C)
208-
if test "$ompi_pthread_c_success" = "1"; then
209-
AC_MSG_RESULT([yes])
210-
else
211-
PTHREAD_CPPFLAGS=
212-
CPPFLAGS="$orig_CPPFLAGS"
213-
AC_MSG_RESULT([no])
214-
fi
181+
AC_LANG_PUSH(C)
182+
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_c_success=1,
183+
ompi_pthread_c_success=0)
184+
AC_LANG_POP(C)
185+
if test "$ompi_pthread_c_success" = "1"; then
186+
AC_MSG_RESULT([yes])
187+
else
188+
AC_MSG_RESULT([no])
215189
fi
216190
fi
217191
])dnl
@@ -223,43 +197,15 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_CXX], [
223197
#
224198
if test "$ompi_pthread_cxx_success" = "0"; then
225199
AC_MSG_CHECKING([if C++ compiler and POSIX threads work as is])
226-
if test "$HAVE_POSIX_THREADS" = "1" ; then
227-
run_this_test=1
228-
else
229-
case "${host_cpu}-${host_os}" in
230-
*solaris*)
231-
AC_MSG_RESULT([no - Solaris, not checked])
232-
run_this_test=0
233-
;;
234-
*-aix* | *-freebsd*)
235-
if test "`echo $CXXCPPFLAGS | $GREP 'D_THREAD_SAFE'`" = ""; then
236-
PTHREAD_CXXCPPFLAGS="-D_THREAD_SAFE"
237-
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
238-
fi
239-
run_this_test=1
240-
;;
241-
*)
242-
if test "`echo $CXXCPPFLAGS | $GREP 'D_REENTRANT'`" = ""; then
243-
PTHREAD_CXXCPPFLAGS="-D_REENTRANT"
244-
CXXCPPFLAGS="$CXXCPPFLAGS $PTHREAD_CXXCPPFLAGS"
245-
fi
246-
run_this_test=1
247-
;;
248-
esac
249-
fi
250200
251-
if test "$run_this_test" = "1" ; then
252-
AC_LANG_PUSH(C++)
253-
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
254-
ompi_pthread_cxx_success=0)
255-
AC_LANG_POP(C++)
256-
if test "$ompi_pthread_cxx_success" = "1"; then
257-
AC_MSG_RESULT([yes])
258-
else
259-
PTHREAD_CXXCPPFLAGS=
260-
CXXCPPFLAGS="$orig_CXXCPPFLAGS"
261-
AC_MSG_RESULT([no])
262-
fi
201+
AC_LANG_PUSH(C++)
202+
OMPI_INTL_PTHREAD_TRY_LINK(ompi_pthread_cxx_success=1,
203+
ompi_pthread_cxx_success=0)
204+
AC_LANG_POP(C++)
205+
if test "$ompi_pthread_cxx_success" = "1"; then
206+
AC_MSG_RESULT([yes])
207+
else
208+
AC_MSG_RESULT([no])
263209
fi
264210
fi
265211
])dnl
@@ -271,30 +217,15 @@ AC_DEFUN([OMPI_INTL_POSIX_THREADS_PLAIN_FC], [
271217
#
272218
if test "$ompi_pthread_fortran_success" = "0" -a "$OMPI_WANT_FORTRAN_BINDINGS" = "1" -a $ompi_fortran_happy -eq 1; then
273219
AC_MSG_CHECKING([if Fortran compiler and POSIX threads work as is])
274-
if test "$HAVE_POSIX_THREADS" = "1" ; then
275-
run_this_test=1
276-
else
277-
case "${host_cpu}-${host_os}" in
278-
*solaris*)
279-
AC_MSG_RESULT([no - Solaris, not checked])
280-
run_this_test=0
281-
;;
282-
*)
283-
run_this_test=1
284-
;;
285-
esac
286-
fi
287220
288-
if test "$run_this_test" = "1" ; then
289-
AC_LANG_PUSH(C)
290-
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
291-
ompi_pthread_fortran_success=0)
292-
AC_LANG_POP(C)
293-
if test "$ompi_pthread_fortran_success" = "1"; then
294-
AC_MSG_RESULT([yes])
295-
else
296-
AC_MSG_RESULT([no])
297-
fi
221+
AC_LANG_PUSH(C)
222+
OMPI_INTL_PTHREAD_TRY_LINK_FORTRAN(ompi_pthread_fortran_success=1,
223+
ompi_pthread_fortran_success=0)
224+
AC_LANG_POP(C)
225+
if test "$ompi_pthread_fortran_success" = "1"; then
226+
AC_MSG_RESULT([yes])
227+
else
228+
AC_MSG_RESULT([no])
298229
fi
299230
fi
300231
])dnl

0 commit comments

Comments
 (0)