1 # use autotools_stage_all for native packages
2 AUTOTOOLS_NATIVE_STAGE_INSTALL = "1"
5 if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1):
8 pn = bb.data.getVar('PN', d, 1)
11 if pn in ['autoconf-native', 'automake-native']:
13 deps += 'autoconf-native automake-native '
15 if not pn in ['libtool', 'libtool-native', 'libtool-cross']:
16 deps += 'libtool-native '
17 if not bb.data.inherits_class('native', d) \
18 and not bb.data.inherits_class('cross', d) \
19 and not bb.data.inherits_class('sdk', d) \
20 and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1):
21 deps += 'libtool-cross '
23 return deps + 'gnu-config-native '
27 DEPENDS_prepend = "${@autotools_deps(d)}"
28 DEPENDS_virtclass-native_prepend = "${@autotools_deps(d)}"
29 DEPENDS_virtclass-nativesdk_prepend = "${@autotools_deps(d)}"
33 # Space separated list of shell scripts with variables defined to supply test
34 # results for autoconf tests we cannot run at build time.
35 export CONFIG_SITE = "${@siteinfo_get_files(d)}"
38 EXTRA_AUTORECONF = "--exclude=autopoint"
40 def autotools_set_crosscompiling(d):
41 if not bb.data.inherits_class('native', d):
42 return " cross_compiling=yes"
45 # EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
47 CONFIGUREOPTS = " --build=${BUILD_SYS} \
49 --target=${TARGET_SYS} \
51 --exec_prefix=${exec_prefix} \
53 --sbindir=${sbindir} \
54 --libexecdir=${libexecdir} \
55 --datadir=${datadir} \
56 --sysconfdir=${sysconfdir} \
57 --sharedstatedir=${sharedstatedir} \
58 --localstatedir=${localstatedir} \
60 --includedir=${includedir} \
61 --oldincludedir=${oldincludedir} \
62 --infodir=${infodir} \
66 if [ -x ${S}/configure ] ; then
67 ${S}/configure ${CONFIGUREOPTS} ${EXTRA_OECONF} "$@"
69 oefatal "no configure script found"
73 autotools_do_configure() {
80 # WARNING: gross hack follows:
81 # An autotools built package generally needs these scripts, however only
82 # automake or libtoolize actually install the current versions of them.
83 # This is a problem in builds that do not use libtool or automake, in the case
84 # where we -need- the latest version of these scripts. e.g. running a build
85 # for a package whose autotools are old, on an x86_64 machine, which the old
86 # config.sub does not support. Work around this by installing them manually
88 ( for ac in `find ${S} -name configure.in -o -name configure.ac`; do
89 rm -f `dirname $ac`/configure
91 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
94 if [ x"${acpaths}" = xdefault ]; then
96 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
97 grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
98 acpaths="$acpaths -I $i"
103 AUTOV=`automake --version |head -n 1 |sed "s/.* //;s/\.[0-9]\+$//"`
105 echo "AUTOV is $AUTOV"
106 install -d ${STAGING_DATADIR}/aclocal
107 install -d ${STAGING_DATADIR}/aclocal-$AUTOV
108 acpaths="$acpaths -I${STAGING_DATADIR}/aclocal-$AUTOV -I ${STAGING_DATADIR}/aclocal"
109 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
110 # like it was auto-generated. Work around this by blowing it away
111 # by hand, unless the package specifically asked not to run aclocal.
112 if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
115 if [ -e configure.in ]; then
116 CONFIGURE_AC=configure.in
118 CONFIGURE_AC=configure.ac
120 if grep "^[[:space:]]*AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
121 if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
122 : do nothing -- we still have an old unmodified configure.ac
124 oenote Executing glib-gettextize --force --copy
125 echo "no" | glib-gettextize --force --copy
127 else if grep "^[[:space:]]*AM_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
128 if [ -e ${STAGING_DATADIR}/gettext/config.rpath ]; then
129 cp ${STAGING_DATADIR}/gettext/config.rpath ${S}/
131 oenote ${STAGING_DATADIR}/gettext/config.rpath not found. gettext is not installed.
137 oenote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
138 autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || oefatal "autoreconf execution failed."
139 if grep "^[[:space:]]*[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
140 oenote Executing intltoolize --copy --force --automake
141 intltoolize --copy --force --automake
147 if [ -e ${S}/configure ]; then
150 oenote "nothing to configure"
154 autotools_do_install() {
155 oe_runmake 'DESTDIR=${D}' install
158 PACKAGE_PREPROCESS_FUNCS += "autotools_prepackage_lamangler"
160 autotools_prepackage_lamangler () {
161 for i in `find ${PKGD} -name "*.la"` ; do \
162 sed -i -e 's:${STAGING_LIBDIR}:${libdir}:g;' \
164 -e 's:-I${WORKDIR}\S*: :g;' \
165 -e 's:-L${WORKDIR}\S*: :g;' \
170 # STAGE_TEMP_PREFIX is used for a speedup by packaged-staging
171 STAGE_TEMP="${WORKDIR}/temp-staging"
172 STAGE_TEMP_PREFIX = ""
174 autotools_stage_includes() {
175 if [ "${INHIBIT_AUTO_STAGE_INCLUDES}" != "1" ]
178 mkdir -p ${STAGE_TEMP}
179 make DESTDIR="${STAGE_TEMP}" install
180 cp -pPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
185 autotools_stage_dir() {
186 sysroot_stage_dir $1 ${STAGE_TEMP_PREFIX}$2
189 autotools_stage_libdir() {
190 sysroot_stage_libdir $1 ${STAGE_TEMP_PREFIX}$2
193 autotools_stage_all() {
194 if [ "${INHIBIT_AUTO_STAGE}" = "1" ]
199 mkdir -p ${STAGE_TEMP}
200 oe_runmake DESTDIR="${STAGE_TEMP}" install
201 rm -rf ${STAGE_TEMP}/${mandir} || true
202 rm -rf ${STAGE_TEMP}/${infodir} || true
203 sysroot_stage_dirs ${STAGE_TEMP} ${STAGE_TEMP_PREFIX}
207 EXPORT_FUNCTIONS do_configure do_install