Backport #8596

r41734

Added by Shota Fukumori 10 months ago. Updated 10 months ago.

[ruby-core:55756]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

Description

Please backport r41734


Related issues

Related to ruby-trunk - Bug #8595: mkmf.rb pkg_config modifies $LDFLAGS Closed 07/02/2013

Associated revisions

Revision 41758
Added by Tomoyuki Chikanaga 10 months ago

merge revision(s) 41734,41737: [Backport #8596]

* lib/mkmf.rb (try_config): Fix to not replace $LDFLAGS with $libs
  (1.9.3 behavior)  [Bug #8595]

History

#1 Updated by Shota Fukumori 10 months ago

r41734 can't apply to ruby20_0 as it is, use this patch:

diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index d4d5846..6fec4bd 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1709,12 +1709,13 @@ SRC
# default to package specific config command, as a last resort.
get = proc {|opt| #{pkgconfig} --#{opt}.strip}
end
+ origldflags = $LDFLAGS
if get and try
ldflags(ldflags = get['libs'])
cflags = get['cflags']
libs = get['libs-only-l']
ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
$CFLAGS += " " << cflags
- $LDFLAGS += " " << ldflags
+ $LDFLAGS = [orig_ldflags, ldflags].join(' ')
$libs += " " << libs
Logging::message "package configuration for %s\n", pkg
Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",

#2 Updated by Tomoyuki Chikanaga 10 months ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41758.
Shota, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 41734,41737: [Backport #8596]

* lib/mkmf.rb (try_config): Fix to not replace $LDFLAGS with $libs
  (1.9.3 behavior)  [Bug #8595]

Also available in: Atom PDF