3 def autotools_dep_prepend(d):
5 pn = oe.data.getVar('PN', d, 1)
8 if pn in ['autoconf-native', 'automake-native']:
10 deps += 'autoconf-native automake-native '
12 if not pn in ['libtool', 'libtool-native', 'libtool-cross']:
13 deps += 'libtool-native '
15 return deps + 'gnu-config-native '
18 DEPENDS_prepend = "${@autotools_dep_prepend(d)}"
20 EXTRA_AUTORECONF = "--exclude=autopoint"
22 def autotools_set_crosscompiling(d):
24 if not oe.data.inherits_class('native', d):
25 return " cross_compiling=yes"
28 # EXTRA_OECONF_append = "${@autotools_set_crosscompiling(d)}"
31 if [ -x ${S}/configure ] ; then
32 cfgcmd="${S}/configure \
33 --build=${BUILD_SYS} \
35 --target=${TARGET_SYS} \
37 --exec_prefix=${exec_prefix} \
39 --sbindir=${sbindir} \
40 --libexecdir=${libexecdir} \
41 --datadir=${datadir} \
42 --sysconfdir=${sysconfdir} \
43 --sharedstatedir=${sharedstatedir} \
44 --localstatedir=${localstatedir} \
46 --includedir=${includedir} \
47 --oldincludedir=${oldincludedir} \
48 --infodir=${infodir} \
52 oenote "Running $cfgcmd..."
53 $cfgcmd || oefatal "oe_runconf failed"
55 oefatal "no configure script found"
59 autotools_do_configure() {
66 # WARNING: gross hack follows:
67 # An autotools built package generally needs these scripts, however only
68 # automake or libtoolize actually install the current versions of them.
69 # This is a problem in builds that do not use libtool or automake, in the case
70 # where we -need- the latest version of these scripts. e.g. running a build
71 # for a package whose autotools are old, on an x86_64 machine, which the old
72 # config.sub does not support. Work around this by installing them manually
74 ( for ac in `find ${S} -name configure.in -o -name configure.ac`; do
75 rm -f `dirname $ac`/configure
77 if [ -e ${S}/configure.in -o -e ${S}/configure.ac ]; then
80 if [ x"${acpaths}" = xdefault ]; then
82 for i in `find ${S} -maxdepth 2 -name \*.m4|grep -v 'aclocal.m4'| \
83 grep -v 'acinclude.m4' | sed -e 's,\(.*/\).*$,\1,'|sort -u`; do
84 acpaths="$acpaths -I $i"
89 install -d ${STAGING_DIR}/${HOST_SYS}/share/aclocal
90 acpaths="$acpaths -I ${STAGING_DIR}/${HOST_SYS}/share/aclocal"
91 # autoreconf is too shy to overwrite aclocal.m4 if it doesn't look
92 # like it was auto-generated. Work around this by blowing it away
93 # by hand, unless the package specifically asked not to run aclocal.
94 if ! echo ${EXTRA_AUTORECONF} | grep -q "aclocal"; then
97 if [ -e configure.in ]; then
98 CONFIGURE_AC=configure.in
100 CONFIGURE_AC=configure.ac
102 if grep "^AM_GLIB_GNU_GETTEXT" $CONFIGURE_AC >/dev/null; then
103 if grep "sed.*POTFILES" configure.ac >/dev/null; then
104 : do nothing -- we still have an old unmodified configure.ac
106 oenote Executing glib-gettextize --force --copy
107 echo "no" | glib-gettextize --force --copy
110 if grep "^AC_PROG_INTLTOOL" $CONFIGURE_AC >/dev/null; then
111 oenote Executing intltoolize --copy --force --automake
112 intltoolize --copy --force --automake
114 oenote Executing autoreconf --verbose --install --force ${EXTRA_AUTORECONF} $acpaths
116 autoreconf -Wcross --verbose --install --force ${EXTRA_AUTORECONF} $acpaths || oefatal "autoreconf execution failed."
121 if [ -e ${S}/configure ]; then
124 oenote "nothing to configure"
128 autotools_do_install() {
129 oe_runmake 'DESTDIR=${D}' install
132 STAGE_TEMP="${WORKDIR}/temp-staging"
134 autotools_stage_includes() {
136 mkdir -p ${STAGE_TEMP}
137 make DESTDIR="${STAGE_TEMP}" install
138 cp -a ${STAGE_TEMP}/${includedir}/* ${STAGING_INCDIR}
142 EXPORT_FUNCTIONS do_configure do_install