aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-19 20:23:58 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-11-09 16:01:01 +0900
commit22939382a897af32d9899fafedd5be807b0d555b (patch)
tree21003eb21b6eef945505b6e2776d4dbe5d3df19c /configure.ac
parente2ef85b1090d8806f6b68e2fa93d929d02e543b5 (diff)
downloadruby-22939382a897af32d9899fafedd5be807b0d555b.tar.gz
[Bug #18286] Make builtin binary if sharable in universal binaries
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac21
1 files changed, 20 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index bf6d9af1f1..e0057d974f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1489,6 +1489,25 @@ RUBY_CHECK_SIZEOF(float)
RUBY_CHECK_SIZEOF(double)
RUBY_CHECK_SIZEOF(time_t, [long "long long"], [], [@%:@include <time.h>])
RUBY_CHECK_SIZEOF(clock_t, [], [], [@%:@include <time.h>])
+AC_SUBST(X_BUILTIN_BINARY, yes)
+AS_IF([test "$cross_compiling" = yes],
+[dnl miniruby cannot run if cross compiling
+ X_BUILTIN_BINARY=no
+],
+[
+ AS_CASE([ac_cv_sizeof_voidp],
+ [[1-9]*], [dnl fixed value
+ ],
+ [
+ AC_CACHE_CHECK([word size], [rb_cv_word_size],
+ [for w in 4 8; do
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@if SIZEOF_VOIDP != ${w}
+ @%:@error SIZEOF_VOIDP
+ @%:@endif]])], [rb_cv_word_size=${w}; break])
+ done])
+ AS_IF([test -z $rb_cv_word_size], [X_BUILTIN_BINARY=no])
+ ])
+])
AC_CACHE_CHECK(packed struct attribute, rb_cv_packed_struct,
[rb_cv_packed_struct=no
@@ -4482,7 +4501,7 @@ guard=INCLUDE_RUBY_CONFIG_H
{
echo "#ifndef $guard"
echo "#define $guard 1"
- grep -v "^#define PACKAGE_" confdefs.h
+ sed "/^@%:@define PACKAGE_/d;s/ *$//" confdefs.h
echo "#endif /* $guard */"
} | tr -d '\015' |
(