Build 'file' for the host as well as the target. If the host system has a version older than that being built for buildroot, the target build will fail. So, we build 'file' for the host and add actually add '$(TOOL_BUILD_DIR)/bin' to the TARGET_PATH so that it takes precedence over the host system version.
This commit is contained in:
parent
4b186393b4
commit
6b632ad624
2
Makefile
2
Makefile
@ -49,7 +49,7 @@ ifeq ($(strip $(BR2_HAVE_DOT_CONFIG)),y)
|
|||||||
# along with the packages to build for the target.
|
# along with the packages to build for the target.
|
||||||
#
|
#
|
||||||
##############################################################
|
##############################################################
|
||||||
TARGETS:=host-sed kernel-headers uclibc-configured binutils gcc uclibc-target-utils
|
TARGETS:=host-sed host-file kernel-headers uclibc-configured binutils gcc uclibc-target-utils
|
||||||
include toolchain/Makefile.in
|
include toolchain/Makefile.in
|
||||||
include package/Makefile.in
|
include package/Makefile.in
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ TOOL_BUILD_DIR=$(BASE_DIR)/toolchain_build_$(ARCH)$(ARCH_FPU_SUFFIX)
|
|||||||
# Strip off the annoying quoting
|
# Strip off the annoying quoting
|
||||||
STAGING_DIR:=$(strip $(subst ",, $(BR2_STAGING_DIR)))
|
STAGING_DIR:=$(strip $(subst ",, $(BR2_STAGING_DIR)))
|
||||||
#"
|
#"
|
||||||
TARGET_PATH=$(STAGING_DIR)/bin:/bin:/sbin:/usr/bin:/usr/sbin
|
TARGET_PATH=$(STAGING_DIR)/bin:$(TOOL_BUILD_DIR)/bin:/bin:/sbin:/usr/bin:/usr/sbin
|
||||||
IMAGE:=$(BASE_DIR)/rootfs.$(ARCH)$(ARCH_FPU_SUFFIX)
|
IMAGE:=$(BASE_DIR)/rootfs.$(ARCH)$(ARCH_FPU_SUFFIX)
|
||||||
REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux-uclibc
|
REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux-uclibc
|
||||||
GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
|
GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
|
||||||
|
@ -6,7 +6,8 @@
|
|||||||
FILE_VER:=4.15
|
FILE_VER:=4.15
|
||||||
FILE_SOURCE:=file-$(FILE_VER).tar.gz
|
FILE_SOURCE:=file-$(FILE_VER).tar.gz
|
||||||
FILE_SITE:=ftp://ftp.astron.com/pub/file
|
FILE_SITE:=ftp://ftp.astron.com/pub/file
|
||||||
FILE_DIR:=$(BUILD_DIR)/file-$(FILE_VER)
|
FILE_DIR1:=$(TOOL_BUILD_DIR)/file-$(FILE_VER)
|
||||||
|
FILE_DIR2:=$(BUILD_DIR)/file-$(FILE_VER)
|
||||||
FILE_CAT:=zcat
|
FILE_CAT:=zcat
|
||||||
FILE_BINARY:=src/file
|
FILE_BINARY:=src/file
|
||||||
FILE_TARGET_BINARY:=usr/bin/file
|
FILE_TARGET_BINARY:=usr/bin/file
|
||||||
@ -16,13 +17,47 @@ $(DL_DIR)/$(FILE_SOURCE):
|
|||||||
|
|
||||||
file-source: $(DL_DIR)/$(FILE_SOURCE)
|
file-source: $(DL_DIR)/$(FILE_SOURCE)
|
||||||
|
|
||||||
$(FILE_DIR)/.unpacked: $(DL_DIR)/$(FILE_SOURCE)
|
|
||||||
$(FILE_CAT) $(DL_DIR)/$(FILE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
|
||||||
toolchain/patch-kernel.sh $(FILE_DIR) package/file/ file\*.patch
|
|
||||||
touch $(FILE_DIR)/.unpacked
|
|
||||||
|
|
||||||
$(FILE_DIR)/.configured: $(FILE_DIR)/.unpacked
|
#############################################################
|
||||||
(cd $(FILE_DIR); rm -rf config.cache; \
|
#
|
||||||
|
# build file for use on the host system
|
||||||
|
#
|
||||||
|
#############################################################
|
||||||
|
$(FILE_DIR1)/.unpacked: $(DL_DIR)/$(FILE_SOURCE)
|
||||||
|
$(FILE_CAT) $(DL_DIR)/$(FILE_SOURCE) | tar -C $(TOOL_BUILD_DIR) $(TAR_OPTIONS) -
|
||||||
|
touch $(FILE_DIR1)/.unpacked
|
||||||
|
|
||||||
|
$(FILE_DIR1)/.configured: $(FILE_DIR1)/.unpacked
|
||||||
|
(cd $(FILE_DIR1); rm -rf config.cache; \
|
||||||
|
./configure \
|
||||||
|
--prefix=$(FILE_DIR1)/install \
|
||||||
|
);
|
||||||
|
touch $(FILE_DIR1)/.configured
|
||||||
|
|
||||||
|
$(TOOL_BUILD_DIR)/bin/file: $(FILE_DIR1)/.configured
|
||||||
|
$(MAKE) -C $(FILE_DIR1) install
|
||||||
|
ln -sf $(FILE_DIR1)/install/bin/file $(TOOL_BUILD_DIR)/bin/file
|
||||||
|
|
||||||
|
host-file: $(TOOL_BUILD_DIR)/bin/file
|
||||||
|
|
||||||
|
host-file-clean:
|
||||||
|
$(MAKE) -C $(FILE_DIR1) clean
|
||||||
|
|
||||||
|
host-file-dirclean:
|
||||||
|
rm -rf $(FILE_DIR1)
|
||||||
|
|
||||||
|
#############################################################
|
||||||
|
#
|
||||||
|
# build file for use on the target system
|
||||||
|
#
|
||||||
|
#############################################################
|
||||||
|
$(FILE_DIR2)/.unpacked: $(DL_DIR)/$(FILE_SOURCE)
|
||||||
|
$(FILE_CAT) $(DL_DIR)/$(FILE_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
|
||||||
|
toolchain/patch-kernel.sh $(FILE_DIR2) package/file/ file\*.patch
|
||||||
|
touch $(FILE_DIR2)/.unpacked
|
||||||
|
|
||||||
|
$(FILE_DIR2)/.configured: $(FILE_DIR2)/.unpacked
|
||||||
|
(cd $(FILE_DIR2); rm -rf config.cache; \
|
||||||
$(TARGET_CONFIGURE_OPTS) \
|
$(TARGET_CONFIGURE_OPTS) \
|
||||||
CFLAGS="$(TARGET_CFLAGS)" \
|
CFLAGS="$(TARGET_CFLAGS)" \
|
||||||
./configure \
|
./configure \
|
||||||
@ -44,13 +79,13 @@ $(FILE_DIR)/.configured: $(FILE_DIR)/.unpacked
|
|||||||
--enable-static \
|
--enable-static \
|
||||||
--disable-fsect-man5 \
|
--disable-fsect-man5 \
|
||||||
);
|
);
|
||||||
touch $(FILE_DIR)/.configured
|
touch $(FILE_DIR2)/.configured
|
||||||
|
|
||||||
$(FILE_DIR)/$(FILE_BINARY): $(FILE_DIR)/.configured
|
$(FILE_DIR2)/$(FILE_BINARY): $(FILE_DIR2)/.configured
|
||||||
$(MAKE) $(TARGET_CONFIGURE_OPTS) LDFLAGS="-static" -C $(FILE_DIR)
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) LDFLAGS="-static" -C $(FILE_DIR2)
|
||||||
|
|
||||||
$(TARGET_DIR)/$(FILE_TARGET_BINARY): $(FILE_DIR)/$(FILE_BINARY)
|
$(TARGET_DIR)/$(FILE_TARGET_BINARY): $(FILE_DIR2)/$(FILE_BINARY)
|
||||||
$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) -C $(FILE_DIR) install
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) -C $(FILE_DIR2) install
|
||||||
-($(STRIP) $(TARGET_DIR)/usr/lib/libmagic.so.*.* > /dev/null 2>&1)
|
-($(STRIP) $(TARGET_DIR)/usr/lib/libmagic.so.*.* > /dev/null 2>&1)
|
||||||
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
|
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
|
||||||
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
|
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
|
||||||
@ -58,11 +93,11 @@ $(TARGET_DIR)/$(FILE_TARGET_BINARY): $(FILE_DIR)/$(FILE_BINARY)
|
|||||||
file: zlib uclibc $(TARGET_DIR)/$(FILE_TARGET_BINARY)
|
file: zlib uclibc $(TARGET_DIR)/$(FILE_TARGET_BINARY)
|
||||||
|
|
||||||
file-clean:
|
file-clean:
|
||||||
$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FILE_DIR) uninstall
|
$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FILE_DIR2) uninstall
|
||||||
-$(MAKE) -C $(FILE_DIR) clean
|
-$(MAKE) -C $(FILE_DIR2) clean
|
||||||
|
|
||||||
file-dirclean:
|
file-dirclean:
|
||||||
rm -rf $(FILE_DIR)
|
rm -rf $(FILE_DIR2)
|
||||||
|
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user