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

Complier centric options are hardcoded. #4

Open
jprondak-zz opened this issue Jan 11, 2011 · 0 comments
Open

Complier centric options are hardcoded. #4

jprondak-zz opened this issue Jan 11, 2011 · 0 comments

Comments

@jprondak-zz
Copy link

The forcing of some compiler options can be bad. In the case of -Wall. This is GCC centric and would cause compilation on other platforms to fail (i.e. Solaris and Windows). The following patch might be a solution.


--- ext/xslt_lib/extconf.rb     2011-01-11 10:16:12.424617000 -0600
+++ ext/xslt_lib/extconf.rb.new 2011-01-11 10:07:10.048251000 -0600
@@ -54,7 +54,14 @@
   $CFLAGS += " -DUSE_EXSLT"
 end

-$CFLAGS = '-g -Wall ' + `xml2-config --cflags`.chomp + " " + `xslt-config --cflags`.chomp + " " + $CFLAGS
+# Allow for custom compiler to be specified.
+RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
+
+# NOTE: use GCC flags unless Visual C compiler is used
+$CFLAGS << '-Wall ' if (RbConfig::MAKEFILE_CONFIG['CC'] =~ /gcc/ && RUBY_PLATFORM !~ /mswin/ )
+
+$CFLAGS << '-g ' + `xml2-config --cflags`.chomp + " " + `xslt-config --cflags`.chomp
+

 create_header()
 create_makefile("xml/xslt_lib")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant