diff --git a/ruby/ext/google/protobuf_c/extconf.rb b/ruby/ext/google/protobuf_c/extconf.rb index ec17787f79..d8f081a431 100755 --- a/ruby/ext/google/protobuf_c/extconf.rb +++ b/ruby/ext/google/protobuf_c/extconf.rb @@ -2,6 +2,10 @@ require 'mkmf' +ext_name = "google/protobuf_c" + +dir_config(ext_name) + if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ $CFLAGS += " -std=gnu99 -O3 -DNDEBUG -fvisibility=hidden -Wall -Wsign-compare -Wno-declaration-after-statement" else @@ -14,7 +18,11 @@ if RUBY_PLATFORM =~ /linux/ $LDFLAGS += " -Wl,-wrap,memcpy" end -$objs = ["protobuf.o", "convert.o", "defs.o", "message.o", - "repeated_field.o", "map.o", "ruby-upb.o", "wrap_memcpy.o"] +$VPATH << "$(srcdir)/third_party/utf8_range" +$INCFLAGS << "$(srcdir)/third_party/utf8_range" + +$srcs = ["protobuf.c", "convert.c", "defs.c", "message.c", + "repeated_field.c", "map.c", "ruby-upb.c", "wrap_memcpy.c", + "utf8_range.c"] -create_makefile("google/protobuf_c") +create_makefile(ext_name)