summaryrefslogtreecommitdiffstats
path: root/meta/classes/autotools.bbclass
diff options
context:
space:
mode:
authorPhil Blundell <philb@gnu.org>2012-09-22 17:18:08 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-09-24 11:30:33 +0100
commit82a99a4cee4c63bafe6335897f2adccb5fe2a7c7 (patch)
tree1d0c8018becdbea7adb930a2df0015ab6b2a5b54 /meta/classes/autotools.bbclass
parent6f32c9ce082ec1b7e84567c32affbf5fdec4f086 (diff)
downloadpoky-82a99a4cee4c63bafe6335897f2adccb5fe2a7c7.tar.gz
autotools: Remove special handling for autoconf* and automake*
For reasons that are now shrouded in obscurity, autotools.bbclass has long contained a special heuristic to avoid attempting to run autoreconf when building autoconf or automake themselves. However, the wildcard test against PN which is used there is problematic when trying to build another package whose name happens to start with "autoconf", and in any case it is silly to do this test at runtime for every package. The individual recipes for autoconf and automake can just as easily suppress the behaviour that they don't want by providing a custom do_configure() method which just runs configure. (From OE-Core rev: a87db6f8dea71cbb7ead9285ff8af0e28cf75604) Signed-off-by: Phil Blundell <pb@pbcl.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/autotools.bbclass')
-rw-r--r--meta/classes/autotools.bbclass158
1 files changed, 75 insertions, 83 deletions
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index a5997c55e0..e4e034b623 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -111,91 +111,83 @@ do_configure[prefuncs] += "autotools_preconfigure"
111do_configure[postfuncs] += "autotools_postconfigure" 111do_configure[postfuncs] += "autotools_postconfigure"
112 112
113autotools_do_configure() { 113autotools_do_configure() {
114 case ${PN} in 114 # WARNING: gross hack follows:
115 autoconf*) 115 # An autotools built package generally needs these scripts, however only
116 ;; 116 # automake or libtoolize actually install the current versions of them.
117 automake*) 117 # This is a problem in builds that do not use libtool or automake, in the case
118 ;; 118 # where we -need- the latest version of these scripts. e.g. running a build
119 *) 119 # for a package whose autotools are old, on an x86_64 machine, which the old
120 # WARNING: gross hack follows: 120 # config.sub does not support. Work around this by installing them manually
121 # An autotools built package generally needs these scripts, however only 121 # regardless.
122 # automake or libtoolize actually install the current versions of them. 122 ( for ac in `find ${S} -name configure.in -o -name configure.ac`; do
123 # This is a problem in builds that do not use libtool or automake, in the case 123 rm -f `dirname $ac`/configure
124 # where we -need- the latest version of these scripts. e.g. running a build 124 done )
125 # for a package whose autotools are old, on an x86_64 machine, which the old 125 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
126 # config.sub does not support. Work around this by installing them manually 126 olddir=`pwd`
127 # regardless. 127 cd ${S}
128 ( for ac in `find ${S} -name configure.in -o -name configure.ac`; do 128 # Remove any previous copy of the m4 macros
129 rm -f `dirname $ac`/configure 129 rm -rf ${B}/aclocal-copy/
130 done ) 130 if [ x"${acpaths}" = xdefault ]; then
131 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then 131 acpaths=
132 olddir=`pwd` 132 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
133 cd ${S} 133 grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
134 # Remove any previous copy of the m4 macros 134 acpaths="$acpaths -I $i"
135 rm -rf ${B}/aclocal-copy/ 135 done
136 if [ x"${acpaths}" = xdefault ]; then 136 else
137 acpaths= 137 acpaths="${acpaths}"
138 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \ 138 fi
139 grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do 139 AUTOV=`automake --version |head -n 1 |sed "s/.* //;s/\.[0-9]\+$//"`
140 acpaths="$acpaths -I $i" 140 automake --version
141 done 141 echo "AUTOV is $AUTOV"
142 else 142 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then
143 acpaths="${acpaths}" 143 acpaths="$acpaths -I${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV"
144 fi 144 fi
145 AUTOV=`automake --version |head -n 1 |sed "s/.* //;s/\.[0-9]\+$//"` 145 # The aclocal directory could get modified by other processes
146 automake --version 146 # uninstalling data from the sysroot. See Yocto #861 for details.
147 echo "AUTOV is $AUTOV" 147 # We avoid this by taking a copy here and then files cannot disappear.
148 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then 148 if [ -d ${STAGING_DATADIR}/aclocal ]; then
149 acpaths="$acpaths -I${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV" 149 # for scratch build this directory can be empty
150 fi 150 # so avoid cp's no files to copy error
151 # The aclocal directory could get modified by other processes 151 cp-noerror ${STAGING_DATADIR}/aclocal ${B}/aclocal-copy/
152 # uninstalling data from the sysroot. See Yocto #861 for details. 152 acpaths="$acpaths -I ${B}/aclocal-copy/"
153 # We avoid this by taking a copy here and then files cannot disappear. 153 fi
154 if [ -d ${STAGING_DATADIR}/aclocal ]; then 154 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
155 # for scratch build this directory can be empty 155 # like it was auto-generated. Work around this by blowing it away
156 # so avoid cp's no files to copy error 156 # by hand, unless the package specifically asked not to run aclocal.
157 cp-noerror ${STAGING_DATADIR}/aclocal ${B}/aclocal-copy/ 157 if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
158 acpaths="$acpaths -I ${B}/aclocal-copy/" 158 rm -f aclocal.m4
159 fi 159 fi
160 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look 160 if [ -e configure.in ]; then
161 # like it was auto-generated. Work around this by blowing it away 161 CONFIGURE_AC=configure.in
162 # by hand, unless the package specifically asked not to run aclocal. 162 else
163 if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then 163 CONFIGURE_AC=configure.ac
164 rm -f aclocal.m4 164 fi
165 fi 165 if ! echo ${EXTRA_OECONF} | grep -q "\-\-disable-nls"; then
166 if [ -e configure.in ]; then 166 if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
167 CONFIGURE_AC=configure.in 167 if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
168 else 168 : do nothing -- we still have an old unmodified configure.ac
169 CONFIGURE_AC=configure.ac 169 else
170 fi 170 bbnote Executing glib-gettextize --force --copy
171 if ! echo ${EXTRA_OECONF} | grep -q "\-\-disable-nls"; then 171 echo "no" | glib-gettextize --force --copy
172 if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then 172 fi
173 if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then 173 else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
174 : do nothing -- we still have an old unmodified configure.ac 174 # We'd call gettextize here if it wasn't so broken...
175 else 175 cp ${STAGING_DATADIR}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
176 bbnote Executing glib-gettextize --force --copy 176 if [ -d ${S}/po/ -a ! -e ${S}/po/Makefile.in.in ]; then
177 echo "no" | glib-gettextize --force --copy 177 cp ${STAGING_DATADIR}/gettext/po/Makefile.in.in ${S}/po/
178 fi 178 fi
179 else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then 179 fi
180 # We'd call gettextize here if it wasn't so broken...
181 cp ${STAGING_DATADIR}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
182 if [ -d ${S}/po/ -a ! -e ${S}/po/Makefile.in.in ]; then
183 cp ${STAGING_DATADIR}/gettext/po/Makefile.in.in ${S}/po/
184 fi
185 fi
186 fi
187 fi
188 mkdir -p m4
189 if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
190 bbnote Executing intltoolize --copy --force --automake
191 intltoolize --copy --force --automake
192 fi 180 fi
193 bbnote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
194 autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || bbfatal "autoreconf execution failed."
195 cd $olddir
196 fi 181 fi
197 ;; 182 mkdir -p m4
198 esac 183 if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
184 bbnote Executing intltoolize --copy --force --automake
185 intltoolize --copy --force --automake
186 fi
187 bbnote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
188 autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || bbfatal "autoreconf execution failed."
189 cd $olddir
190 fi
199 if [ -e ${S}/configure ]; then 191 if [ -e ${S}/configure ]; then
200 oe_runconf 192 oe_runconf
201 else 193 else