uclibc support in oe-core v3
v3 cover uclibc support in oe-core v3
This patchset works well with both uclibc and eglibc For uclibc one would need meta-openembedded layer for now I have included the feedback on v2
Additionally inherit gettext for libx11 recipes
alsa-utils needs to fix exp10 references for uclibc
Pull URL: git://git.openembedded.org/openembedded-core-contrib
Branch: kraj/uclibc
Browse: http://git.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=kraj/uclibc
Thanks,
Khem Raj <[email protected]>
---
Khem Raj (4):
gettext.bbclass: Use _append instead of =+
insane.bbclass: Checking for NLS too when checking gettext dependency
libx11: Use inherit gettext
alsa-utils_1.0.24.2.bb: Fix build for uclibc targets
meta/classes/gettext.bbclass | 30 ++++++++++++++----- meta/classes/insane.bbclass | 9 +++-- meta/recipes-graphics/xorg-lib/libx11_1.3.4.bb | 3 +- meta/recipes-graphics/xorg-lib/libx11_git.bb | 6 ++- .../uclibc-exp10-replacement.patch | 21 ++++++++++++++ .../recipes-multimedia/alsa/alsa-utils_1.0.24.2.bb | 4 ++- 6 files changed, 57 insertions(+), 16 deletions(-) create mode 100644 meta/recipes-multimedia/alsa/alsa-utils-1.0.24.2/uclibc-exp10-replacement.patch
Signature · 1 line
1.7.4.1
PATCH v3 1/4 gettext.bbclass: Use _append instead of =+
Ensure gettext and gettext-native are removed from DEPENDS when not using NLS
Use append instead of += to get gettext dependecies processed correctly in all cases
Dont remove gettext-native for native recipes as ENABLE_NLS is only for target and not for native recipes
Replace using 1 for a boolean type with True
Honor INHIBIT_DEFAULT_DEPS
Remove the added dependencies for gettext if INHIBIT_DEFAULT_DEPS is non null
operate on virtclass overrides individually
virtclass classes are parsed at the end hence
just doing DEPENDS munging is not enough since
it will be overridden
When inheriting cross-canadian we should not remove gettext from default deps
--- meta/classes/gettext.bbclass | 30 ++++++++++++++++++++++-------- 1 files changed, 22 insertions(+), 8 deletions(-)
meta/classes/gettext.bbclass +22 -8
@@ -1,17 +1,31 @@ def gettext_after_parse(d): # Remove the NLS bits if USE_NLS is no. - if bb.data.getVar('USE_NLS', d, 1) == 'no': + if bb.data.getVar('USE_NLS', d, True) == 'no': cfg = oe_filter_out('^--(dis|en)able-nls$', bb.data.getVar('EXTRA_OECONF', d, 1) or "", d) cfg += " --disable-nls" - depends = bb.data.getVar('DEPENDS', d, 1) or "" - bb.data.setVar('DEPENDS', oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d) + depends = bb.data.getVar('DEPENDS', d, True) or "" + depends = oe_filter_out('^(virtual/libiconv|virtual/libintl|virtual/gettext|gettext)$', depends, d) + if not oe.utils.inherits(d, 'native', 'nativesdk', 'cross', 'crosssdk'): + depends = oe_filter_out('^(gettext-native)$', depends, d) + bb.data.setVar('DEPENDS', depends, d) bb.data.setVar('EXTRA_OECONF', cfg, d) - + # check if INHIBIT_DEFAULT_DEPS is 1 then we forcibly remove dependencies + # added by this class through DEPENDS_GETTEXT + if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not oe.utils.inherits(d, 'cross-canadian'): + depends_native = bb.data.getVar('DEPENDS_virtclass-native', d, True) or "" + depends_nativesdk = bb.data.getVar('DEPENDS_virtclass-nativesdk', d, True) or "" + depends = bb.data.getVar('DEPENDS', d, True) or "" + gettext_deps = bb.data.getVar('DEPENDS_GETTEXT', d, True).replace(' ','|') + gettext_deps = '^(' + gettext_deps + ')$' + depends_native = oe_filter_out(gettext_deps, depends_native, d) + depends_nativesdk = oe_filter_out(gettext_deps, depends_nativesdk, d) + depends = oe_filter_out(gettext_deps, depends, d) + bb.data.setVar('DEPENDS_virtclass-native', depends, d) + bb.data.setVar('DEPENDS_virtclass-nativesdk', depends, d) + bb.data.setVar('DEPENDS', depends, d) python () { gettext_after_parse(d) } - -DEPENDS_GETTEXT = "gettext gettext-native" - -DEPENDS =+ "${DEPENDS_GETTEXT}" EXTRA_OECONF += "--enable-nls" +DEPENDS_GETTEXT = "virtual/gettext gettext-native" +DEPENDS =+ "${DEPENDS_GETTEXT}"
Signature · 1 line
1.7.4.1
PATCH v3 2/4 insane.bbclass: Checking for NLS too when checking gettext dependency
In reply to Khem RajChecking for gettext is not needed when --disable-nls is used
Let user know what variant of gettext is missing e.g. gettext-native, gettext-nativesdk etc, reveals a bit more for user
Check for virtual/gettext
--- meta/classes/insane.bbclass | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
meta/classes/insane.bbclass +5 -4
@@ -578,20 +578,21 @@ Rerun configure task after fixing this. The path was '%s'""" % root) if "configure.in" in files: configs.append(os.path.join(root, "configure.in")) - if "gettext" not in bb.data.getVar('P', d, True) and "gcc-runtime" not in bb.data.getVar('P', d, True): + cnf = bb.data.getVar('EXTRA_OECONF', d, True) or "" + if "gettext" not in bb.data.getVar('P', d, True) and "gcc-runtime" not in bb.data.getVar('P', d, True) and "--disable-nls" not in cnf: if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d) or bb.data.inherits_class('crosssdk', d) or bb.data.inherits_class('nativesdk', d): gt = "gettext-native" elif bb.data.inherits_class('cross-canadian', d): gt = "gettext-nativesdk" else: - gt = "gettext" + gt = "virtual/gettext" deps = bb.utils.explode_deps(bb.data.getVar('DEPENDS', d, True) or "") if gt not in deps: for config in configs: gnu = "grep \"^[[:space:]]*AM_GNU_GETTEXT\" %s >/dev/null" % config if os.system(gnu) == 0: - bb.fatal("""Gettext required but not in DEPENDS for file %s. -Missing inherit gettext?""" % config) + bb.fatal("""%s required but not in DEPENDS for file %s. +Missing inherit gettext?""" % (gt, config)) if not package_qa_check_license(workdir, d): bb.fatal("Licensing Error: LIC_FILES_CHKSUM does not match, please fix")
Signature · 1 line
1.7.4.1
PATCH v3 3/4 libx11: Use inherit gettext
In reply to Khem RajAvoid direct depependency on gettext, inherit class instead
--- meta/recipes-graphics/xorg-lib/libx11_1.3.4.bb | 3 ++- meta/recipes-graphics/xorg-lib/libx11_git.bb | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-)
meta/recipes-graphics/xorg-lib/libx11_1.3.4.bb +2 -1
@@ -1,4 +1,5 @@ require libx11.inc +inherit gettext LICENSE = "MIT & MIT-style & BSD" LIC_FILES_CHKSUM = "file://COPYING;md5=bf75bfe4d05068311b5e6862d4b5f2c5"
@@ -14,7 +15,7 @@ SRC_URI[md5sum] = "f65c9c7ecbfb64c19dbd7927160d63fd" SRC_URI[sha256sum] = "88d7238ce5f7cd123450567de7a3b56a43556e4ccc45df38b8324147c889a844" DEPENDS += "bigreqsproto xproto xextproto xtrans libxau xcmiscproto \ - libxdmcp xf86bigfontproto kbproto inputproto xproto-native gettext" + libxdmcp xf86bigfontproto kbproto inputproto xproto-native" EXTRA_OECONF += "--without-xcb"
meta/recipes-graphics/xorg-lib/libx11_git.bb +4 -2
@@ -1,11 +1,13 @@ require libx11.inc require libx11_git.inc +inherit gettext + PR = "r2" DEPENDS = "xproto xextproto xcmiscproto xf86bigfontproto kbproto inputproto \ - bigreqsproto xtrans libxau libxcb libxdmcp util-macros gettext" + bigreqsproto xtrans libxau libxcb libxdmcp util-macros" DEFAULT_PREFERENCE = "-1" -BBCLASSEXTEND = "nativesdk" +BBCLASSEXTEND = "nativesdk"
Signature · 1 line
1.7.4.1
PATCH v3 4/4 alsa-utils_1.0.24.2.bb: Fix build for uclibc targets
In reply to Khem Rajuclibc does not have exp10() implemented so we obtain same behaviour using pow()
--- .../uclibc-exp10-replacement.patch | 21 ++++++++++++++++++++ .../recipes-multimedia/alsa/alsa-utils_1.0.24.2.bb | 4 ++- 2 files changed, 24 insertions(+), 1 deletions(-) create mode 100644 meta/recipes-multimedia/alsa/alsa-utils-1.0.24.2/uclibc-exp10-replacement.patch
meta/recipes-multimedia/alsa/alsa-utils-1.0.24.2/uclibc-exp10-replacement.patch new file +21 -0
@@ -0,0 +1,21 @@ +uclibc does not have exp10 function which is glibc extension. +Bur we can get the same behavior by using pow() + +Upstream-status: Pending + +Khem Raj <[email protected]> + +Index: alsa-utils-1.0.24.2/alsamixer/volume_mapping.c +=================================================================== +--- alsa-utils-1.0.24.2.orig/alsamixer/volume_mapping.c ++++ alsa-utils-1.0.24.2/alsamixer/volume_mapping.c +@@ -36,6 +36,9 @@ + #include <math.h> + #include <stdbool.h> + #include "volume_mapping.h" ++#ifdef __UCLIBC__ ++#define exp10(x) (pow(10, (x))) ++#endif /* __UCLIBC__ */ + + #define MAX_LINEAR_DB_SCALE 24 +
meta/recipes-multimedia/alsa/alsa-utils_1.0.24.2.bb +3 -1
@@ -9,7 +9,9 @@ DEPENDS = "alsa-lib ncurses" PR = "r0" SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \ - file://ncursesfix.patch" + file://ncursesfix.patch \ + file://uclibc-exp10-replacement.patch \ + " SRC_URI[md5sum] = "8238cd57cb301d1c36bcf0ecb59ce6b2" SRC_URI[sha256sum] = "95127f740291086486c06c28118cabca0814bde48fd14dac041a9812a5ac1be2"
Signature · 1 line
1.7.4.1
Re: [PATCH 4/4] alsa-utils_1.0.24.2.bb: Fix build for uclibc targets
On Sat, Apr 30, 2011 at 19:07, Khem Raj <[email protected]> wrote:
...
meta/recipes-multimedia/alsa/alsa-utils-1.0.24.2/uclibc-exp10-replacement.patch line 2
Quoted 2 lines
meta/recipes-multimedia/alsa/alsa-utils-1.0.24.2/uclibc-exp10-replacement.patch new file +2
-0+uclibc does not have exp10 function which is glibc extension. +Bur we can get the same behavior by using pow()
...
Typo! s/Bur/But/
Signature · 3 lines
Otavio Salvador O.S. Systems E-mail: [email protected] http://www.ossystems.com.br Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br