From b2aa4add5ed29c54cba353d9ff914c9fe10c886e Mon Sep 17 00:00:00 2001 From: Steven Noonan Date: Sun, 18 Oct 2009 03:31:17 -0700 Subject: util/gcc-opt.pl: added (whoops) Signed-off-by: Steven Noonan --- crawl-ref/source/util/gcc-opt.pl | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 crawl-ref/source/util/gcc-opt.pl (limited to 'crawl-ref/source/util') diff --git a/crawl-ref/source/util/gcc-opt.pl b/crawl-ref/source/util/gcc-opt.pl new file mode 100755 index 0000000000..5ed4e48f64 --- /dev/null +++ b/crawl-ref/source/util/gcc-opt.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl +# +# GCC optimization flag generator +# + +use strict; +use warnings; + +my $gcc = $ARGV[0]; + +if ( ! $gcc ) { + die "Can't generate optimization flags (no compiler specified)\n"; +} + +if ( ! `which $gcc 2> /dev/null` ) { + die "Can't generate optimization flags ($gcc is missing?)\n"; +} + + +# +# Detect architecture +# + +my $arch = `uname -m`; + + +# Intel x86 +# +# Matches ix86, i386, i486, i586, i686 +# +my $pattern = "i([x3-6])86"; +if ($arch =~ $pattern) { + system("util/gcc-opt-x86.pl $gcc"); + exit 0 +} + + +exit 0 -- cgit v1.2.3-54-g00ecf