support: move package/gnuconfig to support/gnuconfig

The CONFIG_UPDATE macro is no longer defined in
package/gnuconfig/gnuconfig.mk, but instead in
package/Makefile.autotools.in. It it also changed a little bit to take
the directory of the package sources as argument, and the AUTOTARGETS
infrastructure is updated to use this macro.

[Peter: drop echo in CONFIG_UPDATE]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
Thomas Petazzoni 2011-08-31 23:35:06 +02:00 committed by Peter Korsgaard
parent 56da3859c7
commit 102a93bdca
17 changed files with 50 additions and 37 deletions

View File

@ -193,7 +193,7 @@ unexport CFLAGS
unexport CXXFLAGS
unexport GREP_OPTIONS
GNU_HOST_NAME:=$(shell package/gnuconfig/config.guess)
GNU_HOST_NAME:=$(shell support/gnuconfig/config.guess)
#############################################################
#

View File

@ -22,6 +22,22 @@
#
################################################################################
#
# Utility function to upgrade config.sub and config.guess files
#
# argument 1 : directory into which config.guess and config.sub need
# to be updated. Note that config.sub and config.guess are searched
# recursively in this directory.
#
define CONFIG_UPDATE
for file in config.guess config.sub; do \
for i in $$(find $(1) -name $$file); do \
cp support/gnuconfig/$$file $$i; \
done; \
done
endef
################################################################################
# AUTOTARGETS_INNER -- defines how the configuration, compilation and
# installation of an autotools package should be done, implements a
@ -132,11 +148,8 @@ endif
# Hook to update config.sub and config.guess if needed
#
define UPDATE_CONFIG_HOOK
for file in config.guess config.sub; do \
for i in $$$$(find $$(@D) -name $$$$file); do \
cp package/gnuconfig/$$$$file $$$$i; \
done; \
done
@$$(call MESSAGE, "Updating config.sub and config.guess")
$$(call CONFIG_UPDATE,$$(@D))
endef
$(2)_POST_PATCH_HOOKS += UPDATE_CONFIG_HOOK

View File

@ -70,7 +70,7 @@ $(DL_DIR)/$(CUPS_SOURCE):
$(CUPS_DIR)/.unpacked: $(DL_DIR)/$(CUPS_SOURCE)
$(CUPS_CAT) $(DL_DIR)/$(CUPS_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
support/scripts/apply-patches.sh $(CUPS_DIR) package/cups/ \*.patch
$(CONFIG_UPDATE) $(CUPS_DIR)
$(call CONFIG_UPDATE,$(CUPS_DIR))
touch $@
$(CUPS_DIR)/.configured: $(CUPS_DIR)/.unpacked

View File

@ -25,8 +25,7 @@ gettext-source: $(DL_DIR)/$(GETTEXT_SOURCE)
$(GETTEXT_DIR)/.unpacked: $(DL_DIR)/$(GETTEXT_SOURCE)
$(GETTEXT_CAT) $(DL_DIR)/$(GETTEXT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
support/scripts/apply-patches.sh $(GETTEXT_DIR) package/gettext/ gettext\*.patch
$(CONFIG_UPDATE) $(@D)
$(CONFIG_UPDATE) $(GETTEXT_DIR)/build-aux
$(call CONFIG_UPDATE,$(@D))
touch $@
ifneq ($(BR2_TOOLCHAIN_BUILDROOT),y)

View File

@ -1,20 +0,0 @@
--- ABOUT ---
This isnt a real package, it just exists to easily update the
config.sub / config.guess files in packages to the latest version
(since many bundled ones don't support the latest possible targets)
--- HOWTO ---
To use, just add this to your unpack rule in the package.mk:
$(CONFIG_UPDATE) $(PACKAGE_DIR)/
--- UPDATE ---
GNU config is now managed in git, so to update:
# git clone git://git.savannah.gnu.org/config.git
# cp config/config.* .
# for p in $(ls patches/*.patch); do patch -p0 < $p; done
# rm -rf config
A few local customizations are used to support uClibc so you may
have to make sure they're still needed. The patches are broken
out in the patches/ dir to keep things simple.

View File

@ -1,3 +0,0 @@
# See README.buildroot
gnuconfig-source:
CONFIG_UPDATE = cp -f package/gnuconfig/config.sub package/gnuconfig/config.guess

View File

@ -8,7 +8,7 @@ LMBENCH_SOURCE:=lmbench-$(LMBENCH_VERSION).tgz
LMBENCH_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/project/lmbench/development/lmbench-3.0-a9/
define LMBENCH_CONFIGURE_CMDS
$(CONFIG_UPDATE) $(@D)
$(call CONFIG_UPDATE,$(@D))
sed -i 's/CFLAGS=/CFLAGS+=/g' $(@D)/src/Makefile
sed -i '/cd .*doc/d' $(@D)/src/Makefile
sed -i '/include/d' $(@D)/src/Makefile

View File

@ -0,0 +1,25 @@
--- HOWTO ---
If your package uses config.guess and/or config.sub, then it probably
relies on the autotools as its build system. In this case, you should
use the AUTOTARGETS infrastructure, which will take care of updating
the config.guess and/or config.sub files appropriately. See the
Buildroot documentation for details about the AUTOTARGETS
infrastructure.
If for some reason your package does not use the AUTOTARGETS
infrastructure, you can request the config.guess and/or config.sub
files of your package to be updated by using:
$(call CONFIG_UPDATE,directory-of-your-package-sources)
--- UPDATE ---
GNU config is now managed in git, so to update:
# git clone git://git.savannah.gnu.org/config.git
# cp config/config.* .
# for p in $(ls patches/*.patch); do patch -p0 < $p; done
# rm -rf config
A few local customizations are used to support uClibc so you may
have to make sure they're still needed. The patches are broken
out in the patches/ dir to keep things simple.

View File

@ -81,7 +81,6 @@ for i in $(find package/ -name '*.mk') ; do
$i = "package/games/games.mk" -o \
$i = "package/multimedia/multimedia.mk" -o \
$i = "package/customize/customize.mk" -o \
$i = "package/gnuconfig/gnuconfig.mk" -o \
$i = "package/matchbox/matchbox.mk" -o \
$i = "package/x11r7/x11r7.mk" ; then
echo "skipping $i" 1>&2

View File

@ -14,7 +14,7 @@ $(ELF2FLT_DIR)/.unpacked:
touch $@
$(ELF2FLT_DIR)/.patched: $(ELF2FLT_DIR)/.unpacked
$(CONFIG_UPDATE) $(@D)
$(call CONFIG_UPDATE,$(@D))
touch $@
$(ELF2FLT_DIR)/.configured: $(ELF2FLT_DIR)/.patched

View File

@ -200,7 +200,7 @@ $(GCC_DIR)/.unpacked: $(DL_DIR)/$(GCC_SOURCE)
mkdir -p $(TOOLCHAIN_DIR)
rm -rf $(GCC_DIR)
$(GCC_CAT) $(DL_DIR)/$(GCC_SOURCE) | tar -C $(TOOLCHAIN_DIR) $(TAR_OPTIONS) -
$(CONFIG_UPDATE) $(@D)
$(call CONFIG_UPDATE,$(@D))
touch $@
gcc-patched: $(GCC_DIR)/.patched

View File

@ -38,7 +38,7 @@ endif
ifneq ($(wildcard $(GDB_PATCH_DIR)),)
support/scripts/apply-patches.sh $(GDB_DIR) $(GDB_PATCH_DIR) \*.patch $(GDB_PATCH_EXTRA)
endif
$(CONFIG_UPDATE) $(@D)
$(call CONFIG_UPDATE,$(@D))
touch $@
gdb-patched: $(GDB_DIR)/.unpacked