summaryrefslogtreecommitdiff
path: root/qpid/cpp/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/bindings')
-rw-r--r--qpid/cpp/bindings/qpid/ruby/ext/cqpid/extconf.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/qpid/cpp/bindings/qpid/ruby/ext/cqpid/extconf.rb b/qpid/cpp/bindings/qpid/ruby/ext/cqpid/extconf.rb
index fc9e65d562..27cb41af3c 100644
--- a/qpid/cpp/bindings/qpid/ruby/ext/cqpid/extconf.rb
+++ b/qpid/cpp/bindings/qpid/ruby/ext/cqpid/extconf.rb
@@ -25,8 +25,16 @@
require 'mkmf'
+(rver, rrev, rmin) = RUBY_VERSION.split('.')
+
+old_ruby = (rver == "1" && rrev < "9") # pre-1.9
+
# Setup the build environment.
-$CFLAGS = "-fPIC -fno-inline -x c++ -lstdc++"
+if old_ruby
+ $CFLAGS = "-fPIC -fno-inline -x c++ -lstdc++"
+else
+ $CFLAGS = "-fPIC -fno-inline"
+end
REQUIRED_LIBRARIES = [
'stdc++',
@@ -68,7 +76,7 @@ have_library('stdc++')
REQUIRED_LIBRARIES.each {|library| require_library library}
-REQUIRED_HEADERS.each {|header| require_header header}
+REQUIRED_HEADERS.each {|header| require_header header} if old_ruby
create_makefile('cqpid')