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.mk291
1 files changed, 170 insertions, 121 deletions
diff --git a/reproduce/software/make/basic.mk b/reproduce/software/make/basic.mk
index 745aeca..92fa8f0 100644
--- a/reproduce/software/make/basic.mk
+++ b/reproduce/software/make/basic.mk
@@ -21,9 +21,9 @@
#
# ------------------------------------------------------------------------
#
-# Copyright (C) 2018-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
-# Copyright (C) 2019-2025 Raul Infante-Sainz <infantesainz@gmail.com>
-# Copyright (C) 2022-2025 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
@@ -63,10 +63,13 @@ ibidir = $(BDIR)/software/installed/version-info/proglib
# 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
# ----------------------------
@@ -102,12 +105,13 @@ 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 '::'.
+# 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
@@ -117,7 +121,7 @@ export CPPFLAGS := -I$(idir)/include $(CPPFLAGS) $(noccwarnings)
ifeq ($(strip $(LD_LIBRARY_PATH)),)
export LD_LIBRARY_PATH=$(sys_library_sh_path)
endif
-export LD_LIBRARY_PATH := $(shell echo $(LD_LIBRARY_PATH):$(ildir) \
+export LD_LIBRARY_PATH := $(shell echo $(ildir):$(LD_LIBRARY_PATH) \
| sed -e's/::/:/g' -e's/^://' -e's/:$$//')
# RPATH is automatically written in macOS, so 'DYLD_LIBRARY_PATH' is
@@ -144,10 +148,17 @@ 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
@@ -243,6 +254,23 @@ $(ibidir)/low-level-links: $(ibidir)/grep-$(grep-version) \
# 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 $@
@@ -261,11 +289,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
@@ -273,13 +298,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
@@ -308,7 +333,7 @@ $(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 \
@@ -330,30 +355,29 @@ $(ibidir)/bzip2-$(bzip2-version): $(ibidir)/gzip-$(gzip-version)
#
# 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)/gzip-$(gzip-version) \
$(ibidir)/zlib-$(zlib-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 onfigurations: nls and iconv were creating problems with
+# the dependencies on MacOs and are not relevant in the context of
+# Maneage, hence, they are disabled.
+ $(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 am_cv_func_iconv=no, \
+ -j$(numthreads) V=1)
echo "GNU Tar $(tar-version)" > $@
@@ -370,8 +394,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,7 +406,47 @@ $(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'.
+ 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 we will disable pkg-config's
+# internal Glib for Mac systems, and to be further safe, we'll make
+# sure it will use LLVM's Clang.
+#
+# On macOS systems, to ensure that Clang can build pkg-config, take
+# the following steps:
+# 1. Install the latest Glib via Homebrew:
+# brew install glib
+# 2. Set these environment variables before configuring Maneage:
+# export GLIB_CFLAGS=$(pkg-config --cflags glib-2.0)
+# export GLIB_LIBS=$(pkg-config --libs glib-2.0)
+# 3. Ensure PKG_CONFIG_PATH includes Homebrew's pkgconfig:
+# export PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH
+ if [ x$(on_mac_os) = xyes ]; then
+ extra_pkgconf=""
+ export compiler="CC=clang"
+ else
+ export compiler=""
+ extra_pkgconf="--with-internal-glib"
+ fi
+ export CFLAGS="-std=$(std_c_old) $$CFLAGS"
+ $(call gbuild, pkg-config-$(pkgconfig-version), static, \
+ $$compiler $$extra_pkgconf \
+ --with-pc-path=$(ildir)/pkgconfig, V=1)
+ echo "pkg-config $(pkgconfig-version)" > $@
@@ -402,7 +466,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 +485,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
@@ -531,6 +605,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
@@ -559,7 +634,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, \
@@ -576,9 +651,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)" > $@
@@ -591,6 +663,7 @@ $(ibidir)/bash-$(bash-version): \
+
# Level 4: Most other programs
# ----------------------------
@@ -604,18 +677,24 @@ 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 \
@@ -623,15 +702,15 @@ $(ibidir)/perl-$(perl-version): $(ibidir)/patchelf-$(patchelf-version)
-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 \
@@ -642,7 +721,14 @@ $(ibidir)/perl-$(perl-version): $(ibidir)/patchelf-$(patchelf-version)
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)" > $@
@@ -675,14 +761,15 @@ $(ibidir)/coreutils-$(coreutils-version): \
$(ibidir)/perl-$(perl-version) \
$(ibidir)/openssl-$(openssl-version)
-# Import the source tarball.
+# 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)
$(shsrcdir)/prep-source.sh $(ibdir)
@@ -696,7 +783,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
@@ -710,29 +797,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)
- $(shsrcdir)/prep-source.sh $(ibdir)
- 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
@@ -740,8 +804,9 @@ $(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.
@@ -897,7 +962,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, \
@@ -949,6 +1014,8 @@ $(ibidir)/help2man-$(help2man-version): \
$(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
@@ -964,12 +1031,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, \
@@ -1008,6 +1077,7 @@ $(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))
@@ -1054,10 +1124,6 @@ $(ibidir)/grep-$(grep-version): $(ibidir)/coreutils-$(coreutils-version)
-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.
-#
# 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
@@ -1065,7 +1131,7 @@ $(ibidir)/grep-$(grep-version): $(ibidir)/coreutils-$(coreutils-version)
# 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)/patchelf-$(patchelf-version)
+$(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, \
@@ -1079,32 +1145,6 @@ $(ibidir)/mpfr-$(mpfr-version): $(ibidir)/gmp-$(gmp-version)
$(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))
@@ -1212,6 +1252,7 @@ $(ibidir)/binutils-$(binutils-version): \
$(call makelink,ld)
$(call makelink,nm)
$(call makelink,ps)
+ $(call makelink,lipo)
$(call makelink,strip)
$(call makelink,ranlib)
echo "" > $@
@@ -1400,7 +1441,7 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
# 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
@@ -1435,6 +1476,14 @@ $(ibidir)/gcc-$(gcc-version): $(ibidir)/binutils-$(binutils-version)
-e"s|FS_IOC_SETVERSION;|_IOW('v', 2, long);|" \
-i libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+# Bug in GCC 15.2.0 using glibc 2.43 (see [1]) as fixed in [2].
+# [1] https://patchwork.ozlabs.org/project/gcc/patch/e1679277-d7c9-49aa-8365-a8dca082d9bd@web.de
+# [2] https://github.com/johnny-mnemonic/toolchain-autobuilds/commit/9585fdfc
+ sed -e's|char \*q = strchr (p + 1,|const char \*q = strchr (p + 1,|' \
+ libgomp/affinity-fmt.c > affinity-fmt-tmp.c
+ mv affinity-fmt-tmp.c libgomp/affinity-fmt.c
+
+
# Set the build directory for the processing.
mkdir build
cd build
@@ -1530,7 +1579,7 @@ $(ibidir)/lzip-$(lzip-version): $(ibidir)/gcc-$(gcc-version)
unpackdir=lzip-$(lzip-version)
cd $(ddir)
rm -rf $$unpackdir
- tar -xf $(tdir)/$$tarball
+ tar -xf $(tdir)/$$tarball --no-same-owner --no-same-permissions
cd $$unpackdir
$(shsrcdir)/prep-source.sh $(ibdir)
./configure --build --check --installdir="$(ibdir)"