toolchain: fix the sysroot mess by getting rid of $(TOOLCHAIN_DIR)/usr and moving it back to $(TOOLCHAIN_DIR), this change makes the toolchain relocatable again, which should fix the SDK

SVN-Revision: 22723
This commit is contained in:
Felix Fietkau 2010-08-19 12:49:51 +00:00
parent d9e0d5705a
commit 62c1740676
12 changed files with 66 additions and 68 deletions

View File

@ -402,7 +402,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
define Package/libstdcpp/install define Package/libstdcpp/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(TOOLCHAIN_DIR)/usr/lib/libstdc++.so.* $(1)/usr/lib/ $(CP) $(TOOLCHAIN_DIR)/lib/libstdc++.so.* $(1)/usr/lib/
endef endef
use_libutil=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),libutil) use_libutil=$(if $(CONFIG_USE_GLIBC)$(CONFIG_EGLIBC_OPTION_EGLIBC_UTMP),libutil)
@ -450,11 +450,11 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
endef endef
define Package/libc/install_lib define Package/libc/install_lib
$(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/usr/lib/lib*.a)) $(1)/lib/ $(CP) $(filter-out %/libdl_pic.a %/libpthread_pic.a %/libresolv_pic.a,$(wildcard $(TOOLCHAIN_DIR)/lib/lib*.a)) $(1)/lib/
$(if $(wildcard $(TOOLCHAIN_DIR)/usr/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/usr/lib/libc_so.a $(1)/lib/libc_pic.a) $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libc_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libc_so.a $(1)/lib/libc_pic.a)
$(if $(wildcard $(TOOLCHAIN_DIR)/usr/lib/gcc/*/*/libgcc.map), \ $(if $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map), \
$(CP) $(TOOLCHAIN_DIR)/usr/lib/gcc/*/*/libgcc_pic.a $(1)/lib/libgcc_s_pic.a; \ $(CP) $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a $(1)/lib/libgcc_s_pic.a; \
$(CP) $(TOOLCHAIN_DIR)/usr/lib/gcc/*/*/libgcc.map $(1)/lib/libgcc_s_pic.map \ $(CP) $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map $(1)/lib/libgcc_s_pic.map \
) )
endef endef
@ -467,7 +467,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
endef endef
define Package/libpthread/install_lib define Package/libpthread/install_lib
$(if $(wildcard $(TOOLCHAIN_DIR)/usr/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/usr/lib/libpthread_so.a $(1)/lib/libpthread_pic.a) $(if $(wildcard $(TOOLCHAIN_DIR)/lib/libpthread_so.a),$(CP) $(TOOLCHAIN_DIR)/lib/libpthread_so.a $(1)/lib/libpthread_pic.a)
endef endef
define Package/librt/install define Package/librt/install
@ -480,7 +480,7 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
define Package/ldd/install define Package/ldd/install
$(INSTALL_DIR) $(1)/usr/bin/ $(INSTALL_DIR) $(1)/usr/bin/
$(CP) $(TOOLCHAIN_DIR)/usr/bin/ldd $(1)/usr/bin/ $(CP) $(TOOLCHAIN_DIR)/bin/ldd $(1)/usr/bin/
endef endef
define Package/ldconfig/install define Package/ldconfig/install

View File

@ -114,7 +114,7 @@ ifndef DUMP
TARGET_CFLAGS+= -fhonour-copts TARGET_CFLAGS+= -fhonour-copts
TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/usr/include -I$(TOOLCHAIN_DIR)/include TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/usr/include -I$(TOOLCHAIN_DIR)/include
TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib
TARGET_PATH:=$(TOOLCHAIN_DIR)/usr/bin:$(TARGET_PATH) TARGET_PATH:=$(TOOLCHAIN_DIR)/bin:$(TARGET_PATH)
else else
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
TARGET_CROSS:=$(call qstrip,$(CONFIG_TOOLCHAIN_PREFIX)) TARGET_CROSS:=$(call qstrip,$(CONFIG_TOOLCHAIN_PREFIX))

View File

@ -41,7 +41,7 @@ include $(INCLUDE_DIR)/toolchain-build.mk
BINUTILS_CONFIGURE:= \ BINUTILS_CONFIGURE:= \
./configure \ ./configure \
--prefix=$(TOOLCHAIN_DIR)/usr \ --prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \
@ -84,7 +84,7 @@ endef
define Host/Install define Host/Install
$(MAKE) -C $(HOST_BUILD_DIR) install $(MAKE) -C $(HOST_BUILD_DIR) install
$(CP) $(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf $(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(REAL_STAGING_DIR_HOST)/bin/readelf
endef endef
define Host/Clean define Host/Clean

View File

@ -62,10 +62,10 @@ EGLIBC_CONFIGURE:= \
CFLAGS="$(EGLIBC_CFLAGS)" \ CFLAGS="$(EGLIBC_CFLAGS)" \
libc_cv_slibdir="/lib" \ libc_cv_slibdir="/lib" \
$(HOST_BUILD_DIR)/libc/configure \ $(HOST_BUILD_DIR)/libc/configure \
--prefix=/usr \ --prefix= \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \ --host=$(REAL_GNU_TARGET_NAME) \
--with-headers=$(TOOLCHAIN_DIR)/usr/include \ --with-headers=$(TOOLCHAIN_DIR)/include \
--disable-profile \ --disable-profile \
--without-gd \ --without-gd \
--without-cvs \ --without-cvs \
@ -102,7 +102,7 @@ define Stage1/Compile
endef endef
define Stage1/Install define Stage1/Install
mkdir -p $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/{include,lib} mkdir -p $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/{include,lib}
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \ $(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \
install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \ install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \
install-bootstrap-headers=yes \ install-bootstrap-headers=yes \
@ -110,10 +110,10 @@ define Stage1/Install
$(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \ $(EGLIBC_MAKE) -C $(HOST_BUILD_DIR1) \
csu/subdir_lib csu/subdir_lib
( cd $(HOST_BUILD_DIR1); \ ( cd $(HOST_BUILD_DIR1); \
$(CP) csu/crt1.o csu/crti.o csu/crtn.o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/lib/ \ $(CP) csu/crt1.o csu/crti.o csu/crtn.o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/ \
) )
$(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \ $(TARGET_CC) -nostdlib -nostartfiles -shared -x c /dev/null \
-o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/lib/libc.so -o $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/lib/libc.so
endef endef
define Stage2/Configure define Stage2/Configure

View File

@ -104,7 +104,7 @@ export libgcc_cv_fixed_point=no
GCC_CONFIGURE:= \ GCC_CONFIGURE:= \
SHELL="$(BASH)" \ SHELL="$(BASH)" \
$(HOST_SOURCE_DIR)/configure \ $(HOST_SOURCE_DIR)/configure \
--prefix=$(TOOLCHAIN_DIR)/usr \ --prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \
@ -187,7 +187,7 @@ define Host/Clean
$(STAGING_DIR_HOST)/stamp/.binutils_* \ $(STAGING_DIR_HOST)/stamp/.binutils_* \
$(GCC_BUILD_DIR) \ $(GCC_BUILD_DIR) \
$(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \ $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) \
$(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME) \ $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME) \
$(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-gc* \ $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-gc* \
$(TOOLCHAIN_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-c* $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-c*
endef endef

View File

@ -23,13 +23,13 @@ else
endif endif
define Host/Configure define Host/Configure
mkdir -p $(GCC_BUILD_DIR) $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME) mkdir -p $(GCC_BUILD_DIR) $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)
# Important! Required for limits.h to be fixed. # Important! Required for limits.h to be fixed.
rm -rf $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
ln -sf ../include $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/sys-include ln -sf ../include $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
rm -rf $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib rm -rf $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib
ln -sf ../lib $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib ln -sf ../lib $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib
$(if $(CONFIG_mips64)$(CONFIG_mips64el)$(CONFIG_x86_64),ln -sf ../lib64 $(TOOLCHAIN_DIR)/usr/$(REAL_GNU_TARGET_NAME)/lib64) $(if $(CONFIG_mips64)$(CONFIG_mips64el)$(CONFIG_x86_64),ln -sf ../lib64 $(TOOLCHAIN_DIR)/$(REAL_GNU_TARGET_NAME)/lib64)
(cd $(GCC_BUILD_DIR) && rm -f config.cache; \ (cd $(GCC_BUILD_DIR) && rm -f config.cache; \
$(GCC_CONFIGURE) \ $(GCC_CONFIGURE) \
); );
@ -40,15 +40,15 @@ define Host/Compile
endef endef
define SetupExtraArch define SetupExtraArch
for app in $(TOOLCHAIN_DIR)/usr/bin/$(OPTIMIZE_FOR_CPU)*-{gcc,gcc-*,g++}; do \ for app in $(TOOLCHAIN_DIR)/bin/$(OPTIMIZE_FOR_CPU)*-{gcc,gcc-*,g++}; do \
[ -e $$$$app ] || continue; \ [ -e $$$$app ] || continue; \
old_base=$$$$(basename $$$$app); \ old_base=$$$$(basename $$$$app); \
new_base=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-$$$${old_base##$(OPTIMIZE_FOR_CPU)-}; \ new_base=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-$$$${old_base##$(OPTIMIZE_FOR_CPU)-}; \
sed -e "s/@CC_BASE@/$$$$old_base/" \ sed -e "s/@CC_BASE@/$$$$old_base/" \
-e 's/@EXTRA_ARCH_OPTS@/$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_OPTS))/' \ -e 's/@EXTRA_ARCH_OPTS@/$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_OPTS))/' \
../files/alternate-arch-cc.in > \ ../files/alternate-arch-cc.in > \
$(TOOLCHAIN_DIR)/usr/bin/$$$$new_base; \ $(TOOLCHAIN_DIR)/bin/$$$$new_base; \
chmod a+x $(TOOLCHAIN_DIR)/usr/bin/$$$$new_base; \ chmod a+x $(TOOLCHAIN_DIR)/bin/$$$$new_base; \
done done
endef endef
@ -56,7 +56,7 @@ define Host/Install
$(_SINGLE)$(GCC_MAKE) -C $(GCC_BUILD_DIR) install $(_SINGLE)$(GCC_MAKE) -C $(GCC_BUILD_DIR) install
# Set up the symlinks to enable lying about target name. # Set up the symlinks to enable lying about target name.
set -e; \ set -e; \
(cd $(TOOLCHAIN_DIR)/usr; \ (cd $(TOOLCHAIN_DIR); \
ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \ ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
cd bin; \ cd bin; \
for app in $(REAL_GNU_TARGET_NAME)-* ; do \ for app in $(REAL_GNU_TARGET_NAME)-* ; do \

View File

@ -4,7 +4,7 @@ include ../common.mk
GCC_CONFIGURE += \ GCC_CONFIGURE += \
--with-newlib \ --with-newlib \
--with-sysroot=$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev \ --with-sysroot=$(TOOLCHAIN_DIR) \
--enable-languages=c \ --enable-languages=c \
--disable-shared \ --disable-shared \
--disable-threads \ --disable-threads \
@ -23,7 +23,7 @@ define Host/Install
$(if $(GCC_BUILD_TARGET_LIBGCC),install-target-libgcc) $(if $(GCC_BUILD_TARGET_LIBGCC),install-target-libgcc)
# XXX: glibc insists on linking against libgcc_eh # XXX: glibc insists on linking against libgcc_eh
( cd $(TOOLCHAIN_DIR)/usr/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) ; \ ( cd $(TOOLCHAIN_DIR)/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) ; \
[ -e libgcc_eh.a ] || ln -sf libgcc.a libgcc_eh.a ; \ [ -e libgcc_eh.a ] || ln -sf libgcc.a libgcc_eh.a ; \
cp libgcc.a libgcc_initial.a; \ cp libgcc.a libgcc_initial.a; \
) )

View File

@ -20,7 +20,7 @@ define Host/Configure
gdb_cv_func_sigsetjmp=yes \ gdb_cv_func_sigsetjmp=yes \
CFLAGS="-O2" \ CFLAGS="-O2" \
$(HOST_BUILD_DIR)/configure \ $(HOST_BUILD_DIR)/configure \
--prefix=$(TOOLCHAIN_DIR)/usr \ --prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \
@ -38,17 +38,17 @@ define Host/Compile
endef endef
define Host/Install define Host/Install
mkdir -p $(TOOLCHAIN_DIR)/usr/bin mkdir -p $(TOOLCHAIN_DIR)/bin
$(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
strip $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
endef endef
define Host/Clean define Host/Clean
rm -rf \ rm -rf \
$(HOST_BUILD_DIR) \ $(HOST_BUILD_DIR) \
$(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)gdb \ $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb \
$(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
endef endef
$(eval $(call HostBuild)) $(eval $(call HostBuild))

View File

@ -57,10 +57,10 @@ GLIBC_CONFIGURE:= \
libc_cv_386_tls=yes \ libc_cv_386_tls=yes \
libc_cv_slibdir="/lib" \ libc_cv_slibdir="/lib" \
$(HOST_BUILD_DIR)/configure \ $(HOST_BUILD_DIR)/configure \
--prefix=/usr \ --prefix=/ \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--host=$(REAL_GNU_TARGET_NAME) \ --host=$(REAL_GNU_TARGET_NAME) \
--with-headers="$(TOOLCHAIN_DIR)/usr/include" \ --with-headers="$(TOOLCHAIN_DIR)/include" \
$(if $(CONFIG_mips64)$(CONFIG_mips64el), --enable-kernel="2.6.0") \ $(if $(CONFIG_mips64)$(CONFIG_mips64el), --enable-kernel="2.6.0") \
--disable-debug \ --disable-debug \
--disable-profile \ --disable-profile \
@ -111,11 +111,11 @@ define Stage1/Install
cross-compiling=yes \ cross-compiling=yes \
install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \ install_root="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev" \
install-headers install-headers
[ -f $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/bits/stdio_lim.h ] || \ [ -f $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/include/bits/stdio_lim.h ] || \
$(CP) $(HOST_BUILD_DIR1)/bits/stdio_lim.h \ $(CP) $(HOST_BUILD_DIR1)/bits/stdio_lim.h \
$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/bits/stdio_lim.h $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/include/bits/stdio_lim.h
[ -f $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/gnu/stubs.h ] || \ [ -f $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/include/gnu/stubs.h ] || \
touch $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/usr/include/gnu/stubs.h touch $(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/include/gnu/stubs.h
endef endef
define Stage2/Configure define Stage2/Configure

View File

@ -24,7 +24,7 @@ define Host/Configure
gdb_cv_func_sigsetjmp=yes \ gdb_cv_func_sigsetjmp=yes \
CFLAGS="-O2" \ CFLAGS="-O2" \
$(HOST_BUILD_DIR)/configure \ $(HOST_BUILD_DIR)/configure \
--prefix=$(TOOLCHAIN_DIR)/usr \ --prefix=$(TOOLCHAIN_DIR) \
--build=$(GNU_HOST_NAME) \ --build=$(GNU_HOST_NAME) \
--host=$(GNU_HOST_NAME) \ --host=$(GNU_HOST_NAME) \
--target=$(REAL_GNU_TARGET_NAME) \ --target=$(REAL_GNU_TARGET_NAME) \
@ -39,17 +39,17 @@ define Host/Compile
endef endef
define Host/Install define Host/Install
mkdir -p $(TOOLCHAIN_DIR)/usr/bin mkdir -p $(TOOLCHAIN_DIR)/bin
$(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/insight $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)insight $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/insight $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)insight
ln -fs $(TARGET_CROSS)insight $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-insight ln -fs $(TARGET_CROSS)insight $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-insight
strip $(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)insight strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)insight
endef endef
define Host/Clean define Host/Clean
rm -rf \ rm -rf \
$(HOST_BUILD_DIR) \ $(HOST_BUILD_DIR) \
$(TOOLCHAIN_DIR)/usr/bin/$(TARGET_CROSS)insight \ $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)insight \
$(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-insight $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-insight
endef endef
$(eval $(call HostBuild)) $(eval $(call HostBuild))

View File

@ -42,9 +42,9 @@ KMAKE := $(MAKE) -C $(HOST_BUILD_DIR) \
CONFIG_SHELL=$(BASH) CONFIG_SHELL=$(BASH)
define Host/Prepare/all define Host/Prepare/all
mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr mkdir -p $(BUILD_DIR_TOOLCHAIN)/linux-dev
$(KMAKE) \ $(KMAKE) \
INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/" \ INSTALL_HDR_PATH="$(BUILD_DIR_TOOLCHAIN)/linux-dev/" \
headers_install headers_install
if [ -d $(HOST_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm ]; then \ if [ -d $(HOST_BUILD_DIR)/arch/$(LINUX_KARCH)/include/asm ]; then \
mkdir -p $(HOST_BUILD_DIR)/include/asm-$(LINUX_KARCH); \ mkdir -p $(HOST_BUILD_DIR)/include/asm-$(LINUX_KARCH); \
@ -59,16 +59,16 @@ define Host/Prepare/lzma
$(CP) \ $(CP) \
$(HOST_BUILD_DIR)/include/asm-mips/asm.h \ $(HOST_BUILD_DIR)/include/asm-mips/asm.h \
$(HOST_BUILD_DIR)/include/asm-mips/regdef.h \ $(HOST_BUILD_DIR)/include/asm-mips/regdef.h \
$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/ $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/
endef endef
define Host/Prepare/post/cris define Host/Prepare/post/cris
$(CP) \ $(CP) \
$(HOST_BUILD_DIR)/include/linux/user.h \ $(HOST_BUILD_DIR)/include/linux/user.h \
$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/linux/ $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/linux/
ln -snf $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/arch-v10/arch \ ln -snf $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/arch-v10/arch \
$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/arch $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/arch
$(SED) '/#include <asm\/page\.h>/d' $(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/user.h $(SED) '/#include <asm\/page\.h>/d' $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/user.h
endef endef
define Host/Prepare/post/ubicom32 define Host/Prepare/post/ubicom32
@ -77,7 +77,7 @@ define Host/Prepare/post/ubicom32
$(HOST_BUILD_DIR)/arch/ubicom32/include/asm/user.h \ $(HOST_BUILD_DIR)/arch/ubicom32/include/asm/user.h \
$(HOST_BUILD_DIR)/arch/ubicom32/include/asm/page.h \ $(HOST_BUILD_DIR)/arch/ubicom32/include/asm/page.h \
$(HOST_BUILD_DIR)/arch/ubicom32/include/asm/page_offset.h \ $(HOST_BUILD_DIR)/arch/ubicom32/include/asm/page_offset.h \
$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include/asm/ $(BUILD_DIR_TOOLCHAIN)/linux-dev/include/asm/
endef endef
define Host/Prepare/post/mips define Host/Prepare/post/mips

View File

@ -72,7 +72,7 @@ define Host/Prepare
$(call Host/Prepare/Default) $(call Host/Prepare/Default)
ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME) ln -snf $(PKG_NAME)-$(PKG_VERSION) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
$(GEN_CONFIG) > $(HOST_BUILD_DIR)/.config $(GEN_CONFIG) > $(HOST_BUILD_DIR)/.config
$(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/usr/include\",g' \ $(SED) 's,^KERNEL_HEADERS=.*,KERNEL_HEADERS=\"$(BUILD_DIR_TOOLCHAIN)/linux-dev/include\",g' \
-e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \ -e 's,^.*UCLIBC_HAS_FPU.*,UCLIBC_HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n,y),g' \
-e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \ -e 's,^.*UCLIBC_HAS_SOFT_FLOAT.*,UCLIBC_HAS_SOFT_FLOAT=$(if $(CONFIG_SOFT_FLOAT),y,n),g' \
-e 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=$(if $(CONFIG_LARGEFILE),y,n),g' \ -e 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=$(if $(CONFIG_LARGEFILE),y,n),g' \
@ -84,7 +84,7 @@ define Host/Prepare
$(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS" $(MAKE) -C $(HOST_BUILD_DIR)/extra/config conf KBUILD_HAVE_NLS= HOSTCFLAGS="-DKBUILD_NO_NLS"
PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \ PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \
PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
DEVEL_PREFIX=/usr/ \ DEVEL_PREFIX=/ \
RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \ RUNTIME_PREFIX="$(BUILD_DIR_TOOLCHAIN)/$(LIBC)-dev/" \
HOSTCC="$(HOSTCC)" \ HOSTCC="$(HOSTCC)" \
CC="$(TARGET_CC)" \ CC="$(TARGET_CC)" \
@ -99,7 +99,7 @@ endef
UCLIBC_MAKE = PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \ UCLIBC_MAKE = PATH='$(TARGET_PATH)' $(MAKE) -C $(HOST_BUILD_DIR) \
$(TARGET_CONFIGURE_OPTS) \ $(TARGET_CONFIGURE_OPTS) \
DEVEL_PREFIX=/usr/ \ DEVEL_PREFIX=/ \
RUNTIME_PREFIX=/ \ RUNTIME_PREFIX=/ \
HOSTCC="$(HOSTCC)" \ HOSTCC="$(HOSTCC)" \
CPU_CFLAGS="$(TARGET_CFLAGS)" \ CPU_CFLAGS="$(TARGET_CFLAGS)" \
@ -111,9 +111,8 @@ define Host/Compile
$(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak
$(UCLIBC_MAKE) PREFIX= all $(UCLIBC_MAKE) PREFIX= all
$(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev $(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev
ln -sf ../../lib/libc.so.0 $(TOOLCHAIN_DIR)/usr/lib/libc.so $(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/lib/
$(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/usr/lib/ $(CP) $(HOST_BUILD_DIR)/libpthread/*/libpthread_so.a $(TOOLCHAIN_DIR)/lib/
$(CP) $(HOST_BUILD_DIR)/libpthread/*/libpthread_so.a $(TOOLCHAIN_DIR)/usr/lib/
( cd $(TOOLCHAIN_DIR) ; \ ( cd $(TOOLCHAIN_DIR) ; \
for d in lib usr/lib ; do \ for d in lib usr/lib ; do \
for f in libc.so libpthread.so libgcc_s.so ; do \ for f in libc.so libpthread.so libgcc_s.so ; do \
@ -128,10 +127,9 @@ endef
define Host/Install define Host/Install
$(UCLIBC_MAKE) PREFIX= utils $(UCLIBC_MAKE) PREFIX= utils
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/bin $(INSTALL_DIR) $(TOOLCHAIN_DIR)/bin
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/usr/bin
$(INSTALL_BIN) \ $(INSTALL_BIN) \
$(HOST_BUILD_DIR)/utils/ldd \ $(HOST_BUILD_DIR)/utils/ldd \
$(TOOLCHAIN_DIR)/usr/bin/ $(TOOLCHAIN_DIR)/bin/
$(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin $(INSTALL_DIR) $(TOOLCHAIN_DIR)/sbin
$(INSTALL_BIN) \ $(INSTALL_BIN) \
$(HOST_BUILD_DIR)/utils/ldconfig \ $(HOST_BUILD_DIR)/utils/ldconfig \