aboutsummaryrefslogtreecommitdiff
path: root/reproduce/software/make/basic.mk
diff options
context:
space:
mode:
Diffstat (limited to 'reproduce/software/make/basic.mk')
-rw-r--r--reproduce/software/make/basic.mk599
1 files changed, 413 insertions, 186 deletions
diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk
index d90d945..b045bb1 100644
--- a/reproduce/software/make/basic.mk
+++ b/reproduce/software/make/basic.mk
@@ -21,9 +21,9 @@
#
# ------------------------------------------------------------------------
#
-# Copyright (C) 2018-2022 Mohammad Akhlaghi <mohammad@akhlaghi.org>
-# Copyright (C) 2019-2022 Raul Infante-Sainz <infantesainz@gmail.com>
-# Copyright (C) 2022 Pedram Ashofteh Ardakani <pedramardakani@pm.me>
+# Copyright (C) 2018-2026 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2019-2026 Raul Infante-Sainz <infantesainz@gmail.com>
+# Copyright (C) 2022-2026 Pedram Ashofteh Ardakani <pedramardakani@pm.me>
#
# This Makefile is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@
# along with this Makefile. If not, see <http://www.gnu.org/licenses/>.
# Top level environment
-include reproduce/software/config/LOCAL.conf
+include .build/software/config/LOCAL.conf
include reproduce/software/make/build-rules.mk
include reproduce/software/config/versions.conf
include reproduce/software/config/checksums.conf
@@ -49,22 +49,27 @@ include reproduce/software/config/checksums.conf
include reproduce/software/config/urls.conf
# Basic directories
-lockdir = $(BDIR)/software/locks
-tdir = $(BDIR)/software/tarballs
-ddir = $(BDIR)/software/build-tmp
-idir = $(BDIR)/software/installed
-ibdir = $(BDIR)/software/installed/bin
-ildir = $(BDIR)/software/installed/lib
-ibidir = $(BDIR)/software/installed/version-info/proglib
+lockdir = $(BDIR)/software/locks
+tdir = $(BDIR)/software/tarballs
+ddir = $(BDIR)/software/build-tmp
+idir = $(BDIR)/software/installed
+ibdir = $(BDIR)/software/installed/bin
+ildir = $(BDIR)/software/installed/lib
+iidir = $(BDIR)/software/installed/include
+shsrcdir = "$(shell pwd)"/reproduce/software/shell
+ibidir = $(BDIR)/software/installed/version-info/proglib
# Ultimate Makefile target. GNU Nano (a simple and very light-weight text
# editor) is installed by default, it is recommended to have it in the
# 'basic.mk', so Maneaged projects can be edited on any system (even when
# there is no command-line text editor available).
+#
+# The recipe is '@echo > /dev/null' so Make does not print "make: Nothing
+# to be done for 'all'."
targets-proglib = low-level-links \
gcc-$(gcc-version) \
nano-$(nano-version)
-all: $(foreach p, $(targets-proglib), $(ibidir)/$(p))
+all: $(foreach p, $(targets-proglib), $(ibidir)/$(p)); @echo > /dev/null
# Define the shell environment
# ----------------------------
@@ -82,27 +87,44 @@ all: $(foreach p, $(targets-proglib), $(ibidir)/$(p))
# own build-directory comes first.
.ONESHELL:
.SHELLFLAGS := -e -c
+export LC_ALL := C
export CCACHE_DISABLE := 1
export SHELL := $(ibdir)/dash
export PATH := $(ibdir):$(PATH)
export PKG_CONFIG_PATH := $(ildir)/pkgconfig
export PKG_CONFIG_LIBDIR := $(ildir)/pkgconfig
-export CPPFLAGS := -I$(idir)/include $(CPPFLAGS) \
- -Wno-nullability-completeness
export LDFLAGS := $(rpath_command) -L$(ildir) $(LDFLAGS)
# Disable built-in rules (which are not needed here!)
.SUFFIXES:
+# See description of '-Wno-nullability-completeness' in
+# 'reproduce/software/shell/configure.sh'.
+ifeq ($(on_mac_os),yes)
+ noccwarnings=-Wno-nullability-completeness
+endif
+export CPPFLAGS := -I$(idir)/include $(CPPFLAGS) $(noccwarnings)
+
# This is the "basic" tools where we are relying on the host operating
-# system, but are slowly populating our basic software envirnoment. To run
-# (system or template) programs, 'LD_LIBRARY_PATH' is necessary, so here,
-# we'll first tell the programs to look into any possible pre-defined
-# 'LD_LIBRARY_PATH', then we'll add our own newly installed libraries. We
-# will also make sure that there is no "current directory" in it (by
-# removing a starting or trailing ':' and any occurance of '::'.
-export LD_LIBRARY_PATH := $(shell echo $(LD_LIBRARY_PATH):$(ildir) \
+# system, but are slowly populating our basic software envirnoment. So
+# here, we are also appending the host's 'LD_LIBRARY_PATH' to Maneage's
+# installed library path. It is just important to keep Maneage's library
+# directories first so when something has been built, the newly built
+# software use (link-with) Maneage's libraries, not the host's. We will
+# also make sure that there is no "current directory" in it (by removing a
+# starting or trailing ':' and any occurance of '::').
+#
+# But first: in case LD_LIBRARY_PATH is empty, give it the default value of
+# $(sys_library_sh_path) (which was the location of the libraries needed by
+# the host's shell). This is because after we add the Maneage's library
+# path, on some systems, no other libraries will be checked except those
+# that are in 'LD_LIBRARY_PATH'.
+ifeq ($(strip $(LD_LIBRARY_PATH)),)
+export LD_LIBRARY_PATH=$(sys_library_sh_path)
+endif
+export LD_LIBRARY_PATH := $(shell echo $(ildir):$(LD_LIBRARY_PATH) \
| sed -e's/::/:/g' -e's/^://' -e's/:$$//')
+ldpathorig := $(subst $(ildir):,,$(LD_LIBRARY_PATH))
# RPATH is automatically written in macOS, so 'DYLD_LIBRARY_PATH' is
# ultimately redundant. But on some systems, even having a single value
@@ -121,17 +143,24 @@ export DYLD_LIBRARY_PATH :=
# Afer putting everything together, we use the first server as the
# reference for all software if their '-url' variable isn't defined (in
# 'reproduce/software/config/urls.conf').
-downloadwrapper = ./reproduce/analysis/bash/download-multi-try
+downloadwrapper = ./reproduce/analysis/bash/download-multi-try.sh
maneage_backup_urls := $(shell awk '!/^#/{printf "%s ", $$1}' \
reproduce/software/config/servers-backup.conf)
backupservers_all = $(user_backup_urls) $(maneage_backup_urls)
topbackupserver = $(word 1, $(backupservers_all))
backupservers = $(filter-out $(topbackupserver),$(backupservers_all))
-
-
-
-
+# When building in Apptainer containers, as of 2025-04-18, we need to
+# configure Maneage as root (within the container). In such cases, we need
+# to activate the 'FORCE_UNSAFE_CONFIGURE' environment variable to build
+# some of the software. The 'if' statement is here to make sure we are in
+# Apptainer: in other situations, the "unsafe" configure script shouldn't
+# be activated. Note that this doesn't happen in Docker (where the Maneage
+# source is in the same directory) because we build a non-root ('maneager'
+# user there who executes the configure command.
+unsafe-config = if [ $$(pwd) = "/home/maneager/source" ] \
+ && [ $$(whoami) = root ]; then \
+ export FORCE_UNSAFE_CONFIGURE=1; fi
@@ -202,6 +231,7 @@ $(ibidir)/low-level-links: $(ibidir)/grep-$(grep-version) \
$(call makelink,xcrun)
$(call makelink,sysctl)
$(call makelink,sw_vers)
+ $(call makelink,codesign)
$(call makelink,dsymutil)
$(call makelink,install_name_tool)
@@ -222,6 +252,27 @@ $(ibidir)/low-level-links: $(ibidir)/grep-$(grep-version) \
fi
done
+# Useful tools: 'ldd' (list libraries linked by binary on GNU
+# systems)
+ $(call makelink,ldd)
+
+# zic: On some systems like Debian GNU/Linux, 'zic' may be in
+# '/usr/sbin' and is available to users. But it is not normally in
+# the 'PATH' of a non-root user. This is because the executables
+# there are normally system-level commands, and most are executable
+# only by the root user.
+ $(call makelink,zic)
+ if [ "x$$(command -v zic)" = x ]; then
+ zicfullpath=$$(PATH=$${PATH}:/usr/sbin command -v zic)
+ if [ "x$${zicfullpath}" = x ]; then
+ printf "Warning: 'zic' not found. You may need it for"
+ printf " higher-level packages such as 'tzdb'. Install"
+ printf " 'zic' if needed.\n"
+ else
+ ln -sf $$(realpath $${zicfullpath}) $(ibdir)/zic
+ fi
+ fi
+
# We want this to be empty (so it doesn't interefere with the other
# files in 'ibidir'.
touch $@
@@ -240,11 +291,8 @@ $(ibidir)/low-level-links: $(ibidir)/grep-$(grep-version) \
#
# The first set of programs to be built are those that we need to unpack
# the source code tarballs of each program. We have already installed Lzip
-# before calling 'basic.mk', so it is present and working. Hence we first
-# build the Lzipped tarball of Gzip, then use our own Gzip to unpack the
-# tarballs of the other compression programs. Once all the compression
-# programs/libraries are complete, we build our own GNU Tar and continue
-# with other software.
+# before calling 'basic.mk', so it is present and working. So the only
+# prerequisites of these (until reaching Tar) is the necessary directories.
$(lockdir): | $(BDIR); mkdir $@
$(ibidir)/gzip-$(gzip-version): | $(ibdir) $(ildir) $(lockdir)
tarball=gzip-$(gzip-version).tar.lz
@@ -252,13 +300,13 @@ $(ibidir)/gzip-$(gzip-version): | $(ibdir) $(ildir) $(lockdir)
$(call gbuild, gzip-$(gzip-version), static, , V=1)
echo "GNU Gzip $(gzip-version)" > $@
-$(ibidir)/xz-$(xz-version): $(ibidir)/gzip-$(gzip-version)
+$(ibidir)/xz-$(xz-version): | $(ibdir) $(ildir) $(lockdir)
tarball=xz-$(xz-version).tar.lz
$(call import-source, $(xz-url), $(xz-checksum))
$(call gbuild, xz-$(xz-version), static)
echo "XZ Utils $(xz-version)" > $@
-$(ibidir)/bzip2-$(bzip2-version): $(ibidir)/gzip-$(gzip-version)
+$(ibidir)/bzip2-$(bzip2-version): | $(ibdir) $(ildir) $(lockdir)
# Download the tarball.
tarball=bzip2-$(bzip2-version).tar.lz
@@ -287,8 +335,9 @@ $(ibidir)/bzip2-$(bzip2-version): $(ibidir)/gzip-$(gzip-version)
fi
cd $(ddir)
rm -rf $$tdir
- tar -xf $(tdir)/$$tarball
+ tar -xf $(tdir)/$$tarball --no-same-owner --no-same-permissions
cd $$tdir
+ $(shsrcdir)/prep-source.sh $(ibdir)
sed -e 's@\(ln -s -f \)$$(PREFIX)/bin/@\1@' Makefile \
> Makefile.sed
mv Makefile.sed Makefile
@@ -303,57 +352,37 @@ $(ibidir)/bzip2-$(bzip2-version): $(ibidir)/gzip-$(gzip-version)
ln -fs libbz2.so.$(bzip2-version) libbz2.so
echo "Bzip2 $(bzip2-version)" > $@
-$(ibidir)/unzip-$(unzip-version): $(ibidir)/gzip-$(gzip-version)
- tarball=unzip-$(unzip-version).tar.lz
- $(call import-source, $(unzip-url), $(unzip-checksum))
- $(call gbuild, unzip-$(unzip-version), static,, \
- -f unix/Makefile generic \
- CFLAGS="-DBIG_MEM -DMMAP",,pwd, \
- -f unix/Makefile generic \
- BINDIR=$(ibdir) MANDIR=$(idir)/man/man1 )
- echo "Unzip $(unzip-version)" > $@
-
-$(ibidir)/zip-$(zip-version): $(ibidir)/gzip-$(gzip-version)
- tarball=zip-$(zip-version).tar.lz
- $(call import-source, $(zip-url), $(zip-checksum))
- $(call gbuild, zip-$(zip-version), static,, \
- -f unix/Makefile generic \
- CFLAGS="-DBIG_MEM -DMMAP",,pwd, \
- -f unix/Makefile generic \
- BINDIR=$(ibdir) MANDIR=$(idir)/man/man1 )
- echo "Zip $(zip-version)" > $@
-
# Some programs (like Wget and CMake) that use zlib need it to be dynamic
# so they use our custom build. So we won't force a static-only build.
#
# Note for a static-only build: Zlib's './configure' doesn't use Autoconf's
# configure script, it just accepts a direct '--static' option.
-$(ibidir)/zlib-$(zlib-version): $(ibidir)/gzip-$(gzip-version)
+$(ibidir)/zlib-$(zlib-version): | $(ibdir) $(ildir) $(lockdir)
tarball=zlib-$(zlib-version).tar.lz
$(call import-source, $(zlib-url), $(zlib-checksum))
$(call gbuild, zlib-$(zlib-version))
echo "Zlib $(zlib-version)" > $@
# GNU Tar: When built statically, tar gives a segmentation fault on
-# unpacking Bash. So we'll build it dynamically. Note that technically, zip
-# and unzip aren't dependencies of Tar, but for a clean build, we'll set
-# Tar to be the last compression-related software (the first-set of
-# software to be built).
+# unpacking Bash. So we'll build it dynamically.
$(ibidir)/tar-$(tar-version): \
$(ibidir)/xz-$(xz-version) \
- $(ibidir)/zip-$(zip-version) \
$(ibidir)/gzip-$(gzip-version) \
$(ibidir)/zlib-$(zlib-version) \
- $(ibidir)/bzip2-$(bzip2-version) \
- $(ibidir)/unzip-$(unzip-version)
+ $(ibidir)/bzip2-$(bzip2-version)
-# Since all later programs depend on Tar, the configuration will hit
-# a bottleneck here: only making Tar. So its more efficient to built
-# it on multiple threads (even when the user's Make doesn't pass down
-# the number of threads).
+# About the configurations: disabled because they are not relevant in
+# the context of Maneage usage.
+# - nls: conflicts with iconv on macOS.
+# - acl: causing crashes when Tar was compiled with GCC 16.1.1.
+ $(call unsafe-config)
tarball=tar-$(tar-version).tar.lz
$(call import-source, $(tar-url), $(tar-checksum))
- $(call gbuild, tar-$(tar-version), , , -j$(numthreads) V=1)
+ $(call gbuild, tar-$(tar-version), , \
+ --disable-nls \
+ --disable-acl \
+ am_cv_func_iconv=no, \
+ -j$(numthreads) V=1)
echo "GNU Tar $(tar-version)" > $@
@@ -370,8 +399,8 @@ $(ibidir)/tar-$(tar-version): \
# Patchelf is necessary for some software on GNU/Linux systems, its job is
# to manually insert RPATH into the dynamically-linked executable. Since
# all the other software depend on Pathelf, to avoid manually repeating as
-# a prerequisite (and forgetting in others causing bugs), we'll put it as a
-# dependancy of 'tar'.
+# a prerequisite (and forgetting in others causing bugs), it is installed
+# in this phase (right after 'tar').
$(ibidir)/patchelf-$(patchelf-version): $(ibidir)/tar-$(tar-version)
tarball=patchelf-$(patchelf-version).tar.lz
$(call import-source, $(patchelf-url), $(patchelf-checksum))
@@ -382,6 +411,84 @@ $(ibidir)/patchelf-$(patchelf-version): $(ibidir)/tar-$(tar-version)
echo "PatchELF $(patchelf-version)" > $@
fi
+$(ibidir)/pkg-config-$(pkgconfig-version): $(ibidir)/tar-$(tar-version)
+
+# Download the tarball.
+ tarball=pkg-config-$(pkgconfig-version).tar.lz
+ $(call import-source, $(pkgconfig-url), $(pkgconfig-checksum))
+
+# An existing 'libiconv' can cause a conflict with 'pkg-config' (this
+# is why 'libiconv' depends on 'pkg-config'). On a clean build,
+# 'pkg-config' is built first. But when we don't have a clean build
+# (and 'libiconv' exists) there will be a problem. So before
+# re-building 'pkg-config', we'll remove any installation of
+# 'libiconv'. This can create a known bug:
+# https://savannah.nongnu.org/bugs/?67001
+ rm -f $(ildir)/libiconv* $(idir)/include/iconv.h
+
+# On GNU/Linux no changes necessary, so we'll start with those. If
+# the runner is on a macOS, some changes are necessary.
+ export compiler=""
+ confsh=./configure
+ if [ x$(on_mac_os) = xyes ]; then
+
+# On macOS we force Clang, because some GCC versions shipped with
+# Xcode lack features needed to build Glib.
+ export compiler="CC=clang"
+
+# The bundled glib's gatomic.c uses integer-to-pointer conversions
+# that newer Clang (Xcode 26+) treats as hard errors on all macOS
+# architectures.
+ CFLAGS="-Wno-int-conversion $$CFLAGS"
+
+# On macOS ARM64 the bundled glib sub-configure checks for Carbon
+# support with the C preprocessor only. Since 'Carbon/Carbon.h'
+# exists in the Xcode SDK on Apple Silicon, the check passes and
+# '-framework Carbon' is appended to LDFLAGS. But Carbon cannot
+# actually be linked on ARM64, so every subsequent linker test in
+# glib's configure fails silently and libglib-2.0.la is never
+# created. We work around this by passing gbuild a tiny wrapper
+# script (instead of ./configure) that patches glib/configure to
+# force glib_have_carbon=no before the real configure runs.
+#
+# NOTE: the initial two SPACES in the SED command are very
+# important (see 'glib/configure'): without them, the wrong
+# variable will be set.
+ confsh=$(ddir)/pkg-config-configure
+ printf '#!/bin/sh\n' > $$confsh
+ printf 'sed -i.bak "s/^ glib_have_carbon=yes$$/' >> $$confsh
+ printf ' glib_have_carbon=no/"' >> $$confsh
+ printf ' glib/configure\n' >> $$confsh
+ printf 'exec ./configure "$$@"\n' >> $$confsh
+ chmod +x $$confsh
+
+# For its 'glib' installation within macOS, pkg-config needs a
+# working Python for its build (not affecting its final code), but
+# only searches for '/usr/bin/python'. However, some users may have
+# Python available in another location, so we'll set it externally
+# here to be safe. Note that 'which' is not present on some
+# systems, 'command -v' is more portable).
+ if type python > /dev/null 2> /dev/null; then
+ pypath=$$(command -v python)
+ elif type python3 > /dev/null 2> /dev/null; then
+ pypath=$$(command -v python3)
+ else
+ printf "pkg-config: ERROR: a local Python is necessary"; exit 1
+ fi
+ export PYTHON=$$pypath
+ fi
+
+# Configuration options:
+# --with-internal-glib: the internal glib is necessary because
+# without it, we have many problems in macOS.
+ export CFLAGS="-std=$(std_c_old) $$CFLAGS"
+ $(call gbuild, pkg-config-$(pkgconfig-version), static, \
+ $$compiler \
+ --with-internal-glib \
+ --with-pc-path=$(ildir)/pkgconfig, V=1, , $$confsh)
+ if [ -f $$confsh ]; then rm $$confsh; fi # Only on macOS.
+ echo "pkg-config $(pkgconfig-version)" > $@
+
@@ -402,7 +509,10 @@ $(ibidir)/patchelf-$(patchelf-version): $(ibidir)/tar-$(tar-version)
# function (for tilde expansion). The first can be disabled with
# '--disable-load', but unfortunately I don't know any way to fix the
# second. So, we'll have to build it dynamically for now.
-$(ibidir)/ncurses-$(ncurses-version): $(ibidir)/patchelf-$(patchelf-version)
+$(ibidir)/ncurses-$(ncurses-version): $(ibidir)/patchelf-$(patchelf-version) \
+ $(ibidir)/pkg-config-$(pkgconfig-version)
+
+# Prepare the input.
tarball=ncurses-$(ncurses-version).tar.lz
$(call import-source, $(ncurses-url), $(ncurses-checksum))
@@ -418,11 +528,18 @@ $(ibidir)/ncurses-$(ncurses-version): $(ibidir)/patchelf-$(patchelf-version)
rm -f $(ibdir)/bash* $(ibdir)/awk* $(ibdir)/gawk*
# Standard build process.
+ export CFLAGS="-std=$(std_c_old) $$CFLAGS"
$(call gbuild, ncurses-$(ncurses-version), static, \
- --with-shared --enable-rpath --without-normal \
- --without-debug --with-cxx-binding \
- --with-cxx-shared --enable-widec --enable-pc-files \
- --with-pkg-config=$(ildir)/pkgconfig, -j$(numthreads))
+ --with-shared \
+ --enable-rpath \
+ --enable-widec \
+ --without-debug \
+ --without-normal \
+ --enable-pc-files \
+ --with-cxx-shared \
+ --with-cxx-binding \
+ --with-pkg-config=$(ildir)/pkgconfig, \
+ -j$(numthreads))
# Unfortunately there are many problems with 'ncurses' using "normal"
# (or 8-bit) characters. The standard way that will work is to build
@@ -461,6 +578,9 @@ $(ibidir)/ncurses-$(ncurses-version): $(ibidir)/patchelf-$(patchelf-version)
#
# 5. A link is made to also be able to include files from the
# 'ncurses' headers.
+#
+# 6. Top-level symbolic links are made for the 'include' (.h) files.
+#
if [ x$(on_mac_os) = xyes ]; then so="dylib"; else so="so"; fi
if [ -f $(ildir)/libncursesw.$$so ]; then
@@ -485,6 +605,11 @@ $(ibidir)/ncurses-$(ncurses-version): $(ibidir)/patchelf-$(patchelf-version)
ln -fs $(ildir)/pkgconfig/ncursesw.pc pkgconfig/cursesw.pc
ln -fs $(idir)/include/ncursesw $(idir)/include/ncurses
+
+# Add symbolic links for the ncursesw/*.h 'include' files
+# so that they can be found in the top-level include/ directory.
+ cd "$(iidir)"
+ ln -fsv $(idir)/include/ncursesw/*.h .
echo "GNU NCURSES $(ncurses-version)" > $@
else
exit 1
@@ -523,6 +648,7 @@ $(ibidir)/readline-$(readline-version): \
# pname=bash50-$(printf "%03d" $i); \
# wget http://ftp.gnu.org/gnu/bash/bash-5.0-patches/$pname -O ../$pname;\
# patch -p0 -i ../$pname; \
+# rm ../$pname; \
# done
# $ cd ..
# $ mv bash-5.0 bash-5.0.$number
@@ -551,7 +677,7 @@ $(ibidir)/bash-$(bash-version): \
export CFLAGS="$$CFLAGS \
-DDEFAULT_PATH_VALUE='\"$(ibdir)\"' \
-DSTANDARD_UTILS_PATH='\"$(ibdir)\"' \
- -DSYS_BASHRC='\"$(BASH_ENV)\"' "
+ -DSYS_BASHRC='\"$(BASH_ENV)\"'"
$(call gbuild, bash-$(bash-version),, $$stopt \
--with-installed-readline=$(ildir) \
--with-curses=yes, \
@@ -568,9 +694,6 @@ $(ibidir)/bash-$(bash-version): \
# shell. By convention, 'sh' is just a symbolic link to the preferred
# shell executable. So we'll define '$(ibdir)/sh' as a symbolic link
# to the Bash that we just built and installed.
-#
-# Just to be sure that the installation step above went well, before
-# making the link, we'll see if the file actually exists there.
ln -fs $(ibdir)/bash $(ibdir)/sh
echo "GNU Bash $(bash-version)" > $@
@@ -596,44 +719,58 @@ perl-conflddlflags =
else
perl-conflddlflags = -Dlddlflags="-shared $$LDFLAGS"
endif
-$(ibidir)/perl-$(perl-version): $(ibidir)/patchelf-$(patchelf-version)
+$(ibidir)/perl-$(perl-version): $(ibidir)/tar-$(tar-version)
+
+# Import tarball.
tarball=perl-$(perl-version).tar.lz
$(call import-source, $(perl-url), $(perl-checksum))
+
+# Extract the version strings.
major_version=$$(echo $(perl-version) \
| sed -e's/\./ /g' \
| awk '{printf("%d", $$1)}')
base_version=$$(echo $(perl-version) \
| sed -e's/\./ /g' \
| awk '{printf("%d.%d", $$1, $$2)}')
+
+# Unpack, build and install.
cd $(ddir)
rm -rf perl-$(perl-version)
- tar -xf $(tdir)/$$tarball
+ tar -xf $(tdir)/$$tarball --no-same-owner --no-same-permissions
cd perl-$(perl-version)
+ $(shsrcdir)/prep-source.sh $(ibdir)
./Configure -des \
-Dusethreads \
-Duseshrplib \
-Dprefix=$(idir) \
-Dvendorprefix=$(idir) \
- -Dprivlib=$(idir)/share/perl$$major_version/core_perl \
- -Darchlib=$(idir)/lib/perl$$major_version/$$base_version/core_perl \
- -Dsitelib=$(idir)/share/perl$$major_version/site_perl \
- -Dsitearch=$(idir)/lib/perl$$major_version/$$base_version/site_perl \
- -Dvendorlib=$(idir)/share/perl$$major_version/vendor_perl \
- -Dvendorarch=$(idir)/lib/perl$$major_version/$$base_version/vendor_perl \
- -Dscriptdir=$(idir)/bin/core_perl \
- -Dsitescript=$(idir)/bin/site_perl \
- -Dvendorscript=$(idir)/bin/vendor_perl \
+ -Dprivlib=$(idir)/share/perl$$major_version/perl-core \
+ -Darchlib=$(idir)/lib/perl$$major_version/$$base_version/perl-core \
+ -Dsitelib=$(idir)/share/perl$$major_version/perl-site \
+ -Dsitearch=$(idir)/lib/perl$$major_version/$$base_version/perl-site \
+ -Dvendorlib=$(idir)/share/perl$$major_version/perl-vendor \
+ -Dvendorarch=$(idir)/lib/perl$$major_version/$$base_version/perl-vendor \
+ -Dscriptdir=$(idir)/bin/perl-core \
+ -Dsitescript=$(idir)/bin/perl-site \
+ -Dvendorscript=$(idir)/bin/perl-vendor \
-Dinc_version_list=none \
-Dman1ext=1perl \
-Dman3ext=3perl \
-Dcccdlflags='-fPIC' \
$(perl-conflddlflags) \
-Dldflags="$$LDFLAGS"
- make -j$(numthreads)
+ make -j$(numthreads) V=1
make install
cd ..
rm -rf perl-$(perl-version)
- cd $$topdir
+
+# Symbolic links to necessary Perl programs (that Perl installs in
+# the 'perl-core' directory.
+ ln -sf $(ibdir)/perl-core/xsubpp $(ibdir)/xsubpp
+ ln -sf $(ibdir)/perl-core/pod2man $(ibdir)/pod2man
+ ln -sf $(ibdir)/perl-core/pod2text $(ibdir)/pod2text
+
+# Final target.
echo "Perl $(perl-version)" > $@
@@ -667,20 +804,16 @@ $(ibidir)/coreutils-$(coreutils-version): \
$(ibidir)/openssl-$(openssl-version)
# Import, unpack and enter the source directory.
+ $(call unsafe-config)
tarball=coreutils-$(coreutils-version).tar.lz
$(call import-source, $(coreutils-url), $(coreutils-checksum))
+
+# Unpack and enter the source.
cd $(ddir)
rm -rf coreutils-$(coreutils-version)
- tar -xf $(tdir)/$$tarball
+ tar -xf $(tdir)/$$tarball --no-same-owner --no-same-permissions
cd coreutils-$(coreutils-version)
-
-# Set the configure script to use our shell, note that we can't
-# assume GNU SED here yet (it installs after Coreutils).
- sed -e's|\#\! /bin/sh|\#\! $(ibdir)/bash|' \
- -e's|\#\!/bin/sh|\#\! $(ibdir)/bash|' \
- configure > configure-tmp
- mv configure-tmp configure
- chmod +x configure
+ $(shsrcdir)/prep-source.sh $(ibdir)
# Configure, build and install Coreutils.
./configure --prefix=$(idir) SHELL=$(ibdir)/bash \
@@ -692,7 +825,7 @@ $(ibidir)/coreutils-$(coreutils-version): \
# Fix RPATH if necessary.
if [ -f $(ibdir)/patchelf ]; then
make SHELL=$(ibdir)/bash install DESTDIR=junkinst
- unalias ls || true # avoid decorated 'ls' commands with extra characters
+ unalias ls || true # Not decorated 'ls' (with extra characters).
instprogs=$$(ls junkinst/$(ibdir))
for f in $$instprogs; do
$(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/$$f
@@ -706,28 +839,6 @@ $(ibidir)/coreutils-$(coreutils-version): \
rm -rf coreutils-$(coreutils-version)
echo "GNU Coreutils $(coreutils-version)" > $@
-# Podlators
-#
-# POD is short for "Plain Old Documentation", that is the format used in
-# Perl's documentation. Podlators provies two executables pod2man and
-# pod2text convert this into the roff format (used in man pages) or pod2 It
-# is used by some software like OpenSSL to create their man pages.
-$(ibidir)/podlators-$(podlators-version): $(ibidir)/perl-$(perl-version)
- tarball=podlators-$(podlators-version).tar.lz
- $(call import-source, $(podlators-url), $(podlators-checksum))
- cd $(ddir)
- rm -rf podlators-$(podlators-version)
- tar -xf $(tdir)/$$tarball
- cd podlators-$(podlators-version)
- perl Makefile.PL
- make
- make install
- ln -sf $(ibdir)/site_perl/pod2man $(ibdir)/pod2man
- ln -sf $(ibdir)/site_perl/pod2text $(ibdir)/pod2text
- cd ..
- rm -rf podlators-$(podlators-version)
- echo "podlators $(podlators-version)" > $@
-
# OpenSSL
#
# Until we find a nice and generic way to create an updated CA file in the
@@ -735,13 +846,14 @@ $(ibidir)/podlators-$(podlators-version): $(ibidir)/perl-$(perl-version)
# along with the other tarballs.
$(idir)/etc:; mkdir $@
$(idir)/etc/ssl: | $(idir)/etc; mkdir $@
-$(ibidir)/openssl-$(openssl-version): $(ibidir)/podlators-$(podlators-version) \
- | $(idir)/etc/ssl
+$(ibidir)/openssl-$(openssl-version): $(ibidir)/perl-$(perl-version) \
+ $(ibidir)/patchelf-$(patchelf-version) \
+ | $(idir)/etc/ssl
# First download the certificates and copy them into the
# installation directory.
tarball=cert.pem-$(certpem-version)
- $(call import-source, $(cert-url), $(cert-checksum))
+ $(call import-source, $(certpem-url), $(certpem-checksum))
cp $(tdir)/cert.pem-$(certpem-version) $(idir)/etc/ssl/cert.pem
# Now download the OpenSSL tarball.
@@ -807,6 +919,8 @@ $(ibidir)/curl-$(curl-version): $(ibidir)/coreutils-$(coreutils-version)
--without-librtmp \
--without-libidn2 \
--without-wolfssl \
+ --without-nghttp2 \
+ --without-nghttp3 \
--without-brotli \
--without-gnutls \
--without-cyassl \
@@ -814,6 +928,7 @@ $(ibidir)/curl-$(curl-version): $(ibidir)/coreutils-$(coreutils-version)
--without-axtls \
--disable-ldaps \
--disable-ldap \
+ --without-zstd \
--without-nss, V=1)
if [ -f $(ibdir)/patchelf ]; then
@@ -843,6 +958,23 @@ $(ibidir)/wget-$(wget-version): \
tarball=wget-$(wget-version).tar.lz
$(call import-source, $(wget-url), $(wget-checksum))
+# Wget needs a working Python for its tests (VERY BAD DESIGN!), this
+# does not affect its final operation. But only searches for
+# '/usr/bin/python'. However, some users may have Python available in
+# another location, so we'll set it externally here to be safe. Note
+# that 'which' is not present on some systems, 'command -v' is more
+# portable).
+ if [ x$(on_mac_os) = xyes ]; then
+ if type python > /dev/null 2> /dev/null; then
+ pypath=$$(command -v python)
+ elif type python3 > /dev/null 2> /dev/null; then
+ pypath=$$(command -v python3)
+ else
+ printf "Wget: ERROR: a local Python is necessary"; exit 1
+ fi
+ export PYTHON=$$pypath
+ fi
+
# We need to explicitly disable 'libiconv', because of the
# 'pkg-config' and 'libiconv' problem.
libs="-pthread"
@@ -875,6 +1007,12 @@ $(ibidir)/wget-$(wget-version): \
# process of the higher-level programs and libraries. Note that during the
# building of those higher-level programs (after this Makefile finishes),
# there is no access to the system's PATH.
+$(ibidir)/bison-$(bison-version): $(ibidir)/help2man-$(help2man-version)
+ tarball=bison-$(bison-version).tar.lz
+ $(call import-source, $(bison-url), $(bison-checksum))
+ $(call gbuild, bison-$(bison-version), static, ,V=1 -j$(numthreads))
+ echo "GNU Bison $(bison-version)" > $@
+
$(ibidir)/diffutils-$(diffutils-version): \
$(ibidir)/coreutils-$(coreutils-version)
tarball=diffutils-$(diffutils-version).tar.lz
@@ -883,7 +1021,7 @@ $(ibidir)/diffutils-$(diffutils-version): \
echo "GNU Diffutils $(diffutils-version)" > $@
$(ibidir)/file-$(file-version): $(ibidir)/coreutils-$(coreutils-version)
- export CFLAGS="-std=c99 $$CFLAGS"
+ export CFLAGS="-std=$(std_c_old) $$CFLAGS"
tarball=file-$(file-version).tar.lz
$(call import-source, $(file-url), $(file-checksum))
$(call gbuild, file-$(file-version), static, \
@@ -928,6 +1066,15 @@ $(ibidir)/gawk-$(gawk-version): \
# Build final target.
echo "GNU AWK $(gawk-version)" > $@
+$(ibidir)/help2man-$(help2man-version): \
+ $(ibidir)/coreutils-$(coreutils-version)
+ tarball=help2man-$(help2man-version).tar.lz
+ $(call import-source, $(help2man-url), $(help2man-checksum))
+ $(call gbuild, help2man-$(help2man-version), static, ,V=1)
+ echo "Help2man $(Help2man-version)" > $@
+
+# Even though libiconv does not use pkg-config, pkg-config conflicts with
+# it, see the comments in pkg-config for more.
$(ibidir)/libiconv-$(libiconv-version): \
$(ibidir)/pkg-config-$(pkgconfig-version)
tarball=libiconv-$(libiconv-version).tar.lz
@@ -943,12 +1090,14 @@ $(ibidir)/libunistring-$(libunistring-version): \
-j$(numthreads))
echo "GNU libunistring $(libunistring-version)" > $@
-$(ibidir)/libxml2-$(libxml2-version): $(ibidir)/patchelf-$(patchelf-version)
+$(ibidir)/libxml2-$(libxml2-version): $(ibidir)/tar-$(tar-version)
# The libxml2 tarball also contains Python bindings which are built
# and installed to a system directory by default. If you don't need
# the Python bindings, the easiest solution is to compile without
# Python support: './configure --without-python'. If you really need
-# the Python bindings, use '--with-python-install-dir=DIR' instead.
+# its Python bindings:
+# 1. Add the Python dependency.
+# 2. Add the '--with-python-install-dir=DIR' configure option.
tarball=libxml2-$(libxml2-version).tar.lz
$(call import-source, $(libxml2-url), $(libxml2-checksum))
$(call gbuild, libxml2-$(libxml2-version), static, \
@@ -987,9 +1136,10 @@ $(ibidir)/gmp-$(gmp-version): \
$(ibidir)/coreutils-$(coreutils-version)
tarball=gmp-$(gmp-version).tar.lz
$(call import-source, $(gmp-url), $(gmp-checksum))
+ export CFLAGS="-std=$(std_c_old) $$CFLAGS"
$(call gbuild, gmp-$(gmp-version), static, \
--enable-cxx --enable-fat, \
- -j$(numthreads) ,make check)
+ -j$(numthreads))
echo "GNU Multiple Precision Arithmetic Library $(gmp-version)" > $@
# Less is useful with Git (to view the diffs within a minimal container)
@@ -998,7 +1148,19 @@ $(ibidir)/gmp-$(gmp-version): \
$(ibidir)/less-$(less-version): $(ibidir)/ncurses-$(ncurses-version)
tarball=less-$(less-version).tar.lz
$(call import-source, $(less-url), $(less-checksum))
- $(call gbuild, less-$(less-version), static,,-j$(numthreads))
+
+# Without the '--with-regex=posix' option, the build will depend on
+# PCRE (perl compatible regular expressions) which are not available
+# on some systems/compilers and can cause a crash. Maneage was
+# successfully built with the POSIX regular expression (regex), and
+# 'less' is generally, an interactive software, not a batch-mode
+# software (it is just added in 'basic.mk' because Git uses it to
+# display things. Again, this is an interactive meta-operation in
+# maneage (operations you only do when you are developing Maneage
+# within Maneage interactively, and will not affect into the actual
+# reproducible analysis!)
+ $(call gbuild, less-$(less-version), static, \
+ --with-regex=posix,-j$(numthreads))
if [ -f $(ibdir)/patchelf ]; then
$(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/less;
fi
@@ -1017,50 +1179,31 @@ $(ibidir)/libtool-$(libtool-version): $(ibidir)/m4-$(m4-version)
$(ibidir)/grep-$(grep-version): $(ibidir)/coreutils-$(coreutils-version)
tarball=grep-$(grep-version).tar.lz
$(call import-source, $(grep-url), $(grep-checksum))
- $(call gbuild, grep-$(grep-version), static,,V=1)
+ $(call gbuild, grep-$(grep-version), static,, \
+ -j$(numthreads) V=1)
echo "GNU Grep $(grep-version)" > $@
-# M4 doesn't depend on PatchELF, but just to be consistent with the
-# levels/phases introduced here (where the compressors are level 1,
-# PatchELF is level 2, and ...), we'll set it as a dependency.
-$(ibidir)/m4-$(m4-version): $(ibidir)/patchelf-$(patchelf-version)
+# The '--with-syscmd-shell' is used as the default shell and if not given,
+# 'm4' will use '/bin/sh' (which is not under Maneage control and can cause
+# problems in 'high-level.mk' because it closes off the system's
+# LD_LIBRARY_PATH and if the system's '/bin/sh' needs a special system
+# library, the high-level programs will not be built). We are setting this
+# default shell to Dash because M4 is built before our own Bash. Recall
+# that Dash is built before we enter this Makefile.
+$(ibidir)/m4-$(m4-version): $(ibidir)/libiconv-$(libiconv-version)
tarball=m4-$(m4-version).tar.lz
$(call import-source, $(m4-url), $(m4-checksum))
- $(call gbuild, m4-$(m4-version), static,,V=1)
+ $(call gbuild, m4-$(m4-version), static, \
+ --with-syscmd-shell=$(ibdir)/dash, \
+ -j$(numthreads) V=1)
echo "GNU M4 $(m4-version)" > $@
$(ibidir)/mpfr-$(mpfr-version): $(ibidir)/gmp-$(gmp-version)
tarball=mpfr-$(mpfr-version).tar.lz
$(call import-source, $(mpfr-url), $(mpfr-checksum))
- $(call gbuild, mpfr-$(mpfr-version), static, , , make check)
+ $(call gbuild, mpfr-$(mpfr-version), static)
echo "GNU Multiple Precision Floating-Point Reliably $(mpfr-version)" > $@
-$(ibidir)/pkg-config-$(pkgconfig-version): $(ibidir)/patchelf-$(patchelf-version)
-
-# Download the tarball.
- tarball=pkg-config-$(pkgconfig-version).tar.lz
- $(call import-source, $(pkgconfig-url), $(pkgconfig-checksum))
-
-# An existing 'libiconv' can cause a conflict with 'pkg-config', this
-# is why 'libiconv' depends on 'pkg-config'. On a clean build,
-# 'pkg-config' is built first. But when we don't have a clean build
-# (and 'libiconv' exists) there will be a problem. So before
-# re-building 'pkg-config', we'll remove any installation of
-# 'libiconv'.
- rm -f $(ildir)/libiconv* $(idir)/include/iconv.h
-
-# Some Mac OS systems may have a version of the GNU C Compiler (GCC)
-# installed that doesn't support some necessary features of building
-# Glib (as part of pkg-config). So to be safe, for Mac systems, we'll
-# make sure it will use LLVM's Clang.
- if [ x$(on_mac_os) = xyes ]; then export compiler="CC=clang"
- else export compiler=""
- fi
- $(call gbuild, pkg-config-$(pkgconfig-version), static, \
- $$compiler --with-internal-glib \
- --with-pc-path=$(ildir)/pkgconfig, V=1)
- echo "pkg-config $(pkgconfig-version)" > $@
-
$(ibidir)/sed-$(sed-version): $(ibidir)/coreutils-$(coreutils-version)
tarball=sed-$(sed-version).tar.lz
$(call import-source, $(sed-url), $(sed-checksum))
@@ -1070,6 +1213,17 @@ $(ibidir)/sed-$(sed-version): $(ibidir)/coreutils-$(coreutils-version)
$(ibidir)/texinfo-$(texinfo-version): \
$(ibidir)/perl-$(perl-version) \
$(ibidir)/gettext-$(gettext-version)
+
+# Setting for the XS sub-package. "This is because in theory, the XS
+# module could be built with a different compiler to the rest of the
+# project, needing completely different flags" (part of [1])
+#
+# [1] https://lists.gnu.org/archive/html/bug-texinfo/2022-08/msg00068.html
+ export PERL="$(ibdir)/perl"
+ export PERL_EXT_LDFLAGS="-L$(ildir)"
+ export PERL_EXT_CPPFLAGS="-I$(iidir)"
+
+# Basic build commands.
tarball=texinfo-$(texinfo-version).tar.lz
$(call import-source, $(texinfo-url), $(texinfo-checksum))
$(call gbuild, texinfo-$(texinfo-version), static)
@@ -1105,7 +1259,7 @@ $(ibidir)/mpc-$(mpc-version): $(ibidir)/mpfr-$(mpfr-version)
echo "" > $@
else
$(call gbuild, mpc-$(mpc-version), static, , \
- -j$(numthreads), make check)
+ -j$(numthreads))
echo "GNU Multiple Precision Complex library" > $@
fi
@@ -1136,6 +1290,7 @@ $(ibidir)/binutils-$(binutils-version): \
$(ibidir)/gawk-$(gawk-version) \
$(ibidir)/grep-$(grep-version) \
$(ibidir)/wget-$(wget-version) \
+ $(ibidir)/bison-$(bison-version) \
$(ibidir)/which-$(which-version) \
$(ibidir)/libtool-$(libtool-version) \
$(ibidir)/texinfo-$(texinfo-version) \
@@ -1156,6 +1311,7 @@ $(ibidir)/binutils-$(binutils-version): \
$(call makelink,ld)
$(call makelink,nm)
$(call makelink,ps)
+ $(call makelink,lipo)
$(call makelink,strip)
$(call makelink,ranlib)
echo "" > $@
@@ -1163,8 +1319,9 @@ $(ibidir)/binutils-$(binutils-version): \
# Build binutils with the standard 'gbuild' function.
$(call gbuild, binutils-$(binutils-version), static, \
- --with-lib-path=$(sys_library_path), \
- -j$(numthreads) )
+ --with-lib-path=$(sys_library_path) \
+ --enable-gprofng=no, \
+ -j$(numthreads) V=1)
# The 'ld' linker of Binutils needs several '*crt*.o' files from
# the host's GNU C Library to run. On some systems these object
@@ -1287,20 +1444,49 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
current_dir=$$(pwd)
# By default 'ddir' (where GCC is decompressed and built) is in the
-# RAM (on systems that support '/dev/shm'). This is done to avoid
-# building so many small/temporary files and possibly harming the
-# hard-drive or SSD. But if the RAM doesn't have enough space, we
-# should use the hard-drive or SSD. During its build GCC's build
-# directory will become about 7GB (multiple of 1024 bytes, for GCC
-# 11.2.0). So at this step, we are making sure we have more than
-# 7.5GiB (multiple of 1000 bytes, which corresponds to 7.32GB)
-# before GCC starts to build. Note that the 4th column of 'df' is
-# the "available" space at the time of running, not the full
-# space. So the background RAM that the OS will be using during
-# Maneage is accounted for. Also consider that GCC is built alone
-# (no other Maneage software is built at the same time as GCC).
- in_ram=$$(df $(ddir) \
- | awk 'NR==2{print ($$4>7500000) ? "yes" : "no"}'); \
+# RAM (on systems that support a '/dev/shm' RAM disk). This is done
+# to avoid building so many small/temporary files and possibly
+# harming the hard-drive or SSD. But if the RAM doesn't have enough
+# space, we should use the hard-drive or SSD. During its build,
+# GCC's build directory will become several gigabytes and the build
+# also needs RAM. You can track the RAM usage of the system with a
+# 1-second resolution (if no other RAM consuming program is running
+# while building GCC) with the command below (example outputs can
+# be seen in https://savannah.nongnu.org/task/index.php?16623).
+#
+# c=1; while true; do POSIXLY_CORRECT=1 df -P /dev/shm/maneage-* | awk 'NR==2{print '$c', $3}'; c=$((c+1)); sleep 1; done > mem-usage.txt
+# asttable mem-usage.txt -c1,'arith $2 512 x 1024 / 1024 / 1024 /' -o mem.fits
+#
+# For POSIX portability and longevity (default sizes might change),
+# we use the '-P' option, and we use the environment variable
+# POSIXLY_CORRECT=1, so the 'block size' is 512 bytes. In this way,
+# to get the actual GiB amount, multiply the value returned above
+# by 512 (B/block), then divide by 1024^3 (B/GiB).
+#
+# To get the final value to use here, get the maximum used value
+# after GCC is fully built and you have stopped the 'while true'
+# command above. You can do this with the command below (assumes
+# you have Gnuastro).
+#
+# aststatistics mem-usage.txt -c2 --maximum | asttable -c'arith $1 7000000 +' -Afixed -B0
+#
+# The extra space is because we will assume an extra 3 GiB = 3GiB *
+# 1024^3 (B/GiB) / 512 (B/block) = 6291456 blocks are necessary for
+# the building (let's round it to 7000000!).
+#
+# Therefore, we need to make sure that the running system more than
+# the necessary amount of space in the RAM. To do this, we use 'df'
+# below.
+#
+# The 4th column of 'df' is the "available" space at the time of
+# running, not the full space. So the 'RAM disk' that the OS
+# will be using as "pretend" disk space (e.g. using 'tmpfs'; this
+# is physically RAM, but appears as if it is disk space)
+# during this stage of Maneage is accounted for. GCC is built
+# alone - no other Maneage software is built at the same time as
+# GCC - so this amount of RAM should be enough.
+ in_ram=$$(POSIXLY_CORRECT=1 df -P $(ddir) \
+ | awk 'NR==2{print ($$4>26613216) ? "yes" : "no"}'); \
if [ $$in_ram = "yes" ]; then odir=$(ddir)
else
odir=$(BDIR)/software/build-tmp-gcc-due-to-lack-of-space
@@ -1308,15 +1494,28 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
mkdir $$odir
fi
-# Go into the proper directory, unpack GCC and prepare the 'build'
-# directory inside it for all the built files.
+# Go into the directory to uncompress GCC.
cd $$odir
+
+# Unpack GCC and prepare the 'build' directory inside it for all
+# the built files.
rm -rf gcc-$(gcc-version)
- tar -xf $(tdir)/$$tarball
+ tar -xf $(tdir)/$$tarball --no-same-owner --no-same-permissions
if [ $$odir != $(ddir) ]; then
ln -s $$odir/gcc-$(gcc-version) $(ddir)/gcc-$(gcc-version)
fi
cd gcc-$(gcc-version)
+ $(shsrcdir)/prep-source.sh $(ibdir)
+
+# Unfortunately binutils installs headers like 'ansidecl.h' that
+# have been seen to conflict with GCC's internal versions of those
+# headers. For example in the 'ansidecl.h' of Binutils 2.39, the
+# 'PTR' macro isn't defined, while the same file in GCC 12.1.0 has
+# defined it. Therefore, without this change, GCC will include the
+# file installed from Binutils, not find what it needs and crash!
+# Therefore, with the 'CPPFLAGS' modification below, we tell GCC to
+# first look into its own 'include' directory before anything else.
+ export CPPFLAGS="-I$$(pwd)/include $(CPPFLAGS)"
# Set the build directory for the processing.
mkdir build
@@ -1396,12 +1595,39 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
+# Level 6: need re-compilation
+# ----------------------------
+#
+# The initial build of these was done with the host's settings, which will
+# cause problems later when we completely close-off the host environment.
+$(ibidir)/make-$(make-version): $(ibidir)/gcc-$(gcc-version)
+ tarball=make-$(make-version).tar.lz
+ $(call import-source, $(make-url), $(make-checksum))
+ $(call gbuild, make-$(make-version), static, \
+ --disable-dependency-tracking --without-guile)
+ echo "GNU Make $(make-version)" > $@
+
+$(ibidir)/lzip-$(lzip-version): $(ibidir)/gcc-$(gcc-version)
+ tarball=lzip-$(lzip-version).tar
+ unpackdir=lzip-$(lzip-version)
+ cd $(ddir)
+ rm -rf $$unpackdir
+ tar -xf $(tdir)/$$tarball --no-same-owner --no-same-permissions
+ cd $$unpackdir
+ $(shsrcdir)/prep-source.sh $(ibdir)
+ ./configure --build --check --installdir="$(ibdir)"
+ if [ -f $(ibdir)/patchelf ]; then
+ $(ibdir)/patchelf --set-rpath $(ildir) $(ibdir)/lzip;
+ fi
+ cd ..
+ rm -rf $$unpackdir
+ echo "Lzip $(lzip-version)" > $@
-# Level 6: Basic text editor
+# Level 7: Basic text editor
# --------------------------
#
# If the project is built in a minimal environment, there is no text
@@ -1418,7 +1644,8 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
# nano (and use their own optional high-level text editor). To do this, you
# can just have to manually remove 'nano' from 'targets-proglib' above and
# add their optional text editor in 'TARGETS.conf'.
-$(ibidir)/nano-$(nano-version): $(ibidir)/gcc-$(gcc-version)
+$(ibidir)/nano-$(nano-version): $(ibidir)/lzip-$(lzip-version) \
+ $(ibidir)/make-$(make-version)
tarball=nano-$(nano-version).tar.lz
$(call import-source, $(nano-url), $(nano-checksum))
$(call gbuild, nano-$(nano-version), static)