aboutsummaryrefslogtreecommitdiff
path: root/reproduce/src/make
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/src/make')
-rw-r--r--reproduce/src/make/dependencies-basic.mk42
-rw-r--r--reproduce/src/make/dependencies-build-rules.mk22
-rw-r--r--reproduce/src/make/dependencies.mk24
3 files changed, 66 insertions, 22 deletions
diff --git a/reproduce/src/make/dependencies-basic.mk b/reproduce/src/make/dependencies-basic.mk
index 6bd389e..74ca429 100644
--- a/reproduce/src/make/dependencies-basic.mk
+++ b/reproduce/src/make/dependencies-basic.mk
@@ -63,7 +63,7 @@ export LDFLAGS := -L$(ildir) $(LDFLAGS)
export CPPFLAGS := -I$(idir)/include $(CPPFLAGS)
export LD_LIBRARY_PATH := $(ildir):$(LD_LIBRARY_PATH)
-top-level-programs = gcc pkg-config
+top-level-programs = ls sed gawk grep diff find bash which pkg-config
all: $(foreach p, $(top-level-programs), $(ibdir)/$(p))
@@ -168,13 +168,29 @@ $(tarballs): $(tdir)/%:
# For the time being, we aren't building a local C compiler, but we'll use
# any C compiler that the system already has and just make a symbolic link
# to it.
-makelink = a=$$(which $(1) 2> /dev/null); \
+makelink = export PATH=$(syspath); a=$$(which $(1) 2> /dev/null); \
if [ x$$a != x ]; then ln -s $$a $(ibdir)/$(1); fi
$(ibdir):; mkdir $@
$(ibdir)/low-level: | $(ibdir)
- # We aren't building these low-levels tools yet ourselves. We'll
- # thus just use what the host operating system has available.
- PATH=$(syspath)
+ # The Assembler
+ $(call makelink,as)
+
+ # The compiler
+ $(call makelink,clang)
+ $(call makelink,gcc)
+ $(call makelink,g++)
+ $(call makelink,cc)
+
+ # The linker
+ $(call makelink,ar)
+ $(call makelink,ld)
+ $(call makelink,nm)
+ $(call makelink,ps)
+
+ # On Mac OS, libtool is different compared to GNU Libtool. The
+ # libtool we'll build in the high-level dependencies has the
+ # executable name `glibtool'.
+ $(call makelink,libtool)
# GNU Gettext (translate messages)
$(call makelink,msgfmt)
@@ -328,8 +344,8 @@ endif
-# GCC prerequisites
-# -----------------
+# (CURRENTLY IGNORED) GCC prerequisites
+# -------------------------------------
$(ildir): | $(idir); mkdir $@
$(ilidir): | $(ildir); mkdir $@
$(ilidir)/gmp: $(tdir)/gmp-$(gmp-version).tar.lz \
@@ -372,8 +388,16 @@ $(ibdir)/ld: $(tdir)/binutils-$(binutils-version).tar.lz \
-# Build GCC
-# ---------
+# (CURRENTLY IGNORED) Build GCC
+# -----------------------------
+#
+# The building is currently ignored because GNU Binutils currently doesn't
+# install critical components of building a compiler on Mac systems. So we
+# can install and use the GNU C compiler, but we're still going to have the
+# crazy issues with linking on a Mac OS. Since almost no natural science
+# paper's processing depends so strongly on the compiler used, for now,
+# we'll just use the host operating system's C library, compiler, and
+# linker.
#
# We want to build GCC after building all the basic tools that are often
# used in a configure script to enable GCC's configure script to work as
diff --git a/reproduce/src/make/dependencies-build-rules.mk b/reproduce/src/make/dependencies-build-rules.mk
index eafa29c..b7d6c1a 100644
--- a/reproduce/src/make/dependencies-build-rules.mk
+++ b/reproduce/src/make/dependencies-build-rules.mk
@@ -48,17 +48,33 @@
# 4: Extra configuration options.
# 5: Extra options/arguments to pass to Make.
# 6: Step to run between `make' and `make install': usually `make check'.
+#
+# NOTE: Unfortunately the configure script of `zlib' doesn't recognize
+# `SHELL'. So we'll have to remove it from the call to the configure
+# script.
gbuild = if [ x$(static_build) = xyes ] && [ $(3)x = staticx ]; then \
export LDFLAGS="$$LDFLAGS -static"; \
fi; \
check="$(6)"; \
if [ x"$$check" = x ]; then check="echo Skipping-check"; fi; \
- if [ -f $(ibdir)/bash ]; then shellop="SHELL=$(ibdir)/bash"; \
+ cd $(ddir); rm -rf $(2); tar xf $(1); cd $(2); \
+ \
+ if [ -f $(ibdir)/bash ]; then \
+ sed configure -e's|\#\! /bin/sh|\#\! $(ibdir)/bash|' \
+ -e's|\#\!/bin/sh|\#\! $(ibdir)/bash|'> configure-t; \
+ mv configure-t configure; \
+ chmod +x configure; \
+ shellop="SHELL=$(ibdir)/bash"; \
elif [ -f /bin/bash ]; then shellop="SHELL=/bin/bash"; \
else shellop="SHELL=/bin/sh"; \
fi; \
- cd $(ddir) && rm -rf $(2) && tar xf $(1) && cd $(2) && \
- ./configure $(4) "$$shellop" --prefix=$(idir) && \
+ \
+ if [ x"$(2)" = x"zlib-$(zlib-version)" ]; then \
+ configop="--prefix=$(idir)"; \
+ else configop="$$shellop --prefix=$(idir)"; \
+ fi; \
+ \
+ ./configure $(4) $$configop && \
make "$$shellop" $(5) && \
$$check && \
make "$$shellop" install && \
diff --git a/reproduce/src/make/dependencies.mk b/reproduce/src/make/dependencies.mk
index 6acfdf9..dc9e053 100644
--- a/reproduce/src/make/dependencies.mk
+++ b/reproduce/src/make/dependencies.mk
@@ -104,7 +104,7 @@ $(tarballs): $(tdir)/%:
if [ $$n = cfitsio ]; then
mergenames=0
v=$$(echo $(cfitsio-version) | sed -e's/\.//' \
- | awk '{l=length($1); \
+ | awk '{l=length($$1); \
printf (l==4 ? "%d\n" \
: (l==3 ? "%d0\n" \
: (l==2 ? "%d00\n" \
@@ -164,34 +164,35 @@ $(tarballs): $(tdir)/%:
# for us here. So, we'll make an `$(ildir)/built' directory and make a
# simple plain text file in it with the basic library name (an no prefix)
# and create/write into it when the library is successfully built.
+$(ilidir): | $(ildir); mkdir $@
$(ilidir)/cfitsio: $(tdir)/cfitsio-$(cfitsio-version).tar.gz \
- $(ibdir)/curl
+ $(ibdir)/curl | $(ilidir)
$(call gbuild, $<,cfitsio, static, --enable-sse2 --enable-reentrant) \
&& echo "CFITSIO is built" > $@
$(ilidir)/libgit2: $(tdir)/libgit2-$(libgit2-version).tar.gz \
$(ibdir)/cmake \
- $(ibdir)/curl
+ $(ibdir)/curl | $(ilidir)
$(call cbuild, $<, libgit2-$(libgit2-version), static, \
-DUSE_SSH=OFF -DUSE_OPENSSL=OFF -DBUILD_CLAR=OFF \
-DTHREADSAFE=ON) \
&& echo "Libgit2 is built" > $@
-$(ilidir)/gsl: $(tdir)/gsl-$(gsl-version).tar.gz
+$(ilidir)/gsl: $(tdir)/gsl-$(gsl-version).tar.gz | $(ilidir)
$(call gbuild, $<, gsl-$(gsl-version), static) \
&& echo "GNU Scientific Library is built" > $@
-$(ilidir)/libjpeg: $(tdir)/jpegsrc.$(libjpeg-version).tar.gz
+$(ilidir)/libjpeg: $(tdir)/jpegsrc.$(libjpeg-version).tar.gz | $(ilidir)
$(call gbuild, $<, jpeg-9b, static) && echo "Libjpeg is built" > $@
$(ilidir)/libtiff: $(tdir)/tiff-$(libtiff-version).tar.gz \
- $(ilidir)/libjpeg
+ $(ilidir)/libjpeg | $(ilidir)
$(call gbuild, $<, tiff-$(libtiff-version), static) \
&& echo "Libtiff is built" > $@
$(ilidir)/wcslib: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \
- $(ilidir)/cfitsio
+ $(ilidir)/cfitsio | $(ilidir)
# Unfortunately WCSLIB forces the building of shared libraries.
$(call gbuild, $<, wcslib-$(wcslib-version), , \
LIBS="-pthread -lcurl -lm" --without-pgplot \
@@ -200,12 +201,15 @@ $(ilidir)/wcslib: $(tdir)/wcslib-$(wcslib-version).tar.bz2 \
# Zlib: its `./configure' doesn't use Autoconf's configure script, it just
# accepts a direct `--static' option.
-$(ilidir)/zlib: $(tdir)/zlib-$(zlib-version).tar.gz
+$(ilidir)/zlib: $(tdir)/zlib-$(zlib-version).tar.gz | $(ilidir)
+
+ # IMPORTANT, the second argument to `gbuild', must not have any
+ # spaces before or after it: it is going to be checked.
ifeq ($(static_build),yes)
- $(call gbuild, $<, zlib-$(zlib-version), , --static) \
+ $(call gbuild, $<,zlib-$(zlib-version), , --static) \
&& echo "Zlib is built" > $@
else
- $(call gbuild, $<, zlib-$(zlib-version)) && echo "Zlib is built" > $@
+ $(call gbuild, $<,zlib-$(zlib-version)) && echo "Zlib is built" > $@
endif