summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-24 17:58:56 +0000
committergotoyuzo <gotoyuzo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-24 17:58:56 +0000
commitc9aad4c098193cad0440228595c85aadc44bebe5 (patch)
treeaaa90e93fedc802656383953822d034537ff2a93
parent4d859f926a2bacd21f06630ff185da3d09a1a314 (diff)
* ext/openssl/extconf.rb: add check for libsocket and libnsl.
* ext/openssl/extconf.rb: use pkg-config to build CFLAGS and LDFLAGS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--ext/openssl/extconf.rb37
2 files changed, 25 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 690b0f948e..eed0de9360 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jul 25 02:55:59 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
+
+ * ext/openssl/extconf.rb: add check for libsocket and libnsl.
+
+ * ext/openssl/extconf.rb: use pkg-config to build CFLAGS and LDFLAGS.
+
Fri Jul 25 01:27:59 2003 why the lucky stiff <ruby-cvs@whytheluckystiff.net>
* ext/syck/emitter.c (syck_emitter_flush): accepts count
@@ -35,7 +41,7 @@ Thu Jul 24 15:50:42 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/extconf.rb: add check for win32 OpenSSL libraries.
- * ext/openssl/extconf.rb: add check for __VA_AEGS__.
+ * ext/openssl/extconf.rb: add check for __VA_ARGS__.
* ext/openssl/ossl.h: avoid non C99 compiler errors.
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 2335fc680d..94b79d4428 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -18,13 +18,6 @@ require "mkmf"
dir_config("openssl")
-if !defined? message
- def message(*s)
- printf(*s)
- Logging::message(*s)
- end
-end
-
message "=== OpenSSL for Ruby configurator ===\n"
@@ -65,23 +58,29 @@ EOD
end
-message "=== Checking for required stuff... ===\n"
-
-result = have_header("openssl/crypto.h")
-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
- message "=== Checking for required stuff failed. ===\n"
- message "Makefile wasn't created. Fix the errors above.\n"
- exit 1
-end
message "=== Checking for system dependent stuff... ===\n"
+have_library("nsl", "t_open")
+have_library("socket", "socket")
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
+ message "=== Checking for required stuff failed. ===\n"
+ message "Makefile wasn't created. Fix the errors above.\n"
+ exit 1
+ end
+end
+
message "=== Checking for OpenSSL features... ===\n"
have_func("HMAC_CTX_copy")
have_func("X509_STORE_get_ex_data")