1 diff -dur gdal-1.7.2.orig/swig/ruby/RubyMakefile.mk gdal-1.7.2/swig/ruby/RubyMakefile.mk
2 --- gdal-1.7.2.orig/swig/ruby/RubyMakefile.mk 2010-04-24 01:22:08.000000000 +0200
3 +++ gdal-1.7.2/swig/ruby/RubyMakefile.mk 2010-06-12 11:15:23.000000000 +0200
6 include $(GDAL_ROOT)/GDALmake.opt
8 -RUBY_MODULES = gdal.so ogr.so gdalconst.so osr.so
9 -RUBY_INCLUDE_DIR := $(shell ruby -rrbconfig -e "puts Config::CONFIG['archdir']")
10 +RUBY_INCLUDE_DIR := $(shell ruby -rrbconfig -e "puts Config::CONFIG['rubyhdrdir']")
11 +RUBY_MODULES = gdal.la ogr.la gdalconst.la osr.la
12 RUBY_LIB_DIR := $(shell ruby -rrbconfig -e "puts Config::CONFIG['libdir']")
13 RUBY_SO_NAME := $(shell ruby -rrbconfig -e "puts Config::CONFIG['RUBY_SO_NAME']")
14 RUBY_EXTENSIONS_DIR := $(shell ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
15 INSTALL_DIR := $(RUBY_EXTENSIONS_DIR)/gdal
17 -RUBY_INCLUDE = -I$(RUBY_INCLUDE_DIR)
18 +RUBY_INCLUDE = -I$(RUBY_INCLUDE_DIR) -I$(RUBY_INCLUDE_DIR)/$(shell ruby -rrbconfig -e "puts Config::CONFIG['arch']")
19 -LDFLAGS += -Xcompiler -shared -L$(RUBY_LIB_DIR)
20 +LDFLAGS += -Xcompiler -shared -module -avoid-version -rpath $(INSTALL_DIR) -L$(RUBY_LIB_DIR)
21 RUBY_LIB := -l$(RUBY_SO_NAME)
23 build: $(RUBY_MODULES)
25 install: $(INSTALL_DIR)
26 $(INSTALL) $(RUBY_MODULES) $(DESTDIR)$(INSTALL_DIR)
28 -$(RUBY_MODULES): %.so: %_wrap.o
29 - $(LD) $(LDFLAGS) $(LIBS) $(GDAL_SLIB_LINK) $(RUBY_LIB) $< -o $@
30 +$(RUBY_MODULES): %.la: %_wrap.lo
31 + $(LD) $(GDAL_SLIB_LINK) $(LDFLAGS) $(LIBS) $(RUBY_LIB) $< -o $@
35 $(CXX) $(CFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE) -c $<
39 $(CXX) $(CFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE) -c $<
43 $(CC) $(CFLAGS) $(GDAL_INCLUDE) $(RUBY_INCLUDE) -c $<
44 diff -dur gdal-1.7.2.orig/swig/include/ruby/gdal_ruby.i gdal-1.7.2/swig/include/ruby/gdal_ruby.i
45 --- gdal-1.7.2.orig/swig/include/ruby/gdal_ruby.i 2010-04-24 01:22:09.000000000 +0200
46 +++ gdal-1.7.2/swig/include/ruby/gdal_ruby.i 2010-06-12 14:21:11.000000000 +0200
51 - nChildCount = RARRAY(rubyArray)->len - 2;
52 + nChildCount = RARRAY_LEN(rubyArray) - 2;
55 rb_raise(rb_eRuntimeError, "Error in input XMLTree, child count is less than zero.");
56 diff -dur gdal-1.7.2.orig/swig/include/ruby/typemaps_ruby.i gdal-1.7.2/swig/include/ruby/typemaps_ruby.i
57 --- gdal-1.7.2.orig/swig/include/ruby/typemaps_ruby.i 2010-04-24 01:22:09.000000000 +0200
58 +++ gdal-1.7.2/swig/include/ruby/typemaps_ruby.i 2010-06-12 14:22:07.000000000 +0200
60 Check_Type($input, T_ARRAY);
63 - int seq_size = RARRAY($input)->len;
64 + int seq_size = RARRAY_LEN($input);
66 if ( seq_size != $dim0 ) {
67 rb_raise(rb_eRangeError, "sequence must have length %i.", seq_size);
69 Check_Type($input, T_ARRAY);
72 - $1 = RARRAY($input)->len;
73 + $1 = RARRAY_LEN($input);
75 /* Allocate space for the C array. */
76 $2 = (int*) malloc($1*sizeof(int));
78 /* Check if is a list */
79 Check_Type($input, T_ARRAY);
81 - $1 = RARRAY($input)->len;
82 + $1 = RARRAY_LEN($input);
83 tmpGCPList = (GDAL_GCP*) malloc($1*sizeof(GDAL_GCP));
87 /* is the provided object an array or a hash? */
88 if ( TYPE($input) == T_ARRAY) {
89 /* get the size of the array */
90 - int size = RARRAY($input)->len;
91 + int size = RARRAY_LEN($input);
93 for (int i = 0; i < size; i++) {
94 /* get the ruby object */
96 /* Check if is a list */
97 Check_Type($input, T_ARRAY);
99 - int size = RARRAY($input)->len;
100 + int size = RARRAY_LEN($input);
101 for (int i = 0; i < size; i++) {
102 VALUE item = rb_ary_entry($input, i);
103 char *pszItem = StringValuePtr(item);
105 /* %typemap(out) GByte* */
107 /* Stops insertion of default type map. */
109 \ No newline at end of file