mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-26 07:34:11 +00:00
782cb7aea0
* get libc-cflags and libcxx-cxxflags from the sibling clang derivation. * fix the order of those for C++ (libc-cflags use -idirafter for a reason).
28 lines
889 B
Bash
Executable File
28 lines
889 B
Bash
Executable File
#!/bin/sh
|
|
|
|
buildcpath() {
|
|
local path after
|
|
while (( $# )); do
|
|
case $1 in
|
|
-isystem)
|
|
shift
|
|
path=$path${path:+':'}$1
|
|
;;
|
|
-idirafter)
|
|
shift
|
|
after=$after${after:+':'}$1
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
echo $path${after:+':'}$after
|
|
}
|
|
|
|
export CPATH=${CPATH}${CPATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
|
|
$(<@clang@/nix-support/libc-cflags))
|
|
export CPLUS_INCLUDE_PATH=${CPLUS_INCLUDE_PATH}${CPLUS_INCLUDE_PATH:+':'}$(buildcpath ${NIX_CFLAGS_COMPILE} \
|
|
$(<@clang@/nix-support/libcxx-cxxflags) \
|
|
$(<@clang@/nix-support/libc-cflags))
|
|
|
|
exec -a "$0" @unwrapped@/bin/$(basename $0) "$@"
|