aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/objc/libtool.sh
diff options
context:
space:
mode:
authorGravatar cparsons <cparsons@google.com>2017-05-03 22:13:44 +0200
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2017-05-04 13:13:49 +0200
commitcc21998c299b4d1f97df37b961552ff8168da17f (patch)
tree85a5a1845a1802842e5bf127d3b07f34c36eb52d /tools/objc/libtool.sh
parent655c07b87161030f73f8e2103aebcf8277051582 (diff)
Rollforward #2 of: Basic open-source crosstool to support targeting apple platform types.
RELNOTES: None. PiperOrigin-RevId: 154993630
Diffstat (limited to 'tools/objc/libtool.sh')
-rwxr-xr-xtools/objc/libtool.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/objc/libtool.sh b/tools/objc/libtool.sh
index 5ad89a019d..e1275758ea 100755
--- a/tools/objc/libtool.sh
+++ b/tools/objc/libtool.sh
@@ -23,7 +23,15 @@
set -eu
-MY_LOCATION=${MY_LOCATION:-"$0.runfiles/bazel_tools/tools/objc"}
+# A trick to allow invoking this script in multiple contexts.
+if [ -z ${MY_LOCATION+x} ]; then
+ if [ -d "$0.runfiles/" ]; then
+ MY_LOCATION="$0.runfiles/bazel_tools/tools/objc"
+ else
+ MY_LOCATION="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+ fi
+fi
+
WRAPPER="${MY_LOCATION}/xcrunwrapper.sh"
# Creates a symbolic link to the input argument file and returns the symlink