summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2011-07-11 20:42:34 +0000
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2011-07-11 20:42:34 +0000
commitcb495c85bdfc6ab72b5867289b5022df268b34c5 (patch)
tree0acba5f8e4eb6aa8f86820e509d71074da75d417 /configure.in
parent5f7a1a2a4ed6e7ac83723ba21ec4dea618f67426 (diff)
Introduce the concept of platform variants. These allow further
qualification of the normal (arch, os) pairings used to factorise the code base via the VGP_ defines. With this change, a new define VGPV_<arch>_<os>_<variant> is also passed to each compile. The initial motivation is to allow clean factorisation of Android-specific code, which is a minor variant of arm-linux, without having to introduce a complete new platform. In all other cases the supplied tag is simply "vanilla". Also add configure.in stuff to recognise Android at configure time. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11872 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in76
1 files changed, 76 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 13d75e3a..8f224231 100644
--- a/configure.in
+++ b/configure.in
@@ -596,6 +596,15 @@ fi
#----------------------------------------------------------------------------
+# Extra fine-tuning of installation directories
+#----------------------------------------------------------------------------
+AC_ARG_WITH(tmpdir,
+ [ --with-tmpdir=PATH Specify path for temporary files],
+ tmpdir="$withval",
+ tmpdir="/tmp")
+AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
+
+#----------------------------------------------------------------------------
# Libc and suppressions
#----------------------------------------------------------------------------
# This variable will collect the suppression files to be used.
@@ -623,6 +632,15 @@ AC_EGREP_CPP([DARWIN_LIBC], [
],
GLIBC_VERSION="darwin")
+# not really a version check
+AC_EGREP_CPP([BIONIC_LIBC], [
+#if defined(__ANDROID__)
+ BIONIC_LIBC
+#endif
+],
+GLIBC_VERSION="bionic")
+
+
AC_MSG_CHECKING([the GLIBC_VERSION version])
case "${GLIBC_VERSION}" in
@@ -725,6 +743,11 @@ case "${GLIBC_VERSION}" in
AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
# DEFAULT_SUPP set by kernel version check above.
;;
+ bionic)
+ AC_MSG_RESULT(Bionic)
+ AC_DEFINE([BIONIC_LIBC], 1, [Define to 1 if you're using Bionic])
+ DEFAULT_SUPP="bionic.supp ${DEFAULT_SUPP}"
+ ;;
*)
AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
@@ -748,6 +771,57 @@ DEFAULT_SUPP="exp-sgcheck.supp ${DEFAULT_SUPP}"
#----------------------------------------------------------------------------
+# Platform variants?
+#----------------------------------------------------------------------------
+
+# Normally the PLAT = (ARCH, OS) characterisation of the platform is enough.
+# But there are times where we need a bit more control. The motivating
+# and currently only case is Android: this is almost identical to arm-linux,
+# but not quite. So this introduces the concept of platform variant tags,
+# which get passed in the compile as -DVGPV_<arch>_<os>_<variant> along
+# with the main -DVGP_<arch>_<os> definition.
+#
+# In almost all cases, the <variant> bit is "vanilla". But for Android
+# it is "android" instead.
+#
+# Consequently (eg), plain arm-linux would build with
+#
+# -DVGP_arm_linux -DVGPV_arm_linux_vanilla
+#
+# whilst an Android build would have
+#
+# -DVGP_arm_linux -DVGPV_arm_linux_android
+#
+# The setup of the platform variant is pushed relatively far down this
+# file in order that we can inspect any of the variables set above.
+
+# In the normal case ..
+VGCONF_PLATVARIANT="vanilla"
+
+# Android on ARM ?
+if test "$VGCONF_ARCH_PRI-$VGCONF_OS" = "arm-linux" \
+ -a "$GLIBC_VERSION" = "bionic";
+then
+ VGCONF_PLATVARIANT="android"
+fi
+
+AC_SUBST(VGCONF_PLATVARIANT)
+
+
+# FIXME: do we also want to define automake variables
+# VGCONF_PLATVARIANT_IS_<WHATEVER>, where WHATEVER is (currently)
+# VANILLA or ANDROID ? This would be in the style of VGCONF_ARCHS_INCLUDE,
+# VGCONF_PLATFORMS_INCLUDE and VGCONF_OS_IS above? Could easily enough
+# do that. Problem is that we can't do and-ing in Makefile.am's, but
+# that's what we'd need to do to use this, since what we'd want to write
+# is something like
+#
+# VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
+#
+# Oh well, something to figure out properly later on.
+
+
+#----------------------------------------------------------------------------
# Checking for various library functions and other definitions
#----------------------------------------------------------------------------
@@ -1909,6 +1983,8 @@ cat<<EOF
Build OS: ${VGCONF_OS}
Primary build target: ${VGCONF_PLATFORM_PRI_CAPS}
Secondary build target: ${VGCONF_PLATFORM_SEC_CAPS}
+ Platform variant: ${VGCONF_PLATVARIANT}
+ Primary -DVGPV string: -DVGPV_${VGCONF_ARCH_PRI}_${VGCONF_OS}_${VGCONF_PLATVARIANT}=1
Default supp files: ${DEFAULT_SUPP}
EOF