[oe-commits] Chris Larson : autotools: split out configure from autoreconf bits

git version control git at git.openembedded.org
Fri Oct 22 03:31:00 UTC 2010


Module: openembedded.git
Branch: kergoth/autotools
Commit: 6c5a0efd7b31ca0b0dc85f07ad5c6ac0124a0a43
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=6c5a0efd7b31ca0b0dc85f07ad5c6ac0124a0a43

Author: Chris Larson <chris_larson at mentor.com>
Date:   Tue Oct 19 18:04:47 2010 -0700

autotools: split out configure from autoreconf bits

Signed-off-by: Chris Larson <chris_larson at mentor.com>

---

 classes/autotools.bbclass      |  123 +---------------------------------------
 classes/autotools_base.bbclass |  116 +++++++++++++++++++++++++++++++++++++
 2 files changed, 119 insertions(+), 120 deletions(-)

diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass
index a634201..79ac08e 100644
--- a/classes/autotools.bbclass
+++ b/classes/autotools.bbclass
@@ -1,5 +1,4 @@
-# use autotools_stage_all for native packages
-AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
+inherit autotools_base
 
 def autotools_deps(d):
 	if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1):
@@ -22,72 +21,13 @@ def autotools_deps(d):
 
 	return deps + 'gnu-config-native '
 
-EXTRA_OEMAKE = ""
-
 DEPENDS_prepend = "${@autotools_deps(d)}"
 DEPENDS_virtclass-native_prepend = "${@autotools_deps(d)}"
 DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d)}"
 
-inherit siteinfo
-
-def _autotools_get_sitefiles(d):
-    def inherits(d, *classes):
-        if any(bb.data.inherits_class(cls, d) for cls in classes):
-            return True
-
-    if inherits(d, "native", "nativesdk"):
-        return
-
-    sitedata = siteinfo_data(d)
-    for path in d.getVar("BBPATH", True).split(":"):
-        for element in sitedata:
-            filename = os.path.join(path, "site", element)
-            if os.path.exists(filename):
-                yield filename
-
-# Space separated list of shell scripts with variables defined to supply test
-# results for autoconf tests we cannot run at build time.
-export CONFIG_SITE = "${@' '.join(_autotools_get_sitefiles(d))}"
-
 acpaths = "default"
 EXTRA_AUTORECONF = "--exclude=autopoint"
 
-def autotools_set_crosscompiling(d):
-	if not bb.data.inherits_class('native', d):
-		return " cross_compiling=yes"
-	return ""
-
-# EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
-
-CONFIGUREOPTS = " --build=${BUILD_SYS} \
-		  --host=${HOST_SYS} \
-		  --target=${TARGET_SYS} \
-		  --prefix=${prefix} \
-		  --exec_prefix=${exec_prefix} \
-		  --bindir=${bindir} \
-		  --sbindir=${sbindir} \
-		  --libexecdir=${libexecdir} \
-		  --datadir=${datadir} \
-		  --sysconfdir=${sysconfdir} \
-		  --sharedstatedir=${sharedstatedir} \
-		  --localstatedir=${localstatedir} \
-		  --libdir=${libdir} \
-		  --includedir=${includedir} \
-		  --oldincludedir=${oldincludedir} \
-		  --infodir=${infodir} \
-		  --mandir=${mandir} \
-		  ${@["","--with-sysroot"][bb.data.getVar('LIBTOOL_HAS_SYSROOT', d, 1) == "yes"]} \
-		"
-
-oe_runconf () {
-	if [ -x ${S}/configure ] ; then
-		${S}/configure \
-		${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"
-	else
-		oefatal "no configure script found"
-	fi
-}
-
 autotools_do_configure() {
 	case ${PN} in
 	autoconf*)
@@ -162,64 +102,7 @@ autotools_do_configure() {
 		fi
 	;;
 	esac
-	if [ -e ${S}/configure ]; then
-		oe_runconf $@
-	else
-		oenote "nothing to configure"
-	fi
-}
-
-autotools_do_install() {
-	oe_runmake 'DESTDIR=${D}' install
+	autotools_base_do_configure
 }
 
-PACKAGE_PREPROCESS_FUNCS += "${@['autotools_prepackage_lamangler',''][bb.data.getVar('LIBTOOL_HAS_SYSROOT', d, 1) == "yes"]}"
-autotools_prepackage_lamangler () {
-        for i in `find ${PKGD} -name "*.la"` ; do \
-            sed -i -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
-                   -e 's:${D}::g;' \
-                   -e 's:-I${WORKDIR}\S*: :g;' \
-                   -e 's:-L${WORKDIR}\S*: :g;' \
-                   $i
-	done
-}
-
-# STAGE_TEMP_PREFIX is used for a speedup by packaged-staging
-STAGE_TEMP="${WORKDIR}/temp-staging"
-STAGE_TEMP_PREFIX = ""
-
-autotools_stage_includes() {
-	if [ "${INHIBIT_AUTO_STAGE_INCLUDES}" != "1" ]
-	then
-		rm -rf ${STAGE_TEMP}
-		mkdir -p ${STAGE_TEMP}
-		make DESTDIR="${STAGE_TEMP}" install
-		cp -pPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
-		rm -rf ${STAGE_TEMP}
-	fi
-}
-
-autotools_stage_dir() {
- 	sysroot_stage_dir $1 ${STAGE_TEMP_PREFIX}$2
-}
-
-autotools_stage_libdir() {
-	sysroot_stage_libdir $1 ${STAGE_TEMP_PREFIX}$2
-}
-
-autotools_stage_all() {
-	if [ "${INHIBIT_AUTO_STAGE}" = "1" ]
-	then
-		return
-	fi
-	rm -rf ${STAGE_TEMP}
-	mkdir -p ${STAGE_TEMP}
-	oe_runmake DESTDIR="${STAGE_TEMP}" install
-	rm -rf ${STAGE_TEMP}/${mandir} || true
-	rm -rf ${STAGE_TEMP}/${infodir} || true
-	sysroot_stage_dirs ${STAGE_TEMP} ${STAGE_TEMP_PREFIX}
-	rm -rf ${STAGE_TEMP}
-}
-
-EXPORT_FUNCTIONS do_configure do_install
-
+EXPORT_FUNCTIONS do_configure
diff --git a/classes/autotools_base.bbclass b/classes/autotools_base.bbclass
new file mode 100755
index 0000000..d2e3f5c
--- /dev/null
+++ b/classes/autotools_base.bbclass
@@ -0,0 +1,116 @@
+# use autotools_stage_all for native packages
+AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
+
+EXTRA_OEMAKE = ""
+
+inherit siteinfo
+
+def _autotools_get_sitefiles(d):
+    def inherits(d, *classes):
+        if any(bb.data.inherits_class(cls, d) for cls in classes):
+            return True
+
+    if inherits(d, "native", "nativesdk"):
+        return
+
+    sitedata = siteinfo_data(d)
+    for path in d.getVar("BBPATH", True).split(":"):
+        for element in sitedata:
+            filename = os.path.join(path, "site", element)
+            if os.path.exists(filename):
+                yield filename
+
+# Space separated list of shell scripts with variables defined to supply test
+# results for autoconf tests we cannot run at build time.
+export CONFIG_SITE = "${@' '.join(_autotools_get_sitefiles(d))}"
+
+CONFIGUREOPTS = " --build=${BUILD_SYS} \
+		  --host=${HOST_SYS} \
+		  --target=${TARGET_SYS} \
+		  --prefix=${prefix} \
+		  --exec_prefix=${exec_prefix} \
+		  --bindir=${bindir} \
+		  --sbindir=${sbindir} \
+		  --libexecdir=${libexecdir} \
+		  --datadir=${datadir} \
+		  --sysconfdir=${sysconfdir} \
+		  --sharedstatedir=${sharedstatedir} \
+		  --localstatedir=${localstatedir} \
+		  --libdir=${libdir} \
+		  --includedir=${includedir} \
+		  --oldincludedir=${oldincludedir} \
+		  --infodir=${infodir} \
+		  --mandir=${mandir} \
+		  ${@['','--with-sysroot'][bb.data.getVar('LIBTOOL_HAS_SYSROOT', d, 1) == 'yes']} \
+		"
+
+oe_runconf () {
+	if [ -x ${S}/configure ] ; then
+		${S}/configure \
+		${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"
+	else
+		oefatal "no configure script found"
+	fi
+}
+
+autotools_base_do_configure () {
+	if [ -e ${S}/configure ]; then
+		oe_runconf $@
+	else
+		oenote "nothing to configure"
+	fi
+}
+
+autotools_base_do_install() {
+	oe_runmake 'DESTDIR=${D}' install
+}
+
+EXPORT_FUNCTIONS do_configure do_install
+
+PACKAGE_PREPROCESS_FUNCS += "${@['autotools_prepackage_lamangler',''][bb.data.getVar('LIBTOOL_HAS_SYSROOT', d, 1) == "yes"]}"
+autotools_prepackage_lamangler () {
+        for i in `find ${PKGD} -name "*.la"` ; do \
+            sed -i -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
+                   -e 's:${D}::g;' \
+                   -e 's:-I${WORKDIR}\S*: :g;' \
+                   -e 's:-L${WORKDIR}\S*: :g;' \
+                   $i
+	done
+}
+
+# STAGE_TEMP_PREFIX is used for a speedup by packaged-staging
+STAGE_TEMP="${WORKDIR}/temp-staging"
+STAGE_TEMP_PREFIX = ""
+
+autotools_stage_includes() {
+	if [ "${INHIBIT_AUTO_STAGE_INCLUDES}" != "1" ]
+	then
+		rm -rf ${STAGE_TEMP}
+		mkdir -p ${STAGE_TEMP}
+		make DESTDIR="${STAGE_TEMP}" install
+		cp -pPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
+		rm -rf ${STAGE_TEMP}
+	fi
+}
+
+autotools_stage_dir() {
+	sysroot_stage_dir $1 ${STAGE_TEMP_PREFIX}$2
+}
+
+autotools_stage_libdir() {
+	sysroot_stage_libdir $1 ${STAGE_TEMP_PREFIX}$2
+}
+
+autotools_stage_all() {
+	if [ "${INHIBIT_AUTO_STAGE}" = "1" ]
+	then
+		return
+	fi
+	rm -rf ${STAGE_TEMP}
+	mkdir -p ${STAGE_TEMP}
+	oe_runmake DESTDIR="${STAGE_TEMP}" install
+	rm -rf ${STAGE_TEMP}/${mandir} || true
+	rm -rf ${STAGE_TEMP}/${infodir} || true
+	sysroot_stage_dirs ${STAGE_TEMP} ${STAGE_TEMP_PREFIX}
+	rm -rf ${STAGE_TEMP}
+}





More information about the Openembedded-commits mailing list