diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2001-10-07 08:14:41 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2001-10-07 08:14:41 (GMT) |
commit | 260aecc83dae4769183279e28708c97680d3e94c (patch) | |
tree | 3f728cb34bc47e5b3f977a5d9ac0fc60251c2c32 /configure.in | |
parent | db1ed2aec36dfadc953dd9c8f7da7f00d404f9e5 (diff) | |
download | cpython-260aecc83dae4769183279e28708c97680d3e94c.zip cpython-260aecc83dae4769183279e28708c97680d3e94c.tar.gz cpython-260aecc83dae4769183279e28708c97680d3e94c.tar.bz2 |
Use AC_TRY_RUN for checking for -Kpthread.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/configure.in b/configure.in index c190b70..2055387 100644 --- a/configure.in +++ b/configure.in @@ -407,20 +407,29 @@ fi # -Kpthread, if available, provides the right #defines # and linker options to make pthread_create available +# Some compilers won't report that they do not support -Kpthread, +# so we need to run a program to see whether it really made the +# function available. AC_MSG_CHECKING(whether $CC accepts -Kpthread) AC_CACHE_VAL(ac_cv_kpthread, [ac_save_cc="$CC" CC="$CC -Kpthread" -AC_TRY_LINK([#include <pthread.h>],[pthread_create(0,0,0,0)], +AC_TRY_RUN([ +#include <pthread.h> + +void* routine(void* p){return NULL;} + +int main(){ + pthread_t p; + if(pthread_create(&p,NULL,routine,NULL)!=0) + return 1; + return 0; +} +], ac_cv_kpthread=yes, + ac_cv_kpthread=no, ac_cv_kpthread=no) CC="$ac_save_cc"]) - -# GCC does not reject -Kpthread as an illegal option, it merely complains that -# it is unrecognized -if test "$GCC" = "yes" -then ac_cv_kpthread="no, we have gcc" -fi AC_MSG_RESULT($ac_cv_kpthread) dnl # check for ANSI or K&R ("traditional") preprocessor |