diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4734b0f..75d4b0e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,6 +23,9 @@ before_script: pkg-config \ texinfo \ wget \ + help2man \ + autoconf \ + automake \ zstd && curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none diff --git a/mk/prefix.mk b/mk/prefix.mk index 87ab8be..3bf9b10 100644 --- a/mk/prefix.mk +++ b/mk/prefix.mk @@ -1,12 +1,13 @@ -# Configuration file for the Rust/GCC cross-compilers and relibc +# Configuration file for the Rust/GCC cross-compilers, relibc and libtool PREFIX=prefix/$(TARGET) -PREFIX_INSTALL=$(PREFIX)/relibc-install +PREFIX_INSTALL=$(PREFIX)/sysroot/ PREFIX_PATH=$(ROOT)/$(PREFIX_INSTALL)/bin BINUTILS_BRANCH=redox-2.43.1 GCC_BRANCH=redox-13.2.0 +LIBTOOL_VERSION=2.5.4 export PREFIX_RUSTFLAGS=-L $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX_INSTALL) @@ -21,7 +22,11 @@ else GCC_ARCH?= endif -prefix: $(PREFIX_INSTALL) +# TODO(andypython): Upstream libtool patches to remove the need to locally build libtool. +# Cannot be CI built, i.e. be a part of relibc-install.tar.gz, as the prefix has to be correctly +# set while building. Otherwise aclocal will not be able to find libtool's files. Furthermore, doing +# so would break non-podman builds (not sure if they are still supported though). +prefix: $(PREFIX)/sysroot PREFIX_STRIP=\ mkdir -p bin libexec "$(GCC_TARGET)/bin" && \ @@ -65,6 +70,51 @@ $(PREFIX)/relibc-install.tar.gz: $(PREFIX)/relibc-install --directory="$<" \ . +$(PREFIX)/libtool: + rm -rf "$@.partial" "$@" + mkdir -p "$@.partial" + + git clone \ + --recurse-submodules \ + "https://gitlab.redox-os.org/andypython/libtool/" \ + --branch "v$(LIBTOOL_VERSION)-redox" \ + --depth 1 \ + "$@.partial" + + touch "$@.partial" + mv "$@.partial" "$@" + +$(PREFIX)/libtool-build: $(PREFIX)/libtool $(CONTAINER_TAG) +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) $(MAKE) $@ +else + mkdir -p "$@.partial" + cd "$(PREFIX)/libtool" && \ + ./bootstrap \ + --skip-po \ + --skip-git \ + --force \ + --gnulib-srcdir=./gnulib + cd "$@.partial" && \ + "$(ROOT)/$