From: duerst@it.aoyama.ac.jp
To: ruby-core@ruby-lang.org
Subject: [ruby-core:96941] [Ruby master Feature#16517] mkmf.rb - changes for Windows ?
Date: Sun, 19 Jan 2020 06:29:51 +0000 (UTC) [thread overview]
Message-ID: <redmine.journal-83968.20200119062950.f78afa0a0ea4c95f@ruby-lang.org> (raw)
In-Reply-To: redmine.issue-16517.20200118234947@ruby-lang.org
Issue #16517 has been updated by duerst (Martin Dürst).
nobu (Nobuyoshi Nakada) wrote:
> What is `devkit`?
> Is it https://rubygems.org/gems/devkit ?
I don't think so. Please have a look at https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.
----------------------------------------
Feature #16517: mkmf.rb - changes for Windows ?
https://bugs.ruby-lang.org/issues/16517#change-83968
* Author: MSP-Greg (Greg L)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
I propose two changes to mkmf.rb to make it more Windows friendly.
1) mingw - `devkit` has been the standard for 'enabling' compile tools in publicly available MinGW builds for quite a while. Could something like the following be added? Not sure whether to rescue on LoadError or not, or whether to output anything if it doesn't load.
```ruby
if $mingw
begin
require 'devkit'
rescue
end
end
```
2) mswin - most compile tools other than msvc will find libraries without a lib prefix. Note the following code in extconf.rb for OpenSSL:
```ruby
ret = have_library("crypto", "CRYPTO_malloc") &&
have_library("ssl", "SSL_new")
return ret if ret
if $mswin
# OpenSSL >= 1.1.0: libcrypto.lib and libssl.lib.
if have_library("libcrypto", "CRYPTO_malloc") &&
have_library("libssl", "SSL_new")
return true
end
```
If something like the following was added, the above wouldn't be needed:
```ruby
if $mswin
alias_method :orig_find_library, :find_library
def find_library(lib, func, *paths, &b)
orig_find_library(lib, func, *paths, b) || orig_find_library("lib#{lib}", func, *paths, b)
end
alias_method :orig_have_library, :have_library
def have_library(lib, func = nil, headers = nil, opt = "", &b)
orig_have_library(lib, func, headers, opt, b) || orig_have_library("lib#{lib}", func, headers, opt, b)
end
end
```
Adding something similar to above two items would remove the need for Windows specific build code in many extension gems.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
next prev parent reply other threads:[~2020-01-19 6:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <redmine.issue-16517.20200118234947@ruby-lang.org>
2020-01-18 23:49 ` [ruby-core:96938] [Ruby master Feature#16517] mkmf.rb - changes for Windows ? Greg.mpls
2020-01-19 5:04 ` [ruby-core:96940] " nobu
2020-01-19 6:29 ` duerst [this message]
2020-01-19 12:47 ` [ruby-core:96945] " nobu
2020-01-19 16:08 ` [ruby-core:96946] " Greg.mpls
2020-01-20 9:16 ` [ruby-core:96950] " larskanis
2020-01-20 15:49 ` [ruby-core:96952] " Greg.mpls
2020-01-20 18:05 ` [ruby-core:96953] " shevegen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.ruby-lang.org/en/community/mailing-lists/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=redmine.journal-83968.20200119062950.f78afa0a0ea4c95f@ruby-lang.org \
--to=ruby-core@ruby-lang.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).