Skip to contentSkip to conversation

uclibc: fix handling of configuration file

PATCH New Thomas De Schampheleire 4 participants 33 messages Jul 14, 2014 – Jul 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uclibc: fix handling of configuration file

This patch series (part of it poster earlier as RFC) has as main goal to fix the uclibc kconfig handling with following requirements in mind:

- neither foo-menuconfig nor foo-update-config should have a dependency on the toolchain (which means we cannot depend on foo-configure)

- 'clean foo-menuconfig' should start from the specified (custom) config file

- 'foo-menuconfig foo-update-config' should preserve the changes made in the menuconfig step (this problem is reported for uclibc with bug #7154
(https://bugs.busybox.net/show_bug.cgi?id=7154).

- 'make foo-menuconfig; make foo-menuconfig' should preserve the changes made in the menuconfig step.

- 'make clean foo-update-config' should copy the initial file, do any fixups, and then save the config

In the process, some smaller changes are done too.

Once this series is accepted, the plan is:
- to extract the kconfig-related bits to a kconfig-package infrastructure.
- to convert busybox, linux and barebox to this kconfig-package infra too.

---
Thomas De Schampheleire (6):
pkg-utils: kconfig helpers: add basic usage documentation
pkg-utils: kconfig helpers: use single iso double quoting
uclibc: replace custom kconfig helpers with those provided by pkg-utils
uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG
uclibc: menuconfig: take into account initial settings from config file
uclibc: update-config: preserve freshly configured settings

 linux/linux.mk           |    2 +-
 package/pkg-utils.mk     |   12 +-
 package/uclibc/uclibc.mk |  230 ++++++++++++++++++--------------------
 3 files changed, 119 insertions(+), 125 deletions(-)
#1 lore raw

PATCH 1/1 pkg-utils: kconfig helpers: add basic usage documentation

---
 package/pkg-utils.mk |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
package/pkg-utils.mk +3 -3
diff -r 7c17407eb26e -r 4a53bf323d8a package/pkg-utils.mk
@@ -33,17 +33,17 @@
 # package, and more.
 #
 
-define KCONFIG_ENABLE_OPT
+define KCONFIG_ENABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
 	echo "$(1)=y" >> $(2)
 endef
 
-define KCONFIG_SET_OPT
+define KCONFIG_SET_OPT # (option, value, file)
 	$(SED) "/\\<$(1)\\>/d" $(3)
 	echo "$(1)=$(2)" >> $(3)
 endef
 
-define KCONFIG_DISABLE_OPT
+define KCONFIG_DISABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
 	echo "# $(1) is not set" >> $(2)
 endef
#2 lore raw

PATCH 1/1 pkg-utils: kconfig helpers: add basic usage documentation

Thomas, All,

On 2014-07-14 13:50 +0200, Thomas De Schampheleire spake thusly:

Quoted 1 line

Regards,
Yann E. MORIN.

Quoted 28 lines
---
 package/pkg-utils.mk |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -r 7c17407eb26e -r 4a53bf323d8a package/pkg-utils.mk

package/pkg-utils.mk +3 -3
@@ -33,17 +33,17 @@
 # package, and more.
 #
 
-define KCONFIG_ENABLE_OPT
+define KCONFIG_ENABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
 	echo "$(1)=y" >> $(2)
 endef
 
-define KCONFIG_SET_OPT
+define KCONFIG_SET_OPT # (option, value, file)
 	$(SED) "/\\<$(1)\\>/d" $(3)
 	echo "$(1)=$(2)" >> $(3)
 endef
 
-define KCONFIG_DISABLE_OPT
+define KCONFIG_DISABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
 	echo "# $(1) is not set" >> $(2)
 endef
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 pkg-utils: kconfig helpers: add basic usage documentation

In reply to Thomas De Schampheleire
Quoted 10 lines · Thomas De Schampheleire
---
 package/pkg-utils.mk |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -r 7c17407eb26e -r 4a53bf323d8a package/pkg-utils.mk

package/pkg-utils.mk line 36

Quoted 5 lines
package/pkg-utils.mk +1 -1
@@ -33,17 +33,17 @@
 # package, and more.
 #
 
-define KCONFIG_ENABLE_OPT
+define KCONFIG_ENABLE_OPT # (option, file)

I like this pattern!

Regards,
Arnout

Quoted 16 lines
package/pkg-utils.mk +2 -2
 	$(SED) "/\\<$(1)\\>/d" $(2)
 	echo "$(1)=y" >> $(2)
 endef
 
-define KCONFIG_SET_OPT
+define KCONFIG_SET_OPT # (option, value, file)
 	$(SED) "/\\<$(1)\\>/d" $(3)
 	echo "$(1)=$(2)" >> $(3)
 endef
 
-define KCONFIG_DISABLE_OPT
+define KCONFIG_DISABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
 	echo "# $(1) is not set" >> $(2)
 endef
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

PATCH 1/1 pkg-utils: kconfig helpers: use single iso double quoting

In reply to Thomas De Schampheleire

The echo statements in the kconfig helpers are currently using double quotes. For KCONFIG_SET_OPT this is problematic when the value argument itself contains a double quote (a string value). In this case, the statement

    echo "$(1)=$(2)" >> $(3)

would become:
echo "FOO="string value"" >> /some/path/.config
resulting in the string
FOO=string value
in the config file, rather than the properly quoted
FOO="string value"

The linux package worked around this by escaping the quote characters, but a prettier solution is to use single quoting in the helpers (or alternatively use no quoting at all).
A side effect of this change is that a $variable in the key or value would no longer be interpreted by the shell, removing any unexpected behavior.

This change is only really necessary for KCONFIG_SET_OPT, but for symmetry reasons the other helpers are updated too.

---
 linux/linux.mk       |  2 +-
 package/pkg-utils.mk |  6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)
linux/linux.mk +1 -1
diff -r 4a53bf323d8a -r 53e04c0bd837 linux/linux.mk
@@ -180,7 +180,7 @@
 	# rebuilt using the linux26-rebuild-with-initramfs target.
 	$(if $(BR2_TARGET_ROOTFS_INITRAMFS),
 		touch $(BINARIES_DIR)/rootfs.cpio
-		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,\"$(BINARIES_DIR)/rootfs.cpio\",$(@D)/.config)
+		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,"$(BINARIES_DIR)/rootfs.cpio",$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config))
 	$(if $(BR2_ROOTFS_DEVICE_CREATION_STATIC),,
package/pkg-utils.mk +3 -3
diff -r 4a53bf323d8a -r 53e04c0bd837 package/pkg-utils.mk
@@ -35,17 +35,17 @@
 
 define KCONFIG_ENABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
-	echo "$(1)=y" >> $(2)
+	echo '$(1)=y' >> $(2)
 endef
 
 define KCONFIG_SET_OPT # (option, value, file)
 	$(SED) "/\\<$(1)\\>/d" $(3)
-	echo "$(1)=$(2)" >> $(3)
+	echo '$(1)=$(2)' >> $(3)
 endef
 
 define KCONFIG_DISABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
-	echo "# $(1) is not set" >> $(2)
+	echo '# $(1) is not set' >> $(2)
 endef
 
 # Helper functions to determine the name of a package and its
#5 lore raw

PATCH 1/1 pkg-utils: kconfig helpers: use single iso double quoting

Thomas, All,

On 2014-07-14 13:50 +0200, Thomas De Schampheleire spake thusly:

Quoted 17 lines

The echo statements in the kconfig helpers are currently using double quotes. For KCONFIG_SET_OPT this is problematic when the value argument itself contains a double quote (a string value). In this case, the statement

    echo "$(1)=$(2)" >> $(3)

would become:
echo "FOO="string value"" >> /some/path/.config
resulting in the string
FOO=string value
in the config file, rather than the properly quoted
FOO="string value"

The linux package worked around this by escaping the quote characters, but a prettier solution is to use single quoting in the helpers (or alternatively use no quoting at all).
A side effect of this change is that a $variable in the key or value would no longer be interpreted by the shell, removing any unexpected behavior.

Quoted 4 lines

This change is only really necessary for KCONFIG_SET_OPT, but for symmetry reasons the other helpers are updated too.

Regards,
Yann E. MORIN.

Quoted 41 lines
---
 linux/linux.mk       |  2 +-
 package/pkg-utils.mk |  6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -r 4a53bf323d8a -r 53e04c0bd837 linux/linux.mk

linux/linux.mk +1 -1
@@ -180,7 +180,7 @@
 	# rebuilt using the linux26-rebuild-with-initramfs target.
 	$(if $(BR2_TARGET_ROOTFS_INITRAMFS),
 		touch $(BINARIES_DIR)/rootfs.cpio
-		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,\"$(BINARIES_DIR)/rootfs.cpio\",$(@D)/.config)
+		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,"$(BINARIES_DIR)/rootfs.cpio",$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config))
 	$(if $(BR2_ROOTFS_DEVICE_CREATION_STATIC),,

diff -r 4a53bf323d8a -r 53e04c0bd837 package/pkg-utils.mk

package/pkg-utils.mk +3 -3
@@ -35,17 +35,17 @@
 
 define KCONFIG_ENABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
-	echo "$(1)=y" >> $(2)
+	echo '$(1)=y' >> $(2)
 endef
 
 define KCONFIG_SET_OPT # (option, value, file)
 	$(SED) "/\\<$(1)\\>/d" $(3)
-	echo "$(1)=$(2)" >> $(3)
+	echo '$(1)=$(2)' >> $(3)
 endef
 
 define KCONFIG_DISABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
-	echo "# $(1) is not set" >> $(2)
+	echo '# $(1) is not set' >> $(2)
 endef
 
 # Helper functions to determine the name of a package and its
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 1/1 pkg-utils: kconfig helpers: use single iso double quoting

In reply to Thomas De Schampheleire
Quoted 17 lines · Thomas De Schampheleire

The echo statements in the kconfig helpers are currently using double quotes. For KCONFIG_SET_OPT this is problematic when the value argument itself contains a double quote (a string value). In this case, the statement

    echo "$(1)=$(2)" >> $(3)

would become:
echo "FOO="string value"" >> /some/path/.config
resulting in the string
FOO=string value
in the config file, rather than the properly quoted
FOO="string value"

The linux package worked around this by escaping the quote characters, but a prettier solution is to use single quoting in the helpers (or alternatively use no quoting at all).
A side effect of this change is that a $variable in the key or value would no longer be interpreted by the shell, removing any unexpected behavior.

Quoted 4 lines

This change is only really necessary for KCONFIG_SET_OPT, but for symmetry reasons the other helpers are updated too.

Regards,
Arnout

Quoted 43 lines
---
 linux/linux.mk       |  2 +-
 package/pkg-utils.mk |  6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -r 4a53bf323d8a -r 53e04c0bd837 linux/linux.mk

linux/linux.mk +1 -1
@@ -180,7 +180,7 @@
 	# rebuilt using the linux26-rebuild-with-initramfs target.
 	$(if $(BR2_TARGET_ROOTFS_INITRAMFS),
 		touch $(BINARIES_DIR)/rootfs.cpio
-		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,\"$(BINARIES_DIR)/rootfs.cpio\",$(@D)/.config)
+		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,"$(BINARIES_DIR)/rootfs.cpio",$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config)
 		$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config))
 	$(if $(BR2_ROOTFS_DEVICE_CREATION_STATIC),,

diff -r 4a53bf323d8a -r 53e04c0bd837 package/pkg-utils.mk

package/pkg-utils.mk +3 -3
@@ -35,17 +35,17 @@
 
 define KCONFIG_ENABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
-	echo "$(1)=y" >> $(2)
+	echo '$(1)=y' >> $(2)
 endef
 
 define KCONFIG_SET_OPT # (option, value, file)
 	$(SED) "/\\<$(1)\\>/d" $(3)
-	echo "$(1)=$(2)" >> $(3)
+	echo '$(1)=$(2)' >> $(3)
 endef
 
 define KCONFIG_DISABLE_OPT # (option, file)
 	$(SED) "/\\<$(1)\\>/d" $(2)
-	echo "# $(1) is not set" >> $(2)
+	echo '# $(1) is not set' >> $(2)
 endef
 
 # Helper functions to determine the name of a package and its
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#7 lore raw

PATCH 1/1 uclibc: replace custom kconfig helpers with those provided by pkg-utils

In reply to Thomas De Schampheleire

This patch removes the custom kconfig helpers UCLIBC_OPT_SET and UCLIBC_OPT_UNSET with the common KCONFIG_SET_OPT, KCONFIG_ENABLE_OPT and KCONFIG_DISABLE_OPT.

---
 package/uclibc/uclibc.mk |  208 ++++++++++++++++++--------------------
 1 files changed, 97 insertions(+), 111 deletions(-)
package/uclibc/uclibc.mk +96 -110
diff -r 53e04c0bd837 -r 0b5a6fcf97ef package/uclibc/uclibc.mk
@@ -49,27 +49,13 @@
 endif
 
 #
-# Utility functions to manipulation the uClibc configuration file
-#
-
-define UCLIBC_OPT_SET
-	$(SED) '/$(1)/d' $(3)/.config
-	echo '$(1)=$(2)' >> $(3)/.config
-endef
-
-define UCLIBC_OPT_UNSET
-	$(SED) '/$(1)/d' $(2)/.config
-	echo '# $(1) is not set' >> $(2)/.config
-endef
-
-#
 # ARM definitions
 #
 
 ifeq ($(UCLIBC_TARGET_ARCH),arm)
 define UCLIBC_ARM_ABI_CONFIG
 	$(SED) '/CONFIG_ARM_.ABI/d' $(@D)/.config
-	$(call UCLIBC_OPT_SET,CONFIG_ARM_EABI,y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,CONFIG_ARM_EABI,$(@D)/.config)
 endef
 
 # Thumb build is broken with threads, build in ARM mode
@@ -79,11 +65,11 @@
 
 ifeq ($(BR2_UCLIBC_ARM_BX),y)
 define UCLIBC_ARM_BX_CONFIG
-	$(call UCLIBC_OPT_SET,USE_BX,y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,USE_BX,$(@D)/.config)
 endef
 else
 define UCLIBC_ARM_BX_CONFIG
-	$(call UCLIBC_OPT_UNSET,USE_BX,$(@D))
+	$(call KCONFIG_DISABLE_OPT,USE_BX,$(@D)/.config)
 endef
 endif
 
@@ -97,13 +83,13 @@
 UCLIBC_MIPS_ABI = CONFIG_MIPS_$(call qstrip,$(BR2_UCLIBC_MIPS_ABI))_ABI
 define UCLIBC_MIPS_ABI_CONFIG
 	$(SED) '/CONFIG_MIPS_[NO].._ABI/d' $(@D)/.config
-	$(call UCLIBC_OPT_SET,$(UCLIBC_MIPS_ABI),y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,$(UCLIBC_MIPS_ABI),$(@D)/.config)
 endef
 
 UCLIBC_MIPS_ISA = CONFIG_MIPS_ISA_$(call qstrip,$(BR2_UCLIBC_MIPS_ISA))
 define UCLIBC_MIPS_ISA_CONFIG
 	$(SED) '/CONFIG_MIPS_ISA_.*/d' $(@D)/.config
-	$(call UCLIBC_OPT_SET,$(UCLIBC_MIPS_ISA),y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,$(UCLIBC_MIPS_ISA),$(@D)/.config)
 endef
 endif # mips
 
@@ -115,7 +101,7 @@
 UCLIBC_SH_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_SH_TYPE))
 define UCLIBC_SH_TYPE_CONFIG
 	$(SED) '/CONFIG_SH[234A]*/d' $(@D)/.config
-	$(call UCLIBC_OPT_SET,$(UCLIBC_SH_TYPE),y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,$(UCLIBC_SH_TYPE),$(@D)/.config)
 endef
 endif # sh
 
@@ -128,7 +114,7 @@
 define UCLIBC_SPARC_TYPE_CONFIG
 	$(SED) 's/^\(CONFIG_[^_]*[_]*SPARC[^=]*\)=.*/# \1 is not set/g' \
 		 $(@D)/.config
-	$(call UCLIBC_OPT_SET,$(UCLIBC_SPARC_TYPE),y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,$(UCLIBC_SPARC_TYPE),$(@D)/.config)
 endef
 endif # sparc
 
@@ -139,9 +125,9 @@
 ifeq ($(UCLIBC_TARGET_ARCH),powerpc)
 UCLIBC_POWERPC_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_POWERPC_TYPE))
 define UCLIBC_POWERPC_TYPE_CONFIG
-	$(call UCLIBC_OPT_UNSET,CONFIG_GENERIC,$(@D))
-	$(call UCLIBC_OPT_UNSET,CONFIG_E500,$(@D))
-	$(call UCLIBC_OPT_SET,$(UCLIBC_POWERPC_TYPE),y,$(@D))
+	$(call KCONFIG_DISABLE_OPT,CONFIG_GENERIC,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,CONFIG_E500,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,$(UCLIBC_POWERPC_TYPE),$(@D)/.config)
 endef
 endif # powerpc
 
@@ -152,34 +138,34 @@
 ifeq ($(UCLIBC_TARGET_ARCH),bfin)
 ifeq ($(BR2_BINFMT_FDPIC),y)
 define UCLIBC_BFIN_CONFIG
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_SHARED_FLAT,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_FORMAT_FDPIC_ELF,y,$(@D))
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config)
 endef
 endif
 ifeq ($(BR2_BINFMT_FLAT_ONE),y)
 define UCLIBC_BFIN_CONFIG
-	$(call UCLIBC_OPT_SET,UCLIBC_FORMAT_FLAT,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_SHARED_FLAT,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FDPIC_ELF,$(@D))
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FLAT,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config)
 endef
 endif
 ifeq ($(BR2_BINFMT_FLAT_SEP_DATA),y)
 define UCLIBC_BFIN_CONFIG
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_FORMAT_FLAT_SEP_DATA,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_SHARED_FLAT,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FDPIC_ELF,$(@D))
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config)
 endef
 endif
 ifeq ($(BR2_BINFMT_FLAT_SHARED),y)
 define UCLIBC_BFIN_CONFIG
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_FORMAT_SHARED_FLAT,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_FORMAT_FDPIC_ELF,$(@D))
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FLAT_SEP_DATA,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_FORMAT_SHARED_FLAT,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_FORMAT_FDPIC_ELF,$(@D)/.config)
 endef
 endif
 endif # bfin
@@ -190,7 +176,7 @@
 
 ifeq ($(UCLIBC_TARGET_ARCH),avr32)
 define UCLIBC_AVR32_CONFIG
-	$(call UCLIBC_OPT_SET,LINKRELAX,y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,LINKRELAX,$(@D)/.config)
 endef
 endif # avr32
 
@@ -200,7 +186,7 @@
 ifeq ($(UCLIBC_TARGET_ARCH),i386)
 UCLIBC_X86_TYPE = CONFIG_$(call qstrip,$(BR2_UCLIBC_X86_TYPE))
 define UCLIBC_X86_TYPE_CONFIG
-	$(call UCLIBC_OPT_SET,$(UCLIBC_X86_TYPE),y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,$(UCLIBC_X86_TYPE),$(@D)/.config)
 endef
 endif
 
@@ -210,17 +196,17 @@
 
 ifeq ($(call qstrip,$(BR2_ENDIAN)),BIG)
 define UCLIBC_ENDIAN_CONFIG
-	$(call UCLIBC_OPT_SET,ARCH_BIG_ENDIAN,y,$(@D))
-	$(call UCLIBC_OPT_SET,ARCH_WANTS_BIG_ENDIAN,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,ARCH_LITTLE_ENDIAN,$(@D))
-	$(call UCLIBC_OPT_UNSET,ARCH_WANTS_LITTLE_ENDIAN,$(@D))
+	$(call KCONFIG_ENABLE_OPT,ARCH_BIG_ENDIAN,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,ARCH_WANTS_BIG_ENDIAN,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,ARCH_LITTLE_ENDIAN,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,ARCH_WANTS_LITTLE_ENDIAN,$(@D)/.config)
 endef
 else
 define UCLIBC_ENDIAN_CONFIG
-	$(call UCLIBC_OPT_SET,ARCH_LITTLE_ENDIAN,y,$(@D))
-	$(call UCLIBC_OPT_SET,ARCH_WANTS_LITTLE_ENDIAN,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,ARCH_BIG_ENDIAN,$(@D))
-	$(call UCLIBC_OPT_UNSET,ARCH_WANTS_BIG_ENDIAN,$(@D))
+	$(call KCONFIG_ENABLE_OPT,ARCH_LITTLE_ENDIAN,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,ARCH_WANTS_LITTLE_ENDIAN,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,ARCH_BIG_ENDIAN,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,ARCH_WANTS_BIG_ENDIAN,$(@D)/.config)
 endef
 endif
 
@@ -230,12 +216,12 @@
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_LARGEFILE),y)
 define UCLIBC_LARGEFILE_CONFIG
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_LFS,y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_LFS,$(@D)/.config)
 endef
 else
 define UCLIBC_LARGEFILE_CONFIG
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_LFS,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_FOPEN_LARGEFILE_MODE,$(@D))
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LFS,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_FOPEN_LARGEFILE_MODE,$(@D)/.config)
 endef
 endif
 
@@ -245,11 +231,11 @@
 
 ifeq ($(BR2_USE_MMU),y)
 define UCLIBC_MMU_CONFIG
-	$(call UCLIBC_OPT_SET,ARCH_USE_MMU,y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,ARCH_USE_MMU,$(@D)/.config)
 endef
 else
 define UCLIBC_MMU_CONFIG
-	$(call UCLIBC_OPT_UNSET,ARCH_USE_MMU,$(@D))
+	$(call KCONFIG_DISABLE_OPT,ARCH_USE_MMU,$(@D)/.config)
 endef
 endif
 
@@ -258,9 +244,9 @@
 #
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_INET_IPV6),y)
-UCLIBC_IPV6_CONFIG = $(call UCLIBC_OPT_SET,UCLIBC_HAS_IPV6,y,$(@D))
+UCLIBC_IPV6_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_IPV6,$(@D)/.config)
 else
-UCLIBC_IPV6_CONFIG = $(call UCLIBC_OPT_UNSET,UCLIBC_HAS_IPV6,$(@D))
+UCLIBC_IPV6_CONFIG = $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_IPV6,$(@D)/.config)
 endif
 
 #
@@ -269,15 +255,15 @@
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_INET_RPC),y)
 define UCLIBC_RPC_CONFIG
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_RPC,y,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_FULL_RPC,y,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_REENTRANT_RPC,y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_RPC,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FULL_RPC,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_REENTRANT_RPC,$(@D)/.config)
 endef
 else
 define UCLIBC_RPC_CONFIG
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_RPC,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_FULL_RPC,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_REENTRANT_RPC,$(@D))
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_RPC,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_FULL_RPC,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_REENTRANT_RPC,$(@D)/.config)
 endef
 endif
 
@@ -287,14 +273,14 @@
 
 ifeq ($(BR2_SOFT_FLOAT),y)
 define UCLIBC_FLOAT_CONFIG
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_FPU,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_FLOATS,y,$(@D))
-	$(call UCLIBC_OPT_SET,DO_C99_MATH,y,$(@D))
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_FPU,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FLOATS,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,DO_C99_MATH,$(@D)/.config)
 endef
 else
 define UCLIBC_FLOAT_CONFIG
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_FPU,y,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_FLOATS,y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FPU,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_FLOATS,$(@D)/.config)
 endef
 endif
 
@@ -303,13 +289,13 @@
 #
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_USE_SSP),y)
 define UCLIBC_SSP_CONFIG
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_SSP,y,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_BUILD_SSP,y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_SSP,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_BUILD_SSP,$(@D)/.config)
 endef
 else
 define UCLIBC_SSP_CONFIG
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_SSP,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_BUILD_SSP,$(@D))
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_SSP,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_BUILD_SSP,$(@D)/.config)
 endef
 endif
 
@@ -318,31 +304,31 @@
 #
 ifeq ($(BR2_PTHREADS_NONE),y)
 define UCLIBC_THREAD_CONFIG
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_THREADS,$(@D))
-	$(call UCLIBC_OPT_UNSET,LINUXTHREADS,$(@D))
-	$(call UCLIBC_OPT_UNSET,LINUXTHREADS_OLD,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_THREADS_NATIVE,$(@D))
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,LINUXTHREADS,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,LINUXTHREADS_OLD,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS_NATIVE,$(@D)/.config)
 endef
 else ifeq ($(BR2_PTHREADS),y)
 define UCLIBC_THREAD_CONFIG
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_THREADS,y,$(@D))
-	$(call UCLIBC_OPT_SET,LINUXTHREADS_NEW,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,LINUXTHREADS_OLD,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_THREADS_NATIVE,$(@D))
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,LINUXTHREADS_NEW,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,LINUXTHREADS_OLD,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS_NATIVE,$(@D)/.config)
 endef
 else ifeq ($(BR2_PTHREADS_OLD),y)
 define UCLIBC_THREAD_CONFIG
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_THREADS,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,LINUXTHREADS_NEW,$(@D))
-	$(call UCLIBC_OPT_SET,LINUXTHREADS_OLD,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_THREADS_NATIVE,$(@D))
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,LINUXTHREADS_NEW,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,LINUXTHREADS_OLD,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_THREADS_NATIVE,$(@D)/.config)
 endef
 else ifeq ($(BR2_PTHREADS_NATIVE),y)
 define UCLIBC_THREAD_CONFIG
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_THREADS,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,LINUXTHREADS_NEW,$(@D))
-	$(call UCLIBC_OPT_UNSET,LINUXTHREADS_OLD,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_THREADS_NATIVE,y,$(@D))
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,LINUXTHREADS_NEW,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,LINUXTHREADS_OLD,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_THREADS_NATIVE,$(@D)/.config)
 endef
 endif
 
@@ -351,9 +337,9 @@
 #
 
 ifeq ($(BR2_PTHREAD_DEBUG),y)
-UCLIBC_THREAD_DEBUG_CONFIG = $(call UCLIBC_OPT_SET,PTHREADS_DEBUG_SUPPORT,y,$(@D))
+UCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_ENABLE_OPT,PTHREADS_DEBUG_SUPPORT,$(@D)/.config)
 else
-UCLIBC_THREAD_DEBUG_CONFIG = $(call UCLIBC_OPT_UNSET,PTHREADS_DEBUG_SUPPORT,$(@D))
+UCLIBC_THREAD_DEBUG_CONFIG = $(call KCONFIG_DISABLE_OPT,PTHREADS_DEBUG_SUPPORT,$(@D)/.config)
 endif
 
 #
@@ -362,18 +348,18 @@
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_LOCALE),y)
 define UCLIBC_LOCALE_CONFIG
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_LOCALE,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_BUILD_ALL_LOCALE,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_BUILD_MINIMAL_LOCALE,y,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_BUILD_MINIMAL_LOCALES,"$(UCLIBC_LOCALES)",$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_PREGENERATED_LOCALE_DATA,$(@D))
-	$(call UCLIBC_OPT_UNSET,DOWNLOAD_PREGENERATED_LOCALE_DATA,$(@D))
-	$(call UCLIBC_OPT_SET,UCLIBC_HAS_XLOCALE,y,$(@D))
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_GLIBC_DIGIT_GROUPING,$(@D))
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_LOCALE,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_BUILD_ALL_LOCALE,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_BUILD_MINIMAL_LOCALE,$(@D)/.config)
+	$(call KCONFIG_SET_OPT,UCLIBC_BUILD_MINIMAL_LOCALES,"$(UCLIBC_LOCALES)",$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_PREGENERATED_LOCALE_DATA,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,DOWNLOAD_PREGENERATED_LOCALE_DATA,$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_XLOCALE,$(@D)/.config)
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_GLIBC_DIGIT_GROUPING,$(@D)/.config)
 endef
 else
 define UCLIBC_LOCALE_CONFIG
-	$(call UCLIBC_OPT_UNSET,UCLIBC_HAS_LOCALE,$(@D))
+	$(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_LOCALE,$(@D)/.config)
 endef
 endif
 
@@ -382,9 +368,9 @@
 #
 
 ifeq ($(BR2_TOOLCHAIN_BUILDROOT_WCHAR),y)
-UCLIBC_WCHAR_CONFIG = $(call UCLIBC_OPT_SET,UCLIBC_HAS_WCHAR,y,$(@D))
+UCLIBC_WCHAR_CONFIG = $(call KCONFIG_ENABLE_OPT,UCLIBC_HAS_WCHAR,$(@D)/.config)
 else
-UCLIBC_WCHAR_CONFIG = $(call UCLIBC_OPT_UNSET,UCLIBC_HAS_WCHAR,$(@D))
+UCLIBC_WCHAR_CONFIG = $(call KCONFIG_DISABLE_OPT,UCLIBC_HAS_WCHAR,$(@D)/.config)
 endif
 
 #
@@ -392,9 +378,9 @@
 #
 
 ifeq ($(BR2_STRIP_none),y)
-UCLIBC_STRIP_CONFIG = $(call UCLIBC_OPT_UNSET,DOSTRIP,$(@D))
+UCLIBC_STRIP_CONFIG = $(call KCONFIG_DISABLE_OPT,DOSTRIP,$(@D)/.config)
 else
-UCLIBC_STRIP_CONFIG = $(call UCLIBC_OPT_SET,DOSTRIP,y,$(@D))
+UCLIBC_STRIP_CONFIG = $(call KCONFIG_ENABLE_OPT,DOSTRIP,$(@D)/.config)
 endif
 
 #
@@ -409,13 +395,13 @@
 
 define UCLIBC_SETUP_DOT_CONFIG
 	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config
-	$(call UCLIBC_OPT_SET,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D))
-	$(call UCLIBC_OPT_SET,TARGET_$(UCLIBC_TARGET_ARCH),y,$(@D))
-	$(call UCLIBC_OPT_SET,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D))
-	$(call UCLIBC_OPT_SET,KERNEL_HEADERS,"$(LINUX_HEADERS_DIR)/usr/include",$(@D))
-	$(call UCLIBC_OPT_SET,RUNTIME_PREFIX,"/",$(@D))
-	$(call UCLIBC_OPT_SET,DEVEL_PREFIX,"/usr",$(@D))
-	$(call UCLIBC_OPT_SET,SHARED_LIB_LOADER_PREFIX,"/lib",$(@D))
+	$(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D)/.config)
+	$(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH),$(@D)/.config)
+	$(call KCONFIG_SET_OPT,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D)/.config)
+	$(call KCONFIG_SET_OPT,KERNEL_HEADERS,"$(LINUX_HEADERS_DIR)/usr/include",$(@D)/.config)
+	$(call KCONFIG_SET_OPT,RUNTIME_PREFIX,"/",$(@D)/.config)
+	$(call KCONFIG_SET_OPT,DEVEL_PREFIX,"/usr",$(@D)/.config)
+	$(call KCONFIG_SET_OPT,SHARED_LIB_LOADER_PREFIX,"/lib",$(@D)/.config)
 	$(UCLIBC_MMU_CONFIG)
 	$(UCLIBC_ARM_ABI_CONFIG)
 	$(UCLIBC_ARM_BX_CONFIG)
#8 lore raw

PATCH 1/1 uclibc: replace custom kconfig helpers with those provided by pkg-utils

Thomas, All,

On 2014-07-14 13:50 +0200, Thomas De Schampheleire spake thusly:

Quoted 5 lines

This patch removes the custom kconfig helpers UCLIBC_OPT_SET and UCLIBC_OPT_UNSET with the common KCONFIG_SET_OPT, KCONFIG_ENABLE_OPT and KCONFIG_DISABLE_OPT.

But see below:

Review

Quoted 6 lines
(quoted diff) +0 -0
 	$(SED) '/CONFIG_ARM_.ABI/d' $(@D)/.config
 	$(SED) '/CONFIG_MIPS_[NO].._ABI/d' $(@D)/.config
 	$(SED) '/CONFIG_MIPS_ISA_.*/d' $(@D)/.config
 	$(SED) '/CONFIG_SH[234A]*/d' $(@D)/.config
 	$(SED) 's/^\(CONFIG_[^_]*[_]*SPARC[^=]*\)=.*/# \1 is not set/g' \
 		 $(@D)/.config

Ideally, we should have KCONFIG helpers for those, too.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#9 lore raw

PATCH 1/1 uclibc: replace custom kconfig helpers with those provided by pkg-utils

Hi Yann,

Quoted 13 lines · Yann E. MORIN

Thomas, All,

On 2014-07-14 13:50 +0200, Thomas De Schampheleire spake thusly:

Quoted 5 lines

This patch removes the custom kconfig helpers UCLIBC_OPT_SET and UCLIBC_OPT_UNSET with the common KCONFIG_SET_OPT, KCONFIG_ENABLE_OPT and KCONFIG_DISABLE_OPT.

But see below:

Quoted 9 lines
Quoted 6 lines
      $(SED) '/CONFIG_ARM_.ABI/d' $(@D)/.config
      $(SED) '/CONFIG_MIPS_[NO].._ABI/d' $(@D)/.config
      $(SED) '/CONFIG_MIPS_ISA_.*/d' $(@D)/.config
      $(SED) '/CONFIG_SH[234A]*/d' $(@D)/.config
      $(SED) 's/^\(CONFIG_[^_]*[_]*SPARC[^=]*\)=.*/# \1 is not set/g' \
               $(@D)/.config

Ideally, we should have KCONFIG helpers for those, too.

Yes, but it has to be a new helper I think, because of the pattern matching.

Best regards,
Thomas

#10 lore raw

PATCH 1/1 uclibc: replace custom kconfig helpers with those provided by pkg-utils

Thomas, All,

On 2014-07-14 16:39 +0200, Thomas De Schampheleire spake thusly:

Quoted 23 lines

Hi Yann,

Quoted 20 lines · Yann E. MORIN

Thomas, All,

On 2014-07-14 13:50 +0200, Thomas De Schampheleire spake thusly:

Quoted 5 lines

This patch removes the custom kconfig helpers UCLIBC_OPT_SET and UCLIBC_OPT_UNSET with the common KCONFIG_SET_OPT, KCONFIG_ENABLE_OPT and KCONFIG_DISABLE_OPT.

But see below:

Quoted 6 lines
      $(SED) '/CONFIG_ARM_.ABI/d' $(@D)/.config
      $(SED) '/CONFIG_MIPS_[NO].._ABI/d' $(@D)/.config
      $(SED) '/CONFIG_MIPS_ISA_.*/d' $(@D)/.config
      $(SED) '/CONFIG_SH[234A]*/d' $(@D)/.config
      $(SED) 's/^\(CONFIG_[^_]*[_]*SPARC[^=]*\)=.*/# \1 is not set/g' \
               $(@D)/.config
Quoted 4 lines
Quoted 2 lines

Ideally, we should have KCONFIG helpers for those, too.

Yes, but it has to be a new helper I think, because of the pattern matching.

Absolutely, yes. And it can come in a later patch.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#11 lore raw

PATCH 1/1 uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG

In reply to Thomas De Schampheleire

To better match the actual behavior, rename function UCLIBC_SETUP_DOT_CONFIG to UCLIBC_FIXUP_DOT_CONFIG.

---
 package/uclibc/uclibc.mk |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
package/uclibc/uclibc.mk +2 -2
diff -r 0b5a6fcf97ef -r 1f15cd84996d package/uclibc/uclibc.mk
@@ -393,7 +393,7 @@
 	UCLIBC_EXTRA_CFLAGS="$(UCLIBC_EXTRA_CFLAGS) $(TARGET_ABI)" \
 	HOSTCC="$(HOSTCC)"
 
-define UCLIBC_SETUP_DOT_CONFIG
+define UCLIBC_FIXUP_DOT_CONFIG
 	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config
 	$(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D)/.config)
 	$(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH),$(@D)/.config)
@@ -433,7 +433,7 @@
 endef
 
 define UCLIBC_CONFIGURE_CMDS
-	$(UCLIBC_SETUP_DOT_CONFIG)
+	$(UCLIBC_FIXUP_DOT_CONFIG)
 	$(MAKE1) -C $(UCLIBC_DIR) \
 		$(UCLIBC_MAKE_FLAGS) \
 		PREFIX=$(STAGING_DIR) \
#12 lore raw

PATCH 1/1 uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG

Dear Thomas De Schampheleire,

package/uclibc/uclibc.mk line 397

Quoted 3 lines · Thomas De Schampheleire
package/uclibc/uclibc.mk +1 -1
-define UCLIBC_SETUP_DOT_CONFIG
+define UCLIBC_FIXUP_DOT_CONFIG
 	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config

This this variable is actually copying the configuration file, I believe the current name of the variable is more correct than the one you propose to use, no?

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#13 lore raw

PATCH 1/1 uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG

Thomas?, All,

On 2014-07-14 16:33 +0200, Thomas Petazzoni spake thusly:

Quoted 9 lines · Thomas De Schampheleire

package/uclibc/uclibc.mk line 397

Quoted 4 lines
package/uclibc/uclibc.mk +1 -1
-define UCLIBC_SETUP_DOT_CONFIG
+define UCLIBC_FIXUP_DOT_CONFIG
 	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config

This this variable is actually copying the configuration file, I believe the current name of the variable is more correct than the one you propose to use, no?

Thomas did the change, because in patch 5/6 it no longer does the copy, it only does the fixup.

This should probably have been explained in the commit log that the change was needed by a future patch.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#14 lore raw

PATCH 1/1 uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG

Quoted 13 lines · Yann E. MORIN

Thomas?, All,

On 2014-07-14 16:33 +0200, Thomas Petazzoni spake thusly:

Quoted 9 lines · Thomas De Schampheleire

package/uclibc/uclibc.mk line 397

Quoted 4 lines
package/uclibc/uclibc.mk +1 -1
-define UCLIBC_SETUP_DOT_CONFIG
+define UCLIBC_FIXUP_DOT_CONFIG
    $(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config

This this variable is actually copying the configuration file, I believe the current name of the variable is more correct than the one you propose to use, no?

Quoted 5 lines

Thomas did the change, because in patch 5/6 it no longer does the copy, it only does the fixup.

This should probably have been explained in the commit log that the change was needed by a future patch.

Ok, I see. I split off the change to a separate patch for clarity, but indeed at this moment it is not yet fully accurate. I can fold this patch with the 5th patch, or otherwise update the commit msg as Yann proposed, what do you prefer?

#15 lore raw

PATCH 1/1 uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG

Thomas?, All,

On 2014-07-14 16:43 +0200, Thomas De Schampheleire spake thusly:

Quoted 17 lines · Yann E. MORIN
Quoted 16 lines

Thomas?, All,

On 2014-07-14 16:33 +0200, Thomas Petazzoni spake thusly:

Quoted 9 lines · Thomas De Schampheleire

package/uclibc/uclibc.mk line 397

Quoted 4 lines
package/uclibc/uclibc.mk +1 -1
-define UCLIBC_SETUP_DOT_CONFIG
+define UCLIBC_FIXUP_DOT_CONFIG
    $(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config

This this variable is actually copying the configuration file, I believe the current name of the variable is more correct than the one you propose to use, no?

Thomas did the change, because in patch 5/6 it no longer does the copy, it only does the fixup.

Quoted 7 lines
Quoted 2 lines

This should probably have been explained in the commit log that the change was needed by a future patch.

Ok, I see. I split off the change to a separate patch for clarity, but indeed at this moment it is not yet fully accurate. I can fold this patch with the 5th patch, or otherwise update the commit msg as Yann proposed, what do you prefer?

Well, I think a separate patch is better, since it is easier to review. Just add a blurb in the commit log.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#16 lore raw

PATCH 1/1 uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG

In reply to Thomas De Schampheleire
Quoted 17 lines · Thomas De Schampheleire
Quoted 16 lines · Yann E. MORIN

Thomas?, All,

On 2014-07-14 16:33 +0200, Thomas Petazzoni spake thusly:

Quoted 9 lines · Thomas De Schampheleire

package/uclibc/uclibc.mk line 397

Quoted 4 lines
package/uclibc/uclibc.mk +1 -1
-define UCLIBC_SETUP_DOT_CONFIG
+define UCLIBC_FIXUP_DOT_CONFIG
    $(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config

This this variable is actually copying the configuration file, I believe the current name of the variable is more correct than the one you propose to use, no?

Thomas did the change, because in patch 5/6 it no longer does the copy, it only does the fixup.

Quoted 7 lines
Quoted 2 lines

This should probably have been explained in the commit log that the change was needed by a future patch.

Ok, I see. I split off the change to a separate patch for clarity, but indeed at this moment it is not yet fully accurate. I can fold this patch with the 5th patch, or otherwise update the commit msg as Yann proposed, what do you prefer?

I'd fold it.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#17 lore raw

PATCH 1/1 uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG

Arnout Vandecappelle <[email protected]> schreef:

Quoted 21 lines · Thomas De Schampheleire
Quoted 20 lines · Yann E. MORIN
Quoted 18 lines

Thomas?, All,

On 2014-07-14 16:33 +0200, Thomas Petazzoni spake thusly:

Quoted 9 lines · Thomas De Schampheleire

package/uclibc/uclibc.mk line 397

Quoted 4 lines
package/uclibc/uclibc.mk +1 -1
-define UCLIBC_SETUP_DOT_CONFIG
+define UCLIBC_FIXUP_DOT_CONFIG
    $(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config

This this variable is actually copying the configuration file, I believe the current name of the variable is more correct than the one you propose to use, no?

Thomas did the change, because in patch 5/6 it no longer does the copy, it only does the fixup.

This should probably have been explained in the commit log that the change was needed by a future patch.

Quoted 6 lines
Quoted 4 lines

Ok, I see. I split off the change to a separate patch for clarity, but indeed at this moment it is not yet fully accurate. I can fold this patch with the 5th patch, or otherwise update the commit msg as Yann proposed, what do you prefer?

I'd fold it.

Since Yann says split it, I need a third opinion...

#18 lore raw

PATCH 1/1 uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG

Quoted 22 lines · Thomas De Schampheleire

Arnout Vandecappelle <[email protected]> schreef:

Quoted 21 lines · Thomas De Schampheleire
Quoted 20 lines · Yann E. MORIN
Quoted 18 lines

Thomas?, All,

On 2014-07-14 16:33 +0200, Thomas Petazzoni spake thusly:

Quoted 9 lines · Thomas De Schampheleire

package/uclibc/uclibc.mk line 397

Quoted 4 lines
package/uclibc/uclibc.mk +1 -1
-define UCLIBC_SETUP_DOT_CONFIG
+define UCLIBC_FIXUP_DOT_CONFIG
    $(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config

This this variable is actually copying the configuration file, I believe the current name of the variable is more correct than the one you propose to use, no?

Thomas did the change, because in patch 5/6 it no longer does the copy, it only does the fixup.

This should probably have been explained in the commit log that the change was needed by a future patch.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Ok, I see. I split off the change to a separate patch for clarity, but indeed at this moment it is not yet fully accurate. I can fold this patch with the 5th patch, or otherwise update the commit msg as Yann proposed, what do you prefer?

I'd fold it.

Since Yann says split it, I need a third opinion...

Your own opinion counts as the third opinion, so split it.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#19 lore raw

PATCH 1/1 uclibc: menuconfig: take into account initial settings from config file

In reply to Thomas De Schampheleire

When executing the sequence 'make clean uclibc-menuconfig', the configured config file is not taken into account and one starts from the default settings.

This patch adds an explicit target for the config file and lets the configure and menuconfig steps depend on it, fixing the problem.

---
rfc->patch:
- add target for .config to avoid menuconfig copying the config file every time (ThomasP, Arnout)
- move dependency on patch step from menuconfig to the .config target

 package/uclibc/uclibc.mk |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
package/uclibc/uclibc.mk +8 -4
diff -r 1f15cd84996d -r 34f3d55304ad package/uclibc/uclibc.mk
@@ -394,7 +394,6 @@
 	HOSTCC="$(HOSTCC)"
 
 define UCLIBC_FIXUP_DOT_CONFIG
-	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config
 	$(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D)/.config)
 	$(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH),$(@D)/.config)
 	$(call KCONFIG_SET_OPT,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D)/.config)
@@ -533,7 +532,14 @@
 	$(UCLIBC_INSTALL_UTILS_STAGING)
 endef
 
-uclibc-menuconfig: uclibc-patch
+$(eval $(generic-package))
+
+$(UCLIBC_DIR)/.config: $(UCLIBC_CONFIG_FILE) | uclibc-patch
+	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(UCLIBC_DIR)/.config
+
+$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.config
+
+uclibc-menuconfig: $(UCLIBC_DIR)/.config
 	$(MAKE1) -C $(UCLIBC_DIR) \
 		$(UCLIBC_MAKE_FLAGS) \
 		PREFIX=$(STAGING_DIR) \
@@ -542,8 +548,6 @@
 		menuconfig
 	rm -f $(UCLIBC_DIR)/.stamp_{configured,built,target_installed,staging_installed}
 
-$(eval $(generic-package))
-
 uclibc-update-config: $(UCLIBC_DIR)/.stamp_configured
 	cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE)
 
#20 lore raw

PATCH 1/1 uclibc: menuconfig: take into account initial settings from config file

Quoted 30 lines · Thomas De Schampheleire

When executing the sequence 'make clean uclibc-menuconfig', the configured config file is not taken into account and one starts from the default settings.

This patch adds an explicit target for the config file and lets the configure and menuconfig steps depend on it, fixing the problem.

---
rfc->patch:
- add target for .config to avoid menuconfig copying the config file every time (ThomasP, Arnout)
- move dependency on patch step from menuconfig to the .config target

 package/uclibc/uclibc.mk |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r 1f15cd84996d -r 34f3d55304ad package/uclibc/uclibc.mk

package/uclibc/uclibc.mk +0 -1
@@ -394,7 +394,6 @@
 	HOSTCC="$(HOSTCC)"
 
 define UCLIBC_FIXUP_DOT_CONFIG
-	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config
 	$(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D)/.config)
 	$(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH),$(@D)/.config)
 	$(call KCONFIG_SET_OPT,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D)/.config)

package/uclibc/uclibc.mk line 540

Quoted 10 lines
package/uclibc/uclibc.mk +6 -1
@@ -533,7 +532,14 @@
 	$(UCLIBC_INSTALL_UTILS_STAGING)
 endef
 
-uclibc-menuconfig: uclibc-patch
+$(eval $(generic-package))
+
+$(UCLIBC_DIR)/.config: $(UCLIBC_CONFIG_FILE) | uclibc-patch
+	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(UCLIBC_DIR)/.config
+
+$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.config

This should be $(UCLIBC_TARGET_CONFIGURE) instead of
$(UCLIBC_DIR)/.stamp_configured.

Actually, I'd prefer the FOO_TARGET_* variables to be removed completely.
However, as long as they exist, I guess they should be used.

Other than that, looks good to me.

Regards,
Arnout

Quoted 15 lines
package/uclibc/uclibc.mk +2 -2
+
+uclibc-menuconfig: $(UCLIBC_DIR)/.config
 	$(MAKE1) -C $(UCLIBC_DIR) \
 		$(UCLIBC_MAKE_FLAGS) \
 		PREFIX=$(STAGING_DIR) \
@@ -542,8 +548,6 @@
 		menuconfig
 	rm -f $(UCLIBC_DIR)/.stamp_{configured,built,target_installed,staging_installed}
 
-$(eval $(generic-package))
-
 uclibc-update-config: $(UCLIBC_DIR)/.stamp_configured
 	cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE)
 
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#21 lore raw

PATCH 1/1 uclibc: menuconfig: take into account initial settings from config file

Arnout Vandecappelle <[email protected]> schreef:

Quoted 34 lines · Thomas De Schampheleire
Quoted 33 lines

When executing the sequence 'make clean uclibc-menuconfig', the configured config file is not taken into account and one starts from the default settings.

This patch adds an explicit target for the config file and lets the configure and menuconfig steps depend on it, fixing the problem.

---
rfc->patch:
- add target for .config to avoid menuconfig copying the config file every time (ThomasP, Arnout)
- move dependency on patch step from menuconfig to the .config target

 package/uclibc/uclibc.mk |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r 1f15cd84996d -r 34f3d55304ad package/uclibc/uclibc.mk

package/uclibc/uclibc.mk +0 -1
@@ -394,7 +394,6 @@
 	HOSTCC="$(HOSTCC)"
 
 define UCLIBC_FIXUP_DOT_CONFIG
-	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(@D)/.config
 	$(call KCONFIG_SET_OPT,CROSS_COMPILER_PREFIX,"$(TARGET_CROSS)",$(@D)/.config)
 	$(call KCONFIG_ENABLE_OPT,TARGET_$(UCLIBC_TARGET_ARCH),$(@D)/.config)
 	$(call KCONFIG_SET_OPT,TARGET_ARCH,"$(UCLIBC_TARGET_ARCH)",$(@D)/.config)
@@ -533,7 +532,14 @@
 	$(UCLIBC_INSTALL_UTILS_STAGING)
 endef
 
Quoted 10 lines

package/uclibc/uclibc.mk line 540

Quoted 7 lines
package/uclibc/uclibc.mk +6 -1
-uclibc-menuconfig: uclibc-patch
+$(eval $(generic-package))
+
+$(UCLIBC_DIR)/.config: $(UCLIBC_CONFIG_FILE) | uclibc-patch
+	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(UCLIBC_DIR)/.config
+
+$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.config

This should be $(UCLIBC_TARGET_CONFIGURE) instead of $(UCLIBC_DIR)/.stamp_configured.

Indeed, will fix.

Quoted 2 lines

Actually, I'd prefer the FOO_TARGET_* variables to be removed completely.

I guess Thomas P can provide his input here?

#22 lore raw

PATCH 1/1 uclibc: menuconfig: take into account initial settings from config file

Quoted 2 lines · Thomas De Schampheleire
Quoted 1 line

Actually, I'd prefer the FOO_TARGET_* variables to be removed completely.

I guess Thomas P can provide his input here?

That removal would be completely independent of this series, of course...

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#23 lore raw

PATCH 1/1 uclibc: update-config: preserve freshly configured settings

In reply to Thomas De Schampheleire

In the sequence:

make uclibc-menuconfig
make uclibc-update-config

the freshly configured settings from the menuconfig are lost during the update-config step. This is because update-config depends on the configure step, which starts by copying the config file to the build directory.

Instead, stop depending on the configure step from update-config, and introduce a new stamp file .stamp_config_fixup_done, which applies any fixups on the .config file.

This has the added bonus that 'uclibc-update-config' no longer needs the toolchain to be available, which makes:
make clean uclibc-menuconfig uclibc-update-config
much faster and user-friendly.

Additionally, make sure that 'make clean uclibc-update-config' works properly, by depending on .stamp_config_fixup_done so that the config file is present and fixed.

Fixes bug #7154 https://bugs.busybox.net/show_bug.cgi?id=7154

---
rfc->patch:
- rebase
- rename .stamp_config_file_fixed into .stamp_config_fixup_done
- add dependency on .config from .stamp_config_file_fixed (Arnout)
- remove explicit call to UCLIBC_FIXUP_DOT_CONFIG from configure commands, and instead depend on .stamp_config_fixup_done.

 package/uclibc/uclibc.mk |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
package/uclibc/uclibc.mk +8 -4
diff -r 34f3d55304ad -r 82c951fdcf48 package/uclibc/uclibc.mk
@@ -432,7 +432,6 @@
 endef
 
 define UCLIBC_CONFIGURE_CMDS
-	$(UCLIBC_FIXUP_DOT_CONFIG)
 	$(MAKE1) -C $(UCLIBC_DIR) \
 		$(UCLIBC_MAKE_FLAGS) \
 		PREFIX=$(STAGING_DIR) \
@@ -537,7 +536,11 @@
 $(UCLIBC_DIR)/.config: $(UCLIBC_CONFIG_FILE) | uclibc-patch
 	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(UCLIBC_DIR)/.config
 
-$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.config
+$(UCLIBC_DIR)/.stamp_config_fixup_done: $(UCLIBC_DIR)/.config
+	$(UCLIBC_FIXUP_DOT_CONFIG)
+	touch $@
+
+$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.stamp_config_fixup_done
 
 uclibc-menuconfig: $(UCLIBC_DIR)/.config
 	$(MAKE1) -C $(UCLIBC_DIR) \
@@ -546,9 +549,10 @@
 		DEVEL_PREFIX=/usr/ \
 		RUNTIME_PREFIX=$(STAGING_DIR)/ \
 		menuconfig
-	rm -f $(UCLIBC_DIR)/.stamp_{configured,built,target_installed,staging_installed}
+	rm -f $(UCLIBC_DIR)/.stamp_{config_fixup_done,configured,built}
+	rm -f $(UCLIBC_DIR)/.stamp_{target,staging}_installed
 
-uclibc-update-config: $(UCLIBC_DIR)/.stamp_configured
+uclibc-update-config: $(UCLIBC_DIR)/.stamp_config_fixup_done
 	cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE)
 
 # Before uClibc is built, we must have the second stage cross-compiler
#24 lore raw

PATCH 1/1 uclibc: update-config: preserve freshly configured settings

Quoted 5 lines · Thomas De Schampheleire

In the sequence:

make uclibc-menuconfig
make uclibc-update-config

Quoted 7 lines

the freshly configured settings from the menuconfig are lost during the update-config step. This is because update-config depends on the configure step, which starts by copying the config file to the build directory.

Instead, stop depending on the configure step from update-config, and introduce a new stamp file .stamp_config_fixup_done, which applies any fixups on the .config file.

I think the commit message should explain why this stamp file is preferred over
repeating the fixup in each target.

Quoted 37 lines

This has the added bonus that 'uclibc-update-config' no longer needs the toolchain to be available, which makes:
make clean uclibc-menuconfig uclibc-update-config
much faster and user-friendly.

Additionally, make sure that 'make clean uclibc-update-config' works properly, by depending on .stamp_config_fixup_done so that the config file is present and fixed.

Fixes bug #7154 https://bugs.busybox.net/show_bug.cgi?id=7154

---
rfc->patch:
- rebase
- rename .stamp_config_file_fixed into .stamp_config_fixup_done
- add dependency on .config from .stamp_config_file_fixed (Arnout)
- remove explicit call to UCLIBC_FIXUP_DOT_CONFIG from configure commands, and instead depend on .stamp_config_fixup_done.

 package/uclibc/uclibc.mk |  12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff -r 34f3d55304ad -r 82c951fdcf48 package/uclibc/uclibc.mk

package/uclibc/uclibc.mk +0 -1
@@ -432,7 +432,6 @@
 endef
 
 define UCLIBC_CONFIGURE_CMDS
-	$(UCLIBC_FIXUP_DOT_CONFIG)
 	$(MAKE1) -C $(UCLIBC_DIR) \
 		$(UCLIBC_MAKE_FLAGS) \
 		PREFIX=$(STAGING_DIR) \

package/uclibc/uclibc.mk line 541

Quoted 7 lines
package/uclibc/uclibc.mk +3 -1
@@ -537,7 +536,11 @@
 $(UCLIBC_DIR)/.config: $(UCLIBC_CONFIG_FILE) | uclibc-patch
 	$(INSTALL) -m 0644 $(UCLIBC_CONFIG_FILE) $(UCLIBC_DIR)/.config
 
-$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.config
+$(UCLIBC_DIR)/.stamp_config_fixup_done: $(UCLIBC_DIR)/.config
+	$(UCLIBC_FIXUP_DOT_CONFIG)
+	touch $@
	$(@)touch $@

like the rest of pkg-generic.mk.

Otherwise, looks good to me.

Regards,
Arnout

Quoted 19 lines
package/uclibc/uclibc.mk +5 -2
+
+$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.stamp_config_fixup_done
 
 uclibc-menuconfig: $(UCLIBC_DIR)/.config
 	$(MAKE1) -C $(UCLIBC_DIR) \
@@ -546,9 +549,10 @@
 		DEVEL_PREFIX=/usr/ \
 		RUNTIME_PREFIX=$(STAGING_DIR)/ \
 		menuconfig
-	rm -f $(UCLIBC_DIR)/.stamp_{configured,built,target_installed,staging_installed}
+	rm -f $(UCLIBC_DIR)/.stamp_{config_fixup_done,configured,built}
+	rm -f $(UCLIBC_DIR)/.stamp_{target,staging}_installed
 
-uclibc-update-config: $(UCLIBC_DIR)/.stamp_configured
+uclibc-update-config: $(UCLIBC_DIR)/.stamp_config_fixup_done
 	cp -f $(UCLIBC_DIR)/.config $(UCLIBC_CONFIG_FILE)
 
 # Before uClibc is built, we must have the second stage cross-compiler
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#25 lore raw

PATCH 1/1 uclibc: update-config: preserve freshly configured settings

Hi Arnout,

Quoted 10 lines · Arnout Vandecappelle
Quoted 9 lines · Thomas De Schampheleire

In the sequence:

make uclibc-menuconfig
make uclibc-update-config

the freshly configured settings from the menuconfig are lost during the update-config step. This is because update-config depends on the configure step, which starts by copying the config file to the build directory.

Quoted 7 lines
Quoted 3 lines

Instead, stop depending on the configure step from update-config, and introduce a new stamp file .stamp_config_fixup_done, which applies any fixups on the .config file.

I think the commit message should explain why this stamp file is preferred over
repeating the fixup in each target.

I'm trying to come up with good reasons here, but the only real one I can find is to avoid duplicating code and avoid redoing the fixup unnecessarily.

Did you have anything else in mind?

Best regards,
Thomas

#26 lore raw

PATCH 1/1 uclibc: update-config: preserve freshly configured settings

Quoted 21 lines · Thomas De Schampheleire

Hi Arnout,

Quoted 10 lines · Arnout Vandecappelle
Quoted 9 lines · Thomas De Schampheleire

In the sequence:

make uclibc-menuconfig
make uclibc-update-config

the freshly configured settings from the menuconfig are lost during the update-config step. This is because update-config depends on the configure step, which starts by copying the config file to the build directory.

Quoted 7 lines
Quoted 3 lines

Instead, stop depending on the configure step from update-config, and introduce a new stamp file .stamp_config_fixup_done, which applies any fixups on the .config file.

I think the commit message should explain why this stamp file is preferred over
repeating the fixup in each target.

Quoted 5 lines

I'm trying to come up with good reasons here, but the only real one I can find is to avoid duplicating code and avoid redoing the fixup unnecessarily.

Did you have anything else in mind?

Well, I never proposed to introduce an extra stamp file, did I? :-)

The reasons you put forward are OK, they should just be mentioned in the commit
message because it's a change from how things are currently done, and this should be motivated. That way, if someone later on finds a reason to revert to repeating the fixup, they can see why it was done this way to begin with.

BTW, it doesn't really avoid duplication of code. Now we have repetitions of

$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.stamp_config_fixup_done

and otherwise we'd have repetitions of

define UCLIBC_CONFIGURE_CMDS

	$(UCLIBC_FIXUP_DOT_CONFIG)

Regards,
Arnout

Quoted 4 lines

Best regards,
Thomas

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#27 lore raw

PATCH 1/1 uclibc: update-config: preserve freshly configured settings

Hi Arnout,

Quoted 26 lines · Arnout Vandecappelle
Quoted 25 lines · Thomas De Schampheleire

Hi Arnout,

Quoted 10 lines · Arnout Vandecappelle
Quoted 9 lines · Thomas De Schampheleire

In the sequence:

make uclibc-menuconfig
make uclibc-update-config

the freshly configured settings from the menuconfig are lost during the update-config step. This is because update-config depends on the configure step, which starts by copying the config file to the build directory.

Quoted 7 lines
Quoted 3 lines

Instead, stop depending on the configure step from update-config, and introduce a new stamp file .stamp_config_fixup_done, which applies any fixups on the .config file.

I think the commit message should explain why this stamp file is preferred over
repeating the fixup in each target.

I'm trying to come up with good reasons here, but the only real one I can find is to avoid duplicating code and avoid redoing the fixup unnecessarily.

Quoted 8 lines
Quoted 1 line

Did you have anything else in mind?

Well, I never proposed to introduce an extra stamp file, did I? :-)

The reasons you put forward are OK, they should just be mentioned in the commit
message because it's a change from how things are currently done, and this should be motivated. That way, if someone later on finds a reason to revert to repeating the fixup, they can see why it was done this way to begin with.

Is the commit message of v2 sufficient for you or should I add something?

Quoted 9 lines

BTW, it doesn't really avoid duplication of code. Now we have repetitions of

$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.stamp_config_fixup_done

and otherwise we'd have repetitions of

define UCLIBC_CONFIGURE_CMDS

        $(UCLIBC_FIXUP_DOT_CONFIG)

Yes true.
If others also prefer the repeating of FIXUP_DOT_CONFIG over the stamp file solution I can change that, of course.

Best regards,
thomas

#28 lore raw

PATCH 1/1 uclibc: update-config: preserve freshly configured settings

Quoted 31 lines · Thomas De Schampheleire

Hi Arnout,

Quoted 28 lines · Arnout Vandecappelle
Quoted 26 lines · Thomas De Schampheleire

Hi Arnout,

Quoted 10 lines · Arnout Vandecappelle
Quoted 9 lines · Thomas De Schampheleire

In the sequence:

make uclibc-menuconfig
make uclibc-update-config

the freshly configured settings from the menuconfig are lost during the update-config step. This is because update-config depends on the configure step, which starts by copying the config file to the build directory.

Quoted 7 lines
Quoted 3 lines

Instead, stop depending on the configure step from update-config, and introduce a new stamp file .stamp_config_fixup_done, which applies any fixups on the .config file.

I think the commit message should explain why this stamp file is preferred over
repeating the fixup in each target.

I'm trying to come up with good reasons here, but the only real one I can find is to avoid duplicating code and avoid redoing the fixup unnecessarily.

Did you have anything else in mind?

Quoted 8 lines
Quoted 6 lines

Well, I never proposed to introduce an extra stamp file, did I? :-)

The reasons you put forward are OK, they should just be mentioned in the commit
message because it's a change from how things are currently done, and this should be motivated. That way, if someone later on finds a reason to revert to repeating the fixup, they can see why it was done this way to begin with.

Is the commit message of v2 sufficient for you or should I add something?

How about: "With the extra stamp file, we avoid redoing the fixup unnecessarily."

(I don't have time now to look at v2 in detail.)

Quoted 6 lines
Quoted 6 lines

BTW, it doesn't really avoid duplication of code. Now we have repetitions of

$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.stamp_config_fixup_done

Quoted 8 lines
Quoted 4 lines

and otherwise we'd have repetitions of

define UCLIBC_CONFIGURE_CMDS

        $(UCLIBC_FIXUP_DOT_CONFIG)

Yes true.
If others also prefer the repeating of FIXUP_DOT_CONFIG over the stamp file solution I can change that, of course.

I'm OK with either way.

I'm not really a big fan of adding an extra stamp file. However, I can imagine
that we'll evolve towards a new generic step between patch and configure (also for e.g. autoreconf); then this approach will match nicely with the generic infrastructure.

Actually, this is probably one for Peter to rule upon.

Regards,
Arnout

Quoted 4 lines

Best regards,
thomas

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#29 lore raw

PATCH 1/1 uclibc: update-config: preserve freshly configured settings

Hi Arnout, all,

Quoted 60 lines · Arnout Vandecappelle
Quoted 31 lines · Thomas De Schampheleire

Hi Arnout,

Quoted 28 lines · Arnout Vandecappelle
Quoted 26 lines · Thomas De Schampheleire

Hi Arnout,

Quoted 10 lines · Arnout Vandecappelle
Quoted 9 lines · Thomas De Schampheleire

In the sequence:

make uclibc-menuconfig
make uclibc-update-config

the freshly configured settings from the menuconfig are lost during the update-config step. This is because update-config depends on the configure step, which starts by copying the config file to the build directory.

Quoted 7 lines
Quoted 3 lines

Instead, stop depending on the configure step from update-config, and introduce a new stamp file .stamp_config_fixup_done, which applies any fixups on the .config file.

I think the commit message should explain why this stamp file is preferred over
repeating the fixup in each target.

I'm trying to come up with good reasons here, but the only real one I can find is to avoid duplicating code and avoid redoing the fixup unnecessarily.

Did you have anything else in mind?

Quoted 8 lines
Quoted 6 lines

Well, I never proposed to introduce an extra stamp file, did I? :-)

The reasons you put forward are OK, they should just be mentioned in the commit
message because it's a change from how things are currently done, and this should be motivated. That way, if someone later on finds a reason to revert to repeating the fixup, they can see why it was done this way to begin with.

Is the commit message of v2 sufficient for you or should I add something?

How about: "With the extra stamp file, we avoid redoing the fixup unnecessarily."

(I don't have time now to look at v2 in detail.)

Quoted 6 lines
Quoted 6 lines

BTW, it doesn't really avoid duplication of code. Now we have repetitions of

$(UCLIBC_DIR)/.stamp_configured: $(UCLIBC_DIR)/.stamp_config_fixup_done

Quoted 8 lines
Quoted 4 lines

and otherwise we'd have repetitions of

define UCLIBC_CONFIGURE_CMDS

        $(UCLIBC_FIXUP_DOT_CONFIG)

Yes true.
If others also prefer the repeating of FIXUP_DOT_CONFIG over the stamp file solution I can change that, of course.

Quoted 9 lines

I'm OK with either way.

I'm not really a big fan of adding an extra stamp file. However, I can imagine
that we'll evolve towards a new generic step between patch and configure (also for e.g. autoreconf); then this approach will match nicely with the generic infrastructure.

Actually, this is probably one for Peter to rule upon.

I now found a pretty good reason why the stamp file is better: when extracting the kconfig logic to a common kconfig-package infrastructure, the stamp file rules and the dependency expressions can entirely be placed
in that infrastructure. The package itself only has to provide a FIXUP_DOT_CONFIG define.
If we do not use stamp files and let the CONFIGURE_CMDS actually contain FIXUP_DOT_CONFIG, then it's the responsibility of the package to actually add this, it is not under control of the kconfig-package, so more fragile.

I will also add this to the commit message.

Best regards,
Thomas

#30 lore raw

PATCH 1/1 uclibc: fix handling of configuration file

In reply to Thomas De Schampheleire
Quoted 21 lines · Thomas De Schampheleire

This patch series (part of it poster earlier as RFC) has as main goal to fix the uclibc kconfig handling with following requirements in mind:

- neither foo-menuconfig nor foo-update-config should have a dependency on the toolchain (which means we cannot depend on foo-configure)

- 'clean foo-menuconfig' should start from the specified (custom) config file

- 'foo-menuconfig foo-update-config' should preserve the changes made in the menuconfig step (this problem is reported for uclibc with bug #7154
(https://bugs.busybox.net/show_bug.cgi?id=7154).

- 'make foo-menuconfig; make foo-menuconfig' should preserve the changes made in the menuconfig step.

- 'make clean foo-update-config' should copy the initial file, do any fixups, and then save the config

Quoted 5 lines

In the process, some smaller changes are done too.

Once this series is accepted, the plan is:
- to extract the kconfig-related bits to a kconfig-package infrastructure.
- to convert busybox, linux and barebox to this kconfig-package infra too.

For the record: I agree with this plan.

I also agree with the plan to land this in 2014.08.

Regards,
Arnout

Quoted 18 lines

---
Thomas De Schampheleire (6):
pkg-utils: kconfig helpers: add basic usage documentation
pkg-utils: kconfig helpers: use single iso double quoting
uclibc: replace custom kconfig helpers with those provided by pkg-utils
uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG
uclibc: menuconfig: take into account initial settings from config file
uclibc: update-config: preserve freshly configured settings

 linux/linux.mk           |    2 +-
 package/pkg-utils.mk     |   12 +-
 package/uclibc/uclibc.mk |  230 ++++++++++++++++++--------------------
 3 files changed, 119 insertions(+), 125 deletions(-)
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#31 lore raw

PATCH 1/1 uclibc: fix handling of configuration file

In reply to Thomas De Schampheleire

Dear Thomas De Schampheleire,

Quoted 7 lines · Thomas De Schampheleire

Thomas De Schampheleire (6):
pkg-utils: kconfig helpers: add basic usage documentation
pkg-utils: kconfig helpers: use single iso double quoting
uclibc: replace custom kconfig helpers with those provided by pkg-utils
uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG
uclibc: menuconfig: take into account initial settings from config file
uclibc: update-config: preserve freshly configured settings

Patches 1 to 3 applied. The others are still in discussion.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#32 lore raw

PATCH 1/1 uclibc: fix handling of configuration file

Hi Thomas,

Quoted 12 lines · Thomas Petazzoni

Dear Thomas De Schampheleire,

Quoted 7 lines · Thomas De Schampheleire

Thomas De Schampheleire (6):
pkg-utils: kconfig helpers: add basic usage documentation
pkg-utils: kconfig helpers: use single iso double quoting
uclibc: replace custom kconfig helpers with those provided by pkg-utils
uclibc: rename SETUP_DOT_CONFIG to FIXUP_DOT_CONFIG
uclibc: menuconfig: take into account initial settings from config file
uclibc: update-config: preserve freshly configured settings

Quoted 2 lines

Patches 1 to 3 applied. The others are still in discussion.

Thanks, updated patches 4-6 coming up...