]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Move toolchain from /tools to /tools_${arch}
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Nov 2017 11:39:23 +0000 (11:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 23 Nov 2017 15:57:28 +0000 (15:57 +0000)
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 <michael.tremer@ipfire.org>
39 files changed:
lfs/Config
lfs/automake
lfs/bash
lfs/binutils
lfs/bzip2
lfs/ccache
lfs/cleanup-toolchain
lfs/coreutils
lfs/dejagnu
lfs/diffutils
lfs/expect
lfs/fake-environ
lfs/findutils
lfs/flex
lfs/gawk
lfs/gcc
lfs/gettext
lfs/glibc
lfs/grep
lfs/gzip
lfs/linux
lfs/m4
lfs/make
lfs/ncurses
lfs/ncurses-compat
lfs/patch
lfs/perl
lfs/pkg-config
lfs/sed
lfs/stage1
lfs/stage2
lfs/strip
lfs/tar
lfs/tcl
lfs/texinfo
lfs/xz
make.sh
src/stripper
tools/make-functions

index e647e753f2e2955f70faa4bb25857d40e407ebf3..a45b76b995d00e1ca0688180427639ef089bd51f 100644 (file)
@@ -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
index a372443b3273e37addf53181d115cae6cadc1c4c..15bdad1e5e866d435813cdb139826fc1d56aefe4 100644 (file)
@@ -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
 
index e98b6fdba8a1bc3ce02cabecfc8bac065dc45a6d..99a293dbb6b9753ccb6e3f6c1ad5ab0a21a76bd9 100644 (file)
--- 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
index 79ac96b3e20f7d57abed3785398ed675de4ff8b8..79b208d080736a4bf1435afa751b88f0231e7732 100644 (file)
@@ -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
 
index 44fa7575e0009146ffc730bcd983caff9d486285..89f0ca7adcddd464e65937848f7a15c4d4744480 100644 (file)
--- 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)
index f7da652ad826fc299bc8e39cce0cecbdeb5badff..470890d65eb0376c1f5105ebfe85a60676da77c0 100644 (file)
@@ -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
 
index 91e056ed8348aafac07054824d988913204c47f5..1c1fa8a50eda33426d99e0d3e8fe4aa142aa00e2 100644 (file)
@@ -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
index 324dc780892b49330afa7a9856f89cebfe9c4dcf..904bd2bdf16ec65851805cc3c682ed70cdd3fcc9 100644 (file)
@@ -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 += \
index b5105652beb35ecb48f530fe3e0b8b971ec7e690..3623c9b99c75fbbbf157a9cff2f87261faeeb650 100644 (file)
@@ -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)
index c8dc42f9090dc970e8f911f35eb7b38636dae936..d3e957d82a8dea65c2dae414d1134a16cae386c4 100644 (file)
@@ -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
index 93d6fe6e6aa3768cedd67f8871ac2eef1f2172c1..2ebd6a8f574096a8e374a4da5a104a8f4cd21bfe 100644 (file)
@@ -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)
index 978a90d9bc9c0db1e1250d514d07f9203ca237cf..7c8dd066401c326015ddcc0efeb6965df5efa3d0 100644 (file)
@@ -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)
index d1a520b3f6837b01dcded126413d21ad7dcfe3fa..6b9e0fc74d285728260e725861837aca97d6f9b4 100644 (file)
@@ -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
index 4b1a75b098c5b890d95eec73e9d801ef9ca91931..f3cc095b99aee82c3122c38af88fdeb8db3d20d4 100644 (file)
--- 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
index 62bad0164e84facad0201458f1629159a9c17731..cfa106d836eb9eade276c5306049199901e55fa0 100644 (file)
--- 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 9325792ffe944e53e3cd96713b61cf337a82b1ac..9cc6ce3359ae4e6e5f48853f8ec4f8337d32f3c3 100644 (file)
--- 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
index 3896ec12f1dc41a1a740fd2fa4bd15e8296bcd1f..e4eeb7299ac952e36ff023f2baf466bac284fb64 100644 (file)
@@ -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)
index 122aca58fdd6b6927770d3473be865a7ceb65260..061bf8c2b47ed42b361c9a88452c013f580dce21 100644 (file)
--- 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
 
index 5ac45c15a45cf9470e647f24ae1c3ee0ee7e2bdc..3c3d9769636f1ad89c6bdcaded9acfc08dc4cfb9 100644 (file)
--- 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
index e61d78a8c6b33db20908320c6d635003e0d7aeca..12fae78e9436641a914540f7d5bd88a5750b53ff 100644 (file)
--- 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
 
 ###############################################################################
index b3ccb7af9a74dfbcda67d4f9f01be13b6853ba49..c74051250f89dc42462dc98c96f4a054bf98dd96 100644 (file)
--- 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 55cc4c3ce5c2149ac431ea5176a90d1bddcdbed9..3864d42158f97eecf9ad4c0f9c0bb120935da348 100644 (file)
--- 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
 
index 213ef9ae7687b1949991a0ed87f291107a915104..979357eca3ef95059ce45f89c2bcfd77ca0158e7 100644 (file)
--- 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
index 1d8fd40d2181e0da29b9e42f514833686628cabd..1186b5244f3aeea2a12cc1c7f8deb37269238347 100644 (file)
@@ -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)
index 09ec434850925ca30a71ca4961551230565a5210..14807367f10e93de2ce48d09e750c50da9069146 100644 (file)
@@ -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 += \
index 88adf25f4e7721a3f65f086954ca7ec8dd882b86..c938ac8faacec50f96c1422722b77cf513a74844 100644 (file)
--- 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
index 9ab8efae4e4bcb96ccd9266162beb8d4c24ddbee..0c239318c3915cdfbad3ff602b075bb425513bf3 100644 (file)
--- 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)
index 36fb40ae9cd97fe4007bf71e070d59e23ce769ec..fe2752a0dca625af01e3c51083379a49dc90ff1a 100644 (file)
@@ -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 77eba0bc63441b90418fc95674fd1e0141082231..3ac39a71cd8cdb385cd04648386a2887b0ab01de 100644 (file)
--- 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
index c4c578411eb19980033dddb1335a98bc73569338..99e3edbbdd97c8fbc9459a1f7ed2a2935691bade 100644 (file)
@@ -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)
index 0a5ac65c09a3f641d2f549751b8b8b07220bc61b..4ab5edd8b59909e849d7446f992e0714800e93b2 100644 (file)
@@ -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
index 237f4d2b3b5a243a007c89b886f6d3a01326a038..9fbdf762746271e2e9f33f97e93d84019d4d4d44 100644 (file)
--- 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 d701dd0e97928d9302f098ded293b308c664f3e7..2cca09935ce35dc7c758ad20b1422a917a5e973b 100644 (file)
--- 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 06e9e08356bcb5a2bce776e818a88901b188775c..7762a1dc8f30984c3e50258262cdd796ef32a450 100644 (file)
--- 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
index 95e244a5260f9724bed7e01d04dedf3bb1ddd187..8927156449752be561b8a6f54ee222d40e8e8540 100644 (file)
@@ -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 a0da50a193fafb033455b6a9fc154c8721783073..219c160b9a3982a6da766575816b3393fe180676 100644 (file)
--- 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 b13e455c655a0b04d274e6c6c08b02d153d41ad4..78ff23671b5fc4be3342299b104a78406bc99d48 100755 (executable)
--- 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
index d73848fc6e7491e4b2d11a6889d3994e50f9853e..f121d35919fb967c6469c54b32d4f791ea631480 100755 (executable)
@@ -1,4 +1,4 @@
-#!/tools/bin/bash
+#!/usr/bin/env bash
 
 dirs=""
 excludes="/dev /proc /sys /run"
index 439298b3fd03171cfb32245db6c6f669c9c1b993..6ef1d115342a2340743fcae6950813e00062ae1d 100644 (file)
@@ -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}" \