From 42850db14b21b4fa9e85f575fe3a2bce0ba1867e Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 23 Aug 2007 08:25:12 +0000 Subject: [PATCH] * configure.in (group_member): check if presents. * configure.in (XCFLAGS): add _GNU_SOURCE on linux. * file.c (group_member): use system routine if available. * process.c: moved _GNU_SOURCE macro to Makefile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 10 ++++++++++ configure.in | 5 ++++- file.c | 2 ++ process.c | 3 --- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3e47546697..606dde1118 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Thu Aug 23 17:25:05 2007 Nobuyoshi Nakada + + * configure.in (group_member): check if presents. + + * configure.in (XCFLAGS): add _GNU_SOURCE on linux. + + * file.c (group_member): use system routine if available. + + * process.c: moved _GNU_SOURCE macro to Makefile. + Thu Aug 23 16:59:40 2007 Nobuyoshi Nakada * compile.c (compile_massign), insnhelper.ci (vm_throw): not use C99 diff --git a/configure.in b/configure.in index 79916af4b6..6b533c900c 100644 --- a/configure.in +++ b/configure.in @@ -594,7 +594,7 @@ AC_CHECK_FUNCS(fmod killpg wait4 waitpid fork spawnv syscall chroot fsync getcwd setitimer setruid seteuid setreuid setresuid setproctitle socketpair\ setrgid setegid setregid setresgid issetugid pause lchown lchmod\ getpgrp setpgrp getpgid setpgid initgroups getgroups setgroups\ - getpriority getrlimit setrlimit sysconf\ + getpriority getrlimit setrlimit sysconf group_member\ dlopen sigprocmask sigaction _setjmp vsnprintf snprintf\ setsid telldir seekdir fchmod mktime timegm cosh sinh tanh log2\ setuid setgid daemon select_large_fdset setenv unsetenv) @@ -1423,6 +1423,9 @@ if test "$rb_with_pthread" = "yes"; then THREAD_MODEL=pthread fi case "$target_os" in + linux*) + XCFLAGS="$XCFLAGS -D_GNU_SOURCE=1" + ;; netbsd*) CFLAGS="$CFLAGS -pipe" ;; diff --git a/file.c b/file.c index ff0c324e2e..2f4643dcd3 100644 --- a/file.c +++ b/file.c @@ -785,6 +785,7 @@ rb_file_lstat(VALUE obj) #endif } +#ifndef HAVE_GROUP_MEMBER static int group_member(GETGROUPS_T gid) { @@ -813,6 +814,7 @@ group_member(GETGROUPS_T gid) #endif return Qfalse; } +#endif #ifndef S_IXUGO # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) diff --git a/process.c b/process.c index a246cf9d47..5374375e1b 100644 --- a/process.c +++ b/process.c @@ -12,9 +12,6 @@ **********************************************************************/ -#ifdef linux -#define _GNU_SOURCE 1 -#endif #include "ruby/ruby.h" #include "ruby/signal.h" #include "vm_core.h"