[oe-commits] Chris Larson : autotools: split out a oe_autoreconf function

git version control git at git.openembedded.org
Wed Feb 16 22:06:09 UTC 2011


Module: openembedded.git
Branch: master
Commit: 80549f1f6f33061a73b386e1fcb2c4e3e25ae362
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=80549f1f6f33061a73b386e1fcb2c4e3e25ae362

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

autotools: split out a oe_autoreconf function

This functionality logically belongs in its own function, and it makes it
easier to explicitly run against subdirs in certain cases.

Signed-off-by: Chris Larson <chris_larson at mentor.com>
Acked-by: Khem Raj <raj.khem at gmail.com>

---

 classes/autotools.bbclass |   96 +++++++++++++++++++++++---------------------
 1 files changed, 50 insertions(+), 46 deletions(-)

diff --git a/classes/autotools.bbclass b/classes/autotools.bbclass
index 4d7a66b..9744589 100644
--- a/classes/autotools.bbclass
+++ b/classes/autotools.bbclass
@@ -108,6 +108,55 @@ oe_runconf () {
 	fi
 }
 
+oe_autoreconf () {
+	if [ x"${acpaths}" = xdefault ]; then
+		acpaths=
+		for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
+			grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
+			acpaths="$acpaths -I $i"
+		done
+	else
+		acpaths="${acpaths}"
+	fi
+	AUTOV=`automake --version | head -n 1 | sed "s/.* //;s/\.[0-9]\+$//"`
+	install -d ${STAGING_DATADIR}/aclocal
+	install -d ${STAGING_DATADIR}/aclocal-$AUTOV
+	acpaths="$acpaths -I${STAGING_DATADIR}/aclocal-$AUTOV -I ${STAGING_DATADIR}/aclocal"
+	# autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
+	# like it was auto-generated.  Work around this by blowing it away
+	# by hand, unless the package specifically asked not to run aclocal.
+	if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
+		rm -f aclocal.m4
+	fi
+	if [ -e configure.in ]; then
+		CONFIGURE_AC=configure.in
+	else
+		CONFIGURE_AC=configure.ac
+	fi
+	if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
+		if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
+			: do nothing -- we still have an old unmodified configure.ac
+		else
+			echo "no" | glib-gettextize --force --copy
+		fi
+	else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
+		if [ -e ${STAGING_DATADIR}/gettext/config.rpath ]; then
+			cp ${STAGING_DATADIR}/gettext/config.rpath ${S}/
+		else
+			oenote ${STAGING_DATADIR}/gettext/config.rpath not found. gettext is not installed.
+		fi
+	fi
+
+	fi
+	for aux in m4 `sed -n -e '/^[[:space:]]*AC_CONFIG_MACRO_DIR/s|[^(]*([[]*\([^])]*\)[]]*)|\1|p' $CONFIGURE_AC`; do
+		mkdir -p ${aux}
+	done
+	autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || oefatal "autoreconf execution failed."
+	if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
+		intltoolize --copy --force --automake
+	fi
+}
+
 autotools_do_configure() {
 	case ${PN} in
 	autoconf*|automake*)
@@ -120,52 +169,7 @@ autotools_do_configure() {
 		if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
 			olddir=`pwd`
 			cd ${S}
-			if [ x"${acpaths}" = xdefault ]; then
-				acpaths=
-				for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
-					grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
-					acpaths="$acpaths -I $i"
-				done
-			else
-				acpaths="${acpaths}"
-			fi
-			AUTOV=`automake --version | head -n 1 | sed "s/.* //;s/\.[0-9]\+$//"`
-			install -d ${STAGING_DATADIR}/aclocal
-			install -d ${STAGING_DATADIR}/aclocal-$AUTOV
-			acpaths="$acpaths -I${STAGING_DATADIR}/aclocal-$AUTOV -I ${STAGING_DATADIR}/aclocal"
-			# autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
-			# like it was auto-generated.  Work around this by blowing it away
-			# by hand, unless the package specifically asked not to run aclocal.
-			if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
-				rm -f aclocal.m4
-			fi
-			if [ -e configure.in ]; then
-				CONFIGURE_AC=configure.in
-			else
-				CONFIGURE_AC=configure.ac
-			fi
-			if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
-				if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
-					: do nothing -- we still have an old unmodified configure.ac
-				else
-					echo "no" | glib-gettextize --force --copy
-				fi
-			else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
-				if [ -e ${STAGING_DATADIR}/gettext/config.rpath ]; then
-					cp ${STAGING_DATADIR}/gettext/config.rpath ${S}/
-				else
-					oenote ${STAGING_DATADIR}/gettext/config.rpath not found. gettext is not installed.
-				fi
-			fi
-
-			fi
-			for aux in m4 `sed -n -e '/^[[:space:]]*AC_CONFIG_MACRO_DIR/s|[^(]*([[]*\([^])]*\)[]]*)|\1|p' $CONFIGURE_AC`; do
-				mkdir -p ${aux}
-			done
-			autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || oefatal "autoreconf execution failed."
-			if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
-				intltoolize --copy --force --automake
-			fi
+			oe_autoreconf
 			cd $olddir
 		fi
 	;;





More information about the Openembedded-commits mailing list