summaryrefslogtreecommitdiff
path: root/ext/openssl/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/extconf.rb')
-rw-r--r--ext/openssl/extconf.rb25
1 files changed, 15 insertions, 10 deletions
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 2f1ddfc..fe4d2d6 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -17,7 +17,8 @@
require "mkmf"
dir_config("openssl")
-
+dir_config("kerberos")
+pkgconfig = with_config("pkg-config", !CROSS_COMPILING && "pkg-config")
message "=== OpenSSL for Ruby configurator ===\n"
@@ -66,15 +67,19 @@ have_header("unistd.h")
have_header("sys/time.h")
message "=== Checking for required stuff... ===\n"
-if find_executable("pkg-config") and system("pkg-config", "--exists", "openssl")
- $CFLAGS += " " << `pkg-config --cflags openssl`.chomp
- $DLDFLAGS += " " << `pkg-config --libs-only-L openssl`.chomp
- $LIBS += " " << `pkg-config --libs-only-l openssl`.chomp
-else
- result = have_header("openssl/crypto.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")}
- if !result
+if $mingw
+ have_library("wsock32")
+ 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")}
+if !result
+ if find_executable(pkgconfig) and system(pkgconfig, "--exists", "openssl")
+ $CFLAGS += " " << `#{pkgconfig} --cflags openssl`.chomp
+ $DLDFLAGS += " " << `#{pkgconfig} --libs-only-L openssl`.chomp
+ $LIBS += " " << `#{pkgconfig} --libs-only-l openssl`.chomp
+ else
message "=== Checking for required stuff failed. ===\n"
message "Makefile wasn't created. Fix the errors above.\n"
exit 1