summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-01 12:13:13 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-01 12:13:13 +0000
commit1b62e5ec370a5e442effad9b5012cb3373a839ff (patch)
treeee365d6aeb2464044b9708a3acb2bb9ef779c63c /lib/mkmf.rb
parent982450e24fb275644664499cea197deae3f5722b (diff)
* lib/mkmf.rb (create_tmpsrc): we need to include COMMON_HEADERS,
namely inclusion of ruby.h, because _GNU_SOURCE is now defined there (if any) and socket.so requires it on Linux systems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 74a20609b2..034ca0bf9c 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -321,6 +321,7 @@ end
def create_tmpsrc(src)
src = yield(src) if block_given?
+ src[0, 0] = COMMON_HEADERS + "\n"
src = src.gsub(/[ \t]+$/, '').gsub(/\A\n+|^\n+$/, '').sub(/[^\n]\z/, "\\&\n")
count = 0
begin
@@ -1843,7 +1844,7 @@ split = Shellwords.method(:shellwords).to_proc
EXPORT_PREFIX = config_string('EXPORT_PREFIX') {|s| s.strip}
-hdr = []
+hdr = ['#include "ruby.h"' "\n"]
config_string('COMMON_MACROS') do |s|
Shellwords.shellwords(s).each do |w|
hdr << "#define " + w.split(/=/, 2).join(" ")