ClickHouse/debian/copy_clang_binaries.sh
proller c62901a871 Internal compiler: first try find and use clang with version in postf… (#1029)
* Fix missing includes

* clean

* Allow compile with clang 3.8 with warning

* Add message

* Internal compiler: first try find and use clang vith version in postfix (clang-4.0)

* Try use clang-3.8

* try use all clangs

* Update copy_clang_binaries.sh

* Update rules
2017-08-10 07:44:28 +03:00

31 lines
960 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash -e
# Копирует бинарник clang а также ld и shared-библиотеку libstdc++ в указанную директорию.
# Так повезло, что этого достаточно, чтобы затем собирать код на удалённом сервере с совпадающей версией Ubuntu, но без установленного компилятора.
DST=${1:-.};
PATH="/usr/local/bin:/usr/local/sbin:/usr/bin:$PATH"
LD=$(command -v gold || command -v ld.gold || command -v ld)
# Should be runned with correct path to clang
if [ -z "$CLANG" ]; then
CLANG=$(which clang)
fi
if [ ! -x "$CLANG" ]; then
echo "Not found executable clang."
exit 1
fi
if [ ! -x "$LD" ]; then
echo "Not found executable gold or ld."
exit 1
fi
cp "$CLANG" "${DST}/clang"
cp "$LD" "${DST}/ld"
STDCPP=$(ldd $CLANG | grep -oE '/[^ ]+libstdc++[^ ]+')
[ -f "$STDCPP" ] && cp "$STDCPP" $DST