summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/extmk.rb28
-rw-r--r--ext/openssl/extconf.rb5
-rw-r--r--ext/openssl/ossl.h8
-rw-r--r--ext/openssl/ruby_missing.h54
4 files changed, 22 insertions, 73 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index e2f398356d..bb50579c92 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -61,15 +61,17 @@ def extmake(target)
$mdir = target
$srcdir = File.join($top_srcdir, "ext", $mdir)
$preload = nil
+ makefile = "./Makefile"
unless $ignore
if $static ||
- !(t = modified?("./Makefile", MTIMES)) ||
+ !(t = modified?(makefile, MTIMES)) ||
%W<#{$srcdir}/makefile.rb #{$srcdir}/extconf.rb
#{$srcdir}/depend #{$srcdir}/MANIFEST>.any? {|f| modified?(f, [t])}
then
$defs = []
Logging::logfile 'mkmf.log'
Config::CONFIG["srcdir"] = $srcdir
+ rm_f makefile
begin
if File.exist?($0 = "#{$srcdir}/makefile.rb")
load $0
@@ -78,6 +80,7 @@ def extmake(target)
else
create_makefile(target)
end
+ File.exist?(makefile)
rescue SystemExit
# ignore
ensure
@@ -85,19 +88,20 @@ def extmake(target)
$0 = $PROGRAM_NAME
Config::CONFIG["srcdir"] = $top_srcdir
end
+ else
+ true
end
+ end or open(makefile, "w") do |f|
+ f.print dummy_makefile($srcdir)
+ return true
end
- if File.exist?("./Makefile")
- if $static
- $extlist.push [$static, $target, File.basename($target), $preload]
- end
- unless system($make, *sysquote($mflags))
- $ignore or $continue or return false
- end
- else
- open("./Makefile", "w") {|f|
- f.print dummy_makefile($srcdir)
- }
+ args = sysquote($mflags)
+ if $static
+ args += ["static"]
+ $extlist.push [$static, $target, File.basename($target), $preload]
+ end
+ unless system($make, *args)
+ $ignore or $continue or return false
end
if $static
$extflags ||= ""
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 92dabdc587..978f9dbb69 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -79,15 +79,12 @@ have_func("BN_mod_sub")
have_func("BN_rand_range")
have_func("BN_pseudo_rand_range")
have_func("CONF_get1_default_config_file")
-if try_cpp("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n int x(){FOO(1,2);}\n")
+if try_cpp("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n int x(){FOO(1);FOO(1,2);FOO(1,2,3);}\n")
$defs.push("-DHAVE_VA_ARGS_MACRO")
end
have_header("openssl/ocsp.h")
have_struct_member("EVP_CIPHER_CTX", "flags", "openssl/evp.h")
-message "=== Checking for Ruby features... ===\n"
-have_func("rb_obj_init_copy", "ruby.h")
-
message "=== Checking done. ===\n"
$distcleanfiles << "GNUmakefile" << "dep"
create_makefile("openssl")
diff --git a/ext/openssl/ossl.h b/ext/openssl/ossl.h
index 72b183986e..7a8b3e1853 100644
--- a/ext/openssl/ossl.h
+++ b/ext/openssl/ossl.h
@@ -16,15 +16,13 @@ extern "C" {
#endif
/*
- * Check the Ruby version and OpenSSL
+ * Check the OpenSSL version
* The only supported are:
- * Ruby >= 1.7.2
* OpenSSL >= 0.9.7
*/
-#include <version.h>
#include <openssl/opensslv.h>
-#if defined(NT) || defined(_WIN32)
+#if defined(_WIN32)
# define OpenFile WINAPI_OpenFile
#endif
#include <errno.h>
@@ -40,7 +38,7 @@ extern "C" {
# define OSSL_OCSP_ENABLED
# include <openssl/ocsp.h>
#endif
-#if defined(NT) || defined(_WIN32)
+#if defined(_WIN32)
# undef OpenFile
#endif
diff --git a/ext/openssl/ruby_missing.h b/ext/openssl/ruby_missing.h
index bdb152b08e..f9e74f743e 100644
--- a/ext/openssl/ruby_missing.h
+++ b/ext/openssl/ruby_missing.h
@@ -11,60 +11,10 @@
#if !defined(_OSSL_RUBY_MISSING_H_)
#define _OSS_RUBY_MISSING_H_
-#if !defined(StringValue)
-# define StringValue(v) \
- if (TYPE(v) != T_STRING) v = rb_str_to_str(v)
-#endif
+#define DEFINE_ALLOC_WRAPPER(func)
-#if !defined(StringValuePtr)
-# define StringValuePtr(v) \
- RSTRING((TYPE(v) == T_STRING) ? (v) : rb_str_to_str(v))->ptr
-#endif
-
-#if !defined(SafeStringValue)
-# define SafeStringValue(v) do {\
- StringValue(v);\
- rb_check_safe_str(v);\
-} while (0)
-#endif
-
-#if RUBY_VERSION_CODE < 180
-# define rb_cstr_to_inum(a,b,c) \
- rb_cstr2inum(a,b)
-# define rb_check_frozen(obj) \
- if (OBJ_FROZEN(obj)) rb_error_frozen(rb_obj_classname(obj))
-# define rb_obj_classname(obj) \
- rb_class2name(CLASS_OF(obj))
-#endif
-
-#if HAVE_RB_DEFINE_ALLOC_FUNC
-# define DEFINE_ALLOC_WRAPPER(func)
-#else
-# define DEFINE_ALLOC_WRAPPER(func) \
- static VALUE \
- func##_wrapper(int argc, VALUE *argv, VALUE klass) \
- { \
- VALUE obj; \
- \
- obj = func(klass); \
- \
- rb_obj_call_init(obj, argc, argv); \
- \
- return obj; \
- }
-# define rb_define_alloc_func(klass, func) \
- rb_define_singleton_method(klass, "new", func##_wrapper, -1)
-#endif
-
-#if RUBY_VERSION_CODE >= 180
-# if !defined(HAVE_RB_OBJ_INIT_COPY)
-# define rb_define_copy_func(klass, func) \
- rb_define_method(klass, "copy_object", func, 1)
-# else
-# define rb_define_copy_func(klass, func) \
+#define rb_define_copy_func(klass, func) \
rb_define_method(klass, "initialize_copy", func, 1)
-# endif
-#endif
#endif /* _OSS_RUBY_MISSING_H_ */