Skip to contentSkip to conversation

gettext: Switch to disabling nls and reducing -native build dependencies to a set of pre built m4 macros

PATCH New Richard Purdie 1 participant 1 message Nov 1, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gettext: Switch to disabling nls and reducing -native build dependencies to a set of pre built m4 macros

When analysing our build performance, its apparent that binutils-cross takes an age to get built. This is due to its dependencies on flex-native and bison-native which in turn depend on gettext-native.

gettext-native is problematic as it has a significant dependency chain of its own and takes an age to build. What is worse is that we never care about the native language support in -native and -cross packages since we always force the C locale.

This patch therefore disables nls for all -native packages (its already disabled for -cross) and adds a new gettext-minimal-native package which contains the m4 macros to keep autoconf/automake happy.

This means we gain a significant build time speedup by the removal of gettext-native from most dependency chains (only being part of gettext for the target now).

For now the LICENCE field says GPLv3, the macros are actually under a FSF MIT like licence so we need to update this part of the patch in due course.

---

meta/classes/gettext.bbclass +4 -0
index d5b3d70..1793748 100644
@@ -3,9 +3,13 @@ def gettext_dependencies(d):
         return ""
     if d.getVar('INHIBIT_DEFAULT_DEPS', True) and not oe.utils.inherits(d, 'cross-canadian'):
         return ""
+    if oe.utils.inherits(d, 'native'):
+        return "gettext-minimal-native"
     return d.getVar('DEPENDS_GETTEXT', False)
 
 def gettext_oeconf(d):
+    if oe.utils.inherits(d, 'native'):
+        return '--disable-nls'
     # Remove the NLS bits if USE_NLS is no.
     if d.getVar('USE_NLS', True) == 'no' and not oe.utils.inherits(d, 'native', 'nativesdk', 'cross', 'cross-canadian'):
         return '--disable-nls'
meta/recipes-core/gettext/gettext-minimal-0.18.1.1/COPYING renamed from dev/null +674 -0

674 lines not on this page · raw message

meta/recipes-core/gettext/gettext-minimal-0.18.1.1/aclocal.tgz renamed from dev/null +0 -0
new file mode 100644
index 0000000..6dab00d

Binary files differ

meta/recipes-core/gettext/gettext-minimal-native_0.18.1.1.bb renamed from dev/null +19 -0
new file mode 100644
index 0000000..71c6045
@@ -0,0 +1,19 @@
+SRC_URI = "file://aclocal.tgz \
+           file://COPYING"
+
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_AUTOTOOLS_DEPS = "1"
+
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+
+inherit native
+
+PR = "r1"
+
+S = "${WORKDIR}"
+
+do_install () {
+	install -d ${D}${datadir}/aclocal/
+	cp ${WORKDIR}/*.m4 ${D}${datadir}/aclocal/
+}
meta/recipes-devtools/bison/bison_2.5.bb +1 -1
index eb5d87c..c5113cd 100644
@@ -21,7 +21,7 @@ SRC_URI = "${BASE_SRC_URI} \
 SRC_URI[md5sum] = "687e1dcd29452789d34eaeea4c25abe4"
 SRC_URI[sha256sum] = "722def46e4a19a5b7a579ef30db1965f86c37c1a20a5f0113743a2e4399f7c99"
 
-DEPENDS_virtclass-native = "gettext-native"
+DEPENDS_virtclass-native = "gettext-minimal-native"
 SRC_URI_virtclass-native = "${BASE_SRC_URI}"
 
 inherit autotools gettext
meta/recipes-support/attr/ea-acl.inc +1 -0
index 6a45858..ce98a95 100644
@@ -9,6 +9,7 @@ inherit autotools gettext
 # overwritten by autoheader
 export AUTOHEADER = "true"
 EXTRA_OECONF = "INSTALL_USER=root INSTALL_GROUP=root"
+EXTRA_OECONF_append_virtclass-native = " --enable-gettext=no"
 
 EXTRA_OEMAKE = "PKG_LIB_DIR=${base_libdir} PKG_DEVLIB_DIR=${libdir}"