Patchwork [1/3] autotools.bbclass: pass distro_imposed_configure_flags

login
register
mail settings
Submitter Bernhard Reutner-Fischer
Date Jan. 12, 2011, 8:15 p.m.
Message ID <1294863352-1486-2-git-send-email-rep.dot.nop@gmail.com>
Download mbox | patch
Permalink /patch/261/
State Accepted
Headers show

Comments

Bernhard Reutner-Fischer - Jan. 12, 2011, 8:15 p.m.
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
 classes/autotools.bbclass |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

Patch

diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass
index 247e21d..77bd37d 100644
--- a/classes/autotools.bbclass
+++ b/classes/autotools.bbclass
@@ -65,6 +65,22 @@  def append_libtool_sysroot(d):
 			return '--with-libtool-sysroot=${STAGING_DIR_HOST}'
 	return ''
 
+def distro_imposed_configure_flags(d):
+	distro_features = bb.data.getVar('DISTRO_FEATURES', d, True) or ""
+	distro_features = distro_features.split()
+	flags = set()
+	features = (('largefile', 'largefile'),
+		('ipv6'     , 'ipv6'),
+		('nls'      , 'nls'))
+
+	for knob, cfgargs in features:
+		if isinstance(cfgargs, basestring):
+			cfgargs = [cfgargs]
+		en_or_dis = knob in distro_features and "enable" or "disable"
+		for flg in cfgargs:
+			flags.add("--%s-%s" % (en_or_dis, flg))
+	return " ".join(flags)
+
 # EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
 
 CONFIGUREOPTS = " --build=${BUILD_SYS} \
@@ -85,6 +101,7 @@  CONFIGUREOPTS = " --build=${BUILD_SYS} \
 		  --infodir=${infodir} \
 		  --mandir=${mandir} \
 		  ${@append_libtool_sysroot(d)} \
+		  ${@distro_imposed_configure_flags(d)} \
 		"
 
 oe_runconf () {