forked from facebook/infer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This is mostly a partial revert of D19022905 and D19272627 for only the part of it concerned with "install-with-libs". Fixes facebook#1260. Reviewed By: skcho Differential Revision: D21998484 fbshipit-source-id: ed884e772
- Loading branch information
1 parent
7df439c
commit 2a68099
Showing
6 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# Copyright (c) Facebook, Inc. and its affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# Usage: set_libso_path.sh [LIBSO_DIR] [TARGET] | ||
# | ||
# This changes MacOSX's executable [TARGET] to use shared libraries in | ||
# [LIBSO_DIR] when rpath has been set to [LIBSO_DIR]. | ||
|
||
set -e | ||
set -o pipefail | ||
set -u | ||
|
||
LIBSO_DIR=$1 | ||
TARGET=$2 | ||
|
||
TMP=$( mktemp ) | ||
trap "rm $TMP" EXIT | ||
|
||
otool -L "$TARGET" | tail -n +2 > "$TMP" | ||
while IFS='' read -r line || [[ -n "$line" ]]; do | ||
LIB_PATH=$( echo $line | awk '{print $1}' ) | ||
LIB_FILE=$( basename "${LIB_PATH}" ) | ||
if [ -f "${LIBSO_DIR}/${LIB_FILE}" ]; then | ||
install_name_tool -change "${LIB_PATH}" "@rpath/${LIB_FILE}" "$TARGET" | ||
fi | ||
done < "$TMP" |