Summary: Provide hooks into the autoconf configure script to define where libgmp and libmpfr may be found. Use these and opam to copy the more exotic library objects into the installation of infer on a new `make install-with-libs` target so that the binaries can be distributed usefully, i.e., without users having to install gmp, mpfr, and more importantly apron and elina (which need ocaml + opam + ..., which would defeat the point of having binaries). Reviewed By: skcho Differential Revision: D14065317 fbshipit-source-id: 9a2ac7200master
parent
a3ecfdb8ad
commit
ba5ad82128
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright (c) 2018-present, Facebook, Inc.
|
||||||
|
#
|
||||||
|
# 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"
|
Loading…
Reference in new issue