diff options
author | Steven Noonan <steven@uplinklabs.net> | 2009-10-18 03:31:17 -0700 |
---|---|---|
committer | Steven Noonan <steven@uplinklabs.net> | 2009-10-18 03:31:17 -0700 |
commit | b2aa4add5ed29c54cba353d9ff914c9fe10c886e (patch) | |
tree | 79ed1e8e41550fbdf08ebb7220094cae666cb9b7 /crawl-ref/source/util | |
parent | 6aec5ed01c4d4c41d1b94ae3f275d788b734719e (diff) | |
download | crawl-ref-b2aa4add5ed29c54cba353d9ff914c9fe10c886e.tar.gz crawl-ref-b2aa4add5ed29c54cba353d9ff914c9fe10c886e.zip |
util/gcc-opt.pl: added (whoops)
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/util')
-rwxr-xr-x | crawl-ref/source/util/gcc-opt.pl | 38 |
1 files changed, 38 insertions, 0 deletions
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 |