From 73b7eebf07a5045a47bff72a7fc70e5e6aee7b94 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Sat, 22 Jun 2024 05:04:49 +0000 Subject: build: fix crossruby build by handling empty `ac_abs_builddir` `ac_abs_builddir` can be empty when the build is top-level (not subdirs, and Ruby is usually the case). In such case, the MINIRUBY is expanded to `$RUBY -I -r'$(arch)-fake'`, which interprets `-r$(arch)-fake` as an argument to `-I` option. This led to: - Not loading the fake config file - Then not setting `CROSS_COMPILING` constant during extmk.rb execution - Then misusing cross-compiled `./miniruby` instead of baseruby to generate files used in exts. This commit fixes the issue by handling the empty `ac_abs_builddir` case properly. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 0d757eb998..6d6ae6a6c5 100644 --- a/configure.ac +++ b/configure.ac @@ -3501,7 +3501,7 @@ done BTESTRUBY='$(MINIRUBY)' AS_IF([test x"$cross_compiling" = xyes], [ - test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I$ac_abs_builddir "-r'$(arch)-fake' + test x"$MINIRUBY" = x && MINIRUBY="${RUBY-$BASERUBY} -I${ac_abs_builddir-.} "-r'$(arch)-fake' XRUBY_LIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["libdir"]']` XRUBY_RUBYLIBDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubylibdir"]']` XRUBY_RUBYHDRDIR=`${RUBY-$BASERUBY} -rrbconfig -e ['puts RbConfig::CONFIG["rubyhdrdir"]']` -- cgit v1.2.3