Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get rid of gcc-ism #118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Get rid of gcc-ism #118

wants to merge 1 commit into from

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