ruby/nacl
yugui 57bc5eaf2f Fixes build failures on Portable Native Client.
Note: Some of the fixes are for newlib in general but not NaCl-specific.

* include/ruby/intern.h (rb_fd_select): declare struct timeval, or the
  struct gets local to the function in C99.

* file.c (#include): add nacl/stat.h for PNaCl.
  (utimes): added a declaration for PNaCl.
  (stat_atimespec): stat::st_atimensec is long long but
  timespec::tv_nsec is long in PNaCl.
  (stat_mtimespec, stat_ctimespec): ditto.
  (rb_group_member): disable getgroups unless HAVE_GETGROUPS.
  (eaccess): unify the fallback to generic defined(USE_GETEUID).

* io.c: include sys/time.h for struct timeval.
  (rb_close_before_exec): nothing we can do if F_GETFD is not
  available.
  (ioctl): pnacl newlib actually doesn't have ioctl.

* process.c (maxgroups): it is used iff
   defined(_SC_NGROUPS_MAX) || defined(NGROUPS_MAX) but not
   defined(HAVE_GETGROUPS) || defined(HAVE_SETGROUPS).
  (obj2gid): fail unless the object is a Fixnum if getgrnam is not
  available.
  (disable_child_handler_fork_child): sigaction is not available in
  PNaCl newlib.

* configure.in (warnflags, strict_warnflags): avoid -ansi for strlcpy.
  (rb_cv_gcc_atomic_builtins): also check
  __atomic_or_etch because it is used in ruby_atomic.h.
  (rb_cv_gcc_sync_builtins): ditto.
  (HAVE_GETGRNAM): added.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-11 13:33:14 +00:00
..
GNUmakefile.in Merges a patch form naclports. 2014-10-11 02:11:53 +00:00
README.nacl Fixes build failures on Portable Native Client. 2014-10-11 13:33:14 +00:00
create_nmf.rb Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00
dirent.h Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00
example.html Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00
nacl-config.rb Merges a patch form naclports. 2014-10-11 02:11:53 +00:00
package.rb Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00
pepper_main.c Merges a patch form naclports. 2014-10-11 02:11:53 +00:00
resource.h Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00
select.h Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00
signal.h Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00
stat.h Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00
unistd.h Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00
utime.h Imports Ruby's port to NativeClient (a.k.a NaCl). 2012-05-17 02:48:59 +00:00

README.nacl

=begin
= Native Client port of Ruby

= How to build
== Prerequisites
You need to install the following things before building NaCl port of Ruby.
* Ruby 1.9.3 or later
* Python 2.6 or later
* NativeClient SDK pepper 37 or later
* GNU make

== Steps
(1) Extract all files from the tarball:
     $ tar xzf ruby-X.Y.Z.tar.gz
(2) Set NACL_SDK_ROOT environment variable to the path to the Native Client SDK you installed:
     $ export NACL_SDK_ROOT=/home/yugui/src/nacl_sdk/pepper_37
(3) Configure
     $ ./configure --prefix=/tmp/nacl-ruby --host=x86_64-nacl --with-baseruby=/path/to/ruby-1.9.3-or-later
(4) Make
     $ make
     $ make package

Now you have ruby.nexe. You can run it by sel_ldr in NaCl SDK.

"make package" installs "pepper-ruby.nexe", an example Pepper application that
embeds Ruby", and libraries to $prefix. You can run it by the following steps:
(5) Publish the $prefix directory on a web server
(6) Visit the example.html on the web server by a browser that implements Pepper 18 or later.
   -- e.g., Chrome 18 implements Pepper 18, Chrome 19 implements Pepper 19, ...

=== Example Configurations
* x86_32 Native Client
   $ ./configure --prefix=/tmp/nacl-ruby \
     --host=i686-nacl \
     --with-baseruby=/path/to/ruby-1.9.3-or-later
* arm Native Client
   $ ./configure --prefix=/tmp/nacl-ruby \
     --host=arm-nacl \
     --with-newlib \
     --with-baseruby=/path/to/ruby-1.9.3-or-later
* Portable Native Client
   $ ./configure --prefix=/tmp/nacl-ruby \
     --host=le32-nacl \
     --with-newlib \
     --with-static-linked-ext \
     --with-baseruby=/path/to/ruby-1.9.3-or-later

= Copyright
* Copyright 2012 Google Inc. All Rights Reserved.
* Author: yugui@google.com (Yugui Sonoda)
=end