diff --git a/tools/cpp/osx_cc_wrapper.sh b/tools/cpp/osx_cc_wrapper.sh index 8c9c111a750587..f8208a5aa5c6c8 100755 --- a/tools/cpp/osx_cc_wrapper.sh +++ b/tools/cpp/osx_cc_wrapper.sh @@ -54,6 +54,13 @@ function parse_option() { # let parse the option list for i in "$@"; do if [[ "$i" = @* ]]; then + if [[ "$i" = @executable_path/* ]] \ + || [[ "$i" = @loader_path/* ]] \ + || [[ "$i" = @rpath/* ]]; then + # magic tokens on Mac OS X + parse_option "$i" + continue + fi while IFS= read -r opt do parse_option "$opt" diff --git a/tools/cpp/osx_cc_wrapper.sh.tpl b/tools/cpp/osx_cc_wrapper.sh.tpl index 28bd47ba1a4a97..ae6b984670c8cc 100644 --- a/tools/cpp/osx_cc_wrapper.sh.tpl +++ b/tools/cpp/osx_cc_wrapper.sh.tpl @@ -53,6 +53,13 @@ function parse_option() { # let parse the option list for i in "$@"; do if [[ "$i" = @* ]]; then + if [[ "$i" = @executable_path/* ]] \ + || [[ "$i" = @loader_path/* ]] \ + || [[ "$i" = @rpath/* ]]; then + # magic tokens on Mac OS X + parse_option "$i" + continue + fi while IFS= read -r opt do parse_option "$opt"