2014-12-12 23:58:26 +00:00
|
|
|
#!/usr/bin/ruby
|
|
|
|
|
|
|
|
require 'mkmf'
|
|
|
|
|
2019-02-01 18:09:34 +00:00
|
|
|
if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
|
2019-08-14 21:41:37 +00:00
|
|
|
$CFLAGS += " -std=gnu90 -O3 -DNDEBUG -Wall -Wdeclaration-after-statement -Wsign-compare"
|
2019-02-01 18:09:34 +00:00
|
|
|
else
|
2019-08-14 21:41:37 +00:00
|
|
|
$CFLAGS += " -std=gnu90 -O3 -DNDEBUG"
|
2019-02-01 18:09:34 +00:00
|
|
|
end
|
2014-12-12 23:58:26 +00:00
|
|
|
|
2017-03-08 19:25:48 +00:00
|
|
|
|
|
|
|
if RUBY_PLATFORM =~ /linux/
|
|
|
|
# Instruct the linker to point memcpy calls at our __wrap_memcpy wrapper.
|
|
|
|
$LDFLAGS += " -Wl,-wrap,memcpy"
|
|
|
|
end
|
|
|
|
|
2014-12-12 23:58:26 +00:00
|
|
|
$objs = ["protobuf.o", "defs.o", "storage.o", "message.o",
|
2017-03-08 19:25:48 +00:00
|
|
|
"repeated_field.o", "map.o", "encode_decode.o", "upb.o",
|
|
|
|
"wrap_memcpy.o"]
|
2014-12-12 23:58:26 +00:00
|
|
|
|
|
|
|
create_makefile("google/protobuf_c")
|