ext/extconf.rb in proc-wait3-1.7.3 vs ext/extconf.rb in proc-wait3-1.8.0
- old
+ new
@@ -4,33 +4,10 @@
########################################################
require 'mkmf'
dir_config('proc-wait3')
-# We need this for older versions of Ruby.
-def have_const(const, header = nil, opt = "", &b)
- checking_for const do
- header = cpp_include(header)
- if try_compile(<<"SRC", opt, &b)
-#{COMMON_HEADERS}
-#{header}
-/* top */
-static int t = #{const};
-SRC
- $defs.push(
- format(
- "-DHAVE_CONST_%s",
- const.strip.upcase.tr_s("^A-Z0-9_", "_")
- )
- )
- true
- else
- false
- end
- end
-end
-
have_header('wait.h')
have_header('sys/resource.h')
have_header('sys/wait.h')
# wait3 is mandatory.
@@ -39,10 +16,19 @@
exit
end
# Yay, Linux
have_func('str2sig')
-have_func('strlcpy')
+
+if have_library('bsd')
+ if have_header('bsd/string.h')
+ have_func('strlcpy', 'bsd/string.h')
+ else
+ have_func('strlcpy')
+ end
+else
+ have_func('strlcpy')
+end
# wait4, waitid, etc, are optional (HPUX, et al)
have_func('wait4')
have_func('waitid')
have_func('sigset')