aboutsummaryrefslogtreecommitdiff
path: root/reproduce/src/make/dependencies-basic.mk
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-16 19:07:03 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2018-11-16 19:10:41 +0000
commit035e44f3bfdd814c4b7d8240011672ed625aed8d (patch)
tree612f3604fee775869462d3bc888ad88ce4a0eba1 /reproduce/src/make/dependencies-basic.mk
parenta0ac5af0b21c79a65d8657f762ff5324bd2419ae (diff)
Configure script checks if static libraries will be built
The default Mac compiler has problems building static libraries. Since we are not yet building the GNU C Compiler as part of the pipeline, we'll have to rely on the host system's compiler. Therefore, a check is now added a the start of the configure script that will build a minimal program with the `-static' flag and if it fails, it will print a warning. Afterwards, none of the dependencies will be built with the `-static' flag.
Diffstat (limited to 'reproduce/src/make/dependencies-basic.mk')
-rw-r--r--reproduce/src/make/dependencies-basic.mk51
1 files changed, 49 insertions, 2 deletions
diff --git a/reproduce/src/make/dependencies-basic.mk b/reproduce/src/make/dependencies-basic.mk
index 4c57e30..45a4192 100644
--- a/reproduce/src/make/dependencies-basic.mk
+++ b/reproduce/src/make/dependencies-basic.mk
@@ -134,8 +134,16 @@ $(tarballs): $(tdir)/%:
# GNU Lzip: For a static build, the `-static' flag should be given to
# LDFLAGS on the command-line (not from the environment).
$(ibdir)/lzip: $(tdir)/lzip-$(lzip-version).tar.gz
+ echo; echo $(static_build); echo;
+ifeq ($(static_build),yes)
$(call gbuild,$(subst $(tdir)/,,$<), lzip-$(lzip-version), , \
- LDFLAGS="-static")
+ LDFLAGS="-static")
+else
+ $(call gbuild,$(subst $(tdir)/,,$<), lzip-$(lzip-version))
+endif
+
+
+
# GNU Gzip.
@@ -144,24 +152,47 @@ $(ibdir)/gzip: $(tdir)/gzip-$(gzip-version).tar.lz \
$(call gbuild,$(subst $(tdir)/,,$<), gzip-$(gzip-version), static)
+
+
+
# Zlib: its `./configure' doesn't use Autoconf's configure script, it just
# accepts a direct `--static' option.
$(ildir)/libz.a: $(tdir)/zlib-$(zlib-version).tar.gz
+ifeq ($(static_build),yes)
$(call gbuild,$(subst $(tdir)/,,$<), zlib-$(zlib-version), , \
--static)
+else
+ $(call gbuild,$(subst $(tdir)/,,$<), zlib-$(zlib-version))
+endif
+
+
+
+
# XZ Utils
$(ibdir)/xz: $(tdir)/xz-$(xz-version).tar.gz
$(call gbuild,$(subst $(tdir)/,,$<), xz-$(xz-version), static)
+
+
+
+
# Bzip2: Bzip2 doesn't have a configure script.
$(ibdir)/bzip2: $(tdir)/bzip2-$(bzip2-version).tar.gz
tdir=bzip2-$(bzip2-version); \
+ if [ $(static_build) = yes ]; then \
+ makecommand="make LDFLAGS=-static"; \
+ else \
+ makecommand="make"; \
+ fi; \
cd $(ddir) && rm -rf $$tdir && tar xf $< && cd $$tdir && \
- make LDFLAGS=-static && make install PREFIX=$(idir) && \
+ $$makecommand && make install PREFIX=$(idir) && \
cd .. && rm -rf $$tdir
+
+
+
# GNU Binutils:
$(ibdir)/nm: $(tdir)/binutils-$(binutils-version).tar.lz \
$(ibdir)/lzip \
@@ -169,6 +200,10 @@ $(ibdir)/nm: $(tdir)/binutils-$(binutils-version).tar.lz \
$(call gbuild,$(subst $(tdir)/,,$<), binutils-$(binutils-version), \
static)
+
+
+
+
# GNU Tar: When built statically, tar gives a segmentation fault on
# unpacking Bash. So we'll build it dynamically.
$(ibdir)/tar: $(tdir)/tar-$(tar-version).tar.gz \
@@ -179,6 +214,10 @@ $(ibdir)/tar: $(tdir)/tar-$(tar-version).tar.gz \
$(ibdir)/nm
$(call gbuild,$(subst $(tdir)/,,$<), tar-$(tar-version))
+
+
+
+
# GNU Make: Unfortunately it needs dynamic linking in two instances: when
# loading objects (dynamically linked libraries), or when using the
# `getpwnam' function (for tilde expansion). The first can be disabled with
@@ -188,8 +227,16 @@ $(ibdir)/make: $(tdir)/make-$(make-version).tar.lz \
$(ibdir)/tar
$(call gbuild,$(subst $(tdir)/,,$<), make-$(make-version))
+
+
+
+
# GNU Bash
$(ibdir)/bash: $(tdir)/bash-$(bash-version).tar.gz \
$(ibdir)/make
+ifeq ($(static_build),yes)
$(call gbuild,$(subst $(tdir)/,,$<), bash-$(bash-version), , \
--enable-static-link)
+else
+ $(call gbuild,$(subst $(tdir)/,,$<), bash-$(bash-version))
+endif