AC_CANONICAL_HOST
AC_CANONICAL_BUILD
-if test "$XCONFIGURE" = "android"; then
+AS_IF([test "$XCONFIGURE" = "android"],[
# Initialize the Android NDK build system. Make sure to use the
# passed through NDK path.
# Make sure to pass through the CFLAGS, as older versions of the
with_ndk_cxx_shared="$android_ndk_cxx_shared"
with_ndk_cxx="$android_ndk_cxx"
ndk_INIT([$android_abi], [$ANDROID_SDK], [cross/ndk-build],
- [$ANDROID_CFLAGS])
-fi
+ [$ANDROID_CFLAGS])])
case $host in
*-mingw*)
# DIR should be a directory containing the Makefile.in actually
# implementing the Android NDK build system.
-AC_DEFUN_ONCE([ndk_INIT],
+AC_DEFUN([ndk_INIT],
[
# Look for Android.mk files.
ndk_module_files=
# required C and C++ headers.
AC_DEFUN([ndk_LATE],
-[
+[dnl
+dnl This calls AC_REQUIRE([AC_PROG_CXX]), leading to configure looking
+dnl for a C++ compiler. However, the language is not restored
+dnl afterwards if not `$ndk_INITIALIZED'.
AS_IF([test "$ndk_INITIALIZED" = "yes"],[
AS_IF([test -n "$CXX"], [AC_LANG_PUSH([C++])
AC_CHECK_HEADER([string], [ndk_working_cxx=yes],
[AC_MSG_WARN([Your C++ compiler is not properly set up, and\
the standard library headers could not be found.])])
AC_LANG_POP([C++])])])
+dnl Thus, manually switch back to C here.
+AC_LANG([C])
])
# ndk_SEARCH_MODULE(MODULE, NAME, ACTION-IF-FOUND, [ACTION-IF-NOT-FOUND])