Project

General

Profile

Actions

Bug #7856

closed

The usage of try_run in extconf.rb is broken when crosscompiling

Added by luizluca (Luiz Angelo Daros de Luca) almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Target version:
ruby -v:
1.9.2p0
Backport:
[ruby-core:52275]

Description

Hello,

Every "try_run" inside extconf.rb (found in some ext/*/extconf.rb) tries to compile and run the generated binary. However,
when crosscompiling, this simply can't work.

Please, make try_run be ignored (or just test the compilation) when crosscompiling is detected. I tested this only at 1.9.2
but this might affect all versions that uses try_run to test dependencies.

Taking socket as an example, this can be solved individually, from the original:

getaddr_info_ok = (enable_config("wide-getaddrinfo") && :wide) ||
(checking_for("wide getaddrinfo") {try_run(<<EOF)} && :os)

to:

getaddr_info_ok = (enable_config("wide-getaddrinfo") && :wide) ||
(CROSS_COMPILING && :cross) ||
(checking_for("wide getaddrinfo") {try_run(<<EOF)} && :os)

or just allow the check for every try_run to be manually defined in ./configure script
like:

getaddr_info_ok = (enable_config("wide-getaddrinfo") && :wide) ||
(enable_config("ignore-getaddr_info-check") && :manual ) ||
(CROSS_COMPILING && <warn the user to use --ignore-getaddr_info-check> && false) ||
(checking_for("wide getaddrinfo") {try_run(<<EOF)} && :os)

Regards,

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0