diff options
Diffstat (limited to 'recipes-devtools/clang/llvm-common')
-rw-r--r-- | recipes-devtools/clang/llvm-common/llvm-config | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/recipes-devtools/clang/llvm-common/llvm-config b/recipes-devtools/clang/llvm-common/llvm-config index a9a416d..9fb14cb 100644 --- a/recipes-devtools/clang/llvm-common/llvm-config +++ b/recipes-devtools/clang/llvm-common/llvm-config | |||
@@ -1,10 +1,35 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/bash |
2 | # Wrapper script for real llvm-config. Simply calls | 2 | # |
3 | # Wrapper script for llvm-config. Supplies the right environment variables | ||
4 | # for the target and delegates to the native llvm-config for anything else. This | ||
5 | # is needed because arguments like --ldflags, --cxxflags, etc. are set by the | ||
6 | # native compile rather than the target compile. | ||
7 | # | ||
3 | 8 | ||
4 | if [ $WANT_LLVM_RELEASE ]; then | 9 | SCRIPT_DIR="$(dirname "$(readlink -f "$0")")" |
5 | exec `dirname $0`/${TARGET_PREFIX}llvm-config$WANT_LLVM_RELEASE ${@} | 10 | NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)" |
6 | else | 11 | export YOCTO_ALTERNATE_EXE_PATH="$(readlink -f "$SCRIPT_DIR/../llvm-config")" |
7 | echo "The variable WANT_LLVM_RELEASE is not defined and exported" | 12 | |
8 | echo "by your build recipe. Go figure." | 13 | if [[ $# == 0 ]]; then |
9 | exit 1 | 14 | exec "$NEXT_LLVM_CONFIG" |
10 | fi | 15 | fi |
16 | |||
17 | for arg in "$@"; do | ||
18 | case "$arg" in | ||
19 | --cppflags) | ||
20 | echo $TARGET_CPPFLAGS | ||
21 | ;; | ||
22 | --cflags) | ||
23 | echo $TARGET_CFLAGS | ||
24 | ;; | ||
25 | --cxxflags) | ||
26 | echo $TARGET_CXXFLAGS | ||
27 | ;; | ||
28 | --ldflags) | ||
29 | echo $TARGET_LDFLAGS | ||
30 | ;; | ||
31 | *) | ||
32 | echo "$("$NEXT_LLVM_CONFIG" "$arg")" | ||
33 | ;; | ||
34 | esac | ||
35 | done | ||