Index: gdal/swig/ruby/RubyMakefile.mk
===================================================================
--- gdal.orig/swig/ruby/RubyMakefile.mk	2012-01-04 08:03:41.000000000 +0100
+++ gdal/swig/ruby/RubyMakefile.mk	2012-02-20 11:32:37.000000000 +0100
@@ -41,7 +41,9 @@
 RUBY_LIB := -l$(RUBY_SO_NAME)
 else
 RUBY_MODULES=$(RUBY_MODULES_LIN)
-LDFLAGS += -Xcompiler -shared -L$(RUBY_LIB_DIR)
+LDFLAGS += -fPIC -DPIC -Xcompiler -shared -L$(RUBY_LIB_DIR)
+CFLAGS += -fPIC -DPIC
+CXXFLAGS += -fPIC -DPIC
 RUBY_LIB := -l$(RUBY_SO_NAME)
 endif
 
@@ -59,7 +61,7 @@
 $(INSTALL_DIR):
 	mkdir -p $(DESTDIR)$(INSTALL_DIR)
 
-install: $(INSTALL_DIR)
+install: $(INSTALL_DIR) $(RUBY_MODULES)
 	for i in $(RUBY_MODULES) ; do $(INSTALL) $$i $(DESTDIR)$(INSTALL_DIR) ; done
 
 $(RUBY_MODULES_MAC): %.bundle: %_wrap.o
@@ -69,10 +71,10 @@
 	$(LD) $(LDFLAGS) $(LIBS) $(GDAL_SLIB_LINK) $(RUBY_LIB) $< -o $@
 
 %.o: %.cpp
-	$(CXX) $(CFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE)  -c $<
+	$(CXX) $(CXXFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE)  -c $<
 
 %.o: %.cxx
-	$(CXX) $(CFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE) -c $<
+	$(CXX) $(CXXFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE) -c $<
 
 %.o: %.c
 	$(CC) $(CFLAGS) $(GDAL_INCLUDE)  $(RUBY_INCLUDE) -c $<
