extconf.rb 564 Bytes
Newer Older
1 2 3 4
#!/usr/bin/ruby

require 'mkmf'

5
if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/
6
  $CFLAGS += " -std=gnu90 -O3 -DNDEBUG -Wall -Wdeclaration-after-statement -Wsign-compare"
7
else
8
  $CFLAGS += " -std=gnu90 -O3 -DNDEBUG"
9
end
10

11 12 13 14 15 16

if RUBY_PLATFORM =~ /linux/
  # Instruct the linker to point memcpy calls at our __wrap_memcpy wrapper.
  $LDFLAGS += " -Wl,-wrap,memcpy"
end

17
$objs = ["protobuf.o", "defs.o", "storage.o", "message.o",
18 19
         "repeated_field.o", "map.o", "encode_decode.o", "upb.o",
         "wrap_memcpy.o"]
20 21

create_makefile("google/protobuf_c")