mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
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 <michael.tremer@ipfire.org>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
8
lfs/bash
8
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
|
||||
|
||||
12
lfs/binutils
12
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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
28
lfs/ccache
28
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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 += \
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
2
lfs/flex
2
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
|
||||
|
||||
4
lfs/gawk
4
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
|
||||
|
||||
###############################################################################
|
||||
|
||||
34
lfs/gcc
34
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
|
||||
|
||||
@@ -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)
|
||||
|
||||
10
lfs/glibc
10
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
|
||||
|
||||
|
||||
4
lfs/grep
4
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
|
||||
|
||||
4
lfs/gzip
4
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
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -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
|
||||
|
||||
4
lfs/m4
4
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
|
||||
|
||||
|
||||
4
lfs/make
4
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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 += \
|
||||
|
||||
@@ -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
|
||||
|
||||
10
lfs/perl
10
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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
4
lfs/sed
4
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
|
||||
|
||||
@@ -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)
|
||||
|
||||
10
lfs/stage2
10
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
|
||||
|
||||
@@ -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
|
||||
|
||||
4
lfs/tar
4
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
|
||||
|
||||
4
lfs/tcl
4
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
|
||||
|
||||
@@ -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
|
||||
|
||||
###############################################################################
|
||||
|
||||
2
lfs/xz
2
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
|
||||
|
||||
|
||||
29
make.sh
29
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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/tools/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
dirs=""
|
||||
excludes="/dev /proc /sys /run"
|
||||
|
||||
@@ -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}" \
|
||||
|
||||
Reference in New Issue
Block a user