-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from miyucy/vendor-snappy
Vendor snappy
- Loading branch information
Showing
5 changed files
with
62 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "vendor/snappy"] | ||
path = vendor/snappy | ||
url = git@github.com:google/snappy.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,30 @@ | ||
require 'mkmf' | ||
require 'fileutils' | ||
|
||
unless have_library 'snappy_ext' | ||
dst = File.dirname File.expand_path __FILE__ | ||
|
||
tar = 'tar' | ||
tar = 'gnutar' if find_executable 'gnutar' | ||
|
||
ver = "1.1.1" | ||
src = "snappy-#{ver}" | ||
|
||
FileUtils.rm_rf File.join dst, src | ||
system "curl -s http://snappy.googlecode.com/files/#{src}.tar.gz | #{tar} xz" | ||
|
||
src = File.join dst, src | ||
|
||
Dir.chdir src do | ||
system "./configure --disable-option-checking --disable-dependency-tracking --disable-gtest --without-gflags" | ||
unless have_library 'snappy' | ||
# build vendor/snappy | ||
pwd = File.dirname File.expand_path __FILE__ | ||
dir = File.join pwd, '..', 'vendor', 'snappy' | ||
|
||
Dir.chdir dir do | ||
system './autogen.sh' | ||
system './configure --disable-option-checking --disable-dependency-tracking --disable-gtest --without-gflags' | ||
end | ||
|
||
%w( | ||
config.h | ||
snappy-c.cc | ||
snappy-c.h | ||
snappy-internal.h | ||
snappy-sinksource.cc | ||
snappy-sinksource.h | ||
snappy-stubs-internal.cc | ||
snappy-stubs-internal.h | ||
snappy-stubs-public.h | ||
snappy.cc | ||
snappy.h | ||
).each do |file| | ||
FileUtils.copy File.join(src, file), File.join(dst, file) if FileTest.exist? File.join(src, file) | ||
end | ||
src = %w( | ||
config.h | ||
snappy-c.cc | ||
snappy-c.h | ||
snappy-internal.h | ||
snappy-sinksource.cc | ||
snappy-sinksource.h | ||
snappy-stubs-internal.cc | ||
snappy-stubs-internal.h | ||
snappy-stubs-public.h | ||
snappy.cc | ||
snappy.h | ||
).map { |e| File.join dir, e } | ||
FileUtils.cp src, pwd, :verbose => true | ||
end | ||
|
||
create_makefile 'snappy_ext' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters