Merge pull request #134 from cfallin/master
Update Ruby build setup to produce gems successfully. Include upb as a single .c / .h file.pull/135/head
commit
ed52203481
20 changed files with 17557 additions and 63 deletions
@ -1,3 +0,0 @@ |
|||||||
[submodule "upb"] |
|
||||||
path = upb |
|
||||||
url = https://github.com/haberman/upb |
|
@ -0,0 +1,10 @@ |
|||||||
|
#!/usr/bin/ruby |
||||||
|
|
||||||
|
require 'mkmf' |
||||||
|
|
||||||
|
$CFLAGS += " -O3 -std=c99 -Wno-unused-function -DNDEBUG " |
||||||
|
|
||||||
|
$objs = ["protobuf.o", "defs.o", "storage.o", "message.o", |
||||||
|
"repeated_field.o", "encode_decode.o", "upb.o"] |
||||||
|
|
||||||
|
create_makefile("google/protobuf_c") |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,23 +0,0 @@ |
|||||||
#!/usr/bin/ruby |
|
||||||
|
|
||||||
require 'mkmf' |
|
||||||
|
|
||||||
upb_path = File.absolute_path(File.dirname($0)) + "/../../../upb" |
|
||||||
libs = ["upb_pic", "upb.pb_pic", "upb.json_pic"] |
|
||||||
system("cd #{upb_path}; make " + libs.map{|l| "lib/lib#{l}.a"}.join(" ")) |
|
||||||
|
|
||||||
$CFLAGS += " -O3 -std=c99 -Wno-unused-function -DNDEBUG" |
|
||||||
|
|
||||||
find_header("upb/upb.h", upb_path) or |
|
||||||
raise "Can't find upb headers" |
|
||||||
find_library("upb_pic", "upb_msgdef_new", upb_path + "/lib") or |
|
||||||
raise "Can't find upb lib" |
|
||||||
find_library("upb.pb_pic", "upb_pbdecoder_init", upb_path + "/lib") or |
|
||||||
raise "Can't find upb.pb lib" |
|
||||||
find_library("upb.json_pic", "upb_json_printer_init", upb_path + "/lib") or |
|
||||||
raise "Can't find upb.pb lib" |
|
||||||
|
|
||||||
$objs = ["protobuf.o", "defs.o", "storage.o", "message.o", |
|
||||||
"repeated_field.o", "encode_decode.o"] |
|
||||||
|
|
||||||
create_makefile("protobuf_c") |
|
@ -0,0 +1,22 @@ |
|||||||
|
class << Gem::Specification |
||||||
|
def find_c_source(dir) |
||||||
|
`cd #{dir}; git ls-files "*.c" "*.h" extconf.rb Makefile`.split |
||||||
|
.map{|f| "#{dir}/#{f}"} |
||||||
|
end |
||||||
|
end |
||||||
|
|
||||||
|
Gem::Specification.new do |s| |
||||||
|
s.name = "google-protobuf" |
||||||
|
s.version = "3.0.0.alpha.2" |
||||||
|
s.licenses = ["BSD"] |
||||||
|
s.summary = "Protocol Buffers" |
||||||
|
s.description = "Protocol Buffers are Google's data interchange format." |
||||||
|
s.authors = ["Protobuf Authors"] |
||||||
|
s.email = "protobuf@googlegroups.com" |
||||||
|
s.require_paths = ["lib"] |
||||||
|
s.extensions = ["ext/google/protobuf_c/extconf.rb"] |
||||||
|
s.files = ["lib/google/protobuf.rb"] + |
||||||
|
# extension C source |
||||||
|
find_c_source("ext/google/protobuf_c") |
||||||
|
s.test_files = `git ls-files -- tests`.split |
||||||
|
end |
@ -1 +0,0 @@ |
|||||||
Subproject commit 56913be6bb57f81dbbf7baf9cc9a0a2cd1a36493 |
|
Loading…
Reference in new issue