diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-05-05 22:36:36 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-05-05 22:36:36 -0700 |
commit | d2de4557234ddf3dd11e658109c0c224f25fe4e3 (patch) | |
tree | a3abc8e77398b9d0ae9439ca9bc7db4a8adb9d75 | |
parent | 347622323ffba3c884d45590b3e831ae7e31d547 (diff) | |
download | ffi-yajl-d2de4557234ddf3dd11e658109c0c224f25fe4e3.tar.gz |
removing libyajl2 to the separate gem
-rw-r--r-- | ext/libyajl2/extconf.rb | 60 | ||||
m--------- | ext/libyajl2/vendored | 0 | ||||
-rw-r--r-- | ffi-yajl-universal-java.gemspec | 5 | ||||
-rw-r--r-- | ffi-yajl.gemspec | 2 | ||||
-rw-r--r-- | ffi-yajl.gemspec.shared | 1 |
5 files changed, 6 insertions, 62 deletions
diff --git a/ext/libyajl2/extconf.rb b/ext/libyajl2/extconf.rb deleted file mode 100644 index ee8e30a..0000000 --- a/ext/libyajl2/extconf.rb +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env ruby - -require 'rbconfig' - -cflags = ENV['CFLAGS'] -ldflags = ENV['LDFLAGS'] -cc = ENV['CC'] - -# use the CC that ruby was compiled with by default -cc ||= RbConfig::MAKEFILE_CONFIG['CC'] -cflags ||= "" -ldflags ||= "" - -# then ultimately default back to gcc -cc ||= "gcc" - -# FIXME: add more compilers with default options -if cc =~ /gcc|clang/ - cflags << " -O3" unless cflags =~ /-O\d/ - cflags << " -Wall" -end - -if !defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby' || RUBY_ENGINE == 'rbx' - require 'mkmf' - - # yajl_complete_parse is only in >= 2.0 - libyajl2_ok = have_library("yajl", "yajl_complete_parse", [ "yajl/yajl_parse.h" ]) && have_func("yajl_complete_parse") -else - # always install libyajl2 on Jruby - # FIXME: get the conditional mkmf stuff to work on Jruby - libyajl2_ok = false -end - -prefix=File.expand_path(File.join(File.dirname(__FILE__), "..", "..")) - -#dir_config 'libyajl2' - -if libyajl2_ok - File.open("Makefile", "w") do |mf| - mf.puts "# Dummy makefile when we don't build the library" - mf.puts "all install::\n" - end -else - ENV['CFLAGS'] = cflags - ENV['LDFLAGS'] = ldflags - ENV['CC'] = cc - system("cp -rf #{File.expand_path(File.join(File.dirname(__FILE__), "vendored"))} .") unless File.exists?("vendored") - - File.open("Makefile", "w") do |mf| - mf.puts "# Makefile for building vendored libyajl2" - mf.puts "CFLAGS = #{ENV['CFLAGS']}" - mf.puts "LDFLAGS = #{ENV['LDFLAGS']}" - mf.puts "CC = #{ENV['CC']}\n" - mf.puts "all install::" - mf.puts "\tcd vendored && ./configure --prefix=#{prefix}" - mf.puts "\tcd vendored && make install" - mf.puts "\tcp -f vendored/build/yajl-2.0.5/lib/libyajl.so .\n" - end -end - diff --git a/ext/libyajl2/vendored b/ext/libyajl2/vendored deleted file mode 160000 -Subproject 4c539cb5b48c41cecbbf3a0afcbd293de33abfc diff --git a/ffi-yajl-universal-java.gemspec b/ffi-yajl-universal-java.gemspec index ae1ee00..35a1ebb 100644 --- a/ffi-yajl-universal-java.gemspec +++ b/ffi-yajl-universal-java.gemspec @@ -1,7 +1,10 @@ gemspec = eval(IO.read(File.expand_path(File.join(File.dirname(__FILE__), "ffi-yajl.gemspec.shared")))) gemspec.platform = "universal-java" -gemspec.extensions = %w{ ext/libyajl2/extconf.rb } + +# XXX: after the libyajl2-gem, we don't need to fork the +# extensions so can we simplify the gemspecs now? +#gemspec.extensions = %w{ ext/libyajl2/extconf.rb } gemspec diff --git a/ffi-yajl.gemspec b/ffi-yajl.gemspec index be4a2d9..8e6943d 100644 --- a/ffi-yajl.gemspec +++ b/ffi-yajl.gemspec @@ -1,7 +1,7 @@ gemspec = eval(IO.read(File.expand_path(File.join(File.dirname(__FILE__), "ffi-yajl.gemspec.shared")))) gemspec.platform = Gem::Platform::RUBY -gemspec.extensions = %w{ ext/libyajl2/extconf.rb ext/ffi_yajl/ext/encoder/extconf.rb ext/ffi_yajl/ext/parser/extconf.rb } +gemspec.extensions = %w{ ext/ffi_yajl/ext/encoder/extconf.rb ext/ffi_yajl/ext/parser/extconf.rb } gemspec diff --git a/ffi-yajl.gemspec.shared b/ffi-yajl.gemspec.shared index 93f5ccc..7569d1e 100644 --- a/ffi-yajl.gemspec.shared +++ b/ffi-yajl.gemspec.shared @@ -17,6 +17,7 @@ Gem::Specification.new do |s| s.add_development_dependency "pry", "~> 0.9" s.add_development_dependency "rake-compiler", "~> 0.9" s.add_dependency "ffi", "~> 1.9" + s.add_dependency "libyajl2" s.bindir = "bin" s.executables = %w{ ffi-yajl-bench } |