1#!/usr/bin/ruby 2 3require 'mkmf' 4 5if RUBY_PLATFORM =~ /darwin/ || RUBY_PLATFORM =~ /linux/ 6 $CFLAGS += " -std=gnu90 -O3 -DNDEBUG -Wall -Wdeclaration-after-statement -Wsign-compare" 7else 8 $CFLAGS += " -std=gnu90 -O3 -DNDEBUG" 9end 10 11 12if RUBY_PLATFORM =~ /linux/ 13 # Instruct the linker to point memcpy calls at our __wrap_memcpy wrapper. 14 $LDFLAGS += " -Wl,-wrap,memcpy" 15end 16 17$objs = ["protobuf.o", "defs.o", "storage.o", "message.o", 18 "repeated_field.o", "map.o", "encode_decode.o", "upb.o", 19 "wrap_memcpy.o"] 20 21create_makefile("google/protobuf_c") 22