aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/objc
diff options
context:
space:
mode:
authorGravatar cparsons <cparsons@google.com>2017-04-28 18:24:52 +0200
committerGravatar Vladimir Moskva <vladmos@google.com>2017-04-28 18:33:45 +0200
commit5038016e6573962d2554fcf9c10faa0cca8714e2 (patch)
tree27c3a70a80ac6a8dac7bda9e11ed364a2d076185 /tools/objc
parent151d1933823922ba9b8856c3c26c30dbd234fd27 (diff)
Rollforward of: Basic open-source crosstool to support targeting apple platform types.
RELNOTES: None. PiperOrigin-RevId: 154547417
Diffstat (limited to 'tools/objc')
-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