diff options
author | Technorama team <oss-ruby@technorama.net> | 2004-02-20 19:51:10 +0000 |
---|---|---|
committer | Technorama team <oss-ruby@technorama.net> | 2004-02-20 19:51:10 +0000 |
commit | e07dd8212aa4bfb1a6e81e712bffee44e0cf13d6 (patch) | |
tree | 51ad109867da411806b60eecf5d43667e7789885 | |
parent | 1048d6a4af879a8b4639986f5bf452cdfb9e2db0 (diff) | |
download | ruby-openssl-history-e07dd8212aa4bfb1a6e81e712bffee44e0cf13d6.tar.gz |
add support for ruby1.6
-rw-r--r-- | extconf.rb | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -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| |