Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 1 | #!/usr/bin/ruby |
| 2 | |
| 3 | require 'mkmf' |
| 4 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 5 | unless RUBY_PLATFORM =~ /mswin|mingw/ |
| 6 | $CFLAGS += " -std=c99 -O3 -DNDEBUG" |
| 7 | end |
| 8 | |
| 9 | |
| 10 | if RUBY_PLATFORM =~ /linux/ |
| 11 | # Instruct the linker to point memcpy calls at our __wrap_memcpy wrapper. |
| 12 | $LDFLAGS += " -Wl,-wrap,memcpy" |
| 13 | end |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 14 | |
| 15 | $objs = ["protobuf.o", "defs.o", "storage.o", "message.o", |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 16 | "repeated_field.o", "map.o", "encode_decode.o", "upb.o", |
| 17 | "wrap_memcpy.o"] |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 18 | |
| 19 | create_makefile("google/protobuf_c") |