[cairo] [PATCH 6/7] Add --without-vendor-override option to extconf.rb

Nikolai Weibull now at bitwi.se
Fri Sep 16 01:32:44 PDT 2011


When compiling rcairo on Windows without using RubyGems you might want
to use hand-compiled libraries.  Passing --without-vendor-override
allows you to stop rcairo from trying to set up the vendor/local
environment.
---
 README.rdoc          |    5 +++++
 ext/cairo/extconf.rb |   12 +++++++-----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/README.rdoc b/README.rdoc
index bdd0d3c..08c2af6 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -44,6 +44,11 @@ Compiling:
 		       # support. So you need to install rcairo and build
 		       # Ruby/Pango with it before you run them.
 
+Options to extconf.rb:
+
+  * --without-vendor-override: Use system libraries instead of those found in
+                               vendor/local for compiling
+
 == Windows
 
 cairo-X.Y.Z-x86-mswin32.gem includes cairo related binaries.
diff --git a/ext/cairo/extconf.rb b/ext/cairo/extconf.rb
index ea3cb8c..adc1fa3 100755
--- a/ext/cairo/extconf.rb
+++ b/ext/cairo/extconf.rb
@@ -34,11 +34,13 @@ checking_for(checking_message("Win32 OS")) do
     import_library_name = "libruby-#{module_name}.a"
     $DLDFLAGS << " -Wl,--out-implib=#{import_library_name}"
     $cleanfiles << import_library_name
-    binary_base_dir = base_dir + "vendor" + "local"
-    $CFLAGS += " -I#{binary_base_dir}/include"
-    pkg_config_dir = binary_base_dir + "lib" + "pkgconfig"
-    PKGConfig.add_path(pkg_config_dir.to_s)
-    PKGConfig.set_override_variable("prefix", binary_base_dir.to_s)
+    unless $configure_args['--without-vendor-override']
+      binary_base_dir = base_dir + "vendor" + "local"
+      $CFLAGS += " -I#{binary_base_dir}/include"
+      pkg_config_dir = binary_base_dir + "lib" + "pkgconfig"
+      PKGConfig.add_path(pkg_config_dir.to_s)
+      PKGConfig.set_override_variable("prefix", binary_base_dir.to_s)
+    end
     true
   else
     false
-- 
1.7.5.1



More information about the cairo mailing list