Skip to contentSkip to conversation

uClibc: redo configuration

PATCH New Bernhard Reutner-Fischer 1 participant 4 messages Jul 6, 2010

lore
Share & tools
lore
#3 lore raw

PATCH v2 4/4 busybox: configure according to {MACHINE, DISTRO}_FEATURES

In reply to Bernhard Reutner-Fischer
---
 recipes/busybox/busybox-config.inc |   28 +++++++++++++++++++++++++++
 recipes/busybox/busybox.inc        |   37 ++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 0 deletions(-)
 create mode 100644 recipes/busybox/busybox-config.inc
recipes/busybox/busybox-config.inc new file +28 -0
new file mode 100644
index 0000000..26ccec4
@@ -0,0 +1,28 @@
+# internal helper
+def busybox_cfg(feature, features, tokens, cnf, rem):
+	if type(tokens) == type(""):
+		tokens = [tokens]
+	rem.extend(['/^[# ]*' + token + '[ =]/d' for token in tokens])
+	if type(features) == type([]) and feature in features:
+		cnf.extend([token + '=y' for token in tokens])
+	else:
+		cnf.extend(['# ' + token + ' is not set' for token in tokens])
+# Map distro and machine features to config settings
+def features_to_busybox_settings(d):
+	cnf, rem = ([], [])
+	distro_features = bb.data.getVar('DISTRO_FEATURES', d).split()
+	machine_features = bb.data.getVar('MACHINE_FEATURES', d).split()
+	busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IPV6', cnf, rem)
+	busybox_cfg('largefile', distro_features, 'CONFIG_LFS', cnf, rem)
+	busybox_cfg('nls',  distro_features, 'CONFIG_LOCALE_SUPPORT', cnf, rem)
+	busybox_cfg('ipv4', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV4', cnf, rem)
+	busybox_cfg('ipv6', distro_features, 'CONFIG_FEATURE_IFUPDOWN_IPV6', cnf, rem)
+	return "\n".join(cnf), "\n".join(rem)
+# X, Y = ${@features_to_uclibc_settings(d)}
+# unfortunately doesn't seem to work with bitbake, workaround:
+def features_to_busybox_conf(d):
+	cnf, rem = features_to_busybox_settings(d)
+	return cnf
+def features_to_busybox_del(d):
+	cnf, rem = features_to_busybox_settings(d)
+	return rem
recipes/busybox/busybox.inc +37 -0
index a5346bd..827e917 100644
@@ -70,10 +70,47 @@ RDEPENDS_${PN}-udhcpd += "${PN}"
 LD = "${CC} -nostdlib"
 
 inherit cml1 update-rc.d
+require busybox-config.inc
+
+configmangle = '/CROSS_COMPILER_PREFIX/d; \
+		/CONFIG_EXTRA_CFLAGS/d; \
+		'
+OE_FEATURES := "${@features_to_busybox_conf(d)}"
+OE_DEL      := "${@features_to_busybox_del(d)}"
+DO_IPv4 := ${@base_contains('DISTRO_FEATURES', 'ipv4', 1, 0, d)}
+DO_IPv6 := ${@base_contains('DISTRO_FEATURES', 'ipv6', 1, 0, d)}
+python () {
+  if "${OE_DEL}":
+    bb.data.setVar('configmangle_append', "${OE_DEL}" + "\n", d)
+  if "${OE_FEATURES}":
+    bb.data.setVar('configmangle_append',
+                   "/^### DISTRO FEATURES$/a\\\n%s\n\n" %
+                   ("\\n".join((bb.data.expand("${OE_FEATURES}", d).split("\n")))),
+                   d)
+  bb.data.setVar('configmangle_append',
+                 "/^### CROSS$/a\\\n%s\n" %
+                  ("\\n".join(["CONFIG_CROSS_COMPILER_PREFIX=\"${TARGET_PREFIX}\"",
+			       "CONFIG_EXTRA_CFLAGS=\"${CFLAGS}\""
+                        ])
+                  ),
+                 d)
+}
 
 do_configure () {
 	sed -e 's#@DATADIR@#${datadir}#g' \
 		< ${WORKDIR}/defconfig > ${S}/.config
+	for i in 'CROSS' 'DISTRO FEATURES'; do echo "### $i"; done >> \
+		${S}/.config
+	sed -i -e '${configmangle}' ${S}/.config
+	if test ${DO_IPv4} -eq 0 && test ${DO_IPv6} -eq 0; then
+	  # disable networking applets
+	  mv ${S}/.config ${S}/.config.oe-tmp
+	  awk 'BEGIN{net=0}
+	  /^# Networking Utilities/{net=1}
+	  /^#$/{if(net){net=net+1}}
+	  {if(net==2&&$0 !~ /^#/&&$1){print("# "$1" is not set")}else{print}}' \
+		  ${S}/.config.oe-tmp > ${S}/.config
+	fi
 	cml1_do_configure
 }
 
Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 2/4 busybox: picking IPv6 per default is not up to the package

In reply to Bernhard Reutner-Fischer
---
 recipes/busybox/busybox-1.15.3/micro/defconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
recipes/busybox/busybox-1.15.3/micro/defconfig +1 -1
index 8431d19..f6eaa6d 100644
@@ -608,7 +608,7 @@ CONFIG_TIME=y
 #
 # Networking Utilities
 #
-CONFIG_FEATURE_IPV6=y
+# CONFIG_FEATURE_IPV6 is not set
 CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
 # CONFIG_VERBOSE_RESOLUTION_ERRORS is not set
 # CONFIG_ARP is not set
Signature · 1 line
1.7.1
#2 lore raw

PATCH v2 3/4 uclibc: handle DISTRO_FEATURE="largefile"

In reply to Bernhard Reutner-Fischer
---
 recipes/uclibc/uclibc-config.inc |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
recipes/uclibc/uclibc-config.inc +5 -4
index 624f596..ff334da 100644
@@ -95,10 +95,11 @@ def features_to_uclibc_settings(d):
 	cnf, rem = ([], [])
 	distro_features = bb.data.getVar('DISTRO_FEATURES', d).split()
 	machine_features = bb.data.getVar('MACHINE_FEATURES', d).split()
-	uclibc_cfg('ipv4', distro_features, 'UCLIBC_HAS_IPV4', cnf, rem)
-	uclibc_cfg('ipv6', distro_features, 'UCLIBC_HAS_IPV6', cnf, rem)
-	uclibc_cfg('nls',  distro_features, 'UCLIBC_HAS_LOCALE', cnf, rem)
-	uclibc_cfg('bx',   machine_features, 'USE_BX', cnf, rem)
+	uclibc_cfg('ipv4',      distro_features, 'UCLIBC_HAS_IPV4', cnf, rem)
+	uclibc_cfg('ipv6',      distro_features, 'UCLIBC_HAS_IPV6', cnf, rem)
+	uclibc_cfg('largefile', distro_features, 'UCLIBC_HAS_LFS', cnf, rem)
+	uclibc_cfg('nls',       distro_features, 'UCLIBC_HAS_LOCALE', cnf, rem)
+	uclibc_cfg('bx',        machine_features,'USE_BX', cnf, rem)
 	return "\n".join(cnf), "\n".join(rem)
 # X, Y = ${@features_to_uclibc_settings(d)}
 # unfortunately doesn't seem to work with bitbake, workaround:
Signature · 1 line
1.7.1
#0 lore raw

PATCH v2 1/4 uClibc: redo configuration

---
 conf/distro/include/sane-toolchain-uclibc.inc |    7 +
 conf/distro/include/sane-toolchain.inc        |    3 +-
 conf/distro/include/uclibc.inc                |    8 +
 recipes/uclibc/bfin-uclibc_svn.bb             |    2 +-
 recipes/uclibc/uclibc-config.inc              |  110 +++++++++++
 recipes/uclibc/uclibc-initial_0.9.30.2.bb     |   12 +-
 recipes/uclibc/uclibc-initial_0.9.30.bb       |    5 +-
 recipes/uclibc/uclibc-initial_git.bb          |    6 +-
 recipes/uclibc/uclibc-old.inc                 |  186 +++++++++++++++++++
 recipes/uclibc/uclibc.inc                     |  246 ++++++++++++-------------
 recipes/uclibc/uclibc_0.9.28.bb               |    2 +-
 recipes/uclibc/uclibc_0.9.29.bb               |    2 +-
 recipes/uclibc/uclibc_0.9.30.1.bb             |    2 +-
 recipes/uclibc/uclibc_0.9.30.bb               |    2 +-
 recipes/uclibc/uclibc_git.bb                  |    1 -
 15 files changed, 444 insertions(+), 150 deletions(-)
 create mode 100644 recipes/uclibc/uclibc-config.inc
 create mode 100644 recipes/uclibc/uclibc-old.inc
conf/distro/include/sane-toolchain-uclibc.inc +7 -0
index 314340a..9f515a0 100644
@@ -14,6 +14,13 @@ USE_NLS ?= "no"
 USE_NLS_glib-2.0-native = "yes"
 USE_NLS_gcc-cross = "no"
 
+PREFERRED_VERSION_uclibc                    ?= "${PREFERRED_UCLIBC_VERSION}"
+PREFERRED_VERSION_uclibc-initial            ?= "${PREFERRED_UCLIBC_VERSION}"
+PREFERRED_VERSION_uclibc-cross              ?= "${PREFERRED_UCLIBC_VERSION}"
+PREFERRED_VERSION_uclibc-cross-sdk          ?= "${PREFERRED_UCLIBC_VERSION}"
+PREFERRED_VERSION_uclibc-cross-initial      ?= "${PREFERRED_UCLIBC_VERSION}"
+PREFERRED_VERSION_uclibc-cross-intermediate ?= "${PREFERRED_UCLIBC_VERSION}"
+
 #mess with compiler flags to use -Os instead of -O2
 #Please see http://free-electrons.com/doc/embedded_linux_optimizations/img47.html for some more info
 FULL_OPTIMIZATION = "-fexpensive-optimizations -fomit-frame-pointer -frename-registers -Os"
conf/distro/include/sane-toolchain.inc +1 -2
index 00ba0f9..6b6b170 100644
@@ -13,8 +13,7 @@ PREFERRED_VERSION_glibc             ?= "2.10.1"
 PREFERRED_VERSION_glibc-initial     ?= "2.10.1"
 PREFERRED_VERSION_eglibc             ?= "2.11"
 PREFERRED_VERSION_eglibc-initial     ?= "2.11"
-PREFERRED_VERSION_uclibc            ?= "0.9.30.1"
-PREFERRED_VERSION_uclibc-initial    ?= "0.9.30.1"
+PREFERRED_UCLIBC_VERSION            ?= "0.9.31"
 
 # Some systems need a special gcc version
 PREFERRED_GCC_VERSION_486sx          ?= "4.3.2"
conf/distro/include/uclibc.inc +8 -0
index ee18fc8..b40fbf5 100644
@@ -9,3 +9,11 @@ PREFERRED_PROVIDER_virtual/libintl_avr32 = "proxy-libintl"
 PREFERRED_PROVIDER_virtual/libc = "uclibc"
 PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-initial = "uclibc-initial"
 PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}libc-for-gcc = "uclibc"
+
+# libc settings
+DISTRO_FEATURES += "${@['', ' nls'][bb.data.getVar('ENABLE_BINARY_LOCALE_GENERATION', d, 1) == '1']}"
+MACHINE_FEATURES += "${@['', ' bx'][bb.data.getVar('ARM_INSTRUCTION_SET', d, 1) == 'thumb']}"
+# FIXME: We enable IPv4 per default to avoid alot of breakage.
+# FIXME: Figure out an acceptable way to negotiate either
+# FIXME: desired features or hard requirements, either top-down or bottom-up.
+DISTRO_FEATURES += " ipv4"
recipes/uclibc/bfin-uclibc_svn.bb +1 -1
index e8cb63e..2757fc2 100644
@@ -9,7 +9,7 @@
 UCLIBC_BASE ?= "0.9.29"
 PV = "${UCLIBC_BASE}+svnr${SRCPV}"
 
-require uclibc.inc
+require uclibc-old.inc
 PR = "${INC_PR}.0"
 SRCREV = "1857"
 PROVIDES_append_bfin = " virtual/${TARGET_PREFIX}libc-for-gcc "
recipes/uclibc/uclibc-config.inc new file +110 -0

110 lines not on this page · raw message

recipes/uclibc/uclibc-initial_0.9.30.2.bb +4 -8
index a9fa146..d00cb38 100644
@@ -7,19 +7,15 @@ PACKAGES = ""
 
 do_install() {
 	# Install initial headers into the cross dir
-	make V=1 CC="${CC}" PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
-		install_headers
+	make PREFIX=${D} install_headers
 	#ln -sf include ${CROSS_DIR}/${TARGET_SYS}/sys-include
 
-	# This conflicts with the c++ version of this header
-	rm -f ${D}${includedir}/bits/atomicity.h
-	install -d ${D}${libdir}/
-	install -m 644 lib/crt[1in].o ${D}${libdir}/
-	install -m 644 lib/libc.so ${D}${libdir}/
+	install -d ${D}${layout_libdir}/
+	install -m 644 lib/crt[1in].o lib/libc.so ${D}${layout_libdir}/
 }
 
 do_compile () {
-	make V=1 CC="${CC}" PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
+	make PREFIX=${D} \
 		lib/crt1.o lib/crti.o lib/crtn.o
 	${CC} -nostdlib -nostartfiles -shared -x c /dev/null \
 		-o lib/libc.so
recipes/uclibc/uclibc-initial_0.9.30.bb +1 -4
index 84c35c8..9391a8c 100644
@@ -12,11 +12,8 @@ do_install() {
 
 	#ln -sf include ${CROSS_DIR}/${TARGET_SYS}/sys-include
 
-	# This conflicts with the c++ version of this header
-	rm -f ${D}${includedir}/bits/atomicity.h
 	install -d ${D}${libdir}/
-	install -m 644 lib/crt[1in].o ${D}${libdir}/
-	install -m 644 lib/libc.so ${D}${libdir}/
+	install -m 644 lib/crt[1in].o lib/libc.so ${D}${libdir}/
 }
 
 do_compile () {
recipes/uclibc/uclibc-initial_git.bb +2 -4
index 8c582e0..dd69dc0 100644
@@ -7,19 +7,17 @@ PACKAGES = ""
 
 do_install() {
 	# Install initial headers into the cross dir
-	make V=1 CC="${CC}" PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
+	make PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
 		install_headers
 	#ln -sf include ${CROSS_DIR}/${TARGET_SYS}/sys-include
 
-	# This conflicts with the c++ version of this header
-	rm -f ${D}${includedir}/bits/atomicity.h
 	install -d ${D}${libdir}/
 	install -m 644 lib/crt[1in].o ${D}${libdir}/
 	install -m 755 lib/lib[cm].so ${D}${libdir}/
 }
 
 do_compile () {
-	make V=1 CC="${CC}" PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
+	make PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \
 		lib/crt1.o lib/crti.o lib/crtn.o
 	${CC} -nostdlib -nostartfiles -shared -x c /dev/null \
 		-o lib/libc.so
recipes/uclibc/uclibc-old.inc new file +186 -0

186 lines not on this page · raw message

recipes/uclibc/uclibc.inc +120 -126

298 lines not on this page · raw message

recipes/uclibc/uclibc_0.9.28.bb +1 -1
index a43d5ed..7da53f9 100644
@@ -1,4 +1,4 @@
-require uclibc.inc
+require uclibc-old.inc
 PR = "${INC_PR}.0"
 
 # This is the correct KERNEL_SOURCE location, if the uClibc
recipes/uclibc/uclibc_0.9.29.bb +1 -1
index b83cd2e..829777b 100644
@@ -8,7 +8,7 @@
 #
 UCLIBC_BASE ?= "0.9.29"
 
-require uclibc.inc
+require uclibc-old.inc
 PR = "${INC_PR}.0"
 
 PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
recipes/uclibc/uclibc_0.9.30.1.bb +1 -1
index ea69249..d3d5c58 100644
@@ -8,7 +8,7 @@
 #
 UCLIBC_BASE ?= "0.9.30.1"
 
-require uclibc.inc
+require uclibc-old.inc
 PR = "${INC_PR}.4"
 
 PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
recipes/uclibc/uclibc_0.9.30.bb +1 -1
index 5d267b5..36e9de3 100644
@@ -8,7 +8,7 @@
 #
 UCLIBC_BASE ?= "0.9.30"
 
-require uclibc.inc
+require uclibc-old.inc
 PR = "${INC_PR}.1"
 
 PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc"
recipes/uclibc/uclibc_git.bb +0 -1
index 9640ef2..e68135e 100644
@@ -26,7 +26,6 @@ FILESPATHPKG =. "uclibc-git:uclibc-${UCLIBC_BASE}:"
 KERNEL_SOURCE = "${CROSS_DIR}/${TARGET_SYS}"
 
 SRC_URI = "git://uclibc.org/uClibc.git;branch=master;protocol=git \
-	${@['${UCLIBC_LOCALE_URI}', ''][bb.data.getVar('USE_NLS', d, 1) != 'yes']} \
 	file://uClibc.config \
 	file://uClibc.machine \
 	file://uClibc.distro \
Signature · 1 line
1.7.1