diff options
author | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2021-09-12 11:40:43 +0300 |
---|---|---|
committer | Roman Perepelitsa <roman.perepelitsa@gmail.com> | 2021-09-12 11:40:43 +0300 |
commit | d2f78d4b29d463b433aa6e013661331b63317b22 (patch) | |
tree | e280916750ca21d8aa347d8cbdba92141bd88f70 /gitstatus/build | |
parent | 4f3d2ffe7251a17aa10e00ed30d55f6fd9d65002 (diff) | |
parent | 20eb8c64bf2520e20739610acb503c8729867a5e (diff) |
Merge commit '20eb8c64bf2520e20739610acb503c8729867a5e'
Diffstat (limited to 'gitstatus/build')
-rwxr-xr-x | gitstatus/build | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gitstatus/build b/gitstatus/build index 036a12ad..d23f8fc1 100755 --- a/gitstatus/build +++ b/gitstatus/build @@ -88,7 +88,7 @@ if [ -n "$gitstatus_install_tools" ]; then fi ;; freebsd) - command pkg install -y cmake gmake binutils gcc git perl5 + command pkg install -y cmake gmake binutils git perl5 wget ;; openbsd) command pkg_add install cmake gmake gcc git wget @@ -140,8 +140,15 @@ cflags="$archflag=$gitstatus_cpu -fno-plt -D_FORTIFY_SOURCE=2 -Wformat -Werror=f ldflags= static_pie= +if [ -z "${CC-}" ]; then + case "$gitstatus_kernel" in + freebsd) export CC=clang;; + *) export CC=cc;; + esac +fi + printf 'int main() {}\n' >"$workdir"/cc-test.c -if 2>/dev/null "${CC:-cc}" \ +if 2>/dev/null "$CC" \ -ffile-prefix-map=x=y \ -Werror \ -c "$workdir"/cc-test.c \ @@ -150,7 +157,7 @@ if 2>/dev/null "${CC:-cc}" \ fi command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o -if 2>/dev/null "${CC:-cc}" \ +if 2>/dev/null "$CC" \ -fstack-clash-protection -fcf-protection \ -Werror \ -c "$workdir"/cc-test.c \ @@ -159,7 +166,7 @@ if 2>/dev/null "${CC:-cc}" \ fi command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o -if 2>/dev/null "${CC:-cc}" \ +if 2>/dev/null "$CC" \ -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now \ -Werror \ "$workdir"/cc-test.c \ @@ -168,7 +175,7 @@ if 2>/dev/null "${CC:-cc}" \ fi command rm -f -- "$workdir"/cc-test "$workdir"/cc-test.o -if 2>/dev/null "${CC:-cc}" \ +if 2>/dev/null "$CC" \ -fpie -static-pie \ -Werror \ "$workdir"/cc-test.c \ @@ -195,6 +202,7 @@ case "$gitstatus_kernel" in libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; freebsd) + gitstatus_cxx=clang++ gitstatus_make=gmake gitstatus_ldflags="$gitstatus_ldflags ${static_pie:--static}" libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" @@ -241,7 +249,7 @@ case "$gitstatus_kernel" in ;; esac -for cmd in cat cmake gcc g++ git ld ln mkdir rm strip tar "$gitstatus_make"; do +for cmd in cat cmake git ld ln mkdir rm strip tar "$gitstatus_make"; do if ! command -v "$cmd" >/dev/null 2>&1; then if [ -n "$gitstatus_install_tools" ]; then >&2 echo "[internal error] $cmd not found" |