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 '
19 return deps + 'gnu-config-native '
22 DEPENDS_prepend = "${@autotools_dep_prepend(d)}"
24 EXTRA_AUTORECONF = "--exclude=autopoint"
26 def autotools_set_crosscompiling(d):
28 if not bb.data.inherits_class('native', d):
29 return " cross_compiling=yes"
32 # EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
35 if [ -x ${S}/configure ] ; then
36 cfgcmd="${S}/configure \
37 --build=${BUILD_SYS} \
39 --target=${TARGET_SYS} \
41 --exec_prefix=${exec_prefix} \
43 --sbindir=${sbindir} \
44 --libexecdir=${libexecdir} \
45 --datadir=${datadir} \
46 --sysconfdir=${sysconfdir} \
47 --sharedstatedir=${sharedstatedir} \
48 --localstatedir=${localstatedir} \
50 --includedir=${includedir} \
51 --oldincludedir=${oldincludedir} \
52 --infodir=${infodir} \
56 oenote "Running $cfgcmd..."
57 $cfgcmd || oefatal "oe_runconf failed"
59 oefatal "no configure script found"
63 autotools_do_configure() {
70 # WARNING: gross hack follows:
71 # An autotools built package generally needs these scripts, however only
72 # automake or libtoolize actually install the current versions of them.
73 # This is a problem in builds that do not use libtool or automake, in the case
74 # where we -need- the latest version of these scripts. e.g. running a build
75 # for a package whose autotools are old, on an x86_64 machine, which the old
76 # config.sub does not support. Work around this by installing them manually
78 ( for ac in `find ${S} -name configure.in -o -name configure.ac`; do
79 rm -f `dirname $ac`/configure
81 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
84 if [ x"${acpaths}" = xdefault ]; then
86 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
87 grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
88 acpaths="$acpaths -I $i"
93 AUTOV=`automake --version |head -n 1 |sed "s/.* //;s/\.[0-9]\+$//"`
95 echo "AUTOV is $AUTOV"
96 install -d ${STAGING_DIR}/${HOST_SYS}/share/aclocal
97 install -d ${STAGING_DIR}/${HOST_SYS}/share/aclocal-$AUTOV
98 acpaths="$acpaths -I ${STAGING_DIR}/${HOST_SYS}/share/aclocal-$AUTOV -I ${STAGING_DIR}/${HOST_SYS}/share/aclocal"
99 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
100 # like it was auto-generated. Work around this by blowing it away
101 # by hand, unless the package specifically asked not to run aclocal.
102 if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
105 if [ -e configure.in ]; then
106 CONFIGURE_AC=configure.in
108 CONFIGURE_AC=configure.ac
110 if grep "^AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
111 if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
112 : do nothing -- we still have an old unmodified configure.ac
114 oenote Executing glib-gettextize --force --copy
115 echo "no" | glib-gettextize --force --copy
118 if grep "^AC_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
119 oenote Executing intltoolize --copy --force --automake
120 intltoolize --copy --force --automake
122 oenote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
124 autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || oefatal "autoreconf execution failed."
129 if [ -e ${S}/configure ]; then
132 oenote "nothing to configure"
136 autotools_do_install() {
137 oe_runmake 'DESTDIR=${D}' install
140 STAGE_TEMP="${WORKDIR}/temp-staging"
142 autotools_stage_includes() {
143 if [ "${INHIBIT_AUTO_STAGE_INCLUDES}" != "1" ]
146 mkdir -p ${STAGE_TEMP}
147 make DESTDIR="${STAGE_TEMP}" install
148 cp -pPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
153 autotools_stage_all() {
154 if [ "${INHIBIT_AUTO_STAGE}" = "1" ]
159 mkdir -p ${STAGE_TEMP}
160 oe_runmake DESTDIR="${STAGE_TEMP}" install
161 if [ -d ${STAGE_TEMP}/${includedir} ]; then
162 cp -fpPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
164 if [ -d ${STAGE_TEMP}/${libdir} ]
166 for i in ${STAGE_TEMP}/${libdir}/*.la
168 if [ ! -f "$i" ]; then
169 cp -fpPR ${STAGE_TEMP}/${libdir}/* ${STAGING_LIBDIR}
172 oe_libinstall -so $(basename $i .la) ${STAGING_LIBDIR}
175 if [ -d ${STAGE_TEMP}/${datadir}/aclocal ]; then
176 install -d ${STAGING_DATADIR}/aclocal
177 cp -fpPR ${STAGE_TEMP}/${datadir}/aclocal/* ${STAGING_DATADIR}/aclocal
182 EXPORT_FUNCTIONS do_configure do_install