Hi,
Please port mmap to ruby 1.9. Currently it fails with lots of errors.
make[1]: Entering directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
gcc -I. -I/usr/lib/ruby/1.8/x86_64-linux -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -g -O2
-fPIC -DHAVE_RB_STR_LSTRIP -DHAVE_RB_STR_MATCH -DHAVE_RB_STR_INSERT -DHAVE_RB_STR_CASECMP
-DRUBYLIBDIR='"/usr/lib/ruby/1.8"' -c mmap.c
gcc -shared -o mmap.so mmap.o -L. -L/usr/lib -L. -rdynamic -Wl,-export-dynamic -lruby1.8 -lpthread -lrt -ldl -lcrypt
-lm -lc
make[1]: Leaving directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
make install
make[1]: Entering directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
mkdir -p /media/forge/debian/diaspora/ruby-mmap-0.2.6/debian/ruby-mmap/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux
/usr/bin/install -c -m 0755 mmap.so
/media/forge/debian/diaspora/ruby-mmap-0.2.6/debian/ruby-mmap/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux
make[1]: Leaving directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
Building extension for ruby1.9.1 ...
/usr/bin/ruby1.9.1 -I/usr/lib/ruby/vendor_ruby /usr/lib/ruby/vendor_ruby/gem2deb/extension_builder.rb ruby-mmap
make[1]: Entering directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
make[1]: Leaving directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
make[1]: Entering directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
make[1]: Leaving directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
/usr/bin/ruby1.9.1 extconf.rb
creating Makefile
make
make[1]: Entering directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
compiling mmap.c
mmap.c: In function 'mm_str':
mmap.c:366:17: error: 'struct RString' has no member named 'ptr'
mmap.c:367:17: error: 'struct RString' has no member named 'len'
mmap.c:370:14: error: 'struct RString' has no member named 'aux'
mmap.c: In function 'mm_init':
mmap.c:741:30: error: 'struct RArray' has no member named 'len'
mmap.c:743:39: error: 'struct RArray' has no member named 'len'
mmap.c:745:25: error: 'struct RArray' has no member named 'ptr'
mmap.c:747:13: error: 'struct RArray' has no member named 'ptr'
mmap.c: In function 'mm_update':
mmap.c:1095:5: error: 'struct RString' has no member named 'len'
mmap.c: In function 'mm_correct_backref':
mmap.c:1183:22: error: 'struct RMatch' has no member named 'regs'
mmap.c:1184:26: error: 'struct RMatch' has no member named 'regs'
mmap.c:1186:22: error: 'struct RMatch' has no member named 'regs'
mmap.c:1188:34: error: 'struct RMatch' has no member named 'regs'
mmap.c:1188:67: error: 'struct RMatch' has no member named 'regs'
mmap.c:1189:15: error: 'struct RMatch' has no member named 'regs'
mmap.c:1190:15: error: 'struct RMatch' has no member named 'regs'
mmap.c: In function 'mm_sub_bang_int':
mmap.c:1228:22: error: 'struct RMatch' has no member named 'regs'
mmap.c:1235:18: error: 'struct RString' has no member named 'ptr'
mmap.c:1236:6: error: too few arguments to function 'rb_reg_regsub'
/usr/include/ruby-1.9.1/ruby/re.h:58:7: note: declared here
mmap.c:1237:18: error: 'struct RString' has no member named 'ptr'
mmap.c:1241:19: error: 'struct RString' has no member named 'len'
mmap.c:1242:35: error: 'struct RString' has no member named 'len'
mmap.c:1242:56: error: 'struct RString' has no member named 'len'
mmap.c:1243:18: error: 'struct RString' has no member named 'ptr'
mmap.c:1245:19: error: 'struct RString' has no member named 'len'
mmap.c:1249:26: error: 'struct RString' has no member named 'ptr'
mmap.c:1249:64: error: 'struct RString' has no member named 'len'
mmap.c:1250:19: error: 'struct RString' has no member named 'ptr'
mmap.c:1251:19: error: 'struct RString' has no member named 'len'
mmap.c:1253:21: error: 'struct RString' has no member named 'ptr'
mmap.c:1254:22: error: 'struct RString' has no member named 'ptr'
mmap.c:1254:42: error: 'struct RString' has no member named 'len'
mmap.c:1255:32: error: 'struct RString' has no member named 'len'
mmap.c: In function 'mm_gsub_bang_int':
mmap.c:1333:22: error: 'struct RMatch' has no member named 'regs'
mmap.c:1340:18: error: 'struct RString' has no member named 'ptr'
mmap.c:1341:6: error: too few arguments to function 'rb_reg_regsub'
/usr/include/ruby-1.9.1/ruby/re.h:58:7: note: declared here
mmap.c:1342:18: error: 'struct RString' has no member named 'ptr'
mmap.c:1346:35: error: 'struct RString' has no member named 'len'
mmap.c:1347:35: error: 'struct RString' has no member named 'len'
mmap.c:1347:55: error: 'struct RString' has no member named 'len'
mmap.c:1349:18: error: 'struct RString' has no member named 'len'
mmap.c:1353:26: error: 'struct RString' has no member named 'ptr'
mmap.c:1353:63: error: 'struct RString' has no member named 'len'
mmap.c:1354:19: error: 'struct RString' has no member named 'ptr'
mmap.c:1355:19: error: 'struct RString' has no member named 'len'
mmap.c:1357:21: error: 'struct RString' has no member named 'ptr'
mmap.c:1358:21: error: 'struct RString' has no member named 'ptr'
mmap.c:1358:40: error: 'struct RString' has no member named 'len'
mmap.c:1359:14: error: 'struct RString' has no member named 'len'
mmap.c:1359:35: error: 'struct RString' has no member named 'len'
mmap.c:1360:30: error: 'struct RString' has no member named 'len'
mmap.c:1362:52: error: 'struct RString' has no member named 'ptr'
mmap.c:1363:28: error: 'struct RString' has no member named 'len'
mmap.c:1366:44: error: 'struct RString' has no member named 'len'
mmap.c:1368:27: error: 'struct RString' has no member named 'len'
mmap.c: In function 'mm_subpat_set':
mmap.c:1427:32: error: 'struct RMatch' has no member named 'regs'
mmap.c:1431:26: error: 'struct RMatch' has no member named 'regs'
mmap.c:1435:24: error: 'struct RMatch' has no member named 'regs'
mmap.c: In function 'mm_aset':
mmap.c:1493:52: error: 'struct RString' has no member named 'len'
mmap.c: In function 'mm_insert':
mmap.c:1577:20: error: 'struct RString' has no member named 'len'
mmap.c: In function 'mm_append':
mmap.c:1655:60: error: 'struct RString' has no member named 'len'
mmap.c: In function 'mm_i_bang':
mmap.c:2008:30: error: 'struct RString' has no member named 'len'
make[1]: *** [mmap.o] Error 1
make[1]: Leaving directory `/media/forge/debian/diaspora/ruby-mmap-0.2.6/ext/mmap'
/usr/lib/ruby/1.9.1/rubygems/ext/builder.rb:37:in `block in make': make failed: (Gem::InstallError)
I was able to fix only missing header files issue (I'm a debian packager and don't know ruby). My initial patch for
picking correct header files
--- a/ext/mmap/mmap.c
+++ b/ext/mmap/mmap.c
@@ -12,9 +12,15 @@
#include <sys/sem.h>
#endif
+#ifndef RUBY_19
#include <rubyio.h>
#include <intern.h>
#include <re.h>
+#else
+#include <ruby/io.h>
+#include <ruby/intern.h>
+#include <ruby/re.h>
+#endif
#ifndef StringValue
#define StringValue(x) do { \
--- a/ext/mmap/extconf.rb
+++ b/ext/mmap/extconf.rb
@@ -29,4 +29,8 @@
$CFLAGS += " -DRUBYLIBDIR='\"#{CONFIG['rubylibdir']}\"'"
+if RUBY_VERSION =~/1.9/ then
+ $CFLAGS += " -DRUBY_19"
+end
+
create_makefile "mmap"
|