3 def autotools_dep_prepend(d):
6 if bb.data.getVar('INHIBIT_AUTOTOOLS_DEPS', d, 1):
9 pn = bb.data.getVar('PN', d, 1)
12 if pn in ['autoconf-native', 'automake-native']:
14 deps += 'autoconf-native automake-native '
16 if not pn in ['libtool', 'libtool-native', 'libtool-cross']:
17 deps += 'libtool-native '
18 if not bb.data.inherits_class('native', d) \
19 and not bb.data.inherits_class('cross', d) \
20 and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1):
21 deps += 'libtool-cross '
23 return deps + 'gnu-config-native '
26 DEPENDS_prepend = "${@autotools_dep_prepend(d)}"
28 EXTRA_AUTORECONF = "--exclude=autopoint"
30 def autotools_set_crosscompiling(d):
32 if not bb.data.inherits_class('native', d):
33 return " cross_compiling=yes"
36 # EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
39 if [ -x ${S}/configure ] ; then
40 cfgcmd="${S}/configure \
41 --build=${BUILD_SYS} \
43 --target=${TARGET_SYS} \
45 --exec_prefix=${exec_prefix} \
47 --sbindir=${sbindir} \
48 --libexecdir=${libexecdir} \
49 --datadir=${datadir} \
50 --sysconfdir=${sysconfdir} \
51 --sharedstatedir=${sharedstatedir} \
52 --localstatedir=${localstatedir} \
54 --includedir=${includedir} \
55 --oldincludedir=${oldincludedir} \
56 --infodir=${infodir} \
60 oenote "Running $cfgcmd..."
61 $cfgcmd || oefatal "oe_runconf failed"
63 oefatal "no configure script found"
67 autotools_do_configure() {
74 # WARNING: gross hack follows:
75 # An autotools built package generally needs these scripts, however only
76 # automake or libtoolize actually install the current versions of them.
77 # This is a problem in builds that do not use libtool or automake, in the case
78 # where we -need- the latest version of these scripts. e.g. running a build
79 # for a package whose autotools are old, on an x86_64 machine, which the old
80 # config.sub does not support. Work around this by installing them manually
82 ( for ac in `find ${S} -name configure.in -o -name configure.ac`; do
83 rm -f `dirname $ac`/configure
85 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
88 if [ x"${acpaths}" = xdefault ]; then
90 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
91 grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
92 acpaths="$acpaths -I $i"
97 AUTOV=`automake --version |head -n 1 |sed "s/.* //;s/\.[0-9]\+$//"`
99 echo "AUTOV is $AUTOV"
100 install -d ${STAGING_DIR}/${HOST_SYS}/share/aclocal
101 install -d ${STAGING_DIR}/${HOST_SYS}/share/aclocal-$AUTOV
102 acpaths="$acpaths -I ${STAGING_DIR}/${HOST_SYS}/share/aclocal-$AUTOV -I ${STAGING_DIR}/${HOST_SYS}/share/aclocal"
103 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
104 # like it was auto-generated. Work around this by blowing it away
105 # by hand, unless the package specifically asked not to run aclocal.
106 if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
109 if [ -e configure.in ]; then
110 CONFIGURE_AC=configure.in
112 CONFIGURE_AC=configure.ac
114 if grep "^AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
115 if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
116 : do nothing -- we still have an old unmodified configure.ac
118 oenote Executing glib-gettextize --force --copy
119 echo "no" | glib-gettextize --force --copy
122 if grep "^[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
123 oenote Executing intltoolize --copy --force --automake
124 intltoolize --copy --force --automake
126 oenote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
128 autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || oefatal "autoreconf execution failed."
133 if [ -e ${S}/configure ]; then
136 oenote "nothing to configure"
140 autotools_do_install() {
141 oe_runmake 'DESTDIR=${D}' install
144 STAGE_TEMP="${WORKDIR}/temp-staging"
146 autotools_stage_includes() {
147 if [ "${INHIBIT_AUTO_STAGE_INCLUDES}" != "1" ]
150 mkdir -p ${STAGE_TEMP}
151 make DESTDIR="${STAGE_TEMP}" install
152 cp -pPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
157 autotools_stage_all() {
158 if [ "${INHIBIT_AUTO_STAGE}" = "1" ]
163 mkdir -p ${STAGE_TEMP}
164 oe_runmake DESTDIR="${STAGE_TEMP}" install
165 if [ -d ${STAGE_TEMP}/${includedir} ]; then
166 cp -fpPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
168 if [ -d ${STAGE_TEMP}/${libdir} ]
170 for i in ${STAGE_TEMP}/${libdir}/*.la
172 if [ ! -f "$i" ]; then
173 cp -fpPR ${STAGE_TEMP}/${libdir}/* ${STAGING_LIBDIR}
176 oe_libinstall -so $(basename $i .la) ${STAGING_LIBDIR}
179 if [ -d ${STAGE_TEMP}/${datadir}/aclocal ]; then
180 install -d ${STAGING_DATADIR}/aclocal
181 cp -fpPR ${STAGE_TEMP}/${datadir}/aclocal/* ${STAGING_DATADIR}/aclocal
186 EXPORT_FUNCTIONS do_configure do_install