ruby-changes:60863
From: Yusuke <ko1@a...>
Date: Wed, 22 Apr 2020 02:32:01 +0900 (JST)
Subject: [ruby-changes:60863] 92afac8f33 (master): configure.ac: Automatically add -D__ANDROID_API=ver on Android
https://git.ruby-lang.org/ruby.git/commit/?id=92afac8f33 From 92afac8f3346f050ff25ad15a640a6861f690427 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Wed, 22 Apr 2020 01:45:19 +0900 Subject: configure.ac: Automatically add -D__ANDROID_API=ver on Android diff --git a/configure.ac b/configure.ac index ba86def..e16c3e4 100644 --- a/configure.ac +++ b/configure.ac @@ -414,6 +414,30 @@ AC_CHECK_PROG(PKG_CONFIG, pkg-config, [pkg-config], [], [], https://github.com/ruby/ruby/blob/trunk/configure.ac#L414 # checks for UNIX variants that set C preprocessor variables AC_USE_SYSTEM_EXTENSIONS +AC_MSG_CHECKING([whether it is Android]) +AC_TRY_COMPILE([ + @%:@ifdef __ANDROID__ + @%:@error android + @%:@endif +], [], +[AC_MSG_RESULT(no)], +[ + AC_MSG_RESULT(yes) + target_os=${target_os}-android + AC_MSG_CHECKING([for Android API version]) + AC_TRY_COMPILE([ + @%:@ifndef __ANDROID_API__ + @%:@error android + @%:@endif + ], [], + [AC_MSG_RESULT(defined by the compiler)], + [ + rb_android_api=`getprop ro.build.version.sdk` + AC_MSG_RESULT($rb_android_api) + RUBY_APPEND_OPTIONS(CPPFLAGS, -D__ANDROID_API__=$rb_android_api) + ]) +]) + AC_SUBST(RM, ['rm -f']) AC_SUBST(CP, ['cp']) RMDIRS='$(top_srcdir)/tool/rmdirs' -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/