summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-11 02:11:53 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-11 02:11:53 +0000
commit69ac654c90178dce12c3365afbc03447a0fccf78 (patch)
tree390fb7f7cd6f0888e0c321b8049f0471dd2ca205 /configure.in
parentf21431e574b1b27e47d19ff40ce2997783d310e3 (diff)
Merges a patch form naclports.
* configure.in (RUBY_NACL and others): Supports PNaCl. * dln.c: replace the old hacky dynamic loading over HTTP with nacl_io. * file.c: tenatively use access(2) instead of eaccess. (rb_file_load_ok): weaken with attribute but not by postprocess. * io.c (socket.h): now NaCl has socket.h (flock): disable here instead of nacl/ioctl.h * nacl/GNUmakefile.in (CC, LD, NM, AR, AS, RANLIB, OBJDUMP, OBJCOPY): respect path to them if they are absolute. This helps naclports to build ruby in their source tree. (PROGRAM_NMF, .SUFFIXES): support .pnexe for PNaCl. (ruby.o, file.o): move the hack to attributes in ruby.c and file.c * nacl/ioctl.h: removed. move the hack to io.c. * nacl/nacl-config.rb: support arm, pnacl and others. * nacl/pepper_main.c: support build in a naclports tree. * ruby.c (rb_load_file): weaken with attribute but not by postprocess. The patch is by sbc@google.com and the Native Client Authors. It is available at: * https://chromium.googlesource.com/external/naclports.git/+/873ca4910a5f9d4206306aacb4ed79c587c6a5f3/ports/ruby/nacl.patch git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in29
1 files changed, 18 insertions, 11 deletions
diff --git a/configure.in b/configure.in
index efb14e7611..d2c44d6199 100644
--- a/configure.in
+++ b/configure.in
@@ -96,8 +96,11 @@ AC_DEFUN([RUBY_NACL],
[no], [nacl_cv_build_variant=glibc],
[yes], [nacl_cv_build_variant=newlib])])
- AS_CASE(["$build_cpu"],
- [x86_64|i?86], [nacl_cv_cpu_nick=x86], [nacl_cv_cpu_nick=$build_cpu])
+ AS_CASE(["$target_cpu"],
+ [x86_64|i?86], [nacl_cv_cpu_nick=x86],
+ [le32], [nacl_cv_cpu_nick=pnacl
+ ac_cv_exeext=.pexe],
+ [nacl_cv_cpu_nick=$target_cpu])
AS_CASE(["$build_os"],
[linux*], [nacl_cv_os_nick=linux],
[darwin*], [nacl_cv_os_nick=mac],
@@ -111,6 +114,9 @@ AC_DEFUN([RUBY_NACL],
if test -d \
"${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"; then
NACL_TOOLCHAIN="${nacl_cv_os_nick}_${nacl_cv_cpu_nick}_${nacl_cv_build_variant}"
+ elif test -d \
+ "${NACL_SDK_ROOT}/toolchain/${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"; then
+ NACL_TOOLCHAIN="${nacl_cv_os_nick}_x86_${nacl_cv_cpu_nick}/${nacl_cv_build_variant}"
else
AS_CASE(
["${nacl_cv_build_variant}"],
@@ -791,12 +797,16 @@ fi
RUBY_TRY_CFLAGS(-Qunused-arguments, [RUBY_APPEND_OPTIONS(rb_cv_wsuppress_flags, -Qunused-arguments)])
if test "$GCC" = yes; then
- # -D_FORTIFY_SOURCE
- # When defined _FORTIFY_SOURCE, glibc enables some additional sanity
- # argument check. The performance drop is very little and Ubuntu enables
- # _FORTIFY_SOURCE=2 by default. So, let's support it for protecting us from
- # a mistake of silly C extensions.
- RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
+ # NaCl's glibc build generates undefined references to __memset_chk.
+ # TODO(sbc): Remove this once NaCl's glibc is fixed.
+ AS_CASE(["$target_os"], [nacl], [], [
+ # -D_FORTIFY_SOURCE
+ # When defined _FORTIFY_SOURCE, glibc enables some additional sanity
+ # argument check. The performance drop is very little and Ubuntu enables
+ # _FORTIFY_SOURCE=2 by default. So, let's support it for protecting us from
+ # a mistake of silly C extensions.
+ RUBY_TRY_CFLAGS(-D_FORTIFY_SOURCE=2, [RUBY_APPEND_OPTION(XCFLAGS, -D_FORTIFY_SOURCE=2)])
+ ])
# -fstack-protector
AS_CASE(["$target_os"],
@@ -1087,12 +1097,9 @@ main()
LIBS="-lm $LIBS"
if test "${nacl_cv_build_variant}" = "newlib"; then
RUBY_APPEND_OPTION(CPPFLAGS, -DNACL_NEWLIB)
- RUBY_APPEND_OPTION(LIBS, '-lnosys')
else
RUBY_APPEND_OPTION(XCFLAGS, -fPIC)
fi
- ac_cv_func_shutdown=no
- ac_cv_func_fcntl=no
],
[ LIBS="-lm $LIBS"])