aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-01-05 10:16:05 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-01-05 10:16:05 +0900
commit449ef72cb97ae57e57c523d2252528f8eb7b9d3e (patch)
tree5e14b451b5ea01fe8bdb591ece6aff45f739d006 /configure.ac
parent7a3322a0fd660d676f1918bd7c4a37676b44e1c2 (diff)
downloadruby-449ef72cb97ae57e57c523d2252528f8eb7b9d3e.tar.gz
configure.ac: Stop auto-detection of __ANDROID_API__ when cross-compiling
A patch from Tee KOBAYASHI <xtkoba+ruby@gmail.com>. [Bug #17491]
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 7 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index c143c23d3a..e1e59f06fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -457,11 +457,13 @@ AC_TRY_COMPILE([
[
AC_MSG_RESULT(yes)
target_os=${target_os}-android
- AC_MSG_CHECKING([for Android API version])
- # hacky workaround: https://github.com/termux/termux-packages/issues/6176
- rb_android_api=`getprop ro.build.version.sdk`
- AC_MSG_RESULT($rb_android_api)
- RUBY_APPEND_OPTIONS(CPPFLAGS, -D__ANDROID_API__=$rb_android_api -Wno-macro-redefined)
+ AS_IF([test "x$cross_compiling" = xno], [
+ AC_MSG_CHECKING([for Android API version])
+ # hacky workaround: https://github.com/termux/termux-packages/issues/6176
+ rb_android_api=`getprop ro.build.version.sdk`
+ AC_MSG_RESULT($rb_android_api)
+ RUBY_APPEND_OPTIONS(CPPFLAGS, -D__ANDROID_API__=$rb_android_api -Wno-macro-redefined)
+ ])
])
AC_SUBST(RM, ['rm -f'])