mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-05 15:42:32 +08:00
[svn-r26399] Converted an AC_TRY_RUN macro to an AC_RUN_IFELSE macro.
Used with checking Pthread scope. Part of: HDFFV-9087 Tested on: Local Linux w/ thread-safety enabled
This commit is contained in:
parent
42eee37a26
commit
2f77d8c5ea
10
configure.ac
10
configure.ac
@ -1721,7 +1721,7 @@ if test "X$THREADSAFE" = "Xyes"; then
|
|||||||
## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM)
|
## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM)
|
||||||
## is supported on this system
|
## is supported on this system
|
||||||
##
|
##
|
||||||
## Unfortunately, this probably needs to be an AC_TRY_RUN since
|
## Unfortunately, this probably needs to be an AC_RUN_IFELSE since
|
||||||
## it's impossible to determine if PTHREAD_SCOPE_SYSTEM is
|
## it's impossible to determine if PTHREAD_SCOPE_SYSTEM is
|
||||||
## supported a priori. POSIX.1-2001 requires that a conformant
|
## supported a priori. POSIX.1-2001 requires that a conformant
|
||||||
## system need only support one of SYSTEM or PROCESS scopes.
|
## system need only support one of SYSTEM or PROCESS scopes.
|
||||||
@ -1730,12 +1730,13 @@ if test "X$THREADSAFE" = "Xyes"; then
|
|||||||
## hand-hack the config file if you know otherwise.
|
## hand-hack the config file if you know otherwise.
|
||||||
AC_MSG_CHECKING([Pthreads supports system scope])
|
AC_MSG_CHECKING([Pthreads supports system scope])
|
||||||
AC_CACHE_VAL([hdf5_cv_system_scope_threads],
|
AC_CACHE_VAL([hdf5_cv_system_scope_threads],
|
||||||
[AC_TRY_RUN([
|
[AC_RUN_IFELSE(
|
||||||
|
[AC_LANG_PROGRAM([
|
||||||
#if STDC_HEADERS
|
#if STDC_HEADERS
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
],[
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
pthread_attr_t attribute;
|
pthread_attr_t attribute;
|
||||||
@ -1745,7 +1746,8 @@ if test "X$THREADSAFE" = "Xyes"; then
|
|||||||
ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
|
ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
|
||||||
exit(ret==0 ? 0 : 1);
|
exit(ret==0 ? 0 : 1);
|
||||||
}
|
}
|
||||||
], [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no], [hdf5_cv_system_scope_threads=no])])
|
])]
|
||||||
|
, [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no], [hdf5_cv_system_scope_threads=no])])
|
||||||
|
|
||||||
if test ${hdf5_cv_system_scope_threads} = "yes"; then
|
if test ${hdf5_cv_system_scope_threads} = "yes"; then
|
||||||
AC_DEFINE([SYSTEM_SCOPE_THREADS], [1],
|
AC_DEFINE([SYSTEM_SCOPE_THREADS], [1],
|
||||||
|
Loading…
Reference in New Issue
Block a user