diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2020-05-26 12:14:53 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2020-05-26 12:14:53 +0300 |
commit | 6696212ddecbb5ffae8d71467518cc5651c90b3f (patch) | |
tree | b5df01923337c3bd473f447bd865d553420c6cec /build | |
parent | 9a4bbcd930afa54bc605e3020fb38353161e5a84 (diff) |
Squashed 'gitstatus/' changes from cc956ca78..331e9ff65
331e9ff65 docs: remove packaging instructions and instead discourage it
c1fff558c install: add a link to #compiling docs if no gitstatusd is found
8632b85ab build: use extra optimization and hardening flags
c0a71c757 mbuild: don't stop on first failure
52e0359ec build: don't link statically when doing a local linux build
git-subtree-dir: gitstatus
git-subtree-split: 331e9ff65df96e7423c0b7a01e5e98d6c6b7d428
Diffstat (limited to 'build')
-rwxr-xr-x | build | 34 |
1 files changed, 24 insertions, 10 deletions
@@ -110,34 +110,44 @@ cpus="$(command getconf _NPROCESSORS_ONLN 2>/dev/null)" || cpus=8 case "$gitstatus_cpu" in - ppc64le) - archflag="-mcpu" - ;; - *) - archflag="-march" - ;; + ppc64le) archflag="-mcpu";; + *) archflag="-march";; esac +cflags="$archflag=$gitstatus_cpu -fno-plt" + +if [ "$gitstatus_cpu" = x86-64 ]; then + cflags="$cflags -mtune=generic" +fi + libgit2_cmake_flags= -libgit2_cflags="$archflag=$gitstatus_cpu" +libgit2_cflags="$cflags" gitstatus_cxx=g++ -gitstatus_cxxflags="-I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE $archflag=$gitstatus_cpu" +gitstatus_cxxflags="$cflags -I${workdir}/libgit2/include -DGITSTATUS_ZERO_NSEC -D_GNU_SOURCE" gitstatus_ldflags="-L${workdir}/libgit2/build" gitstatus_ldlibs= gitstatus_make=make case "$gitstatus_kernel" in linux) - gitstatus_ldflags="$gitstatus_ldflags -static" + if [ -n "$docker_cmd" ]; then + gitstatus_ldflags="$gitstatus_ldflags -static" + fi + gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; freebsd) gitstatus_make=gmake gitstatus_ldflags="$gitstatus_ldflags -static" + gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; netbsd) gitstatus_make=gmake gitstatus_ldflags="$gitstatus_ldflags -static" + gitstatus_ldflags="$gitstatus_ldflags -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; darwin) command mkdir -- "$workdir"/lib @@ -147,12 +157,15 @@ case "$gitstatus_kernel" in gitstatus_cxxflags="$gitstatus_cxxflags -I/usr/local/opt/libiconv/include" gitstatus_ldlibs="$gitstatus_ldlibs -liconv" gitstatus_ldflags="$gitstatus_ldflags -L${workdir}/lib" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=OFF" ;; msys*|mingw*) gitstatus_ldflags="$gitstatus_ldflags -static" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; cygwin*) gitstatus_ldflags="$gitstatus_ldflags -static" + libgit2_cmake_flags="$libgit2_cmake_flags -DENABLE_REPRODUCIBLE_BUILDS=ON" ;; *) >&2 echo "[internal error] unhandled kernel: $gitstatus_kernel" @@ -252,7 +265,6 @@ CFLAGS="$libgit2_cflags" command cmake \ -DUSE_GSSAPI=OFF \ -DUSE_NTLMCLIENT=OFF \ -DBUILD_SHARED_LIBS=OFF \ - -DENABLE_REPRODUCIBLE_BUILDS=OFF \ $libgit2_cmake_flags \ .. command make -j "$cpus" VERBOSE=1 @@ -490,6 +502,8 @@ fi if [ -n "$docker_cmd" ]; then "$docker_cmd" run \ + -e docker_cmd="$docker_cmd" \ + -e docker_image="$docker_image" \ -e gitstatus_kernel="$gitstatus_kernel" \ -e gitstatus_arch="$gitstatus_arch" \ -e gitstatus_cpu="$gitstatus_cpu" \ |