diff options
author | Alexandre Vassalotti <alexandre@peadrop.com> | 2009-07-17 05:47:33 (GMT) |
---|---|---|
committer | Alexandre Vassalotti <alexandre@peadrop.com> | 2009-07-17 05:47:33 (GMT) |
commit | 0805b4ac54e0a37eb1c8c54fdcaddbe39e27a739 (patch) | |
tree | 78ebcbf24667ae23c3f6433da5e3c2a35af37d59 /configure.in | |
parent | f0381a152ba300971f77c20d8e64a0f66cea4c57 (diff) | |
download | cpython-0805b4ac54e0a37eb1c8c54fdcaddbe39e27a739.zip cpython-0805b4ac54e0a37eb1c8c54fdcaddbe39e27a739.tar.gz cpython-0805b4ac54e0a37eb1c8c54fdcaddbe39e27a739.tar.bz2 |
Use AC_CHECK_SIZEOF to find the size of off_t, pthread_t and time_t.
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 68 |
1 files changed, 13 insertions, 55 deletions
diff --git a/configure.in b/configure.in index 7b1cab8..652a751 100644 --- a/configure.in +++ b/configure.in @@ -1384,26 +1384,11 @@ AC_CHECK_TYPES(uintptr_t, #include <stdint.h> #endif]) - -# Hmph. AC_CHECK_SIZEOF() doesn't include <sys/types.h>. -AC_MSG_CHECKING(size of off_t) -AC_CACHE_VAL(ac_cv_sizeof_off_t, -[AC_TRY_RUN([#include <stdio.h> +AC_CHECK_SIZEOF(off_t, [], [ +#ifdef HAVE_SYS_TYPES_H #include <sys/types.h> -main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(off_t)); - exit(0); -}], -ac_cv_sizeof_off_t=`cat conftestval`, -ac_cv_sizeof_off_t=0, -ac_cv_sizeof_off_t=4) +#endif ]) -AC_MSG_RESULT($ac_cv_sizeof_off_t) -AC_DEFINE_UNQUOTED(SIZEOF_OFF_T, $ac_cv_sizeof_off_t, -[The number of bytes in an off_t.]) AC_MSG_CHECKING(whether to enable large file support) if test "$have_long_long" = yes -a \ @@ -1419,26 +1404,14 @@ else AC_MSG_RESULT(no) fi -# AC_CHECK_SIZEOF() doesn't include <time.h>. -AC_MSG_CHECKING(size of time_t) -AC_CACHE_VAL(ac_cv_sizeof_time_t, -[AC_TRY_RUN([#include <stdio.h> +AC_CHECK_SIZEOF(time_t, [], [ +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_TIME_H #include <time.h> -main() -{ - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(time_t)); - exit(0); -}], -ac_cv_sizeof_time_t=`cat conftestval`, -ac_cv_sizeof_time_t=0, -ac_cv_sizeof_time_t=4) +#endif ]) -AC_MSG_RESULT($ac_cv_sizeof_time_t) -AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t, -[The number of bytes in a time_t.]) - # if have pthread_t then define SIZEOF_PTHREAD_T ac_save_cc="$CC" @@ -1449,35 +1422,20 @@ then CC="$CC -Kthread" elif test "$ac_cv_pthread" = "yes" then CC="$CC -pthread" fi + AC_MSG_CHECKING(for pthread_t) have_pthread_t=no AC_TRY_COMPILE([#include <pthread.h>], [pthread_t x; x = *(pthread_t*)0;], have_pthread_t=yes) AC_MSG_RESULT($have_pthread_t) if test "$have_pthread_t" = yes ; then - # AC_CHECK_SIZEOF() doesn't include <pthread.h>. - AC_MSG_CHECKING(size of pthread_t) - AC_CACHE_VAL(ac_cv_sizeof_pthread_t, - [AC_TRY_RUN([#include <stdio.h> + AC_CHECK_SIZEOF(pthread_t, [], [ +#ifdef HAVE_PTHREAD_H #include <pthread.h> - main() - { - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(pthread_t)); - exit(0); - }], - ac_cv_sizeof_pthread_t=`cat conftestval`, - ac_cv_sizeof_pthread_t=0, - ac_cv_sizeof_pthread_t=4) +#endif ]) - AC_MSG_RESULT($ac_cv_sizeof_pthread_t) - AC_DEFINE_UNQUOTED(SIZEOF_PTHREAD_T, $ac_cv_sizeof_pthread_t, - [The number of bytes in a pthread_t.]) fi CC="$ac_save_cc" - - AC_SUBST(OTHER_LIBTOOL_OPT) case $ac_sys_system/$ac_sys_release in Darwin/@<:@01567@:>@\..*) |