diff --git a/macos/get_library_path.sh b/macos/get_library_path.sh new file mode 100644 index 00000000..85131608 --- /dev/null +++ b/macos/get_library_path.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +# Options +WANTED_LIB=$1 +EXEC=$2 + +# Function to extract the first element of a space seperated list +get_first_arg() { + echo $1 +} + +# Get current path +echo $(get_first_arg $(otool -L $EXEC | grep $WANTED_LIB)) \ No newline at end of file diff --git a/macos/search_rpath.sh b/macos/search_rpath.sh new file mode 100644 index 00000000..8acdd4fe --- /dev/null +++ b/macos/search_rpath.sh @@ -0,0 +1,14 @@ +#!/bin/sh +set -e + +# Options +RPATH_NAME=$1 +EXEC=$2 + +# Function to keep only the second arg +get_second_arg() { + echo $2 +} + +# Get current rpath +echo $(get_second_arg $(otool -l $EXEC | grep $RPATH_NAME | grep path)) \ No newline at end of file