###############################################################################
# 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
#
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
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
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)
--with-installed-readline
else
TARGET = $(DIR_INFO)/$(THISAPP)-tools
- CONFIGURE_OPTIONS = --prefix=/tools
+ CONFIGURE_OPTIONS = --prefix=$(TOOLS_DIR)
endif
CONFIGURE_OPTIONS += \
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
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)
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
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
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
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)
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)
$(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
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
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 += \
$(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)
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_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
@$(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)
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)
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_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
$(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
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
###############################################################################
FULL_BOOTSTRAP = 1
endif
-# Normal build or /tools build.
+# Normal build or $(TOOLS_DIR) build.
#
ifeq "$(ROOT)" ""
TARGET = $(DIR_INFO)/$(THISAPP)
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 \
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
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
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
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
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_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
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)
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 = \
--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
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
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
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
###############################################################################
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
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_MAKE =
else
TARGET = $(DIR_INFO)/$(THISAPP)-tools
- EXTRA_CONFIG = --prefix=/tools --disable-nls
+ EXTRA_CONFIG = --prefix=$(TOOLS_DIR) --disable-nls
EXTRA_MAKE =
endif
DEPS = ""
-# Normal build or /tools build.
+# Normal build or $(TOOLS_DIR) build.
#
ifeq "$(ROOT)" ""
TARGET = $(DIR_INFO)/$(THISAPP)
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
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
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)
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 += \
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_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
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)
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)
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
###############################################################################
@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)
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_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
$(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)
# 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
# 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
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_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
@$(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
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
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
###############################################################################
PREFIX = /usr
TARGET = $(DIR_INFO)/$(THISAPP)
else
- PREFIX = /tools
+ PREFIX = $(TOOLS_DIR)
TARGET = $(DIR_INFO)/$(THISAPP)-tools
endif
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)"
# 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
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}
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
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
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
-#!/tools/bin/bash
+#!/usr/bin/env bash
dirs=""
excludes="/dev /proc /sys /run"
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"
}
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.
# 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" \
VERSION="${VERSION}" \
CORE="${CORE}" \
SLOGAN="${SLOGAN}" \
+ TOOLS_DIR="${TOOLS_DIR}" \
CONFIG_ROOT="${CONFIG_ROOT}" \
CFLAGS="${CFLAGS} ${HARDENING_CFLAGS}" \
CXXFLAGS="${CXXFLAGS} ${HARDENING_CFLAGS}" \
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}" \
MAKETUNING="${MAKETUNING}" \
make -f $* \
TOOLCHAIN=1 \
+ TOOLS_DIR="${TOOLS_DIR}" \
CROSSTARGET="${CROSSTARGET}" \
BUILDTARGET="${BUILDTARGET}" \
BUILD_ARCH="${BUILD_ARCH}" \