summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/llvm/llvm/llvm-config
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/llvm/llvm/llvm-config')
-rw-r--r--meta/recipes-devtools/llvm/llvm/llvm-config42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta/recipes-devtools/llvm/llvm/llvm-config b/meta/recipes-devtools/llvm/llvm/llvm-config
new file mode 100644
index 0000000000..a45f38c650
--- /dev/null
+++ b/meta/recipes-devtools/llvm/llvm/llvm-config
@@ -0,0 +1,42 @@
1#!/bin/bash
2#
3# Copyright OpenEmbedded Contributors
4#
5# SPDX-License-Identifier: MIT
6#
7# Wrap llvm-config since the native llvm-config will remap some values correctly
8# if placed in the target sysroot but for flags, it would provide the native ones.
9# Provide ours from the environment instead.
10
11NEXT_LLVM_CONFIG="$(which -a llvm-config | sed -n 2p)"
12if [[ $# == 0 ]]; then
13 exec "$NEXT_LLVM_CONFIG"
14fi
15
16remain=""
17output=""
18for arg in "$@"; do
19 case "$arg" in
20 --cppflags)
21 output="${output} ${CPPFLAGS}"
22 ;;
23 --cflags)
24 output="${output} ${CFLAGS}"
25 ;;
26 --cxxflags)
27 output="${output} ${CXXFLAGS}"
28 ;;
29 --ldflags)
30 output="${output} ${LDFLAGS}"
31 ;;
32 *)
33 remain="${remain} ${arg}"
34 ;;
35 esac
36done
37
38if [ "${remain}" != "" ]; then
39 output="${output} "$("$NEXT_LLVM_CONFIG" ${remain})
40fi
41
42echo "${output}"