aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2014-11-18 18:33:37 +0100
committerDavid 'Digit' Turner <digit@google.com>2014-11-18 18:34:31 +0100
commitb0476631154e3bfae0ab5a8503e38b527e222da1 (patch)
tree403b371b1ce96eb83000e78a3e4d67c792b84f74 /build
parent32fd7b840e986af859df76b8f330f63978dd83bb (diff)
downloadndk-b0476631154e3bfae0ab5a8503e38b527e222da1.tar.gz
build/tools/builder-funcs.sh: Fix for Darwin
The XCode 'ar' tool doesn't support the 'D' flag, which is specific to GNU binutils (and used to generate 'deterministic' archives which are nice-to-have but not mandatory). Change-Id: I8f2879df4ba91a1554383bd89bf2af06bddea09e
Diffstat (limited to 'build')
-rw-r--r--build/tools/builder-funcs.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/build/tools/builder-funcs.sh b/build/tools/builder-funcs.sh
index fbad6f2c3..340cc6d0f 100644
--- a/build/tools/builder-funcs.sh
+++ b/build/tools/builder-funcs.sh
@@ -311,7 +311,7 @@ builder_sources ()
builder_static_library ()
{
- local lib libname
+ local lib libname arflags
libname=$1
if [ -z "$_BUILD_DSTDIR" ]; then
panic "Destination directory not set"
@@ -327,7 +327,16 @@ builder_static_library ()
fi
builder_log "${_BUILD_PREFIX}Archive: $libname"
rm -f "$lib"
- builder_command ${_BUILD_AR} crsD "$lib" "$_BUILD_OBJECTS"
+ arflags="crs"
+ case $HOST_TAG in
+ darwin*)
+ # XCode 'ar' doesn't support D flag
+ ;;
+ *)
+ arflags="${arflags}D"
+ ;;
+ esac
+ builder_command ${_BUILD_AR} $arflags "$lib" "$_BUILD_OBJECTS"
fail_panic "Could not archive ${_BUILD_PREFIX}$libname objects!"
}