summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-12-23 06:57:52 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-12-23 06:57:52 -0800
commitae1e265eda80625c655ee46ab99a4af418e4cd96 (patch)
tree3cc4d441e387beebce243f26979b30463c219d8a /configure
parent09db18d3284157497652e048ac63aa69aca864eb (diff)
downloadtxr-ae1e265eda80625c655ee46ab99a4af418e4cd96.tar.gz
txr-ae1e265eda80625c655ee46ab99a4af418e4cd96.tar.bz2
txr-ae1e265eda80625c655ee46ab99a4af418e4cd96.zip
build: Android support.
* Makefile (conftest.android): New helper target for testing for Android toolchain, via presence of __ANDROID__ preprocessor symbol, similarly to how we detect Darwin. * configure: New test for Android. This is mutually exclusive agains Darwin. On Android, we add some necessary feature selection macros to the compiler command line.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure16
1 files changed, 16 insertions, 0 deletions
diff --git a/configure b/configure
index ee52e460..5c3fd974 100755
--- a/configure
+++ b/configure
@@ -202,6 +202,7 @@ termios_define=
have_pkgconfig=
libffi_cflags=
darwin_target=
+android_target=
#
# Parse configuration variables
@@ -1143,6 +1144,21 @@ else
printf "no\n"
fi
+if ! [ $darwin_target ] ; then
+ printf "Checking for Android environment ... "
+
+ if [ "$(make conftest.android)" = "yes" ] ; then
+ printf "yes\n"
+ android_target=y
+ lang_flags="$lang_flags -D__ANDROID_API__=65535 -D_BSD_SOURCE"
+ printf "Regenerating config.make ..."
+ gen_config_make
+ printf "done\n"
+ else
+ printf "no\n"
+ fi
+fi
+
#
# Detect stupid FreeBSD problem: no defined way to reveal
# traditional BSD functions if Unix compliance is selected with