summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/autotools.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe/autotools.bbclass')
-rw-r--r--meta/classes-recipe/autotools.bbclass62
1 files changed, 14 insertions, 48 deletions
diff --git a/meta/classes-recipe/autotools.bbclass b/meta/classes-recipe/autotools.bbclass
index 9359c9b4e1..948f8c183a 100644
--- a/meta/classes-recipe/autotools.bbclass
+++ b/meta/classes-recipe/autotools.bbclass
@@ -36,7 +36,6 @@ inherit siteinfo
36# the contents of the sysroot. 36# the contents of the sysroot.
37export CONFIG_SITE 37export CONFIG_SITE
38 38
39acpaths ?= "default"
40EXTRA_AUTORECONF += "--exclude=autopoint" 39EXTRA_AUTORECONF += "--exclude=autopoint"
41 40
42export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}" 41export lt_cv_sys_lib_dlsearch_path_spec = "${libdir} ${base_libdir}"
@@ -52,17 +51,11 @@ export CC_FOR_BUILD = "${BUILD_CC}"
52export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}" 51export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
53 52
54export CXX_FOR_BUILD = "${BUILD_CXX}" 53export CXX_FOR_BUILD = "${BUILD_CXX}"
55export CXXFLAGS_FOR_BUILD="${BUILD_CXXFLAGS}" 54export CXXFLAGS_FOR_BUILD = "${BUILD_CXXFLAGS}"
56 55
57export LD_FOR_BUILD = "${BUILD_LD}" 56export LD_FOR_BUILD = "${BUILD_LD}"
58export LDFLAGS_FOR_BUILD = "${BUILD_LDFLAGS}" 57export LDFLAGS_FOR_BUILD = "${BUILD_LDFLAGS}"
59 58
60def append_libtool_sysroot(d):
61 # Only supply libtool sysroot option for non-native packages
62 if not bb.data.inherits_class('native', d):
63 return '--with-libtool-sysroot=${STAGING_DIR_HOST}'
64 return ""
65
66CONFIGUREOPTS = " --build=${BUILD_SYS} \ 59CONFIGUREOPTS = " --build=${BUILD_SYS} \
67 --host=${HOST_SYS} \ 60 --host=${HOST_SYS} \
68 --target=${TARGET_SYS} \ 61 --target=${TARGET_SYS} \
@@ -81,8 +74,7 @@ CONFIGUREOPTS = " --build=${BUILD_SYS} \
81 --infodir=${infodir} \ 74 --infodir=${infodir} \
82 --mandir=${mandir} \ 75 --mandir=${mandir} \
83 --disable-silent-rules \ 76 --disable-silent-rules \
84 ${CONFIGUREOPT_DEPTRACK} \ 77 ${CONFIGUREOPT_DEPTRACK}"
85 ${@append_libtool_sysroot(d)}"
86CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking" 78CONFIGUREOPT_DEPTRACK ?= "--disable-dependency-tracking"
87 79
88CACHED_CONFIGUREVARS ?= "" 80CACHED_CONFIGUREVARS ?= ""
@@ -141,17 +133,11 @@ EXTRACONFFUNCS ??= ""
141 133
142EXTRA_OECONF:append = " ${PACKAGECONFIG_CONFARGS}" 134EXTRA_OECONF:append = " ${PACKAGECONFIG_CONFARGS}"
143 135
144do_configure[prefuncs] += "autotools_preconfigure autotools_aclocals ${EXTRACONFFUNCS}" 136do_configure[prefuncs] += "autotools_preconfigure autotools_sitefiles ${EXTRACONFFUNCS}"
145do_compile[prefuncs] += "autotools_aclocals"
146do_install[prefuncs] += "autotools_aclocals"
147do_configure[postfuncs] += "autotools_postconfigure" 137do_configure[postfuncs] += "autotools_postconfigure"
148 138
149ACLOCALDIR = "${STAGING_DATADIR}/aclocal" 139# Tell autoconf to load the site defaults from siteinfo
150ACLOCALEXTRAPATH = "" 140python autotools_sitefiles () {
151ACLOCALEXTRAPATH:class-target = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
152ACLOCALEXTRAPATH:class-nativesdk = " -I ${STAGING_DATADIR_NATIVE}/aclocal/"
153
154python autotools_aclocals () {
155 sitefiles, searched = siteinfo_get_files(d, sysrootcache=True) 141 sitefiles, searched = siteinfo_get_files(d, sysrootcache=True)
156 d.setVar("CONFIG_SITE", " ".join(sitefiles)) 142 d.setVar("CONFIG_SITE", " ".join(sitefiles))
157} 143}
@@ -178,28 +164,13 @@ autotools_do_configure() {
178 if [ -e ${AUTOTOOLS_SCRIPT_PATH}/configure.in -o -e ${AUTOTOOLS_SCRIPT_PATH}/configure.ac ]; then 164 if [ -e ${AUTOTOOLS_SCRIPT_PATH}/configure.in -o -e ${AUTOTOOLS_SCRIPT_PATH}/configure.ac ]; then
179 olddir=`pwd` 165 olddir=`pwd`
180 cd ${AUTOTOOLS_SCRIPT_PATH} 166 cd ${AUTOTOOLS_SCRIPT_PATH}
181 mkdir -p ${ACLOCALDIR} 167 # aclocal looks in the native sysroot by default, so tell it to also look in the target sysroot.
182 ACLOCAL="aclocal --system-acdir=${ACLOCALDIR}/" 168 ACLOCAL="aclocal --aclocal-path=${STAGING_DATADIR}/aclocal/"
183 if [ x"${acpaths}" = xdefault ]; then
184 acpaths=
185 for i in `find ${AUTOTOOLS_SCRIPT_PATH} -ignore_readdir_race -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
186 grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
187 acpaths="$acpaths -I $i"
188 done
189 else
190 acpaths="${acpaths}"
191 fi
192 acpaths="$acpaths ${ACLOCALEXTRAPATH}"
193 AUTOV=`automake --version | sed -e '1{s/.* //;s/\.[0-9]\+$//};q'`
194 automake --version
195 echo "AUTOV is $AUTOV"
196 if [ -d ${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV ]; then
197 ACLOCAL="$ACLOCAL --automake-acdir=${STAGING_DATADIR_NATIVE}/aclocal-$AUTOV"
198 fi
199 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look 169 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
200 # like it was auto-generated. Work around this by blowing it away 170 # like it was auto-generated. Work around this by blowing it away
201 # by hand, unless the package specifically asked not to run aclocal. 171 # by hand, unless the package specifically asked not to run aclocal.
202 if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then 172 if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
173 bbnote Removing existing aclocal.m4
203 rm -f aclocal.m4 174 rm -f aclocal.m4
204 fi 175 fi
205 if [ -e configure.in ]; then 176 if [ -e configure.in ]; then
@@ -219,8 +190,8 @@ autotools_do_configure() {
219 cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/ 190 cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${AUTOTOOLS_AUXDIR}/
220 if [ -d ${S}/po/ ]; then 191 if [ -d ${S}/po/ ]; then
221 cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/ 192 cp -f ${STAGING_DATADIR_NATIVE}/gettext/po/Makefile.in.in ${S}/po/
222 if [ ! -e ${S}/po/remove-potcdate.sin ]; then 193 if [ ! -e ${S}/po/remove-potcdate.sed ]; then
223 cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sin ${S}/po/ 194 cp ${STAGING_DATADIR_NATIVE}/gettext/po/remove-potcdate.sed ${S}/po/
224 fi 195 fi
225 fi 196 fi
226 PRUNE_M4="$PRUNE_M4 gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4" 197 PRUNE_M4="$PRUNE_M4 gettext.m4 iconv.m4 lib-ld.m4 lib-link.m4 lib-prefix.m4 nls.m4 po.m4 progtest.m4"
@@ -231,15 +202,12 @@ autotools_do_configure() {
231 find ${S} -ignore_readdir_race -name $i -delete 202 find ${S} -ignore_readdir_race -name $i -delete
232 done 203 done
233 204
234 bbnote Executing ACLOCAL=\"$ACLOCAL\" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths 205 bbnote Executing ACLOCAL=\"$ACLOCAL\" autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF}
235 ACLOCAL="$ACLOCAL" autoreconf -Wcross -Wno-obsolete --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || die "autoreconf execution failed." 206 ACLOCAL="$ACLOCAL" autoreconf -Wcross -Wno-obsolete --verbose --install --force ${EXTRA_AUTORECONF} || die "autoreconf execution failed."
236 cd $olddir 207 cd $olddir
237 fi 208 fi
238 if [ -e ${CONFIGURE_SCRIPT} ]; then 209
239 oe_runconf 210 oe_runconf
240 else
241 bbnote "nothing to configure"
242 fi
243} 211}
244 212
245autotools_do_compile() { 213autotools_do_compile() {
@@ -254,8 +222,6 @@ autotools_do_install() {
254 fi 222 fi
255} 223}
256 224
257inherit siteconfig
258
259EXPORT_FUNCTIONS do_configure do_compile do_install 225EXPORT_FUNCTIONS do_configure do_compile do_install
260 226
261B = "${WORKDIR}/build" 227B = "${WORKDIR}/build"