mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* configure.in (sizeof_struct_dirent_too_small): check if struct
dirent.d_name is too small. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
90a10297d6
commit
3e0819c66a
2 changed files with 36 additions and 10 deletions
|
@ -1,4 +1,7 @@
|
|||
Sat Sep 3 23:55:17 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Sat Sep 3 23:56:24 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* configure.in (sizeof_struct_dirent_too_small): check if struct
|
||||
dirent.d_name is too small.
|
||||
|
||||
* configure.in (RUBY_MINGW32): take tool prefix from CC.
|
||||
|
||||
|
|
41
configure.in
41
configure.in
|
@ -933,15 +933,6 @@ dnl Checks for libraries.
|
|||
AS_CASE(["$target_os"],[*bsd*|dragonfly*],[],[ac_cv_func_daemon=no])
|
||||
|
||||
AS_CASE(["$target_os"],
|
||||
[solaris*], [
|
||||
AC_DEFINE(SIZEOF_STRUCT_DIRENT_TOO_SMALL, 1)
|
||||
LIBS="-lm $LIBS"
|
||||
],
|
||||
# GNU Hurd
|
||||
[gnu*], [
|
||||
AC_DEFINE(SIZEOF_STRUCT_DIRENT_TOO_SMALL, 1)
|
||||
LIBS="-lm $LIBS"
|
||||
],
|
||||
[nextstep*], [ ],
|
||||
[openstep*], [ ],
|
||||
[rhapsody*], [ ],
|
||||
|
@ -1734,6 +1725,38 @@ fi
|
|||
|
||||
RUBY_CHECK_SIZEOF([struct stat.st_ino], [long "long long"], [], [@%:@include <sys/stat.h>])
|
||||
|
||||
AC_CACHE_CHECK([whether struct dirent.d_name is too small], rb_cv_sizeof_struct_dirent_too_small,
|
||||
[AC_COMPILE_IFELSE(
|
||||
[AC_LANG_BOOL_COMPILE_TRY([AC_INCLUDES_DEFAULT([
|
||||
@%:@if defined _WIN32
|
||||
@%:@ error <<<struct direct in win32/dir.h has variable length d_name>>>
|
||||
@%:@elif defined HAVE_DIRENT_H
|
||||
@%:@ include <dirent.h>
|
||||
@%:@elif defined HAVE_DIRECT_H
|
||||
@%:@ include <direct.h>
|
||||
@%:@else
|
||||
@%:@ define dirent direct
|
||||
@%:@ if HAVE_SYS_NDIR_H
|
||||
@%:@ include <sys/ndir.h>
|
||||
@%:@ endif
|
||||
@%:@ if HAVE_SYS_DIR_H
|
||||
@%:@ include <sys/dir.h>
|
||||
@%:@ endif
|
||||
@%:@ if HAVE_NDIR_H
|
||||
@%:@ include <ndir.h>
|
||||
@%:@ endif
|
||||
@%:@endif
|
||||
@%:@include <stddef.h>
|
||||
@%:@define numberof(array) [(int)(sizeof(array) / sizeof((array)[0]))]
|
||||
struct dirent d;
|
||||
])],
|
||||
[offsetof(struct dirent, [d_name[numberof(d.d_name)]]) - offsetof(struct dirent, d_name) < 256])],
|
||||
[rb_cv_sizeof_struct_dirent_too_small=yes],
|
||||
[rb_cv_sizeof_struct_dirent_too_small=no])])
|
||||
if test "$rb_cv_sizeof_struct_dirent_too_small" = yes; then
|
||||
AC_DEFINE(SIZEOF_STRUCT_DIRENT_TOO_SMALL, 1)
|
||||
fi
|
||||
|
||||
if test "$ac_cv_func_sysconf" = yes; then
|
||||
AC_DEFUN([RUBY_CHECK_SYSCONF], [dnl
|
||||
AC_CACHE_CHECK([whether _SC_$1 is supported], rb_cv_have_sc_[]m4_tolower($1),
|
||||
|
|
Loading…
Add table
Reference in a new issue