diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-03-08 01:59:09 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-03-08 01:59:09 (GMT) |
commit | 35a97c0bed8af6cab7ea0fffe374c3369561c444 (patch) | |
tree | 669a8ebf7cce2246560484ae433e070e83b9b53d /configure.ac | |
parent | 6036e4431dbc45952550c2b730fc0d1c82e30883 (diff) | |
download | cpython-35a97c0bed8af6cab7ea0fffe374c3369561c444.zip cpython-35a97c0bed8af6cab7ea0fffe374c3369561c444.tar.gz cpython-35a97c0bed8af6cab7ea0fffe374c3369561c444.tar.bz2 |
Issue #22524: Fix os.scandir() for platforms which don't have a d_type field in
the dirent structure (ex: OpenIndiana).
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index a2c5eb4..263ae15 100644 --- a/configure.ac +++ b/configure.ac @@ -4944,6 +4944,26 @@ AS_CASE($with_ensurepip, AC_MSG_RESULT($ENSUREPIP) AC_SUBST(ENSUREPIP) +# check if the dirent structure of a d_type field and DT_UNKNOWN is defined +AC_MSG_CHECKING(if the dirent structure of a d_type field) +AC_LINK_IFELSE( +[ + AC_LANG_SOURCE([[ + #include <dirent.h> + + int main() { + struct dirent entry; + return entry.d_type == DT_UNKNOWN; + } + ]]) +],[have_dirent_d_type=yes],[have_dirent_d_type=no]) +AC_MSG_RESULT($have_dirent_d_type) + +if test "$have_dirent_d_type" = yes; then + AC_DEFINE(HAVE_DIRENT_D_TYPE, 1, + [Define to 1 if the dirent structure has a d_type field]) +fi + # generate output files AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh) AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix]) |