Kevin Clark | 916f353 | 2009-03-20 04:21:39 +0000 | [diff] [blame] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
Bryan Duxbury | c3affb3 | 2010-11-17 22:47:06 +0000 | [diff] [blame] | 20 | if defined?(RUBY_ENGINE) && RUBY_ENGINE =~ /jruby/ |
| 21 | File.open('Makefile', 'w'){|f| f.puts "all:\n\ninstall:\n" } |
| 22 | else |
| 23 | require 'mkmf' |
jfarrell | ef7d56c | 2014-07-10 09:21:25 -0400 | [diff] [blame] | 24 | require 'rbconfig' |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 25 | |
jfarrell | ef7d56c | 2014-07-10 09:21:25 -0400 | [diff] [blame] | 26 | $ARCH_FLAGS = RbConfig::CONFIG['CFLAGS'].scan( /(-arch )(\S+)/ ).map{|x,y| x + y + ' ' }.join('') |
| 27 | |
Jake Farrell | fc35612 | 2012-10-09 00:30:03 +0000 | [diff] [blame] | 28 | |
Jake Farrell | a87cc5e | 2013-03-23 22:56:13 -0400 | [diff] [blame] | 29 | $CFLAGS = "-fsigned-char -g -O2 -Wall -Werror " + $ARCH_FLAGS |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 30 | |
Bryan Duxbury | c3affb3 | 2010-11-17 22:47:06 +0000 | [diff] [blame] | 31 | have_func("strlcpy", "string.h") |
Kevin Clark | 4bd8916 | 2008-07-08 00:47:49 +0000 | [diff] [blame] | 32 | |
Bryan Duxbury | c3affb3 | 2010-11-17 22:47:06 +0000 | [diff] [blame] | 33 | create_makefile 'thrift_native' |
| 34 | end |