aboutsummaryrefslogtreecommitdiff
path: root/reproduce/software/make/high-level.mk
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2020-06-01 03:05:37 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-06-02 22:36:03 +0100
commit3d8aa5953c4e0b79278ab2e27ec4e1051310d04f (patch)
treeba90256edba224edc5300d24e512b24f964ad757 /reproduce/software/make/high-level.mk
parent213dac320133571bca871275c1bf6446ddee33cb (diff)
Core software build before using Make to build other software
Until now, Maneage would only build Flock before building everything else using Make (calling 'basic.mk') in parallel. Flock was necessary to avoid parallel downloads during the building of software (which could cause network problems). But after recently trying Maneage on FreeBSD (which is not yet complete, see bug #58465), we noticed that the BSD implemenation of Make couldn't parse 'basic.mk' (in particular, complaining with the 'ifeq' parts) and its shell also had some peculiarities. It was thus decided to also install our own minimalist shell, Make and compressor program before calling 'basic.mk'. In this way, 'basic.mk' can now assume the same GNU Make features that high-level.mk and python.mk assume. The pre-make building of software is now organized in 'reproduce/software/shell/pre-make-build.sh'. Another nice feature of this commit is for macOS users: until now the default macOS Make had problems for parallel building of software, so 'basic.mk' was built in one thread. But now that we can build the core tools with GNU Make on macOS too, it uses all threads. Furthermore, since we now run 'basic.mk' with GNU Make, we can use '.ONESHELL' and don't have to finish every line of a long rule with a backslash to keep variables and such. Generally, the pre-make software are now organized like this: first we build Lzip before anything else: it is downloaded as a simple '.tar' file that is not compressed (only ~400kb). Once Lzip is built, the pre-make phase continues with building GNU Make, Dash (a minimalist shell) and Flock. All of their tarballs are in '.tar.lz'. Maneage then enters 'basic.mk' and the first program it builds is GNU Gzip (itself packaged as '.tar.lz'). Once Gzip is built, we build all the other compression software (all downloaded as '.tar.gz'). Afterwards, any compression standard for other software is fine because we have it. In the process, a bug related to using backup servers was found in 'reproduce/analysis/bash/download-multi-try' for calling outside of 'basic.mk' and removed Bash-specific features. As a result of that bug-fix, because we now have multiple servers for software tarballs, the backup servers now have their own configuration file in 'reproduce/software/config/servers-backup.conf'. This makes it much easier to maintain the backup server list across the multiple places that we need it. Some other minor fixes: - In building Bzip2, we need to specify 'CC' so it doesn't use 'gcc'. - In building Zip, the 'generic_gcc' Make option caused a crash on FreeBSD (which doesn't have GCC). - We are now using 'uname -s' to specify if we are on a Linux kernel or not, if not, we are still using the old 'on_mac_os' variable. - While I was trying to build on FreeBSD, I noticed some further corrections that could help. For example the 'makelink' Make-function now takes a third argument which can be a different name compared to the actual program (used for examle to make a link to '/usr/bin/cc' from 'gcc'. - Until now we didn't know if the host's Make implementation supports placing a '@' at the start of the recipe (to avoid printing the actual commands to standard output). Especially in the tarball download phase, there are many lines that are printed for each download which was really annoying. We already used '@' in 'high-level.mk' and 'python.mk' before, but now that we also know that 'basic.mk' is called with our custom GNU Make, we can use it at the start for a cleaner stdout. - Until now, WCSLIB assumed a Fortran compiler, but when the user is on a system where we can't install GCC (or has activated the '--host-cc' option), it may not be present and the project shouldn't break because of this. So with this commit, when a Fortran compiler isn't present, WCSLIB will be built with the '--disable-fortran' configuration option. This commit (task #15667) was completed with help/checks by Raul Infante-Sainz and Boud Roukema.
Diffstat (limited to 'reproduce/software/make/high-level.mk')
-rw-r--r--reproduce/software/make/high-level.mk12
1 files changed, 10 insertions, 2 deletions
diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk
index 19cb52f..7cc2d51 100644
--- a/reproduce/software/make/high-level.mk
+++ b/reproduce/software/make/high-level.mk
@@ -104,7 +104,8 @@ export BASH_ENV := $(shell pwd)/reproduce/software/shell/bashrc.sh
# Servers to use as backup, later this should go in a file that is not
# under version control (the actual server that the tarbal comes from is
# irrelevant).
-backupservers = http://akhlaghi.org/maneage-software
+backupservers := $(shell awk '!/^#/{printf "%s ", $$1}' \
+ reproduce/software/config/servers-backup.conf)
# Building flags:
#
@@ -335,6 +336,7 @@ $(tarballs): $(tdir)/%: | $(lockdir)
# storing all the tarballs in one directory, we want it to have the
# same naming convention, so we'll download it to a temporary name,
# then rename that.
+ rm -f "$@.unchecked"
if [ -f $(DEPENDENCIES-DIR)/$* ]; then
cp $(DEPENDENCIES-DIR)/$* "$@.unchecked"
else
@@ -812,11 +814,17 @@ $(ibidir)/libgit2: $(ibidir)/curl \
$(ibidir)/wcslib: $(ibidir)/cfitsio \
$(tdir)/wcslib-$(wcslib-version).tar.bz2
+ # If Fortran isn't present, don't build WCSLIB with it.
+ if type gfortran &> /dev/null; then fortranopt="";
+ else fortranopt="--disable-fortran"
+ fi
+
+ # Build WCSLIB.
$(call gbuild, wcslib-$(wcslib-version), , \
LIBS="-pthread -lcurl -lm" \
--with-cfitsiolib=$(ildir) \
--with-cfitsioinc=$(idir)/include \
- --without-pgplot) \
+ --without-pgplot $$fortranopt) \
&& if [ x$(on_mac_os) = xyes ]; then \
install_name_tool -id $(ildir)/libwcs.6.4.dylib \
$(ildir)/libwcs.6.4.dylib; \