From 6c4cc7ea1bcb58c586ae64ae6f76720b6b89bda4 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 23 Nov 2017 11:39:23 +0000 Subject: [PATCH] Move toolchain from /tools to /tools_${arch} This will allow us to run multiple builds on the same system at the same time (or at least have them on disk). Signed-off-by: Michael Tremer --- lfs/Config | 4 ++-- lfs/automake | 4 ++-- lfs/bash | 8 ++++---- lfs/binutils | 12 ++++++------ lfs/bzip2 | 4 ++-- lfs/ccache | 28 ++++++++++++++-------------- lfs/cleanup-toolchain | 22 +++++++++++----------- lfs/coreutils | 4 ++-- lfs/dejagnu | 2 +- lfs/diffutils | 4 ++-- lfs/expect | 6 +++--- lfs/fake-environ | 2 +- lfs/findutils | 4 ++-- lfs/flex | 2 +- lfs/gawk | 4 ++-- lfs/gcc | 34 +++++++++++++++++----------------- lfs/gettext | 6 +++--- lfs/glibc | 10 +++++----- lfs/grep | 4 ++-- lfs/gzip | 4 ++-- lfs/linux | 2 +- lfs/m4 | 4 ++-- lfs/make | 4 ++-- lfs/ncurses | 6 +++--- lfs/ncurses-compat | 4 ++-- lfs/patch | 4 ++-- lfs/perl | 10 +++++----- lfs/pkg-config | 6 +++--- lfs/sed | 4 ++-- lfs/stage1 | 4 ++-- lfs/stage2 | 10 +++++----- lfs/strip | 2 +- lfs/tar | 4 ++-- lfs/tcl | 4 ++-- lfs/texinfo | 4 ++-- lfs/xz | 2 +- make.sh | 29 ++++++++++++++++------------- src/stripper | 2 +- tools/make-functions | 11 +++++++---- 39 files changed, 145 insertions(+), 139 deletions(-) diff --git a/lfs/Config b/lfs/Config index e647e753f2..a45b76b995 100644 --- a/lfs/Config +++ b/lfs/Config @@ -31,7 +31,7 @@ ############################################################################### # Cleanup environment from any variables -unexport BUILD_ARCH BUILD_PLATFORM BUILDTARGET CROSSTARGET TOOLCHAIN +unexport BUILD_ARCH BUILD_PLATFORM BUILDTARGET CROSSTARGET TOOLCHAIN TOOLS_DIR ifeq "$(BUILD_ARCH)" "aarch64" IS_64BIT = 1 @@ -80,7 +80,7 @@ CCACHE_COMPILERCHECK += $(shell gcc -dumpspecs 2>/dev/null | md5sum | cut -d ' ' # define FIND_FILES cd $(ROOT)/ && find -mount \ - \( -path './tools' -or -path './tmp' -or -path './usr/src' \ + \( -path '.$(TOOLS_DIR)' -or -path './tmp' -or -path './usr/src' \ -or -path './run' -or -path './dev' -or -path './proc' \ -or -path './install' \) -prune -or -print | sort endef diff --git a/lfs/automake b/lfs/automake index a372443b32..15bdad1e5e 100644 --- a/lfs/automake +++ b/lfs/automake @@ -32,13 +32,13 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" PREFIX = /usr TARGET = $(DIR_INFO)/$(THISAPP) else - PREFIX = /tools + PREFIX = $(TOOLS_DIR) TARGET = $(DIR_INFO)/$(THISAPP)-tools endif diff --git a/lfs/bash b/lfs/bash index e98b6fdba8..99a293dbb6 100644 --- a/lfs/bash +++ b/lfs/bash @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.gz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -39,7 +39,7 @@ ifeq "$(ROOT)" "" --with-installed-readline else TARGET = $(DIR_INFO)/$(THISAPP)-tools - CONFIGURE_OPTIONS = --prefix=/tools + CONFIGURE_OPTIONS = --prefix=$(TOOLS_DIR) endif CONFIGURE_OPTIONS += \ @@ -100,10 +100,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && make install ifeq "$(TOOLCHAIN)" "1" - ln -svf bash /tools/bin/sh + ln -svf bash $(TOOLS_DIR)/bin/sh mkdir -pv $(ROOT)/bin - ln -svf ../tools/bin/bash $(ROOT)/bin/sh + ln -svf ..$(TOOLS_DIR)/bin/bash $(ROOT)/bin/sh else ln -svf bash /bin/sh endif diff --git a/lfs/binutils b/lfs/binutils index 79ac96b3e2..79b208d080 100644 --- a/lfs/binutils +++ b/lfs/binutils @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.gz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -53,9 +53,9 @@ ifeq "$(PASS)" "1" TARGET = $(DIR_INFO)/$(THISAPP)-tools1 EXTRA_CONFIG = \ --target=$(CROSSTARGET) \ - --prefix=/tools \ + --prefix=$(TOOLS_DIR) \ --with-sysroot=$(ROOT) \ - --with-lib-path=/tools/lib + --with-lib-path=$(TOOLS_DIR)/lib EXTRA_MAKE = EXTRA_INSTALL = else @@ -67,8 +67,8 @@ else EXTRA_CONFIG = \ --host=$(BUILDTARGET) \ --build=$(BUILDTARGET) \ - --prefix=/tools \ - --with-lib-path=/tools/lib + --prefix=$(TOOLS_DIR) \ + --with-lib-path=$(TOOLS_DIR)/lib EXTRA_MAKE = EXTRA_INSTALL = endif @@ -138,7 +138,7 @@ ifeq "$(TOOLCHAIN)" "1" ifeq "$(PASS)" "2" cd $(DIR_SRC)/binutils-build && make -C ld clean cd $(DIR_SRC)/binutils-build && make -C ld LIB_PATH=/usr/lib:/lib - cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new /tools/bin + cd $(DIR_SRC)/binutils-build && cp -v ld/ld-new $(TOOLS_DIR)/bin endif endif diff --git a/lfs/bzip2 b/lfs/bzip2 index 44fa7575e0..89f0ca7adc 100644 --- a/lfs/bzip2 +++ b/lfs/bzip2 @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.gz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -90,7 +90,7 @@ ifeq "$(ROOT)" "" ln -sfv bzip2 /bin/bzcat else cd $(DIR_APP) && make $(MAKETUNING) - cd $(DIR_APP) && make PREFIX=/tools install + cd $(DIR_APP) && make PREFIX=$(TOOLS_DIR) install endif @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/ccache b/lfs/ccache index f7da652ad8..470890d65e 100644 --- a/lfs/ccache +++ b/lfs/ccache @@ -79,28 +79,28 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && ./configure --prefix=/tools + cd $(DIR_APP) && ./configure --prefix=$(TOOLS_DIR) cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE) cd $(DIR_APP) && make install ifeq "$(TOOLCHAIN)" "1" ifeq "$(PASS)" "1" - mkdir -pv /tools/ccache/bin - ln -svf ../../bin/ccache /tools/ccache/bin/gcc - ln -svf ../../bin/ccache /tools/ccache/bin/g++ - ln -svf ../../bin/ccache /tools/ccache/bin/cc - ln -svf ../../bin/ccache /tools/ccache/bin/c++ - ln -svf ../../bin/ccache /tools/ccache/bin/$(CROSSTARGET)-gcc - ln -svf ../../bin/ccache /tools/ccache/bin/$(CROSSTARGET)-g++ - ln -svf ../../bin/ccache /tools/ccache/bin/$(CROSSTARGET)-cc - ln -svf ../../bin/ccache /tools/ccache/bin/$(CROSSTARGET)-c++ + mkdir -pv $(TOOLS_DIR)/ccache/bin + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/gcc + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/g++ + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/cc + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/c++ + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(CROSSTARGET)-gcc + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(CROSSTARGET)-g++ + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(CROSSTARGET)-cc + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(CROSSTARGET)-c++ endif ifeq "$(PASS)" "2" - ln -svf ../../bin/ccache /tools/ccache/bin/$(BUILDTARGET)-gcc - ln -svf ../../bin/ccache /tools/ccache/bin/$(BUILDTARGET)-g++ - ln -svf ../../bin/ccache /tools/ccache/bin/$(BUILDTARGET)-cc - ln -svf ../../bin/ccache /tools/ccache/bin/$(BUILDTARGET)-c++ + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(BUILDTARGET)-gcc + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(BUILDTARGET)-g++ + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(BUILDTARGET)-cc + ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(BUILDTARGET)-c++ endif endif diff --git a/lfs/cleanup-toolchain b/lfs/cleanup-toolchain index 91e056ed83..1c1fa8a50e 100644 --- a/lfs/cleanup-toolchain +++ b/lfs/cleanup-toolchain @@ -59,30 +59,30 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) ifeq "$(TOOLCHAIN)" "1" # Remove the first cross compiler which is not needed anymore. - find /tools/ -name "$(CROSSTARGET)*" | xargs rm -rfv + find $(TOOLS_DIR)/ -name "$(CROSSTARGET)*" | xargs rm -rfv # Remove man and info pages. - rm -rfv /tools/{,share}/{info,man} + rm -rfv $(TOOLS_DIR)/{,share}/{info,man} # Strip all binaries. - STRIP="/usr/bin/strip" $(DIR_SRC)/src/stripper /tools/ + STRIP="/usr/bin/strip" $(DIR_SRC)/src/stripper $(TOOLS_DIR)/ # Fix ownership of the toolchain. - chown -R root:root /tools/ + chown -R root:root $(TOOLS_DIR)/ # Update/create linker cache. - /tools/sbin/ldconfig + $(TOOLS_DIR)/sbin/ldconfig # Set a marker when the toolchain was successfully built - touch /tools/.toolchain-successful + touch $(TOOLS_DIR)/.toolchain-successful else - mv -v /tools/bin/{ld,ld-old} - mv -v /tools/$(BUILDTARGET)/bin/{ld,ld-old} - mv -v /tools/bin/{ld-new,ld} - ln -sv /tools/bin/ld /tools/$(BUILDTARGET)/bin/ld + mv -v $(TOOLS_DIR)/bin/{ld,ld-old} + mv -v $(TOOLS_DIR)/$(BUILDTARGET)/bin/{ld,ld-old} + mv -v $(TOOLS_DIR)/bin/{ld-new,ld} + ln -sv $(TOOLS_DIR)/bin/ld $(TOOLS_DIR)/$(BUILDTARGET)/bin/ld gcc -dumpspecs | sed \ - -e 's@/tools@@g' \ + -e 's@$(TOOLS_DIR)@@g' \ -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \ -e '/\*cpp:/{n;s@$$@ -isystem /usr/include@}' > \ $$(dirname $$(gcc -print-libgcc-file-name))/specs diff --git a/lfs/coreutils b/lfs/coreutils index 324dc78089..904bd2bdf1 100644 --- a/lfs/coreutils +++ b/lfs/coreutils @@ -31,14 +31,14 @@ DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) CONFIGURE_OPTIONS = --prefix=/usr else TARGET = $(DIR_INFO)/$(THISAPP)-tools - CONFIGURE_OPTIONS = --prefix=/tools + CONFIGURE_OPTIONS = --prefix=$(TOOLS_DIR) endif CONFIGURE_OPTIONS += \ diff --git a/lfs/dejagnu b/lfs/dejagnu index b5105652be..3623c9b99c 100644 --- a/lfs/dejagnu +++ b/lfs/dejagnu @@ -70,7 +70,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && ./configure --prefix=/tools --disable-nls + cd $(DIR_APP) && ./configure --prefix=$(TOOLS_DIR) --disable-nls cd $(DIR_APP) && make install @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/diffutils b/lfs/diffutils index c8dc42f909..d3e957d82a 100644 --- a/lfs/diffutils +++ b/lfs/diffutils @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -40,7 +40,7 @@ ifeq "$(ROOT)" "" EXTRA_INSTALL = else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls --build=$(BUILDTARGET) + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls --build=$(BUILDTARGET) EXTRA_MAKE = EXTRA_INSTALL = endif diff --git a/lfs/expect b/lfs/expect index 93d6fe6e6a..2ebd6a8f57 100644 --- a/lfs/expect +++ b/lfs/expect @@ -71,10 +71,10 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) $(DIR_SRC)/tcl* && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) cd $(DIR_APP) && ./configure \ - --prefix=/tools \ + --prefix=$(TOOLS_DIR) \ --build=$(BUILDTARGET) \ - --with-tcl=/tools/lib \ - --with-tclinclude=/tools/include \ + --with-tcl=$(TOOLS_DIR)/lib \ + --with-tclinclude=$(TOOLS_DIR)/include \ --with-x=no \ --disable-nls cd $(DIR_APP) && make $(MAKETUNING) diff --git a/lfs/fake-environ b/lfs/fake-environ index 978a90d9bc..7c8dd06640 100644 --- a/lfs/fake-environ +++ b/lfs/fake-environ @@ -52,7 +52,7 @@ $(TARGET) : cp -rvf $(DIR_SRC)/src/$(THISAPP) $(DIR_APP) cd $(DIR_APP) && make install CFLAGS="$(CFLAGS)" \ - TOOLS_DIR="/tools" + TOOLS_DIR="$(TOOLS_DIR)" @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/findutils b/lfs/findutils index d1a520b3f6..6b9e0fc74d 100644 --- a/lfs/findutils +++ b/lfs/findutils @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.gz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -41,7 +41,7 @@ ifeq "$(ROOT)" "" EXTRA_INSTALL = else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls --build=$(BUILDTARGET) + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls --build=$(BUILDTARGET) EXTRA_MAKE = EXTRA_INSTALL = endif diff --git a/lfs/flex b/lfs/flex index 4b1a75b098..f3cc095b99 100644 --- a/lfs/flex +++ b/lfs/flex @@ -70,7 +70,7 @@ $(subst %,%_MD5,$(objects)) : $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) - cd $(DIR_APP) && HELP2MAN=/tools/bin/true \ + cd $(DIR_APP) && HELP2MAN=$(TOOLS_DIR)/bin/true \ ./configure --prefix=/usr --disable-nls cd $(DIR_APP) && make $(MAKETUNING) $(EXTRA_MAKE) cd $(DIR_APP) && make $(EXTRA_INSTALL) install diff --git a/lfs/gawk b/lfs/gawk index 62bad0164e..cfa106d836 100644 --- a/lfs/gawk +++ b/lfs/gawk @@ -32,13 +32,13 @@ DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) EXTRA_CONFIG = --prefix=/usr --libexecdir=/usr/lib --disable-nls else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls endif ############################################################################### diff --git a/lfs/gcc b/lfs/gcc index 9325792ffe..9cc6ce3359 100644 --- a/lfs/gcc +++ b/lfs/gcc @@ -50,7 +50,7 @@ ifeq "$(BUILD_ARCH)" "armv5tel" FULL_BOOTSTRAP = 1 endif -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -71,10 +71,10 @@ ifeq "$(PASS)" "1" TARGET = $(DIR_INFO)/$(THISAPP)-tools1 EXTRA_CONFIG = \ --target=$(CROSSTARGET) \ - --prefix=/tools \ + --prefix=$(TOOLS_DIR) \ --with-sysroot=$(ROOT) \ - --with-local-prefix=/tools \ - --with-native-system-header-dir=/tools/include \ + --with-local-prefix=$(TOOLS_DIR) \ + --with-native-system-header-dir=$(TOOLS_DIR)/include \ --disable-nls \ --disable-shared \ --disable-decimal-float \ @@ -107,9 +107,9 @@ ifeq "$(PASS)" "2" RANLIB="$(CROSSTARGET)-ranlib" EXTRA_CONFIG = \ --build=$(BUILDTARGET) \ - --prefix=/tools \ - --with-local-prefix=/tools \ - --with-native-system-header-dir=/tools/include \ + --prefix=$(TOOLS_DIR) \ + --with-local-prefix=$(TOOLS_DIR) \ + --with-native-system-header-dir=$(TOOLS_DIR)/include \ --enable-languages=c,c++ \ --disable-libstdcxx-pch \ --disable-libgomp @@ -130,13 +130,13 @@ else RANLIB="$(CROSSTARGET)-ranlib" EXTRA_CONFIG = \ --host=$(CROSSTARGET) \ - --prefix=/tools \ + --prefix=$(TOOLS_DIR) \ --with-sysroot=$(ROOT) \ --disable-shared \ --disable-nls \ --disable-libstdcxx-threads \ --disable-libstdcxx-pch \ - --with-gxx-include-dir=/tools/$(CROSSTARGET)/include/c++/$(VER) + --with-gxx-include-dir=$(TOOLS_DIR)/$(CROSSTARGET)/include/c++/$(VER) EXTRA_MAKE = EXTRA_INSTALL = endif @@ -234,18 +234,18 @@ ifeq "$(TOOLCHAIN)" "1" ifeq "$(PASS)" "2" cd $(DIR_APP) && cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \ - `dirname $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name)`/include-fixed/limits.h + `dirname $$($(TOOLS_DIR)/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name)`/include-fixed/limits.h endif for file in $$(find $(DIR_APP)/gcc/config -name linux64.h -o -name linux.h \ -o -name sysv4.h -o -name linux-eabi.h -o -name linux-elf.h -o -name aarch64-linux.h); do \ echo "Processing $${file}..."; \ sed -i $${file} \ - -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \ - -e 's@/usr@/tools@g'; \ + -e 's@/lib\(64\)\?\(32\)\?/ld@$(TOOLS_DIR)&@g' \ + -e 's@/usr@$(TOOLS_DIR)@g'; \ echo '#undef STANDARD_STARTFILE_PREFIX_1' >> $${file}; \ echo '#undef STANDARD_STARTFILE_PREFIX_2' >> $${file}; \ - echo '#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"' >> $${file}; \ + echo '#define STANDARD_STARTFILE_PREFIX_1 "$(TOOLS_DIR)/lib/"' >> $${file}; \ echo '#define STANDARD_STARTFILE_PREFIX_2 ""' >> $${file}; \ done endif @@ -271,18 +271,18 @@ endif ifeq "$(TOOLCHAIN)" "1" ifeq "$(PASS)" "1" - ln -svf libgcc.a $$(/tools/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/') + ln -svf libgcc.a $$($(TOOLS_DIR)/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/') endif ifeq "$(PASS)" "2" - ln -svf gcc /tools/bin/cc + ln -svf gcc $(TOOLS_DIR)/bin/cc # remove gdb python files from libdir - rm -rf /tools/lib/*-gdb.py + rm -rf $(TOOLS_DIR)/lib/*-gdb.py endif ifeq "$(PASS)" "L" # Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70936 - sed -e "s/^#include_next/#include/" -i /tools/$(CROSSTARGET)/include/c++/$(VER)/cstdlib + sed -e "s/^#include_next/#include/" -i $(TOOLS_DIR)/$(CROSSTARGET)/include/c++/$(VER)/cstdlib endif else # NON-TOOLCHAIN diff --git a/lfs/gettext b/lfs/gettext index 3896ec12f1..e4eeb7299a 100644 --- a/lfs/gettext +++ b/lfs/gettext @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -40,7 +40,7 @@ ifeq "$(ROOT)" "" EXTRA_INSTALL = else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-shared --disable-nls --build=$(BUILDTARGET) + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-shared --disable-nls --build=$(BUILDTARGET) EXTRA_MAKE = EXTRA_INSTALL = endif @@ -92,7 +92,7 @@ else cd $(DIR_APP)/gettext-tools && make -C gnulib-lib cd $(DIR_APP)/gettext-tools && make -C intl pluralx.c cd $(DIR_APP)/gettext-tools && make -C src msgfmt - cd $(DIR_APP)/gettext-tools && cp -v src/msgfmt /tools/bin + cd $(DIR_APP)/gettext-tools && cp -v src/msgfmt $(TOOLS_DIR)/bin endif @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/glibc b/lfs/glibc index 122aca58fd..061bf8c2b4 100644 --- a/lfs/glibc +++ b/lfs/glibc @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.gz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -45,8 +45,8 @@ else EXTRA_CONFIG = \ --host=$(CROSSTARGET) \ --build=$(BUILDTARGET) \ - --prefix=/tools \ - --with-headers=/tools/include \ + --prefix=$(TOOLS_DIR) \ + --with-headers=$(TOOLS_DIR)/include \ libc_cv_forced_unwind=yes \ libc_cv_c_cleanup=yes endif @@ -160,8 +160,8 @@ ifeq "$(TOOLCHAIN)" "1" cd $(DIR_APP) && echo "int main() { return 0; }" > dummy.c cd $(DIR_APP) && $(CROSSTARGET)-gcc dummy.c -o dummy - # Must be using a runtime linker from /tools - cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: /tools" + # Must be using a runtime linker from $(TOOLS_DIR) + cd $(DIR_APP) && readelf -l dummy | grep "Requesting program interpreter: $(TOOLS_DIR)" cd $(DIR_APP) && rm -vf dummy dummy.c endif diff --git a/lfs/grep b/lfs/grep index 5ac45c15a4..3c3d976963 100644 --- a/lfs/grep +++ b/lfs/grep @@ -31,14 +31,14 @@ DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) EXTRA_CONFIG = --prefix=/usr --bindir=/bin --disable-nls else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls \ + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls \ --disable-perl-regexp --without-included-regex endif diff --git a/lfs/gzip b/lfs/gzip index e61d78a8c6..12fae78e94 100644 --- a/lfs/gzip +++ b/lfs/gzip @@ -31,14 +31,14 @@ DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) EXTRA_CONFIG = --prefix=/usr --disable-nls --bindir=/bin else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls endif ############################################################################### diff --git a/lfs/linux b/lfs/linux index b3ccb7af9a..c74051250f 100644 --- a/lfs/linux +++ b/lfs/linux @@ -56,7 +56,7 @@ VERSUFIX=ipfire$(KCFG) ifeq "$(TOOLCHAIN)" "1" TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX)-tools - HEADERS_PREFIX = /tools + HEADERS_PREFIX = $(TOOLS_DIR) else TARGET = $(DIR_INFO)/linux-$(VER)-$(VERSUFIX) HEADERS_PREFIX = /usr diff --git a/lfs/m4 b/lfs/m4 index 55cc4c3ce5..3864d42158 100644 --- a/lfs/m4 +++ b/lfs/m4 @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -39,7 +39,7 @@ ifeq "$(ROOT)" "" EXTRA_MAKE = else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls EXTRA_MAKE = endif diff --git a/lfs/make b/lfs/make index 213ef9ae76..979357eca3 100644 --- a/lfs/make +++ b/lfs/make @@ -35,7 +35,7 @@ PAK_VER = 4 DEPS = "" -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -44,7 +44,7 @@ ifeq "$(ROOT)" "" EXTRA_INSTALL = else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls EXTRA_MAKE = EXTRA_INSTALL = endif diff --git a/lfs/ncurses b/lfs/ncurses index 1d8fd40d21..1186b5244f 100644 --- a/lfs/ncurses +++ b/lfs/ncurses @@ -31,14 +31,14 @@ DL_FILE = $(THISAPP).tar.gz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) PREFIX = /usr else TARGET = $(DIR_INFO)/$(THISAPP)-tools - PREFIX = /tools + PREFIX = $(TOOLS_DIR) EXTRA_CONFIG = --build=$(BUILDTARGET) endif @@ -94,7 +94,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in # Create pkgconfig dir in toolchain ifneq "$(ROOT)" "" - mkdir -pv /tools/lib/pkgconfig/ + mkdir -pv $(TOOLS_DIR)/lib/pkgconfig/ endif cd $(DIR_APP) && CPPFLAGS=-P ./configure $(EXTRA_CONFIG) cd $(DIR_APP) && make $(MAKETUNING) diff --git a/lfs/ncurses-compat b/lfs/ncurses-compat index 09ec434850..14807367f1 100644 --- a/lfs/ncurses-compat +++ b/lfs/ncurses-compat @@ -31,14 +31,14 @@ DL_FILE = $(THISAPP).tar.gz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) PREFIX = /usr else TARGET = $(DIR_INFO)/$(THISAPP)-tools - PREFIX = /tools + PREFIX = $(TOOLS_DIR) endif EXTRA_CONFIG += \ diff --git a/lfs/patch b/lfs/patch index 88adf25f4e..c938ac8faa 100644 --- a/lfs/patch +++ b/lfs/patch @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -40,7 +40,7 @@ ifeq "$(ROOT)" "" EXTRA_INSTALL = else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls EXTRA_MAKE = EXTRA_INSTALL = endif diff --git a/lfs/perl b/lfs/perl index 9ab8efae4e..0c239318c3 100644 --- a/lfs/perl +++ b/lfs/perl @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.bz2 DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -90,13 +90,13 @@ ifeq "$(ROOT)" "" cd $(DIR_APP) && make $(MAKETUNING) cd $(DIR_APP) && make install else - cd $(DIR_APP) && ./configure.gnu --prefix=/tools -Dstatic_ext='Data/Dumper Fcntl IO' + cd $(DIR_APP) && ./configure.gnu --prefix=$(TOOLS_DIR) -Dstatic_ext='Data/Dumper Fcntl IO' cd $(DIR_APP) && sed -i 's/^0$$//' makefile cd $(DIR_APP) && sed -i 's/^0$$//' x2p/makefile cd $(DIR_APP) && make perl utilities - cd $(DIR_APP) && cp -v perl pod/pod2man /tools/bin - cd $(DIR_APP) && mkdir -pv /tools/lib/perl5/$(VER) - cd $(DIR_APP) && cp -Rv lib/* /tools/lib/perl5/$(VER) + cd $(DIR_APP) && cp -v perl pod/pod2man $(TOOLS_DIR)/bin + cd $(DIR_APP) && mkdir -pv $(TOOLS_DIR)/lib/perl5/$(VER) + cd $(DIR_APP) && cp -Rv lib/* $(TOOLS_DIR)/lib/perl5/$(VER) endif @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/lfs/pkg-config b/lfs/pkg-config index 36fb40ae9c..fe2752a0dc 100644 --- a/lfs/pkg-config +++ b/lfs/pkg-config @@ -32,14 +32,14 @@ DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) TARGET = $(DIR_INFO)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) PREFIX = /usr else TARGET = $(DIR_INFO)/$(THISAPP)-tools - PREFIX = /tools + PREFIX = $(TOOLS_DIR) endif ############################################################################### @@ -82,7 +82,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) ifeq "$(ROOT)" "" else - mkdir -pv /tools/lib/pkgconfig + mkdir -pv $(TOOLS_DIR)/lib/pkgconfig endif cd $(DIR_APP) && ./configure --prefix=$(PREFIX) --with-internal-glib cd $(DIR_APP) && make $(MAKETUNING) diff --git a/lfs/sed b/lfs/sed index 77eba0bc63..3ac39a71cd 100644 --- a/lfs/sed +++ b/lfs/sed @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.gz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -40,7 +40,7 @@ ifeq "$(ROOT)" "" EXTRA_INSTALL = else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls EXTRA_MAKE = EXTRA_INSTALL = endif diff --git a/lfs/stage1 b/lfs/stage1 index c4c578411e..99e3edbbdd 100644 --- a/lfs/stage1 +++ b/lfs/stage1 @@ -48,10 +48,10 @@ md5 : $(TARGET) : @$(PREBUILD) - mkdir -pv /tools/lib + mkdir -pv $(TOOLS_DIR)/lib ifeq "$(IS_64BIT)" "1" - ln -svf lib /tools/lib64 + ln -svf lib $(TOOLS_DIR)/lib64 endif @$(POSTBUILD) diff --git a/lfs/stage2 b/lfs/stage2 index 0a5ac65c09..4ab5edd8b5 100644 --- a/lfs/stage2 +++ b/lfs/stage2 @@ -71,11 +71,11 @@ endif # Symlinks # for this reason, stage2 rebuild will broke the iso:perl, grubbatch - -ln -sv /tools/bin/{bash,cat,echo,pwd,stty} /bin - -ln -sv /tools/bin/perl /usr/bin - -ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib - -ln -sv /tools/lib/libstdc++.so{,.6} /usr/lib - sed 's/tools/usr/' /tools/lib/libstdc++.la > /usr/lib/libstdc++.la + -ln -sv $(TOOLS_DIR)/bin/{bash,cat,echo,pwd,stty} /bin + -ln -sv $(TOOLS_DIR)/bin/perl /usr/bin + -ln -sv $(TOOLS_DIR)/lib/libgcc_s.so{,.1} /usr/lib + -ln -sv $(TOOLS_DIR)/lib/libstdc++.so{,.6} /usr/lib + sed 's@$(TOOLS_DIR)@/usr@' $(TOOLS_DIR)/lib/libstdc++.la > /usr/lib/libstdc++.la -ln -sv bash /bin/sh # Config files diff --git a/lfs/strip b/lfs/strip index 237f4d2b3b..9fbdf76274 100644 --- a/lfs/strip +++ b/lfs/strip @@ -50,5 +50,5 @@ $(TARGET) : # which does not work when unneeded symbols get stripped from # /usr/sbin/vdr. $(DIR_SRC)/src/stripper $(ROOT) \ - --exclude=/usr/src --exclude=/tools \ + --exclude=/usr/src --exclude=$(TOOLS_DIR) \ --exclude=/usr/sbin/vdr --exclude=/usr/lib/vdr diff --git a/lfs/tar b/lfs/tar index d701dd0e97..2cca09935c 100644 --- a/lfs/tar +++ b/lfs/tar @@ -31,7 +31,7 @@ DL_FILE = $(THISAPP).tar.bz2 DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/$(THISAPP) -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) @@ -41,7 +41,7 @@ ifeq "$(ROOT)" "" EXTRA_INSTALL = else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools --disable-nls + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls EXTRA_MAKE = EXTRA_INSTALL = endif diff --git a/lfs/tcl b/lfs/tcl index 06e9e08356..7762a1dc8f 100644 --- a/lfs/tcl +++ b/lfs/tcl @@ -76,7 +76,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @$(PREBUILD) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) ifneq "$(ROOT)" "" - cd $(DIR_APP)/unix && ./configure --prefix=/tools --disable-nls + cd $(DIR_APP)/unix && ./configure --prefix=$(TOOLS_DIR) --disable-nls else cd $(DIR_APP)/unix && ./configure --prefix=/usr --disable-nls endif @@ -84,7 +84,7 @@ endif cd $(DIR_APP)/unix && make install ifneq "$(ROOT)" "" cd $(DIR_APP)/unix && make install-private-headers - ln -sf tclsh8.6 /tools/bin/tclsh + ln -sf tclsh8.6 $(TOOLS_DIR)/bin/tclsh else ln -sf tclsh8.6 /usr/bin/tclsh endif diff --git a/lfs/texinfo b/lfs/texinfo index 95e244a526..8927156449 100644 --- a/lfs/texinfo +++ b/lfs/texinfo @@ -31,14 +31,14 @@ DL_FILE = $(THISAPP).tar.xz DL_FROM = $(URL_IPFIRE) DIR_APP = $(DIR_SRC)/texinfo-6.3 -# Normal build or /tools build. +# Normal build or $(TOOLS_DIR) build. # ifeq "$(ROOT)" "" TARGET = $(DIR_INFO)/$(THISAPP) EXTRA_CONFIG = --prefix=/usr else TARGET = $(DIR_INFO)/$(THISAPP)-tools - EXTRA_CONFIG = --prefix=/tools + EXTRA_CONFIG = --prefix=$(TOOLS_DIR) endif ############################################################################### diff --git a/lfs/xz b/lfs/xz index a0da50a193..219c160b9a 100644 --- a/lfs/xz +++ b/lfs/xz @@ -35,7 +35,7 @@ ifeq "$(ROOT)" "" PREFIX = /usr TARGET = $(DIR_INFO)/$(THISAPP) else - PREFIX = /tools + PREFIX = $(TOOLS_DIR) TARGET = $(DIR_INFO)/$(THISAPP)-tools endif diff --git a/make.sh b/make.sh index b13e455c65..78ff23671b 100755 --- a/make.sh +++ b/make.sh @@ -37,7 +37,7 @@ KVER=`grep --max-count=1 VER lfs/linux | awk '{ print $3 }'` GIT_TAG=$(git tag | tail -1) # Git Tag GIT_LASTCOMMIT=$(git log | head -n1 | cut -d" " -f2 |head -c8) # Last commit -TOOLCHAINVER=20170705 +TOOLCHAINVER=20171121 # New architecture variables HOST_ARCH="$(uname -m)" @@ -163,15 +163,17 @@ prepareenv() { # Set LFS Directory LFS=$BASEDIR/build - # Check /tools symlink - if [ -h /tools ]; then - rm -f /tools + # Check ${TOOLS_DIR} symlink + if [ -h "${TOOLS_DIR}" ]; then + rm -f "${TOOLS_DIR}" fi - if [ ! -a /tools ]; then - ln -s $BASEDIR/build/tools / + + if [ ! -e "${TOOLS_DIR}" ]; then + ln -s "${BASEDIR}/build${TOOLS_DIR}" "${TOOLS_DIR}" fi - if [ ! -h /tools ]; then - exiterror "Could not create /tools symbolic link." + + if [ ! -h "${TOOLS_DIR}" ]; then + exiterror "Could not create ${TOOLS_DIR} symbolic link" fi # Setup environment @@ -181,7 +183,8 @@ prepareenv() { unset CC CXX CPP LD_LIBRARY_PATH LD_PRELOAD # Make some extra directories - mkdir -p $BASEDIR/build/{tools,etc,usr/src} 2>/dev/null + mkdir -p "${BASEDIR}/build${TOOLS_DIR}" 2>/dev/null + mkdir -p $BASEDIR/build/{etc,usr/src} 2>/dev/null mkdir -p $BASEDIR/build/{dev/{shm,pts},proc,sys} mkdir -p $BASEDIR/{cache,ccache} 2>/dev/null mkdir -p $BASEDIR/build/usr/src/{cache,config,doc,html,langs,lfs,log,src,ccache} @@ -1002,7 +1005,7 @@ build) clear PACKAGE=`ls -v -r $BASEDIR/cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz 2> /dev/null | head -n 1` #only restore on a clean disk - if [ ! -e "${BASEDIR}/build/tools/.toolchain-successful" ]; then + if [ ! -e "${BASEDIR}/build${TOOLS_DIR}/.toolchain-successful" ]; then if [ ! -n "$PACKAGE" ]; then beautify build_stage "Full toolchain compilation" prepareenv @@ -1070,8 +1073,8 @@ clean) rm -rf $BASEDIR/cdrom rm -rf $BASEDIR/packages rm -rf $BASEDIR/log - if [ -h /tools ]; then - rm -f /tools + if [ -h "${TOOLS_DIR}" ]; then + rm -f "${TOOLS_DIR}" fi rm -f $BASEDIR/ipfire-* beautify message DONE @@ -1138,7 +1141,7 @@ toolchain) echo "`date -u '+%b %e %T'`: Create toolchain tar.gz for ${BUILD_ARCH}" | tee -a $LOGFILE test -d $BASEDIR/cache/toolchains || mkdir -p $BASEDIR/cache/toolchains cd $BASEDIR && tar -zc --exclude='log/_build.*.log' -f cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz \ - build/tools build/bin/sh log >> $LOGFILE + build/${TOOLS_DIR} build/bin/sh log >> $LOGFILE md5sum cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.tar.gz \ > cache/toolchains/$SNAME-$VERSION-toolchain-$TOOLCHAINVER-${BUILD_ARCH}.md5 stdumount diff --git a/src/stripper b/src/stripper index d73848fc6e..f121d35919 100755 --- a/src/stripper +++ b/src/stripper @@ -1,4 +1,4 @@ -#!/tools/bin/bash +#!/usr/bin/env bash dirs="" excludes="/dev /proc /sys /run" diff --git a/tools/make-functions b/tools/make-functions index 439298b3fd..6ef1d11534 100644 --- a/tools/make-functions +++ b/tools/make-functions @@ -138,6 +138,7 @@ configure_build() { fi BUILD_ARCH="${build_arch}" + TOOLS_DIR="/tools_${BUILD_ARCH}" # Enables hardening HARDENING_CFLAGS="-Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4" @@ -385,9 +386,9 @@ exiterror() { } fake_environ() { - [ -e "${BASEDIR}/build/tools/lib/libpakfire_preload.so" ] || return + [ -e "${BASEDIR}/build${TOOLS_DIR}/lib/libpakfire_preload.so" ] || return - local env="LD_PRELOAD=/tools/lib/libpakfire_preload.so" + local env="LD_PRELOAD=${TOOLS_DIR}/lib/libpakfire_preload.so" # Fake kernel version, because some of the packages do not compile # with kernel 3.0 and later. @@ -528,7 +529,7 @@ enterchroot() { # Install QEMU helper, if needed qemu_install_helper - local PATH="/tools/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin" + local PATH="${TOOLS_DIR}/ccache/bin:/bin:/usr/bin:/sbin:/usr/sbin:${TOOLS_DIR}/bin" PATH="${PATH}" chroot ${LFS} env -i \ HOME="/root" \ @@ -542,6 +543,7 @@ enterchroot() { VERSION="${VERSION}" \ CORE="${CORE}" \ SLOGAN="${SLOGAN}" \ + TOOLS_DIR="${TOOLS_DIR}" \ CONFIG_ROOT="${CONFIG_ROOT}" \ CFLAGS="${CFLAGS} ${HARDENING_CFLAGS}" \ CXXFLAGS="${CXXFLAGS} ${HARDENING_CFLAGS}" \ @@ -640,7 +642,7 @@ lfsmake1() { local PKG_TIME_START=`date +%s` cd $BASEDIR/lfs && env -i \ - PATH="/tools/ccache/bin:/tools/bin:$PATH" \ + PATH="${TOOLS_DIR}/ccache/bin:${TOOLS_DIR}/bin:$PATH" \ CCACHE_DIR="${CCACHE_DIR}" \ CCACHE_COMPRESS="${CCACHE_COMPRESS}" \ CCACHE_COMPILERCHECK="${CCACHE_COMPILERCHECK}" \ @@ -649,6 +651,7 @@ lfsmake1() { MAKETUNING="${MAKETUNING}" \ make -f $* \ TOOLCHAIN=1 \ + TOOLS_DIR="${TOOLS_DIR}" \ CROSSTARGET="${CROSSTARGET}" \ BUILDTARGET="${BUILDTARGET}" \ BUILD_ARCH="${BUILD_ARCH}" \ -- 2.39.2