aboutsummaryrefslogtreecommitdiff
path: root/reproduce/src/make/dependencies-build-rules.mk
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-15 13:59:47 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-15 13:59:47 +0000
commit89e580dfd612d216ec7f297a17b77c85a3053f69 (patch)
treeb8cc0f534af9102f12d989bb4d02aab031eb7a31 /reproduce/src/make/dependencies-build-rules.mk
parentbb563a8fbefbc636d34247df735801a23badc750 (diff)
Static linking flag added to LDFLAGS, using special Bash script
Until now, when a package was to be built statically, we were adding the `--static' option to `CFLAGS'. This was the wrong place to put it! It should be in the linking step (thus `LDFLAGS'). Also, based on Bash's configure script, we are now using the more generic form of `-static' (single dash, not double dash). On the other hand, the `--disable-shared' option isn't available in many of the packages and it is highly redundant with the `-static' option, so it has been removed to avoid an extra warning in such packages.
Diffstat (limited to 'reproduce/src/make/dependencies-build-rules.mk')
-rw-r--r--reproduce/src/make/dependencies-build-rules.mk40
1 files changed, 19 insertions, 21 deletions
diff --git a/reproduce/src/make/dependencies-build-rules.mk b/reproduce/src/make/dependencies-build-rules.mk
index b53bc52..a2e4a89 100644
--- a/reproduce/src/make/dependencies-build-rules.mk
+++ b/reproduce/src/make/dependencies-build-rules.mk
@@ -48,16 +48,14 @@
# 4: Extra configuration options.
# 5: Extra options/arguments to pass to Make.
# 6: Step to run between `make' and `make install': usually `make check'.
-gbuild = if [ $(3)x = staticx ]; then \
- configopts="CFLAGS=--static --disable-shared"; \
- fi; \
- check="$(6)"; \
- if [ x"$$check" = x ]; then check="echo Skipping-check"; fi; \
- cd $(ddir) && rm -rf $(2) && tar xf $(tdir)/$(1) && cd $(2) && \
- ./configure $$configopts $(4) --prefix=$(idir) && \
- make $(5) && \
- $$check && \
- make install&& \
+gbuild = if [ $(3)x = staticx ]; then export LDFLAGS="$$LDFLAGS -static"; fi;\
+ check="$(6)"; \
+ if [ x"$$check" = x ]; then check="echo Skipping-check"; fi; \
+ cd $(ddir) && rm -rf $(2) && tar xf $(tdir)/$(1) && cd $(2) && \
+ ./configure $(4) --prefix=$(idir) && \
+ make $(5) && \
+ $$check && \
+ make install&& \
cd ..&& rm -rf $(2)
@@ -66,15 +64,15 @@ gbuild = if [ $(3)x = staticx ]; then \
# CMake
# -----
-cbuild = if [ $(3)x = staticx ]; then \
- export CFLAGS="--static $$CFLAGS"; \
- opts="-DBUILD_SHARED_LIBS=OFF"; \
- fi; \
- cd $(ddir) && rm -rf $(2) && tar xf $(tdir)/$(1) && cd $(2) && \
- rm -rf my-build && mkdir my-build && cd my-build && \
- cmake .. $$opts $(4) && \
- cmake --build . && \
- cmake .. -DCMAKE_INSTALL_PREFIX=$(idir) && \
- cmake --build . --target install && \
- cd ../.. && \
+cbuild = if [ $(3)x = staticx ]; then \
+ export LDFLAGS="$$LDFLAGS -static"; \
+ opts="-DBUILD_SHARED_LIBS=OFF"; \
+ fi; \
+ cd $(ddir) && rm -rf $(2) && tar xf $(tdir)/$(1) && cd $(2) && \
+ rm -rf my-build && mkdir my-build && cd my-build && \
+ cmake .. $$opts $(4) && \
+ cmake --build . && \
+ cmake .. -DCMAKE_INSTALL_PREFIX=$(idir) && \
+ cmake --build . --target install && \
+ cd ../.. && \
rm -rf $(2)