From e07dd8212aa4bfb1a6e81e712bffee44e0cf13d6 Mon Sep 17 00:00:00 2001 From: Technorama team Date: Fri, 20 Feb 2004 19:51:10 +0000 Subject: add support for ruby1.6 --- extconf.rb | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/extconf.rb b/extconf.rb index 92dabdc..c4b5c81 100644 --- a/extconf.rb +++ b/extconf.rb @@ -15,6 +15,15 @@ =end require "mkmf" +require "rbconfig" + +ruby_version = Config::CONFIG['ruby_version'].to_f + +if ruby_version < 1.8 + def message(*args) + printf(*args) + end +end dir_config("openssl") dir_config("kerberos") @@ -47,8 +56,8 @@ if $mingw have_library("gdi32") end result = have_header("openssl/ssl.h") -result &&= %w[crypto libeay32].any? {|lib| have_library(lib, "OpenSSL_add_all_digests")} -result &&= %w[ssl ssleay32].any? {|lib| have_library(lib, "SSL_library_init")} +result &&= have_library("crypto", "OpenSSL_add_all_digests") || have_library("libeay32", "OpenSSL_add_all_digests") +result &&= have_library("ssl", "SSL_library_init") || have_library("ssleay32", "SSL_library_init") if !result unless pkg_config("openssl") and have_header("openssl/ssl.h") message "=== Checking for required stuff failed. ===\n" @@ -83,13 +92,17 @@ if try_cpp("#define FOO(a, ...) foo(a, ##__VA_ARGS__)\n int x(){FOO(1,2);}\n") $defs.push("-DHAVE_VA_ARGS_MACRO") end have_header("openssl/ocsp.h") -have_struct_member("EVP_CIPHER_CTX", "flags", "openssl/evp.h") +if ruby_version >= 1.8 + have_struct_member("EVP_CIPHER_CTX", "flags", "openssl/evp.h") +end message "=== Checking for Ruby features... ===\n" have_func("rb_obj_init_copy", "ruby.h") message "=== Checking done. ===\n" -$distcleanfiles << "GNUmakefile" << "dep" +if ruby_version >= 1.8 + $distcleanfiles << "GNUmakefile" << "dep" +end create_makefile("openssl") if /gcc/ =~ CONFIG["CC"] File.open("GNUmakefile", "w") {|f| -- cgit v1.2.3