Skip to content

Commit

Permalink
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions configure
Original file line number Diff line number Diff line change
@@ -746,7 +746,7 @@ not support #{name} compiler, please email contact@rubinius.com
end

@system_cflags = ""
@system_cxxflags = ""
@system_cxxflags = "-std=c++11 "
@system_cppflags = ""
@system_ldflags = ""

@@ -862,7 +862,8 @@ not support #{name} compiler, please email contact@rubinius.com
return $?.exitstatus unless run

unless $?.exitstatus == 0
failure "Compiling configure test program failed."
@log.log msg = "Compiling configure test program failed."
raise RuntimeError, msg
end

system expand("./#{basename}")
@@ -1373,6 +1374,37 @@ int main() { return tgetnum(""); }
end
end

def detect_atomic
@log.print "Checking -latomic: "

saved_ldflags = @system_ldflags.dup
@system_ldflags << "-latomic "

begin
status = check_program() do |src|
src.puts <<-EOP
#include <stdio.h>
#include <atomic>
int main(int argc, char* argv[]) {
std::atomic<int> i;
printf("%d", (int)i);
return 0;
}
EOP
end
rescue
status = nil
end

if status == 0
@log.write "yes"
else
@log.write "no"
@system_ldflags = saved_ldflags
end
end

def warn_prefix(dir)
delimiter = "-------------------------%s-----------------------"

@@ -1427,6 +1459,7 @@ int main() { return tgetnum(""); }
detect_headers
detect_curses
detect_strerror
detect_atomic
end

# Checks whether the given config file is a Perl script by checking its first

0 comments on commit 0aa75c2

Please sign in to comment.