Paul Brannan
2/11/2008 9:46:00 PM
On Tue, Feb 12, 2008 at 06:20:12AM +0900, Paul Brannan wrote:
> We should have been using the fPIC flag all along, since we're building
> shared objects.
Here's a patch which you should be able to apply to the tarball:
Index: test/Makefile.am
===================================================================
--- test/Makefile.am (revision 173)
+++ test/Makefile.am (working copy)
@@ -32,6 +32,9 @@
-I.. $(RUBY_CPPFLAGS)
+AM_CXXLAGS = + $(RUBY_CXXFLAGS)
+
AM_LDFLAGS = $(RUBY_LDFLAGS) -L../rice
@@ -41,4 +44,3 @@
$(RUBY_LIBS) $(RUBY_LIBRUBYARG)
-
Index: rice/Makefile.am
===================================================================
--- rice/Makefile.am (revision 173)
+++ rice/Makefile.am (working copy)
@@ -110,3 +110,5 @@
AM_CPPFLAGS = @RUBY_CPPFLAGS@
+AM_CXXFLAGS = @RUBY_CXXFLAGS@
+
Index: ruby.ac
===================================================================
--- ruby.ac (revision 173)
+++ ruby.ac (working copy)
@@ -23,6 +23,7 @@
RUBY_CONFIG_ARCHDIR=`RUBY_CONFIG(archdir)`
RUBY_CONFIG_LIBDIR=`RUBY_CONFIG(libdir)`
RUBY_CONFIG_BINDIR=`RUBY_CONFIG(bindir)`
+RUBY_CONFIG_CFLAGS=`RUBY_CONFIG(CFLAGS)`
RUBY_CONFIG_LIBS=`RUBY_CONFIG(LIBS)`
RUBY_CONFIG_DLDLIBS=`RUBY_CONFIG(DLDLIBS)`
RUBY_CONFIG_LDFLAGS=`RUBY_CONFIG(LDFLAGS)`
@@ -32,6 +33,12 @@
RUBY_CPPFLAGS="-I${RUBY_CONFIG_ARCHDIR}"
AC_SUBST(RUBY_CPPFLAGS)
+RUBY_CFLAGS="${RUBY_CONFIG_CFLAGS}"
+AC_SUBST(RUBY_CFLAGS)
+
+RUBY_CXXFLAGS="${RUBY_CONFIG_CFLAGS}"
+AC_SUBST(RUBY_CXXFLAGS)
+
RUBY_LDFLAGS="-L${RUBY_ARCHDIR} -L${RUBY_CONFIG_LIBDIR} ${RUBY_LDFLAGS}"
AC_SUBST(RUBY_LDFLAGS)
Rice and the samples now build fine, though two unit tests still fail:
To_From_Ruby:int_from_ruby: integer -4611686018427387904 too small to convert to `int'
To_From_Ruby:unsigned_int_from_ruby: integer 13835058055282163712 too big to convert to `unsigned int'
We will be sure to test x86_64 better for the next release.
Paul