Skip to content

Conversation

@unak
Copy link

@unak unak commented Apr 23, 2013

No description provided.

@lamont-granquist
Copy link

this is also a problem with AIX and Solaris

@lamont-granquist
Copy link

something like this works for me on AIX with the IBM compiler:

if RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc/
  $CFLAGS << ' -Wall -funroll-loops'
  $CFLAGS << ' -Wextra -O0 -ggdb3' if ENV['DEBUG']
end

that variable is set to the path of the compiler which is why i used a regex. you could probably use File.basename to drop the path and match ^gcc instead, but you need to worry about gcc invoked as /blah/blah/gcc4, etc.

could also do something more involved like invoke the compiler with --version and see if the output looks like gcc...

here's the File.basename version:

if File.basename(RbConfig::MAKEFILE_CONFIG['CC']) =~ /^gcc/
  $CFLAGS << ' -Wall -funroll-loops'
  $CFLAGS << ' -Wextra -O0 -ggdb3' if ENV['DEBUG']
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants