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.inherits_class('sdk', d) \
21 and not bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, 1):
22 deps += 'libtool-cross '
24 return deps + 'gnu-config-native '
27 DEPENDS_prepend = "${@autotools_dep_prepend(d)}"
29 EXTRA_AUTORECONF = "--exclude=autopoint"
31 def autotools_set_crosscompiling(d):
33 if not bb.data.inherits_class('native', d):
34 return " cross_compiling=yes"
37 # EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
40 if [ -x ${S}/configure ] ; then
41 cfgcmd="${S}/configure \
42 --build=${BUILD_SYS} \
44 --target=${TARGET_SYS} \
46 --exec_prefix=${exec_prefix} \
48 --sbindir=${sbindir} \
49 --libexecdir=${libexecdir} \
50 --datadir=${datadir} \
51 --sysconfdir=${sysconfdir} \
52 --sharedstatedir=${sharedstatedir} \
53 --localstatedir=${localstatedir} \
55 --includedir=${includedir} \
56 --oldincludedir=${oldincludedir} \
57 --infodir=${infodir} \
61 oenote "Running $cfgcmd..."
62 $cfgcmd || oefatal "oe_runconf failed"
64 oefatal "no configure script found"
68 autotools_do_configure() {
75 # WARNING: gross hack follows:
76 # An autotools built package generally needs these scripts, however only
77 # automake or libtoolize actually install the current versions of them.
78 # This is a problem in builds that do not use libtool or automake, in the case
79 # where we -need- the latest version of these scripts. e.g. running a build
80 # for a package whose autotools are old, on an x86_64 machine, which the old
81 # config.sub does not support. Work around this by installing them manually
83 ( for ac in `find ${S} -name configure.in -o -name configure.ac`; do
84 rm -f `dirname $ac`/configure
86 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
89 if [ x"${acpaths}" = xdefault ]; then
91 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
92 grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
93 acpaths="$acpaths -I $i"
98 AUTOV=`automake --version |head -n 1 |sed "s/.* //;s/\.[0-9]\+$//"`
100 echo "AUTOV is $AUTOV"
101 install -d ${STAGING_DATADIR}/aclocal
102 install -d ${STAGING_DATADIR}/aclocal-$AUTOV
103 acpaths="$acpaths -I${STAGING_DATADIR}/aclocal-$AUTOV -I ${STAGING_DATADIR}/aclocal"
104 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
105 # like it was auto-generated. Work around this by blowing it away
106 # by hand, unless the package specifically asked not to run aclocal.
107 if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
110 if [ -e configure.in ]; then
111 CONFIGURE_AC=configure.in
113 CONFIGURE_AC=configure.ac
115 if grep "^AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
116 if grep "sed.*POTFILES" $CONFIGURE_AC >/dev/null; then
117 : do nothing -- we still have an old unmodified configure.ac
119 oenote Executing glib-gettextize --force --copy
120 echo "no" | glib-gettextize --force --copy
123 if grep "^[AI][CT]_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
124 oenote Executing intltoolize --copy --force --automake
125 intltoolize --copy --force --automake
127 oenote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
129 autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || oefatal "autoreconf execution failed."
134 if [ -e ${S}/configure ]; then
137 oenote "nothing to configure"
141 autotools_do_install() {
142 oe_runmake 'DESTDIR=${D}' install
144 for i in `find ${D} -name "*.la"` ; do \
145 sed -i -e s:${STAGING_LIBDIR}:${libdir}:g $i
146 sed -i -e s:${D}::g $i
147 sed -i -e 's:-I${WORKDIR}\S*: :g' $i
148 sed -i -e 's:-L${WORKDIR}\S*: :g' $i
152 STAGE_TEMP="${WORKDIR}/temp-staging"
154 autotools_stage_includes() {
155 if [ "${INHIBIT_AUTO_STAGE_INCLUDES}" != "1" ]
158 mkdir -p ${STAGE_TEMP}
159 make DESTDIR="${STAGE_TEMP}" install
160 cp -pPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
165 autotools_stage_all() {
166 if [ "${INHIBIT_AUTO_STAGE}" = "1" ]
171 mkdir -p ${STAGE_TEMP}
172 oe_runmake DESTDIR="${STAGE_TEMP}" install
173 if [ -d ${STAGE_TEMP}/${includedir} ]; then
174 cp -fpPR ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
176 if [ -d ${STAGE_TEMP}/${libdir} ]
178 find ${STAGE_TEMP}/${libdir} -name '*.la' -exec sed -i s,installed=yes,installed=no, {} \;
180 for i in ${STAGE_TEMP}/${libdir}/*.la
182 if [ ! -f "$i" ]; then
183 cp -fpPR ${STAGE_TEMP}/${libdir}/* ${STAGING_LIBDIR}
186 oe_libinstall -so $(basename $i .la) ${STAGING_LIBDIR}
189 if [ -d ${STAGE_TEMP}/${datadir}/aclocal ]; then
190 install -d ${STAGING_DATADIR}/aclocal
191 cp -fpPR ${STAGE_TEMP}/${datadir}/aclocal/* ${STAGING_DATADIR}/aclocal
196 EXPORT_FUNCTIONS do_configure do_install