Created
October 26, 2015 15:03
-
-
Save Pugio/c40450beac87029fb159 to your computer and use it in GitHub Desktop.
Possible refactor of rubinius configure.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def detect_functions | |
[ [ "HAVE_CLOCK_GETTIME", "clock_gettime", ["time.h"], ] | |
[ "HAVE_NL_LANGINFO", "nl_langinfo", ["langinfo.h"]] | |
[ "HAVE_SETPROCTITLE", "setproctitle", ["sys/types.h", "unistd.h"]] | |
[ "HAVE_POSIX_FADVISE", "posix_fadvise", ["fcntl.h"]] | |
[ "HAVE_STRNLEN", "strnlen", ["string.h"]] | |
[ "HAVE_KQUEUE", "kqueue", ["sys/types.h", "sys/event.h", "sys/time.h"]] | |
[ "HAVE_TIMERFD", "timerfd_create", ["sys/timerfd.h"]] | |
[ "HAVE_INOTIFY", "inotify_init", ["sys/inotify.h"]] | |
[ "HAVE_GETTID", "gettid", ["unistd.d", "sys/types.h"]] ].each do |konst, func, sources| | |
if has_function(func, sources) | |
@defines << konst | |
end | |
end | |
[["HAVE_STRUCT_STAT_ST_ATIM", "st_atim", ["sys/stat.h"]] | |
["HAVE_STRUCT_STAT_ST_ATIMESPEC", "st_atimespec", ["sys/stat.h"]] | |
["HAVE_STRUCT_STAT_ST_ATIMENSEC", "st_atimensec", ["sys/stat.h"]] | |
["HAVE_STRUCT_STAT_ST_MTIM", "st_mtim", ["sys/stat.h"]] | |
["HAVE_STRUCT_STAT_ST_MTIMESPEC", "st_mtimespec", ["sys/stat.h"]] | |
["HAVE_STRUCT_STAT_ST_MTIMENSEC", "st_mtimensec", ["sys/stat.h"]] | |
["HAVE_STRUCT_STAT_ST_CTIM", "st_ctim", ["sys/stat.h"]] | |
["HAVE_STRUCT_STAT_ST_CTIMESPEC", "st_ctimespec", ["sys/stat.h"]] | |
["HAVE_STRUCT_STAT_ST_CTIMENSEC", "st_ctimensec", ["sys/stat.h"]]].each do |konst, member, sources| | |
if has_struct_member("stat", member, sources) | |
@defines << konst | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment