M
Maxim Sokolovsky
Hi,
I'm spent countless time in searching working ruby port on Windows
Mobile. I'm not a fan of this OS, but already have device with it and
still want to try programming in ruby on it. Google kicked me to:
1. Howto compile and binaries ruby 1.8.x with Microsoft Visual Embedded
C++ ( http://uema2.s8.xrea.com/ruby-mswince/ ). This works fine, but
first of all it has Windows Mobile restriction on relative paths (ex.
requiring 'lib/some.rb" - fails) and in addition it is 1.8 - not 1.9.
There is no chance to use it as full value port, especially with
rubygems.
2. Success story of compiling ruby 1.8 with CeGCC cross compile
toolchain ( http://cegcc.sourceforge.net/ ). Here is the topic of John
Snowdon aka smed: http://www.ruby-forum.com/topic/143475 . He
successfully compiled ruby 1.8 even with rubygems (!). But for my sorry
I can't reproduce his success and his blog with binaries is down too (
http://www.target-earth.net/gadgets/code/rubyce.html ). In addition it
is 1.8 branch and it will be more likely to use 1.9.x
So, i'm trying to compile ruby 1.9.1 p429 with CeGCC 0.59.1 under
Ubuntu 10.04. First trouble that I get - is that confuigure script can't
verify setpgrp() while cross-compiling. I solve it by adding
"ac_cv_func_setpgrp_void=yes" to args. Next trouble was that configure
script cannot detect pthread_kill function in any header, so it suggest
not to use native threads, but in 1.9.x native threads - are mandatory.
Some search kick me to mail list with howto compile pthreads-win32 (
http://sourceware.org/ml/pthreads-win32/ ) with mingw32ce (mingw32 part
of cegcc). I reproduced his success and now i have .dll, .a and headers.
First my question is - can I it ( library compiled with mingw32ce) in
compiling with cegcc? I'm novice in cross compiling and it would be
greate if someone can hint how do I use it in compilng: some extra
environment variable, makefile edits or maybe i can add some args to
configure script? I think i choose dirty incorrect way, trying to hack
makefile and sources in order to bypass errors. I added
"-I/path/to/pthreads" to optflags variable in Makefile. I'm compiling
with this environment:
ruby sources is in: /var/tmp/ruby-1.9.1-p429
pthreads-win32 sources, library file(.a) and its dll in:
/var/tmp/pthreads-w32-2-8-0-release
cegcc is in: /opt/cegcc
mingw32ce is in: /opt/mingw32ce
this is my PATH env variable:
/opt/mingw32ce/bin:/opt/cegcc/bin:/opt/cegcc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/android-sdk-linux_86/tools
and this is line with which i'm compiling:
CC=arm-cegcc-gcc CPP=arm-cegcc-cpp AR=arm-cegcc-ar AS=arm-cegcc-as
OBJCOPY=arm-cegcc-objcopy OBJDUMP=arm-cegcc-objdump
RANLIB=arm-cegcc-ranlib LIBS="-I/var/tmp/pthreads-w32-2-8-0-release
-I/opt/cegcc/include -I/opt/cegcc/arm-cegcc/include"
LDFLAGS="-L/var/tmp/pthreads-w32-2-8-0-release -L/opt/cegcc/lib
-L/opt/cegcc/arm-cegcc/lib" ./configure --host=arm-wince
--prefix=/WinCE/built --enable-shared ac_cv_func_setpgrp_void=yes
--enable-pthread=pthread
and this is my output:
axe1@axe1-desktop:/var/tmp/ruby-1.9.1-p429$ make
GNUmakefile:43: target `ruby.rc' given more than once in the same rule.
include-dir . --include-dir . --include-dir ./win32 ruby.rc ruby.res.o
make: include-dir: Command not found
make: [ruby.res.o] Error 127 (ignored)
arm-cegcc-gcc -O2 -I/var/tmp/pthreads-w32-2-8-0-release -g -Wall
-Wno-parentheses -I. -I.ext/include/arm-wince -I./include -I.
-DRUBY_EXPORT -o io.o -c io.c
io.c: In function 'rb_io_close_read':
io.c:3369: warning: implicit declaration of function 'rb_w32_is_socket'
io.c: In function 'pipe_open':
io.c:4643: warning: implicit declaration of function 'rb_w32_aspawn'
io.c:4643: error: 'P_NOWAIT' undeclared (first use in this function)
io.c:4643: error: (Each undeclared identifier is reported only once
io.c:4643: error: for each function it appears in.)
io.c:4644: warning: implicit declaration of function 'rb_w32_spawn'
io.c: In function 'io_cntl':
io.c:6709: warning: implicit declaration of function 'ioctl'
io.c: In function 'maygvl_copy_stream_wait_read':
io.c:7351: warning: implicit declaration of function 'select'
make: *** [io.o] Error 1
can anybody kick me to right way on solving this? I couldn't understand
why ruby uses some *w32* function when i'm compiling with posix
compilant toolchain...
P.S. Sorry for my bad english - my native language is russian.
I'm spent countless time in searching working ruby port on Windows
Mobile. I'm not a fan of this OS, but already have device with it and
still want to try programming in ruby on it. Google kicked me to:
1. Howto compile and binaries ruby 1.8.x with Microsoft Visual Embedded
C++ ( http://uema2.s8.xrea.com/ruby-mswince/ ). This works fine, but
first of all it has Windows Mobile restriction on relative paths (ex.
requiring 'lib/some.rb" - fails) and in addition it is 1.8 - not 1.9.
There is no chance to use it as full value port, especially with
rubygems.
2. Success story of compiling ruby 1.8 with CeGCC cross compile
toolchain ( http://cegcc.sourceforge.net/ ). Here is the topic of John
Snowdon aka smed: http://www.ruby-forum.com/topic/143475 . He
successfully compiled ruby 1.8 even with rubygems (!). But for my sorry
I can't reproduce his success and his blog with binaries is down too (
http://www.target-earth.net/gadgets/code/rubyce.html ). In addition it
is 1.8 branch and it will be more likely to use 1.9.x
So, i'm trying to compile ruby 1.9.1 p429 with CeGCC 0.59.1 under
Ubuntu 10.04. First trouble that I get - is that confuigure script can't
verify setpgrp() while cross-compiling. I solve it by adding
"ac_cv_func_setpgrp_void=yes" to args. Next trouble was that configure
script cannot detect pthread_kill function in any header, so it suggest
not to use native threads, but in 1.9.x native threads - are mandatory.
Some search kick me to mail list with howto compile pthreads-win32 (
http://sourceware.org/ml/pthreads-win32/ ) with mingw32ce (mingw32 part
of cegcc). I reproduced his success and now i have .dll, .a and headers.
First my question is - can I it ( library compiled with mingw32ce) in
compiling with cegcc? I'm novice in cross compiling and it would be
greate if someone can hint how do I use it in compilng: some extra
environment variable, makefile edits or maybe i can add some args to
configure script? I think i choose dirty incorrect way, trying to hack
makefile and sources in order to bypass errors. I added
"-I/path/to/pthreads" to optflags variable in Makefile. I'm compiling
with this environment:
ruby sources is in: /var/tmp/ruby-1.9.1-p429
pthreads-win32 sources, library file(.a) and its dll in:
/var/tmp/pthreads-w32-2-8-0-release
cegcc is in: /opt/cegcc
mingw32ce is in: /opt/mingw32ce
this is my PATH env variable:
/opt/mingw32ce/bin:/opt/cegcc/bin:/opt/cegcc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/android-sdk-linux_86/tools
and this is line with which i'm compiling:
CC=arm-cegcc-gcc CPP=arm-cegcc-cpp AR=arm-cegcc-ar AS=arm-cegcc-as
OBJCOPY=arm-cegcc-objcopy OBJDUMP=arm-cegcc-objdump
RANLIB=arm-cegcc-ranlib LIBS="-I/var/tmp/pthreads-w32-2-8-0-release
-I/opt/cegcc/include -I/opt/cegcc/arm-cegcc/include"
LDFLAGS="-L/var/tmp/pthreads-w32-2-8-0-release -L/opt/cegcc/lib
-L/opt/cegcc/arm-cegcc/lib" ./configure --host=arm-wince
--prefix=/WinCE/built --enable-shared ac_cv_func_setpgrp_void=yes
--enable-pthread=pthread
and this is my output:
axe1@axe1-desktop:/var/tmp/ruby-1.9.1-p429$ make
GNUmakefile:43: target `ruby.rc' given more than once in the same rule.
include-dir . --include-dir . --include-dir ./win32 ruby.rc ruby.res.o
make: include-dir: Command not found
make: [ruby.res.o] Error 127 (ignored)
arm-cegcc-gcc -O2 -I/var/tmp/pthreads-w32-2-8-0-release -g -Wall
-Wno-parentheses -I. -I.ext/include/arm-wince -I./include -I.
-DRUBY_EXPORT -o io.o -c io.c
io.c: In function 'rb_io_close_read':
io.c:3369: warning: implicit declaration of function 'rb_w32_is_socket'
io.c: In function 'pipe_open':
io.c:4643: warning: implicit declaration of function 'rb_w32_aspawn'
io.c:4643: error: 'P_NOWAIT' undeclared (first use in this function)
io.c:4643: error: (Each undeclared identifier is reported only once
io.c:4643: error: for each function it appears in.)
io.c:4644: warning: implicit declaration of function 'rb_w32_spawn'
io.c: In function 'io_cntl':
io.c:6709: warning: implicit declaration of function 'ioctl'
io.c: In function 'maygvl_copy_stream_wait_read':
io.c:7351: warning: implicit declaration of function 'select'
make: *** [io.o] Error 1
can anybody kick me to right way on solving this? I couldn't understand
why ruby uses some *w32* function when i'm compiling with posix
compilant toolchain...
P.S. Sorry for my bad english - my native language is russian.