bogdan celer
05/06/2008 4:50 PM
post7778
|
I compile ruby 1.8.7 in QNX 6.3.2 without problems.
ruby and irb also work without problems.
I do not use qcc only gcc.
I used three versions gcc for the test and results from them were equal for every one.
( # gcc --version
gcc (GCC) 4.2.4 20080423 (prerelease)
gcc (GCC) 4.3.1 20080403 (prerelease)
and gcc (GCC) 4.4.0 20080505 (experimental) )
I take a stable-snapshot ruby.
I made only one change in configure:
# diff configure configure.org
15940c15940
< nto-qnx*) : ${LDSHARED='${CC} -shared'}
---
> nto-qnx*) : ${LDSHARED="qcc -shared"}
next
./configure --enable-shared --enable-pthread --enable-largefile 2>&1 | tee Konfig.log
make 2>&1 | tee CC.log
make test 2>&1 | tee Test.log => test succeeded
make install 2>&1 | tee INSTALL.log
./miniruby ./instruby.rb --dest-dir="" --extout=".ext" --make="make"
--mflags="-I /usr/qnx632/target/qnx6/usr/include"
--make-flags="I /usr/qnx632/target/qnx6/usr/include"
--installed-list .installed.list --mantype="man"
installing binary commands
installing command scripts
installing library scripts
installing headers
installing manpages
installing extension objects
installing extension scripts
Ruby version is:
bash-3.2# ruby --version
ruby 1.8.7 (2008-05-07 patchlevel 5000) [i386-nto-qnx6.3.2]
irb work:
# irb -retc
irb(main):001:0>
.........
irb(main):008:0> Etc.getlogin
=> "root"
irb(main):009:0> name = Etc.getlogin
=> "root"
irb(main):010:0> info = Etc.getpwnam(name)
=> #<struct Struct::Passwd name="root", passwd="", uid=0, gid=0, gecos="Superuser", dir="/root", shell="/bin/s
h", age="", comment="Superuser">
irb(main):011:0> info.dir
=> "/root"
irb(main):012:0>
# irb
irb(main):001:0> def fib_up_to(n)
irb(main):002:1> f1, f2 = 1, 1
irb(main):003:1> while f1 <= n
irb(main):004:2> puts f1
irb(main):005:2> f1, f2 = f2, f1 + f2
irb(main):006:2> end
irb(main):007:1> end
=> nil
irb(main):008:0> fib_up_to(4)
1
1
2
3
=> nil
irb(main):009:0> fib_up_to(6)
1
1
2
3
5
=> nil
irb(main):010:0>
|
|
|