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
34
configure.ac
34
configure.ac
@ -1721,7 +1721,7 @@ if test "X$THREADSAFE" = "Xyes"; then
|
||||
## Check if pthread_attr_setscope(&attribute, PTHREAD_SCOPE_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
|
||||
## supported a priori. POSIX.1-2001 requires that a conformant
|
||||
## system need only support one of SYSTEM or PROCESS scopes.
|
||||
@ -1730,22 +1730,24 @@ if test "X$THREADSAFE" = "Xyes"; then
|
||||
## hand-hack the config file if you know otherwise.
|
||||
AC_MSG_CHECKING([Pthreads supports system scope])
|
||||
AC_CACHE_VAL([hdf5_cv_system_scope_threads],
|
||||
[AC_TRY_RUN([
|
||||
#if STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM([
|
||||
#if STDC_HEADERS
|
||||
#include <stdlib.h>
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
],[
|
||||
int main(void)
|
||||
{
|
||||
pthread_attr_t attribute;
|
||||
int ret;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
pthread_attr_t attribute;
|
||||
int ret;
|
||||
|
||||
pthread_attr_init(&attribute);
|
||||
ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
|
||||
exit(ret==0 ? 0 : 1);
|
||||
}
|
||||
], [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no], [hdf5_cv_system_scope_threads=no])])
|
||||
pthread_attr_init(&attribute);
|
||||
ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
|
||||
exit(ret==0 ? 0 : 1);
|
||||
}
|
||||
])]
|
||||
, [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
|
||||
AC_DEFINE([SYSTEM_SCOPE_THREADS], [1],
|
||||
|
Loading…
Reference in New Issue
Block a user