[前][次][番号順一覧][スレッド一覧]

ruby-changes:38636

From: nobu <ko1@a...>
Date: Mon, 1 Jun 2015 22:03:13 +0900 (JST)
Subject: [ruby-changes:38636] nobu:r50717 (trunk): mkmf.rb: split --libs

nobu	2015-06-01 22:01:52 +0900 (Mon, 01 Jun 2015)

  New Revision: 50717

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50717

  Log:
    mkmf.rb: split --libs
    
    * lib/mkmf.rb (pkg_config): split --libs if --libs-only-l option
      is not available.  patch in [ruby-core:69428] by Hans Mackowiak.
      [ruby-core:69421] [Bug #11201]

  Modified files:
    trunk/ChangeLog
    trunk/lib/mkmf.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50716)
+++ ChangeLog	(revision 50717)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jun  1 22:01:27 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/mkmf.rb (pkg_config): split --libs if --libs-only-l option
+	  is not available.  patch in [ruby-core:69428] by Hans Mackowiak.
+	  [ruby-core:69421] [Bug #11201]
+
 Mon Jun  1 21:18:24 2015  Koichi Sasada  <ko1@a...>
 
 	* gc.c (gc_mark_children): remove a garbage character
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 50716)
+++ lib/mkmf.rb	(revision 50717)
@@ -1818,11 +1818,18 @@ SRC https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L1818
         cflags = get['cflags']
       end
       libs = get['libs-only-l']
-      ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
-      $CFLAGS += " " << cflags
-      $CXXFLAGS += " " << cflags
-      $LDFLAGS = [orig_ldflags, ldflags].join(' ')
+      if cflags
+        $CFLAGS += " " << cflags
+        $CXXFLAGS += " " << cflags
+      end
+      if libs
+        ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
+      else
+        libs, ldflags = Shellwords.shellwords(ldflags).partition {|s| s =~ /-l([^ ]+)/ }.map {|l|l.quote.join(" ")}
+      end
       $libs += " " << libs
+
+      $LDFLAGS = [orig_ldflags, ldflags].join(' ')
       Logging::message "package configuration for %s\n", pkg
       Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",
                        cflags, ldflags, libs

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]